@agoric/cosmos 0.34.2-dev-7ffae88.0 → 0.34.2-orchestration-dev-096c4e8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/Makefile +7 -0
  2. package/ante/ante.go +6 -5
  3. package/ante/fee.go +8 -7
  4. package/ante/inbound_test.go +3 -2
  5. package/ante/vm_admission.go +2 -1
  6. package/app/app.go +107 -59
  7. package/app/export.go +13 -6
  8. package/cmd/libdaemon/main_test.go +2 -1
  9. package/daemon/cmd/root.go +12 -5
  10. package/e2e_test/Makefile +29 -0
  11. package/e2e_test/README.md +100 -0
  12. package/e2e_test/go.mod +217 -0
  13. package/e2e_test/go.sum +1323 -0
  14. package/e2e_test/ibc_conformance_test.go +56 -0
  15. package/e2e_test/pfm_test.go +613 -0
  16. package/e2e_test/util.go +271 -0
  17. package/git-revision.txt +1 -1
  18. package/go.mod +15 -7
  19. package/go.sum +8 -5
  20. package/package.json +3 -3
  21. package/proto/agoric/vlocalchain/.clang-format +7 -0
  22. package/proto/agoric/vlocalchain/vlocalchain.proto +31 -0
  23. package/vm/action.go +5 -4
  24. package/vm/action_test.go +31 -11
  25. package/vm/controller.go +22 -1
  26. package/vm/server.go +1 -1
  27. package/x/swingset/abci.go +10 -10
  28. package/x/swingset/client/cli/tx.go +4 -0
  29. package/x/swingset/handler.go +2 -1
  30. package/x/swingset/keeper/keeper.go +6 -12
  31. package/x/swingset/keeper/msg_server.go +18 -18
  32. package/x/swingset/keeper/proposal.go +13 -3
  33. package/x/swingset/keeper/querier.go +12 -11
  34. package/x/swingset/keeper/swing_store_exports_handler.go +7 -3
  35. package/x/swingset/proposal_handler.go +2 -1
  36. package/x/swingset/types/expected_keepers.go +3 -2
  37. package/x/swingset/types/msgs.go +25 -24
  38. package/x/swingset/types/params.go +2 -1
  39. package/x/swingset/types/proposal.go +5 -4
  40. package/x/vbank/handler.go +2 -1
  41. package/x/vbank/keeper/querier.go +4 -3
  42. package/x/vbank/vbank.go +3 -3
  43. package/x/vibc/alias.go +3 -0
  44. package/x/vibc/handler.go +16 -9
  45. package/x/vibc/keeper/keeper.go +102 -65
  46. package/x/vibc/keeper/triggers.go +101 -0
  47. package/x/vibc/module.go +4 -2
  48. package/x/vibc/types/expected_keepers.go +13 -0
  49. package/x/vibc/types/ibc_module.go +335 -0
  50. package/x/vibc/types/receiver.go +160 -0
  51. package/x/vlocalchain/alias.go +19 -0
  52. package/x/vlocalchain/handler.go +20 -0
  53. package/x/vlocalchain/keeper/keeper.go +279 -0
  54. package/x/vlocalchain/keeper/keeper_test.go +32 -0
  55. package/x/vlocalchain/types/codec.go +34 -0
  56. package/x/vlocalchain/types/key.go +27 -0
  57. package/x/vlocalchain/types/msgs.go +16 -0
  58. package/x/vlocalchain/types/vlocalchain.pb.go +1072 -0
  59. package/x/vlocalchain/vlocalchain.go +109 -0
  60. package/x/vlocalchain/vlocalchain_test.go +305 -0
  61. package/x/vstorage/handler.go +2 -1
  62. package/x/vstorage/keeper/keeper.go +5 -4
  63. package/x/vstorage/keeper/querier.go +6 -5
  64. package/x/vstorage/keeper/querier_test.go +4 -3
  65. package/proto/agoric/lien/genesis.proto +0 -25
  66. package/proto/agoric/lien/lien.proto +0 -25
  67. package/x/lien/alias.go +0 -17
  68. package/x/lien/genesis.go +0 -58
  69. package/x/lien/genesis_test.go +0 -101
  70. package/x/lien/keeper/account.go +0 -290
  71. package/x/lien/keeper/keeper.go +0 -255
  72. package/x/lien/keeper/keeper_test.go +0 -623
  73. package/x/lien/lien.go +0 -205
  74. package/x/lien/lien_test.go +0 -533
  75. package/x/lien/module.go +0 -115
  76. package/x/lien/spec/01_concepts.md +0 -146
  77. package/x/lien/spec/02_messages.md +0 -96
  78. package/x/lien/types/accountkeeper.go +0 -81
  79. package/x/lien/types/accountstate.go +0 -27
  80. package/x/lien/types/expected_keepers.go +0 -18
  81. package/x/lien/types/genesis.pb.go +0 -567
  82. package/x/lien/types/key.go +0 -25
  83. package/x/lien/types/lien.pb.go +0 -403
  84. package/x/vibc/ibc.go +0 -394
  85. /package/{src/index.cjs → index.cjs} +0 -0
@@ -0,0 +1,335 @@
1
+ package types
2
+
3
+ import (
4
+ sdkioerrors "cosmossdk.io/errors"
5
+ "github.com/Agoric/agoric-sdk/golang/cosmos/vm"
6
+ capability "github.com/cosmos/cosmos-sdk/x/capability/types"
7
+ channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
8
+ porttypes "github.com/cosmos/ibc-go/v6/modules/core/05-port/types"
9
+ host "github.com/cosmos/ibc-go/v6/modules/core/24-host"
10
+ ibckeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper"
11
+
12
+ "github.com/cosmos/ibc-go/v6/modules/core/exported"
13
+
14
+ sdk "github.com/cosmos/cosmos-sdk/types"
15
+ )
16
+
17
+ const (
18
+ // AsyncVersions is a flag that indicates whether the IBC module supports
19
+ // asynchronous versions. If it does, then the VM must supply an empty
20
+ // version string to indicate that the VM explicitly (possibly async)
21
+ // performs the Write* method.
22
+ AsyncVersions = ibckeeper.AsyncVersionNegotiation
23
+ )
24
+
25
+ var (
26
+ _ porttypes.IBCModule = (*IBCModule)(nil)
27
+ )
28
+
29
+ type IBCModuleImpl interface {
30
+ ClaimCapability(ctx sdk.Context, channelCap *capability.Capability, path string) error
31
+ GetChannel(ctx sdk.Context, portID, channelID string) (channeltypes.Channel, bool)
32
+ PushAction(ctx sdk.Context, action vm.Action) error
33
+ }
34
+
35
+ type IBCModule struct {
36
+ impl IBCModuleImpl
37
+ }
38
+
39
+ func NewIBCModule(impl IBCModuleImpl) IBCModule {
40
+ return IBCModule{
41
+ impl: impl,
42
+ }
43
+ }
44
+
45
+ type ChannelOpenInitEvent struct {
46
+ *vm.ActionHeader `actionType:"IBC_EVENT"`
47
+ Event string `json:"event" default:"channelOpenInit"`
48
+ Target string `json:"target,omitempty"`
49
+ Order string `json:"order"`
50
+ ConnectionHops []string `json:"connectionHops"`
51
+ PortID string `json:"portID"`
52
+ ChannelID string `json:"channelID"`
53
+ Counterparty channeltypes.Counterparty `json:"counterparty"`
54
+ Version string `json:"version"`
55
+ AsyncVersions bool `json:"asyncVersions"`
56
+ }
57
+
58
+ // Implement IBCModule callbacks
59
+ func (im IBCModule) OnChanOpenInit(
60
+ ctx sdk.Context,
61
+ order channeltypes.Order,
62
+ connectionHops []string,
63
+ portID string,
64
+ channelID string,
65
+ channelCap *capability.Capability,
66
+ counterparty channeltypes.Counterparty,
67
+ version string,
68
+ ) (string, error) {
69
+ event := ChannelOpenInitEvent{
70
+ Order: orderToString(order),
71
+ ConnectionHops: connectionHops,
72
+ PortID: portID,
73
+ ChannelID: channelID,
74
+ Counterparty: counterparty,
75
+ Version: version,
76
+ AsyncVersions: AsyncVersions,
77
+ }
78
+
79
+ err := im.impl.PushAction(ctx, event)
80
+ if err != nil {
81
+ return "", err
82
+ }
83
+
84
+ // Claim channel capability passed back by IBC module
85
+ if err := im.impl.ClaimCapability(ctx, channelCap, host.ChannelCapabilityPath(portID, channelID)); err != nil {
86
+ return "", err
87
+ }
88
+
89
+ if !event.AsyncVersions {
90
+ // We have to supply a synchronous version, so just echo back the one they sent.
91
+ return event.Version, nil
92
+ }
93
+
94
+ return "", nil
95
+ }
96
+
97
+ type ChannelOpenTryEvent struct {
98
+ *vm.ActionHeader `actionType:"IBC_EVENT"`
99
+ Event string `json:"event" default:"channelOpenTry"`
100
+ Target string `json:"target,omitempty"`
101
+ Order string `json:"order"`
102
+ ConnectionHops []string `json:"connectionHops"`
103
+ PortID string `json:"portID"`
104
+ ChannelID string `json:"channelID"`
105
+ Counterparty channeltypes.Counterparty `json:"counterparty"`
106
+ Version string `json:"version"`
107
+ AsyncVersions bool `json:"asyncVersions"`
108
+ }
109
+
110
+ func (im IBCModule) OnChanOpenTry(
111
+ ctx sdk.Context,
112
+ order channeltypes.Order,
113
+ connectionHops []string,
114
+ portID,
115
+ channelID string,
116
+ channelCap *capability.Capability,
117
+ counterparty channeltypes.Counterparty,
118
+ counterpartyVersion string,
119
+ ) (string, error) {
120
+ event := ChannelOpenTryEvent{
121
+ Order: orderToString(order),
122
+ ConnectionHops: connectionHops,
123
+ PortID: portID,
124
+ ChannelID: channelID,
125
+ Counterparty: counterparty,
126
+ Version: counterpartyVersion,
127
+ AsyncVersions: AsyncVersions,
128
+ }
129
+
130
+ err := im.impl.PushAction(ctx, event)
131
+ if err != nil {
132
+ return "", err
133
+ }
134
+
135
+ // Claim channel capability passed back by IBC module
136
+ if err = im.impl.ClaimCapability(ctx, channelCap, host.ChannelCapabilityPath(portID, channelID)); err != nil {
137
+ return "", sdkioerrors.Wrap(channeltypes.ErrChannelCapabilityNotFound, err.Error())
138
+ }
139
+
140
+ if !event.AsyncVersions {
141
+ // We have to supply a synchronous version, so just echo back the one they sent.
142
+ return event.Version, nil
143
+ }
144
+
145
+ // Use an empty version string to indicate that the VM explicitly (possibly
146
+ // async) performs the WriteOpenTryChannel.
147
+ return "", nil
148
+ }
149
+
150
+ type ChannelOpenAckEvent struct {
151
+ *vm.ActionHeader `actionType:"IBC_EVENT"`
152
+ Event string `json:"event" default:"channelOpenAck"`
153
+ PortID string `json:"portID"`
154
+ ChannelID string `json:"channelID"`
155
+ CounterpartyVersion string `json:"counterpartyVersion"`
156
+ Counterparty channeltypes.Counterparty `json:"counterparty"`
157
+ ConnectionHops []string `json:"connectionHops"`
158
+ }
159
+
160
+ func (im IBCModule) OnChanOpenAck(
161
+ ctx sdk.Context,
162
+ portID,
163
+ channelID string,
164
+ counterpartyChannelID string,
165
+ counterpartyVersion string,
166
+ ) error {
167
+ // We don't care if the channel was found. If it wasn't then GetChannel
168
+ // returns an empty channel object that we can still use without crashing.
169
+ channel, _ := im.impl.GetChannel(ctx, portID, channelID)
170
+
171
+ channel.Counterparty.ChannelId = counterpartyChannelID
172
+ event := ChannelOpenAckEvent{
173
+ PortID: portID,
174
+ ChannelID: channelID,
175
+ CounterpartyVersion: counterpartyVersion,
176
+ Counterparty: channel.Counterparty,
177
+ ConnectionHops: channel.ConnectionHops,
178
+ }
179
+
180
+ return im.impl.PushAction(ctx, event)
181
+ }
182
+
183
+ type ChannelOpenConfirmEvent struct {
184
+ *vm.ActionHeader `actionType:"IBC_EVENT"`
185
+ Event string `json:"event" default:"channelOpenConfirm"`
186
+ Target string `json:"target,omitempty"`
187
+ PortID string `json:"portID"`
188
+ ChannelID string `json:"channelID"`
189
+ }
190
+
191
+ func (im IBCModule) OnChanOpenConfirm(
192
+ ctx sdk.Context,
193
+ portID,
194
+ channelID string,
195
+ ) error {
196
+ event := ChannelOpenConfirmEvent{
197
+ PortID: portID,
198
+ ChannelID: channelID,
199
+ }
200
+
201
+ return im.impl.PushAction(ctx, event)
202
+ }
203
+
204
+ type ChannelCloseInitEvent struct {
205
+ *vm.ActionHeader `actionType:"IBC_EVENT"`
206
+ Event string `json:"event" default:"channelCloseInit"`
207
+ Target string `json:"target,omitempty"`
208
+ PortID string `json:"portID"`
209
+ ChannelID string `json:"channelID"`
210
+ }
211
+
212
+ func (im IBCModule) OnChanCloseInit(
213
+ ctx sdk.Context,
214
+ portID,
215
+ channelID string,
216
+ ) error {
217
+ event := ChannelCloseInitEvent{
218
+ PortID: portID,
219
+ ChannelID: channelID,
220
+ }
221
+
222
+ err := im.impl.PushAction(ctx, event)
223
+ return err
224
+ }
225
+
226
+ type ChannelCloseConfirmEvent struct {
227
+ *vm.ActionHeader `actionType:"IBC_EVENT"`
228
+ Event string `json:"event" default:"channelCloseConfirm"`
229
+ Target string `json:"target,omitempty"`
230
+ PortID string `json:"portID"`
231
+ ChannelID string `json:"channelID"`
232
+ }
233
+
234
+ func (im IBCModule) OnChanCloseConfirm(
235
+ ctx sdk.Context,
236
+ portID,
237
+ channelID string,
238
+ ) error {
239
+ event := ChannelCloseConfirmEvent{
240
+ PortID: portID,
241
+ ChannelID: channelID,
242
+ }
243
+
244
+ err := im.impl.PushAction(ctx, event)
245
+ return err
246
+ }
247
+
248
+ type ReceivePacketEvent struct {
249
+ *vm.ActionHeader `actionType:"IBC_EVENT"`
250
+ Event string `json:"event" default:"receivePacket"`
251
+ Target string `json:"target,omitempty"`
252
+ Packet channeltypes.Packet `json:"packet"`
253
+ Relayer sdk.AccAddress `json:"relayer"`
254
+ }
255
+
256
+ func (im IBCModule) OnRecvPacket(
257
+ ctx sdk.Context,
258
+ packet channeltypes.Packet,
259
+ relayer sdk.AccAddress,
260
+ ) exported.Acknowledgement {
261
+ // Sometimes we receive duplicate packets, just with a
262
+ // missing packet.TimeoutTimestamp. This causes duplicate
263
+ // acks, with one of them being rejected.
264
+ //
265
+ // This turns out to happen when you run both "rly start"
266
+ // and also "rly tx xfer"-- they both are trying to relay
267
+ // the same packets.
268
+
269
+ event := ReceivePacketEvent{
270
+ Packet: packet,
271
+ Relayer: relayer,
272
+ }
273
+
274
+ err := im.impl.PushAction(ctx, event)
275
+ if err != nil {
276
+ return channeltypes.NewErrorAcknowledgement(err)
277
+ }
278
+
279
+ return nil
280
+ }
281
+
282
+ type AcknowledgementPacketEvent struct {
283
+ *vm.ActionHeader `actionType:"IBC_EVENT"`
284
+ Event string `json:"event" default:"acknowledgementPacket"`
285
+ Target string `json:"target,omitempty"`
286
+ Packet channeltypes.Packet `json:"packet"`
287
+ Acknowledgement []byte `json:"acknowledgement"`
288
+ Relayer sdk.AccAddress `json:"relayer"`
289
+ }
290
+
291
+ func (im IBCModule) OnAcknowledgementPacket(
292
+ ctx sdk.Context,
293
+ packet channeltypes.Packet,
294
+ acknowledgement []byte,
295
+ relayer sdk.AccAddress,
296
+ ) error {
297
+ event := AcknowledgementPacketEvent{
298
+ Packet: packet,
299
+ Acknowledgement: acknowledgement,
300
+ Relayer: relayer,
301
+ }
302
+
303
+ err := im.impl.PushAction(ctx, event)
304
+ if err != nil {
305
+ return err
306
+ }
307
+
308
+ return nil
309
+ }
310
+
311
+ type TimeoutPacketEvent struct {
312
+ *vm.ActionHeader `actionType:"IBC_EVENT"`
313
+ Event string `json:"event" default:"timeoutPacket"`
314
+ Target string `json:"target,omitempty"`
315
+ Packet channeltypes.Packet `json:"packet"`
316
+ Relayer sdk.AccAddress `json:"relayer"`
317
+ }
318
+
319
+ func (im IBCModule) OnTimeoutPacket(
320
+ ctx sdk.Context,
321
+ packet channeltypes.Packet,
322
+ relayer sdk.AccAddress,
323
+ ) error {
324
+ event := TimeoutPacketEvent{
325
+ Packet: packet,
326
+ Relayer: relayer,
327
+ }
328
+
329
+ err := im.impl.PushAction(ctx, event)
330
+ if err != nil {
331
+ return err
332
+ }
333
+
334
+ return nil
335
+ }
@@ -0,0 +1,160 @@
1
+ package types
2
+
3
+ import (
4
+ "context"
5
+ "encoding/json"
6
+ "fmt"
7
+
8
+ "github.com/Agoric/agoric-sdk/golang/cosmos/vm"
9
+ channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
10
+
11
+ "github.com/cosmos/ibc-go/v6/modules/core/exported"
12
+
13
+ sdk "github.com/cosmos/cosmos-sdk/types"
14
+ )
15
+
16
+ var (
17
+ _ vm.PortHandler = Receiver{}
18
+ _ exported.Acknowledgement = (*rawAcknowledgement)(nil)
19
+ )
20
+
21
+ type ReceiverImpl interface {
22
+ ReceiveSendPacket(ctx sdk.Context, packet exported.PacketI) (uint64, error)
23
+ ReceiveWriteAcknowledgement(ctx sdk.Context, packet exported.PacketI, ack exported.Acknowledgement) error
24
+ ReceiveChanOpenInit(ctx sdk.Context, order channeltypes.Order, hops []string, sourcePort, destinationPort, version string) error
25
+ ReceiveWriteOpenTryChannel(ctx sdk.Context, packet exported.PacketI, order channeltypes.Order, connectionHops []string, version string) error
26
+ ReceiveChanCloseInit(ctx sdk.Context, sourcePort, sourceChannel string) error
27
+ ReceiveBindPort(ctx sdk.Context, sourcePort string) error
28
+ ReceiveTimeoutExecuted(ctx sdk.Context, packet exported.PacketI) error
29
+ }
30
+
31
+ type Receiver struct {
32
+ impl ReceiverImpl
33
+ }
34
+
35
+ func NewReceiver(impl ReceiverImpl) Receiver {
36
+ return Receiver{
37
+ impl: impl,
38
+ }
39
+ }
40
+
41
+ type portMessage struct { // comes from swingset's IBC handler
42
+ Type string `json:"type"` // IBC_METHOD
43
+ Method string `json:"method"`
44
+ Packet channeltypes.Packet `json:"packet"`
45
+ RelativeTimeoutNs uint64 `json:"relativeTimeoutNs,string"`
46
+ Order string `json:"order"`
47
+ Hops []string `json:"hops"`
48
+ Version string `json:"version"`
49
+ Ack []byte `json:"ack"`
50
+ }
51
+
52
+ func stringToOrder(order string) channeltypes.Order {
53
+ switch order {
54
+ case "ORDERED":
55
+ return channeltypes.ORDERED
56
+ case "UNORDERED":
57
+ return channeltypes.UNORDERED
58
+ default:
59
+ return channeltypes.NONE
60
+ }
61
+ }
62
+
63
+ func orderToString(order channeltypes.Order) string {
64
+ switch order {
65
+ case channeltypes.ORDERED:
66
+ return "ORDERED"
67
+ case channeltypes.UNORDERED:
68
+ return "UNORDERED"
69
+ default:
70
+ return "NONE"
71
+ }
72
+ }
73
+
74
+ type rawAcknowledgement struct {
75
+ data []byte
76
+ }
77
+
78
+ func (r rawAcknowledgement) Acknowledgement() []byte {
79
+ return r.data
80
+ }
81
+
82
+ func (r rawAcknowledgement) Success() bool {
83
+ return true
84
+ }
85
+
86
+ func (ir Receiver) Receive(cctx context.Context, str string) (ret string, err error) {
87
+ ctx := sdk.UnwrapSDKContext(cctx)
88
+ impl := ir.impl
89
+
90
+ msg := new(portMessage)
91
+ err = json.Unmarshal([]byte(str), &msg)
92
+ if err != nil {
93
+ return "", err
94
+ }
95
+
96
+ if msg.Type != "IBC_METHOD" {
97
+ return "", fmt.Errorf(`channel handler only accepts messages of "type": "IBC_METHOD"`)
98
+ }
99
+
100
+ switch msg.Method {
101
+ case "sendPacket":
102
+ timeoutTimestamp := msg.Packet.TimeoutTimestamp
103
+ if msg.Packet.TimeoutHeight.IsZero() && timeoutTimestamp == 0 {
104
+ // Use the relative timeout if no absolute timeout is specifiied.
105
+ timeoutTimestamp = uint64(ctx.BlockTime().UnixNano()) + msg.RelativeTimeoutNs
106
+ }
107
+
108
+ packet := channeltypes.NewPacket(
109
+ msg.Packet.Data, 0,
110
+ msg.Packet.SourcePort, msg.Packet.SourceChannel,
111
+ msg.Packet.DestinationPort, msg.Packet.DestinationChannel,
112
+ msg.Packet.TimeoutHeight, timeoutTimestamp,
113
+ )
114
+ seq, err := impl.ReceiveSendPacket(ctx, packet)
115
+ if err == nil {
116
+ packet.Sequence = seq
117
+ bytes, err := json.Marshal(&packet)
118
+ if err == nil {
119
+ ret = string(bytes)
120
+ }
121
+ }
122
+
123
+ case "tryOpenExecuted":
124
+ err = impl.ReceiveWriteOpenTryChannel(
125
+ ctx, msg.Packet,
126
+ stringToOrder(msg.Order), msg.Hops, msg.Version,
127
+ )
128
+
129
+ case "receiveExecuted":
130
+ ack := rawAcknowledgement{
131
+ data: msg.Ack,
132
+ }
133
+ err = impl.ReceiveWriteAcknowledgement(ctx, msg.Packet, ack)
134
+
135
+ case "startChannelOpenInit":
136
+ err = impl.ReceiveChanOpenInit(
137
+ ctx, stringToOrder(msg.Order), msg.Hops,
138
+ msg.Packet.SourcePort,
139
+ msg.Packet.DestinationPort,
140
+ msg.Version,
141
+ )
142
+
143
+ case "startChannelCloseInit":
144
+ err = impl.ReceiveChanCloseInit(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel)
145
+
146
+ case "bindPort":
147
+ err = impl.ReceiveBindPort(ctx, msg.Packet.SourcePort)
148
+
149
+ case "timeoutExecuted":
150
+ err = impl.ReceiveTimeoutExecuted(ctx, msg.Packet)
151
+
152
+ default:
153
+ err = fmt.Errorf("unrecognized method %s", msg.Method)
154
+ }
155
+
156
+ if ret == "" && err == nil {
157
+ ret = "true"
158
+ }
159
+ return
160
+ }
@@ -0,0 +1,19 @@
1
+ package vlocalchain
2
+
3
+ import (
4
+ "github.com/Agoric/agoric-sdk/golang/cosmos/x/vlocalchain/keeper"
5
+ "github.com/Agoric/agoric-sdk/golang/cosmos/x/vlocalchain/types"
6
+ )
7
+
8
+ const (
9
+ ModuleName = types.ModuleName
10
+ StoreKey = types.StoreKey
11
+ )
12
+
13
+ var (
14
+ NewKeeper = keeper.NewKeeper
15
+ )
16
+
17
+ type (
18
+ Keeper = keeper.Keeper
19
+ )
@@ -0,0 +1,20 @@
1
+ package vlocalchain
2
+
3
+ import (
4
+ "fmt"
5
+
6
+ "github.com/Agoric/agoric-sdk/golang/cosmos/x/vlocalchain/keeper"
7
+ sdk "github.com/cosmos/cosmos-sdk/types"
8
+ sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
9
+ )
10
+
11
+ // NewHandler returns a handler for "vlocalchain" type messages.
12
+ func NewHandler(keeper keeper.Keeper) sdk.Handler {
13
+ return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
14
+ switch msg := msg.(type) {
15
+ default:
16
+ errMsg := fmt.Sprintf("Unrecognized vlocalchain Msg type: %T", msg)
17
+ return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg)
18
+ }
19
+ }
20
+ }