diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3cac0bfcbdb2..9d1ccdc0caae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -200,7 +200,7 @@ that you would like early feedback and tagging whoever you would like to receive Codeowners are marked automatically as the reviewers. All PRs require at least two review approvals before they can be merged (one review might be acceptable in -the case of minor changes to [docs](./.github/PULL_REQUEST_TEMPLATE/docs.md) changes that do not affect production code). Each PR template has a reviewers checklist that must be completed before the PR can be merged. Each reviewer is responsible +the case of minor changes to docs changes that do not affect production code). Each PR template has a reviewers checklist that must be completed before the PR can be merged. Each reviewer is responsible for all checked items unless they have indicated otherwise by leaving their handle next to specific items. In addition, use the following review explanations: diff --git a/baseapp/streaming.go b/baseapp/streaming.go index 6eeb8e37b449..b6f40cb87fff 100644 --- a/baseapp/streaming.go +++ b/baseapp/streaming.go @@ -33,7 +33,7 @@ const ( // kv-store keys, and app modules. Using the built-in indexer framework is mutually exclusive from using other // types of streaming listeners. func (app *BaseApp) EnableIndexer(indexerOpts interface{}, keys map[string]*storetypes.KVStoreKey, appModules map[string]any) error { - listener, err := indexer.StartManager(indexer.ManagerOptions{ + listener, err := indexer.StartIndexing(indexer.IndexingOptions{ Config: indexerOpts, Resolver: decoding.ModuleSetDecoderResolver(appModules), SyncSource: nil, @@ -47,7 +47,7 @@ func (app *BaseApp) EnableIndexer(indexerOpts interface{}, keys map[string]*stor app.cms.AddListeners(exposedKeys) app.streamingManager = storetypes.StreamingManager{ - ABCIListeners: []storetypes.ABCIListener{listenerWrapper{listener}}, + ABCIListeners: []storetypes.ABCIListener{listenerWrapper{listener.Listener}}, StopNodeOnErr: true, } diff --git a/client/v2/go.mod b/client/v2/go.mod index b6d34fd22af1..876106c8cc43 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -27,7 +27,7 @@ require ( cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.4.1 // indirect cosmossdk.io/math v1.3.0 - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/client/v2/go.sum b/client/v2/go.sum index 4ed3d699b8e8..26e507f1bbe2 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 h1:XQJj9Dv9Gtze0l2TF79BU5lkP6MkUveTUuKICmxoz+o= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190/go.mod h1:7WUGupOvmlHJoIMBz1JbObQxeo6/TDiuDBxmtod8HRg= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= diff --git a/fuzz/fuzz.patch b/fuzz/fuzz.patch new file mode 100644 index 000000000000..995b0d5b53e5 --- /dev/null +++ b/fuzz/fuzz.patch @@ -0,0 +1,81 @@ +diff --git a/types/address_test.go b/types/address_test.go +index 014a48b73..99f9a1a86 100644 +--- a/types/address_test.go ++++ b/types/address_test.go +@@ -26,10 +26,6 @@ type addressTestSuite struct { + suite.Suite + } + +-func TestAddressTestSuite(t *testing.T) { +- suite.Run(t, new(addressTestSuite)) +-} +- + func (s *addressTestSuite) SetupSuite() { + s.T().Parallel() + } +@@ -403,65 +399,6 @@ func (s *addressTestSuite) TestAddressInterface() { + } + } + +-func (s *addressTestSuite) TestBech32ifyAddressBytes() { +- type args struct { +- prefix string +- bs []byte +- } +- tests := []struct { +- name string +- args args +- want string +- wantErr bool +- }{ +- {"empty address", args{"prefixa", []byte{}}, "", false}, +- {"empty prefix", args{"", addr20byte}, "", true}, +- {"10-byte address", args{"prefixa", addr10byte}, "prefixa1qqqsyqcyq5rqwzqf3953cc", false}, +- {"10-byte address", args{"prefixb", addr10byte}, "prefixb1qqqsyqcyq5rqwzqf20xxpc", false}, +- {"20-byte address", args{"prefixa", addr20byte}, "prefixa1qqqsyqcyq5rqwzqfpg9scrgwpugpzysn7hzdtn", false}, +- {"20-byte address", args{"prefixb", addr20byte}, "prefixb1qqqsyqcyq5rqwzqfpg9scrgwpugpzysnrujsuw", false}, +- } +- for _, tt := range tests { +- s.T().Run(tt.name, func(t *testing.T) { +- got, err := types.Bech32ifyAddressBytes(tt.args.prefix, tt.args.bs) +- if (err != nil) != tt.wantErr { +- t.Errorf("Bech32ifyBytes() error = %v, wantErr %v", err, tt.wantErr) +- return +- } +- require.Equal(t, tt.want, got) +- }) +- } +-} +- +-func (s *addressTestSuite) TestMustBech32ifyAddressBytes() { +- type args struct { +- prefix string +- bs []byte +- } +- tests := []struct { +- name string +- args args +- want string +- wantPanic bool +- }{ +- {"empty address", args{"prefixa", []byte{}}, "", false}, +- {"empty prefix", args{"", addr20byte}, "", true}, +- {"10-byte address", args{"prefixa", addr10byte}, "prefixa1qqqsyqcyq5rqwzqf3953cc", false}, +- {"10-byte address", args{"prefixb", addr10byte}, "prefixb1qqqsyqcyq5rqwzqf20xxpc", false}, +- {"20-byte address", args{"prefixa", addr20byte}, "prefixa1qqqsyqcyq5rqwzqfpg9scrgwpugpzysn7hzdtn", false}, +- {"20-byte address", args{"prefixb", addr20byte}, "prefixb1qqqsyqcyq5rqwzqfpg9scrgwpugpzysnrujsuw", false}, +- } +- for _, tt := range tests { +- s.T().Run(tt.name, func(t *testing.T) { +- if tt.wantPanic { +- require.Panics(t, func() { types.MustBech32ifyAddressBytes(tt.args.prefix, tt.args.bs) }) +- return +- } +- require.Equal(t, tt.want, types.MustBech32ifyAddressBytes(tt.args.prefix, tt.args.bs)) +- }) +- } +-} +- + func (s *addressTestSuite) TestAddressTypesEquals() { + addr1 := secp256k1.GenPrivKey().PubKey().Address() + accAddr1 := types.AccAddress(addr1) diff --git a/fuzz/oss-fuzz-build.sh b/fuzz/oss-fuzz-build.sh index faa7c76b5d7b..c829194dc2e4 100644 --- a/fuzz/oss-fuzz-build.sh +++ b/fuzz/oss-fuzz-build.sh @@ -1,5 +1,34 @@ #!/bin/bash +set -o nounset +set -o pipefail +set -o errexit +set -x + +cd $SRC +wget https://go.dev/dl/go1.23.1.linux-amd64.tar.gz +mkdir $SRC/new-go +rm -rf /root/.go && tar -C $SRC/new-go/ -xzf go1.23.1.linux-amd64.tar.gz +mv $SRC/new-go/go /root/.go +ls /root/.go + +cd $SRC/go-118-fuzz-build +go build . +mv go-118-fuzz-build /root/go/bin/ +cd $SRC/cosmos-sdk +git apply ./fuzz/fuzz.patch + +mkdir $SRC/cosmos-sdk/types/fuzzing +mv $SRC/cosmos-sdk/types/address*_test.go $SRC/cosmos-sdk/types/fuzzing/ +sed 's/package types_test/package fuzzing/g' -i "$SRC"/cosmos-sdk/types/fuzzing/* + +rm $SRC/cosmos-sdk/math/dec_internal_test.go +rm $SRC/cosmos-sdk/math/int_internal_test.go +rm $SRC/cosmos-sdk/math/uint_internal_test.go +mv $SRC/cosmos-sdk/types/fuzz_test.go $SRC/cosmos-sdk/types/fuzz.go +rm $SRC/cosmos-sdk/types/*_test.go +mv $SRC/cosmos-sdk/types/fuzz.go $SRC/cosmos-sdk/types/fuzz_test.go + set -euo pipefail export FUZZ_ROOT="github.com/cosmos/cosmos-sdk" @@ -18,25 +47,22 @@ build_go_fuzzer() { compile_native_go_fuzzer cosmossdk.io/math FuzzLegacyNewDecFromStr fuzz_math_legacy_new_dec_from_str ) -go get github.com/AdamKorcz/go-118-fuzz-build/testing +printf "package types \nimport _ \"github.com/AdamKorcz/go-118-fuzz-build/testing\"\n" > ./types/fuzz-register.go +go mod edit -replace github.com/AdamKorcz/go-118-fuzz-build=$SRC/go-118-fuzz-build +go mod tidy # TODO: fails to build with # main.413864645.go:12:2: found packages query (collections_pagination.go) and query_test (fuzz_test.go_fuzz.go) in /src/cosmos-sdk/types/query # because of the separate query_test package. # compile_native_go_fuzzer "$FUZZ_ROOT"/types/query FuzzPagination fuzz_types_query_pagination compile_native_go_fuzzer "$FUZZ_ROOT"/types FuzzCoinUnmarshalJSON fuzz_types_coin_unmarshal_json -compile_native_go_fuzzer "$FUZZ_ROOT"/types FuzzBech32AccAddrConsistencyYAML fuzz_types_bech32_acc_addr_consistency_yaml - +compile_native_go_fuzzer "$FUZZ_ROOT"/types/fuzzing FuzzBech32AccAddrConsistencyYAML fuzz_types_bech32_acc_addr_consistency_yaml build_go_fuzzer FuzzCryptoHDDerivePrivateKeyForPath fuzz_crypto_hd_deriveprivatekeyforpath build_go_fuzzer FuzzCryptoHDNewParamsFromPath fuzz_crypto_hd_newparamsfrompath - build_go_fuzzer FuzzCryptoTypesCompactbitarrayMarshalUnmarshal fuzz_crypto_types_compactbitarray_marshalunmarshal - build_go_fuzzer FuzzTendermintAminoDecodeTime fuzz_tendermint_amino_decodetime - build_go_fuzzer FuzzTypesParseCoin fuzz_types_parsecoin build_go_fuzzer FuzzTypesParseDecCoin fuzz_types_parsedeccoin build_go_fuzzer FuzzTypesParseTimeBytes fuzz_types_parsetimebytes build_go_fuzzer FuzzTypesDecSetString fuzz_types_dec_setstring - build_go_fuzzer FuzzUnknownProto fuzz_unknownproto diff --git a/go.mod b/go.mod index 0c54a37dd9d4..29787c0d148d 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 - cosmossdk.io/schema v0.3.0 + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 diff --git a/go.sum b/go.sum index 4508c5975094..401d45944e7c 100644 --- a/go.sum +++ b/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/schema/indexer/README.md b/schema/indexer/README.md index 9fdec6753a27..9892bccea28d 100644 --- a/schema/indexer/README.md +++ b/schema/indexer/README.md @@ -6,7 +6,7 @@ Indexer implementations should be registered with the `indexer.Register` functio # Integrating the Indexer Manager -The indexer manager should be used for managing all indexers and should be integrated directly with applications wishing to support indexing. The `StartManager` function is used to start the manager. The configuration options for the manager and all indexer targets should be passed as the ManagerOptions.Config field and should match the json structure of ManagerConfig. An example configuration section in `app.toml` might look like this: +The indexer manager should be used for managing all indexers and should be integrated directly with applications wishing to support indexing. The `StartIndexing` function is used to start the manager. The configuration options for the manager and all indexer targets should be passed as the ManagerOptions.Config field and should match the json structure of ManagerConfig. An example configuration section in `app.toml` might look like this: ```toml [indexer.target.postgres] diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index 5a6dce7495a0..7dd5afe82906 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -46,7 +46,7 @@ require ( cosmossdk.io/depinject v1.0.0 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/math v1.3.0 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index 60c3b60a5d83..3166a506eabc 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/simapp/app.go b/simapp/app.go index b02c5e14599f..fd9b8f0efaca 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -28,6 +28,7 @@ import ( "cosmossdk.io/x/accounts/accountstd" baseaccount "cosmossdk.io/x/accounts/defaults/base" lockup "cosmossdk.io/x/accounts/defaults/lockup" + "cosmossdk.io/x/accounts/defaults/multisig" "cosmossdk.io/x/accounts/testing/account_abstraction" "cosmossdk.io/x/accounts/testing/counter" "cosmossdk.io/x/authz" @@ -315,6 +316,7 @@ func NewSimApp( accountstd.AddAccount(lockup.PERIODIC_LOCKING_ACCOUNT, lockup.NewPeriodicLockingAccount), accountstd.AddAccount(lockup.DELAYED_LOCKING_ACCOUNT, lockup.NewDelayedLockingAccount), accountstd.AddAccount(lockup.PERMANENT_LOCKING_ACCOUNT, lockup.NewPermanentLockingAccount), + accountstd.AddAccount("multisig", multisig.NewAccount), // PRODUCTION: add baseaccount.NewAccount("base", txConfig.SignModeHandler(), baseaccount.WithSecp256K1PubKey()), ) diff --git a/simapp/app_di.go b/simapp/app_di.go index 32046a59b7e0..b26220892e0d 100644 --- a/simapp/app_di.go +++ b/simapp/app_di.go @@ -15,6 +15,9 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" "cosmossdk.io/x/accounts" + basedepinject "cosmossdk.io/x/accounts/defaults/base/depinject" + lockupdepinject "cosmossdk.io/x/accounts/defaults/lockup/depinject" + multisigdepinject "cosmossdk.io/x/accounts/defaults/multisig/depinject" bankkeeper "cosmossdk.io/x/bank/keeper" circuitkeeper "cosmossdk.io/x/circuit/keeper" consensuskeeper "cosmossdk.io/x/consensus/keeper" @@ -155,6 +158,27 @@ func NewSimApp( // For providing a custom inflation function for x/mint add here your // custom function that implements the minttypes.MintFn interface. ), + depinject.Provide( + // inject desired account types: + multisigdepinject.ProvideAccount, + basedepinject.ProvideAccount, + lockupdepinject.ProvideAllLockupAccounts, + + // provide base account options + basedepinject.ProvideSecp256K1PubKey, + // if you want to provide a custom public key you + // can do it from here. + // Example: + // basedepinject.ProvideCustomPubkey[Ed25519PublicKey]() + // + // You can also provide a custom public key with a custom validation function: + // + // basedepinject.ProvideCustomPubKeyAndValidationFunc(func(pub Ed25519PublicKey) error { + // if len(pub.Key) != 64 { + // return fmt.Errorf("invalid pub key size") + // } + // }) + ), ) ) diff --git a/simapp/go.mod b/simapp/go.mod index f6e537b4a73d..2445017120db 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -48,6 +48,7 @@ require ( require ( cosmossdk.io/x/accounts/defaults/base v0.0.0-00010101000000-000000000000 + cosmossdk.io/x/accounts/defaults/multisig v0.0.0-00010101000000-000000000000 google.golang.org/grpc v1.67.0 ) @@ -61,8 +62,7 @@ require ( cloud.google.com/go/iam v1.1.13 // indirect cloud.google.com/go/storage v1.43.0 // indirect cosmossdk.io/errors v1.0.1 // indirect - cosmossdk.io/schema v0.3.0 // indirect - cosmossdk.io/x/accounts/defaults/multisig v0.0.0-00010101000000-000000000000 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/simapp/go.sum b/simapp/go.sum index 943624caf8b8..2b2a7116c0a3 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -204,8 +204,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= diff --git a/simapp/v2/app_di.go b/simapp/v2/app_di.go index 25f62b8f3ca5..a2fbb958dc0d 100644 --- a/simapp/v2/app_di.go +++ b/simapp/v2/app_di.go @@ -13,6 +13,9 @@ import ( "cosmossdk.io/log" "cosmossdk.io/runtime/v2" "cosmossdk.io/store/v2/root" + basedepinject "cosmossdk.io/x/accounts/defaults/base/depinject" + lockupdepinject "cosmossdk.io/x/accounts/defaults/lockup/depinject" + multisigdepinject "cosmossdk.io/x/accounts/defaults/multisig/depinject" upgradekeeper "cosmossdk.io/x/upgrade/keeper" "github.com/cosmos/cosmos-sdk/client" @@ -119,6 +122,25 @@ func NewSimApp[T transaction.Tx]( codec.ProvideAddressCodec, codec.ProvideProtoCodec, codec.ProvideLegacyAmino, + // inject desired account types: + multisigdepinject.ProvideAccount, + basedepinject.ProvideAccount, + lockupdepinject.ProvideAllLockupAccounts, + + // provide base account options + basedepinject.ProvideSecp256K1PubKey, + // if you want to provide a custom public key you + // can do it from here. + // Example: + // basedepinject.ProvideCustomPubkey[Ed25519PublicKey]() + // + // You can also provide a custom public key with a custom validation function: + // + // basedepinject.ProvideCustomPubKeyAndValidationFunc(func(pub Ed25519PublicKey) error { + // if len(pub.Key) != 64 { + // return fmt.Errorf("invalid pub key size") + // } + // }) ), depinject.Invoke( std.RegisterInterfaces, diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index 06d1f5260c92..fdbbb0cbf559 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -42,6 +42,12 @@ require ( google.golang.org/protobuf v1.34.2 ) +require ( + cosmossdk.io/x/accounts/defaults/base v0.0.0-00010101000000-000000000000 + cosmossdk.io/x/accounts/defaults/lockup v0.0.0-00010101000000-000000000000 + cosmossdk.io/x/accounts/defaults/multisig v0.0.0-00010101000000-000000000000 +) + require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect @@ -55,13 +61,10 @@ require ( cosmossdk.io/core/testing v0.0.0-20240923163230-04da382a9f29 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/errors/v2 v2.0.0-20240731132947-df72853b3ca5 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/server/v2/appmanager v0.0.0-20240802110823-cffeedff643d // indirect cosmossdk.io/server/v2/stf v0.0.0-20240708142107-25e99c54bac1 // indirect cosmossdk.io/store v1.1.1 // indirect - cosmossdk.io/x/accounts/defaults/base v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/accounts/defaults/lockup v0.0.0-20240417181816-5e7aae0db1f5 // indirect - cosmossdk.io/x/accounts/defaults/multisig v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.5 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect diff --git a/simapp/v2/go.sum b/simapp/v2/go.sum index 6aa505080e4e..b4a90565cd5b 100644 --- a/simapp/v2/go.sum +++ b/simapp/v2/go.sum @@ -204,8 +204,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= diff --git a/tests/e2e/accounts/multisig/test_suite.go b/tests/e2e/accounts/multisig/test_suite.go index 3aa23f147d25..d2e6debb6de6 100644 --- a/tests/e2e/accounts/multisig/test_suite.go +++ b/tests/e2e/accounts/multisig/test_suite.go @@ -10,7 +10,6 @@ import ( "cosmossdk.io/core/transaction" "cosmossdk.io/math" "cosmossdk.io/simapp" - multisigaccount "cosmossdk.io/x/accounts/defaults/multisig" v1 "cosmossdk.io/x/accounts/defaults/multisig/v1" "cosmossdk.io/x/bank/testutil" @@ -76,7 +75,7 @@ func (s *E2ETestSuite) initAccount(ctx context.Context, sender []byte, membersPo members = append(members, &v1.Member{Address: addrStr, Weight: power}) } - _, accountAddr, err := s.app.AccountsKeeper.Init(ctx, multisigaccount.MULTISIG_ACCOUNT, sender, + _, accountAddr, err := s.app.AccountsKeeper.Init(ctx, "multisig", sender, &v1.MsgInit{ Members: members, Config: &v1.Config{ diff --git a/tests/e2e/client/grpc/cmtservice/service_test.go b/tests/e2e/client/grpc/cmtservice/service_test.go deleted file mode 100644 index e4177a11edfb..000000000000 --- a/tests/e2e/client/grpc/cmtservice/service_test.go +++ /dev/null @@ -1,347 +0,0 @@ -//go:build e2e -// +build e2e - -package cmtservice_test - -import ( - "context" - "fmt" - "testing" - - "github.com/stretchr/testify/suite" - - "cosmossdk.io/simapp" - _ "cosmossdk.io/x/gov" - - "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/testutil" - "github.com/cosmos/cosmos-sdk/testutil/network" - qtypes "github.com/cosmos/cosmos-sdk/types/query" - "github.com/cosmos/cosmos-sdk/version" -) - -type E2ETestSuite struct { - suite.Suite - - cfg network.Config - network network.NetworkI - queryClient cmtservice.ServiceClient -} - -func TestE2ETestSuite(t *testing.T) { - suite.Run(t, new(E2ETestSuite)) -} - -func (s *E2ETestSuite) SetupSuite() { - s.T().Log("setting up e2e test suite") - - cfg := network.DefaultConfig(simapp.NewTestNetworkFixture) - cfg.NumValidators = 1 - s.cfg = cfg - - var err error - s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) - s.Require().NoError(err) - - s.Require().NoError(s.network.WaitForNextBlock()) - - s.queryClient = cmtservice.NewServiceClient(s.network.GetValidators()[0].GetClientCtx()) -} - -func (s *E2ETestSuite) TearDownSuite() { - s.T().Log("tearing down e2e test suite") - s.network.Cleanup() -} - -func (s *E2ETestSuite) TestQueryNodeInfo() { - val := s.network.GetValidators()[0] - - res, err := s.queryClient.GetNodeInfo(context.Background(), &cmtservice.GetNodeInfoRequest{}) - s.Require().NoError(err) - s.Require().Equal(res.ApplicationVersion.AppName, version.NewInfo().AppName) - - restRes, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/node_info", val.GetAPIAddress())) - s.Require().NoError(err) - var getInfoRes cmtservice.GetNodeInfoResponse - s.Require().NoError(val.GetClientCtx().Codec.UnmarshalJSON(restRes, &getInfoRes)) - s.Require().Equal(getInfoRes.ApplicationVersion.AppName, version.NewInfo().AppName) -} - -func (s *E2ETestSuite) TestQuerySyncing() { - val := s.network.GetValidators()[0] - - _, err := s.queryClient.GetSyncing(context.Background(), &cmtservice.GetSyncingRequest{}) - s.Require().NoError(err) - - restRes, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/syncing", val.GetAPIAddress())) - s.Require().NoError(err) - var syncingRes cmtservice.GetSyncingResponse - s.Require().NoError(val.GetClientCtx().Codec.UnmarshalJSON(restRes, &syncingRes)) -} - -func (s *E2ETestSuite) TestQueryLatestBlock() { - val := s.network.GetValidators()[0] - - _, err := s.queryClient.GetLatestBlock(context.Background(), &cmtservice.GetLatestBlockRequest{}) - s.Require().NoError(err) - - restRes, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/blocks/latest", val.GetAPIAddress())) - s.Require().NoError(err) - var blockInfoRes cmtservice.GetLatestBlockResponse - s.Require().NoError(val.GetClientCtx().Codec.UnmarshalJSON(restRes, &blockInfoRes)) - s.Require().Contains(blockInfoRes.SdkBlock.Header.ProposerAddress, "cosmosvalcons") -} - -func (s *E2ETestSuite) TestQueryBlockByHeight() { - val := s.network.GetValidators()[0] - _, err := s.queryClient.GetBlockByHeight(context.Background(), &cmtservice.GetBlockByHeightRequest{Height: 1}) - s.Require().NoError(err) - - restRes, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/blocks/%d", val.GetAPIAddress(), 1)) - s.Require().NoError(err) - var blockInfoRes cmtservice.GetBlockByHeightResponse - s.Require().NoError(val.GetClientCtx().Codec.UnmarshalJSON(restRes, &blockInfoRes)) - s.Require().Contains(blockInfoRes.SdkBlock.Header.ProposerAddress, "cosmosvalcons") -} - -func (s *E2ETestSuite) TestQueryLatestValidatorSet() { - val := s.network.GetValidators()[0] - - // nil pagination - res, err := s.queryClient.GetLatestValidatorSet(context.Background(), &cmtservice.GetLatestValidatorSetRequest{ - Pagination: nil, - }) - s.Require().NoError(err) - s.Require().Equal(1, len(res.Validators)) - content, ok := res.Validators[0].PubKey.GetCachedValue().(cryptotypes.PubKey) - s.Require().Equal(true, ok) - s.Require().Equal(content, val.GetPubKey()) - - // with pagination - _, err = s.queryClient.GetLatestValidatorSet(context.Background(), &cmtservice.GetLatestValidatorSetRequest{Pagination: &qtypes.PageRequest{ - Offset: 0, - Limit: 10, - }}) - s.Require().NoError(err) - - // rest request without pagination - _, err = testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/latest", val.GetAPIAddress())) - s.Require().NoError(err) - - // rest request with pagination - restRes, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/latest?pagination.offset=%d&pagination.limit=%d", val.GetAPIAddress(), 0, 1)) - s.Require().NoError(err) - var validatorSetRes cmtservice.GetLatestValidatorSetResponse - s.Require().NoError(val.GetClientCtx().Codec.UnmarshalJSON(restRes, &validatorSetRes)) - s.Require().Equal(1, len(validatorSetRes.Validators)) - anyPub, err := codectypes.NewAnyWithValue(val.GetPubKey()) - s.Require().NoError(err) - s.Require().Equal(validatorSetRes.Validators[0].PubKey, anyPub) -} - -func (s *E2ETestSuite) TestLatestValidatorSet_GRPC() { - vals := s.network.GetValidators() - testCases := []struct { - name string - req *cmtservice.GetLatestValidatorSetRequest - expErr bool - expErrMsg string - }{ - {"nil request", nil, true, "cannot be nil"}, - {"no pagination", &cmtservice.GetLatestValidatorSetRequest{}, false, ""}, - {"with pagination", &cmtservice.GetLatestValidatorSetRequest{Pagination: &qtypes.PageRequest{Offset: 0, Limit: uint64(len(vals))}}, false, ""}, - } - for _, tc := range testCases { - s.Run(tc.name, func() { - grpcRes, err := s.queryClient.GetLatestValidatorSet(context.Background(), tc.req) - if tc.expErr { - s.Require().Error(err) - s.Require().Contains(err.Error(), tc.expErrMsg) - } else { - s.Require().NoError(err) - s.Require().Len(grpcRes.Validators, len(vals)) - s.Require().Equal(grpcRes.Pagination.Total, uint64(len(vals))) - content, ok := grpcRes.Validators[0].PubKey.GetCachedValue().(cryptotypes.PubKey) - s.Require().Equal(true, ok) - s.Require().Equal(content, vals[0].GetPubKey()) - } - }) - } -} - -func (s *E2ETestSuite) TestLatestValidatorSet_GRPCGateway() { - vals := s.network.GetValidators() - testCases := []struct { - name string - url string - expErr bool - expErrMsg string - }{ - {"no pagination", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/latest", vals[0].GetAPIAddress()), false, ""}, - {"pagination invalid fields", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/latest?pagination.offset=-1&pagination.limit=-2", vals[0].GetAPIAddress()), true, "strconv.ParseUint"}, - {"with pagination", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/latest?pagination.offset=0&pagination.limit=2", vals[0].GetAPIAddress()), false, ""}, - } - for _, tc := range testCases { - s.Run(tc.name, func() { - res, err := testutil.GetRequest(tc.url) - s.Require().NoError(err) - if tc.expErr { - s.Require().Contains(string(res), tc.expErrMsg) - } else { - var result cmtservice.GetLatestValidatorSetResponse - err = vals[0].GetClientCtx().Codec.UnmarshalJSON(res, &result) - s.Require().NoError(err) - s.Require().Equal(uint64(len(vals)), result.Pagination.Total) - anyPub, err := codectypes.NewAnyWithValue(vals[0].GetPubKey()) - s.Require().NoError(err) - s.Require().Equal(result.Validators[0].PubKey, anyPub) - } - }) - } -} - -func (s *E2ETestSuite) TestValidatorSetByHeight_GRPC() { - vals := s.network.GetValidators() - testCases := []struct { - name string - req *cmtservice.GetValidatorSetByHeightRequest - expErr bool - expErrMsg string - }{ - {"nil request", nil, true, "request cannot be nil"}, - {"empty request", &cmtservice.GetValidatorSetByHeightRequest{}, true, "height must be greater than 0"}, - {"no pagination", &cmtservice.GetValidatorSetByHeightRequest{Height: 1}, false, ""}, - {"with pagination", &cmtservice.GetValidatorSetByHeightRequest{Height: 1, Pagination: &qtypes.PageRequest{Offset: 0, Limit: 1}}, false, ""}, - } - for _, tc := range testCases { - s.Run(tc.name, func() { - grpcRes, err := s.queryClient.GetValidatorSetByHeight(context.Background(), tc.req) - if tc.expErr { - s.Require().Error(err) - s.Require().Contains(err.Error(), tc.expErrMsg) - } else { - s.Require().NoError(err) - s.Require().Len(grpcRes.Validators, len(vals)) - s.Require().Equal(grpcRes.Pagination.Total, uint64(len(vals))) - } - }) - } -} - -func (s *E2ETestSuite) TestValidatorSetByHeight_GRPCGateway() { - vals := s.network.GetValidators() - testCases := []struct { - name string - url string - expErr bool - expErrMsg string - }{ - {"invalid height", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d", vals[0].GetAPIAddress(), -1), true, "height must be greater than 0"}, - {"no pagination", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d", vals[0].GetAPIAddress(), 1), false, ""}, - {"pagination invalid fields", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d?pagination.offset=-1&pagination.limit=-2", vals[0].GetAPIAddress(), 1), true, "strconv.ParseUint"}, - {"with pagination", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d?pagination.offset=0&pagination.limit=2", vals[0].GetAPIAddress(), 1), false, ""}, - } - for _, tc := range testCases { - s.Run(tc.name, func() { - res, err := testutil.GetRequest(tc.url) - s.Require().NoError(err) - if tc.expErr { - s.Require().Contains(string(res), tc.expErrMsg) - } else { - var result cmtservice.GetValidatorSetByHeightResponse - err = vals[0].GetClientCtx().Codec.UnmarshalJSON(res, &result) - s.Require().NoError(err) - s.Require().Equal(uint64(len(vals)), result.Pagination.Total) - } - }) - } -} - -func (s *E2ETestSuite) TestABCIQuery() { - testCases := []struct { - name string - req *cmtservice.ABCIQueryRequest - expectErr bool - expectedCode uint32 - validQuery bool - }{ - { - name: "valid request with proof", - req: &cmtservice.ABCIQueryRequest{ - Path: "/store/gov/key", - Data: []byte{0x03}, - Prove: true, - }, - validQuery: true, - }, - { - name: "valid request without proof", - req: &cmtservice.ABCIQueryRequest{ - Path: "/store/gov/key", - Data: []byte{0x03}, - Prove: false, - }, - validQuery: true, - }, - { - name: "request with invalid path", - req: &cmtservice.ABCIQueryRequest{ - Path: "/foo/bar", - Data: []byte{0x03}, - }, - expectErr: true, - }, - { - name: "request with invalid path recursive", - req: &cmtservice.ABCIQueryRequest{ - Path: "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery", - Data: s.cfg.Codec.MustMarshal(&cmtservice.ABCIQueryRequest{ - Path: "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery", - }), - }, - expectErr: true, - }, - { - name: "request with invalid broadcast tx path", - req: &cmtservice.ABCIQueryRequest{ - Path: "/cosmos.tx.v1beta1.Service/BroadcastTx", - Data: []byte{0x00}, - }, - expectErr: true, - }, - { - name: "request with invalid data", - req: &cmtservice.ABCIQueryRequest{ - Path: "/store/gov/key", - Data: []byte{0x0044, 0x00}, - }, - validQuery: false, - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - res, err := s.queryClient.ABCIQuery(context.Background(), tc.req) - if tc.expectErr { - s.Require().Error(err) - s.Require().Nil(res) - } else { - s.Require().NoError(err) - s.Require().NotNil(res) - s.Require().Equal(res.Code, tc.expectedCode) - } - - if tc.validQuery { - s.Require().Greater(res.Height, int64(0)) - s.Require().Greater(len(res.Key), 0, "expected non-empty key") - s.Require().Greater(len(res.Value), 0, "expected non-empty value") - } - - if tc.req.Prove { - s.Require().Greater(len(res.ProofOps.Ops), 0, "expected proofs") - } - }) - } -} diff --git a/tests/e2e/gov/cli_test.go b/tests/e2e/gov/cli_test.go deleted file mode 100644 index be8e7afc82e3..000000000000 --- a/tests/e2e/gov/cli_test.go +++ /dev/null @@ -1,37 +0,0 @@ -//go:build e2e -// +build e2e - -package gov - -import ( - "testing" - "time" - - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - - "cosmossdk.io/simapp" - v1 "cosmossdk.io/x/gov/types/v1" - - "github.com/cosmos/cosmos-sdk/testutil/network" -) - -func TestE2ETestSuite(t *testing.T) { - cfg := network.DefaultConfig(simapp.NewTestNetworkFixture) - cfg.NumValidators = 1 - suite.Run(t, NewE2ETestSuite(cfg)) -} - -func TestDepositTestSuite(t *testing.T) { - cfg := network.DefaultConfig(simapp.NewTestNetworkFixture) - cfg.NumValidators = 1 - genesisState := v1.DefaultGenesisState() - maxDepPeriod := time.Duration(20) * time.Second - votingPeriod := time.Duration(8) * time.Second - genesisState.Params.MaxDepositPeriod = &maxDepPeriod - genesisState.Params.VotingPeriod = &votingPeriod - bz, err := cfg.Codec.MarshalJSON(genesisState) - require.NoError(t, err) - cfg.GenesisState["gov"] = bz - suite.Run(t, NewDepositTestSuite(cfg)) -} diff --git a/tests/e2e/gov/deposits.go b/tests/e2e/gov/deposits.go deleted file mode 100644 index b685fa08bc62..000000000000 --- a/tests/e2e/gov/deposits.go +++ /dev/null @@ -1,164 +0,0 @@ -package gov - -import ( - "fmt" - "strconv" - "time" - - "github.com/stretchr/testify/suite" - - "cosmossdk.io/math" - "cosmossdk.io/x/gov/client/cli" - govclitestutil "cosmossdk.io/x/gov/client/testutil" - v1 "cosmossdk.io/x/gov/types/v1" - "cosmossdk.io/x/gov/types/v1beta1" - - "github.com/cosmos/cosmos-sdk/testutil" - "github.com/cosmos/cosmos-sdk/testutil/network" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -type DepositTestSuite struct { - suite.Suite - - cfg network.Config - network network.NetworkI -} - -func NewDepositTestSuite(cfg network.Config) *DepositTestSuite { - return &DepositTestSuite{cfg: cfg} -} - -func (s *DepositTestSuite) SetupSuite() { - s.T().Log("setting up test suite") - - var err error - s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) - s.Require().NoError(err) -} - -func (s *DepositTestSuite) submitProposal(val network.ValidatorI, initialDeposit sdk.Coin, name string) uint64 { - var exactArgs []string - - if !initialDeposit.IsZero() { - exactArgs = append(exactArgs, fmt.Sprintf("--%s=%s", cli.FlagDeposit, initialDeposit.String())) - } - - _, err := govclitestutil.MsgSubmitLegacyProposal( - val.GetClientCtx(), - val.GetAddress().String(), - fmt.Sprintf("Text Proposal %s", name), - "Where is the title!?", - v1beta1.ProposalTypeText, - exactArgs..., - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - // query proposals, return the last's id - res, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals", val.GetAPIAddress())) - s.Require().NoError(err) - var proposals v1.QueryProposalsResponse - err = s.cfg.Codec.UnmarshalJSON(res, &proposals) - s.Require().NoError(err) - s.Require().GreaterOrEqual(len(proposals.Proposals), 1) - - return proposals.Proposals[len(proposals.Proposals)-1].Id -} - -func (s *DepositTestSuite) TearDownSuite() { - s.T().Log("tearing down test suite") - s.network.Cleanup() -} - -func (s *DepositTestSuite) TestQueryDepositsWithInitialDeposit() { - val := s.network.GetValidators()[0] - depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens) - - // submit proposal with an initial deposit - id := s.submitProposal(val, depositAmount, "TestQueryDepositsWithInitialDeposit") - proposalID := strconv.FormatUint(id, 10) - - // query deposit - deposit := s.queryDeposit(val, proposalID, false, "") - s.Require().NotNil(deposit) - s.Require().Equal(depositAmount.String(), sdk.Coins(deposit.Deposit.Amount).String()) - - // query deposits - deposits := s.queryDeposits(val, proposalID, false, "") - s.Require().NotNil(deposits) - s.Require().Len(deposits.Deposits, 1) - // verify initial deposit - s.Require().Equal(depositAmount.String(), sdk.Coins(deposits.Deposits[0].Amount).String()) -} - -func (s *DepositTestSuite) TestQueryProposalAfterVotingPeriod() { - val := s.network.GetValidators()[0] - depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens.Sub(math.NewInt(50))) - - // submit proposal with an initial deposit - id := s.submitProposal(val, depositAmount, "TestQueryProposalAfterVotingPeriod") - proposalID := strconv.FormatUint(id, 10) - - resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals", val.GetAPIAddress())) - s.Require().NoError(err) - var proposals v1.QueryProposalsResponse - err = s.cfg.Codec.UnmarshalJSON(resp, &proposals) - s.Require().NoError(err) - s.Require().GreaterOrEqual(len(proposals.Proposals), 1) - - // query proposal - resp, err = testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s", val.GetAPIAddress(), proposalID)) - s.Require().NoError(err) - var proposal v1.QueryProposalResponse - err = s.cfg.Codec.UnmarshalJSON(resp, &proposal) - s.Require().NoError(err) - - // waiting for deposit and voting period to end - time.Sleep(25 * time.Second) - - // query proposal - resp, err = testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s", val.GetAPIAddress(), proposalID)) - s.Require().NoError(err) - s.Require().Contains(string(resp), fmt.Sprintf("proposal %s doesn't exist", proposalID)) - - // query deposits - deposits := s.queryDeposits(val, proposalID, false, "") - s.Require().Len(deposits.Deposits, 0) -} - -func (s *DepositTestSuite) queryDeposits(val network.ValidatorI, proposalID string, exceptErr bool, message string) *v1.QueryDepositsResponse { - s.Require().NoError(s.network.WaitForNextBlock()) - - resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits", val.GetAPIAddress(), proposalID)) - s.Require().NoError(err) - - if exceptErr { - s.Require().Contains(string(resp), message) - return nil - } - - var depositsRes v1.QueryDepositsResponse - err = val.GetClientCtx().Codec.UnmarshalJSON(resp, &depositsRes) - s.Require().NoError(err) - - return &depositsRes -} - -func (s *DepositTestSuite) queryDeposit(val network.ValidatorI, proposalID string, exceptErr bool, message string) *v1.QueryDepositResponse { - s.Require().NoError(s.network.WaitForNextBlock()) - - resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits/%s", val.GetAPIAddress(), proposalID, val.GetAddress().String())) - s.Require().NoError(err) - - if exceptErr { - s.Require().Contains(string(resp), message) - return nil - } - - var depositRes v1.QueryDepositResponse - err = val.GetClientCtx().Codec.UnmarshalJSON(resp, &depositRes) - s.Require().NoError(err) - - return &depositRes -} diff --git a/tests/e2e/gov/tx.go b/tests/e2e/gov/tx.go deleted file mode 100644 index 9d6f84ce15aa..000000000000 --- a/tests/e2e/gov/tx.go +++ /dev/null @@ -1,372 +0,0 @@ -package gov - -import ( - "encoding/base64" - "fmt" - - "github.com/cosmos/gogoproto/proto" - "github.com/stretchr/testify/suite" - - "cosmossdk.io/math" - "cosmossdk.io/x/gov/client/cli" - govclitestutil "cosmossdk.io/x/gov/client/testutil" - "cosmossdk.io/x/gov/types" - v1 "cosmossdk.io/x/gov/types/v1" - "cosmossdk.io/x/gov/types/v1beta1" - - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/testutil" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/cosmos/cosmos-sdk/testutil/network" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" -) - -type E2ETestSuite struct { - suite.Suite - - cfg network.Config - network network.NetworkI -} - -func NewE2ETestSuite(cfg network.Config) *E2ETestSuite { - return &E2ETestSuite{cfg: cfg} -} - -func (s *E2ETestSuite) SetupSuite() { - s.T().Log("setting up e2e test suite") - - var err error - s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - val := s.network.GetValidators()[0] - clientCtx := val.GetClientCtx() - var resp sdk.TxResponse - - // create a proposal with deposit - out, err := govclitestutil.MsgSubmitLegacyProposal(val.GetClientCtx(), val.GetAddress().String(), - "Text Proposal 1", "Where is the title!?", v1beta1.ProposalTypeText, - fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens).String())) - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) - s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) - - // vote for proposal - out, err = govclitestutil.MsgVote(val.GetClientCtx(), val.GetAddress().String(), "1", "yes") - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) - s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) - - // create a proposal with a small deposit - minimumAcceptedDep := v1.DefaultMinDepositTokens.ToLegacyDec().Mul(v1.DefaultMinDepositRatio).Ceil().TruncateInt() - out, err = govclitestutil.MsgSubmitLegacyProposal(val.GetClientCtx(), val.GetAddress().String(), - "Text Proposal 2", "Where is the title!?", v1beta1.ProposalTypeText, - fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, minimumAcceptedDep).String())) - - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) - s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) - - // create a proposal3 with deposit - out, err = govclitestutil.MsgSubmitLegacyProposal(val.GetClientCtx(), val.GetAddress().String(), - "Text Proposal 3", "Where is the title!?", v1beta1.ProposalTypeText, - fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens).String())) - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) - s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) - - // create a proposal4 with deposit to check the cancel proposal cli tx - out, err = govclitestutil.MsgSubmitLegacyProposal(val.GetClientCtx(), val.GetAddress().String(), - "Text Proposal 4", "Where is the title!?", v1beta1.ProposalTypeText, - fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens).String())) - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) - s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) - - // vote for proposal3 as val - out, err = govclitestutil.MsgVote(val.GetClientCtx(), val.GetAddress().String(), "3", "yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05") - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) - s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) -} - -func (s *E2ETestSuite) TearDownSuite() { - s.T().Log("tearing down e2e test suite") - s.network.Cleanup() -} - -func (s *E2ETestSuite) TestNewCmdSubmitProposal() { - val := s.network.GetValidators()[0] - - // Create a legacy proposal JSON, make sure it doesn't pass this new CLI - // command. - invalidProp := `{ - "title": "", - "description": "Where is the title!?", - "type": "Text", - "deposit": "-324foocoin" -}` - invalidPropFile := testutil.WriteToNewTempFile(s.T(), invalidProp) - defer invalidPropFile.Close() - - // Create a valid new proposal JSON. - propMetadata := []byte{42} - validProp := fmt.Sprintf(` -{ - "messages": [ - { - "@type": "/cosmos.gov.v1.MsgExecLegacyContent", - "authority": "%s", - "content": { - "@type": "/cosmos.gov.v1beta1.TextProposal", - "title": "My awesome title", - "description": "My awesome description" - } - } - ], - "title": "My awesome title", - "summary": "My awesome description", - "metadata": "%s", - "deposit": "%s" -}`, authtypes.NewModuleAddress(types.ModuleName), base64.StdEncoding.EncodeToString(propMetadata), sdk.NewCoin(s.cfg.BondDenom, math.NewInt(100000))) - validPropFile := testutil.WriteToNewTempFile(s.T(), validProp) - defer validPropFile.Close() - - testCases := []struct { - name string - args []string - expectErr bool - expectedCode uint32 - respType proto.Message - }{ - { - "invalid proposal", - []string{ - invalidPropFile.Name(), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), - }, - true, 0, nil, - }, - { - "valid proposal", - []string{ - validPropFile.Name(), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.GetAddress().String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), - }, - false, 0, &sdk.TxResponse{}, - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.NewCmdSubmitProposal() - clientCtx := val.GetClientCtx() - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) - txResp := tc.respType.(*sdk.TxResponse) - s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, txResp.TxHash, tc.expectedCode)) - } - }) - } -} - -func (s *E2ETestSuite) TestNewCmdSubmitLegacyProposal() { - val := s.network.GetValidators()[0] - invalidProp := `{ - "title": "", - "description": "Where is the title!?", - "type": "Text", - "deposit": "-324foocoin" - }` - invalidPropFile := testutil.WriteToNewTempFile(s.T(), invalidProp) - defer invalidPropFile.Close() - validProp := fmt.Sprintf(`{ - "title": "Text Proposal", - "description": "Hello, World!", - "type": "Text", - "deposit": "%s" - }`, sdk.NewCoin(s.cfg.BondDenom, math.NewInt(154310))) - validPropFile := testutil.WriteToNewTempFile(s.T(), validProp) - defer validPropFile.Close() - - testCases := []struct { - name string - args []string - expectErr bool - expectedCode uint32 - respType proto.Message - }{ - { - "invalid proposal (file)", - []string{ - fmt.Sprintf("--%s=%s", cli.FlagProposal, invalidPropFile.Name()), //nolint:staticcheck // we are intentionally using a deprecated flag here. - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.GetAddress().String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), - }, - true, 0, nil, - }, - { - "invalid proposal", - []string{ - fmt.Sprintf("--%s='Where is the title!?'", cli.FlagDescription), //nolint:staticcheck // we are intentionally using a deprecated flag here. - fmt.Sprintf("--%s=%s", cli.FlagProposalType, v1beta1.ProposalTypeText), //nolint:staticcheck // we are intentionally using a deprecated flag here. - fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10000)).String()), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.GetAddress().String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), - }, - true, 0, nil, - }, - { - "valid transaction (file)", - //nolint:staticcheck // we are intentionally using a deprecated flag here. - []string{ - fmt.Sprintf("--%s=%s", cli.FlagProposal, validPropFile.Name()), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.GetAddress().String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), - }, - false, 0, &sdk.TxResponse{}, - }, - { - "valid transaction", - []string{ - fmt.Sprintf("--%s='Text Proposal'", cli.FlagTitle), - fmt.Sprintf("--%s='Where is the title!?'", cli.FlagDescription), //nolint:staticcheck // we are intentionally using a deprecated flag here. - fmt.Sprintf("--%s=%s", cli.FlagProposalType, v1beta1.ProposalTypeText), //nolint:staticcheck // we are intentionally using a deprecated flag here. - fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, math.NewInt(100000)).String()), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.GetAddress().String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), - }, - false, 0, &sdk.TxResponse{}, - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.NewCmdSubmitLegacyProposal() - clientCtx := val.GetClientCtx() - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) - txResp := tc.respType.(*sdk.TxResponse) - s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, txResp.TxHash, tc.expectedCode)) - } - }) - } -} - -func (s *E2ETestSuite) TestNewCmdWeightedVote() { - val := s.network.GetValidators()[0] - - testCases := []struct { - name string - args []string - expectErr bool - expectedCode uint32 - }{ - { - "invalid vote", - []string{}, - true, 0, - }, - { - "vote for invalid proposal", - []string{ - "10", - "yes", - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.GetAddress().String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), - }, - false, 3, - }, - { - "valid vote", - []string{ - "1", - "yes", - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.GetAddress().String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), - }, - false, 0, - }, - { - "valid vote with metadata", - []string{ - "1", - "yes", - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.GetAddress().String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--metadata=%s", "AQ=="), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), - }, - false, 0, - }, - { - "invalid valid split vote string", - []string{ - "1", - "yes/0.6,no/0.3,abstain/0.05,no_with_veto/0.05", - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.GetAddress().String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), - }, - true, 0, - }, - { - "valid split vote", - []string{ - "1", - "yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05", - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.GetAddress().String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), - }, - false, 0, - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.NewCmdWeightedVote() - clientCtx := val.GetClientCtx() - var txResp sdk.TxResponse - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &txResp), out.String()) - s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, txResp.TxHash, tc.expectedCode)) - } - }) - } -} diff --git a/tests/go.mod b/tests/go.mod index a2af50c06077..e0d6e67a8eee 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -65,7 +65,7 @@ require ( cloud.google.com/go/storage v1.43.0 // indirect cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860 // indirect cosmossdk.io/errors v1.0.1 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/x/circuit v0.0.0-20230613133644-0a778132a60f // indirect cosmossdk.io/x/epochs v0.0.0-20240522060652-a1ae4c3e0337 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/tests/go.sum b/tests/go.sum index a0ab6f8190ac..28a5f4b189c0 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -204,8 +204,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= diff --git a/tests/systemtests/cometbft_client_test.go b/tests/systemtests/cometbft_client_test.go new file mode 100644 index 000000000000..e031ae0c8f55 --- /dev/null +++ b/tests/systemtests/cometbft_client_test.go @@ -0,0 +1,330 @@ +//go:build system_test + +package systemtests + +import ( + "context" + "fmt" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/tidwall/gjson" + + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/testutil" + qtypes "github.com/cosmos/cosmos-sdk/types/query" +) + +func TestQueryNodeInfo(t *testing.T) { + baseurl := fmt.Sprintf("http://localhost:%d", apiPortStart) + sut.ResetChain(t) + sut.StartChain(t) + + qc := cmtservice.NewServiceClient(sut.RPCClient(t)) + res, err := qc.GetNodeInfo(context.Background(), &cmtservice.GetNodeInfoRequest{}) + assert.NoError(t, err) + + v := NewCLIWrapper(t, sut, true).Version() + assert.Equal(t, res.ApplicationVersion.Version, v) + + // TODO: we should be adding a way to distinguish a v2. Eventually we should skip some v2 system depending on the consensus engine we want to test + restRes, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/node_info", baseurl)) + assert.NoError(t, err) + assert.Equal(t, gjson.GetBytes(restRes, "application_version.version").String(), res.ApplicationVersion.Version) +} + +func TestQuerySyncing(t *testing.T) { + baseurl := fmt.Sprintf("http://localhost:%d", apiPortStart) + sut.ResetChain(t) + sut.StartChain(t) + + qc := cmtservice.NewServiceClient(sut.RPCClient(t)) + res, err := qc.GetSyncing(context.Background(), &cmtservice.GetSyncingRequest{}) + assert.NoError(t, err) + + restRes, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/syncing", baseurl)) + assert.NoError(t, err) + assert.Equal(t, gjson.GetBytes(restRes, "syncing").Bool(), res.Syncing) +} + +func TestQueryLatestBlock(t *testing.T) { + baseurl := fmt.Sprintf("http://localhost:%d", apiPortStart) + sut.ResetChain(t) + sut.StartChain(t) + + qc := cmtservice.NewServiceClient(sut.RPCClient(t)) + res, err := qc.GetLatestBlock(context.Background(), &cmtservice.GetLatestBlockRequest{}) + assert.NoError(t, err) + assert.Contains(t, res.SdkBlock.Header.ProposerAddress, "cosmosvalcons") + + _, err = testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/blocks/latest", baseurl)) + assert.NoError(t, err) +} + +func TestQueryBlockByHeight(t *testing.T) { + baseurl := fmt.Sprintf("http://localhost:%d", apiPortStart) + sut.ResetChain(t) + sut.StartChain(t) + + sut.AwaitNBlocks(t, 2, time.Second*25) + + qc := cmtservice.NewServiceClient(sut.RPCClient(t)) + res, err := qc.GetBlockByHeight(context.Background(), &cmtservice.GetBlockByHeightRequest{Height: 2}) + assert.NoError(t, err) + assert.Equal(t, res.SdkBlock.Header.Height, int64(2)) + assert.Contains(t, res.SdkBlock.Header.ProposerAddress, "cosmosvalcons") + + restRes, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/blocks/%d", baseurl, 2)) + assert.NoError(t, err) + assert.Equal(t, gjson.GetBytes(restRes, "sdk_block.header.height").Int(), int64(2)) + assert.Contains(t, gjson.GetBytes(restRes, "sdk_block.header.proposer_address").String(), "cosmosvalcons") +} + +func TestQueryLatestValidatorSet(t *testing.T) { + baseurl := fmt.Sprintf("http://localhost:%d", apiPortStart) + sut.ResetChain(t) + sut.StartChain(t) + + vals := sut.RPCClient(t).Validators() + + qc := cmtservice.NewServiceClient(sut.RPCClient(t)) + res, err := qc.GetLatestValidatorSet(context.Background(), &cmtservice.GetLatestValidatorSetRequest{ + Pagination: nil, + }) + assert.NoError(t, err) + assert.Equal(t, len(res.Validators), len(vals)) + + // with pagination + res, err = qc.GetLatestValidatorSet(context.Background(), &cmtservice.GetLatestValidatorSetRequest{Pagination: &qtypes.PageRequest{ + Offset: 0, + Limit: 2, + }}) + assert.NoError(t, err) + assert.Equal(t, len(res.Validators), 2) + + restRes, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/latest?pagination.offset=%d&pagination.limit=%d", baseurl, 0, 2)) + assert.NoError(t, err) + assert.Equal(t, len(gjson.GetBytes(restRes, "validators").Array()), 2) +} + +func TestLatestValidatorSet(t *testing.T) { + sut.ResetChain(t) + sut.StartChain(t) + + vals := sut.RPCClient(t).Validators() + + qc := cmtservice.NewServiceClient(sut.RPCClient(t)) + testCases := []struct { + name string + req *cmtservice.GetLatestValidatorSetRequest + expErr bool + expErrMsg string + }{ + {"nil request", nil, true, "cannot be nil"}, + {"no pagination", &cmtservice.GetLatestValidatorSetRequest{}, false, ""}, + {"with pagination", &cmtservice.GetLatestValidatorSetRequest{Pagination: &qtypes.PageRequest{Offset: 0, Limit: uint64(len(vals))}}, false, ""}, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + res, err := qc.GetLatestValidatorSet(context.Background(), tc.req) + if tc.expErr { + assert.Error(t, err) + assert.Contains(t, err.Error(), tc.expErrMsg) + } else { + assert.NoError(t, err) + assert.Equal(t, len(res.Validators), len(vals)) + content, ok := res.Validators[0].PubKey.GetCachedValue().(cryptotypes.PubKey) + assert.True(t, ok) + assert.Equal(t, content.Address(), vals[0].PubKey.Address()) + } + }) + } +} +func TestLatestValidatorSet_GRPCGateway(t *testing.T) { + sut.ResetChain(t) + sut.StartChain(t) + + baseurl := fmt.Sprintf("http://localhost:%d", apiPortStart) + + vals := sut.RPCClient(t).Validators() + + testCases := []struct { + name string + url string + expErr bool + expErrMsg string + }{ + {"no pagination", "/cosmos/base/tendermint/v1beta1/validatorsets/latest", false, ""}, + {"pagination invalid fields", "/cosmos/base/tendermint/v1beta1/validatorsets/latest?pagination.offset=-1&pagination.limit=-2", true, "strconv.ParseUint"}, + {"with pagination", "/cosmos/base/tendermint/v1beta1/validatorsets/latest?pagination.offset=0&pagination.limit=2", false, ""}, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + rsp, err := testutil.GetRequest(fmt.Sprintf("%s%s", baseurl, tc.url)) + assert.NoError(t, err) + if tc.expErr { + errMsg := gjson.GetBytes(rsp, "message").String() + assert.Contains(t, errMsg, tc.expErrMsg) + } else { + assert.Equal(t, len(vals), int(gjson.GetBytes(rsp, "pagination.total").Int())) + } + }) + } +} + +func TestValidatorSetByHeight(t *testing.T) { + sut.ResetChain(t) + sut.StartChain(t) + + qc := cmtservice.NewServiceClient(sut.RPCClient(t)) + vals := sut.RPCClient(t).Validators() + + testCases := []struct { + name string + req *cmtservice.GetValidatorSetByHeightRequest + expErr bool + expErrMsg string + }{ + {"nil request", nil, true, "request cannot be nil"}, + {"empty request", &cmtservice.GetValidatorSetByHeightRequest{}, true, "height must be greater than 0"}, + {"no pagination", &cmtservice.GetValidatorSetByHeightRequest{Height: 1}, false, ""}, + {"with pagination", &cmtservice.GetValidatorSetByHeightRequest{Height: 1, Pagination: &qtypes.PageRequest{Offset: 0, Limit: uint64(len(vals))}}, false, ""}, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + res, err := qc.GetValidatorSetByHeight(context.Background(), tc.req) + if tc.expErr { + assert.Error(t, err) + assert.Contains(t, err.Error(), tc.expErrMsg) + } else { + assert.NoError(t, err) + assert.Equal(t, len(res.Validators), len(vals)) + } + }) + } +} + +func TestValidatorSetByHeight_GRPCGateway(t *testing.T) { + sut.ResetChain(t) + sut.StartChain(t) + + vals := sut.RPCClient(t).Validators() + + baseurl := fmt.Sprintf("http://localhost:%d", apiPortStart) + + block := sut.AwaitNextBlock(t, time.Second*3) + testCases := []struct { + name string + url string + expErr bool + expErrMsg string + }{ + {"invalid height", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d", baseurl, -1), true, "height must be greater than 0"}, + {"no pagination", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d", baseurl, block), false, ""}, + {"pagination invalid fields", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d?pagination.offset=-1&pagination.limit=-2", baseurl, block), true, "strconv.ParseUint"}, + {"with pagination", fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d?pagination.limit=2", baseurl, 1), false, ""}, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + rsp, err := testutil.GetRequest(tc.url) + assert.NoError(t, err) + if tc.expErr { + errMsg := gjson.GetBytes(rsp, "message").String() + assert.Contains(t, errMsg, tc.expErrMsg) + } else { + assert.Equal(t, len(vals), int(gjson.GetBytes(rsp, "pagination.total").Int())) + } + }) + } +} + +func TestABCIQuery(t *testing.T) { + sut.ResetChain(t) + sut.StartChain(t) + + qc := cmtservice.NewServiceClient(sut.RPCClient(t)) + cdc := codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) + testCases := []struct { + name string + req *cmtservice.ABCIQueryRequest + expectErr bool + expectedCode uint32 + validQuery bool + }{ + { + name: "valid request with proof", + req: &cmtservice.ABCIQueryRequest{ + Path: "/store/gov/key", + Data: []byte{0x03}, + Prove: true, + }, + validQuery: true, + }, + { + name: "valid request without proof", + req: &cmtservice.ABCIQueryRequest{ + Path: "/store/gov/key", + Data: []byte{0x03}, + Prove: false, + }, + validQuery: true, + }, + { + name: "request with invalid path", + req: &cmtservice.ABCIQueryRequest{ + Path: "/foo/bar", + Data: []byte{0x03}, + }, + expectErr: true, + }, + { + name: "request with invalid path recursive", + req: &cmtservice.ABCIQueryRequest{ + Path: "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery", + Data: cdc.MustMarshal(&cmtservice.ABCIQueryRequest{ + Path: "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery", + }), + }, + expectErr: true, + }, + { + name: "request with invalid broadcast tx path", + req: &cmtservice.ABCIQueryRequest{ + Path: "/cosmos.tx.v1beta1.Service/BroadcastTx", + Data: []byte{0x00}, + }, + expectErr: true, + }, + { + name: "request with invalid data", + req: &cmtservice.ABCIQueryRequest{ + Path: "/store/gov/key", + Data: []byte{0x0044, 0x00}, + }, + validQuery: false, + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + res, err := qc.ABCIQuery(context.Background(), tc.req) + if tc.expectErr { + assert.Error(t, err) + assert.Nil(t, res) + } else { + assert.NoError(t, err) + assert.NotNil(t, res) + assert.Equal(t, res.Code, tc.expectedCode) + } + + if tc.validQuery { + assert.Greater(t, res.Height, int64(0)) + assert.Greater(t, len(res.Key), 0) + assert.Greater(t, len(res.Value), 0) + } + }) + } +} diff --git a/tests/systemtests/go.mod b/tests/systemtests/go.mod index 5d4949952111..405d9269bf1a 100644 --- a/tests/systemtests/go.mod +++ b/tests/systemtests/go.mod @@ -20,12 +20,13 @@ require ( github.com/stretchr/testify v1.9.0 github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/grpc v1.67.0 // indirect + google.golang.org/grpc v1.67.0 ) require ( cosmossdk.io/math v1.3.0 github.com/cometbft/cometbft v0.38.8 + github.com/cometbft/cometbft/api v1.0.0-rc.1 github.com/creachadair/tomledit v0.0.26 github.com/tidwall/gjson v1.14.2 github.com/tidwall/sjson v1.2.5 diff --git a/tests/systemtests/go.sum b/tests/systemtests/go.sum index af10f89276c4..09314ac894cf 100644 --- a/tests/systemtests/go.sum +++ b/tests/systemtests/go.sum @@ -129,6 +129,8 @@ github.com/cometbft/cometbft v0.38.8 h1:XyJ9Cu3xqap6xtNxiemrO8roXZ+KS2Zlu7qQ0w1t github.com/cometbft/cometbft v0.38.8/go.mod h1:xOoGZrtUT+A5izWfHSJgl0gYZUE7lu7Z2XIS1vWG/QQ= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= +github.com/cometbft/cometbft/api v1.0.0-rc.1 h1:GtdXwDGlqwHYs16A4egjwylfYOMYyEacLBrs3Zvpt7g= +github.com/cometbft/cometbft/api v1.0.0-rc.1/go.mod h1:NDFKiBBD8HJC6QQLAoUI99YhsiRZtg2+FJWfk6A6m6o= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= diff --git a/tests/systemtests/gov_test.go b/tests/systemtests/gov_test.go new file mode 100644 index 000000000000..73bc7fd96efc --- /dev/null +++ b/tests/systemtests/gov_test.go @@ -0,0 +1,411 @@ +//go:build system_test + +package systemtests + +import ( + "encoding/base64" + "fmt" + "testing" + "time" + + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/tidwall/gjson" +) + +func TestSubmitProposal(t *testing.T) { + // given a running chain + + sut.ResetChain(t) + cli := NewCLIWrapper(t, sut, verbose) + + // get validator address + valAddr := gjson.Get(cli.Keys("keys", "list"), "0.address").String() + require.NotEmpty(t, valAddr) + + sut.StartChain(t) + + // get gov module address + resp := cli.CustomQuery("q", "auth", "module-account", "gov") + govAddress := gjson.Get(resp, "account.value.address").String() + + invalidProp := `{ + "title": "", + "description": "Where is the title!?", + "type": "Text", + "deposit": "-324foocoin" +}` + invalidPropFile := testutil.WriteToNewTempFile(t, invalidProp) + defer invalidPropFile.Close() + + // Create a valid new proposal JSON. + propMetadata := []byte{42} + validProp := fmt.Sprintf(` +{ + "messages": [ + { + "@type": "/cosmos.gov.v1.MsgExecLegacyContent", + "authority": "%s", + "content": { + "@type": "/cosmos.gov.v1beta1.TextProposal", + "title": "My awesome title", + "description": "My awesome description" + } + } + ], + "title": "My awesome title", + "summary": "My awesome description", + "metadata": "%s", + "deposit": "%s" +}`, govAddress, base64.StdEncoding.EncodeToString(propMetadata), sdk.NewCoin("stake", math.NewInt(100000))) + validPropFile := testutil.WriteToNewTempFile(t, validProp) + defer validPropFile.Close() + + testCases := []struct { + name string + args []string + expectErr bool + errMsg string + }{ + { + "invalid proposal", + []string{ + "tx", "gov", "submit-proposal", + invalidPropFile.Name(), + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(10))).String()), + }, + true, + "invalid character in coin string", + }, + { + "valid proposal", + []string{ + "tx", "gov", "submit-proposal", + validPropFile.Name(), + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(10))).String()), + }, + false, + "", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + if tc.expectErr { + assertOutput := func(_ assert.TestingT, gotErr error, gotOutputs ...interface{}) bool { + require.Contains(t, gotOutputs[0], tc.errMsg) + return false + } + + cli.WithRunErrorMatcher(assertOutput).Run(tc.args...) + } else { + rsp := cli.Run(tc.args...) + txResult, found := cli.AwaitTxCommitted(rsp) + require.True(t, found) + RequireTxSuccess(t, txResult) + } + }) + } +} + +func TestSubmitLegacyProposal(t *testing.T) { + // given a running chain + + sut.ResetChain(t) + cli := NewCLIWrapper(t, sut, verbose) + + // get validator address + valAddr := gjson.Get(cli.Keys("keys", "list"), "0.address").String() + require.NotEmpty(t, valAddr) + + sut.StartChain(t) + + invalidProp := `{ + "title": "", + "description": "Where is the title!?", + "type": "Text", + "deposit": "-324foocoin" + }` + invalidPropFile := testutil.WriteToNewTempFile(t, invalidProp) + defer invalidPropFile.Close() + + validProp := fmt.Sprintf(`{ + "title": "Text Proposal", + "description": "Hello, World!", + "type": "Text", + "deposit": "%s" + }`, sdk.NewCoin("stake", math.NewInt(154310))) + validPropFile := testutil.WriteToNewTempFile(t, validProp) + defer validPropFile.Close() + + testCases := []struct { + name string + args []string + expectErr bool + errMsg string + }{ + { + "invalid proposal (file)", + []string{ + "tx", "gov", "submit-legacy-proposal", + fmt.Sprintf("--%s=%s", "proposal", invalidPropFile.Name()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(10))).String()), + }, + true, + "proposal title is required", + }, + { + "invalid proposal", + []string{ + "tx", "gov", "submit-legacy-proposal", + fmt.Sprintf("--%s='Where is the title!?'", "description"), + fmt.Sprintf("--%s=%s", "type", "Text"), + fmt.Sprintf("--%s=%s", "deposit", sdk.NewCoin("stake", math.NewInt(10000)).String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(10))).String()), + }, + true, + "proposal title is required", + }, + { + "valid transaction (file)", + []string{ + "tx", "gov", "submit-legacy-proposal", + fmt.Sprintf("--%s=%s", "proposal", validPropFile.Name()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(10))).String()), + }, + false, + "", + }, + { + "valid transaction", + []string{ + "tx", "gov", "submit-legacy-proposal", + fmt.Sprintf("--%s='Text Proposal'", "title"), + fmt.Sprintf("--%s='Where is the title!?'", "description"), + fmt.Sprintf("--%s=%s", "type", "Text"), + fmt.Sprintf("--%s=%s", "deposit", sdk.NewCoin("stake", math.NewInt(100000)).String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(10))).String()), + }, + false, + "", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + if tc.expectErr { + assertOutput := func(_ assert.TestingT, gotErr error, gotOutputs ...interface{}) bool { + fmt.Println("gotOut", gotOutputs) + require.Contains(t, gotOutputs[0], tc.errMsg) + return false + } + + cli.WithRunErrorMatcher(assertOutput).Run(tc.args...) + } else { + rsp := cli.Run(tc.args...) + txResult, found := cli.AwaitTxCommitted(rsp) + require.True(t, found) + RequireTxSuccess(t, txResult) + } + }) + } +} + +func TestNewCmdWeightedVote(t *testing.T) { + // given a running chain + + sut.ResetChain(t) + cli := NewCLIWrapper(t, sut, verbose) + + // get validator address + valAddr := gjson.Get(cli.Keys("keys", "list"), "0.address").String() + require.NotEmpty(t, valAddr) + + sut.StartChain(t) + + // Submit a new proposal for voting + proposalArgs := []string{ + "tx", "gov", "submit-legacy-proposal", + fmt.Sprintf("--%s='Text Proposal'", "title"), + fmt.Sprintf("--%s='Where is the title!?'", "description"), + fmt.Sprintf("--%s=%s", "type", "Text"), + fmt.Sprintf("--%s=%s", "deposit", sdk.NewCoin("stake", math.NewInt(10_000_000)).String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(10))).String())} + rsp := cli.Run(proposalArgs...) + txResult, found := cli.AwaitTxCommitted(rsp) + require.True(t, found) + RequireTxSuccess(t, txResult) + + proposalsResp := cli.CustomQuery("q", "gov", "proposals") + proposals := gjson.Get(proposalsResp, "proposals.#.id").Array() + require.NotEmpty(t, proposals) + + proposal1 := cli.CustomQuery("q", "gov", "proposal", "1") + fmt.Println("first proposal", proposal1) + + testCases := []struct { + name string + args []string + expectErr bool + expectedCode uint32 + broadcasted bool + errMsg string + }{ + { + "vote for invalid proposal", + []string{ + "tx", "gov", "weighted-vote", + "10", + "yes", + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(10))).String()), + }, + true, 3, true, + "inactive proposal", + }, + { + "valid vote", + []string{ + "tx", "gov", "weighted-vote", + "1", + "yes", + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(10))).String()), + }, + false, 0, true, + "", + }, + { + "valid vote with metadata", + []string{ + "tx", "gov", "weighted-vote", + "1", + "yes", + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--metadata=%s", "AQ=="), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(10))).String()), + }, + false, 0, true, + "", + }, + { + "invalid valid split vote string", + []string{ + "tx", "gov", "weighted-vote", + "1", + "yes/0.6,no/0.3,abstain/0.05,no_with_veto/0.05", + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(10))).String()), + }, + true, 0, false, + "is not a valid vote option", + }, + { + "valid split vote", + []string{ + "tx", "gov", "weighted-vote", + "1", + "yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05", + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(10))).String()), + }, + false, 0, true, + "", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + if !tc.broadcasted { + assertOutput := func(_ assert.TestingT, gotErr error, gotOutputs ...interface{}) bool { + require.Contains(t, gotOutputs[0], tc.errMsg) + return false + } + cli.WithRunErrorMatcher(assertOutput).Run(tc.args...) + } else { + rsp := cli.Run(tc.args...) + if tc.expectErr { + RequireTxFailure(t, rsp) + } else { + cli.AwaitTxCommitted(rsp) + } + } + }) + } +} + +func TestQueryDeposit(t *testing.T) { + // given a running chain + + sut.ResetChain(t) + cli := NewCLIWrapper(t, sut, verbose) + + // get validator address + valAddr := gjson.Get(cli.Keys("keys", "list"), "0.address").String() + require.NotEmpty(t, valAddr) + + sut.StartChain(t) + + // Submit a new proposal for voting + proposalArgs := []string{ + "tx", "gov", "submit-legacy-proposal", + fmt.Sprintf("--%s='Text Proposal'", "title"), + fmt.Sprintf("--%s='Where is the title!?'", "description"), + fmt.Sprintf("--%s=%s", "type", "Text"), + fmt.Sprintf("--%s=%s", "deposit", sdk.NewCoin("stake", math.NewInt(10_000_000)).String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(10))).String())} + rsp := cli.Run(proposalArgs...) + txResult, found := cli.AwaitTxCommitted(rsp) + require.True(t, found) + RequireTxSuccess(t, txResult) + + // Query initial deposit + resp := cli.CustomQuery("q", "gov", "deposit", "1", valAddr) + depositAmount := gjson.Get(resp, "deposit.amount.0.amount").Int() + require.Equal(t, depositAmount, int64(10_000_000)) + + resp = cli.CustomQuery("q", "gov", "deposits", "1") + deposits := gjson.Get(resp, "deposits").Array() + require.Equal(t, len(deposits), 1) + + time.Sleep(time.Second * 8) + resp = cli.CustomQuery("q", "gov", "deposits", "1") + deposits = gjson.Get(resp, "deposits").Array() + require.Equal(t, len(deposits), 0) +} diff --git a/tests/systemtests/rpc_client.go b/tests/systemtests/rpc_client.go index d1acfd780ff4..4714715be600 100644 --- a/tests/systemtests/rpc_client.go +++ b/tests/systemtests/rpc_client.go @@ -2,11 +2,23 @@ package systemtests import ( "context" + "errors" + "reflect" + "strconv" "testing" + abci "github.com/cometbft/cometbft/api/cometbft/abci/v1" + rpcclient "github.com/cometbft/cometbft/rpc/client" client "github.com/cometbft/cometbft/rpc/client/http" cmtypes "github.com/cometbft/cometbft/types" "github.com/stretchr/testify/require" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" ) // RPCClient is a test helper to interact with a node via the RPC endpoint. @@ -31,3 +43,71 @@ func (r RPCClient) Validators() []*cmtypes.Validator { require.NoError(r.t, err) return v.Validators } + +func (r RPCClient) Invoke(ctx context.Context, method string, req, reply interface{}, opts ...grpc.CallOption) error { + if reflect.ValueOf(req).IsNil() { + return errors.New("request cannot be nil") + } + + ir := types.NewInterfaceRegistry() + cryptocodec.RegisterInterfaces(ir) + cdc := codec.NewProtoCodec(ir).GRPCCodec() + + reqBz, err := cdc.Marshal(req) + if err != nil { + return err + } + + var height int64 + md, _ := metadata.FromOutgoingContext(ctx) + if heights := md.Get(grpctypes.GRPCBlockHeightHeader); len(heights) > 0 { + height, err := strconv.ParseInt(heights[0], 10, 64) + if err != nil { + return err + } + if height < 0 { + return errors.New("height must be greater than or equal to 0") + } + } + + abciReq := abci.QueryRequest{ + Path: method, + Data: reqBz, + Height: height, + } + + abciOpts := rpcclient.ABCIQueryOptions{ + Height: height, + Prove: abciReq.Prove, + } + + result, err := r.client.ABCIQueryWithOptions(ctx, abciReq.Path, abciReq.Data, abciOpts) + if err != nil { + return err + } + + if !result.Response.IsOK() { + return errors.New(result.Response.String()) + } + + err = cdc.Unmarshal(result.Response.Value, reply) + if err != nil { + return err + } + + md = metadata.Pairs(grpctypes.GRPCBlockHeightHeader, strconv.FormatInt(result.Response.Height, 10)) + for _, callOpt := range opts { + header, ok := callOpt.(grpc.HeaderCallOption) + if !ok { + continue + } + + *header.HeaderAddr = md + } + + return types.UnpackInterfaces(reply, ir) +} + +func (r RPCClient) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error) { + return nil, errors.New("not implemented") +} diff --git a/tests/systemtests/system.go b/tests/systemtests/system.go index d76d482b89e2..028645956d85 100644 --- a/tests/systemtests/system.go +++ b/tests/systemtests/system.go @@ -132,6 +132,11 @@ func (s *SystemUnderTest) SetupChain() { if err != nil { panic(fmt.Sprintf("failed set block max gas: %s", err)) } + // Short period for gov + genesisBz, err = sjson.SetRawBytes(genesisBz, "app_state.gov.params.voting_period", []byte(fmt.Sprintf(`"%s"`, "8s"))) + if err != nil { + panic(fmt.Sprintf("failed set block max gas: %s", err)) + } s.withEachNodeHome(func(i int, home string) { if err := saveGenesis(home, genesisBz); err != nil { panic(err) diff --git a/x/accounts/README.md b/x/accounts/README.md index 39dd65af48ba..6be5a541eaeb 100644 --- a/x/accounts/README.md +++ b/x/accounts/README.md @@ -1,6 +1,95 @@ -# x/accounts +# x/accounts Module -The x/accounts module provides module and facilities for writing smart cosmos-sdk accounts. +The x/accounts module enhances the Cosmos SDK by providing tools and infrastructure for creating advanced smart accounts. + +# The Authentication Interface + +x/accounts introduces the `Authentication` interface, allowing for flexible transaction (TX) authentication beyond traditional public key cryptography. + +Chain developers can implement tailored authentication methods for their accounts. Any account that implements the `Authentication` interface can be authenticated within a transaction. + +To implement the `Authentication` interface in x/accounts, an account must expose an execution handler capable of processing a specific message type. + +The key message type for authentication is `MsgAuthenticate`, which is defined in the module's protocol buffer files: + +[interfaces/account_abstraction/v1/interface.proto](./proto/cosmos/accounts/interfaces/account_abstraction/v1/interface.proto) + +## Authentication Mechanism + +### AnteHandler in the SDK + +The Cosmos SDK utilizes an `AnteHandler` to verify transaction (TX) integrity. Its primary function is to ensure that the messages within a transaction are correctly signed by the purported sender. + +### Authentication Flow for x/accounts Module + +When the `AnteHandler` identifies that a message sender (and transaction signer) belongs to the x/accounts module, it delegates the authentication process to that module. + +#### Authentication Interface Requirement + +For successful authentication, the account must implement the `Authentication` interface. If an account fails to implement this interface, it's considered non-externally owned, resulting in transaction rejection. + +##### Sequence Diagram + +```mermaid +graph TD + A[Tx Is Received] --> B[Execute Signature Verification Ante Handler] + B --> D{Is signer an x/accounts account?} + D -->|No| E[Continue with signature verification ante handler] + D -->|Yes| F{Does account handle MsgAuthenticate?} + F -->|No| G[Fail TX: Non-externally owned account] + F -->|Yes| H[Invoke signer account MsgAuthenticate] + E --> I[End] + G --> I + H --> I +``` + + +## Implementing the Authentication Interface + +To implement the Authentication interface, an account must handle the execution of `MsgAuthenticate`. Here's an example of how to do this: + +```go +package base + +import ( + "context" + "errors" + aa_interface_v1 "github.com/cosmos/cosmos-sdk/x/accounts/interfaces/account_abstraction/v1" + "github.com/cosmos/cosmos-sdk/x/accounts/std" +) + +// Account represents a base account structure +type Account struct { + // Account fields... +} + +// Authenticate implements the authentication flow for an abstracted base account. +func (a Account) Authenticate(ctx context.Context, msg *aa_interface_v1.MsgAuthenticate) (*aa_interface_v1.MsgAuthenticateResponse, error) { + if !accountstd.SenderIsAccountsModule(ctx) { + return nil, errors.New("unauthorized: only accounts module is allowed to call this") + } + // Implement your authentication logic here + // ... + return &aa_interface_v1.MsgAuthenticateResponse{}, nil +} + +// RegisterExecuteHandlers registers the execution handlers for the account. +func (a Account) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { + accountstd.RegisterExecuteHandler(builder, a.SwapPubKey) // Other handlers + accountstd.RegisterExecuteHandler(builder, a.Authenticate) // Implements the Authentication interface +} +``` + +### Key Implementation Points + +1. **Sender Verification**: Always verify that the sender is the x/accounts module. This prevents unauthorized accounts from triggering authentication. +2. **Authentication Safety**: Ensure your authentication mechanism is secure: + - Prevent replay attacks by making it impossible to reuse the same action with the same signature. + + +#### Implementation example + +Please find an example [here](./defaults/base/account.go). # Supporting Custom Accounts in the x/auth gRPC Server diff --git a/x/accounts/accountstd/exports.go b/x/accounts/accountstd/exports.go index 973a16c4b2cb..2ebe1acb82fb 100644 --- a/x/accounts/accountstd/exports.go +++ b/x/accounts/accountstd/exports.go @@ -34,6 +34,16 @@ type InitBuilder = implementation.InitBuilder // AccountCreatorFunc is the exported type of AccountCreatorFunc. type AccountCreatorFunc = implementation.AccountCreatorFunc +func DIAccount[A Interface](name string, constructor func(deps Dependencies) (A, error)) DepinjectAccount { + return DepinjectAccount{MakeAccount: AddAccount(name, constructor)} +} + +type DepinjectAccount struct { + MakeAccount AccountCreatorFunc +} + +func (DepinjectAccount) IsManyPerContainerType() {} + // Dependencies is the exported type of Dependencies. type Dependencies = implementation.Dependencies diff --git a/x/accounts/defaults/base/account.go b/x/accounts/defaults/base/account.go index 2bfd154a62ed..b227899aec75 100644 --- a/x/accounts/defaults/base/account.go +++ b/x/accounts/defaults/base/account.go @@ -33,6 +33,8 @@ var ( type Option func(a *Account) +func (Option) IsManyPerContainerType() {} + func NewAccount(name string, handlerMap *signing.HandlerMap, options ...Option) accountstd.AccountCreatorFunc { return func(deps accountstd.Dependencies) (string, accountstd.Interface, error) { acc := Account{ diff --git a/x/accounts/defaults/base/depinject/depinject.go b/x/accounts/defaults/base/depinject/depinject.go new file mode 100644 index 000000000000..6943b5dcaafd --- /dev/null +++ b/x/accounts/defaults/base/depinject/depinject.go @@ -0,0 +1,31 @@ +package basedepinject + +import ( + "cosmossdk.io/depinject" + "cosmossdk.io/x/accounts/accountstd" + "cosmossdk.io/x/accounts/defaults/base" + "cosmossdk.io/x/tx/signing" +) + +type Inputs struct { + depinject.In + + SignHandlersMap *signing.HandlerMap + Options []base.Option +} + +func ProvideAccount(in Inputs) accountstd.DepinjectAccount { + return accountstd.DepinjectAccount{MakeAccount: base.NewAccount("base", in.SignHandlersMap, in.Options...)} +} + +func ProvideSecp256K1PubKey() base.Option { + return base.WithSecp256K1PubKey() +} + +func ProvideCustomPubkey[T any, PT base.PubKeyG[T]]() base.Option { + return base.WithPubKey[T, PT]() +} + +func ProvideCustomPubKeyAndValidationFunc[T any, PT base.PubKeyG[T]](validateFn func(PT) error) base.Option { + return base.WithPubKeyWithValidationFunc(validateFn) +} diff --git a/x/accounts/defaults/base/go.mod b/x/accounts/defaults/base/go.mod index a65b80239cc2..d7d5b4acafe5 100644 --- a/x/accounts/defaults/base/go.mod +++ b/x/accounts/defaults/base/go.mod @@ -6,6 +6,7 @@ require ( cosmossdk.io/api v0.7.6 cosmossdk.io/collections v0.4.0 cosmossdk.io/core v1.0.0-alpha.3 + cosmossdk.io/depinject v1.0.0 cosmossdk.io/x/accounts v0.0.0-20240913065641-0064ccbce64e cosmossdk.io/x/tx v0.13.3 github.com/cosmos/cosmos-sdk v0.53.0 @@ -19,11 +20,10 @@ require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/core/testing v0.0.0-20240923163230-04da382a9f29 // indirect - cosmossdk.io/depinject v1.0.0 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.4.1 // indirect cosmossdk.io/math v1.3.0 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect @@ -174,15 +174,7 @@ replace ( cosmossdk.io/collections => ../../../../collections // TODO tag new collections ASAP cosmossdk.io/store => ../../../../store cosmossdk.io/x/accounts => ../../. - cosmossdk.io/x/accounts/defaults/multisig => ../multisig - cosmossdk.io/x/auth => ../../../auth cosmossdk.io/x/bank => ../../../bank - cosmossdk.io/x/consensus => ../../../consensus - cosmossdk.io/x/distribution => ../../../distribution - cosmossdk.io/x/gov => ../../../gov - cosmossdk.io/x/mint => ../../../mint - cosmossdk.io/x/protocolpool => ../../../protocolpool - cosmossdk.io/x/slashing => ../../../slashing cosmossdk.io/x/staking => ../../../staking cosmossdk.io/x/tx => ../../../tx ) diff --git a/x/accounts/defaults/base/go.sum b/x/accounts/defaults/base/go.sum index b6b442434fe0..ed44e6e28aa4 100644 --- a/x/accounts/defaults/base/go.sum +++ b/x/accounts/defaults/base/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/accounts/defaults/lockup/depinject/depinject.go b/x/accounts/defaults/lockup/depinject/depinject.go new file mode 100644 index 000000000000..df26d6ce78aa --- /dev/null +++ b/x/accounts/defaults/lockup/depinject/depinject.go @@ -0,0 +1,31 @@ +package lockupdepinject + +import ( + "cosmossdk.io/x/accounts/accountstd" + "cosmossdk.io/x/accounts/defaults/lockup" +) + +func ProvideAllLockupAccounts() []accountstd.DepinjectAccount { + return []accountstd.DepinjectAccount{ + ProvidePeriodicLockingAccount(), + ProvideContinuousLockingAccount(), + ProvidePermanentLockingAccount(), + ProvideDelayedLockingAccount(), + } +} + +func ProvideContinuousLockingAccount() accountstd.DepinjectAccount { + return accountstd.DIAccount(lockup.CONTINUOUS_LOCKING_ACCOUNT, lockup.NewContinuousLockingAccount) +} + +func ProvidePeriodicLockingAccount() accountstd.DepinjectAccount { + return accountstd.DIAccount(lockup.PERIODIC_LOCKING_ACCOUNT, lockup.NewPeriodicLockingAccount) +} + +func ProvideDelayedLockingAccount() accountstd.DepinjectAccount { + return accountstd.DIAccount(lockup.DELAYED_LOCKING_ACCOUNT, lockup.NewDelayedLockingAccount) +} + +func ProvidePermanentLockingAccount() accountstd.DepinjectAccount { + return accountstd.DIAccount(lockup.PERMANENT_LOCKING_ACCOUNT, lockup.NewPermanentLockingAccount) +} diff --git a/x/accounts/defaults/lockup/go.mod b/x/accounts/defaults/lockup/go.mod index 53a5d0bd8552..28b24473ee91 100644 --- a/x/accounts/defaults/lockup/go.mod +++ b/x/accounts/defaults/lockup/go.mod @@ -22,7 +22,7 @@ require ( cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect @@ -151,13 +151,8 @@ replace ( cosmossdk.io/collections => ../../../../collections // TODO tag new collections ASAP cosmossdk.io/store => ../../../../store cosmossdk.io/x/accounts => ../../. - cosmossdk.io/x/accounts/defaults/multisig => ../multisig cosmossdk.io/x/bank => ../../../bank - cosmossdk.io/x/consensus => ../../../consensus cosmossdk.io/x/distribution => ../../../distribution - cosmossdk.io/x/gov => ../../../gov - cosmossdk.io/x/mint => ../../../mint - cosmossdk.io/x/protocolpool => ../../../protocolpool - cosmossdk.io/x/slashing => ../../../slashing cosmossdk.io/x/staking => ../../../staking + cosmossdk.io/x/tx => ../../../tx ) diff --git a/x/accounts/defaults/lockup/go.sum b/x/accounts/defaults/lockup/go.sum index 5ceb56777eaf..5904ba842e9d 100644 --- a/x/accounts/defaults/lockup/go.sum +++ b/x/accounts/defaults/lockup/go.sum @@ -16,10 +16,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= -cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= -cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/accounts/defaults/multisig/account.go b/x/accounts/defaults/multisig/account.go index 62dbea15c3ba..e60476b33f6c 100644 --- a/x/accounts/defaults/multisig/account.go +++ b/x/accounts/defaults/multisig/account.go @@ -16,8 +16,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" ) -var MULTISIG_ACCOUNT = "multisig-account" - var ( MembersPrefix = collections.NewPrefix(0) SequencePrefix = collections.NewPrefix(1) diff --git a/x/accounts/defaults/multisig/depinject/depinject.go b/x/accounts/defaults/multisig/depinject/depinject.go new file mode 100644 index 000000000000..785799b1a3dd --- /dev/null +++ b/x/accounts/defaults/multisig/depinject/depinject.go @@ -0,0 +1,10 @@ +package multisigdepinject + +import ( + "cosmossdk.io/x/accounts/accountstd" + "cosmossdk.io/x/accounts/defaults/multisig" +) + +func ProvideAccount() accountstd.DepinjectAccount { + return accountstd.DIAccount("multisig", multisig.NewAccount) +} diff --git a/x/accounts/defaults/multisig/go.mod b/x/accounts/defaults/multisig/go.mod index 6be3fc00bbd5..0d45129daaa5 100644 --- a/x/accounts/defaults/multisig/go.mod +++ b/x/accounts/defaults/multisig/go.mod @@ -23,7 +23,7 @@ require ( cosmossdk.io/depinject v1.0.0 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.4.1 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect @@ -175,12 +175,6 @@ replace ( cosmossdk.io/store => ../../../../store cosmossdk.io/x/accounts => ../../. cosmossdk.io/x/bank => ../../../bank - cosmossdk.io/x/consensus => ../../../consensus - cosmossdk.io/x/distribution => ../../../distribution - cosmossdk.io/x/gov => ../../../gov - cosmossdk.io/x/mint => ../../../mint - cosmossdk.io/x/protocolpool => ../../../protocolpool - cosmossdk.io/x/slashing => ../../../slashing cosmossdk.io/x/staking => ../../../staking cosmossdk.io/x/tx => ../../../tx ) diff --git a/x/accounts/defaults/multisig/go.sum b/x/accounts/defaults/multisig/go.sum index b6b442434fe0..ed44e6e28aa4 100644 --- a/x/accounts/defaults/multisig/go.sum +++ b/x/accounts/defaults/multisig/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/accounts/depinject.go b/x/accounts/depinject.go index 1110a0525a20..4bdcfdc6479c 100644 --- a/x/accounts/depinject.go +++ b/x/accounts/depinject.go @@ -1,19 +1,12 @@ package accounts import ( - "context" - modulev1 "cosmossdk.io/api/cosmos/accounts/module/v1" - signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" "cosmossdk.io/depinject" "cosmossdk.io/depinject/appconfig" "cosmossdk.io/x/accounts/accountstd" - baseaccount "cosmossdk.io/x/accounts/defaults/base" - "cosmossdk.io/x/accounts/defaults/lockup" - "cosmossdk.io/x/accounts/defaults/multisig" - "cosmossdk.io/x/tx/signing" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -39,8 +32,7 @@ type ModuleInputs struct { AddressCodec address.Codec Registry cdctypes.InterfaceRegistry - // TODO: Add a way to inject custom accounts. - // Currently only the base account is supported. + Accounts []accountstd.DepinjectAccount // at least one account must be provided } type ModuleOutputs struct { @@ -50,32 +42,19 @@ type ModuleOutputs struct { Module appmodule.AppModule } -var _ signing.SignModeHandler = directHandler{} - -type directHandler struct{} - -func (s directHandler) Mode() signingv1beta1.SignMode { - return signingv1beta1.SignMode_SIGN_MODE_DIRECT -} - -func (s directHandler) GetSignBytes(_ context.Context, _ signing.SignerData, _ signing.TxData) ([]byte, error) { - panic("not implemented") -} - func ProvideModule(in ModuleInputs) ModuleOutputs { - handler := directHandler{} - account := baseaccount.NewAccount("base", signing.NewHandlerMap(handler), baseaccount.WithSecp256K1PubKey()) - accountskeeper, err := NewKeeper( - in.Cdc, in.Environment, in.AddressCodec, in.Registry, account, - accountstd.AddAccount(lockup.CONTINUOUS_LOCKING_ACCOUNT, lockup.NewContinuousLockingAccount), - accountstd.AddAccount(lockup.PERIODIC_LOCKING_ACCOUNT, lockup.NewPeriodicLockingAccount), - accountstd.AddAccount(lockup.DELAYED_LOCKING_ACCOUNT, lockup.NewDelayedLockingAccount), - accountstd.AddAccount(lockup.PERMANENT_LOCKING_ACCOUNT, lockup.NewPermanentLockingAccount), - accountstd.AddAccount(multisig.MULTISIG_ACCOUNT, multisig.NewAccount), + accCreators := make([]accountstd.AccountCreatorFunc, len(in.Accounts)) + for i, acc := range in.Accounts { + accCreators[i] = acc.MakeAccount + } + + accountsKeeper, err := NewKeeper( + in.Cdc, in.Environment, in.AddressCodec, in.Registry, + accCreators..., ) if err != nil { panic(err) } - m := NewAppModule(in.Cdc, accountskeeper) - return ModuleOutputs{AccountsKeeper: accountskeeper, Module: m} + m := NewAppModule(in.Cdc, accountsKeeper) + return ModuleOutputs{AccountsKeeper: accountsKeeper, Module: m} } diff --git a/x/accounts/go.mod b/x/accounts/go.mod index acf653d3bd1b..0470f7e57e4e 100644 --- a/x/accounts/go.mod +++ b/x/accounts/go.mod @@ -8,8 +8,6 @@ require ( cosmossdk.io/core v1.0.0-alpha.3 cosmossdk.io/core/testing v0.0.0-20240923163230-04da382a9f29 cosmossdk.io/depinject v1.0.0 - cosmossdk.io/x/accounts/defaults/base v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/accounts/defaults/multisig v0.0.0-00010101000000-000000000000 cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 cosmossdk.io/x/tx v0.13.3 github.com/cosmos/cosmos-sdk v0.53.0 @@ -33,10 +31,8 @@ require ( cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.4.1 // indirect cosmossdk.io/math v1.3.0 - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect - cosmossdk.io/x/accounts/defaults/lockup v0.0.0-20240417181816-5e7aae0db1f5 - cosmossdk.io/x/distribution v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -181,13 +177,7 @@ replace ( cosmossdk.io/api => ../../api cosmossdk.io/collections => ../../collections cosmossdk.io/store => ../../store - cosmossdk.io/x/accounts/defaults/base => ./defaults/base // REMOVE this when - cosmossdk.io/x/accounts/defaults/lockup => ./defaults/lockup - cosmossdk.io/x/accounts/defaults/multisig => ./defaults/multisig cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/distribution => ../distribution - cosmossdk.io/x/mint => ../mint - cosmossdk.io/x/slashing => ../slashing cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx ) diff --git a/x/accounts/go.sum b/x/accounts/go.sum index 934d22e1cbe7..929e4299e0f9 100644 --- a/x/accounts/go.sum +++ b/x/accounts/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/auth/tx/config/depinject.go b/x/auth/tx/config/depinject.go index bda9ca8735e7..239ab496517f 100644 --- a/x/auth/tx/config/depinject.go +++ b/x/auth/tx/config/depinject.go @@ -49,9 +49,10 @@ type ModuleInputs struct { type ModuleOutputs struct { depinject.Out - BaseAppOption runtime.BaseAppOption // This is only useful for chains using baseapp. - TxConfig client.TxConfig - TxConfigOptions tx.ConfigOptions + BaseAppOption runtime.BaseAppOption // This is only useful for chains using baseapp. + TxConfig client.TxConfig + TxConfigOptions tx.ConfigOptions + TxSigningHandlerMap *txsigning.HandlerMap } func ProvideProtoRegistry() txsigning.ProtoFileResolver { @@ -89,8 +90,9 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { app.SetTxDecoder(txConfig.TxDecoder()) app.SetTxEncoder(txConfig.TxEncoder()) }, - TxConfig: txConfig, - TxConfigOptions: txConfigOptions, + TxConfig: txConfig, + TxConfigOptions: txConfigOptions, + TxSigningHandlerMap: txConfig.SignModeHandler(), } } diff --git a/x/authz/go.mod b/x/authz/go.mod index ea249f9ae63d..79207bd471ae 100644 --- a/x/authz/go.mod +++ b/x/authz/go.mod @@ -30,7 +30,7 @@ require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/x/authz/go.sum b/x/authz/go.sum index 934d22e1cbe7..929e4299e0f9 100644 --- a/x/authz/go.sum +++ b/x/authz/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/bank/go.mod b/x/bank/go.mod index 4fe344558195..48982baedcaa 100644 --- a/x/bank/go.mod +++ b/x/bank/go.mod @@ -163,7 +163,7 @@ require ( require cosmossdk.io/core/testing v0.0.0-20240923163230-04da382a9f29 require ( - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cosmos/cosmos-db v1.0.3-0.20240911104526-ddc3f09bfc22 // indirect github.com/google/uuid v1.6.0 // indirect diff --git a/x/bank/go.sum b/x/bank/go.sum index 934d22e1cbe7..929e4299e0f9 100644 --- a/x/bank/go.sum +++ b/x/bank/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/circuit/go.mod b/x/circuit/go.mod index 99934795a92a..19ee02fc7960 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -24,7 +24,7 @@ require ( buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/log v1.4.1 // indirect cosmossdk.io/math v1.3.0 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect diff --git a/x/circuit/go.sum b/x/circuit/go.sum index 747470c22d80..59d48224896a 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/consensus/go.mod b/x/consensus/go.mod index de3ed1071c85..3df81db73a15 100644 --- a/x/consensus/go.mod +++ b/x/consensus/go.mod @@ -27,7 +27,7 @@ require ( cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.4.1 // indirect cosmossdk.io/math v1.3.0 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect diff --git a/x/consensus/go.sum b/x/consensus/go.sum index 9fa6a4ca9fb4..c79b0839dfb5 100644 --- a/x/consensus/go.sum +++ b/x/consensus/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/distribution/go.mod b/x/distribution/go.mod index 3e2a2e632209..d96bd46afb32 100644 --- a/x/distribution/go.mod +++ b/x/distribution/go.mod @@ -29,7 +29,7 @@ require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/log v1.4.1 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/x/distribution/go.sum b/x/distribution/go.sum index 934d22e1cbe7..929e4299e0f9 100644 --- a/x/distribution/go.sum +++ b/x/distribution/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/epochs/go.mod b/x/epochs/go.mod index 05f635296b34..2b4fb18061c1 100644 --- a/x/epochs/go.mod +++ b/x/epochs/go.mod @@ -20,7 +20,7 @@ require ( google.golang.org/grpc v1.67.0 ) -require cosmossdk.io/schema v0.3.0 // indirect +require cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect diff --git a/x/epochs/go.sum b/x/epochs/go.sum index 9fa6a4ca9fb4..c79b0839dfb5 100644 --- a/x/epochs/go.sum +++ b/x/epochs/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/evidence/go.mod b/x/evidence/go.mod index e2170919c18e..7d2ad3a09eee 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -28,7 +28,7 @@ require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/log v1.4.1 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect diff --git a/x/evidence/go.sum b/x/evidence/go.sum index 747470c22d80..59d48224896a 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index cd3f93c41d25..b2298353d7bc 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -37,7 +37,7 @@ require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/log v1.4.1 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index ed1e72cb37a6..3daf3b69c525 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 h1:XQJj9Dv9Gtze0l2TF79BU5lkP6MkUveTUuKICmxoz+o= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190/go.mod h1:7WUGupOvmlHJoIMBz1JbObQxeo6/TDiuDBxmtod8HRg= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= diff --git a/x/gov/go.mod b/x/gov/go.mod index 80af69cf1281..9b41401197fd 100644 --- a/x/gov/go.mod +++ b/x/gov/go.mod @@ -35,7 +35,7 @@ require ( require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect diff --git a/x/gov/go.sum b/x/gov/go.sum index 25e66089f97e..f6a5dde44eda 100644 --- a/x/gov/go.sum +++ b/x/gov/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/group/go.mod b/x/group/go.mod index 2740cb7f9c0b..423671d9bffc 100644 --- a/x/group/go.mod +++ b/x/group/go.mod @@ -38,11 +38,7 @@ require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/schema v0.3.0 // indirect - cosmossdk.io/x/accounts/defaults/base v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/accounts/defaults/lockup v0.0.0-20240417181816-5e7aae0db1f5 // indirect - cosmossdk.io/x/accounts/defaults/multisig v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/distribution v0.0.0-00010101000000-000000000000 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/x/epochs v0.0.0-20240522060652-a1ae4c3e0337 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/x/group/go.sum b/x/group/go.sum index 12dc9d6cd335..cc8e02bbe7dc 100644 --- a/x/group/go.sum +++ b/x/group/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/mint/go.mod b/x/mint/go.mod index 444f1ee93640..8e48fc822784 100644 --- a/x/mint/go.mod +++ b/x/mint/go.mod @@ -29,7 +29,7 @@ require ( require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect diff --git a/x/mint/go.sum b/x/mint/go.sum index 747470c22d80..59d48224896a 100644 --- a/x/mint/go.sum +++ b/x/mint/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/nft/go.mod b/x/nft/go.mod index 2e1f662b59a3..a83aba80ec2b 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -26,7 +26,7 @@ require ( buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/core/testing v0.0.0-20240923163230-04da382a9f29 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect diff --git a/x/nft/go.sum b/x/nft/go.sum index 747470c22d80..59d48224896a 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/params/go.mod b/x/params/go.mod index 6ceb76cd56ea..a6c0cba0163c 100644 --- a/x/params/go.mod +++ b/x/params/go.mod @@ -29,7 +29,7 @@ require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect diff --git a/x/params/go.sum b/x/params/go.sum index 8e04ce6df3e9..846be1616d1d 100644 --- a/x/params/go.sum +++ b/x/params/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/protocolpool/go.mod b/x/protocolpool/go.mod index 8cb08057781c..1977a370a6b6 100644 --- a/x/protocolpool/go.mod +++ b/x/protocolpool/go.mod @@ -27,7 +27,7 @@ require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/log v1.4.1 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect diff --git a/x/protocolpool/go.sum b/x/protocolpool/go.sum index 747470c22d80..59d48224896a 100644 --- a/x/protocolpool/go.sum +++ b/x/protocolpool/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/slashing/go.mod b/x/slashing/go.mod index 057192775e17..3f97660855dc 100644 --- a/x/slashing/go.mod +++ b/x/slashing/go.mod @@ -30,7 +30,7 @@ require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/log v1.4.1 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/x/slashing/go.sum b/x/slashing/go.sum index 9090a0b868ad..5e6a825ee88a 100644 --- a/x/slashing/go.sum +++ b/x/slashing/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/staking/go.mod b/x/staking/go.mod index 217efa4dad6d..a1ff550e110e 100644 --- a/x/staking/go.mod +++ b/x/staking/go.mod @@ -163,7 +163,7 @@ require ( ) require ( - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cosmos/cosmos-db v1.0.3-0.20240911104526-ddc3f09bfc22 // indirect github.com/google/uuid v1.6.0 // indirect diff --git a/x/staking/go.sum b/x/staking/go.sum index 934d22e1cbe7..929e4299e0f9 100644 --- a/x/staking/go.sum +++ b/x/staking/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 166a0b5be293..1f4139a74b10 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -42,7 +42,7 @@ require ( cloud.google.com/go/storage v1.43.0 // indirect cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/math v1.3.0 // indirect - cosmossdk.io/schema v0.3.0 // indirect + cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index 93311a69c2a9..a543027e19f4 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -206,8 +206,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= -cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= +cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 h1:XQJj9Dv9Gtze0l2TF79BU5lkP6MkUveTUuKICmxoz+o= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190/go.mod h1:7WUGupOvmlHJoIMBz1JbObQxeo6/TDiuDBxmtod8HRg= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=