← Back to Realms

Realm

gno.land/r/moul/x/upgrade/schema/impl/bad/v0

Overview

Realm Path
gno.land/r/moul/x/upgrade/schema/impl/bad/v0
Exported Functions
1
State Entries
3
Source Files
2
Total Package Entries
5

Exported Functions

1 exported function

State

3 state entries

Source Code

FILES
bad.gno
go
1// Package bad is the handler realm that exists to be refused (pattern G; see
2// ../../README.md).
3//
4// It satisfies facade.Handler exactly as well as the others do: same methods,
5// same signatures, compiles and proposes itself without complaint. What it does
6// is drop the "upper" verb and change "repeat" to take one argument instead of
7// two, both of which break a caller already compiled against v0.
8//
9// Nothing in gno's type system can see that. A Go interface says what methods
10// exist, not which verbs the data behind them still answers, which is the whole
11// argument for declaring the API as data and diffing it at accept time.
12package bad
13
14import (
15	facade "gno.land/r/moul/x/upgrade/schema/facade/v0"
16)
17
18// schema drops "upper" entirely and gives "repeat" the wrong arity.
19const schema = `repeat s`
20
21type handler struct{}
22
23func (handler) Schema() string { return schema }
24
25func (handler) Invoke(verb string, args []string) string {
26	return "this handler never gets to run"
27}
28
29// Instance exposes the singleton.
30func Instance() facade.Handler { return handler{} }
31
32// Path is this realm's own package path.
33const Path = "gno.land/r/moul/x/upgrade/schema/impl/bad/v0"
34
35func init(cur realm) {
36	facade.Propose(cross(cur), Instance())
37}
38

Raw Package Data

Raw JSON data