@agoric/cosmos 0.35.0-u15.0 → 0.35.0-u16.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 (131) hide show
  1. package/CHANGELOG.md +121 -149
  2. package/MAINTAINERS.md +3 -0
  3. package/Makefile +36 -26
  4. package/ante/ante.go +6 -5
  5. package/ante/inbound_test.go +3 -2
  6. package/ante/vm_admission.go +2 -1
  7. package/app/app.go +206 -147
  8. package/app/upgrade.go +76 -0
  9. package/cmd/agd/agvm.go +42 -0
  10. package/cmd/agd/main.go +130 -11
  11. package/cmd/libdaemon/main.go +64 -53
  12. package/cmd/libdaemon/main_test.go +2 -1
  13. package/daemon/cmd/root.go +164 -74
  14. package/daemon/cmd/root_test.go +189 -1
  15. package/daemon/main.go +4 -2
  16. package/e2e_test/Makefile +29 -0
  17. package/e2e_test/README.md +100 -0
  18. package/e2e_test/go.mod +217 -0
  19. package/e2e_test/go.sum +1323 -0
  20. package/e2e_test/ibc_conformance_test.go +56 -0
  21. package/e2e_test/pfm_test.go +613 -0
  22. package/e2e_test/util.go +271 -0
  23. package/git-revision.txt +1 -1
  24. package/go.mod +12 -7
  25. package/go.sum +13 -9
  26. package/package.json +8 -4
  27. package/proto/agoric/swingset/genesis.proto +4 -0
  28. package/proto/agoric/swingset/swingset.proto +1 -1
  29. package/proto/agoric/vlocalchain/.clang-format +7 -0
  30. package/proto/agoric/vlocalchain/vlocalchain.proto +31 -0
  31. package/proto/agoric/vtransfer/genesis.proto +18 -0
  32. package/scripts/protocgen.sh +7 -8
  33. package/types/kv_entry_helpers.go +42 -0
  34. package/upgradegaia.sh +8 -8
  35. package/vm/action.go +5 -4
  36. package/vm/action_test.go +31 -11
  37. package/vm/client.go +113 -0
  38. package/vm/client_test.go +182 -0
  39. package/vm/controller.go +17 -40
  40. package/vm/core_proposals.go +22 -2
  41. package/vm/jsonrpcconn/jsonrpcconn.go +160 -0
  42. package/vm/jsonrpcconn/jsonrpcconn_test.go +126 -0
  43. package/vm/proto_json.go +38 -0
  44. package/vm/proto_json_test.go +103 -0
  45. package/vm/server.go +124 -0
  46. package/x/swingset/abci.go +10 -10
  47. package/x/swingset/alias.go +2 -0
  48. package/x/swingset/client/cli/tx.go +4 -0
  49. package/x/swingset/genesis.go +84 -24
  50. package/x/swingset/handler.go +2 -1
  51. package/x/swingset/keeper/extension_snapshotter.go +2 -2
  52. package/x/swingset/keeper/keeper.go +13 -25
  53. package/x/swingset/keeper/msg_server.go +18 -18
  54. package/x/swingset/keeper/proposal.go +3 -3
  55. package/x/swingset/keeper/querier.go +12 -11
  56. package/x/swingset/keeper/swing_store_exports_handler.go +16 -5
  57. package/x/swingset/keeper/test_utils.go +16 -0
  58. package/x/swingset/module.go +7 -7
  59. package/x/swingset/proposal_handler.go +2 -1
  60. package/x/swingset/testing/queue.go +17 -0
  61. package/x/swingset/types/default-params.go +1 -1
  62. package/x/swingset/types/expected_keepers.go +3 -2
  63. package/x/swingset/types/genesis.pb.go +78 -25
  64. package/x/swingset/types/msgs.go +44 -24
  65. package/x/swingset/types/params.go +2 -1
  66. package/x/swingset/types/proposal.go +5 -4
  67. package/x/swingset/types/swingset.pb.go +1 -1
  68. package/x/vbank/genesis.go +0 -2
  69. package/x/vbank/handler.go +2 -1
  70. package/x/vbank/keeper/querier.go +4 -3
  71. package/x/vbank/module.go +0 -5
  72. package/x/vbank/types/msgs.go +0 -12
  73. package/x/vbank/vbank.go +9 -9
  74. package/x/vbank/vbank_test.go +2 -2
  75. package/x/vibc/alias.go +3 -0
  76. package/x/vibc/handler.go +16 -9
  77. package/x/vibc/keeper/keeper.go +102 -65
  78. package/x/vibc/keeper/triggers.go +101 -0
  79. package/x/vibc/module.go +5 -8
  80. package/x/vibc/types/expected_keepers.go +13 -0
  81. package/x/vibc/types/ibc_module.go +336 -0
  82. package/x/vibc/types/receiver.go +170 -0
  83. package/x/vlocalchain/alias.go +19 -0
  84. package/x/vlocalchain/handler.go +21 -0
  85. package/x/vlocalchain/keeper/keeper.go +279 -0
  86. package/x/vlocalchain/keeper/keeper_test.go +97 -0
  87. package/x/vlocalchain/types/codec.go +34 -0
  88. package/x/vlocalchain/types/key.go +27 -0
  89. package/x/vlocalchain/types/msgs.go +16 -0
  90. package/x/vlocalchain/types/vlocalchain.pb.go +1072 -0
  91. package/x/vlocalchain/vlocalchain.go +114 -0
  92. package/x/vlocalchain/vlocalchain_test.go +434 -0
  93. package/x/vstorage/handler.go +2 -1
  94. package/x/vstorage/keeper/grpc_query.go +0 -1
  95. package/x/vstorage/keeper/keeper.go +13 -20
  96. package/x/vstorage/keeper/querier.go +6 -5
  97. package/x/vstorage/keeper/querier_test.go +4 -3
  98. package/x/vstorage/module.go +0 -5
  99. package/x/vstorage/testing/queue.go +27 -0
  100. package/x/vtransfer/alias.go +13 -0
  101. package/x/vtransfer/genesis.go +39 -0
  102. package/x/vtransfer/genesis_test.go +12 -0
  103. package/x/vtransfer/handler.go +20 -0
  104. package/x/vtransfer/ibc_middleware.go +186 -0
  105. package/x/vtransfer/ibc_middleware_test.go +448 -0
  106. package/x/vtransfer/keeper/keeper.go +281 -0
  107. package/x/vtransfer/module.go +124 -0
  108. package/x/vtransfer/types/expected_keepers.go +38 -0
  109. package/x/vtransfer/types/genesis.pb.go +327 -0
  110. package/x/vtransfer/types/key.go +9 -0
  111. package/x/vtransfer/types/msgs.go +9 -0
  112. package/proto/agoric/lien/genesis.proto +0 -25
  113. package/proto/agoric/lien/lien.proto +0 -25
  114. package/x/lien/alias.go +0 -17
  115. package/x/lien/genesis.go +0 -58
  116. package/x/lien/genesis_test.go +0 -101
  117. package/x/lien/keeper/account.go +0 -290
  118. package/x/lien/keeper/keeper.go +0 -255
  119. package/x/lien/keeper/keeper_test.go +0 -623
  120. package/x/lien/lien.go +0 -205
  121. package/x/lien/lien_test.go +0 -533
  122. package/x/lien/module.go +0 -115
  123. package/x/lien/spec/01_concepts.md +0 -146
  124. package/x/lien/spec/02_messages.md +0 -96
  125. package/x/lien/types/accountkeeper.go +0 -81
  126. package/x/lien/types/accountstate.go +0 -27
  127. package/x/lien/types/expected_keepers.go +0 -18
  128. package/x/lien/types/genesis.pb.go +0 -567
  129. package/x/lien/types/key.go +0 -25
  130. package/x/lien/types/lien.pb.go +0 -403
  131. package/x/vibc/ibc.go +0 -394
@@ -51,25 +51,6 @@ const (
51
51
  swingStoreKeyPrefix = "swingStore."
52
52
  )
53
53
 
54
- // Contextual information about the message source of an action on an inbound queue.
55
- // This context should be unique per inboundQueueRecord.
56
- type actionContext struct {
57
- // The block height in which the corresponding action was enqueued
58
- BlockHeight int64 `json:"blockHeight"`
59
- // The hash of the cosmos transaction that included the message
60
- // If the action didn't result from a transaction message, a substitute value
61
- // may be used. For example the VBANK_BALANCE_UPDATE actions use `x/vbank`.
62
- TxHash string `json:"txHash"`
63
- // The index of the message within the transaction. If the action didn't
64
- // result from a cosmos transaction, a number should be chosen to make the
65
- // actionContext unique. (for example a counter per block and source module).
66
- MsgIdx int `json:"msgIdx"`
67
- }
68
- type inboundQueueRecord struct {
69
- Action vm.Jsonable `json:"action"`
70
- Context actionContext `json:"context"`
71
- }
72
-
73
54
  // Keeper maintains the link to data vstorage and exposes getter/setter methods for the various parts of the state machine
74
55
  type Keeper struct {
75
56
  storeKey storetypes.StoreKey
@@ -144,7 +125,14 @@ func (k Keeper) pushAction(ctx sdk.Context, inboundQueuePath string, action vm.A
144
125
  if !txHashOk || !msgIdxOk {
145
126
  stdlog.Printf("error while extracting context for action %q\n", action)
146
127
  }
147
- record := inboundQueueRecord{Action: action, Context: actionContext{BlockHeight: ctx.BlockHeight(), TxHash: txHash, MsgIdx: msgIdx}}
128
+ record := types.InboundQueueRecord{
129
+ Action: action,
130
+ Context: types.ActionContext{
131
+ BlockHeight: ctx.BlockHeight(),
132
+ TxHash: txHash,
133
+ MsgIdx: msgIdx,
134
+ },
135
+ }
148
136
  bz, err := json.Marshal(record)
149
137
  if err != nil {
150
138
  return err
@@ -282,9 +270,9 @@ func (k Keeper) SetState(ctx sdk.Context, state types.State) {
282
270
 
283
271
  // GetBeansPerUnit returns a map taken from the current SwingSet parameters from
284
272
  // a unit (key) string to an unsigned integer amount of beans.
285
- func (k Keeper) GetBeansPerUnit(ctx sdk.Context) map[string]sdk.Uint {
273
+ func (k Keeper) GetBeansPerUnit(ctx sdk.Context) map[string]sdkmath.Uint {
286
274
  params := k.GetParams(ctx)
287
- beansPerUnit := make(map[string]sdk.Uint, len(params.BeansPerUnit))
275
+ beansPerUnit := make(map[string]sdkmath.Uint, len(params.BeansPerUnit))
288
276
  for _, bpu := range params.BeansPerUnit {
289
277
  beansPerUnit[bpu.Key] = bpu.Beans
290
278
  }
@@ -297,7 +285,7 @@ func getBeansOwingPathForAddress(addr sdk.AccAddress) string {
297
285
 
298
286
  // GetBeansOwing returns the number of beans that the given address owes to
299
287
  // the FeeAccount but has not yet paid.
300
- func (k Keeper) GetBeansOwing(ctx sdk.Context, addr sdk.AccAddress) sdk.Uint {
288
+ func (k Keeper) GetBeansOwing(ctx sdk.Context, addr sdk.AccAddress) sdkmath.Uint {
301
289
  path := getBeansOwingPathForAddress(addr)
302
290
  entry := k.vstorageKeeper.GetEntry(ctx, path)
303
291
  if !entry.HasValue() {
@@ -308,7 +296,7 @@ func (k Keeper) GetBeansOwing(ctx sdk.Context, addr sdk.AccAddress) sdk.Uint {
308
296
 
309
297
  // SetBeansOwing sets the number of beans that the given address owes to the
310
298
  // feeCollector but has not yet paid.
311
- func (k Keeper) SetBeansOwing(ctx sdk.Context, addr sdk.AccAddress, beans sdk.Uint) {
299
+ func (k Keeper) SetBeansOwing(ctx sdk.Context, addr sdk.AccAddress, beans sdkmath.Uint) {
312
300
  path := getBeansOwingPathForAddress(addr)
313
301
  k.vstorageKeeper.SetStorage(ctx, agoric.NewKVEntry(path, beans.String()))
314
302
  }
@@ -316,7 +304,7 @@ func (k Keeper) SetBeansOwing(ctx sdk.Context, addr sdk.AccAddress, beans sdk.Ui
316
304
  // ChargeBeans charges the given address the given number of beans. It divides
317
305
  // the beans into the number to debit immediately vs. the number to store in the
318
306
  // beansOwing.
319
- func (k Keeper) ChargeBeans(ctx sdk.Context, addr sdk.AccAddress, beans sdk.Uint) error {
307
+ func (k Keeper) ChargeBeans(ctx sdk.Context, addr sdk.AccAddress, beans sdkmath.Uint) error {
320
308
  beansPerUnit := k.GetBeansPerUnit(ctx)
321
309
 
322
310
  wasOwing := k.GetBeansOwing(ctx, addr)
@@ -21,10 +21,10 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer {
21
21
  var _ types.MsgServer = msgServer{}
22
22
 
23
23
  type deliverInboundAction struct {
24
- vm.ActionHeader `actionType:"DELIVER_INBOUND"`
25
- Peer string `json:"peer"`
26
- Messages [][]interface{} `json:"messages"`
27
- Ack uint64 `json:"ack"`
24
+ *vm.ActionHeader `actionType:"DELIVER_INBOUND"`
25
+ Peer string `json:"peer"`
26
+ Messages [][]interface{} `json:"messages"`
27
+ Ack uint64 `json:"ack"`
28
28
  }
29
29
 
30
30
  func (keeper msgServer) routeAction(ctx sdk.Context, msg vm.ControllerAdmissionMsg, action vm.Action) error {
@@ -48,7 +48,7 @@ func (keeper msgServer) DeliverInbound(goCtx context.Context, msg *types.MsgDeli
48
48
  for i, message := range msg.Messages {
49
49
  messages[i] = []interface{}{msg.Nums[i], message}
50
50
  }
51
- action := &deliverInboundAction{
51
+ action := deliverInboundAction{
52
52
  Peer: msg.Submitter.String(),
53
53
  Messages: messages,
54
54
  Ack: msg.Ack,
@@ -63,9 +63,9 @@ func (keeper msgServer) DeliverInbound(goCtx context.Context, msg *types.MsgDeli
63
63
  }
64
64
 
65
65
  type walletAction struct {
66
- vm.ActionHeader `actionType:"WALLET_ACTION"`
67
- Owner string `json:"owner"`
68
- Action string `json:"action"`
66
+ *vm.ActionHeader `actionType:"WALLET_ACTION"`
67
+ Owner string `json:"owner"`
68
+ Action string `json:"action"`
69
69
  }
70
70
 
71
71
  func (keeper msgServer) WalletAction(goCtx context.Context, msg *types.MsgWalletAction) (*types.MsgWalletActionResponse, error) {
@@ -76,7 +76,7 @@ func (keeper msgServer) WalletAction(goCtx context.Context, msg *types.MsgWallet
76
76
  return nil, err
77
77
  }
78
78
 
79
- action := &walletAction{
79
+ action := walletAction{
80
80
  Owner: msg.Owner.String(),
81
81
  Action: msg.Action,
82
82
  }
@@ -91,9 +91,9 @@ func (keeper msgServer) WalletAction(goCtx context.Context, msg *types.MsgWallet
91
91
  }
92
92
 
93
93
  type walletSpendAction struct {
94
- vm.ActionHeader `actionType:"WALLET_SPEND_ACTION"`
95
- Owner string `json:"owner"`
96
- SpendAction string `json:"spendAction"`
94
+ *vm.ActionHeader `actionType:"WALLET_SPEND_ACTION"`
95
+ Owner string `json:"owner"`
96
+ SpendAction string `json:"spendAction"`
97
97
  }
98
98
 
99
99
  func (keeper msgServer) WalletSpendAction(goCtx context.Context, msg *types.MsgWalletSpendAction) (*types.MsgWalletSpendActionResponse, error) {
@@ -104,7 +104,7 @@ func (keeper msgServer) WalletSpendAction(goCtx context.Context, msg *types.MsgW
104
104
  return nil, err
105
105
  }
106
106
 
107
- action := &walletSpendAction{
107
+ action := walletSpendAction{
108
108
  Owner: msg.Owner.String(),
109
109
  SpendAction: msg.SpendAction,
110
110
  }
@@ -117,7 +117,7 @@ func (keeper msgServer) WalletSpendAction(goCtx context.Context, msg *types.MsgW
117
117
  }
118
118
 
119
119
  type provisionAction struct {
120
- vm.ActionHeader `actionType:"PLEASE_PROVISION"`
120
+ *vm.ActionHeader `actionType:"PLEASE_PROVISION"`
121
121
  *types.MsgProvision
122
122
  AutoProvision bool `json:"autoProvision"`
123
123
  }
@@ -141,7 +141,7 @@ func (keeper msgServer) provisionIfNeeded(ctx sdk.Context, owner sdk.AccAddress)
141
141
  PowerFlags: []string{types.PowerFlagSmartWallet},
142
142
  }
143
143
 
144
- action := &provisionAction{
144
+ action := provisionAction{
145
145
  MsgProvision: msg,
146
146
  AutoProvision: true,
147
147
  }
@@ -163,7 +163,7 @@ func (keeper msgServer) Provision(goCtx context.Context, msg *types.MsgProvision
163
163
  return nil, err
164
164
  }
165
165
 
166
- action := &provisionAction{
166
+ action := provisionAction{
167
167
  MsgProvision: msg,
168
168
  }
169
169
 
@@ -184,7 +184,7 @@ func (keeper msgServer) Provision(goCtx context.Context, msg *types.MsgProvision
184
184
  }
185
185
 
186
186
  type installBundleAction struct {
187
- vm.ActionHeader `actionType:"INSTALL_BUNDLE"`
187
+ *vm.ActionHeader `actionType:"INSTALL_BUNDLE"`
188
188
  *types.MsgInstallBundle
189
189
  }
190
190
 
@@ -195,7 +195,7 @@ func (keeper msgServer) InstallBundle(goCtx context.Context, msg *types.MsgInsta
195
195
  if err != nil {
196
196
  return nil, err
197
197
  }
198
- action := &installBundleAction{
198
+ action := installBundleAction{
199
199
  MsgInstallBundle: msg,
200
200
  }
201
201
 
@@ -11,13 +11,13 @@ import (
11
11
  )
12
12
 
13
13
  type coreEvalAction struct {
14
- vm.ActionHeader `actionType:"CORE_EVAL"`
15
- Evals []types.CoreEval `json:"evals"`
14
+ *vm.ActionHeader `actionType:"CORE_EVAL"`
15
+ Evals []types.CoreEval `json:"evals"`
16
16
  }
17
17
 
18
18
  // CoreEvalProposal tells SwingSet to evaluate the given JS code.
19
19
  func (k Keeper) CoreEvalProposal(ctx sdk.Context, p *types.CoreEvalProposal) error {
20
- action := &coreEvalAction{
20
+ action := coreEvalAction{
21
21
  Evals: p.Evals,
22
22
  }
23
23
 
@@ -6,6 +6,7 @@ import (
6
6
 
7
7
  abci "github.com/tendermint/tendermint/abci/types"
8
8
 
9
+ sdkioerrors "cosmossdk.io/errors"
9
10
  "github.com/cosmos/cosmos-sdk/codec"
10
11
  sdk "github.com/cosmos/cosmos-sdk/types"
11
12
  sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
@@ -31,12 +32,12 @@ func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
31
32
  switch queryType {
32
33
  case QueryEgress:
33
34
  if len(path) < 2 || path[1] == "" {
34
- return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "missing egress address")
35
+ return nil, sdkioerrors.Wrap(sdkerrors.ErrInvalidRequest, "missing egress address")
35
36
  }
36
37
  return queryEgress(ctx, path[1], req, keeper, legacyQuerierCdc)
37
38
  case QueryMailbox:
38
39
  if len(path) < 2 || path[1] == "" {
39
- return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "missing mailbox peer")
40
+ return nil, sdkioerrors.Wrap(sdkerrors.ErrInvalidRequest, "missing mailbox peer")
40
41
  }
41
42
  return queryMailbox(ctx, path[1], req, keeper, legacyQuerierCdc)
42
43
  case LegacyQueryStorage:
@@ -44,7 +45,7 @@ func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
44
45
  case LegacyQueryKeys:
45
46
  return legacyQueryKeys(ctx, strings.Join(path[1:], "/"), req, keeper, legacyQuerierCdc)
46
47
  default:
47
- return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "unknown swingset query path")
48
+ return nil, sdkioerrors.Wrap(sdkerrors.ErrUnknownRequest, "unknown swingset query path")
48
49
  }
49
50
  }
50
51
  }
@@ -53,17 +54,17 @@ func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
53
54
  func queryEgress(ctx sdk.Context, bech32 string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
54
55
  acc, err := sdk.AccAddressFromBech32(bech32)
55
56
  if err != nil {
56
- return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error())
57
+ return nil, sdkioerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error())
57
58
  }
58
59
 
59
60
  egress := keeper.GetEgress(ctx, acc)
60
61
  if egress.Peer.Empty() {
61
- return []byte{}, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, fmt.Sprintf("egress %s not found", bech32))
62
+ return []byte{}, sdkioerrors.Wrap(sdkerrors.ErrUnknownRequest, fmt.Sprintf("egress %s not found", bech32))
62
63
  }
63
64
 
64
65
  bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, egress)
65
66
  if err != nil {
66
- return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())
67
+ return nil, sdkioerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())
67
68
  }
68
69
 
69
70
  return bz, nil
@@ -74,12 +75,12 @@ func queryMailbox(ctx sdk.Context, peer string, req abci.RequestQuery, keeper Ke
74
75
  value := keeper.GetMailbox(ctx, peer)
75
76
 
76
77
  if value == "" {
77
- return []byte{}, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "could not get peer mailbox")
78
+ return []byte{}, sdkioerrors.Wrap(sdkerrors.ErrUnknownRequest, "could not get peer mailbox")
78
79
  }
79
80
 
80
81
  bz, err2 := codec.MarshalJSONIndent(legacyQuerierCdc, vstoragetypes.Data{Value: value})
81
82
  if err2 != nil {
82
- return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err2.Error())
83
+ return nil, sdkioerrors.Wrap(sdkerrors.ErrJSONMarshal, err2.Error())
83
84
  }
84
85
 
85
86
  return bz, nil
@@ -89,12 +90,12 @@ func queryMailbox(ctx sdk.Context, peer string, req abci.RequestQuery, keeper Ke
89
90
  func legacyQueryStorage(ctx sdk.Context, path string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) (res []byte, err error) {
90
91
  entry := keeper.vstorageKeeper.GetEntry(ctx, path)
91
92
  if !entry.HasValue() {
92
- return []byte{}, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "could not get swingset %+v", path)
93
+ return []byte{}, sdkioerrors.Wrapf(sdkerrors.ErrUnknownRequest, "could not get swingset %+v", path)
93
94
  }
94
95
 
95
96
  bz, err2 := codec.MarshalJSONIndent(legacyQuerierCdc, vstoragetypes.Data{Value: entry.StringValue()})
96
97
  if err2 != nil {
97
- return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err2.Error())
98
+ return nil, sdkioerrors.Wrap(sdkerrors.ErrJSONMarshal, err2.Error())
98
99
  }
99
100
 
100
101
  return bz, nil
@@ -111,7 +112,7 @@ func legacyQueryKeys(ctx sdk.Context, path string, req abci.RequestQuery, keeper
111
112
 
112
113
  bz, err2 := codec.MarshalJSONIndent(legacyQuerierCdc, vstoragetypes.Children{Children: chlist})
113
114
  if err2 != nil {
114
- return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err2.Error())
115
+ return nil, sdkioerrors.Wrap(sdkerrors.ErrJSONMarshal, err2.Error())
115
116
  }
116
117
 
117
118
  return bz, nil
@@ -9,10 +9,10 @@ import (
9
9
  "path/filepath"
10
10
  "regexp"
11
11
 
12
+ sdkioerrors "cosmossdk.io/errors"
12
13
  agoric "github.com/Agoric/agoric-sdk/golang/cosmos/types"
13
14
  "github.com/Agoric/agoric-sdk/golang/cosmos/vm"
14
15
  "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types"
15
- sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
16
16
  "github.com/tendermint/tendermint/libs/log"
17
17
  )
18
18
 
@@ -588,7 +588,7 @@ func (exportsHandler SwingStoreExportsHandler) InitiateExport(blockHeight uint64
588
588
  } else if discardErr != nil {
589
589
  // Safe to wrap error and use detailed error info since this error
590
590
  // will not go back into swingset layers
591
- err = sdkerrors.Wrapf(err, "failed to discard swing-store export after failing to process export: %+v", discardErr)
591
+ err = sdkioerrors.Wrapf(err, "failed to discard swing-store export after failing to process export: %+v", discardErr)
592
592
  }
593
593
  }()
594
594
 
@@ -787,7 +787,18 @@ func (exportsHandler SwingStoreExportsHandler) RestoreExport(provider SwingStore
787
787
  // a jsonl-like file, before saving the export manifest linking these together.
788
788
  // The export manifest filename and overall export format is common with the JS
789
789
  // swing-store import/export logic.
790
- func WriteSwingStoreExportToDirectory(provider SwingStoreExportProvider, exportDir string) error {
790
+ func WriteSwingStoreExportToDirectory(provider SwingStoreExportProvider, exportDir string) (err error) {
791
+ handleDeferError := func(fn func() error) {
792
+ deferError := fn()
793
+ if err == nil {
794
+ err = deferError
795
+ } else if deferError != nil {
796
+ // Safe to wrap error and use detailed error info since this error
797
+ // will not go back into swingset layers
798
+ err = sdkioerrors.Wrapf(err, "deferred error %+v", deferError)
799
+ }
800
+ }
801
+
791
802
  manifest := exportManifest{
792
803
  BlockHeight: provider.BlockHeight,
793
804
  }
@@ -798,14 +809,14 @@ func WriteSwingStoreExportToDirectory(provider SwingStoreExportProvider, exportD
798
809
  }
799
810
 
800
811
  if exportDataReader != nil {
801
- defer exportDataReader.Close()
812
+ defer handleDeferError(exportDataReader.Close)
802
813
 
803
814
  manifest.Data = exportDataFilename
804
815
  exportDataFile, err := os.OpenFile(filepath.Join(exportDir, exportDataFilename), os.O_CREATE|os.O_WRONLY, exportedFilesMode)
805
816
  if err != nil {
806
817
  return err
807
818
  }
808
- defer exportDataFile.Close()
819
+ defer handleDeferError(exportDataFile.Close)
809
820
 
810
821
  err = agoric.EncodeKVEntryReaderToJsonl(exportDataReader, exportDataFile)
811
822
  if err != nil {
@@ -0,0 +1,16 @@
1
+ package keeper
2
+
3
+ import (
4
+ "testing"
5
+
6
+ "github.com/Agoric/agoric-sdk/golang/cosmos/x/vstorage"
7
+ )
8
+
9
+ // GetVstorageKeeper returns the vstorage keeper from the swingset keeper
10
+ // for testing purposes.
11
+ func GetVstorageKeeper(t *testing.T, k Keeper) vstorage.Keeper {
12
+ if t == nil {
13
+ panic("this function is reserved for testing")
14
+ }
15
+ return k.vstorageKeeper
16
+ }
@@ -5,7 +5,6 @@ import (
5
5
  "encoding/json"
6
6
  "fmt"
7
7
 
8
- "github.com/gorilla/mux"
9
8
  "github.com/grpc-ecosystem/grpc-gateway/runtime"
10
9
  "github.com/spf13/cobra"
11
10
 
@@ -60,10 +59,6 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod
60
59
  return ValidateGenesis(&data)
61
60
  }
62
61
 
63
- // Register rest routes
64
- func (AppModuleBasic) RegisterRESTRoutes(ctx client.Context, rtr *mux.Router) {
65
- }
66
-
67
62
  func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
68
63
  _ = types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx))
69
64
  }
@@ -104,6 +99,11 @@ func (AppModule) Name() string {
104
99
  return ModuleName
105
100
  }
106
101
 
102
+ // For testing purposes
103
+ func (am *AppModule) SetSwingStoreExportDir(dir string) {
104
+ am.swingStoreExportDir = dir
105
+ }
106
+
107
107
  func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {}
108
108
 
109
109
  func (am AppModule) Route() sdk.Route {
@@ -154,9 +154,9 @@ func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.V
154
154
  return []abci.ValidatorUpdate{}
155
155
  }
156
156
 
157
- func (am AppModule) checkSwingStoreExportSetup() {
157
+ func (am *AppModule) checkSwingStoreExportSetup() {
158
158
  if am.swingStoreExportDir == "" {
159
- panic(fmt.Errorf("SwingStore export dir not set"))
159
+ am.swingStoreExportDir = "/tmp/swingset_export"
160
160
  }
161
161
  }
162
162
 
@@ -1,6 +1,7 @@
1
1
  package swingset
2
2
 
3
3
  import (
4
+ sdkioerrors "cosmossdk.io/errors"
4
5
  sdk "github.com/cosmos/cosmos-sdk/types"
5
6
  sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
6
7
  govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
@@ -17,7 +18,7 @@ func NewSwingSetProposalHandler(k keeper.Keeper) govv1beta1.Handler {
17
18
  return k.CoreEvalProposal(ctx, c)
18
19
 
19
20
  default:
20
- return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized swingset proposal content type: %T", c)
21
+ return sdkioerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized swingset proposal content type: %T", c)
21
22
  }
22
23
  }
23
24
  }
@@ -0,0 +1,17 @@
1
+ package testing
2
+
3
+ import (
4
+ "testing"
5
+
6
+ "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/keeper"
7
+ vstoragetesting "github.com/Agoric/agoric-sdk/golang/cosmos/x/vstorage/testing"
8
+ sdk "github.com/cosmos/cosmos-sdk/types"
9
+ )
10
+
11
+ // GetActionQueueRecords returns the records in the action queue.
12
+ // This is a testing utility function.
13
+ func GetActionQueueRecords(t *testing.T, ctx sdk.Context, swingsetKeeper keeper.Keeper) ([]string, error) {
14
+ vstorageKeeper := keeper.GetVstorageKeeper(t, swingsetKeeper)
15
+ actionQueueName := keeper.StoragePathActionQueue
16
+ return vstoragetesting.GetQueueItems(ctx, vstorageKeeper, actionQueueName)
17
+ }
@@ -55,7 +55,7 @@ var (
55
55
  DefaultBeansPerStorageByte = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(500)) // $0.002
56
56
  DefaultBeansPerSmartWalletProvision = DefaultBeansPerFeeUnit // $1
57
57
 
58
- DefaultBootstrapVatConfig = "@agoric/vats/decentral-core-config.json"
58
+ DefaultBootstrapVatConfig = "@agoric/vm-config/decentral-core-config.json"
59
59
 
60
60
  DefaultPowerFlagFees = []PowerFlagFee{
61
61
  NewPowerFlagFee(PowerFlagSmartWallet, sdk.NewCoins(sdk.NewInt64Coin("ubld", 10_000_000))),
@@ -1,6 +1,7 @@
1
1
  package types
2
2
 
3
3
  import (
4
+ sdkmath "cosmossdk.io/math"
4
5
  sdk "github.com/cosmos/cosmos-sdk/types"
5
6
  authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
6
7
  )
@@ -21,8 +22,8 @@ type AccountKeeper interface {
21
22
  }
22
23
 
23
24
  type SwingSetKeeper interface {
24
- GetBeansPerUnit(ctx sdk.Context) map[string]sdk.Uint
25
- ChargeBeans(ctx sdk.Context, addr sdk.AccAddress, beans sdk.Uint) error
25
+ GetBeansPerUnit(ctx sdk.Context) map[string]sdkmath.Uint
26
+ ChargeBeans(ctx sdk.Context, addr sdk.AccAddress, beans sdkmath.Uint) error
26
27
  IsHighPriorityAddress(ctx sdk.Context, addr sdk.AccAddress) (bool, error)
27
28
  GetSmartWalletState(ctx sdk.Context, addr sdk.AccAddress) SmartWalletState
28
29
  ChargeForSmartWallet(ctx sdk.Context, addr sdk.AccAddress) error
@@ -25,9 +25,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
25
25
 
26
26
  // The initial or exported state.
27
27
  type GenesisState struct {
28
- Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
29
- State State `protobuf:"bytes,3,opt,name=state,proto3" json:"state"`
30
- SwingStoreExportData []*SwingStoreExportDataEntry `protobuf:"bytes,4,rep,name=swing_store_export_data,json=swingStoreExportData,proto3" json:"swingStoreExportData"`
28
+ Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
29
+ State State `protobuf:"bytes,3,opt,name=state,proto3" json:"state"`
30
+ SwingStoreExportData []*SwingStoreExportDataEntry `protobuf:"bytes,4,rep,name=swing_store_export_data,json=swingStoreExportData,proto3" json:"swingStoreExportData"`
31
+ SwingStoreExportDataHash string `protobuf:"bytes,5,opt,name=swing_store_export_data_hash,json=swingStoreExportDataHash,proto3" json:"swingStoreExportDataHash"`
31
32
  }
32
33
 
33
34
  func (m *GenesisState) Reset() { *m = GenesisState{} }
@@ -84,6 +85,13 @@ func (m *GenesisState) GetSwingStoreExportData() []*SwingStoreExportDataEntry {
84
85
  return nil
85
86
  }
86
87
 
88
+ func (m *GenesisState) GetSwingStoreExportDataHash() string {
89
+ if m != nil {
90
+ return m.SwingStoreExportDataHash
91
+ }
92
+ return ""
93
+ }
94
+
87
95
  // A SwingStore "export data" entry.
88
96
  type SwingStoreExportDataEntry struct {
89
97
  Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
@@ -145,28 +153,30 @@ func init() {
145
153
  func init() { proto.RegisterFile("agoric/swingset/genesis.proto", fileDescriptor_49b057311de9d296) }
146
154
 
147
155
  var fileDescriptor_49b057311de9d296 = []byte{
148
- // 334 bytes of a gzipped FileDescriptorProto
149
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xcf, 0x4b, 0x02, 0x41,
150
- 0x1c, 0xc5, 0x77, 0xf2, 0x07, 0x38, 0x06, 0xc5, 0x22, 0xb9, 0x09, 0x8d, 0xe2, 0x49, 0x82, 0x76,
151
- 0xc0, 0xe8, 0x52, 0xa7, 0x2c, 0xe9, 0x1a, 0x2b, 0x5d, 0xba, 0xc8, 0xa8, 0xc3, 0xb4, 0xa8, 0x3b,
152
- 0xcb, 0x7c, 0xc7, 0x52, 0xfa, 0x27, 0xfa, 0x13, 0xfa, 0x73, 0x3c, 0x7a, 0xec, 0x24, 0xa1, 0x97,
153
- 0xe8, 0x6f, 0xe8, 0x10, 0x3b, 0xa3, 0x04, 0x6a, 0xb7, 0xb7, 0xfb, 0x79, 0xef, 0x0d, 0x33, 0x0f,
154
- 0x9f, 0x30, 0x21, 0x55, 0xd8, 0xa5, 0xf0, 0x12, 0x46, 0x02, 0xb8, 0xa6, 0x82, 0x47, 0x1c, 0x42,
155
- 0xf0, 0x63, 0x25, 0xb5, 0x74, 0x0f, 0x2c, 0xf6, 0xd7, 0xb8, 0x54, 0x10, 0x52, 0x48, 0xc3, 0x68,
156
- 0xa2, 0xac, 0xad, 0x44, 0x36, 0x5b, 0xd6, 0xc2, 0xf2, 0xea, 0x0f, 0xc2, 0xfb, 0x77, 0xb6, 0xb8,
157
- 0xa5, 0x99, 0xe6, 0xee, 0x05, 0xce, 0xc6, 0x4c, 0xb1, 0x21, 0x78, 0x7b, 0x15, 0x54, 0xcb, 0xd7,
158
- 0x8b, 0xfe, 0xc6, 0x41, 0xfe, 0xbd, 0xc1, 0x8d, 0xf4, 0x74, 0x5e, 0x76, 0x82, 0x95, 0xd9, 0xad,
159
- 0xe3, 0x0c, 0x24, 0x79, 0x2f, 0x65, 0x52, 0x47, 0x5b, 0x29, 0xd3, 0xbe, 0x0a, 0x59, 0xab, 0xfb,
160
- 0x8a, 0x8b, 0x06, 0xb7, 0x41, 0x4b, 0xc5, 0xdb, 0x7c, 0x1c, 0x4b, 0xa5, 0xdb, 0x3d, 0xa6, 0x99,
161
- 0x97, 0xae, 0xa4, 0x6a, 0xf9, 0xfa, 0xe9, 0x76, 0x4b, 0x22, 0x5a, 0x89, 0xbd, 0x69, 0xdc, 0xb7,
162
- 0x4c, 0xb3, 0x66, 0xa4, 0xd5, 0xa4, 0xe1, 0x7d, 0xcf, 0xcb, 0x05, 0xd8, 0x81, 0x83, 0x9d, 0x7f,
163
- 0x2f, 0xd3, 0x5f, 0xef, 0x65, 0xa7, 0x7a, 0x83, 0x8f, 0xff, 0xad, 0x74, 0x0f, 0x71, 0xaa, 0xcf,
164
- 0x27, 0x1e, 0xaa, 0xa0, 0x5a, 0x2e, 0x48, 0xa4, 0x5b, 0xc0, 0x99, 0x67, 0x36, 0x18, 0x71, 0xf3,
165
- 0x36, 0xb9, 0xc0, 0x7e, 0x34, 0x1e, 0xa6, 0x0b, 0x82, 0x66, 0x0b, 0x82, 0x3e, 0x17, 0x04, 0xbd,
166
- 0x2d, 0x89, 0x33, 0x5b, 0x12, 0xe7, 0x63, 0x49, 0x9c, 0xc7, 0x2b, 0x11, 0xea, 0xa7, 0x51, 0xc7,
167
- 0xef, 0xca, 0x21, 0xbd, 0xb6, 0x43, 0xd8, 0x1b, 0x9d, 0x41, 0xaf, 0x4f, 0x85, 0x1c, 0xb0, 0x48,
168
- 0xd0, 0xae, 0x84, 0xa1, 0x04, 0x3a, 0xfe, 0xdb, 0x48, 0x4f, 0x62, 0x0e, 0x9d, 0xac, 0x59, 0xe8,
169
- 0xfc, 0x37, 0x00, 0x00, 0xff, 0xff, 0x94, 0xe9, 0x22, 0x36, 0x09, 0x02, 0x00, 0x00,
156
+ // 363 bytes of a gzipped FileDescriptorProto
157
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcd, 0x4a, 0xc3, 0x40,
158
+ 0x14, 0x85, 0x93, 0xfe, 0x41, 0xa7, 0x82, 0x12, 0x8a, 0x8d, 0xa5, 0x26, 0xa5, 0xab, 0x22, 0x98,
159
+ 0x40, 0xc5, 0x8d, 0xae, 0x8c, 0x16, 0x5d, 0x4a, 0x8a, 0x1b, 0x11, 0xc2, 0xb4, 0x1d, 0x26, 0xa1,
160
+ 0x6d, 0x26, 0xe4, 0x4e, 0xb5, 0xc5, 0x97, 0xf0, 0x11, 0x7c, 0x9c, 0x2e, 0xbb, 0x14, 0x17, 0x45,
161
+ 0xda, 0x8d, 0xf4, 0x29, 0x24, 0x33, 0x2d, 0x42, 0x7f, 0x76, 0x27, 0xf9, 0xce, 0x39, 0x37, 0xdc,
162
+ 0x1b, 0x74, 0x8a, 0x29, 0x8b, 0x83, 0x8e, 0x0d, 0x6f, 0x41, 0x48, 0x81, 0x70, 0x9b, 0x92, 0x90,
163
+ 0x40, 0x00, 0x56, 0x14, 0x33, 0xce, 0xb4, 0x43, 0x89, 0xad, 0x35, 0x2e, 0x17, 0x29, 0xa3, 0x4c,
164
+ 0x30, 0x3b, 0x51, 0xd2, 0x56, 0x36, 0x36, 0x5b, 0xd6, 0x42, 0xf2, 0xda, 0x77, 0x0a, 0x1d, 0xdc,
165
+ 0xcb, 0xe2, 0x16, 0xc7, 0x9c, 0x68, 0x97, 0x28, 0x17, 0xe1, 0x18, 0x0f, 0x40, 0x4f, 0x55, 0xd5,
166
+ 0x7a, 0xa1, 0x51, 0xb2, 0x36, 0x06, 0x59, 0x8f, 0x02, 0x3b, 0x99, 0xc9, 0xcc, 0x54, 0xdc, 0x95,
167
+ 0x59, 0x6b, 0xa0, 0x2c, 0x24, 0x79, 0x3d, 0x2d, 0x52, 0xc7, 0x5b, 0x29, 0xd1, 0xbe, 0x0a, 0x49,
168
+ 0xab, 0xf6, 0x8e, 0x4a, 0x02, 0x7b, 0xc0, 0x59, 0x4c, 0x3c, 0x32, 0x8a, 0x58, 0xcc, 0xbd, 0x2e,
169
+ 0xe6, 0x58, 0xcf, 0x54, 0xd3, 0xf5, 0x42, 0xe3, 0x6c, 0xbb, 0x25, 0x11, 0xad, 0xc4, 0xde, 0x14,
170
+ 0xee, 0x3b, 0xcc, 0x71, 0x33, 0xe4, 0xf1, 0xd8, 0xd1, 0x97, 0x33, 0xb3, 0x08, 0x3b, 0xb0, 0xbb,
171
+ 0xf3, 0xad, 0xf6, 0x82, 0x2a, 0x7b, 0x86, 0x7b, 0x3e, 0x06, 0x5f, 0xcf, 0x56, 0xd5, 0x7a, 0xde,
172
+ 0xa9, 0x2c, 0x67, 0xa6, 0xbe, 0x2b, 0xff, 0x80, 0xc1, 0x77, 0xf7, 0x92, 0xab, 0xcc, 0xef, 0xa7,
173
+ 0xa9, 0xd4, 0x6e, 0xd1, 0xc9, 0xde, 0x0f, 0xd6, 0x8e, 0x50, 0xba, 0x47, 0xc6, 0xba, 0x9a, 0xcc,
174
+ 0x71, 0x13, 0xa9, 0x15, 0x51, 0xf6, 0x15, 0xf7, 0x87, 0x44, 0x6c, 0x3e, 0xef, 0xca, 0x07, 0xe7,
175
+ 0x69, 0x32, 0x37, 0xd4, 0xe9, 0xdc, 0x50, 0x7f, 0xe6, 0x86, 0xfa, 0xb1, 0x30, 0x94, 0xe9, 0xc2,
176
+ 0x50, 0xbe, 0x16, 0x86, 0xf2, 0x7c, 0x4d, 0x03, 0xee, 0x0f, 0xdb, 0x56, 0x87, 0x0d, 0xec, 0x1b,
177
+ 0x79, 0x66, 0xb9, 0xaf, 0x73, 0xe8, 0xf6, 0x6c, 0xca, 0xfa, 0x38, 0xa4, 0x76, 0x87, 0xc1, 0x80,
178
+ 0x81, 0x3d, 0xfa, 0xff, 0x03, 0xf8, 0x38, 0x22, 0xd0, 0xce, 0x89, 0xfb, 0x5f, 0xfc, 0x05, 0x00,
179
+ 0x00, 0xff, 0xff, 0x1b, 0x95, 0x41, 0xea, 0x67, 0x02, 0x00, 0x00,
170
180
  }
171
181
 
172
182
  func (m *GenesisState) Marshal() (dAtA []byte, err error) {
@@ -189,6 +199,13 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
189
199
  _ = i
190
200
  var l int
191
201
  _ = l
202
+ if len(m.SwingStoreExportDataHash) > 0 {
203
+ i -= len(m.SwingStoreExportDataHash)
204
+ copy(dAtA[i:], m.SwingStoreExportDataHash)
205
+ i = encodeVarintGenesis(dAtA, i, uint64(len(m.SwingStoreExportDataHash)))
206
+ i--
207
+ dAtA[i] = 0x2a
208
+ }
192
209
  if len(m.SwingStoreExportData) > 0 {
193
210
  for iNdEx := len(m.SwingStoreExportData) - 1; iNdEx >= 0; iNdEx-- {
194
211
  {
@@ -290,6 +307,10 @@ func (m *GenesisState) Size() (n int) {
290
307
  n += 1 + l + sovGenesis(uint64(l))
291
308
  }
292
309
  }
310
+ l = len(m.SwingStoreExportDataHash)
311
+ if l > 0 {
312
+ n += 1 + l + sovGenesis(uint64(l))
313
+ }
293
314
  return n
294
315
  }
295
316
 
@@ -445,6 +466,38 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error {
445
466
  return err
446
467
  }
447
468
  iNdEx = postIndex
469
+ case 5:
470
+ if wireType != 2 {
471
+ return fmt.Errorf("proto: wrong wireType = %d for field SwingStoreExportDataHash", wireType)
472
+ }
473
+ var stringLen uint64
474
+ for shift := uint(0); ; shift += 7 {
475
+ if shift >= 64 {
476
+ return ErrIntOverflowGenesis
477
+ }
478
+ if iNdEx >= l {
479
+ return io.ErrUnexpectedEOF
480
+ }
481
+ b := dAtA[iNdEx]
482
+ iNdEx++
483
+ stringLen |= uint64(b&0x7F) << shift
484
+ if b < 0x80 {
485
+ break
486
+ }
487
+ }
488
+ intStringLen := int(stringLen)
489
+ if intStringLen < 0 {
490
+ return ErrInvalidLengthGenesis
491
+ }
492
+ postIndex := iNdEx + intStringLen
493
+ if postIndex < 0 {
494
+ return ErrInvalidLengthGenesis
495
+ }
496
+ if postIndex > l {
497
+ return io.ErrUnexpectedEOF
498
+ }
499
+ m.SwingStoreExportDataHash = string(dAtA[iNdEx:postIndex])
500
+ iNdEx = postIndex
448
501
  default:
449
502
  iNdEx = preIndex
450
503
  skippy, err := skipGenesis(dAtA[iNdEx:])