@agoric/cosmos 0.34.2-dev-f30b379.0 → 0.34.2-dev-64cb69f.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 (47) hide show
  1. package/Makefile +21 -6
  2. package/ante/ante.go +7 -5
  3. package/app/app.go +55 -43
  4. package/daemon/cmd/genaccounts.go +8 -4
  5. package/daemon/cmd/root.go +17 -6
  6. package/daemon/cmd/root_test.go +1 -1
  7. package/daemon/cmd/testnet.go +1 -1
  8. package/daemon/main.go +1 -1
  9. package/git-revision.txt +1 -1
  10. package/go.mod +95 -64
  11. package/go.sum +590 -241
  12. package/package.json +2 -2
  13. package/scripts/protocgen.sh +1 -1
  14. package/third_party/proto/buf.yaml +1 -0
  15. package/third_party/proto/cosmos/base/query/v1beta1/pagination.proto +2 -1
  16. package/third_party/proto/cosmos/base/v1beta1/coin.proto +7 -4
  17. package/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +14 -6
  18. package/third_party/proto/cosmos_proto/cosmos.proto +84 -3
  19. package/third_party/proto/google/api/annotations.proto +1 -1
  20. package/third_party/proto/google/api/http.proto +181 -120
  21. package/third_party/proto/google/api/httpbody.proto +9 -6
  22. package/third_party/proto/google/protobuf/any.proto +1 -7
  23. package/third_party/proto/ibc/core/channel/v1/channel.proto +1 -1
  24. package/third_party/proto/ibc/core/client/v1/client.proto +1 -1
  25. package/upgradegaia.sh +13 -4
  26. package/x/lien/keeper/account.go +3 -3
  27. package/x/lien/keeper/keeper.go +5 -4
  28. package/x/lien/keeper/keeper_test.go +8 -8
  29. package/x/lien/lien_test.go +1 -1
  30. package/x/swingset/client/cli/tx.go +2 -2
  31. package/x/swingset/client/proposal_handler.go +2 -17
  32. package/x/swingset/keeper/keeper.go +7 -4
  33. package/x/swingset/keeper/keeper_test.go +1 -1
  34. package/x/swingset/proposal_handler.go +3 -3
  35. package/x/swingset/types/codec.go +2 -2
  36. package/x/swingset/types/proposal.go +5 -5
  37. package/x/vbank/keeper/keeper.go +3 -2
  38. package/x/vbank/keeper/rewards.go +1 -1
  39. package/x/vbank/vbank_test.go +3 -3
  40. package/x/vibc/ibc.go +4 -4
  41. package/x/vibc/keeper/keeper.go +7 -6
  42. package/x/vibc/types/expected_keepers.go +3 -3
  43. package/x/vibc/types/msgs.go +1 -1
  44. package/x/vibc/types/msgs.pb.go +1 -1
  45. package/x/vstorage/keeper/keeper.go +3 -2
  46. package/x/vstorage/keeper/keeper_test.go +1 -1
  47. package/x/vstorage/vstorage_test.go +1 -1
package/Makefile CHANGED
@@ -98,16 +98,20 @@ proto-lint: proto-tools
98
98
  proto-check-breaking: proto-tools
99
99
  ${BIN}/buf breaking --against $(PR_TARGET_REPO)#branch=$(PR_TARGET_BRANCH),subdir=golang/cosmos
100
100
 
101
- GOGO_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/gogo/protobuf)
102
- IBC_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/ibc-go/v4)/proto/ibc/core
103
- COSMOS_PROTO_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/regen-network/cosmos-proto)
101
+ GOGO_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/gogo/protobuf)
102
+ # GOOGLE_API_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/googleapis/googleapis)/google/api
103
+ IBC_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/ibc-go/v5)/proto/ibc/core
104
+ COSMOS_PROTO_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/cosmos-proto)/proto/cosmos_proto
104
105
  COSMOS_SDK_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/cosmos-sdk)/proto/cosmos
105
106
 
106
107
  COSMOS_PROTO_TYPES = third_party/proto/cosmos_proto
107
108
  GOGO_PROTO_TYPES = third_party/proto/gogoproto
109
+ GOOGLE_API_TYPES = third_party/proto/google/api
110
+ GOOGLE_PROTO_TYPES = third_party/proto/google/protobuf
108
111
  IBC_CHANNEL_TYPES = third_party/proto/ibc/core/channel/v1
109
112
  IBC_CLIENT_TYPES = third_party/proto/ibc/core/client/v1
110
- SDK_QUERY_TYPES = third_party/proto/cosmos/base/query/v1beta1
113
+ SDK_BASE_TYPES = third_party/proto/cosmos/base/v1beta1
114
+ SDK_QUERY_TYPES = third_party/proto/cosmos/base/query/v1beta1
111
115
  SDK_UPGRADE_TYPES = third_party/proto/cosmos/upgrade/v1beta1
112
116
 
113
117
  proto-update-deps:
@@ -117,23 +121,34 @@ proto-update-deps:
117
121
  mkdir -p $(GOGO_PROTO_TYPES)
118
122
  curl -sSL $(GOGO_PROTO_URL)/gogoproto/gogo.proto > $(GOGO_PROTO_TYPES)/gogo.proto
119
123
 
124
+ # Downloading from a not-a-go-module is problematic. These files are artifacts for now.
125
+ # mkdir -p $(GOOGLE_API_TYPES)
126
+ # curl -sSL $(GOOGLE_API_URL)/annotations.proto > $(GOOGLE_API_TYPES)/annotations.proto
127
+ # curl -sSL $(GOOGLE_API_URL)/http.proto > $(GOOGLE_API_TYPES)/http.proto
128
+ # curl -sSL $(GOOGLE_API_URL)/httpbody.proto > $(GOOGLE_API_TYPES)/httpbody.proto
129
+
130
+ mkdir -p $(GOOGLE_PROTO_TYPES)
131
+ curl -sSL $(GOGO_PROTO_URL)/protobuf/google/protobuf/any.proto > $(GOOGLE_PROTO_TYPES)/any.proto
132
+
120
133
  mkdir -p $(IBC_CHANNEL_TYPES)
121
134
  curl -sSL $(IBC_PROTO_URL)/channel/v1/channel.proto > $(IBC_CHANNEL_TYPES)/channel.proto
122
135
 
123
136
  mkdir -p $(IBC_CLIENT_TYPES)
124
137
  curl -sSL $(IBC_PROTO_URL)/client/v1/client.proto > $(IBC_CLIENT_TYPES)/client.proto
125
138
 
139
+ mkdir -p $(SDK_BASE_TYPES)
140
+ curl -sSL $(COSMOS_SDK_PROTO_URL)/base/v1beta1/coin.proto > $(SDK_BASE_TYPES)/coin.proto
141
+
126
142
  mkdir -p $(SDK_QUERY_TYPES)
127
143
  curl -sSL $(COSMOS_SDK_PROTO_URL)/base/query/v1beta1/pagination.proto > $(SDK_QUERY_TYPES)/pagination.proto
128
144
 
129
145
  mkdir -p $(SDK_UPGRADE_TYPES)
130
146
  curl -sSL $(COSMOS_SDK_PROTO_URL)/upgrade/v1beta1/upgrade.proto > $(SDK_UPGRADE_TYPES)/upgrade.proto
131
147
 
132
-
133
148
  UNAME_S ?= $(shell uname -s)
134
149
  UNAME_M ?= $(shell uname -m)
135
150
 
136
- BUF_VERSION ?= 0.56.0
151
+ BUF_VERSION ?= 1.0.0
137
152
 
138
153
  PROTOC_VERSION ?= 3.11.2
139
154
  ifeq ($(UNAME_S),Linux)
package/ante/ante.go CHANGED
@@ -4,8 +4,8 @@ import (
4
4
  sdk "github.com/cosmos/cosmos-sdk/types"
5
5
  sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
6
6
  "github.com/cosmos/cosmos-sdk/x/auth/ante"
7
- ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
8
- ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
7
+ ibcante "github.com/cosmos/ibc-go/v5/modules/core/ante"
8
+ ibckeeper "github.com/cosmos/ibc-go/v5/modules/core/keeper"
9
9
  )
10
10
 
11
11
  // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
@@ -43,8 +43,10 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) {
43
43
 
44
44
  anteDecorators := []sdk.AnteDecorator{
45
45
  ante.NewSetUpContextDecorator(),
46
- ante.NewRejectExtensionOptionsDecorator(),
47
- ante.NewMempoolFeeDecorator(),
46
+ ante.NewExtensionOptionsDecorator(nil), // reject all extensions
47
+ // former ante.NewMempoolFeeDecorator()
48
+ // replaced as in https://github.com/provenance-io/provenance/pull/1016
49
+ ante.NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, nil),
48
50
  ante.NewValidateBasicDecorator(),
49
51
  ante.NewTxTimeoutHeightDecorator(),
50
52
  ante.NewValidateMemoDecorator(opts.AccountKeeper),
@@ -58,7 +60,7 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) {
58
60
  ante.NewSigVerificationDecorator(opts.AccountKeeper, opts.SignModeHandler),
59
61
  NewAdmissionDecorator(opts.AdmissionData),
60
62
  ante.NewIncrementSequenceDecorator(opts.AccountKeeper),
61
- ibcante.NewAnteDecorator(opts.IBCKeeper),
63
+ ibcante.NewRedundantRelayDecorator(opts.IBCKeeper),
62
64
  }
63
65
 
64
66
  return sdk.ChainAnteDecorators(anteDecorators...), nil
package/app/app.go CHANGED
@@ -14,8 +14,8 @@ import (
14
14
 
15
15
  "github.com/cosmos/cosmos-sdk/baseapp"
16
16
  "github.com/cosmos/cosmos-sdk/client"
17
+ nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
17
18
  "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
18
- "github.com/cosmos/cosmos-sdk/client/rpc"
19
19
  "github.com/cosmos/cosmos-sdk/codec"
20
20
  "github.com/cosmos/cosmos-sdk/codec/types"
21
21
  "github.com/cosmos/cosmos-sdk/server/api"
@@ -29,7 +29,6 @@ import (
29
29
  "github.com/cosmos/cosmos-sdk/version"
30
30
  "github.com/cosmos/cosmos-sdk/x/auth"
31
31
  "github.com/cosmos/cosmos-sdk/x/auth/ante"
32
- authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest"
33
32
  authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
34
33
  authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation"
35
34
  authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
@@ -59,8 +58,11 @@ import (
59
58
  "github.com/cosmos/cosmos-sdk/x/genutil"
60
59
  genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
61
60
  "github.com/cosmos/cosmos-sdk/x/gov"
61
+ govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
62
62
  govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
63
63
  govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
64
+ govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
65
+ govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
64
66
  "github.com/cosmos/cosmos-sdk/x/mint"
65
67
  mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
66
68
  minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
@@ -79,22 +81,22 @@ import (
79
81
  upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
80
82
  upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
81
83
  upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
82
- ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts"
83
-
84
- icahost "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host"
85
- icahostkeeper "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/keeper"
86
- icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
87
- icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"
88
- "github.com/cosmos/ibc-go/v4/modules/apps/transfer"
89
- ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper"
90
- ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
91
- ibc "github.com/cosmos/ibc-go/v4/modules/core"
92
- ibcclient "github.com/cosmos/ibc-go/v4/modules/core/02-client"
93
- ibcclientclient "github.com/cosmos/ibc-go/v4/modules/core/02-client/client"
94
- ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
95
- porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types"
96
- ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
97
- ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
84
+ ica "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts"
85
+
86
+ icahost "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host"
87
+ icahostkeeper "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/keeper"
88
+ icahosttypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/types"
89
+ icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types"
90
+ "github.com/cosmos/ibc-go/v5/modules/apps/transfer"
91
+ ibctransferkeeper "github.com/cosmos/ibc-go/v5/modules/apps/transfer/keeper"
92
+ ibctransfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types"
93
+ ibc "github.com/cosmos/ibc-go/v5/modules/core"
94
+ ibcclient "github.com/cosmos/ibc-go/v5/modules/core/02-client"
95
+ ibcclientclient "github.com/cosmos/ibc-go/v5/modules/core/02-client/client"
96
+ ibcclienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types"
97
+ porttypes "github.com/cosmos/ibc-go/v5/modules/core/05-port/types"
98
+ ibchost "github.com/cosmos/ibc-go/v5/modules/core/24-host"
99
+ ibckeeper "github.com/cosmos/ibc-go/v5/modules/core/keeper"
98
100
  "github.com/gorilla/mux"
99
101
  "github.com/rakyll/statik/fs"
100
102
  "github.com/spf13/cast"
@@ -149,15 +151,15 @@ var (
149
151
  staking.AppModuleBasic{},
150
152
  mint.AppModuleBasic{},
151
153
  distr.AppModuleBasic{},
152
- gov.NewAppModuleBasic(
154
+ gov.NewAppModuleBasic([]govclient.ProposalHandler{
153
155
  paramsclient.ProposalHandler,
154
156
  distrclient.ProposalHandler,
155
- upgradeclient.ProposalHandler,
156
- upgradeclient.CancelProposalHandler,
157
+ upgradeclient.LegacyProposalHandler,
158
+ upgradeclient.LegacyCancelProposalHandler,
157
159
  ibcclientclient.UpdateClientProposalHandler,
158
160
  ibcclientclient.UpgradeProposalHandler,
159
161
  swingsetclient.CoreEvalProposalHandler,
160
- ),
162
+ }),
161
163
  params.AppModuleBasic{},
162
164
  slashing.AppModuleBasic{},
163
165
  feegrantmodule.AppModuleBasic{},
@@ -219,9 +221,9 @@ type GaiaApp struct { // nolint: golint
219
221
  invCheckPeriod uint
220
222
 
221
223
  // keys to access the substores
222
- keys map[string]*sdk.KVStoreKey
223
- tkeys map[string]*sdk.TransientStoreKey
224
- memKeys map[string]*sdk.MemoryStoreKey
224
+ keys map[string]*storetypes.KVStoreKey
225
+ tkeys map[string]*storetypes.TransientStoreKey
226
+ memKeys map[string]*storetypes.MemoryStoreKey
225
227
 
226
228
  // keepers
227
229
  AccountKeeper authkeeper.AccountKeeper
@@ -341,7 +343,7 @@ func NewAgoricApp(
341
343
 
342
344
  // set the BaseApp's parameter store
343
345
  bApp.SetParamStore(
344
- app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable()),
346
+ app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()),
345
347
  )
346
348
 
347
349
  // add capability keeper and ScopeToModule for ibc module
@@ -359,6 +361,7 @@ func NewAgoricApp(
359
361
  app.GetSubspace(authtypes.ModuleName),
360
362
  authtypes.ProtoBaseAccount,
361
363
  maccPerms,
364
+ appName,
362
365
  )
363
366
  wrappedAccountKeeper := lien.NewWrappedAccountKeeper(innerAk)
364
367
  app.AccountKeeper = wrappedAccountKeeper
@@ -373,6 +376,7 @@ func NewAgoricApp(
373
376
  keys[authzkeeper.StoreKey],
374
377
  appCodec,
375
378
  app.BaseApp.MsgServiceRouter(),
379
+ app.AccountKeeper,
376
380
  )
377
381
  app.FeeGrantKeeper = feegrantkeeper.NewKeeper(
378
382
  appCodec,
@@ -404,7 +408,6 @@ func NewAgoricApp(
404
408
  &stakingKeeper,
405
409
  // This is the pool to distribute from immediately. DO NOT ALTER.
406
410
  vbanktypes.GiveawayPoolName,
407
- app.ModuleAccountAddrs(),
408
411
  )
409
412
  app.SlashingKeeper = slashingkeeper.NewKeeper(
410
413
  appCodec,
@@ -418,6 +421,7 @@ func NewAgoricApp(
418
421
  appCodec,
419
422
  homePath,
420
423
  app.BaseApp,
424
+ authtypes.NewModuleAddress(govtypes.ModuleName).String(),
421
425
  )
422
426
 
423
427
  // register the staking hooks
@@ -523,14 +527,15 @@ func NewAgoricApp(
523
527
  app.lienPort = vm.RegisterPortHandler("lien", lien.NewPortHandler(app.LienKeeper))
524
528
 
525
529
  // register the proposal types
526
- govRouter := govtypes.NewRouter()
530
+ govRouter := govv1beta1.NewRouter()
527
531
  govRouter.
528
- AddRoute(govtypes.RouterKey, govtypes.ProposalHandler).
532
+ AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler).
529
533
  AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
530
534
  AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)).
531
535
  AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
532
536
  AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
533
537
  AddRoute(swingsettypes.RouterKey, swingset.NewSwingSetProposalHandler(app.SwingSetKeeper))
538
+ govConfig := govtypes.DefaultConfig()
534
539
 
535
540
  app.GovKeeper = govkeeper.NewKeeper(
536
541
  appCodec,
@@ -540,6 +545,8 @@ func NewAgoricApp(
540
545
  app.BankKeeper,
541
546
  &stakingKeeper,
542
547
  govRouter,
548
+ app.BaseApp.MsgServiceRouter(),
549
+ govConfig,
543
550
  )
544
551
 
545
552
  app.TransferKeeper = ibctransferkeeper.NewKeeper(
@@ -560,6 +567,7 @@ func NewAgoricApp(
560
567
  appCodec, keys[icahosttypes.StoreKey],
561
568
  app.GetSubspace(icahosttypes.SubModuleName),
562
569
  app.IBCKeeper.ChannelKeeper,
570
+ app.IBCKeeper.ChannelKeeper,
563
571
  &app.IBCKeeper.PortKeeper,
564
572
  app.AccountKeeper,
565
573
  scopedICAHostKeeper,
@@ -598,12 +606,16 @@ func NewAgoricApp(
598
606
  app.BaseApp.DeliverTx,
599
607
  encodingConfig.TxConfig,
600
608
  ),
601
- auth.NewAppModule(appCodec, app.AccountKeeper, nil),
609
+ // REVIEWER: using innerAk here instead of app.AccountKeeper
610
+ // since migration method doesn't know how to unwrap the account keeper.
611
+ // Needs access to some struct fields.
612
+ // Alternative is to add accessor methods to the AccountKeeper interface.
613
+ auth.NewAppModule(appCodec, innerAk, nil),
602
614
  vesting.NewAppModule(app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
603
615
  bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper),
604
616
  capability.NewAppModule(appCodec, *app.CapabilityKeeper),
605
617
  gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
606
- mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper),
618
+ mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil),
607
619
  slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
608
620
  distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
609
621
  staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
@@ -735,7 +747,7 @@ func NewAgoricApp(
735
747
  feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
736
748
  authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
737
749
  gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
738
- mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper),
750
+ mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil),
739
751
  staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
740
752
  distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
741
753
  slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
@@ -1098,21 +1110,21 @@ func (app *GaiaApp) InterfaceRegistry() types.InterfaceRegistry {
1098
1110
  // GetKey returns the KVStoreKey for the provided store key.
1099
1111
  //
1100
1112
  // NOTE: This is solely to be used for testing purposes.
1101
- func (app *GaiaApp) GetKey(storeKey string) *sdk.KVStoreKey {
1113
+ func (app *GaiaApp) GetKey(storeKey string) *storetypes.KVStoreKey {
1102
1114
  return app.keys[storeKey]
1103
1115
  }
1104
1116
 
1105
1117
  // GetTKey returns the TransientStoreKey for the provided store key.
1106
1118
  //
1107
1119
  // NOTE: This is solely to be used for testing purposes.
1108
- func (app *GaiaApp) GetTKey(storeKey string) *sdk.TransientStoreKey {
1120
+ func (app *GaiaApp) GetTKey(storeKey string) *storetypes.TransientStoreKey {
1109
1121
  return app.tkeys[storeKey]
1110
1122
  }
1111
1123
 
1112
1124
  // GetMemKey returns the MemStoreKey for the provided mem key.
1113
1125
  //
1114
1126
  // NOTE: This is solely used for testing purposes.
1115
- func (app *GaiaApp) GetMemKey(storeKey string) *sdk.MemoryStoreKey {
1127
+ func (app *GaiaApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey {
1116
1128
  return app.memKeys[storeKey]
1117
1129
  }
1118
1130
 
@@ -1133,16 +1145,16 @@ func (app *GaiaApp) SimulationManager() *module.SimulationManager {
1133
1145
  // API server.
1134
1146
  func (app *GaiaApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
1135
1147
  clientCtx := apiSvr.ClientCtx
1136
- rpc.RegisterRoutes(clientCtx, apiSvr.Router)
1137
- // Register legacy tx routes.
1138
- authrest.RegisterTxRoutes(clientCtx, apiSvr.Router)
1139
1148
  // Register new tx routes from grpc-gateway.
1140
1149
  authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
1150
+
1141
1151
  // Register new tendermint queries routes from grpc-gateway.
1142
1152
  tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
1143
1153
 
1144
- // Register legacy and grpc-gateway routes for all modules.
1145
- ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router)
1154
+ // Register node gRPC service for grpc-gateway.
1155
+ nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
1156
+
1157
+ // Register grpc-gateway routes for all modules.
1146
1158
  ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
1147
1159
 
1148
1160
  // register swagger API from root so that other applications can override easily
@@ -1158,7 +1170,7 @@ func (app *GaiaApp) RegisterTxService(clientCtx client.Context) {
1158
1170
 
1159
1171
  // RegisterTendermintService implements the Application.RegisterTendermintService method.
1160
1172
  func (app *GaiaApp) RegisterTendermintService(clientCtx client.Context) {
1161
- tmservice.RegisterTendermintService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.interfaceRegistry)
1173
+ tmservice.RegisterTendermintService(clientCtx, app.BaseApp.GRPCQueryRouter(), app.interfaceRegistry, app.Query)
1162
1174
  }
1163
1175
 
1164
1176
  // RegisterSwaggerAPI registers swagger route with API Server
@@ -1182,7 +1194,7 @@ func GetMaccPerms() map[string][]string {
1182
1194
  }
1183
1195
 
1184
1196
  // initParamsKeeper init params keeper and its subspaces
1185
- func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey) paramskeeper.Keeper {
1197
+ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper {
1186
1198
  paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey)
1187
1199
 
1188
1200
  paramsKeeper.Subspace(authtypes.ModuleName)
@@ -1191,7 +1203,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
1191
1203
  paramsKeeper.Subspace(minttypes.ModuleName)
1192
1204
  paramsKeeper.Subspace(distrtypes.ModuleName)
1193
1205
  paramsKeeper.Subspace(slashingtypes.ModuleName)
1194
- paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable())
1206
+ paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypesv1.ParamKeyTable())
1195
1207
  paramsKeeper.Subspace(ibctransfertypes.ModuleName)
1196
1208
  paramsKeeper.Subspace(ibchost.ModuleName)
1197
1209
  paramsKeeper.Subspace(icahosttypes.SubModuleName)
@@ -10,6 +10,7 @@ import (
10
10
 
11
11
  "github.com/cosmos/cosmos-sdk/client"
12
12
  "github.com/cosmos/cosmos-sdk/client/flags"
13
+ "github.com/cosmos/cosmos-sdk/codec"
13
14
  "github.com/cosmos/cosmos-sdk/crypto/keyring"
14
15
  "github.com/cosmos/cosmos-sdk/server"
15
16
  sdk "github.com/cosmos/cosmos-sdk/types"
@@ -27,7 +28,7 @@ const (
27
28
  )
28
29
 
29
30
  // AddGenesisAccountCmd returns add-genesis-account cobra Command.
30
- func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command {
31
+ func AddGenesisAccountCmd(cdc codec.Codec, defaultNodeHome string) *cobra.Command {
31
32
  cmd := &cobra.Command{
32
33
  Use: "add-genesis-account <address_or_key_name> <coin>[,...]",
33
34
  Short: "Add a genesis account to genesis.json",
@@ -54,17 +55,20 @@ Accounts may optionally be supplied with vesting parameters.
54
55
  }
55
56
 
56
57
  // attempt to lookup address from Keybase if no address was provided
57
- kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.KeyringDir, inBuf)
58
+ kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.KeyringDir, inBuf, cdc)
58
59
  if err != nil {
59
60
  return err
60
61
  }
61
62
 
62
63
  info, err := kb.Key(args[0])
63
64
  if err != nil {
64
- return fmt.Errorf("failed to get address from Keybase: %s", err)
65
+ return fmt.Errorf("failed to get key from Keybase: %s", err)
65
66
  }
66
67
 
67
- addr = info.GetAddress()
68
+ addr, err = info.GetAddress()
69
+ if err != nil {
70
+ return fmt.Errorf("failed to get address from Keybase: %s", err)
71
+ }
68
72
  }
69
73
 
70
74
  coins, err := sdk.ParseCoinsNormalized(args[1])
@@ -19,6 +19,7 @@ import (
19
19
  "github.com/cosmos/cosmos-sdk/server"
20
20
  servertypes "github.com/cosmos/cosmos-sdk/server/types"
21
21
  "github.com/cosmos/cosmos-sdk/snapshots"
22
+ snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types"
22
23
  "github.com/cosmos/cosmos-sdk/store"
23
24
  sdk "github.com/cosmos/cosmos-sdk/types"
24
25
  authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
@@ -29,6 +30,7 @@ import (
29
30
  "github.com/spf13/cast"
30
31
  "github.com/spf13/cobra"
31
32
  "github.com/spf13/viper"
33
+ tmcfg "github.com/tendermint/tendermint/config"
32
34
  tmcli "github.com/tendermint/tendermint/libs/cli"
33
35
  "github.com/tendermint/tendermint/libs/log"
34
36
  dbm "github.com/tendermint/tm-db"
@@ -81,7 +83,8 @@ func NewRootCmd(sender Sender) (*cobra.Command, params.EncodingConfig) {
81
83
  }
82
84
 
83
85
  customAppTemplate, customAppConfig := initAppConfig()
84
- return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig)
86
+ customTMConfig := initTendermintConfig()
87
+ return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig)
85
88
  },
86
89
  }
87
90
 
@@ -90,6 +93,12 @@ func NewRootCmd(sender Sender) (*cobra.Command, params.EncodingConfig) {
90
93
  return rootCmd, encodingConfig
91
94
  }
92
95
 
96
+ func initTendermintConfig() *tmcfg.Config {
97
+ cfg := tmcfg.DefaultConfig()
98
+ // customize config here
99
+ return cfg
100
+ }
101
+
93
102
  // initAppConfig helps to override default appConfig template and configs.
94
103
  // return "", nil if no custom configuration is required for the application.
95
104
  func initAppConfig() (string, interface{}) {
@@ -122,7 +131,7 @@ func initRootCmd(sender Sender, rootCmd *cobra.Command, encodingConfig params.En
122
131
  genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, gaia.DefaultNodeHome),
123
132
  genutilcli.GenTxCmd(gaia.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, gaia.DefaultNodeHome),
124
133
  genutilcli.ValidateGenesisCmd(gaia.ModuleBasics),
125
- AddGenesisAccountCmd(gaia.DefaultNodeHome),
134
+ AddGenesisAccountCmd(encodingConfig.Marshaler, gaia.DefaultNodeHome),
126
135
  tmcli.NewCompletionCmd(rootCmd, true),
127
136
  testnetCmd(gaia.ModuleBasics, banktypes.GenesisBalancesIterator{}),
128
137
  debug.Cmd(),
@@ -156,7 +165,7 @@ func initRootCmd(sender Sender, rootCmd *cobra.Command, encodingConfig params.En
156
165
  const (
157
166
  // FlagSplitVm is the command-line flag for subcommands that can use a
158
167
  // split-process Agoric VM. The default is to use an embedded VM.
159
- FlagSplitVm = "split-vm"
168
+ FlagSplitVm = "split-vm"
160
169
  EmbeddedVmEnvVar = "AGD_EMBEDDED_VM"
161
170
  )
162
171
 
@@ -283,6 +292,10 @@ func (ac appCreator) newApp(
283
292
  if err != nil {
284
293
  panic(err)
285
294
  }
295
+ snapshotOptions := snapshottypes.NewSnapshotOptions(
296
+ cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval)),
297
+ cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent)),
298
+ )
286
299
 
287
300
  return gaia.NewAgoricApp(
288
301
  ac.sender,
@@ -299,9 +312,7 @@ func (ac appCreator) newApp(
299
312
  baseapp.SetInterBlockCache(cache),
300
313
  baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))),
301
314
  baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))),
302
- baseapp.SetSnapshotStore(snapshotStore),
303
- baseapp.SetSnapshotInterval(cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval))),
304
- baseapp.SetSnapshotKeepRecent(cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent))),
315
+ baseapp.SetSnapshot(snapshotStore, snapshotOptions),
305
316
  )
306
317
  }
307
318
 
@@ -19,5 +19,5 @@ func TestRootCmdConfig(t *testing.T) {
19
19
  "test", // value
20
20
  })
21
21
 
22
- require.NoError(t, svrcmd.Execute(rootCmd, app.DefaultNodeHome))
22
+ require.NoError(t, svrcmd.Execute(rootCmd, "", app.DefaultNodeHome))
23
23
  }
@@ -178,7 +178,7 @@ func InitTestnet(
178
178
  memo := fmt.Sprintf("%s@%s:26656", nodeIDs[i], ip)
179
179
  genFiles = append(genFiles, nodeConfig.GenesisFile())
180
180
 
181
- kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, nodeDir, inBuf)
181
+ kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, nodeDir, inBuf, clientCtx.Codec)
182
182
  if err != nil {
183
183
  return err
184
184
  }
package/daemon/main.go CHANGED
@@ -44,7 +44,7 @@ func RunWithController(sendToController cmd.Sender) {
44
44
  config.Seal()
45
45
 
46
46
  rootCmd, _ := cmd.NewRootCmd(sendToController)
47
- if err := svrcmd.Execute(rootCmd, app.DefaultNodeHome); err != nil {
47
+ if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil {
48
48
  switch e := err.(type) {
49
49
  case server.ErrorCode:
50
50
  os.Exit(e.Code)
package/git-revision.txt CHANGED
@@ -1 +1 @@
1
- f30b379
1
+ 64cb69f