diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 0862faab..8a4750d1 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -29,7 +29,7 @@ jobs: - name: build rocksdb dependency run: bash ${GITHUB_WORKSPACE}/.github/scripts/install-rocksdb.sh env: - ROCKSDB_VERSION: v8.1.1 + ROCKSDB_VERSION: v8.10.0 - name: Build and upload release artifacts run: bash ${GITHUB_WORKSPACE}/.github/scripts/publish-internal-release-artifacts.sh env: diff --git a/.github/workflows/ci-rocksdb-build.yml b/.github/workflows/ci-rocksdb-build.yml index c7cff74c..c760f7b1 100644 --- a/.github/workflows/ci-rocksdb-build.yml +++ b/.github/workflows/ci-rocksdb-build.yml @@ -1,7 +1,7 @@ name: Continuous Integration (Rocksdb Build) env: - ROCKSDB_VERSION: v8.1.1 + ROCKSDB_VERSION: v8.10.0 on: workflow_call: diff --git a/CHANGELOG.md b/CHANGELOG.md index feaea393..e9e3469b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ - (cli) [#1785] Add `shard` CLI command to support creating partitions of data for standalone nodes - (cdp) [#1818] Add module param and logic for running x/cdp begin blocker every `n` blocks - (cli) [#1804] Add `rocksdb compact` command for manual DB compaction of state or blockstore. +- (cosmos-sdk) [#1811] Upgrades app to cosmos-sdk v0.47.7 ## [v0.25.0] @@ -323,6 +324,7 @@ the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.38.4/CHANGELOG.md). - [#257](https://github.com/Kava-Labs/kava/pulls/257) Include scripts to run large-scale simulations remotely using aws-batch +[#1811]: https://github.com/Kava-Labs/kava/pull/1811 [#1804]: https://github.com/Kava-Labs/kava/pull/1804 [#1785]: https://github.com/Kava-Labs/kava/pull/1785 [#1784]: https://github.com/Kava-Labs/kava/pull/1784 diff --git a/Dockerfile-rocksdb b/Dockerfile-rocksdb index 593b46d7..d465ba3a 100644 --- a/Dockerfile-rocksdb +++ b/Dockerfile-rocksdb @@ -10,7 +10,7 @@ WORKDIR /root # default home directory is /root # install rocksdb -ARG rocksdb_version=v8.1.1 +ARG rocksdb_version=v8.10.0 ENV ROCKSDB_VERSION=$rocksdb_version RUN git clone https://github.com/facebook/rocksdb.git \ diff --git a/Makefile b/Makefile index 1d11e06a..ff8effb9 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ VERSION := $(GIT_COMMIT_SHORT) VERSION_NUMBER := $(VERSION) endif -TENDERMINT_VERSION := $(shell $(GO_BIN) list -m github.com/tendermint/tendermint | sed 's:.* ::') +TENDERMINT_VERSION := $(shell $(GO_BIN) list -m github.com/cometbft/cometbft | sed 's:.* ::') COSMOS_SDK_VERSION := $(shell $(GO_BIN) list -m github.com/cosmos/cosmos-sdk | sed 's:.* ::') .PHONY: print-git-info @@ -147,7 +147,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=kava \ -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION_NUMBER) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(GIT_COMMIT) \ -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \ - -X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TENDERMINT_VERSION) + -X github.com/cometbft/cometbft/version.TMCoreSemVer=$(TENDERMINT_VERSION) # DB backend selection ifeq (cleveldb,$(findstring cleveldb,$(COSMOS_BUILD_OPTIONS))) diff --git a/app/_sim_test.go b/app/_sim_test.go index 02ae732f..0b75637f 100644 --- a/app/_sim_test.go +++ b/app/_sim_test.go @@ -11,15 +11,15 @@ import ( "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - dbm "github.com/tendermint/tm-db" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/simapp" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/simapp" - "github.com/cosmos/cosmos-sdk/simapp/helpers" "github.com/cosmos/cosmos-sdk/store" + "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" @@ -280,7 +280,7 @@ func TestAppStateDeterminism(t *testing.T) { config.ExportParamsPath = "" config.OnOperation = false config.AllInvariants = false - config.ChainID = helpers.SimAppChainID + config.ChainID = sims.SimAppChainID numTimesToRunPerSeed := 2 appHashList := make([]json.RawMessage, numTimesToRunPerSeed) diff --git a/app/_simulate_tx_test.go b/app/_simulate_tx_test.go index 538b4ec9..a6136020 100644 --- a/app/_simulate_tx_test.go +++ b/app/_simulate_tx_test.go @@ -8,8 +8,13 @@ import ( "net/http/httptest" "testing" + sdkmath "cosmossdk.io/math" "github.com/kava-labs/kava/app" + abci "github.com/cometbft/cometbft/abci/types" + tmbytes "github.com/cometbft/cometbft/libs/bytes" + ctypes "github.com/cometbft/cometbft/rpc/core/types" + jsonrpctypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" "github.com/cosmos/cosmos-sdk/client/context" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/rest" @@ -18,10 +23,6 @@ import ( "github.com/gorilla/mux" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" - tmbytes "github.com/tendermint/tendermint/libs/bytes" - ctypes "github.com/tendermint/tendermint/rpc/core/types" - jsonrpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types" ) type SimulateRequestTestSuite struct { diff --git a/app/ante/ante.go b/app/ante/ante.go index 2b6b81c8..abc1db32 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -5,16 +5,16 @@ import ( "runtime/debug" errorsmod "cosmossdk.io/errors" + tmlog "github.com/cometbft/cometbft/libs/log" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authante "github.com/cosmos/cosmos-sdk/x/auth/ante" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - ibcante "github.com/cosmos/ibc-go/v6/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper" + ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" evmante "github.com/evmos/ethermint/app/ante" evmtypes "github.com/evmos/ethermint/x/evm/types" - tmlog "github.com/tendermint/tendermint/libs/log" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC diff --git a/app/ante/ante_test.go b/app/ante/ante_test.go index fd2e10c9..fd4af13f 100644 --- a/app/ante/ante_test.go +++ b/app/ante/ante_test.go @@ -7,9 +7,13 @@ import ( "time" sdkmath "cosmossdk.io/math" + tmdb "github.com/cometbft/cometbft-db" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/simapp/helpers" + "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" @@ -17,9 +21,6 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" evmtypes "github.com/evmos/ethermint/x/evm/types" "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tmdb "github.com/tendermint/tm-db" "github.com/kava-labs/kava/app" bep3types "github.com/kava-labs/kava/x/bep3/types" @@ -56,10 +57,11 @@ func TestAppAnteHandler_AuthorizedMempool(t *testing.T) { nil, encodingConfig, opts, + baseapp.SetChainID(app.TestChainId), ), } - chainID := "kavatest_1-1" + chainID := app.TestChainId tApp = tApp.InitializeFromGenesisStatesWithTimeAndChainID( time.Date(1998, 1, 1, 0, 0, 0, 0, time.UTC), chainID, @@ -106,7 +108,7 @@ func TestAppAnteHandler_AuthorizedMempool(t *testing.T) { for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - stdTx, err := helpers.GenSignedMockTx( + stdTx, err := sims.GenSignedMockTx( rand.New(rand.NewSource(time.Now().UnixNano())), encodingConfig.TxConfig, []sdk.Msg{ @@ -117,7 +119,7 @@ func TestAppAnteHandler_AuthorizedMempool(t *testing.T) { ), }, sdk.NewCoins(), // no fee - helpers.DefaultGenTxGas, + sims.DefaultGenTxGas, chainID, []uint64{0}, []uint64{0}, // fixed sequence numbers will cause tests to fail sig verification if the same address is used twice @@ -209,7 +211,7 @@ func TestAppAnteHandler_RejectMsgsInAuthz(t *testing.T) { return msg } - chainID := "kavatest_1-1" + chainID := app.TestChainId encodingConfig := app.MakeEncodingConfig() testcases := []struct { @@ -238,12 +240,12 @@ func TestAppAnteHandler_RejectMsgsInAuthz(t *testing.T) { chainID, ) - stdTx, err := helpers.GenSignedMockTx( + stdTx, err := sims.GenSignedMockTx( rand.New(rand.NewSource(time.Now().UnixNano())), encodingConfig.TxConfig, []sdk.Msg{tc.msg}, sdk.NewCoins(), // no fee - helpers.DefaultGenTxGas, + sims.DefaultGenTxGas, chainID, []uint64{0}, []uint64{0}, diff --git a/app/ante/authorized_test.go b/app/ante/authorized_test.go index fafb5576..2cca0a75 100644 --- a/app/ante/authorized_test.go +++ b/app/ante/authorized_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/simapp/helpers" + "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/stretchr/testify/require" @@ -38,7 +38,7 @@ func TestAuthenticatedMempoolDecorator_AnteHandle_NotCheckTx(t *testing.T) { fetcher := mockAddressFetcher(testAddresses[1:]...) decorator := ante.NewAuthenticatedMempoolDecorator(fetcher) - tx, err := helpers.GenSignedMockTx( + tx, err := sims.GenSignedMockTx( rand.New(rand.NewSource(time.Now().UnixNano())), txConfig, []sdk.Msg{ @@ -49,7 +49,7 @@ func TestAuthenticatedMempoolDecorator_AnteHandle_NotCheckTx(t *testing.T) { ), }, sdk.NewCoins(), // no fee - helpers.DefaultGenTxGas, + sims.DefaultGenTxGas, "testing-chain-id", []uint64{0}, []uint64{0}, @@ -73,7 +73,7 @@ func TestAuthenticatedMempoolDecorator_AnteHandle_Pass(t *testing.T) { decorator := ante.NewAuthenticatedMempoolDecorator(fetcher) - tx, err := helpers.GenSignedMockTx( + tx, err := sims.GenSignedMockTx( rand.New(rand.NewSource(time.Now().UnixNano())), txConfig, []sdk.Msg{ @@ -89,7 +89,7 @@ func TestAuthenticatedMempoolDecorator_AnteHandle_Pass(t *testing.T) { ), }, sdk.NewCoins(), // no fee - helpers.DefaultGenTxGas, + sims.DefaultGenTxGas, "testing-chain-id", []uint64{0, 123}, []uint64{0, 123}, @@ -114,7 +114,7 @@ func TestAuthenticatedMempoolDecorator_AnteHandle_Reject(t *testing.T) { decorator := ante.NewAuthenticatedMempoolDecorator(fetcher) - tx, err := helpers.GenSignedMockTx( + tx, err := sims.GenSignedMockTx( rand.New(rand.NewSource(time.Now().UnixNano())), txConfig, []sdk.Msg{ @@ -125,7 +125,7 @@ func TestAuthenticatedMempoolDecorator_AnteHandle_Reject(t *testing.T) { ), }, sdk.NewCoins(), // no fee - helpers.DefaultGenTxGas, + sims.DefaultGenTxGas, "testing-chain-id", []uint64{0}, []uint64{0}, diff --git a/app/ante/authz_test.go b/app/ante/authz_test.go index 78d0fd55..452da4d2 100644 --- a/app/ante/authz_test.go +++ b/app/ante/authz_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/simapp/helpers" + "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/authz" @@ -212,12 +212,12 @@ func TestAuthzLimiterDecorator(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - tx, err := helpers.GenSignedMockTx( + tx, err := sims.GenSignedMockTx( rand.New(rand.NewSource(time.Now().UnixNano())), txConfig, tc.msgs, sdk.NewCoins(), - helpers.DefaultGenTxGas, + sims.DefaultGenTxGas, "testing-chain-id", []uint64{0}, []uint64{0}, diff --git a/app/ante/eip712_test.go b/app/ante/eip712_test.go index a2ed4e27..91504d69 100644 --- a/app/ante/eip712_test.go +++ b/app/ante/eip712_test.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/simapp/helpers" + "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" @@ -20,6 +20,11 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/crypto/tmhash" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmversion "github.com/cometbft/cometbft/proto/tendermint/version" + "github.com/cometbft/cometbft/version" "github.com/evmos/ethermint/crypto/ethsecp256k1" "github.com/evmos/ethermint/ethereum/eip712" "github.com/evmos/ethermint/tests" @@ -27,11 +32,6 @@ import ( evmtypes "github.com/evmos/ethermint/x/evm/types" feemarkettypes "github.com/evmos/ethermint/x/feemarket/types" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/crypto/tmhash" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmversion "github.com/tendermint/tendermint/proto/tendermint/version" - "github.com/tendermint/tendermint/version" "github.com/kava-labs/kava/app" cdptypes "github.com/kava-labs/kava/x/cdp/types" @@ -43,7 +43,7 @@ import ( ) const ( - ChainID = "kavatest_1-1" + ChainID = app.TestChainId USDCCoinDenom = "erc20/usdc" USDCCDPType = "erc20-usdc" ) @@ -138,6 +138,7 @@ func (suite *EIP712TestSuite) createTestEIP712CosmosTxBuilder( func (suite *EIP712TestSuite) SetupTest() { tApp := app.NewTestApp() suite.tApp = tApp + cdc := tApp.AppCodec() suite.evmutilKeeper = tApp.GetEvmutilKeeper() @@ -334,6 +335,11 @@ func (suite *EIP712TestSuite) SetupTest() { ) suite.usdcEVMAddr = pair.GetAddress() + // update consensus params + cParams := tApp.GetConsensusParams(suite.ctx) + cParams.Block.MaxGas = sims.DefaultGenTxGas * 20 + tApp.StoreConsensusParams(suite.ctx, cParams) + // Add a contract to evmutil conversion pair evmutilParams := suite.evmutilKeeper.GetParams(suite.ctx) evmutilParams.EnabledConversionPairs = @@ -541,7 +547,7 @@ func (suite *EIP712TestSuite) TestEIP712Tx() { var option *codectypes.Any option, _ = codectypes.NewAnyWithValue(ðerminttypes.ExtensionOptionsWeb3Tx{ FeePayer: suite.testAddr.String(), - TypedDataChainID: 1, + TypedDataChainID: 2221, FeePayerSig: []byte("sig"), }) builder, _ := txBuilder.(authtx.ExtensionOptionsTxBuilder) @@ -570,7 +576,7 @@ func (suite *EIP712TestSuite) TestEIP712Tx() { updateTx: func(txBuilder client.TxBuilder, msgs []sdk.Msg) client.TxBuilder { gasAmt := sdk.NewCoins(sdk.NewCoin("ukava", sdkmath.NewInt(20))) return suite.createTestEIP712CosmosTxBuilder( - suite.testAddr, suite.testPrivKey, "kavatest_12-1", uint64(helpers.DefaultGenTxGas*10), gasAmt, msgs, + suite.testAddr, suite.testPrivKey, "kavatest_12-1", uint64(sims.DefaultGenTxGas*10), gasAmt, msgs, ) }, }, @@ -583,7 +589,7 @@ func (suite *EIP712TestSuite) TestEIP712Tx() { updateTx: func(txBuilder client.TxBuilder, msgs []sdk.Msg) client.TxBuilder { gasAmt := sdk.NewCoins(sdk.NewCoin("ukava", sdkmath.NewInt(20))) return suite.createTestEIP712CosmosTxBuilder( - suite.testAddr2, suite.testPrivKey2, ChainID, uint64(helpers.DefaultGenTxGas*10), gasAmt, msgs, + suite.testAddr2, suite.testPrivKey2, ChainID, uint64(sims.DefaultGenTxGas*10), gasAmt, msgs, ) }, }, @@ -623,7 +629,7 @@ func (suite *EIP712TestSuite) TestEIP712Tx() { gasAmt := sdk.NewCoins(sdk.NewCoin("ukava", sdkmath.NewInt(20))) txBuilder := suite.createTestEIP712CosmosTxBuilder( - suite.testAddr, suite.testPrivKey, ChainID, uint64(helpers.DefaultGenTxGas*10), gasAmt, msgs, + suite.testAddr, suite.testPrivKey, ChainID, uint64(sims.DefaultGenTxGas*10), gasAmt, msgs, ) if tc.updateTx != nil { txBuilder = tc.updateTx(txBuilder, msgs) @@ -709,7 +715,7 @@ func (suite *EIP712TestSuite) TestEIP712Tx_DepositAndWithdraw() { // deliver deposit msg gasAmt := sdk.NewCoins(sdk.NewCoin("ukava", sdkmath.NewInt(20))) txBuilder := suite.createTestEIP712CosmosTxBuilder( - suite.testAddr, suite.testPrivKey, ChainID, uint64(helpers.DefaultGenTxGas*10), gasAmt, depositMsgs, + suite.testAddr, suite.testPrivKey, ChainID, uint64(sims.DefaultGenTxGas*10), gasAmt, depositMsgs, ) txBytes, err := encodingConfig.TxConfig.TxEncoder()(txBuilder.GetTx()) suite.Require().NoError(err) @@ -754,7 +760,7 @@ func (suite *EIP712TestSuite) TestEIP712Tx_DepositAndWithdraw() { // deliver withdraw msg txBuilder = suite.createTestEIP712CosmosTxBuilder( - suite.testAddr, suite.testPrivKey, ChainID, uint64(helpers.DefaultGenTxGas*10), gasAmt, withdrawMsgs, + suite.testAddr, suite.testPrivKey, ChainID, uint64(sims.DefaultGenTxGas*10), gasAmt, withdrawMsgs, ) txBytes, err = encodingConfig.TxConfig.TxEncoder()(txBuilder.GetTx()) suite.Require().NoError(err) diff --git a/app/ante/min_gas_filter_test.go b/app/ante/min_gas_filter_test.go index 546379a5..b8f00df3 100644 --- a/app/ante/min_gas_filter_test.go +++ b/app/ante/min_gas_filter_test.go @@ -4,12 +4,12 @@ import ( "strings" "testing" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" evmtypes "github.com/evmos/ethermint/x/evm/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/app/ante" diff --git a/app/ante/vesting_test.go b/app/ante/vesting_test.go index 12a98315..f0216655 100644 --- a/app/ante/vesting_test.go +++ b/app/ante/vesting_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/cosmos/cosmos-sdk/simapp/helpers" + "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -72,14 +72,14 @@ func TestVestingMempoolDecorator_MsgCreateVestingAccount_Unauthorized(t *testing for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - tx, err := helpers.GenSignedMockTx( + tx, err := sims.GenSignedMockTx( rand.New(rand.NewSource(time.Now().UnixNano())), txConfig, []sdk.Msg{ tt.msg, }, sdk.NewCoins(), - helpers.DefaultGenTxGas, + sims.DefaultGenTxGas, "testing-chain-id", []uint64{0}, []uint64{0}, diff --git a/app/app.go b/app/app.go index f36b426d..64575657 100644 --- a/app/app.go +++ b/app/app.go @@ -8,6 +8,10 @@ import ( "os" "path/filepath" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/cometbft/cometbft/abci/types" + tmjson "github.com/cometbft/cometbft/libs/json" + tmlog "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" @@ -23,6 +27,7 @@ import ( "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" @@ -36,11 +41,13 @@ import ( "github.com/cosmos/cosmos-sdk/x/capability" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + consensus "github.com/cosmos/cosmos-sdk/x/consensus" + consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/crisis" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distr "github.com/cosmos/cosmos-sdk/x/distribution" - distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/evidence" @@ -72,16 +79,17 @@ import ( upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - transfer "github.com/cosmos/ibc-go/v6/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v6/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v6/modules/core" - ibcclient "github.com/cosmos/ibc-go/v6/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v6/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types" - porttypes "github.com/cosmos/ibc-go/v6/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v6/modules/core/24-host" - ibckeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper" + transfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v7/modules/core" + ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" + ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" evmante "github.com/evmos/ethermint/app/ante" ethermintconfig "github.com/evmos/ethermint/server/config" "github.com/evmos/ethermint/x/evm" @@ -92,10 +100,6 @@ import ( feemarketkeeper "github.com/evmos/ethermint/x/feemarket/keeper" feemarkettypes "github.com/evmos/ethermint/x/feemarket/types" "github.com/gorilla/mux" - abci "github.com/tendermint/tendermint/abci/types" - tmjson "github.com/tendermint/tendermint/libs/json" - tmlog "github.com/tendermint/tendermint/libs/log" - dbm "github.com/tendermint/tm-db" "github.com/kava-labs/kava/app/ante" kavaparams "github.com/kava-labs/kava/app/params" @@ -169,7 +173,7 @@ var ( // ModuleBasics manages simple versions of full app modules. // It's used for things such as codec registration and genesis file verification. ModuleBasics = module.NewBasicManager( - genutil.AppModuleBasic{}, + genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), auth.AppModuleBasic{}, bank.AppModuleBasic{}, capability.AppModuleBasic{}, @@ -177,7 +181,6 @@ var ( distr.AppModuleBasic{}, gov.NewAppModuleBasic([]govclient.ProposalHandler{ paramsclient.ProposalHandler, - distrclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler, ibcclientclient.UpdateClientProposalHandler, @@ -193,6 +196,7 @@ var ( crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, ibc.AppModuleBasic{}, + ibctm.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, authzmodule.AppModuleBasic{}, @@ -219,6 +223,7 @@ var ( mint.AppModuleBasic{}, community.AppModuleBasic{}, metrics.AppModuleBasic{}, + consensus.AppModuleBasic{}, ) // module account permissions @@ -252,8 +257,7 @@ var ( // Verify app interface at compile time var ( - _ servertypes.Application = (*App)(nil) - _ servertypes.ApplicationQueryService = (*App)(nil) + _ servertypes.Application = (*App)(nil) ) // Options bundles several configuration params for an App. @@ -290,39 +294,40 @@ type App struct { memKeys map[string]*storetypes.MemoryStoreKey // keepers from all the modules - accountKeeper authkeeper.AccountKeeper - bankKeeper bankkeeper.Keeper - capabilityKeeper *capabilitykeeper.Keeper - stakingKeeper stakingkeeper.Keeper - distrKeeper distrkeeper.Keeper - govKeeper govkeeper.Keeper - paramsKeeper paramskeeper.Keeper - authzKeeper authzkeeper.Keeper - crisisKeeper crisiskeeper.Keeper - slashingKeeper slashingkeeper.Keeper - ibcKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly - evmKeeper *evmkeeper.Keeper - evmutilKeeper evmutilkeeper.Keeper - feeMarketKeeper feemarketkeeper.Keeper - upgradeKeeper upgradekeeper.Keeper - evidenceKeeper evidencekeeper.Keeper - transferKeeper ibctransferkeeper.Keeper - kavadistKeeper kavadistkeeper.Keeper - auctionKeeper auctionkeeper.Keeper - issuanceKeeper issuancekeeper.Keeper - bep3Keeper bep3keeper.Keeper - pricefeedKeeper pricefeedkeeper.Keeper - swapKeeper swapkeeper.Keeper - cdpKeeper cdpkeeper.Keeper - hardKeeper hardkeeper.Keeper - committeeKeeper committeekeeper.Keeper - incentiveKeeper incentivekeeper.Keeper - savingsKeeper savingskeeper.Keeper - liquidKeeper liquidkeeper.Keeper - earnKeeper earnkeeper.Keeper - routerKeeper routerkeeper.Keeper - mintKeeper mintkeeper.Keeper - communityKeeper communitykeeper.Keeper + accountKeeper authkeeper.AccountKeeper + bankKeeper bankkeeper.Keeper + capabilityKeeper *capabilitykeeper.Keeper + stakingKeeper *stakingkeeper.Keeper + distrKeeper distrkeeper.Keeper + govKeeper govkeeper.Keeper + paramsKeeper paramskeeper.Keeper + authzKeeper authzkeeper.Keeper + crisisKeeper crisiskeeper.Keeper + slashingKeeper slashingkeeper.Keeper + ibcKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly + evmKeeper *evmkeeper.Keeper + evmutilKeeper evmutilkeeper.Keeper + feeMarketKeeper feemarketkeeper.Keeper + upgradeKeeper upgradekeeper.Keeper + evidenceKeeper evidencekeeper.Keeper + transferKeeper ibctransferkeeper.Keeper + kavadistKeeper kavadistkeeper.Keeper + auctionKeeper auctionkeeper.Keeper + issuanceKeeper issuancekeeper.Keeper + bep3Keeper bep3keeper.Keeper + pricefeedKeeper pricefeedkeeper.Keeper + swapKeeper swapkeeper.Keeper + cdpKeeper cdpkeeper.Keeper + hardKeeper hardkeeper.Keeper + committeeKeeper committeekeeper.Keeper + incentiveKeeper incentivekeeper.Keeper + savingsKeeper savingskeeper.Keeper + liquidKeeper liquidkeeper.Keeper + earnKeeper earnkeeper.Keeper + routerKeeper routerkeeper.Keeper + mintKeeper mintkeeper.Keeper + communityKeeper communitykeeper.Keeper + consensusParamsKeeper consensusparamkeeper.Keeper // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper @@ -369,7 +374,7 @@ func NewApp( keys := sdk.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, + govtypes.StoreKey, paramstypes.StoreKey, ibcexported.StoreKey, upgradetypes.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, evmtypes.StoreKey, feemarkettypes.StoreKey, authzkeeper.StoreKey, capabilitytypes.StoreKey, kavadisttypes.StoreKey, auctiontypes.StoreKey, @@ -377,12 +382,14 @@ func NewApp( swaptypes.StoreKey, cdptypes.StoreKey, hardtypes.StoreKey, communitytypes.StoreKey, committeetypes.StoreKey, incentivetypes.StoreKey, evmutiltypes.StoreKey, savingstypes.StoreKey, earntypes.StoreKey, minttypes.StoreKey, + consensusparamtypes.StoreKey, crisistypes.StoreKey, ) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey) memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) // Authority for gov proposals, using the x/gov module account address - govAuthorityAddr := authtypes.NewModuleAddress(govtypes.ModuleName) + govAuthAddr := authtypes.NewModuleAddress(govtypes.ModuleName) + govAuthAddrStr := govAuthAddr.String() app := &App{ BaseApp: bApp, @@ -418,7 +425,7 @@ func NewApp( hardSubspace := app.paramsKeeper.Subspace(hardtypes.ModuleName) incentiveSubspace := app.paramsKeeper.Subspace(incentivetypes.ModuleName) savingsSubspace := app.paramsKeeper.Subspace(savingstypes.ModuleName) - ibcSubspace := app.paramsKeeper.Subspace(ibchost.ModuleName) + ibcSubspace := app.paramsKeeper.Subspace(ibcexported.ModuleName) ibctransferSubspace := app.paramsKeeper.Subspace(ibctransfertypes.ModuleName) feemarketSubspace := app.paramsKeeper.Subspace(feemarkettypes.ModuleName) evmSubspace := app.paramsKeeper.Subspace(evmtypes.ModuleName) @@ -426,11 +433,12 @@ func NewApp( earnSubspace := app.paramsKeeper.Subspace(earntypes.ModuleName) mintSubspace := app.paramsKeeper.Subspace(minttypes.ModuleName) - bApp.SetParamStore( - app.paramsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()), - ) + // set the BaseApp's parameter store + app.consensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[consensusparamtypes.StoreKey], govAuthAddrStr) + bApp.SetParamStore(&app.consensusParamsKeeper) + app.capabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) - scopedIBCKeeper := app.capabilityKeeper.ScopeToModule(ibchost.ModuleName) + scopedIBCKeeper := app.capabilityKeeper.ScopeToModule(ibcexported.ModuleName) scopedTransferKeeper := app.capabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) app.capabilityKeeper.Seal() @@ -438,24 +446,24 @@ func NewApp( app.accountKeeper = authkeeper.NewAccountKeeper( appCodec, keys[authtypes.StoreKey], - authSubspace, authtypes.ProtoBaseAccount, mAccPerms, sdk.GetConfig().GetBech32AccountAddrPrefix(), + govAuthAddrStr, ) app.bankKeeper = bankkeeper.NewBaseKeeper( appCodec, keys[banktypes.StoreKey], app.accountKeeper, - bankSubspace, app.loadBlockedMaccAddrs(), + govAuthAddrStr, ) app.stakingKeeper = stakingkeeper.NewKeeper( appCodec, keys[stakingtypes.StoreKey], app.accountKeeper, app.bankKeeper, - stakingSubspace, + govAuthAddrStr, ) app.authzKeeper = authzkeeper.NewKeeper( keys[authzkeeper.StoreKey], @@ -466,42 +474,45 @@ func NewApp( app.distrKeeper = distrkeeper.NewKeeper( appCodec, keys[distrtypes.StoreKey], - distrSubspace, app.accountKeeper, app.bankKeeper, - &app.stakingKeeper, + app.stakingKeeper, authtypes.FeeCollectorName, + govAuthAddrStr, ) app.slashingKeeper = slashingkeeper.NewKeeper( appCodec, + app.legacyAmino, keys[slashingtypes.StoreKey], - &app.stakingKeeper, - slashingSubspace, + app.stakingKeeper, + govAuthAddrStr, ) - app.crisisKeeper = crisiskeeper.NewKeeper( - crisisSubspace, + app.crisisKeeper = *crisiskeeper.NewKeeper( + appCodec, + keys[crisistypes.StoreKey], options.InvariantCheckPeriod, app.bankKeeper, authtypes.FeeCollectorName, + govAuthAddrStr, ) - app.upgradeKeeper = upgradekeeper.NewKeeper( + app.upgradeKeeper = *upgradekeeper.NewKeeper( options.SkipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp, - govAuthorityAddr.String(), + govAuthAddrStr, ) app.evidenceKeeper = *evidencekeeper.NewKeeper( appCodec, keys[evidencetypes.StoreKey], - &app.stakingKeeper, + app.stakingKeeper, app.slashingKeeper, ) app.ibcKeeper = ibckeeper.NewKeeper( appCodec, - keys[ibchost.StoreKey], + keys[ibcexported.StoreKey], ibcSubspace, app.stakingKeeper, app.upgradeKeeper, @@ -511,7 +522,7 @@ func NewApp( // Create Ethermint keepers app.feeMarketKeeper = feemarketkeeper.NewKeeper( appCodec, - govAuthorityAddr, + govAuthAddr, keys[feemarkettypes.StoreKey], tkeys[feemarkettypes.TransientKey], feemarketSubspace, @@ -528,7 +539,7 @@ func NewApp( evmBankKeeper := evmutilkeeper.NewEvmBankKeeper(app.evmutilKeeper, app.bankKeeper, app.accountKeeper) app.evmKeeper = evmkeeper.NewKeeper( appCodec, keys[evmtypes.StoreKey], tkeys[evmtypes.TransientKey], - govAuthorityAddr, + govAuthAddr, app.accountKeeper, evmBankKeeper, app.stakingKeeper, app.feeMarketKeeper, nil, // precompiled contracts geth.NewEVM, @@ -614,7 +625,7 @@ func NewApp( appCodec, app.accountKeeper, app.bankKeeper, - &app.stakingKeeper, + app.stakingKeeper, &app.distrKeeper, ) savingsKeeper := savingskeeper.NewKeeper( @@ -650,11 +661,11 @@ func NewApp( app.mintKeeper = mintkeeper.NewKeeper( appCodec, keys[minttypes.StoreKey], - mintSubspace, app.stakingKeeper, app.accountKeeper, app.bankKeeper, authtypes.FeeCollectorName, + govAuthAddrStr, ) // x/community's deposit/withdraw to lend proposals depend on hard keeper. @@ -669,7 +680,7 @@ func NewApp( &app.mintKeeper, &app.kavadistKeeper, app.stakingKeeper, - govAuthorityAddr, + govAuthAddr, ) app.incentiveKeeper = incentivekeeper.NewKeeper( @@ -692,7 +703,7 @@ func NewApp( app.routerKeeper = routerkeeper.NewKeeper( &app.earnKeeper, app.liquidKeeper, - &app.stakingKeeper, + app.stakingKeeper, ) // create committee keeper with router @@ -701,8 +712,7 @@ func NewApp( AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). AddRoute(communitytypes.RouterKey, community.NewCommunityPoolProposalHandler(app.communityKeeper)). AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.paramsKeeper)). - AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.distrKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.upgradeKeeper)) + AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(&app.upgradeKeeper)) // Note: the committee proposal handler is not registered on the committee router. This means committees cannot create or update other committees. // Adding the committee proposal handler to the router is possible but awkward as the handler depends on the keeper which depends on the handler. app.committeeKeeper = committeekeeper.NewKeeper( @@ -715,13 +725,12 @@ func NewApp( ) // register the staking hooks - // NOTE: These keepers are passed by reference above, so they will contain these hooks. - app.stakingKeeper = *(app.stakingKeeper.SetHooks( + app.stakingKeeper.SetHooks( stakingtypes.NewMultiStakingHooks( app.distrKeeper.Hooks(), app.slashingKeeper.Hooks(), app.incentiveKeeper.Hooks(), - ))) + )) app.swapKeeper = *swapKeeper.SetHooks(app.incentiveKeeper.Hooks()) app.cdpKeeper = *cdpKeeper.SetHooks(cdptypes.NewMultiCDPHooks(app.incentiveKeeper.Hooks())) @@ -735,30 +744,30 @@ func NewApp( govRouter. AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.paramsKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.upgradeKeeper)). + AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(&app.upgradeKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.ibcKeeper.ClientKeeper)). - AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.distrKeeper)). AddRoute(kavadisttypes.RouterKey, kavadist.NewCommunityPoolMultiSpendProposalHandler(app.kavadistKeeper)). AddRoute(earntypes.RouterKey, earn.NewCommunityPoolProposalHandler(app.earnKeeper)). AddRoute(communitytypes.RouterKey, community.NewCommunityPoolProposalHandler(app.communityKeeper)). AddRoute(committeetypes.RouterKey, committee.NewProposalHandler(app.committeeKeeper)) govConfig := govtypes.DefaultConfig() - app.govKeeper = govkeeper.NewKeeper( + govKeeper := govkeeper.NewKeeper( appCodec, keys[govtypes.StoreKey], - govSubspace, app.accountKeeper, app.bankKeeper, - &app.stakingKeeper, - govRouter, + app.stakingKeeper, app.MsgServiceRouter(), govConfig, + govAuthAddrStr, ) + govKeeper.SetLegacyRouter(govRouter) + app.govKeeper = *govKeeper // override x/gov tally handler with custom implementation tallyHandler := NewTallyHandler( - app.govKeeper, app.stakingKeeper, app.savingsKeeper, app.earnKeeper, + app.govKeeper, *app.stakingKeeper, app.savingsKeeper, app.earnKeeper, app.liquidKeeper, app.bankKeeper, ) app.govKeeper.SetTallyHandler(tallyHandler) @@ -767,19 +776,20 @@ func NewApp( // must be passed by reference here.) app.mm = module.NewManager( genutil.NewAppModule(app.accountKeeper, app.stakingKeeper, app.BaseApp.DeliverTx, encodingConfig.TxConfig), - auth.NewAppModule(appCodec, app.accountKeeper, nil), - bank.NewAppModule(appCodec, app.bankKeeper, app.accountKeeper), - capability.NewAppModule(appCodec, *app.capabilityKeeper), - staking.NewAppModule(appCodec, app.stakingKeeper, app.accountKeeper, app.bankKeeper), - distr.NewAppModule(appCodec, app.distrKeeper, app.accountKeeper, app.bankKeeper, app.stakingKeeper), - gov.NewAppModule(appCodec, app.govKeeper, app.accountKeeper, app.bankKeeper), + auth.NewAppModule(appCodec, app.accountKeeper, authsims.RandomGenesisAccounts, authSubspace), + bank.NewAppModule(appCodec, app.bankKeeper, app.accountKeeper, bankSubspace), + capability.NewAppModule(appCodec, *app.capabilityKeeper, false), // todo: confirm if this is okay to not be sealed + staking.NewAppModule(appCodec, app.stakingKeeper, app.accountKeeper, app.bankKeeper, stakingSubspace), + distr.NewAppModule(appCodec, app.distrKeeper, app.accountKeeper, app.bankKeeper, app.stakingKeeper, distrSubspace), + gov.NewAppModule(appCodec, &app.govKeeper, app.accountKeeper, app.bankKeeper, govSubspace), params.NewAppModule(app.paramsKeeper), - crisis.NewAppModule(&app.crisisKeeper, options.SkipGenesisInvariants), - slashing.NewAppModule(appCodec, app.slashingKeeper, app.accountKeeper, app.bankKeeper, app.stakingKeeper), + crisis.NewAppModule(&app.crisisKeeper, options.SkipGenesisInvariants, crisisSubspace), + slashing.NewAppModule(appCodec, app.slashingKeeper, app.accountKeeper, app.bankKeeper, app.stakingKeeper, slashingSubspace), + consensus.NewAppModule(appCodec, app.consensusParamsKeeper), ibc.NewAppModule(app.ibcKeeper), evm.NewAppModule(app.evmKeeper, app.accountKeeper), feemarket.NewAppModule(app.feeMarketKeeper, feemarketSubspace), - upgrade.NewAppModule(app.upgradeKeeper), + upgrade.NewAppModule(&app.upgradeKeeper), evidence.NewAppModule(app.evidenceKeeper), transferModule, vesting.NewAppModule(app.accountKeeper, app.bankKeeper), @@ -801,7 +811,7 @@ func NewApp( earn.NewAppModule(app.earnKeeper, app.accountKeeper, app.bankKeeper), router.NewAppModule(app.routerKeeper), // nil InflationCalculationFn, use SDK's default inflation function - mint.NewAppModule(appCodec, app.mintKeeper, app.accountKeeper, nil), + mint.NewAppModule(appCodec, app.mintKeeper, app.accountKeeper, nil, mintSubspace), community.NewAppModule(app.communityKeeper, app.accountKeeper), metrics.NewAppModule(options.TelemetryOptions), ) @@ -838,7 +848,7 @@ func NewApp( hardtypes.ModuleName, issuancetypes.ModuleName, incentivetypes.ModuleName, - ibchost.ModuleName, + ibcexported.ModuleName, // Add all remaining modules with an empty begin blocker below since cosmos 0.45.0 requires it swaptypes.ModuleName, vestingtypes.ModuleName, @@ -857,6 +867,7 @@ func NewApp( liquidtypes.ModuleName, earntypes.ModuleName, routertypes.ModuleName, + consensusparamtypes.ModuleName, ) // Warning: Some end blockers must run before others. Ensure the dependencies are understood before modifying this list. @@ -884,7 +895,7 @@ func NewApp( kavadisttypes.ModuleName, swaptypes.ModuleName, vestingtypes.ModuleName, - ibchost.ModuleName, + ibcexported.ModuleName, validatorvestingtypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, @@ -900,6 +911,7 @@ func NewApp( minttypes.ModuleName, communitytypes.ModuleName, metricstypes.ModuleName, + consensusparamtypes.ModuleName, ) // Warning: Some init genesis methods must run before others. Ensure the dependencies are understood before modifying this list @@ -912,7 +924,7 @@ func NewApp( slashingtypes.ModuleName, // iterates over validators, run after staking govtypes.ModuleName, minttypes.ModuleName, - ibchost.ModuleName, + ibcexported.ModuleName, evidencetypes.ModuleName, authz.ModuleName, ibctransfertypes.ModuleName, @@ -933,7 +945,6 @@ func NewApp( earntypes.ModuleName, communitytypes.ModuleName, genutiltypes.ModuleName, // runs arbitrary txs included in genisis state, so run after modules have been initialized - crisistypes.ModuleName, // runs the invariants at genesis, should run after other modules // Add all remaining modules with an empty InitGenesis below since cosmos 0.45.0 requires it vestingtypes.ModuleName, paramstypes.ModuleName, @@ -942,10 +953,11 @@ func NewApp( liquidtypes.ModuleName, routertypes.ModuleName, metricstypes.ModuleName, + consensusparamtypes.ModuleName, + crisistypes.ModuleName, // runs the invariants at genesis, should run after other modules ) app.mm.RegisterInvariants(&app.crisisKeeper) - app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) app.RegisterServices(app.configurator) diff --git a/app/app_test.go b/app/app_test.go index f5e447d0..e5d32cfe 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -8,17 +8,19 @@ import ( "testing" "time" + db "github.com/cometbft/cometbft-db" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" evmtypes "github.com/evmos/ethermint/x/evm/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tmtypes "github.com/tendermint/tendermint/types" - db "github.com/tendermint/tm-db" ) func TestNewApp(t *testing.T) { @@ -36,7 +38,7 @@ func TestNewApp(t *testing.T) { func TestExport(t *testing.T) { SetSDKConfig() db := db.NewMemDB() - app := NewApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, DefaultNodeHome, nil, MakeEncodingConfig(), DefaultOptions) + app := NewApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, DefaultNodeHome, nil, MakeEncodingConfig(), DefaultOptions, baseapp.SetChainID(TestChainId)) genesisState := GenesisStateWithSingleValidator(&TestApp{App: *app}, NewDefaultGenesisState()) @@ -45,21 +47,23 @@ func TestExport(t *testing.T) { initRequest := abci.RequestInitChain{ Time: time.Date(1998, 1, 1, 0, 0, 0, 0, time.UTC), - ChainId: "kavatest_1-1", + ChainId: TestChainId, InitialHeight: 1, - ConsensusParams: tmtypes.TM2PB.ConsensusParams(tmtypes.DefaultConsensusParams()), + ConsensusParams: sims.DefaultConsensusParams, Validators: nil, AppStateBytes: stateBytes, } app.InitChain(initRequest) app.Commit() - exportedApp, err := app.ExportAppStateAndValidators(false, []string{}) + exportedApp, err := app.ExportAppStateAndValidators(false, []string{}, []string{}) require.NoError(t, err) // Assume each module is exported correctly, so only check modules in genesis are present in export initialModules, err := unmarshalJSONKeys(initRequest.AppStateBytes) require.NoError(t, err) + // note ibctm is only registered in the BasicManager and not module manager so can be ignored + initialModules = removeIbcTmModule(initialModules) exportedModules, err := unmarshalJSONKeys(exportedApp.AppState) require.NoError(t, err) assert.ElementsMatch(t, initialModules, exportedModules) @@ -143,3 +147,13 @@ func unmarshalJSONKeys(jsonBytes []byte) ([]string, error) { return keys, nil } + +func removeIbcTmModule(modules []string) []string { + var result []string + for _, str := range modules { + if str != ibctm.ModuleName { + result = append(result, str) + } + } + return result +} diff --git a/app/export.go b/app/export.go index 6c72866f..b90f0ce5 100644 --- a/app/export.go +++ b/app/export.go @@ -4,7 +4,7 @@ import ( "encoding/json" "log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -14,7 +14,7 @@ import ( ) // ExportAppStateAndValidators export the state of the app for a genesis file -func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailWhiteList []string, +func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailWhiteList []string, modulesToExport []string, ) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block // block time is not available and defaults to Jan 1st, 0001 @@ -26,7 +26,7 @@ func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailWhiteList [] app.prepForZeroHeightGenesis(ctx, jailWhiteList) } - genState := app.mm.ExportGenesis(ctx, app.appCodec) + genState := app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) newAppState, err := json.MarshalIndent(genState, "", " ") if err != nil { return servertypes.ExportedApp{}, err diff --git a/app/tally_handler.go b/app/tally_handler.go index 008bfb20..5a341c7e 100644 --- a/app/tally_handler.go +++ b/app/tally_handler.go @@ -154,7 +154,7 @@ func (th TallyHandler) Tally( totalVotingPower = totalVotingPower.Add(votingPower) } - tallyParams := th.gk.GetTallyParams(ctx) + tallyParams := th.gk.GetParams(ctx) tallyResults = govv1.NewTallyResultFromMap(results) // TODO: Upgrade the spec to cover all of these cases & remove pseudocode. @@ -166,7 +166,7 @@ func (th TallyHandler) Tally( // If there is not enough quorum of votes, the proposal fails percentVoting := totalVotingPower.Quo(sdk.NewDecFromInt(th.stk.TotalBondedTokens(ctx))) if percentVoting.LT(sdk.MustNewDecFromStr(tallyParams.Quorum)) { - return false, true, tallyResults + return false, tallyParams.BurnVoteQuorum, tallyResults } // If no one votes (everyone abstains), proposal fails @@ -176,7 +176,7 @@ func (th TallyHandler) Tally( // If more than 1/3 of voters veto, proposal fails if results[govv1.OptionNoWithVeto].Quo(totalVotingPower).GT(sdk.MustNewDecFromStr(tallyParams.VetoThreshold)) { - return false, true, tallyResults + return false, tallyParams.BurnVoteVeto, tallyResults } // If more than 1/2 of non-abstaining voters vote Yes, proposal passes diff --git a/app/tally_handler_test.go b/app/tally_handler_test.go index 7d3d0a1b..42344562 100644 --- a/app/tally_handler_test.go +++ b/app/tally_handler_test.go @@ -5,6 +5,7 @@ import ( "time" sdkmath "cosmossdk.io/math" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -15,7 +16,6 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" earntypes "github.com/kava-labs/kava/x/earn/types" liquidtypes "github.com/kava-labs/kava/x/liquid/types" @@ -44,12 +44,13 @@ func (suite *tallyHandlerSuite) SetupTest() { genesisTime := time.Date(1998, 1, 1, 0, 0, 0, 0, time.UTC) suite.ctx = suite.app.NewContext(false, tmproto.Header{Height: 1, Time: genesisTime}) - suite.staking = stakingHelper{suite.app.GetStakingKeeper()} + stakingKeeper := *suite.app.GetStakingKeeper() + suite.staking = stakingHelper{stakingKeeper} suite.staking.setBondDenom(suite.ctx, "ukava") suite.tallier = NewTallyHandler( suite.app.GetGovKeeper(), - suite.app.GetStakingKeeper(), + stakingKeeper, suite.app.GetSavingsKeeper(), suite.app.GetEarnKeeper(), suite.app.GetLiquidKeeper(), @@ -215,11 +216,12 @@ func (suite *tallyHandlerSuite) TestTallyOutcomes() { } func (suite *tallyHandlerSuite) setTallyParams(quorum, threshold, veto sdk.Dec) { - suite.app.GetGovKeeper().SetTallyParams(suite.ctx, govv1.TallyParams{ - Quorum: quorum.String(), - Threshold: threshold.String(), - VetoThreshold: veto.String(), - }) + params := suite.app.GetGovKeeper().GetParams(suite.ctx) + params.Quorum = quorum.String() + params.Threshold = threshold.String() + params.VetoThreshold = veto.String() + params.BurnVoteQuorum = true + suite.app.GetGovKeeper().SetParams(suite.ctx, params) } func (suite *tallyHandlerSuite) voteOnProposal( @@ -240,7 +242,7 @@ func (suite *tallyHandlerSuite) voteOnProposal( func (suite *tallyHandlerSuite) createProposal() govv1.Proposal { gk := suite.app.GetGovKeeper() - deposit := gk.GetDepositParams(suite.ctx).MinDeposit + deposit := gk.GetParams(suite.ctx).MinDeposit proposer := suite.createAccount(deposit...) msg, err := govv1beta1.NewMsgSubmitProposal( @@ -250,7 +252,7 @@ func (suite *tallyHandlerSuite) createProposal() govv1.Proposal { ) suite.Require().NoError(err) - msgServerv1 := govkeeper.NewMsgServerImpl(gk) + msgServerv1 := govkeeper.NewMsgServerImpl(&gk) govAcct := gk.GetGovernanceAccount(suite.ctx).GetAddress() msgServer := govkeeper.NewLegacyMsgServerImpl(govAcct.String(), msgServerv1) @@ -369,7 +371,7 @@ func (h stakingHelper) createUnbondedValidator(ctx sdk.Context, address sdk.ValA return nil, err } - msgServer := stakingkeeper.NewMsgServerImpl(h.keeper) + msgServer := stakingkeeper.NewMsgServerImpl(&h.keeper) _, err = msgServer.CreateValidator(sdk.WrapSDKContext(ctx), msg) if err != nil { return nil, err @@ -389,7 +391,7 @@ func (h stakingHelper) delegate(ctx sdk.Context, delegator sdk.AccAddress, valid h.newBondCoin(ctx, amount), ) - msgServer := stakingkeeper.NewMsgServerImpl(h.keeper) + msgServer := stakingkeeper.NewMsgServerImpl(&h.keeper) _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), msg) if err != nil { return sdk.Dec{}, err diff --git a/app/test_common.go b/app/test_common.go index 8c36545b..725a245c 100644 --- a/app/test_common.go +++ b/app/test_common.go @@ -9,6 +9,11 @@ import ( "time" sdkmath "cosmossdk.io/math" + tmdb "github.com/cometbft/cometbft-db" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/libs/log" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -35,11 +40,6 @@ import ( evmkeeper "github.com/evmos/ethermint/x/evm/keeper" feemarketkeeper "github.com/evmos/ethermint/x/feemarket/keeper" "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtypes "github.com/tendermint/tendermint/types" - tmdb "github.com/tendermint/tm-db" auctionkeeper "github.com/kava-labs/kava/x/auction/keeper" bep3keeper "github.com/kava-labs/kava/x/bep3/keeper" @@ -61,10 +61,11 @@ import ( var ( emptyTime time.Time - testChainID = "kavatest_1-1" defaultInitialHeight int64 = 1 ) +const TestChainId = "kavatest_2221-1" + // TestApp is a simple wrapper around an App. It exposes internal keepers for use in integration tests. // This file also contains test helpers. Ideally they would be in separate package. // Basic Usage: @@ -99,7 +100,10 @@ func NewTestAppFromSealed() TestApp { encCfg := MakeEncodingConfig() - app := NewApp(log.NewNopLogger(), db, DefaultNodeHome, nil, encCfg, DefaultOptions) + app := NewApp( + log.NewNopLogger(), db, DefaultNodeHome, nil, + encCfg, DefaultOptions, baseapp.SetChainID(TestChainId), + ) return TestApp{App: *app} } @@ -107,7 +111,7 @@ func NewTestAppFromSealed() TestApp { func (tApp TestApp) GetAccountKeeper() authkeeper.AccountKeeper { return tApp.accountKeeper } func (tApp TestApp) GetBankKeeper() bankkeeper.Keeper { return tApp.bankKeeper } func (tApp TestApp) GetMintKeeper() mintkeeper.Keeper { return tApp.mintKeeper } -func (tApp TestApp) GetStakingKeeper() stakingkeeper.Keeper { return tApp.stakingKeeper } +func (tApp TestApp) GetStakingKeeper() *stakingkeeper.Keeper { return tApp.stakingKeeper } func (tApp TestApp) GetSlashingKeeper() slashingkeeper.Keeper { return tApp.slashingKeeper } func (tApp TestApp) GetDistrKeeper() distkeeper.Keeper { return tApp.distrKeeper } func (tApp TestApp) GetGovKeeper() govkeeper.Keeper { return tApp.govKeeper } @@ -267,6 +271,7 @@ func genesisStateWithValSet( balances, totalSupply, currentBankGenesis.DenomMetadata, + currentBankGenesis.SendEnabled, ) // set genesis state @@ -280,13 +285,13 @@ func genesisStateWithValSet( // InitializeFromGenesisStates calls InitChain on the app using the provided genesis states. // If any module genesis states are missing, defaults are used. func (tApp TestApp) InitializeFromGenesisStates(genesisStates ...GenesisState) TestApp { - return tApp.InitializeFromGenesisStatesWithTimeAndChainIDAndHeight(emptyTime, testChainID, defaultInitialHeight, true, genesisStates...) + return tApp.InitializeFromGenesisStatesWithTimeAndChainIDAndHeight(emptyTime, TestChainId, defaultInitialHeight, true, genesisStates...) } // InitializeFromGenesisStatesWithTime calls InitChain on the app using the provided genesis states and time. // If any module genesis states are missing, defaults are used. func (tApp TestApp) InitializeFromGenesisStatesWithTime(genTime time.Time, genesisStates ...GenesisState) TestApp { - return tApp.InitializeFromGenesisStatesWithTimeAndChainIDAndHeight(genTime, testChainID, defaultInitialHeight, true, genesisStates...) + return tApp.InitializeFromGenesisStatesWithTimeAndChainIDAndHeight(genTime, TestChainId, defaultInitialHeight, true, genesisStates...) } // InitializeFromGenesisStatesWithTimeAndChainID calls InitChain on the app using the provided genesis states, time, and chain id. @@ -343,8 +348,8 @@ func (tApp TestApp) InitializeFromGenesisStatesWithTimeAndChainIDAndHeight( AppStateBytes: stateBytes, ChainId: chainID, // Set consensus params, which is needed by x/feemarket - ConsensusParams: &abci.ConsensusParams{ - Block: &abci.BlockParams{ + ConsensusParams: &tmproto.ConsensusParams{ + Block: &tmproto.BlockParams{ MaxBytes: 200000, MaxGas: 20000000, }, diff --git a/build/deps.mk b/build/deps.mk index df026753..f950edd5 100644 --- a/build/deps.mk +++ b/build/deps.mk @@ -28,9 +28,9 @@ DIRS := $(BUILD_CACHE_DIR) $(BIN_DIR) ### Tool Versions ### ################################################################################ GO_BIN ?= go -PROTOC_VERSION ?= v21.9 -BUF_VERSION ?= v1.9.0 -PROTOC_GEN_GOCOSMOS_VERSION ?= v0.3.1 +PROTOC_VERSION ?= v25.1 +BUF_VERSION ?= v1.28.1 +PROTOC_GEN_GOCOSMOS_VERSION ?= $(shell $(GO_BIN) list -m -f '{{.Version}}' github.com/cosmos/gogoproto) PROTOC_GEN_GRPC_GATEWAY_VERSION ?= $(shell $(GO_BIN) list -m github.com/grpc-ecosystem/grpc-gateway| sed 's:.* ::') PROTOC_GEN_DOC_VERSION ?= v1.5.1 SWAGGER_COMBINE_VERSION ?= v1.4.0 @@ -68,7 +68,7 @@ $(PROTOC_VERSION_FILE): mkdir -p protoc && cd protoc; \ curl -sOL $(PROTOC_DOWNLOAD_URL); \ unzip -q $(PROTOC_ARCHIVE_NAME) bin/protoc - @cp $(BUILD_CACHE_DIR)/protoc/bin/protoc $(BIN_DIR)/protoc + @cp -f $(BUILD_CACHE_DIR)/protoc/bin/protoc $(BIN_DIR)/protoc @rm -rf $(BUILD_CACHE_DIR)/protoc PROTOC := $(BIN_DIR)/protoc @@ -93,7 +93,7 @@ $(BUF_VERSION_FILE): mkdir -p buf && cd buf; \ curl -sOL $(BUF_DOWNLOAD_URL); \ tar -xzf $(BUF_ARCHIVE_NAME) buf/bin/buf - @cp $(BUILD_CACHE_DIR)/buf/buf/bin/buf $(BIN_DIR)/buf + @cp -f $(BUILD_CACHE_DIR)/buf/buf/bin/buf $(BIN_DIR)/buf @rm -rf $(BUILD_CACHE_DIR)/buf BUF := $(BIN_DIR)/buf @@ -113,8 +113,8 @@ $(PROTOC_GEN_GOCOSMOS_VERSION_FILE): @touch $(PROTOC_GEN_GOCOSMOS_VERSION_FILE) @cd $(BUILD_CACHE_DIR); \ mkdir -p protoc-gen-gocosmos && cd protoc-gen-gocosmos; \ - git clone -q https://github.com/regen-network/cosmos-proto.git; \ - cd cosmos-proto; \ + git clone -q https://github.com/cosmos/gogoproto.git; \ + cd gogoproto; \ git checkout -q $(PROTOC_GEN_GOCOSMOS_VERSION); \ GOBIN=$(ROOT_DIR)/$(BIN_DIR) $(GO_BIN) install ./protoc-gen-gocosmos @rm -rf $(BUILD_CACHE_DIR)/protoc-gen-gocosmos @@ -185,7 +185,7 @@ $(PROTOC_GEN_DOC_VERSION_FILE): mkdir -p protoc-gen-doc && cd protoc-gen-doc; \ curl -sOL $(PROTOC_GEN_DOC_DOWNLOAD_URL); \ tar -xzf $(PROTOC_GEN_DOC_ARCHIVE_NAME) protoc-gen-doc - @cp $(BUILD_CACHE_DIR)/protoc-gen-doc/protoc-gen-doc $(BIN_DIR)/protoc-gen-doc + @cp -f $(BUILD_CACHE_DIR)/protoc-gen-doc/protoc-gen-doc $(BIN_DIR)/protoc-gen-doc @rm -rf $(BUILD_CACHE_DIR)/protoc-gen-doc PROTOC_GEN_DOC := $(BIN_DIR)/protoc-gen-doc diff --git a/build/proto-deps.mk b/build/proto-deps.mk index af040e4f..1a78f605 100644 --- a/build/proto-deps.mk +++ b/build/proto-deps.mk @@ -14,13 +14,23 @@ PROTOBUF_ANY_DOWNLOAD_URL = https://raw.githubusercontent.com/protocolbuffers/pr # # Proto dependencies under go.mod # -GOGO_PATH := $(shell $(GO_BIN) list -m -f '{{.Dir}}' github.com/gogo/protobuf) -TENDERMINT_PATH := $(shell $(GO_BIN) list -m -f '{{.Dir}}' github.com/tendermint/tendermint) +GOGO_PATH := $(shell $(GO_BIN) list -m -f '{{.Dir}}' github.com/cosmos/gogoproto) +TENDERMINT_PATH := $(shell $(GO_BIN) list -m -f '{{.Dir}}' github.com/cometbft/cometbft) COSMOS_PROTO_PATH := $(shell $(GO_BIN) list -m -f '{{.Dir}}' github.com/cosmos/cosmos-proto) COSMOS_SDK_PATH := $(shell $(GO_BIN) list -m -f '{{.Dir}}' github.com/cosmos/cosmos-sdk) -IBC_GO_PATH := $(shell $(GO_BIN) list -m -f '{{.Dir}}' github.com/cosmos/ibc-go/v6) +IBC_GO_PATH := $(shell $(GO_BIN) list -m -f '{{.Dir}}' github.com/cosmos/ibc-go/v7) ETHERMINT_PATH := $(shell $(GO_BIN) list -m -f '{{.Dir}}' github.com/evmos/ethermint) +# +# ICS23 Proof Proto +# +ICS23_VERSION := $(shell $(GO_BIN) list -m -f '{{.Version}}' github.com/cosmos/ics23/go) + +ICS23_PROOFS_PROTO_PATH := cosmos/ics23/v1/proofs.proto +ICS23_PROOFS_PROTO_LOCAL_PATH := third_party/proto/$(ICS23_PROOFS_PROTO_PATH) + +ICS23_PROOFS_PROTO_DOWNLOAD_URL := https://raw.githubusercontent.com/cosmos/ics23/go/$(ICS23_VERSION)/proto/$(ICS23_PROOFS_PROTO_PATH) + # # Common target directories # @@ -44,18 +54,20 @@ proto-update-deps: check-rsync ## Update all third party proto files @curl -sSL $(PROTOBUF_ANY_DOWNLOAD_URL)/any.proto > $(PROTOBUF_GOOGLE_TYPES)/any.proto @mkdir -p client/docs - @cp $(COSMOS_SDK_PATH)/client/docs/swagger-ui/swagger.yaml client/docs/cosmos-swagger.yml - @cp $(IBC_GO_PATH)/docs/client/swagger-ui/swagger.yaml client/docs/ibc-go-swagger.yml + @cp -f $(COSMOS_SDK_PATH)/client/docs/swagger-ui/swagger.yaml client/docs/cosmos-swagger.yml + @cp -f $(IBC_GO_PATH)/docs/client/swagger-ui/swagger.yaml client/docs/ibc-go-swagger.yml @mkdir -p $(COSMOS_PROTO_TYPES) - @cp $(COSMOS_PROTO_PATH)/proto/cosmos_proto/cosmos.proto $(COSMOS_PROTO_TYPES)/cosmos.proto + @cp -f $(COSMOS_PROTO_PATH)/proto/cosmos_proto/cosmos.proto $(COSMOS_PROTO_TYPES)/cosmos.proto + + @mkdir -p $(dir $(ICS23_PROOFS_PROTO_LOCAL_PATH)) + @curl -sSL $(ICS23_PROOFS_PROTO_DOWNLOAD_URL) > $(ICS23_PROOFS_PROTO_LOCAL_PATH) @$(RSYNC_BIN) -r --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r --include "*.proto" --include='*/' --exclude='*' $(GOGO_PATH)/gogoproto third_party/proto @$(RSYNC_BIN) -r --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r --include "*.proto" --include='*/' --exclude='*' $(TENDERMINT_PATH)/proto third_party @$(RSYNC_BIN) -r --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r --include "*.proto" --include='*/' --exclude='*' $(COSMOS_SDK_PATH)/proto third_party @$(RSYNC_BIN) -r --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r --include "*.proto" --include='*/' --exclude='*' $(IBC_GO_PATH)/proto third_party @$(RSYNC_BIN) -r --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r --include "*.proto" --include='*/' --exclude='*' $(ETHERMINT_PATH)/proto third_party - @cp -f $(IBC_GO_PATH)/third_party/proto/proofs.proto third_party/proto/proofs.proto .PHONY: check-proto-deps check-proto-deps: proto-update-deps ## Return error code 1 if proto dependencies are not changed diff --git a/build/proto.mk b/build/proto.mk index 6a555a93..8a9a924c 100644 --- a/build/proto.mk +++ b/build/proto.mk @@ -1,7 +1,7 @@ .PHONY: proto-lint check-proto-lint proto-lint check-proto-lint: install-build-deps @echo "Linting proto file" - @$(BUF) lint + @$(BUF) lint proto .PHONY: proto-gen proto-gen: install-build-deps diff --git a/ci/env/kava-protonet/genesis.json b/ci/env/kava-protonet/genesis.json index 8e3e0ead..2454e3fe 100644 --- a/ci/env/kava-protonet/genesis.json +++ b/ci/env/kava-protonet/genesis.json @@ -2178,6 +2178,23 @@ "quorum": "0.334000000000000000", "threshold": "0.500000000000000000", "veto_threshold": "0.334000000000000000" + }, + "params": { + "min_deposit": [ + { + "denom": "ukava", + "amount": "10000000" + } + ], + "max_deposit_period": "172800s", + "voting_period": "600s", + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000", + "min_initial_deposit_ratio": "0.000000000000000000", + "burn_vote_quorum": false, + "burn_proposal_deposit_prevote": false, + "burn_vote_veto": true } }, "hard": { diff --git a/cli_test/cli_test.go b/cli_test/cli_test.go index b9f9d68b..8d16f50c 100644 --- a/cli_test/cli_test.go +++ b/cli_test/cli_test.go @@ -14,9 +14,9 @@ import ( "strings" "testing" + "github.com/cometbft/cometbft/crypto/ed25519" + tmtypes "github.com/cometbft/cometbft/types" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/crypto/ed25519" - tmtypes "github.com/tendermint/tendermint/types" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/tests" @@ -813,7 +813,7 @@ func TestKvCLISubmitCommunityPoolSpendProposal(t *testing.T) { } func TestKvCLIQueryTxPagination(t *testing.T) { - // Skip until https://github.com/tendermint/tendermint/issues/4432 has been + // Skip until https://github.com/cometbft/cometbft/issues/4432 has been // resolved and included in a release. t.SkipNow() diff --git a/cli_test/test_helpers.go b/cli_test/test_helpers.go index 3475c180..161217f6 100644 --- a/cli_test/test_helpers.go +++ b/cli_test/test_helpers.go @@ -13,13 +13,13 @@ import ( "github.com/stretchr/testify/require" - tmtypes "github.com/tendermint/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" + "cosmossdk.io/simapp" clientkeys "github.com/cosmos/cosmos-sdk/client/keys" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keys" "github.com/cosmos/cosmos-sdk/server" - "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/tests" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" diff --git a/client/docs/cosmos-swagger.yml b/client/docs/cosmos-swagger.yml index 1fa424c0..797069ec 100644 --- a/client/docs/cosmos-swagger.yml +++ b/client/docs/cosmos-swagger.yml @@ -4,10 +4,420 @@ info: description: A REST interface for state queries version: 1.0.0 paths: + /cosmos/auth/v1beta1/account_info/{address}: + get: + summary: AccountInfo queries account info which is common to all account types. + description: 'Since: cosmos-sdk 0.47' + operationId: AccountInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + info: + description: info is the account info which is represented by BaseAccount. + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the + above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + account_number: + type: string + format: uint64 + sequence: + type: string + format: uint64 + description: |- + QueryAccountInfoResponse is the Query/AccountInfo response type. + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: address + description: address is the account address string. + in: path + required: true + type: string + tags: + - Query /cosmos/auth/v1beta1/accounts: get: - summary: Accounts returns all the existing accounts - description: 'Since: cosmos-sdk 0.43' + summary: Accounts returns all the existing accounts. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.43 operationId: Accounts responses: '200': @@ -117,7 +527,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -127,13 +537,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -155,7 +568,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -332,7 +744,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -342,13 +754,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -370,7 +785,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -575,7 +989,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -585,13 +999,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -613,7 +1030,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -764,7 +1180,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -774,13 +1190,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -802,7 +1221,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -978,7 +1396,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -988,13 +1406,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -1016,7 +1437,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -1056,6 +1476,8 @@ paths: parameters: - name: id description: |- + Deprecated, use account_id instead + id is the account number of the address to be queried. This field should have been an uint64 (like all account numbers), and will be updated to uint64 in a future version of the auth query. @@ -1063,6 +1485,15 @@ paths: required: true type: string format: int64 + - name: account_id + description: |- + account_id is the account number of the address to be queried. + + Since: cosmos-sdk 0.47 + in: query + required: false + type: string + format: uint64 tags: - Query /cosmos/auth/v1beta1/bech32: @@ -1198,7 +1629,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -1208,13 +1639,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -1236,7 +1670,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -1408,7 +1841,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -1418,13 +1851,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -1446,7 +1882,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -1625,7 +2060,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -1635,13 +2070,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -1663,7 +2101,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -1820,7 +2257,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -1830,13 +2267,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -1858,7 +2298,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -2015,7 +2454,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -2025,13 +2464,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -2053,7 +2495,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -2201,7 +2642,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -2211,13 +2652,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -2239,7 +2683,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -2390,7 +2833,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -2400,13 +2843,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -2428,7 +2874,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -2618,7 +3063,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -2628,13 +3073,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -2656,7 +3104,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -2698,6 +3145,11 @@ paths: /cosmos/bank/v1beta1/balances/{address}: get: summary: AllBalances queries the balance of all coins for a single account. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: AllBalances responses: '200': @@ -2903,7 +3355,14 @@ paths: token denomination. - description: 'Since: cosmos-sdk 0.46' + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.46 operationId: DenomOwners responses: '200': @@ -3432,6 +3891,18 @@ paths: (whether a denom is sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. + + For genesis, use the newly added send_enabled field in the + genesis object. + + Storage, lookup, and manipulation of this information is + now in the keeper. + + + As of cosmos-sdk 0.47, this only exists for backwards + compatibility of genesis files. default_send_enabled: type: boolean description: Params defines the parameters for the bank module. @@ -3462,12 +3933,176 @@ paths: format: byte tags: - Query + /cosmos/bank/v1beta1/send_enabled: + get: + summary: SendEnabled queries for SendEnabled entries. + description: >- + This query only returns denominations that have specific SendEnabled + settings. + + Any denomination that does not have a specific setting will use the + default + + params.default_send_enabled, and will not be returned by this query. + + + Since: cosmos-sdk 0.47 + operationId: SendEnabled + responses: + '200': + description: A successful response. + schema: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status + (whether a denom is + + sendable). + pagination: + description: >- + pagination defines the pagination in the response. This field + is only + + populated if the denoms field in the request is empty. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QuerySendEnabledResponse defines the RPC response of a SendEnable + query. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: denoms + description: >- + denoms is the specific denoms you want look up. Leave empty to get + all entries. + in: query + required: false + type: array + items: + type: string + collectionFormat: multi + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query /cosmos/bank/v1beta1/spendable_balances/{address}: get: - summary: |- - SpendableBalances queries the spenable balance of all coins for a single + summary: >- + SpendableBalances queries the spendable balance of all coins for a + single + account. - description: 'Since: cosmos-sdk 0.46' + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.46 operationId: SpendableBalances responses: '200': @@ -3606,9 +4241,94 @@ paths: type: boolean tags: - Query + /cosmos/bank/v1beta1/spendable_balances/{address}/by_denom: + get: + summary: >- + SpendableBalanceByDenom queries the spendable balance of a single denom + for + + a single account. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.47 + operationId: SpendableBalanceByDenom + responses: + '200': + description: A successful response. + schema: + type: object + properties: + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + QuerySpendableBalanceByDenomResponse defines the gRPC response + structure for + + querying an account's spendable balance for a specific denom. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: address + description: address is the address to query balances for. + in: path + required: true + type: string + - name: denom + description: denom is the coin denom to query balances for. + in: query + required: false + type: string + tags: + - Query /cosmos/bank/v1beta1/supply: get: summary: TotalSupply queries the total supply of all coins. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: TotalSupply responses: '200': @@ -3745,6 +4465,11 @@ paths: /cosmos/bank/v1beta1/supply/by_denom: get: summary: SupplyOf queries the supply of a single coin. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: SupplyOf responses: '200': @@ -3804,11 +4529,12 @@ paths: get: summary: >- ABCIQuery defines a query handler that supports ABCI queries directly to + the - the application, bypassing Tendermint completely. The ABCI query must + application, bypassing Tendermint completely. The ABCI query must + contain - contain a valid and supported path, including app, custom, p2p, and - store. + a valid and supported path, including app, custom, p2p, and store. description: 'Since: cosmos-sdk 0.46' operationId: ABCIQuery responses: @@ -3853,24 +4579,20 @@ paths: ProofOp defines an operation used for calculating Merkle root. The data could - be arbitrary format, providing nessecary data for + be arbitrary format, providing necessary data for example neighbouring node hash. Note: This type is a duplicate of the ProofOp proto type - defined in - - Tendermint. + defined in Tendermint. description: >- ProofOps is Merkle proof defined by the list of ProofOps. Note: This type is a duplicate of the ProofOps proto type - defined in - - Tendermint. + defined in Tendermint. height: type: string format: int64 @@ -3878,9 +4600,7 @@ paths: type: string description: >- ABCIQueryResponse defines the response structure for the ABCIQuery - gRPC - - query. + gRPC query. Note: This type is a duplicate of the ResponseQuery proto type @@ -4001,7 +4721,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -4011,13 +4731,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -4039,7 +4762,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -5214,9 +5936,7 @@ paths: field converted to bech32 string. description: >- GetLatestBlockResponse is the response type for the - Query/GetLatestBlock RPC - - method. + Query/GetLatestBlock RPC method. default: description: An unexpected error response. schema: @@ -5331,7 +6051,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -5341,13 +6061,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -5369,7 +6092,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -6525,9 +7247,7 @@ paths: field converted to bech32 string. description: >- GetBlockByHeightResponse is the response type for the - Query/GetBlockByHeight - - RPC method. + Query/GetBlockByHeight RPC method. default: description: An unexpected error response. schema: @@ -6642,7 +7362,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -6652,13 +7372,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -6680,7 +7403,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -6806,9 +7528,7 @@ paths: description: VersionInfo is the type for the GetNodeInfoResponse message. description: >- GetNodeInfoResponse is the response type for the Query/GetNodeInfo - RPC - - method. + RPC method. default: description: An unexpected error response. schema: @@ -6923,7 +7643,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -6933,13 +7653,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -6961,7 +7684,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -7129,7 +7851,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7139,13 +7861,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -7167,7 +7892,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -7326,7 +8050,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7336,13 +8060,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -7364,7 +8091,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -7429,7 +8155,7 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - description: |- + description: >- GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. default: @@ -7546,7 +8272,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7556,13 +8282,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -7584,7 +8313,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -7800,7 +8528,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7810,13 +8538,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -7838,7 +8569,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -7903,7 +8633,7 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - description: |- + description: >- GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. default: @@ -8020,7 +8750,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8030,13 +8760,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -8058,7 +8791,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -8491,8 +9223,18 @@ paths: type: string base_proposer_reward: type: string + description: >- + Deprecated: The base_proposer_reward field is deprecated + and is no longer used + + in the x/distribution module's reward mechanism. bonus_proposer_reward: type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated + and is no longer used + + in the x/distribution module's reward mechanism. withdraw_addr_enabled: type: boolean description: >- @@ -8522,6 +9264,92 @@ paths: format: byte tags: - Query + /cosmos/distribution/v1beta1/validators/{validator_address}: + get: + summary: >- + ValidatorDistributionInfo queries validator commission and + self-delegation rewards for validator + operationId: ValidatorDistributionInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + operator_address: + type: string + description: operator_address defines the validator operator address. + self_bond_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: self_bond_rewards defines the self delegations rewards. + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: commission defines the commission the validator received. + description: >- + QueryValidatorDistributionInfoResponse is the response type for + the Query/ValidatorDistributionInfo RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query /cosmos/distribution/v1beta1/validators/{validator_address}/commission: get: summary: ValidatorCommission queries accumulated commission for a validator. @@ -8533,7 +9361,7 @@ paths: type: object properties: commission: - description: commission defines the commision the validator received. + description: commission defines the commission the validator received. type: object properties: commission: @@ -8926,7 +9754,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8936,13 +9764,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -8964,7 +9795,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -9140,7 +9970,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9150,13 +9980,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -9178,7 +10011,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -9274,7 +10106,7 @@ paths: type: boolean tags: - Query - /cosmos/evidence/v1beta1/evidence/{evidence_hash}: + /cosmos/evidence/v1beta1/evidence/{hash}: get: summary: Evidence queries evidence based on evidence hash. operationId: Evidence @@ -9383,7 +10215,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9393,13 +10225,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -9421,7 +10256,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -9572,7 +10406,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9582,13 +10416,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -9610,7 +10447,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -9648,11 +10484,21 @@ paths: "value": "1.212s" } parameters: - - name: evidence_hash - description: evidence_hash defines the hash of the requested evidence. + - name: hash + description: |- + hash defines the evidence hash of the requested evidence. + + Since: cosmos-sdk 0.47 in: path required: true type: string + - name: evidence_hash + description: |- + evidence_hash defines the hash of the requested evidence. + Deprecated: Use hash, a HEX encoded string, instead. + in: query + required: false + type: string format: byte tags: - Query @@ -9672,7 +10518,7 @@ paths: properties: voting_period: type: string - description: Length of the voting period. + description: Duration of the voting period. deposit_params: description: deposit_params defines the parameters related to deposit. type: object @@ -9700,7 +10546,8 @@ paths: description: >- Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - months. + + months. tally_params: description: tally_params defines the parameters related to tally. type: object @@ -9711,7 +10558,8 @@ paths: description: >- Minimum percentage of total stake needed to vote for a result to be - considered valid. + + considered valid. threshold: type: string format: byte @@ -9724,7 +10572,8 @@ paths: description: >- Minimum value of Veto votes to Total votes ratio for proposal to be - vetoed. Default value: 1/3. + + vetoed. Default value: 1/3. description: >- QueryParamsResponse is the response type for the Query/Params RPC method. @@ -9842,7 +10691,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9852,13 +10701,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -9880,7 +10732,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -9947,6 +10798,7 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. content: type: object properties: @@ -10047,7 +10899,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -10057,13 +10909,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -10085,7 +10940,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -10125,6 +10979,7 @@ paths: "value": "1.212s" } status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -10134,21 +10989,6 @@ paths: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: >- - ProposalStatus enumerates the valid statuses of a - proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the @@ -10162,18 +11002,28 @@ paths: properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: >- + abstain is the number of abstain votes on a + proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: >- + no_with_veto is the number of no with veto votes on + a proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -10192,15 +11042,21 @@ paths: custom method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. description: >- Proposal defines the core field members of a governance proposal. + description: proposals defines all the requested governance proposals. pagination: description: pagination defines the pagination in the response. type: object @@ -10339,7 +11195,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -10349,13 +11205,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -10377,7 +11236,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -10525,6 +11383,7 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. content: type: object properties: @@ -10625,7 +11484,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -10635,13 +11494,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -10663,7 +11525,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -10701,6 +11562,7 @@ paths: "value": "1.212s" } status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -10710,21 +11572,6 @@ paths: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: >- - ProposalStatus enumerates the valid statuses of a - proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the @@ -10738,18 +11585,26 @@ paths: properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: abstain is the number of abstain votes on a proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -10767,12 +11622,17 @@ paths: custom method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. description: >- Proposal defines the core field members of a governance proposal. @@ -10893,7 +11753,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -10903,13 +11763,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -10931,7 +11794,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -10995,8 +11857,12 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: >- + depositor defines the deposit addresses from the + proposals. amount: type: array items: @@ -11015,11 +11881,13 @@ paths: custom method signatures required by gogoproto. + description: amount to be deposited by depositor. description: >- Deposit defines an amount deposited by an account address to an active proposal. + description: deposits defines the requested deposits. pagination: description: pagination defines the pagination in the response. type: object @@ -11156,7 +12024,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -11166,13 +12034,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -11194,7 +12065,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -11314,8 +12184,12 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: >- + depositor defines the deposit addresses from the + proposals. amount: type: array items: @@ -11333,6 +12207,7 @@ paths: custom method signatures required by gogoproto. + description: amount to be deposited by depositor. description: >- Deposit defines an amount deposited by an account address to an active @@ -11455,7 +12330,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -11465,13 +12340,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -11493,7 +12371,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -11560,12 +12437,18 @@ paths: properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: abstain is the number of abstain votes on a proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. description: >- QueryTallyResultResponse is the response type for the Query/Tally RPC method. @@ -11683,7 +12566,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -11693,13 +12576,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -11721,7 +12607,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -11785,8 +12670,10 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. option: description: >- Deprecated: Prefer to use `options` instead. This field @@ -11811,6 +12698,9 @@ paths: type: object properties: option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -11819,30 +12709,27 @@ paths: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a - given governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: >- + weight is the vote weight associated with the vote + option. description: >- WeightedVoteOption defines a unit of vote for vote split. Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 description: >- Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option. - description: votes defined the queried votes. + description: votes defines the queried votes. pagination: description: pagination defines the pagination in the response. type: object @@ -11979,7 +12866,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -11989,13 +12876,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -12017,7 +12907,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -12135,8 +13024,10 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. option: description: >- Deprecated: Prefer to use `options` instead. This field is @@ -12161,6 +13052,9 @@ paths: type: object properties: option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -12169,24 +13063,21 @@ paths: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a - given governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: >- + weight is the vote weight associated with the vote + option. description: >- WeightedVoteOption defines a unit of vote for vote split. Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 description: >- Vote defines a vote on a governance proposal. @@ -12309,7 +13200,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -12319,13 +13210,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -12347,7 +13241,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -12409,14 +13302,18 @@ paths: type: object properties: voting_params: - description: voting_params defines the parameters related to voting. + description: |- + Deprecated: Prefer to use `params` instead. + voting_params defines the parameters related to voting. type: object properties: voting_period: type: string - description: Length of the voting period. + description: Duration of the voting period. deposit_params: - description: deposit_params defines the parameters related to deposit. + description: |- + Deprecated: Prefer to use `params` instead. + deposit_params defines the parameters related to deposit. type: object properties: min_deposit: @@ -12442,11 +13339,68 @@ paths: description: >- Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - months. + + months. tally_params: - description: tally_params defines the parameters related to tally. + description: |- + Deprecated: Prefer to use `params` instead. + tally_params defines the parameters related to tally. type: object properties: + quorum: + type: string + description: >- + Minimum percentage of total stake needed to vote for a + result to be + + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. + Default value: 0.5. + veto_threshold: + type: string + description: >- + Minimum value of Veto votes to Total votes ratio for + proposal to be + + vetoed. Default value: 1/3. + params: + description: |- + params defines all the paramaters of x/gov module. + + Since: cosmos-sdk 0.47 + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. + Initial value: 2 + + months. + voting_period: + type: string + description: Duration of the voting period. quorum: type: string description: >- @@ -12464,6 +13418,11 @@ paths: Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Default value: 1/3. + min_initial_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value + that must be paid at proposal submission. description: >- QueryParamsResponse is the response type for the Query/Params RPC method. @@ -12581,7 +13540,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -12591,13 +13550,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -12619,7 +13581,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -12686,6 +13647,7 @@ paths: id: type: string format: uint64 + description: id defines the unique id of the proposal. messages: type: array items: @@ -12788,7 +13750,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -12798,13 +13760,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -12826,7 +13791,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -12865,7 +13829,11 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + description: >- + messages are the arbitrary messages to be executed if + the proposal passes. status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -12875,21 +13843,6 @@ paths: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: >- - ProposalStatus enumerates the valid statuses of a - proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the @@ -12903,18 +13856,28 @@ paths: properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: >- + abstain_count is the number of abstain votes on a + proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: >- + no_with_veto_count is the number of no with veto + votes on a proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -12933,20 +13896,38 @@ paths: custom method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. metadata: type: string description: >- metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter description: >- Proposal defines the core field members of a governance proposal. + description: proposals defines all the requested governance proposals. pagination: description: pagination defines the pagination in the response. type: object @@ -13085,7 +14066,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13095,13 +14076,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -13123,7 +14107,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -13271,6 +14254,7 @@ paths: id: type: string format: uint64 + description: id defines the unique id of the proposal. messages: type: array items: @@ -13373,7 +14357,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13383,13 +14367,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -13411,7 +14398,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -13450,7 +14436,11 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + description: >- + messages are the arbitrary messages to be executed if the + proposal passes. status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -13460,21 +14450,6 @@ paths: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: >- - ProposalStatus enumerates the valid statuses of a - proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the @@ -13488,18 +14463,28 @@ paths: properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: >- + abstain_count is the number of abstain votes on a + proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: >- + no_with_veto_count is the number of no with veto votes + on a proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -13517,17 +14502,34 @@ paths: custom method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. metadata: type: string description: >- metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter description: >- Proposal defines the core field members of a governance proposal. @@ -13648,7 +14650,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13658,13 +14660,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -13686,7 +14691,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -13750,8 +14754,12 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: >- + depositor defines the deposit addresses from the + proposals. amount: type: array items: @@ -13770,11 +14778,13 @@ paths: custom method signatures required by gogoproto. + description: amount to be deposited by depositor. description: >- Deposit defines an amount deposited by an account address to an active proposal. + description: deposits defines the requested deposits. pagination: description: pagination defines the pagination in the response. type: object @@ -13911,7 +14921,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13921,13 +14931,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -13949,7 +14962,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -14069,8 +15081,12 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: >- + depositor defines the deposit addresses from the + proposals. amount: type: array items: @@ -14088,6 +15104,7 @@ paths: custom method signatures required by gogoproto. + description: amount to be deposited by depositor. description: >- Deposit defines an amount deposited by an account address to an active @@ -14210,7 +15227,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14220,13 +15237,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -14248,7 +15268,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -14315,12 +15334,20 @@ paths: properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: >- + abstain_count is the number of abstain votes on a + proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: >- + no_with_veto_count is the number of no with veto votes on + a proposal. description: >- QueryTallyResultResponse is the response type for the Query/Tally RPC method. @@ -14438,7 +15465,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14448,13 +15475,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -14476,7 +15506,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -14540,14 +15569,19 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. options: type: array items: type: object properties: option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -14556,20 +15590,15 @@ paths: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a - given governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: >- + weight is the vote weight associated with the vote + option. description: >- WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. metadata: type: string description: >- @@ -14580,7 +15609,7 @@ paths: A Vote consists of a proposal ID, the voter, and the vote option. - description: votes defined the queried votes. + description: votes defines the queried votes. pagination: description: pagination defines the pagination in the response. type: object @@ -14717,7 +15746,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14727,13 +15756,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -14755,7 +15787,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -14873,14 +15904,19 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. options: type: array items: type: object properties: option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -14889,20 +15925,15 @@ paths: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a - given governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: >- + weight is the vote weight associated with the vote + option. description: >- WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. metadata: type: string description: >- @@ -15030,7 +16061,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15040,13 +16071,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -15068,7 +16102,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -15726,6 +16759,11 @@ paths: summary: >- DelegatorDelegations queries all delegations of a given delegator address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: DelegatorDelegations responses: '200': @@ -15922,7 +16960,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15932,13 +16970,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -15960,7 +17001,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -16064,6 +17104,11 @@ paths: /cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations: get: summary: Redelegations queries redelegations of given address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: Redelegations responses: '200': @@ -16122,6 +17167,18 @@ paths: shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding + has been stopped by external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -16163,6 +17220,18 @@ paths: shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding + has been stopped by external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -16322,7 +17391,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -16332,13 +17401,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -16360,7 +17432,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -16478,6 +17549,11 @@ paths: given delegator address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: DelegatorUnbondingDelegations responses: '200': @@ -16527,6 +17603,18 @@ paths: description: >- balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has + been stopped by external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -16674,7 +17762,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -16684,13 +17772,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -16712,7 +17803,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -16818,6 +17908,11 @@ paths: summary: |- DelegatorValidators queries all validators info for given delegator address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: StakingDelegatorValidators responses: '200': @@ -16935,7 +18030,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -16945,13 +18040,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -16973,7 +18071,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -17117,6 +18214,20 @@ paths: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator description: >- Validator defines a validator, together with the total amount of the @@ -17277,7 +18388,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -17287,13 +18398,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -17315,7 +18429,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -17536,7 +18649,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -17546,13 +18659,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -17574,7 +18690,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -17715,6 +18830,20 @@ paths: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator description: >- Validator defines a validator, together with the total amount of the @@ -17855,7 +18984,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -17865,13 +18994,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -17893,7 +19025,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -18145,7 +19276,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -18155,13 +19286,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -18183,7 +19317,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -18328,6 +19461,20 @@ paths: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has + been stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator description: >- Validator defines a validator, together with the total amount of the @@ -18470,7 +19617,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -18480,13 +19627,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -18508,7 +19658,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -18712,7 +19861,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -18722,13 +19871,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -18750,7 +19902,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -18922,7 +20073,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -18932,13 +20083,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -18960,7 +20114,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -19002,6 +20155,11 @@ paths: /cosmos/staking/v1beta1/validators: get: summary: Validators queries all validators that match the given status. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: Validators responses: '200': @@ -19119,7 +20277,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -19129,13 +20287,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -19157,7 +20318,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -19301,6 +20461,20 @@ paths: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator description: >- Validator defines a validator, together with the total amount of the @@ -19461,7 +20635,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -19471,13 +20645,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -19499,7 +20676,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -19718,7 +20894,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -19728,13 +20904,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -19756,7 +20935,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -19897,6 +21075,20 @@ paths: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator description: >- Validator defines a validator, together with the total amount of the @@ -20037,7 +21229,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -20047,13 +21239,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -20075,7 +21270,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -20123,6 +21317,11 @@ paths: /cosmos/staking/v1beta1/validators/{validator_addr}/delegations: get: summary: ValidatorDelegations queries delegate info for given validator. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: ValidatorDelegations responses: '200': @@ -20316,7 +21515,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -20326,13 +21525,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -20354,7 +21556,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -20630,7 +21831,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -20640,13 +21841,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -20668,7 +21872,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -20768,6 +21971,16 @@ paths: balance: type: string description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -20896,7 +22109,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -20906,13 +22119,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -20934,7 +22150,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -20989,6 +22204,11 @@ paths: summary: >- ValidatorUnbondingDelegations queries unbonding delegations of a validator. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: ValidatorUnbondingDelegations responses: '200': @@ -21038,6 +22258,18 @@ paths: description: >- balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has + been stopped by external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -21185,7 +22417,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -21195,13 +22427,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -21223,7 +22458,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -21324,6 +22558,908 @@ paths: type: boolean tags: - Query + /cosmos/tx/v1beta1/decode: + post: + summary: TxDecode decodes the transaction. + description: 'Since: cosmos-sdk 0.47' + operationId: TxDecode + responses: + '200': + description: A successful response. + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.TxDecodeResponse' + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + in: body + required: true + schema: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + description: |- + TxDecodeRequest is the request type for the Service.TxDecode + RPC method. + + Since: cosmos-sdk 0.47 + tags: + - Service + /cosmos/tx/v1beta1/decode/amino: + post: + summary: TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + description: 'Since: cosmos-sdk 0.47' + operationId: TxDecodeAmino + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amino_json: + type: string + description: >- + TxDecodeAminoResponse is the response type for the + Service.TxDecodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + in: body + required: true + schema: + type: object + properties: + amino_binary: + type: string + format: byte + description: >- + TxDecodeAminoRequest is the request type for the + Service.TxDecodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + tags: + - Service + /cosmos/tx/v1beta1/encode: + post: + summary: TxEncode encodes the transaction. + description: 'Since: cosmos-sdk 0.47' + operationId: TxEncode + responses: + '200': + description: A successful response. + schema: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the encoded transaction bytes. + description: |- + TxEncodeResponse is the response type for the + Service.TxEncode method. + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + in: body + required: true + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.TxEncodeRequest' + tags: + - Service + /cosmos/tx/v1beta1/encode/amino: + post: + summary: TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + description: 'Since: cosmos-sdk 0.47' + operationId: TxEncodeAmino + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amino_binary: + type: string + format: byte + description: >- + TxEncodeAminoResponse is the response type for the + Service.TxEncodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + in: body + required: true + schema: + type: object + properties: + amino_json: + type: string + description: >- + TxEncodeAminoRequest is the request type for the + Service.TxEncodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + tags: + - Service /cosmos/tx/v1beta1/simulate: post: summary: Simulate simulates executing a transaction for estimating gas usage. @@ -21385,10 +23521,8 @@ paths: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -21509,7 +23643,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -21519,13 +23653,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -21547,7 +23684,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -21709,7 +23845,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -21719,13 +23855,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -21747,7 +23886,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -21915,7 +24053,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -21925,13 +24063,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -21953,7 +24094,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -22283,7 +24423,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -22293,13 +24433,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -22321,7 +24464,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -22382,10 +24524,8 @@ paths: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -22536,7 +24676,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -22546,13 +24686,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -22574,7 +24717,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -22635,8 +24777,9 @@ paths: TxService.Broadcast RPC method. - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - - BROADCAST_MODE_BLOCK: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - the tx to be committed in a block. + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x + onwards. - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for a CheckTx execution response only. - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns @@ -22772,7 +24915,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -22782,13 +24925,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -22810,7 +24956,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -23035,7 +25180,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23045,13 +25190,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -23073,7 +25221,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -23251,7 +25398,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23261,13 +25408,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -23289,7 +25439,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -23463,7 +25612,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23473,13 +25622,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -23501,7 +25653,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -23589,9 +25740,7 @@ paths: height: type: string format: int64 - description: |- - The height at which the upgrade must be performed. - Only used if Time is not set. + description: The height at which the upgrade must be performed. info: type: string title: >- @@ -23700,7 +25849,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23710,13 +25859,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -23738,7 +25890,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -23894,7 +26045,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23904,13 +26055,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -23932,7 +26086,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -24123,7 +26276,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -24133,13 +26286,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -24161,7 +26317,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -24353,7 +26508,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -24363,13 +26518,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -24391,7 +26549,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -24554,7 +26711,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -24564,13 +26721,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -24592,7 +26752,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -24784,7 +26943,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -24794,13 +26953,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -24822,7 +26984,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -25053,7 +27214,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -25063,13 +27224,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -25091,7 +27255,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -25275,7 +27438,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -25285,13 +27448,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -25313,7 +27479,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -25533,7 +27698,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -25543,13 +27708,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -25571,7 +27739,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -25755,7 +27922,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -25765,13 +27932,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -25793,7 +27963,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -26107,7 +28276,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -26117,13 +28286,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -26145,7 +28317,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -26434,7 +28605,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -26444,13 +28615,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -26472,7 +28646,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -26811,7 +28984,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -26821,13 +28994,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -26849,7 +29025,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -26964,6 +29139,9 @@ paths: amount: type: string format: uint64 + title: >- + amount is the number of all NFTs of a given class owned by the + owner title: >- QueryBalanceResponse is the response type for the Query/Balance RPC method @@ -27081,7 +29259,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -27091,13 +29269,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -27119,7 +29300,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -27158,10 +29338,12 @@ paths: } parameters: - name: owner + description: owner is the owner address of the nft in: path required: true type: string - name: class_id + description: class_id associated with the nft in: path required: true type: string @@ -27314,7 +29496,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -27324,13 +29506,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -27352,7 +29537,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -27395,7 +29579,9 @@ paths: data is the app specific metadata of the NFT class. Optional description: Class defines the class of the nft type. + description: class defines the class of the nft type. pagination: + description: pagination defines the pagination in the response. type: object properties: next_key: @@ -27413,16 +29599,6 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } title: >- QueryClassesResponse is the response type for the Query/Classes RPC method @@ -27540,7 +29716,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -27550,13 +29726,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -27578,7 +29757,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -27817,7 +29995,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -27827,13 +30005,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -27855,7 +30036,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -28013,7 +30193,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -28023,13 +30203,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -28051,7 +30234,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -28090,6 +30272,7 @@ paths: } parameters: - name: class_id + description: class_id associated with the nft in: path required: true type: string @@ -28228,7 +30411,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -28238,13 +30421,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -28266,7 +30452,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -28307,7 +30492,9 @@ paths: } title: data is an app specific data of the NFT. Optional description: NFT defines the NFT. + title: NFT defines the NFT pagination: + description: pagination defines the pagination in the response. type: object properties: next_key: @@ -28325,16 +30512,6 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } title: >- QueryNFTsResponse is the response type for the Query/NFTs RPC methods @@ -28452,7 +30629,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -28462,13 +30639,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -28490,7 +30670,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -28529,10 +30708,12 @@ paths: } parameters: - name: class_id + description: class_id associated with the nft. in: query required: false type: string - name: owner + description: owner is the owner address of the nft. in: query required: false type: string @@ -28721,7 +30902,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -28731,13 +30912,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -28759,7 +30943,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -28798,6 +30981,7 @@ paths: } title: data is an app specific data of the NFT. Optional description: NFT defines the NFT. + title: owner is the owner address of the nft title: QueryNFTResponse is the response type for the Query/NFT RPC method default: description: An unexpected error response. @@ -28913,7 +31097,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -28923,13 +31107,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -28951,7 +31138,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -28990,10 +31176,12 @@ paths: } parameters: - name: class_id + description: class_id associated with the nft in: path required: true type: string - name: id + description: id is a unique identifier of the NFT in: path required: true type: string @@ -29013,6 +31201,7 @@ paths: properties: owner: type: string + title: owner is the owner address of the nft title: >- QueryOwnerResponse is the response type for the Query/Owner RPC method @@ -29130,7 +31319,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -29140,13 +31329,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -29168,7 +31360,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -29207,10 +31398,12 @@ paths: } parameters: - name: class_id + description: class_id associated with the nft in: path required: true type: string - name: id + description: id is a unique identifier of the NFT in: path required: true type: string @@ -29231,6 +31424,7 @@ paths: amount: type: string format: uint64 + title: amount is the number of all NFTs from the given class title: >- QuerySupplyResponse is the response type for the Query/Supply RPC method @@ -29348,7 +31542,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -29358,13 +31552,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -29386,7 +31583,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -29425,6 +31621,7 @@ paths: } parameters: - name: class_id + description: class_id associated with the nft in: path required: true type: string @@ -29441,7 +31638,7 @@ paths: type: object properties: info: - description: info is the GroupInfo for the group. + description: info is the GroupInfo of the group. type: object properties: id: @@ -29595,7 +31792,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -29605,13 +31802,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -29633,7 +31833,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -29681,7 +31880,7 @@ paths: - Query /cosmos/group/v1/group_members/{group_id}: get: - summary: GroupMembers queries members of a group + summary: GroupMembers queries members of a group by group id. operationId: GroupMembers responses: '200': @@ -29861,7 +32060,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -29871,13 +32070,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -29899,7 +32101,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -30003,7 +32204,7 @@ paths: - Query /cosmos/group/v1/group_policies_by_admin/{admin}: get: - summary: GroupsByAdmin queries group policies by admin address. + summary: GroupPoliciesByAdmin queries group policies by admin address. operationId: GroupPoliciesByAdmin responses: '200': @@ -30029,8 +32230,8 @@ paths: metadata: type: string description: >- - metadata is any arbitrary metadata to attached to the - group policy. + metadata is any arbitrary metadata attached to the group + policy. version: type: string format: uint64 @@ -30139,7 +32340,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -30149,13 +32350,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -30177,7 +32381,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -30364,7 +32567,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -30374,13 +32577,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -30402,7 +32608,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -30531,8 +32736,8 @@ paths: metadata: type: string description: >- - metadata is any arbitrary metadata to attached to the - group policy. + metadata is any arbitrary metadata attached to the group + policy. version: type: string format: uint64 @@ -30641,7 +32846,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -30651,13 +32856,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -30679,7 +32887,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -30866,7 +33073,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -30876,13 +33083,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -30904,7 +33114,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -31034,8 +33243,8 @@ paths: metadata: type: string description: >- - metadata is any arbitrary metadata to attached to the - group policy. + metadata is any arbitrary metadata attached to the group + policy. version: type: string format: uint64 @@ -31144,7 +33353,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -31154,13 +33363,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -31182,7 +33394,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -31345,7 +33556,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -31355,13 +33566,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -31383,7 +33597,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -31619,7 +33832,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -31629,13 +33842,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -31657,7 +33873,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -31949,7 +34164,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -31959,13 +34174,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -31987,7 +34205,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -32114,7 +34331,7 @@ paths: metadata: type: string description: >- - metadata is any arbitrary metadata to attached to the + metadata is any arbitrary metadata attached to the proposal. proposers: type: array @@ -32194,8 +34411,8 @@ paths: voting_period_end is the timestamp before which voting must be done. - Unless a successfull MsgExec is called before (to execute - a proposal whose + Unless a successful MsgExec is called before (to execute a + proposal whose tally is successful before the voting period ends), tallying will be done @@ -32317,7 +34534,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -32327,13 +34544,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -32355,7 +34575,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -32397,6 +34616,14 @@ paths: description: >- messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal description: QueryProposalResponse is the Query/Proposal response type. default: description: An unexpected error response. @@ -32512,7 +34739,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -32522,13 +34749,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -32550,7 +34780,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -32747,7 +34976,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -32757,13 +34986,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -32785,7 +35017,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -32860,7 +35091,7 @@ paths: metadata: type: string description: >- - metadata is any arbitrary metadata to attached to the + metadata is any arbitrary metadata attached to the proposal. proposers: type: array @@ -32940,8 +35171,8 @@ paths: voting_period_end is the timestamp before which voting must be done. - Unless a successfull MsgExec is called before (to - execute a proposal whose + Unless a successful MsgExec is called before (to execute + a proposal whose tally is successful before the voting period ends), tallying will be done @@ -33063,7 +35294,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -33073,13 +35304,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -33101,7 +35335,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -33143,6 +35376,14 @@ paths: description: >- messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal description: >- Proposal defines a group proposal. Any member of a group can submit a proposal @@ -33291,7 +35532,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -33301,13 +35542,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -33329,7 +35573,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -33465,9 +35708,7 @@ paths: default: VOTE_OPTION_UNSPECIFIED metadata: type: string - description: >- - metadata is any arbitrary metadata to attached to the - vote. + description: metadata is any arbitrary metadata attached to the vote. submit_time: type: string format: date-time @@ -33589,7 +35830,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -33599,13 +35840,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -33627,7 +35871,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -33680,7 +35923,7 @@ paths: - Query /cosmos/group/v1/votes_by_proposal/{proposal_id}: get: - summary: VotesByProposal queries a vote by proposal. + summary: VotesByProposal queries a vote by proposal id. operationId: VotesByProposal responses: '200': @@ -33712,9 +35955,7 @@ paths: default: VOTE_OPTION_UNSPECIFIED metadata: type: string - description: >- - metadata is any arbitrary metadata to attached to the - vote. + description: metadata is any arbitrary metadata attached to the vote. submit_time: type: string format: date-time @@ -33859,7 +36100,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -33869,13 +36110,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -33897,7 +36141,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -34033,9 +36276,7 @@ paths: default: VOTE_OPTION_UNSPECIFIED metadata: type: string - description: >- - metadata is any arbitrary metadata to attached to the - vote. + description: metadata is any arbitrary metadata attached to the vote. submit_time: type: string format: date-time @@ -34178,7 +36419,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -34188,13 +36429,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -34216,7 +36460,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -34341,6 +36584,186 @@ definitions: Since: cosmos-sdk 0.46 + cosmos.auth.v1beta1.BaseAccount: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + account_number: + type: string + format: uint64 + sequence: + type: string + format: uint64 + description: >- + BaseAccount defines a base account type. It contains all the necessary + fields + + for basic account functionality. Any custom account type should extend + this + + type for additional functionality (e.g. vesting). cosmos.auth.v1beta1.Bech32PrefixResponse: type: object properties: @@ -34378,6 +36801,192 @@ definitions: title: >- QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + cosmos.auth.v1beta1.QueryAccountInfoResponse: + type: object + properties: + info: + description: info is the account info which is represented by BaseAccount. + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + account_number: + type: string + format: uint64 + sequence: + type: string + format: uint64 + description: |- + QueryAccountInfoResponse is the Query/AccountInfo response type. + + Since: cosmos-sdk 0.47 cosmos.auth.v1beta1.QueryAccountResponse: type: object properties: @@ -34474,7 +37083,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -34484,13 +37093,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -34508,7 +37120,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -34644,7 +37255,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -34654,13 +37265,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -34678,7 +37292,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -34832,7 +37445,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -34842,13 +37455,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -34866,7 +37482,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -35002,7 +37617,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -35012,13 +37627,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -35036,7 +37654,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -35263,7 +37880,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -35273,13 +37890,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -35297,7 +37917,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -35437,7 +38056,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -35447,13 +38066,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -35471,7 +38093,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -35656,6 +38277,18 @@ definitions: denom is sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. + + For genesis, use the newly added send_enabled field in the genesis + object. + + Storage, lookup, and manipulation of this information is now in the + keeper. + + + As of cosmos-sdk 0.47, this only exists for backwards compatibility of + genesis files. default_send_enabled: type: boolean description: Params defines the parameters for the bank module. @@ -36009,12 +38642,89 @@ definitions: denom is sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. + + For genesis, use the newly added send_enabled field in the genesis + object. + + Storage, lookup, and manipulation of this information is now in + the keeper. + + + As of cosmos-sdk 0.47, this only exists for backwards + compatibility of genesis files. default_send_enabled: type: boolean description: Params defines the parameters for the bank module. description: >- QueryParamsResponse defines the response type for querying x/bank parameters. + cosmos.bank.v1beta1.QuerySendEnabledResponse: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status (whether a + denom is + + sendable). + pagination: + description: |- + pagination defines the pagination in the response. This field is only + populated if the denoms field in the request is empty. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QuerySendEnabledResponse defines the RPC response of a SendEnable query. + + Since: cosmos-sdk 0.47 + cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse: + type: object + properties: + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: >- + QuerySpendableBalanceByDenomResponse defines the gRPC response structure + for + + querying an account's spendable balance for a specific denom. + + + Since: cosmos-sdk 0.47 cosmos.bank.v1beta1.QuerySpendableBalancesResponse: type: object properties: @@ -36184,19 +38894,18 @@ definitions: ProofOp defines an operation used for calculating Merkle root. The data could - be arbitrary format, providing nessecary data for example + be arbitrary format, providing necessary data for example neighbouring node hash. Note: This type is a duplicate of the ProofOp proto type defined - in - - Tendermint. - description: |- + in Tendermint. + description: >- ProofOps is Merkle proof defined by the list of ProofOps. + Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. height: @@ -36204,11 +38913,13 @@ definitions: format: int64 codespace: type: string - description: |- + description: >- ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. + Note: This type is a duplicate of the ResponseQuery proto type defined in + Tendermint. cosmos.base.tendermint.v1beta1.Block: type: object @@ -37837,9 +40548,7 @@ definitions: field converted to bech32 string. description: >- GetBlockByHeightResponse is the response type for the - Query/GetBlockByHeight - - RPC method. + Query/GetBlockByHeight RPC method. cosmos.base.tendermint.v1beta1.GetLatestBlockResponse: type: object properties: @@ -38930,9 +41639,7 @@ definitions: field converted to bech32 string. description: >- GetLatestBlockResponse is the response type for the Query/GetLatestBlock - RPC - - method. + RPC method. cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse: type: object properties: @@ -39045,7 +41752,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -39055,13 +41762,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -39082,7 +41792,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -39141,7 +41850,7 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - description: |- + description: >- GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. cosmos.base.tendermint.v1beta1.GetNodeInfoResponse: @@ -39216,7 +41925,7 @@ definitions: type: string title: 'Since: cosmos-sdk 0.43' description: VersionInfo is the type for the GetNodeInfoResponse message. - description: |- + description: >- GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. cosmos.base.tendermint.v1beta1.GetSyncingResponse: @@ -39339,7 +42048,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -39349,13 +42058,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -39376,7 +42088,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -39435,7 +42146,7 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - description: |- + description: >- GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. cosmos.base.tendermint.v1beta1.Header: @@ -39550,14 +42261,13 @@ definitions: ProofOp defines an operation used for calculating Merkle root. The data could - be arbitrary format, providing nessecary data for example neighbouring + be arbitrary format, providing necessary data for example neighbouring node hash. Note: This type is a duplicate of the ProofOp proto type defined in - Tendermint. cosmos.base.tendermint.v1beta1.ProofOps: type: object @@ -39579,18 +42289,18 @@ definitions: ProofOp defines an operation used for calculating Merkle root. The data could - be arbitrary format, providing nessecary data for example + be arbitrary format, providing necessary data for example neighbouring node hash. Note: This type is a duplicate of the ProofOp proto type defined in - Tendermint. - description: |- + description: >- ProofOps is Merkle proof defined by the list of ProofOps. + Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. cosmos.base.tendermint.v1beta1.Validator: @@ -39691,7 +42401,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -39701,13 +42411,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -39725,7 +42438,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -42228,8 +44940,18 @@ definitions: type: string base_proposer_reward: type: string + description: >- + Deprecated: The base_proposer_reward field is deprecated and is no + longer used + + in the x/distribution module's reward mechanism. bonus_proposer_reward: type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated and is no + longer used + + in the x/distribution module's reward mechanism. withdraw_addr_enabled: type: boolean description: Params defines the set of params for the distribution module. @@ -42358,8 +45080,18 @@ definitions: type: string base_proposer_reward: type: string + description: >- + Deprecated: The base_proposer_reward field is deprecated and is no + longer used + + in the x/distribution module's reward mechanism. bonus_proposer_reward: type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated and is + no longer used + + in the x/distribution module's reward mechanism. withdraw_addr_enabled: type: boolean description: QueryParamsResponse is the response type for the Query/Params RPC method. @@ -42367,7 +45099,7 @@ definitions: type: object properties: commission: - description: commission defines the commision the validator received. + description: commission defines the commission the validator received. type: object properties: commission: @@ -42391,6 +45123,45 @@ definitions: title: |- QueryValidatorCommissionResponse is the response type for the Query/ValidatorCommission RPC method + cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse: + type: object + properties: + operator_address: + type: string + description: operator_address defines the validator operator address. + self_bond_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: self_bond_rewards defines the self delegations rewards. + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: commission defines the commission the validator received. + description: >- + QueryValidatorDistributionInfoResponse is the response type for the + Query/ValidatorDistributionInfo RPC method. cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse: type: object properties: @@ -42618,7 +45389,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -42628,13 +45399,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -42652,7 +45426,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -42805,7 +45578,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -42815,13 +45588,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -42839,7 +45615,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -42880,8 +45655,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: depositor defines the deposit addresses from the proposals. amount: type: array items: @@ -42896,6 +45673,7 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. + description: amount to be deposited by depositor. description: |- Deposit defines an amount deposited by an account address to an active proposal. @@ -42922,7 +45700,8 @@ definitions: description: >- Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - months. + + months. description: DepositParams defines the params for deposits on governance proposals. cosmos.gov.v1beta1.Proposal: type: object @@ -42930,6 +45709,7 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. content: type: object properties: @@ -43023,7 +45803,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -43033,13 +45813,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -43057,7 +45840,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -43090,6 +45872,7 @@ definitions: "value": "1.212s" } status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -43099,20 +45882,6 @@ definitions: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: |- final_tally_result is the final tally result of the proposal. When @@ -43122,18 +45891,24 @@ definitions: properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: abstain is the number of abstain votes on a proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: no_with_veto is the number of no with veto votes on a proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -43148,12 +45923,15 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: voting_start_time is the starting time to vote on a proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. description: Proposal defines the core field members of a governance proposal. cosmos.gov.v1beta1.ProposalStatus: type: string @@ -43188,8 +45966,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: depositor defines the deposit addresses from the proposals. amount: type: array items: @@ -43207,6 +45987,7 @@ definitions: method signatures required by gogoproto. + description: amount to be deposited by depositor. description: |- Deposit defines an amount deposited by an account address to an active proposal. @@ -43224,8 +46005,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: depositor defines the deposit addresses from the proposals. amount: type: array items: @@ -43243,11 +46026,13 @@ definitions: method signatures required by gogoproto. + description: amount to be deposited by depositor. description: >- Deposit defines an amount deposited by an account address to an active proposal. + description: deposits defines the requested deposits. pagination: description: pagination defines the pagination in the response. type: object @@ -43279,7 +46064,7 @@ definitions: properties: voting_period: type: string - description: Length of the voting period. + description: Duration of the voting period. deposit_params: description: deposit_params defines the parameters related to deposit. type: object @@ -43307,7 +46092,8 @@ definitions: description: >- Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - months. + + months. tally_params: description: tally_params defines the parameters related to tally. type: object @@ -43318,7 +46104,8 @@ definitions: description: >- Minimum percentage of total stake needed to vote for a result to be - considered valid. + + considered valid. threshold: type: string format: byte @@ -43331,7 +46118,8 @@ definitions: description: >- Minimum value of Veto votes to Total votes ratio for proposal to be - vetoed. Default value: 1/3. + + vetoed. Default value: 1/3. description: QueryParamsResponse is the response type for the Query/Params RPC method. cosmos.gov.v1beta1.QueryProposalResponse: type: object @@ -43342,6 +46130,7 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. content: type: object properties: @@ -43439,7 +46228,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -43449,13 +46238,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -43474,7 +46266,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -43508,6 +46299,7 @@ definitions: "value": "1.212s" } status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -43517,20 +46309,6 @@ definitions: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the proposal. When @@ -43543,18 +46321,26 @@ definitions: properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: abstain is the number of abstain votes on a proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -43572,12 +46358,15 @@ definitions: method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: voting_start_time is the starting time to vote on a proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. description: Proposal defines the core field members of a governance proposal. description: >- QueryProposalResponse is the response type for the Query/Proposal RPC @@ -43593,6 +46382,7 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. content: type: object properties: @@ -43692,7 +46482,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -43702,13 +46492,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -43729,7 +46522,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -43763,6 +46555,7 @@ definitions: "value": "1.212s" } status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -43772,20 +46565,6 @@ definitions: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the proposal. @@ -43799,18 +46578,26 @@ definitions: properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: abstain is the number of abstain votes on a proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -43828,13 +46615,17 @@ definitions: method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: voting_start_time is the starting time to vote on a proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. description: Proposal defines the core field members of a governance proposal. + description: proposals defines all the requested governance proposals. pagination: description: pagination defines the pagination in the response. type: object @@ -43866,12 +46657,16 @@ definitions: properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: abstain is the number of abstain votes on a proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: no_with_veto is the number of no with veto votes on a proposal. description: >- QueryTallyResultResponse is the response type for the Query/Tally RPC method. @@ -43884,8 +46679,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. option: description: >- Deprecated: Prefer to use `options` instead. This field is set in @@ -43909,6 +46706,9 @@ definitions: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -43917,22 +46717,17 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: |- WeightedVoteOption defines a unit of vote for vote split. Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 description: |- Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option. @@ -43948,8 +46743,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. option: description: >- Deprecated: Prefer to use `options` instead. This field is set @@ -43973,6 +46770,9 @@ definitions: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -43981,26 +46781,21 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: |- WeightedVoteOption defines a unit of vote for vote split. Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 description: |- Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option. - description: votes defined the queried votes. + description: votes defines the queried votes. pagination: description: pagination defines the pagination in the response. type: object @@ -44029,7 +46824,7 @@ definitions: format: byte description: |- Minimum percentage of total stake needed to vote for a result to be - considered valid. + considered valid. threshold: type: string format: byte @@ -44041,19 +46836,23 @@ definitions: format: byte description: |- Minimum value of Veto votes to Total votes ratio for proposal to be - vetoed. Default value: 1/3. + vetoed. Default value: 1/3. description: TallyParams defines the params for tallying votes on governance proposals. cosmos.gov.v1beta1.TallyResult: type: object properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: abstain is the number of abstain votes on a proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: no_with_veto is the number of no with veto votes on a proposal. description: TallyResult defines a standard tally for a governance proposal. cosmos.gov.v1beta1.Vote: type: object @@ -44061,8 +46860,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. option: description: >- Deprecated: Prefer to use `options` instead. This field is set in @@ -44086,6 +46887,9 @@ definitions: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -44094,22 +46898,17 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: |- WeightedVoteOption defines a unit of vote for vote split. Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 description: |- Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option. @@ -44136,12 +46935,15 @@ definitions: properties: voting_period: type: string - description: Length of the voting period. + description: Duration of the voting period. description: VotingParams defines the params for voting on governance proposals. cosmos.gov.v1beta1.WeightedVoteOption: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain duplicate + vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -44150,17 +46952,9 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given governance - proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: |- WeightedVoteOption defines a unit of vote for vote split. @@ -44171,8 +46965,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: depositor defines the deposit addresses from the proposals. amount: type: array items: @@ -44187,6 +46983,7 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. + description: amount to be deposited by depositor. description: |- Deposit defines an amount deposited by an account address to an active proposal. @@ -44213,14 +47010,68 @@ definitions: description: >- Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - months. + + months. description: DepositParams defines the params for deposits on governance proposals. + cosmos.gov.v1.Params: + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + voting_period: + type: string + description: Duration of the voting period. + quorum: + type: string + description: |- + Minimum percentage of total stake needed to vote for a result to be + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. Default value: + 0.5. + veto_threshold: + type: string + description: |- + Minimum value of Veto votes to Total votes ratio for proposal to be + vetoed. Default value: 1/3. + min_initial_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value that must + be paid at proposal submission. + description: |- + Params defines the parameters for the x/gov module. + + Since: cosmos-sdk 0.47 cosmos.gov.v1.Proposal: type: object properties: id: type: string format: uint64 + description: id defines the unique id of the proposal. messages: type: array items: @@ -44319,7 +47170,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -44329,13 +47180,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -44353,7 +47207,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -44385,7 +47238,11 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + description: >- + messages are the arbitrary messages to be executed if the proposal + passes. status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -44395,20 +47252,6 @@ definitions: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: |- final_tally_result is the final tally result of the proposal. When @@ -44418,18 +47261,26 @@ definitions: properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: abstain_count is the number of abstain votes on a proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -44444,15 +47295,30 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: voting_start_time is the starting time to vote on a proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. metadata: type: string description: metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter description: Proposal defines the core field members of a governance proposal. cosmos.gov.v1.ProposalStatus: type: string @@ -44487,8 +47353,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: depositor defines the deposit addresses from the proposals. amount: type: array items: @@ -44506,6 +47374,7 @@ definitions: method signatures required by gogoproto. + description: amount to be deposited by depositor. description: |- Deposit defines an amount deposited by an account address to an active proposal. @@ -44523,8 +47392,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: depositor defines the deposit addresses from the proposals. amount: type: array items: @@ -44542,11 +47413,13 @@ definitions: method signatures required by gogoproto. + description: amount to be deposited by depositor. description: >- Deposit defines an amount deposited by an account address to an active proposal. + description: deposits defines the requested deposits. pagination: description: pagination defines the pagination in the response. type: object @@ -44573,14 +47446,18 @@ definitions: type: object properties: voting_params: - description: voting_params defines the parameters related to voting. + description: |- + Deprecated: Prefer to use `params` instead. + voting_params defines the parameters related to voting. type: object properties: voting_period: type: string - description: Length of the voting period. + description: Duration of the voting period. deposit_params: - description: deposit_params defines the parameters related to deposit. + description: |- + Deprecated: Prefer to use `params` instead. + deposit_params defines the parameters related to deposit. type: object properties: min_deposit: @@ -44606,11 +47483,68 @@ definitions: description: >- Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - months. + + months. tally_params: - description: tally_params defines the parameters related to tally. + description: |- + Deprecated: Prefer to use `params` instead. + tally_params defines the parameters related to tally. type: object properties: + quorum: + type: string + description: >- + Minimum percentage of total stake needed to vote for a result to + be + + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. Default + value: 0.5. + veto_threshold: + type: string + description: >- + Minimum value of Veto votes to Total votes ratio for proposal to + be + + vetoed. Default value: 1/3. + params: + description: |- + params defines all the paramaters of x/gov module. + + Since: cosmos-sdk 0.47 + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + voting_period: + type: string + description: Duration of the voting period. quorum: type: string description: >- @@ -44628,6 +47562,11 @@ definitions: Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Default value: 1/3. + min_initial_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value that + must be paid at proposal submission. description: QueryParamsResponse is the response type for the Query/Params RPC method. cosmos.gov.v1.QueryProposalResponse: type: object @@ -44638,6 +47577,7 @@ definitions: id: type: string format: uint64 + description: id defines the unique id of the proposal. messages: type: array items: @@ -44739,7 +47679,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -44749,13 +47689,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -44776,7 +47719,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -44809,7 +47751,11 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + description: >- + messages are the arbitrary messages to be executed if the proposal + passes. status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -44819,20 +47765,6 @@ definitions: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the proposal. When @@ -44845,18 +47777,26 @@ definitions: properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: abstain_count is the number of abstain votes on a proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -44874,15 +47814,30 @@ definitions: method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: voting_start_time is the starting time to vote on a proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. metadata: type: string description: metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter description: Proposal defines the core field members of a governance proposal. description: >- QueryProposalResponse is the response type for the Query/Proposal RPC @@ -44898,6 +47853,7 @@ definitions: id: type: string format: uint64 + description: id defines the unique id of the proposal. messages: type: array items: @@ -44999,7 +47955,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -45009,13 +47965,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -45037,7 +47996,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -45071,7 +48029,11 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + description: >- + messages are the arbitrary messages to be executed if the + proposal passes. status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -45081,20 +48043,6 @@ definitions: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the proposal. @@ -45108,18 +48056,26 @@ definitions: properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: abstain_count is the number of abstain votes on a proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -45137,16 +48093,32 @@ definitions: method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: voting_start_time is the starting time to vote on a proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. metadata: type: string description: metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter description: Proposal defines the core field members of a governance proposal. + description: proposals defines all the requested governance proposals. pagination: description: pagination defines the pagination in the response. type: object @@ -45178,12 +48150,18 @@ definitions: properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: abstain_count is the number of abstain votes on a proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. description: >- QueryTallyResultResponse is the response type for the Query/Tally RPC method. @@ -45196,14 +48174,19 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. options: type: array items: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -45212,18 +48195,11 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. metadata: type: string description: metadata is any arbitrary metadata to attached to the vote. @@ -45242,14 +48218,19 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. options: type: array items: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -45258,25 +48239,18 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. metadata: type: string description: metadata is any arbitrary metadata to attached to the vote. description: |- Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option. - description: votes defined the queried votes. + description: votes defines the queried votes. pagination: description: pagination defines the pagination in the response. type: object @@ -45304,7 +48278,7 @@ definitions: type: string description: |- Minimum percentage of total stake needed to vote for a result to be - considered valid. + considered valid. threshold: type: string description: >- @@ -45314,19 +48288,23 @@ definitions: type: string description: |- Minimum value of Veto votes to Total votes ratio for proposal to be - vetoed. Default value: 1/3. + vetoed. Default value: 1/3. description: TallyParams defines the params for tallying votes on governance proposals. cosmos.gov.v1.TallyResult: type: object properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: abstain_count is the number of abstain votes on a proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: no_with_veto_count is the number of no with veto votes on a proposal. description: TallyResult defines a standard tally for a governance proposal. cosmos.gov.v1.Vote: type: object @@ -45334,14 +48312,19 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. options: type: array items: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -45350,18 +48333,11 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. metadata: type: string description: metadata is any arbitrary metadata to attached to the vote. @@ -45391,12 +48367,15 @@ definitions: properties: voting_period: type: string - description: Length of the voting period. + description: Duration of the voting period. description: VotingParams defines the params for voting on governance proposals. cosmos.gov.v1.WeightedVoteOption: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain duplicate + vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -45405,17 +48384,9 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given governance - proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: WeightedVoteOption defines a unit of vote for vote split. cosmos.mint.v1beta1.Params: type: object @@ -45439,7 +48410,7 @@ definitions: type: string format: uint64 title: expected blocks per year - description: Params holds parameters for the mint module. + description: Params defines the parameters for the x/mint module. cosmos.mint.v1beta1.QueryAnnualProvisionsResponse: type: object properties: @@ -46104,7 +49075,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -46114,13 +49085,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -46141,7 +49115,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -46270,6 +49243,20 @@ definitions: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator description: >- Validator defines a validator, together with the total amount of the @@ -46329,7 +49316,7 @@ definitions: title: >- min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators - description: Params defines the parameters for the staking module. + description: Params defines the parameters for the x/staking module. cosmos.staking.v1beta1.Pool: type: object properties: @@ -46511,6 +49498,16 @@ definitions: balance: type: string description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -46650,7 +49647,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -46660,13 +49657,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -46685,7 +49685,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -46812,6 +49811,20 @@ definitions: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator description: >- Validator defines a validator, together with the total amount of the @@ -46948,7 +49961,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -46958,13 +49971,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -46985,7 +50001,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -47114,6 +50129,20 @@ definitions: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator description: >- Validator defines a validator, together with the total amount of the @@ -47352,7 +50381,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -47362,13 +50391,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -47390,7 +50422,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -47523,6 +50554,20 @@ definitions: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding + of this validator description: >- Validator defines a validator, together with the total amount of the @@ -47649,6 +50694,16 @@ definitions: description: >- shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -47689,6 +50744,16 @@ definitions: description: >- shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -47769,6 +50834,16 @@ definitions: balance: type: string description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -47962,7 +51037,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -47972,13 +51047,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -47997,7 +51075,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -48124,6 +51201,20 @@ definitions: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator description: >- Validator defines a validator, together with the total amount of the @@ -48187,6 +51278,16 @@ definitions: balance: type: string description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -48330,7 +51431,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -48340,13 +51441,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -48367,7 +51471,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -48496,6 +51599,20 @@ definitions: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator description: >- Validator defines a validator, together with the total amount of the @@ -48583,6 +51700,16 @@ definitions: description: >- shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -48611,6 +51738,16 @@ definitions: description: >- shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules description: RedelegationEntry defines a redelegation object with relevant metadata. cosmos.staking.v1beta1.RedelegationEntryResponse: type: object @@ -48638,6 +51775,16 @@ definitions: description: >- shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -48696,6 +51843,16 @@ definitions: description: >- shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -48736,6 +51893,16 @@ definitions: description: >- shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -48786,6 +51953,16 @@ definitions: balance: type: string description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -48812,6 +51989,16 @@ definitions: balance: type: string description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -48916,7 +52103,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -48926,13 +52113,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -48950,7 +52140,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -49074,6 +52263,20 @@ definitions: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped by + external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of this + validator description: >- Validator defines a validator, together with the total amount of the @@ -49188,10 +52391,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -49308,7 +52509,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -49318,13 +52519,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -49342,7 +52546,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -49575,7 +52778,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -49585,13 +52788,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -49609,7 +52815,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -49665,10 +52870,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -49889,8 +53092,8 @@ definitions: method. - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - - BROADCAST_MODE_BLOCK: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - the tx to be committed in a block. + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for a CheckTx execution response only. - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns @@ -49915,8 +53118,8 @@ definitions: RPC method. - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - - BROADCAST_MODE_BLOCK: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - the tx to be committed in a block. + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for a CheckTx execution response only. - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns @@ -50108,7 +53311,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -50118,13 +53321,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -50143,7 +53349,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -50200,10 +53405,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -51057,7 +54260,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -51067,13 +54270,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -51092,7 +54298,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -51149,10 +54354,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -51378,7 +54581,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -51388,13 +54591,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -51415,7 +54621,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -51472,10 +54677,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -51828,7 +55031,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -51838,13 +55041,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -51862,7 +55068,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -51984,10 +55189,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -52107,7 +55310,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -52117,13 +55320,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -52144,7 +55350,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -52319,7 +55524,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -52329,13 +55534,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -52356,7 +55564,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -52525,7 +55732,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -52535,13 +55742,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -52562,7 +55772,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -52704,7 +55913,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -52714,13 +55923,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -52741,7 +55953,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -52903,7 +56114,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -52913,13 +56124,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -52937,7 +56151,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -53099,7 +56312,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -53109,13 +56322,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -53133,7 +56349,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -53270,7 +56485,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -53280,13 +56495,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -53304,7 +56522,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -53344,6 +56561,94 @@ definitions: and can't be handled, they will be ignored description: TxBody is the body of a transaction that all signers sign over. + cosmos.tx.v1beta1.TxDecodeAminoRequest: + type: object + properties: + amino_binary: + type: string + format: byte + description: |- + TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeAminoResponse: + type: object + properties: + amino_json: + type: string + description: |- + TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeRequest: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + description: |- + TxDecodeRequest is the request type for the Service.TxDecode + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeResponse: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: tx is the decoded transaction. + description: |- + TxDecodeResponse is the response type for the + Service.TxDecode method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeAminoRequest: + type: object + properties: + amino_json: + type: string + description: |- + TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeAminoResponse: + type: object + properties: + amino_binary: + type: string + format: byte + description: |- + TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeRequest: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: tx is the transaction to encode. + description: |- + TxEncodeRequest is the request type for the Service.TxEncode + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeResponse: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the encoded transaction bytes. + description: |- + TxEncodeResponse is the response type for the + Service.TxEncode method. + + Since: cosmos-sdk 0.47 tendermint.abci.Event: type: object properties: @@ -53356,10 +56661,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: EventAttribute is a single key-value pair, associated with an event. @@ -53375,10 +56678,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: EventAttribute is a single key-value pair, associated with an event. @@ -53432,9 +56733,7 @@ definitions: height: type: string format: int64 - description: |- - The height at which the upgrade must be performed. - Only used if Time is not set. + description: The height at which the upgrade must be performed. info: type: string title: |- @@ -53533,7 +56832,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -53543,13 +56842,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -53567,7 +56869,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -53663,9 +56964,7 @@ definitions: height: type: string format: int64 - description: |- - The height at which the upgrade must be performed. - Only used if Time is not set. + description: The height at which the upgrade must be performed. info: type: string title: >- @@ -53770,7 +57069,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -53780,13 +57079,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -53805,7 +57107,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -53981,7 +57282,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -53991,13 +57292,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -54015,7 +57319,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -54160,7 +57463,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -54170,13 +57473,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -54194,7 +57500,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -54345,7 +57650,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -54355,13 +57660,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -54382,7 +57690,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -54557,7 +57864,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -54567,13 +57874,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -54594,7 +57904,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -54765,7 +58074,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -54775,13 +58084,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -54802,7 +58114,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -55375,7 +58686,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -55385,13 +58696,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -55409,7 +58723,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -55553,7 +58866,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -55563,13 +58876,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -55587,7 +58903,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -55627,6 +58942,7 @@ definitions: amount: type: string format: uint64 + title: amount is the number of all NFTs of a given class owned by the owner title: QueryBalanceResponse is the response type for the Query/Balance RPC method cosmos.nft.v1beta1.QueryClassResponse: type: object @@ -55755,7 +59071,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -55765,13 +59081,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -55790,7 +59109,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -55959,7 +59277,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -55969,13 +59287,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -55996,7 +59317,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -56031,7 +59351,9 @@ definitions: } title: data is the app specific metadata of the NFT class. Optional description: Class defines the class of the nft type. + description: class defines the class of the nft type. pagination: + description: pagination defines the pagination in the response. type: object properties: next_key: @@ -56049,14 +59371,6 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } title: QueryClassesResponse is the response type for the Query/Classes RPC method cosmos.nft.v1beta1.QueryNFTResponse: type: object @@ -56175,7 +59489,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -56185,13 +59499,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -56210,7 +59527,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -56245,6 +59561,7 @@ definitions: } title: data is an app specific data of the NFT. Optional description: NFT defines the NFT. + title: owner is the owner address of the nft title: QueryNFTResponse is the response type for the Query/NFT RPC method cosmos.nft.v1beta1.QueryNFTsResponse: type: object @@ -56367,7 +59684,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -56377,13 +59694,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -56404,7 +59724,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -56439,7 +59758,9 @@ definitions: } title: data is an app specific data of the NFT. Optional description: NFT defines the NFT. + title: NFT defines the NFT pagination: + description: pagination defines the pagination in the response. type: object properties: next_key: @@ -56457,20 +59778,13 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } title: QueryNFTsResponse is the response type for the Query/NFTs RPC methods cosmos.nft.v1beta1.QueryOwnerResponse: type: object properties: owner: type: string + title: owner is the owner address of the nft title: QueryOwnerResponse is the response type for the Query/Owner RPC method cosmos.nft.v1beta1.QuerySupplyResponse: type: object @@ -56478,6 +59792,7 @@ definitions: amount: type: string format: uint64 + title: amount is the number of all NFTs from the given class title: QuerySupplyResponse is the response type for the Query/Supply RPC method cosmos.group.v1.GroupInfo: type: object @@ -56555,7 +59870,7 @@ definitions: description: admin is the account address of the group admin. metadata: type: string - description: metadata is any arbitrary metadata to attached to the group policy. + description: metadata is any arbitrary metadata attached to the group policy. version: type: string format: uint64 @@ -56657,7 +59972,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -56667,13 +59982,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -56691,7 +60009,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -56761,7 +60078,7 @@ definitions: description: group_policy_address is the account address of group policy. metadata: type: string - description: metadata is any arbitrary metadata to attached to the proposal. + description: metadata is any arbitrary metadata attached to the proposal. proposers: type: array items: @@ -56833,7 +60150,7 @@ definitions: description: >- voting_period_end is the timestamp before which voting must be done. - Unless a successfull MsgExec is called before (to execute a proposal + Unless a successful MsgExec is called before (to execute a proposal whose tally is successful before the voting period ends), tallying will be @@ -56951,7 +60268,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -56961,13 +60278,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -56985,7 +60305,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -57020,6 +60339,14 @@ definitions: description: >- messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal description: >- Proposal defines a group proposal. Any member of a group can submit a proposal @@ -57072,7 +60399,7 @@ definitions: type: object properties: info: - description: info is the GroupInfo for the group. + description: info is the GroupInfo of the group. type: object properties: id: @@ -57182,9 +60509,7 @@ definitions: description: admin is the account address of the group admin. metadata: type: string - description: >- - metadata is any arbitrary metadata to attached to the group - policy. + description: metadata is any arbitrary metadata attached to the group policy. version: type: string format: uint64 @@ -57292,7 +60617,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -57302,13 +60627,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -57329,7 +60657,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -57414,9 +60741,7 @@ definitions: description: admin is the account address of the group admin. metadata: type: string - description: >- - metadata is any arbitrary metadata to attached to the group - policy. + description: metadata is any arbitrary metadata attached to the group policy. version: type: string format: uint64 @@ -57524,7 +60849,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -57534,13 +60859,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -57561,7 +60889,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -57646,9 +60973,7 @@ definitions: description: admin is the account address of the group admin. metadata: type: string - description: >- - metadata is any arbitrary metadata to attached to the group - policy. + description: metadata is any arbitrary metadata attached to the group policy. version: type: string format: uint64 @@ -57754,7 +61079,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -57764,13 +61089,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -57789,7 +61117,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -57976,7 +61303,7 @@ definitions: description: group_policy_address is the account address of group policy. metadata: type: string - description: metadata is any arbitrary metadata to attached to the proposal. + description: metadata is any arbitrary metadata attached to the proposal. proposers: type: array items: @@ -58054,7 +61381,7 @@ definitions: voting_period_end is the timestamp before which voting must be done. - Unless a successfull MsgExec is called before (to execute a + Unless a successful MsgExec is called before (to execute a proposal whose tally is successful before the voting period ends), tallying will @@ -58176,7 +61503,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -58186,13 +61513,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -58213,7 +61543,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -58249,6 +61578,14 @@ definitions: description: >- messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal description: QueryProposalResponse is the Query/Proposal response type. cosmos.group.v1.QueryProposalsByGroupPolicyResponse: type: object @@ -58267,7 +61604,7 @@ definitions: description: group_policy_address is the account address of group policy. metadata: type: string - description: metadata is any arbitrary metadata to attached to the proposal. + description: metadata is any arbitrary metadata attached to the proposal. proposers: type: array items: @@ -58346,7 +61683,7 @@ definitions: voting_period_end is the timestamp before which voting must be done. - Unless a successfull MsgExec is called before (to execute a + Unless a successful MsgExec is called before (to execute a proposal whose tally is successful before the voting period ends), tallying @@ -58468,7 +61805,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -58478,13 +61815,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -58506,7 +61846,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -58543,6 +61882,14 @@ definitions: description: >- messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal description: >- Proposal defines a group proposal. Any member of a group can submit a proposal @@ -58623,7 +61970,7 @@ definitions: default: VOTE_OPTION_UNSPECIFIED metadata: type: string - description: metadata is any arbitrary metadata to attached to the vote. + description: metadata is any arbitrary metadata attached to the vote. submit_time: type: string format: date-time @@ -58658,7 +62005,7 @@ definitions: default: VOTE_OPTION_UNSPECIFIED metadata: type: string - description: metadata is any arbitrary metadata to attached to the vote. + description: metadata is any arbitrary metadata attached to the vote. submit_time: type: string format: date-time @@ -58712,7 +62059,7 @@ definitions: default: VOTE_OPTION_UNSPECIFIED metadata: type: string - description: metadata is any arbitrary metadata to attached to the vote. + description: metadata is any arbitrary metadata attached to the vote. submit_time: type: string format: date-time @@ -58777,7 +62124,7 @@ definitions: default: VOTE_OPTION_UNSPECIFIED metadata: type: string - description: metadata is any arbitrary metadata to attached to the vote. + description: metadata is any arbitrary metadata attached to the vote. submit_time: type: string format: date-time diff --git a/client/docs/ibc-go-swagger.yml b/client/docs/ibc-go-swagger.yml index c750fda6..decf9f6d 100644 --- a/client/docs/ibc-go-swagger.yml +++ b/client/docs/ibc-go-swagger.yml @@ -4,7 +4,7 @@ info: description: A REST interface for state queries version: 1.0.0 paths: - '/ibc/apps/transfer/v1/channels/{channel_id}/ports/{port_id}/escrow_address': + /ibc/apps/transfer/v1/channels/{channel_id}/ports/{port_id}/escrow_address: get: summary: >- EscrowAddress returns the escrow address for a particular port and @@ -23,7 +23,7 @@ paths: QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -57,7 +57,7 @@ paths: type: string tags: - Query - '/ibc/apps/transfer/v1/denom_hashes/{trace}': + /ibc/apps/transfer/v1/denom_hashes/{trace}: get: summary: DenomHash queries a denomination hash information. operationId: DenomHash @@ -76,7 +76,7 @@ paths: method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -99,7 +99,7 @@ paths: format: byte parameters: - name: trace - description: 'The denomination trace ([port_id]/[channel_id])+/[denom]' + description: The denomination trace ([port_id]/[channel_id])+/[denom] in: path required: true type: string @@ -161,7 +161,7 @@ paths: method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -229,7 +229,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -240,10 +239,9 @@ paths: in: query required: false type: boolean - format: boolean tags: - Query - '/ibc/apps/transfer/v1/denom_traces/{hash}': + /ibc/apps/transfer/v1/denom_traces/{hash}: get: summary: DenomTrace queries a denomination trace information. operationId: DenomTrace @@ -277,7 +275,7 @@ paths: method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -308,6 +306,65 @@ paths: type: string tags: - Query + /ibc/apps/transfer/v1/denoms/{denom}/total_escrow: + get: + summary: >- + TotalEscrowForDenom returns the total amount of tokens in escrow based + on the denom. + operationId: TotalEscrowForDenom + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + QueryTotalEscrowForDenomResponse is the response type for + TotalEscrowForDenom RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: denom + in: path + required: true + type: string + tags: + - Query /ibc/apps/transfer/v1/params: get: summary: Params queries all parameters of the ibc-transfer module. @@ -324,7 +381,6 @@ paths: properties: send_enabled: type: boolean - format: boolean description: >- send_enabled enables or disables all cross-chain token transfers from this @@ -332,7 +388,6 @@ paths: chain. receive_enabled: type: boolean - format: boolean description: >- receive_enabled enables or disables all cross-chain token transfers to this @@ -342,7 +397,7 @@ paths: QueryParamsResponse is the response type for the Query/Params RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -365,7 +420,7 @@ paths: format: byte tags: - Query - '/ibc/apps/interchain_accounts/controller/v1/owners/{owner}/connections/{connection_id}': + /ibc/apps/interchain_accounts/controller/v1/owners/{owner}/connections/{connection_id}: get: summary: >- InterchainAccount returns the interchain account address for a given @@ -383,7 +438,7 @@ paths: QueryInterchainAccountResponse the response type for the Query/InterchainAccount RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -431,7 +486,6 @@ paths: properties: controller_enabled: type: boolean - format: boolean description: >- controller_enabled enables or disables the controller submodule. @@ -439,7 +493,7 @@ paths: QueryParamsResponse is the response type for the Query/Params RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -478,7 +532,6 @@ paths: properties: host_enabled: type: boolean - format: boolean description: host_enabled enables or disables the host submodule. allow_messages: type: array @@ -491,7 +544,7 @@ paths: QueryParamsResponse is the response type for the Query/Params RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -514,7 +567,7 @@ paths: format: byte tags: - Query - '/ibc/apps/fee/v1/channels/{channel_id}/ports/{port_id}/fee_enabled': + /ibc/apps/fee/v1/channels/{channel_id}/ports/{port_id}/fee_enabled: get: summary: >- FeeEnabledChannel returns true if the provided port and channel @@ -528,13 +581,12 @@ paths: properties: fee_enabled: type: boolean - format: boolean title: boolean flag representing the fee enabled channel status title: >- QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -647,7 +699,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -657,13 +709,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -685,7 +740,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -735,7 +789,7 @@ paths: type: string tags: - Query - '/ibc/apps/fee/v1/channels/{channel_id}/ports/{port_id}/incentivized_packets': + /ibc/apps/fee/v1/channels/{channel_id}/ports/{port_id}/incentivized_packets: get: summary: Gets all incentivized packets for a specific channel operationId: IncentivizedPacketsForChannel @@ -856,7 +910,7 @@ paths: QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -969,7 +1023,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -979,13 +1033,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -1007,7 +1064,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -1099,7 +1155,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -1110,7 +1165,6 @@ paths: in: query required: false type: boolean - format: boolean - name: query_height description: Height to query at. in: query @@ -1119,7 +1173,7 @@ paths: format: uint64 tags: - Query - '/ibc/apps/fee/v1/channels/{channel_id}/relayers/{relayer}/counterparty_payee': + /ibc/apps/fee/v1/channels/{channel_id}/relayers/{relayer}/counterparty_payee: get: summary: >- CounterpartyPayee returns the registered counterparty payee for forward @@ -1140,7 +1194,7 @@ paths: QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -1253,7 +1307,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -1263,13 +1317,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -1291,7 +1348,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -1341,7 +1397,7 @@ paths: type: string tags: - Query - '/ibc/apps/fee/v1/channels/{channel_id}/relayers/{relayer}/payee': + /ibc/apps/fee/v1/channels/{channel_id}/relayers/{relayer}/payee: get: summary: >- Payee returns the registered payee address for a specific channel given @@ -1358,7 +1414,7 @@ paths: title: the payee address to which packet fees are paid out title: QueryPayeeResponse defines the response type for the Payee rpc default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -1471,7 +1527,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -1481,13 +1537,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -1509,7 +1568,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -1559,7 +1617,7 @@ paths: type: string tags: - Query - '/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/sequences/{packet_id.sequence}/incentivized_packet': + /ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/sequences/{packet_id.sequence}/incentivized_packet: get: summary: >- IncentivizedPacket returns all packet fees for a packet given its @@ -1677,7 +1735,7 @@ paths: QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -1790,7 +1848,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -1800,13 +1858,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -1828,7 +1889,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -1890,7 +1950,7 @@ paths: format: uint64 tags: - Query - '/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/sequences/{packet_id.sequence}/total_ack_fees': + /ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/sequences/{packet_id.sequence}/total_ack_fees: get: summary: >- TotalAckFees returns the total acknowledgement fees for a packet given @@ -1924,7 +1984,7 @@ paths: QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -2037,7 +2097,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -2047,13 +2107,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -2075,7 +2138,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -2131,7 +2193,7 @@ paths: format: uint64 tags: - Query - '/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/sequences/{packet_id.sequence}/total_recv_fees': + /ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/sequences/{packet_id.sequence}/total_recv_fees: get: summary: >- TotalRecvFees returns the total receive fees for a packet given its @@ -2165,7 +2227,7 @@ paths: QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -2278,7 +2340,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -2288,13 +2350,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -2316,7 +2381,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -2372,7 +2436,7 @@ paths: format: uint64 tags: - Query - '/ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/sequences/{packet_id.sequence}/total_timeout_fees': + /ibc/apps/fee/v1/channels/{packet_id.channel_id}/ports/{packet_id.port_id}/sequences/{packet_id.sequence}/total_timeout_fees: get: summary: >- TotalTimeoutFees returns the total timeout fees for a packet given its @@ -2406,7 +2470,7 @@ paths: QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -2519,7 +2583,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -2529,13 +2593,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -2557,7 +2624,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -2642,7 +2708,7 @@ paths: QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -2755,7 +2821,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -2765,13 +2831,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -2793,7 +2862,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -2877,7 +2945,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -2888,7 +2955,6 @@ paths: in: query required: false type: boolean - format: boolean - name: query_height description: block height at which to query. in: query @@ -3020,7 +3086,7 @@ paths: QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -3133,7 +3199,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -3143,13 +3209,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -3171,7 +3240,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -3255,7 +3323,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -3266,7 +3333,6 @@ paths: in: query required: false type: boolean - format: boolean - name: query_height description: block height at which to query. in: query @@ -3394,7 +3460,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -3404,13 +3470,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -3432,7 +3501,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -3512,7 +3580,7 @@ paths: method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -3625,7 +3693,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -3635,13 +3703,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -3663,7 +3734,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -3747,7 +3817,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -3758,10 +3827,9 @@ paths: in: query required: false type: boolean - format: boolean tags: - Query - '/ibc/core/client/v1/client_states/{client_id}': + /ibc/core/client/v1/client_states/{client_id}: get: summary: ClientState queries an IBC light client. operationId: ClientState @@ -3870,7 +3938,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -3880,13 +3948,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -3908,7 +3979,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -3985,7 +4055,7 @@ paths: which the proof was retrieved. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -4098,7 +4168,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -4108,13 +4178,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -4136,7 +4209,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -4181,7 +4253,7 @@ paths: type: string tags: - Query - '/ibc/core/client/v1/client_status/{client_id}': + /ibc/core/client/v1/client_status/{client_id}: get: summary: Status queries the status of an IBC client. operationId: ClientStatus @@ -4199,7 +4271,7 @@ paths: method. It returns the current status of the IBC client. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -4312,7 +4384,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -4322,13 +4394,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -4350,7 +4425,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -4395,7 +4469,7 @@ paths: type: string tags: - Query - '/ibc/core/client/v1/consensus_states/{client_id}': + /ibc/core/client/v1/consensus_states/{client_id}: get: summary: |- ConsensusStates queries all the consensus state associated with a given @@ -4541,7 +4615,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -4551,13 +4625,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -4579,7 +4656,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -4658,7 +4734,7 @@ paths: QueryConsensusStatesResponse is the response type for the Query/ConsensusStates RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -4771,7 +4847,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -4781,13 +4857,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -4809,7 +4888,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -4898,7 +4976,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -4909,10 +4986,9 @@ paths: in: query required: false type: boolean - format: boolean tags: - Query - '/ibc/core/client/v1/consensus_states/{client_id}/heights': + /ibc/core/client/v1/consensus_states/{client_id}/heights: get: summary: >- ConsensusStateHeights queries the height of every consensus states @@ -4995,7 +5071,7 @@ paths: QueryConsensusStateHeightsResponse is the response type for the Query/ConsensusStateHeights RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -5108,7 +5184,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -5118,13 +5194,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -5146,7 +5225,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -5235,7 +5313,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -5246,10 +5323,9 @@ paths: in: query required: false type: boolean - format: boolean tags: - Query - '/ibc/core/client/v1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}': + /ibc/core/client/v1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}: get: summary: >- ConsensusState queries a consensus state associated with a client state @@ -5362,7 +5438,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -5372,13 +5448,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -5400,7 +5479,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -5482,7 +5560,7 @@ paths: RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -5595,7 +5673,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -5605,13 +5683,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -5633,7 +5714,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -5697,7 +5777,6 @@ paths: in: query required: false type: boolean - format: boolean tags: - Query /ibc/core/client/v1/params: @@ -5720,14 +5799,20 @@ paths: type: string description: >- allowed_clients defines the list of allowed client state - types. + types which can be created + + and interacted with. If a client type is removed from the + allowed clients list, usage + + of this client will be disabled until it is added again to + the list. description: >- QueryClientParamsResponse is the response type for the Query/ClientParams RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -5840,7 +5925,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -5850,13 +5935,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -5878,7 +5966,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -6026,7 +6113,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -6036,13 +6123,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -6064,7 +6154,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -6103,7 +6192,7 @@ paths: QueryUpgradedClientStateResponse is the response type for the Query/UpgradedClientState RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -6216,7 +6305,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -6226,13 +6315,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -6254,7 +6346,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -6402,7 +6493,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -6412,13 +6503,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -6440,7 +6534,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -6479,7 +6572,7 @@ paths: QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -6592,7 +6685,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -6602,13 +6695,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -6630,7 +6726,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -6669,7 +6764,7 @@ paths: } tags: - Query - '/ibc/core/connection/v1/client_connections/{client_id}': + /ibc/core/connection/v1/client_connections/{client_id}: get: summary: |- ClientConnections queries the connection paths associated with a client @@ -6723,7 +6818,7 @@ paths: QueryClientConnectionsResponse is the response type for the Query/ClientConnections RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -6836,7 +6931,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -6846,13 +6941,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -6874,7 +6972,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -7080,7 +7177,7 @@ paths: method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -7193,7 +7290,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7203,13 +7300,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -7231,7 +7331,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -7315,7 +7414,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -7326,10 +7424,9 @@ paths: in: query required: false type: boolean - format: boolean tags: - Query - '/ibc/core/connection/v1/connections/{connection_id}': + /ibc/core/connection/v1/connections/{connection_id}: get: summary: Connection queries an IBC connection end. operationId: Connection @@ -7474,7 +7571,7 @@ paths: which the proof was retrieved. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -7587,7 +7684,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7597,13 +7694,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -7625,7 +7725,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -7670,7 +7769,7 @@ paths: type: string tags: - Query - '/ibc/core/connection/v1/connections/{connection_id}/client_state': + /ibc/core/connection/v1/connections/{connection_id}/client_state: get: summary: |- ConnectionClientState queries the client state associated with the @@ -7789,7 +7888,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7799,13 +7898,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -7827,7 +7929,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -7907,7 +8008,7 @@ paths: QueryConnectionClientStateResponse is the response type for the Query/ConnectionClientState RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -8020,7 +8121,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8030,13 +8131,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -8058,7 +8162,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -8103,7 +8206,7 @@ paths: type: string tags: - Query - '/ibc/core/connection/v1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height}': + /ibc/core/connection/v1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height}: get: summary: |- ConnectionConsensusState queries the consensus state associated with the @@ -8214,7 +8317,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8224,13 +8327,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -8252,7 +8358,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -8327,7 +8432,7 @@ paths: QueryConnectionConsensusStateResponse is the response type for the Query/ConnectionConsensusState RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -8440,7 +8545,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8450,13 +8555,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -8478,7 +8586,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -8676,7 +8783,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8686,7 +8793,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -8717,7 +8824,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -8908,7 +9014,7 @@ paths: QueryChannelsResponse is the response type for the Query/Channels RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -9021,7 +9127,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9031,13 +9137,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -9059,7 +9168,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -9143,7 +9251,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -9154,10 +9261,9 @@ paths: in: query required: false type: boolean - format: boolean tags: - Query - '/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}': + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}: get: summary: Channel queries an IBC Channel. operationId: Channel @@ -9283,7 +9389,7 @@ paths: proof was retrieved. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -9396,7 +9502,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9406,13 +9512,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -9434,7 +9543,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -9484,7 +9592,7 @@ paths: type: string tags: - Query - '/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/client_state': + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/client_state: get: summary: >- ChannelClientState queries for the client state for the channel @@ -9605,7 +9713,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9615,13 +9723,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -9643,7 +9754,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -9723,7 +9833,7 @@ paths: QueryChannelClientStateResponse is the Response type for the Query/QueryChannelClientState RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -9836,7 +9946,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9846,13 +9956,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -9874,7 +9987,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -9924,7 +10036,7 @@ paths: type: string tags: - Query - '/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height}': + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height}: get: summary: |- ChannelConsensusState queries for the consensus state for the channel @@ -10035,7 +10147,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -10045,13 +10157,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -10073,7 +10188,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -10148,7 +10262,7 @@ paths: QueryChannelClientStateResponse is the Response type for the Query/QueryChannelClientState RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -10261,7 +10375,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -10271,13 +10385,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -10299,7 +10416,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -10361,7 +10477,7 @@ paths: format: uint64 tags: - Query - '/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/next_sequence': + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/next_sequence: get: summary: >- NextSequenceReceive returns the next receive sequence for a given @@ -10414,7 +10530,7 @@ paths: QuerySequenceResponse is the request type for the Query/QueryNextSequenceReceiveResponse RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -10527,7 +10643,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -10537,13 +10653,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -10565,7 +10684,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -10615,7 +10733,7 @@ paths: type: string tags: - Query - '/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements': + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements: get: summary: >- PacketAcknowledgements returns all the packet acknowledgements @@ -10720,7 +10838,7 @@ paths: QueryPacketAcknowledgemetsResponse is the request type for the Query/QueryPacketAcknowledgements RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -10833,7 +10951,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -10843,13 +10961,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -10871,7 +10992,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -10965,7 +11085,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -10976,7 +11095,6 @@ paths: in: query required: false type: boolean - format: boolean - name: packet_commitment_sequences description: list of packet sequences. in: query @@ -10988,7 +11106,7 @@ paths: collectionFormat: multi tags: - Query - '/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}': + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}: get: summary: PacketAcknowledgement queries a stored packet acknowledgement hash. operationId: PacketAcknowledgement @@ -11043,7 +11161,7 @@ paths: proof was retrieved default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -11156,7 +11274,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -11166,13 +11284,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -11194,7 +11315,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -11250,7 +11370,7 @@ paths: format: uint64 tags: - Query - '/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments': + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments: get: summary: |- PacketCommitments returns all the packet commitments hashes associated @@ -11353,7 +11473,7 @@ paths: QueryPacketCommitmentsResponse is the request type for the Query/QueryPacketCommitments RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -11466,7 +11586,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -11476,13 +11596,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -11504,7 +11627,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -11598,7 +11720,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -11609,10 +11730,9 @@ paths: in: query required: false type: boolean - format: boolean tags: - Query - '/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks': + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks: get: summary: >- UnreceivedAcks returns all the unreceived IBC acknowledgements @@ -11665,7 +11785,7 @@ paths: QueryUnreceivedAcksResponse is the response type for the Query/UnreceivedAcks RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -11778,7 +11898,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -11788,13 +11908,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -11816,7 +11939,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -11876,7 +11998,7 @@ paths: minItems: 1 tags: - Query - '/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets': + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets: get: summary: >- UnreceivedPackets returns all the unreceived IBC packets associated with @@ -11929,7 +12051,7 @@ paths: QueryUnreceivedPacketsResponse is the response type for the Query/UnreceivedPacketCommitments RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -12042,7 +12164,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -12052,13 +12174,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -12080,7 +12205,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -12140,7 +12264,7 @@ paths: minItems: 1 tags: - Query - '/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}': + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}: get: summary: PacketCommitment queries a stored packet commitment hash. operationId: PacketCommitment @@ -12196,7 +12320,7 @@ paths: retrieved default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -12309,7 +12433,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -12319,13 +12443,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -12347,7 +12474,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -12403,7 +12529,7 @@ paths: format: uint64 tags: - Query - '/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}': + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}: get: summary: >- PacketReceipt queries if a given packet sequence has been received on @@ -12419,7 +12545,6 @@ paths: properties: received: type: boolean - format: boolean title: success flag for if receipt exists proof: type: string @@ -12463,7 +12588,7 @@ paths: retrieved default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -12576,7 +12701,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -12586,13 +12711,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -12614,7 +12742,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -12670,7 +12797,7 @@ paths: format: uint64 tags: - Query - '/ibc/core/channel/v1/connections/{connection}/channels': + /ibc/core/channel/v1/connections/{connection}/channels: get: summary: |- ConnectionChannels queries all the channels associated with a connection @@ -12824,7 +12951,7 @@ paths: QueryConnectionChannelsResponse is the Response type for the Query/QueryConnectionChannels RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -12937,7 +13064,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -12947,13 +13074,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -12975,7 +13105,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -13064,7 +13193,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -13075,7 +13203,6 @@ paths: in: query required: false type: boolean - format: boolean tags: - Query definitions: @@ -13106,7 +13233,6 @@ definitions: If left empty it will default to a value to be set by each app. count_total: type: boolean - format: boolean description: >- count_total is set to true to indicate that the result set should include @@ -13119,7 +13245,6 @@ definitions: is set. reverse: type: boolean - format: boolean description: >- reverse is set to true if results are to be returned in the descending order. @@ -13158,6 +13283,18 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + cosmos.base.v1beta1.Coin: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. google.protobuf.Any: type: object properties: @@ -13247,7 +13384,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13257,13 +13394,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -13281,7 +13421,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -13421,7 +13560,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13431,13 +13570,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -13455,7 +13597,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -13510,7 +13651,6 @@ definitions: properties: send_enabled: type: boolean - format: boolean description: >- send_enabled enables or disables all cross-chain token transfers from this @@ -13518,7 +13658,6 @@ definitions: chain. receive_enabled: type: boolean - format: boolean description: >- receive_enabled enables or disables all cross-chain token transfers to this @@ -13632,7 +13771,6 @@ definitions: properties: send_enabled: type: boolean - format: boolean description: >- send_enabled enables or disables all cross-chain token transfers from this @@ -13640,19 +13778,35 @@ definitions: chain. receive_enabled: type: boolean - format: boolean description: >- receive_enabled enables or disables all cross-chain token transfers to this chain. description: QueryParamsResponse is the response type for the Query/Params RPC method. + ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse: + type: object + properties: + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: >- + QueryTotalEscrowForDenomResponse is the response type for + TotalEscrowForDenom RPC method. ibc.applications.interchain_accounts.controller.v1.Params: type: object properties: controller_enabled: type: boolean - format: boolean description: controller_enabled enables or disables the controller submodule. description: |- Params defines the set of on-chain interchain accounts parameters. @@ -13674,7 +13828,6 @@ definitions: properties: controller_enabled: type: boolean - format: boolean description: controller_enabled enables or disables the controller submodule. description: QueryParamsResponse is the response type for the Query/Params RPC method. ibc.applications.interchain_accounts.host.v1.Params: @@ -13682,7 +13835,6 @@ definitions: properties: host_enabled: type: boolean - format: boolean description: host_enabled enables or disables the host submodule. allow_messages: type: array @@ -13703,7 +13855,6 @@ definitions: properties: host_enabled: type: boolean - format: boolean description: host_enabled enables or disables the host submodule. allow_messages: type: array @@ -13713,18 +13864,6 @@ definitions: allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. description: QueryParamsResponse is the response type for the Query/Params RPC method. - cosmos.base.v1beta1.Coin: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. ibc.applications.fee.v1.Fee: type: object properties: @@ -13773,7 +13912,7 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. title: the packet timeout fee - title: 'Fee defines the ICS29 receive, acknowledgement and timeout fees' + title: Fee defines the ICS29 receive, acknowledgement and timeout fees ibc.applications.fee.v1.FeeEnabledChannel: type: object properties: @@ -13973,7 +14112,6 @@ definitions: properties: fee_enabled: type: boolean - format: boolean title: boolean flag representing the fee enabled channel status title: >- QueryFeeEnabledChannelResponse defines the response type for the @@ -14540,7 +14678,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14550,13 +14688,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -14574,7 +14715,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -14737,7 +14877,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14747,13 +14887,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -14771,7 +14914,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -14813,7 +14955,14 @@ definitions: type: array items: type: string - description: allowed_clients defines the list of allowed client state types. + description: >- + allowed_clients defines the list of allowed client state types which + can be created + + and interacted with. If a client type is removed from the allowed + clients list, usage + + of this client will be disabled until it is added again to the list. description: Params defines the set of IBC light client parameters. ibc.core.client.v1.QueryClientParamsResponse: type: object @@ -14826,7 +14975,15 @@ definitions: type: array items: type: string - description: allowed_clients defines the list of allowed client state types. + description: >- + allowed_clients defines the list of allowed client state types + which can be created + + and interacted with. If a client type is removed from the allowed + clients list, usage + + of this client will be disabled until it is added again to the + list. description: >- QueryClientParamsResponse is the response type for the Query/ClientParams RPC @@ -14928,7 +15085,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14938,13 +15095,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -14962,7 +15122,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -15145,7 +15304,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15155,13 +15314,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -15182,7 +15344,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -15430,7 +15591,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15440,13 +15601,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -15464,7 +15628,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -15678,7 +15841,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15688,13 +15851,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -15715,7 +15881,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -15881,7 +16046,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15891,13 +16056,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -15915,7 +16083,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -16047,7 +16214,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -16057,13 +16224,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -16081,7 +16251,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -16491,7 +16660,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -16501,13 +16670,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -16526,7 +16698,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -16694,7 +16865,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -16704,13 +16875,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -16728,7 +16902,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -17188,7 +17361,7 @@ definitions: this channel will travel version: type: string - title: 'opaque channel version, which is agreed upon during the handshake' + title: opaque channel version, which is agreed upon during the handshake description: |- Channel defines pipeline for exactly-once packet delivery between specific modules on separate blockchains, which has at least one end capable of @@ -17263,7 +17436,7 @@ definitions: this channel will travel version: type: string - title: 'opaque channel version, which is agreed upon during the handshake' + title: opaque channel version, which is agreed upon during the handshake port_id: type: string title: port identifier @@ -17415,7 +17588,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -17425,13 +17598,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -17450,7 +17626,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -17618,7 +17793,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -17628,13 +17803,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -17652,7 +17830,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -17787,7 +17964,7 @@ definitions: this channel will travel version: type: string - title: 'opaque channel version, which is agreed upon during the handshake' + title: opaque channel version, which is agreed upon during the handshake description: >- Channel defines pipeline for exactly-once packet delivery between specific @@ -18420,7 +18597,6 @@ definitions: properties: received: type: boolean - format: boolean title: success flag for if receipt exists proof: type: string diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index bd24127c..2bf77515 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -13217,10 +13217,420 @@ paths: format: byte tags: - Community + /cosmos/auth/v1beta1/account_info/{address}: + get: + summary: AccountInfo queries account info which is common to all account types. + description: 'Since: cosmos-sdk 0.47' + operationId: AccountInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + info: + description: info is the account info which is represented by BaseAccount. + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the + above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + account_number: + type: string + format: uint64 + sequence: + type: string + format: uint64 + description: |- + QueryAccountInfoResponse is the Query/AccountInfo response type. + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: address + description: address is the account address string. + in: path + required: true + type: string + tags: + - Cosmos SDK /cosmos/auth/v1beta1/accounts: get: - summary: Accounts returns all the existing accounts - description: 'Since: cosmos-sdk 0.43' + summary: Accounts returns all the existing accounts. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.43 operationId: Accounts responses: '200': @@ -13330,7 +13740,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13340,13 +13750,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -13368,7 +13781,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -13545,7 +13957,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13555,13 +13967,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -13583,7 +13998,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -13788,7 +14202,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13798,13 +14212,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -13826,7 +14243,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -13977,7 +14393,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13987,13 +14403,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -14015,7 +14434,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -14191,7 +14609,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14201,13 +14619,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -14229,7 +14650,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -14269,6 +14689,8 @@ paths: parameters: - name: id description: |- + Deprecated, use account_id instead + id is the account number of the address to be queried. This field should have been an uint64 (like all account numbers), and will be updated to uint64 in a future version of the auth query. @@ -14276,6 +14698,15 @@ paths: required: true type: string format: int64 + - name: account_id + description: |- + account_id is the account number of the address to be queried. + + Since: cosmos-sdk 0.47 + in: query + required: false + type: string + format: uint64 tags: - Cosmos SDK /cosmos/auth/v1beta1/bech32: @@ -14411,7 +14842,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14421,13 +14852,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -14449,7 +14883,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -14621,7 +15054,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14631,13 +15064,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -14659,7 +15095,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -14838,7 +15273,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14848,13 +15283,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -14876,7 +15314,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -15033,7 +15470,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15043,13 +15480,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -15071,7 +15511,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -15228,7 +15667,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15238,13 +15677,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -15266,7 +15708,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -15414,7 +15855,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15424,13 +15865,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -15452,7 +15896,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -15603,7 +16046,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15613,13 +16056,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -15641,7 +16087,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -15831,7 +16276,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15841,13 +16286,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -15869,7 +16317,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -15911,6 +16358,11 @@ paths: /cosmos/bank/v1beta1/balances/{address}: get: summary: AllBalances queries the balance of all coins for a single account. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: AllBalances responses: '200': @@ -16116,7 +16568,14 @@ paths: token denomination. - description: 'Since: cosmos-sdk 0.46' + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.46 operationId: DenomOwners responses: '200': @@ -16645,6 +17104,18 @@ paths: (whether a denom is sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. + + For genesis, use the newly added send_enabled field in the + genesis object. + + Storage, lookup, and manipulation of this information is + now in the keeper. + + + As of cosmos-sdk 0.47, this only exists for backwards + compatibility of genesis files. default_send_enabled: type: boolean description: Params defines the parameters for the bank module. @@ -16675,12 +17146,176 @@ paths: format: byte tags: - Cosmos SDK + /cosmos/bank/v1beta1/send_enabled: + get: + summary: SendEnabled queries for SendEnabled entries. + description: >- + This query only returns denominations that have specific SendEnabled + settings. + + Any denomination that does not have a specific setting will use the + default + + params.default_send_enabled, and will not be returned by this query. + + + Since: cosmos-sdk 0.47 + operationId: SendEnabled + responses: + '200': + description: A successful response. + schema: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status + (whether a denom is + + sendable). + pagination: + description: >- + pagination defines the pagination in the response. This field + is only + + populated if the denoms field in the request is empty. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QuerySendEnabledResponse defines the RPC response of a SendEnable + query. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: denoms + description: >- + denoms is the specific denoms you want look up. Leave empty to get + all entries. + in: query + required: false + type: array + items: + type: string + collectionFormat: multi + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Cosmos SDK /cosmos/bank/v1beta1/spendable_balances/{address}: get: - summary: |- - SpendableBalances queries the spenable balance of all coins for a single + summary: >- + SpendableBalances queries the spendable balance of all coins for a + single + account. - description: 'Since: cosmos-sdk 0.46' + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.46 operationId: SpendableBalances responses: '200': @@ -16819,9 +17454,94 @@ paths: type: boolean tags: - Cosmos SDK + /cosmos/bank/v1beta1/spendable_balances/{address}/by_denom: + get: + summary: >- + SpendableBalanceByDenom queries the spendable balance of a single denom + for + + a single account. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.47 + operationId: SpendableBalanceByDenom + responses: + '200': + description: A successful response. + schema: + type: object + properties: + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + QuerySpendableBalanceByDenomResponse defines the gRPC response + structure for + + querying an account's spendable balance for a specific denom. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: address + description: address is the address to query balances for. + in: path + required: true + type: string + - name: denom + description: denom is the coin denom to query balances for. + in: query + required: false + type: string + tags: + - Cosmos SDK /cosmos/bank/v1beta1/supply: get: summary: TotalSupply queries the total supply of all coins. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: TotalSupply responses: '200': @@ -16958,6 +17678,11 @@ paths: /cosmos/bank/v1beta1/supply/by_denom: get: summary: SupplyOf queries the supply of a single coin. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: SupplyOf responses: '200': @@ -17017,11 +17742,12 @@ paths: get: summary: >- ABCIQuery defines a query handler that supports ABCI queries directly to + the - the application, bypassing Tendermint completely. The ABCI query must + application, bypassing Tendermint completely. The ABCI query must + contain - contain a valid and supported path, including app, custom, p2p, and - store. + a valid and supported path, including app, custom, p2p, and store. description: 'Since: cosmos-sdk 0.46' operationId: ABCIQuery responses: @@ -17066,24 +17792,20 @@ paths: ProofOp defines an operation used for calculating Merkle root. The data could - be arbitrary format, providing nessecary data for + be arbitrary format, providing necessary data for example neighbouring node hash. Note: This type is a duplicate of the ProofOp proto type - defined in - - Tendermint. + defined in Tendermint. description: >- ProofOps is Merkle proof defined by the list of ProofOps. Note: This type is a duplicate of the ProofOps proto type - defined in - - Tendermint. + defined in Tendermint. height: type: string format: int64 @@ -17091,9 +17813,7 @@ paths: type: string description: >- ABCIQueryResponse defines the response structure for the ABCIQuery - gRPC - - query. + gRPC query. Note: This type is a duplicate of the ResponseQuery proto type @@ -17214,7 +17934,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -17224,13 +17944,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -17252,7 +17975,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -18427,9 +19149,7 @@ paths: field converted to bech32 string. description: >- GetLatestBlockResponse is the response type for the - Query/GetLatestBlock RPC - - method. + Query/GetLatestBlock RPC method. default: description: An unexpected error response. schema: @@ -18544,7 +19264,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -18554,13 +19274,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -18582,7 +19305,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -19738,9 +20460,7 @@ paths: field converted to bech32 string. description: >- GetBlockByHeightResponse is the response type for the - Query/GetBlockByHeight - - RPC method. + Query/GetBlockByHeight RPC method. default: description: An unexpected error response. schema: @@ -19855,7 +20575,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -19865,13 +20585,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -19893,7 +20616,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -20019,9 +20741,7 @@ paths: description: VersionInfo is the type for the GetNodeInfoResponse message. description: >- GetNodeInfoResponse is the response type for the Query/GetNodeInfo - RPC - - method. + RPC method. default: description: An unexpected error response. schema: @@ -20136,7 +20856,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -20146,13 +20866,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -20174,7 +20897,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -20342,7 +21064,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -20352,13 +21074,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -20380,7 +21105,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -20539,7 +21263,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -20549,13 +21273,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -20577,7 +21304,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -20642,7 +21368,7 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - description: |- + description: >- GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. default: @@ -20759,7 +21485,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -20769,13 +21495,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -20797,7 +21526,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -21013,7 +21741,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -21023,13 +21751,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -21051,7 +21782,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -21116,7 +21846,7 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - description: |- + description: >- GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. default: @@ -21233,7 +21963,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -21243,13 +21973,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -21271,7 +22004,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -21704,8 +22436,18 @@ paths: type: string base_proposer_reward: type: string + description: >- + Deprecated: The base_proposer_reward field is deprecated + and is no longer used + + in the x/distribution module's reward mechanism. bonus_proposer_reward: type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated + and is no longer used + + in the x/distribution module's reward mechanism. withdraw_addr_enabled: type: boolean description: >- @@ -21735,6 +22477,92 @@ paths: format: byte tags: - Cosmos SDK + /cosmos/distribution/v1beta1/validators/{validator_address}: + get: + summary: >- + ValidatorDistributionInfo queries validator commission and + self-delegation rewards for validator + operationId: ValidatorDistributionInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + operator_address: + type: string + description: operator_address defines the validator operator address. + self_bond_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: self_bond_rewards defines the self delegations rewards. + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: commission defines the commission the validator received. + description: >- + QueryValidatorDistributionInfoResponse is the response type for + the Query/ValidatorDistributionInfo RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + tags: + - Cosmos SDK /cosmos/distribution/v1beta1/validators/{validator_address}/commission: get: summary: ValidatorCommission queries accumulated commission for a validator. @@ -21746,7 +22574,7 @@ paths: type: object properties: commission: - description: commission defines the commision the validator received. + description: commission defines the commission the validator received. type: object properties: commission: @@ -22139,7 +22967,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -22149,13 +22977,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -22177,7 +23008,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -22353,7 +23183,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -22363,13 +23193,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -22391,7 +23224,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -22487,7 +23319,7 @@ paths: type: boolean tags: - Cosmos SDK - /cosmos/evidence/v1beta1/evidence/{evidence_hash}: + /cosmos/evidence/v1beta1/evidence/{hash}: get: summary: Evidence queries evidence based on evidence hash. operationId: Evidence @@ -22596,7 +23428,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -22606,13 +23438,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -22634,7 +23469,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -22785,7 +23619,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -22795,13 +23629,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -22823,7 +23660,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -22861,11 +23697,21 @@ paths: "value": "1.212s" } parameters: - - name: evidence_hash - description: evidence_hash defines the hash of the requested evidence. + - name: hash + description: |- + hash defines the evidence hash of the requested evidence. + + Since: cosmos-sdk 0.47 in: path required: true type: string + - name: evidence_hash + description: |- + evidence_hash defines the hash of the requested evidence. + Deprecated: Use hash, a HEX encoded string, instead. + in: query + required: false + type: string format: byte tags: - Cosmos SDK @@ -22885,7 +23731,7 @@ paths: properties: voting_period: type: string - description: Length of the voting period. + description: Duration of the voting period. deposit_params: description: deposit_params defines the parameters related to deposit. type: object @@ -22913,7 +23759,8 @@ paths: description: >- Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - months. + + months. tally_params: description: tally_params defines the parameters related to tally. type: object @@ -22924,7 +23771,8 @@ paths: description: >- Minimum percentage of total stake needed to vote for a result to be - considered valid. + + considered valid. threshold: type: string format: byte @@ -22937,7 +23785,8 @@ paths: description: >- Minimum value of Veto votes to Total votes ratio for proposal to be - vetoed. Default value: 1/3. + + vetoed. Default value: 1/3. description: >- QueryParamsResponse is the response type for the Query/Params RPC method. @@ -23055,7 +23904,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23065,13 +23914,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -23093,7 +23945,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -23160,6 +24011,7 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. content: type: object properties: @@ -23260,7 +24112,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23270,13 +24122,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -23298,7 +24153,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -23338,6 +24192,7 @@ paths: "value": "1.212s" } status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -23347,21 +24202,6 @@ paths: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: >- - ProposalStatus enumerates the valid statuses of a - proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the @@ -23375,18 +24215,28 @@ paths: properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: >- + abstain is the number of abstain votes on a + proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: >- + no_with_veto is the number of no with veto votes on + a proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -23405,15 +24255,21 @@ paths: custom method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. description: >- Proposal defines the core field members of a governance proposal. + description: proposals defines all the requested governance proposals. pagination: description: pagination defines the pagination in the response. type: object @@ -23552,7 +24408,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23562,13 +24418,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -23590,7 +24449,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -23738,6 +24596,7 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. content: type: object properties: @@ -23838,7 +24697,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23848,13 +24707,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -23876,7 +24738,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -23914,6 +24775,7 @@ paths: "value": "1.212s" } status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -23923,21 +24785,6 @@ paths: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: >- - ProposalStatus enumerates the valid statuses of a - proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the @@ -23951,18 +24798,26 @@ paths: properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: abstain is the number of abstain votes on a proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -23980,12 +24835,17 @@ paths: custom method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. description: >- Proposal defines the core field members of a governance proposal. @@ -24106,7 +24966,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -24116,13 +24976,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -24144,7 +25007,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -24208,8 +25070,12 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: >- + depositor defines the deposit addresses from the + proposals. amount: type: array items: @@ -24228,11 +25094,13 @@ paths: custom method signatures required by gogoproto. + description: amount to be deposited by depositor. description: >- Deposit defines an amount deposited by an account address to an active proposal. + description: deposits defines the requested deposits. pagination: description: pagination defines the pagination in the response. type: object @@ -24369,7 +25237,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -24379,13 +25247,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -24407,7 +25278,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -24527,8 +25397,12 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: >- + depositor defines the deposit addresses from the + proposals. amount: type: array items: @@ -24546,6 +25420,7 @@ paths: custom method signatures required by gogoproto. + description: amount to be deposited by depositor. description: >- Deposit defines an amount deposited by an account address to an active @@ -24668,7 +25543,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -24678,13 +25553,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -24706,7 +25584,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -24773,12 +25650,18 @@ paths: properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: abstain is the number of abstain votes on a proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. description: >- QueryTallyResultResponse is the response type for the Query/Tally RPC method. @@ -24896,7 +25779,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -24906,13 +25789,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -24934,7 +25820,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -24998,8 +25883,10 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. option: description: >- Deprecated: Prefer to use `options` instead. This field @@ -25024,6 +25911,9 @@ paths: type: object properties: option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -25032,30 +25922,27 @@ paths: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a - given governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: >- + weight is the vote weight associated with the vote + option. description: >- WeightedVoteOption defines a unit of vote for vote split. Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 description: >- Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option. - description: votes defined the queried votes. + description: votes defines the queried votes. pagination: description: pagination defines the pagination in the response. type: object @@ -25192,7 +26079,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -25202,13 +26089,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -25230,7 +26120,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -25348,8 +26237,10 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. option: description: >- Deprecated: Prefer to use `options` instead. This field is @@ -25374,6 +26265,9 @@ paths: type: object properties: option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -25382,24 +26276,21 @@ paths: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a - given governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: >- + weight is the vote weight associated with the vote + option. description: >- WeightedVoteOption defines a unit of vote for vote split. Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 description: >- Vote defines a vote on a governance proposal. @@ -25522,7 +26413,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -25532,13 +26423,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -25560,7 +26454,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -25622,14 +26515,18 @@ paths: type: object properties: voting_params: - description: voting_params defines the parameters related to voting. + description: |- + Deprecated: Prefer to use `params` instead. + voting_params defines the parameters related to voting. type: object properties: voting_period: type: string - description: Length of the voting period. + description: Duration of the voting period. deposit_params: - description: deposit_params defines the parameters related to deposit. + description: |- + Deprecated: Prefer to use `params` instead. + deposit_params defines the parameters related to deposit. type: object properties: min_deposit: @@ -25655,11 +26552,68 @@ paths: description: >- Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - months. + + months. tally_params: - description: tally_params defines the parameters related to tally. + description: |- + Deprecated: Prefer to use `params` instead. + tally_params defines the parameters related to tally. type: object properties: + quorum: + type: string + description: >- + Minimum percentage of total stake needed to vote for a + result to be + + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. + Default value: 0.5. + veto_threshold: + type: string + description: >- + Minimum value of Veto votes to Total votes ratio for + proposal to be + + vetoed. Default value: 1/3. + params: + description: |- + params defines all the paramaters of x/gov module. + + Since: cosmos-sdk 0.47 + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. + Initial value: 2 + + months. + voting_period: + type: string + description: Duration of the voting period. quorum: type: string description: >- @@ -25677,6 +26631,11 @@ paths: Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Default value: 1/3. + min_initial_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value + that must be paid at proposal submission. description: >- QueryParamsResponse is the response type for the Query/Params RPC method. @@ -25794,7 +26753,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -25804,13 +26763,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -25832,7 +26794,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -25899,6 +26860,7 @@ paths: id: type: string format: uint64 + description: id defines the unique id of the proposal. messages: type: array items: @@ -26001,7 +26963,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -26011,13 +26973,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -26039,7 +27004,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -26078,7 +27042,11 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + description: >- + messages are the arbitrary messages to be executed if + the proposal passes. status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -26088,21 +27056,6 @@ paths: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: >- - ProposalStatus enumerates the valid statuses of a - proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the @@ -26116,18 +27069,28 @@ paths: properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: >- + abstain_count is the number of abstain votes on a + proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: >- + no_with_veto_count is the number of no with veto + votes on a proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -26146,20 +27109,38 @@ paths: custom method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. metadata: type: string description: >- metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter description: >- Proposal defines the core field members of a governance proposal. + description: proposals defines all the requested governance proposals. pagination: description: pagination defines the pagination in the response. type: object @@ -26298,7 +27279,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -26308,13 +27289,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -26336,7 +27320,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -26484,6 +27467,7 @@ paths: id: type: string format: uint64 + description: id defines the unique id of the proposal. messages: type: array items: @@ -26586,7 +27570,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -26596,13 +27580,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -26624,7 +27611,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -26663,7 +27649,11 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + description: >- + messages are the arbitrary messages to be executed if the + proposal passes. status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -26673,21 +27663,6 @@ paths: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: >- - ProposalStatus enumerates the valid statuses of a - proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the @@ -26701,18 +27676,28 @@ paths: properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: >- + abstain_count is the number of abstain votes on a + proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: >- + no_with_veto_count is the number of no with veto votes + on a proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -26730,17 +27715,34 @@ paths: custom method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. metadata: type: string description: >- metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter description: >- Proposal defines the core field members of a governance proposal. @@ -26861,7 +27863,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -26871,13 +27873,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -26899,7 +27904,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -26963,8 +27967,12 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: >- + depositor defines the deposit addresses from the + proposals. amount: type: array items: @@ -26983,11 +27991,13 @@ paths: custom method signatures required by gogoproto. + description: amount to be deposited by depositor. description: >- Deposit defines an amount deposited by an account address to an active proposal. + description: deposits defines the requested deposits. pagination: description: pagination defines the pagination in the response. type: object @@ -27124,7 +28134,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -27134,13 +28144,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -27162,7 +28175,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -27282,8 +28294,12 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: >- + depositor defines the deposit addresses from the + proposals. amount: type: array items: @@ -27301,6 +28317,7 @@ paths: custom method signatures required by gogoproto. + description: amount to be deposited by depositor. description: >- Deposit defines an amount deposited by an account address to an active @@ -27423,7 +28440,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -27433,13 +28450,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -27461,7 +28481,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -27528,12 +28547,20 @@ paths: properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: >- + abstain_count is the number of abstain votes on a + proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: >- + no_with_veto_count is the number of no with veto votes on + a proposal. description: >- QueryTallyResultResponse is the response type for the Query/Tally RPC method. @@ -27651,7 +28678,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -27661,13 +28688,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -27689,7 +28719,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -27753,14 +28782,19 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. options: type: array items: type: object properties: option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -27769,20 +28803,15 @@ paths: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a - given governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: >- + weight is the vote weight associated with the vote + option. description: >- WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. metadata: type: string description: >- @@ -27793,7 +28822,7 @@ paths: A Vote consists of a proposal ID, the voter, and the vote option. - description: votes defined the queried votes. + description: votes defines the queried votes. pagination: description: pagination defines the pagination in the response. type: object @@ -27930,7 +28959,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -27940,13 +28969,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -27968,7 +29000,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -28086,14 +29117,19 @@ paths: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. options: type: array items: type: object properties: option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -28102,20 +29138,15 @@ paths: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a - given governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: >- + weight is the vote weight associated with the vote + option. description: >- WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. metadata: type: string description: >- @@ -28243,7 +29274,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -28253,13 +29284,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -28281,7 +29315,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -28939,6 +29972,11 @@ paths: summary: >- DelegatorDelegations queries all delegations of a given delegator address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: DelegatorDelegations responses: '200': @@ -29135,7 +30173,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -29145,13 +30183,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -29173,7 +30214,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -29277,6 +30317,11 @@ paths: /cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations: get: summary: Redelegations queries redelegations of given address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: Redelegations responses: '200': @@ -29335,6 +30380,18 @@ paths: shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding + has been stopped by external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -29376,6 +30433,18 @@ paths: shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding + has been stopped by external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -29535,7 +30604,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -29545,13 +30614,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -29573,7 +30645,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -29691,6 +30762,11 @@ paths: given delegator address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: DelegatorUnbondingDelegations responses: '200': @@ -29740,6 +30816,18 @@ paths: description: >- balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has + been stopped by external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -29887,7 +30975,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -29897,13 +30985,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -29925,7 +31016,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -30031,6 +31121,11 @@ paths: summary: |- DelegatorValidators queries all validators info for given delegator address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: StakingDelegatorValidators responses: '200': @@ -30148,7 +31243,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -30158,13 +31253,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -30186,7 +31284,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -30330,6 +31427,20 @@ paths: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator description: >- Validator defines a validator, together with the total amount of the @@ -30490,7 +31601,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -30500,13 +31611,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -30528,7 +31642,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -30749,7 +31862,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -30759,13 +31872,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -30787,7 +31903,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -30928,6 +32043,20 @@ paths: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator description: >- Validator defines a validator, together with the total amount of the @@ -31068,7 +32197,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -31078,13 +32207,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -31106,7 +32238,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -31358,7 +32489,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -31368,13 +32499,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -31396,7 +32530,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -31541,6 +32674,20 @@ paths: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has + been stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator description: >- Validator defines a validator, together with the total amount of the @@ -31683,7 +32830,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -31693,13 +32840,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -31721,7 +32871,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -31925,7 +33074,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -31935,13 +33084,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -31963,7 +33115,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -32135,7 +33286,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -32145,13 +33296,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -32173,7 +33327,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -32215,6 +33368,11 @@ paths: /cosmos/staking/v1beta1/validators: get: summary: Validators queries all validators that match the given status. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: Validators responses: '200': @@ -32332,7 +33490,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -32342,13 +33500,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -32370,7 +33531,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -32514,6 +33674,20 @@ paths: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator description: >- Validator defines a validator, together with the total amount of the @@ -32674,7 +33848,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -32684,13 +33858,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -32712,7 +33889,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -32931,7 +34107,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -32941,13 +34117,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -32969,7 +34148,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -33110,6 +34288,20 @@ paths: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator description: >- Validator defines a validator, together with the total amount of the @@ -33250,7 +34442,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -33260,13 +34452,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -33288,7 +34483,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -33336,6 +34530,11 @@ paths: /cosmos/staking/v1beta1/validators/{validator_addr}/delegations: get: summary: ValidatorDelegations queries delegate info for given validator. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: ValidatorDelegations responses: '200': @@ -33529,7 +34728,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -33539,13 +34738,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -33567,7 +34769,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -33843,7 +35044,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -33853,13 +35054,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -33881,7 +35085,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -33981,6 +35184,16 @@ paths: balance: type: string description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -34109,7 +35322,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -34119,13 +35332,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -34147,7 +35363,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -34202,6 +35417,11 @@ paths: summary: >- ValidatorUnbondingDelegations queries unbonding delegations of a validator. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. operationId: ValidatorUnbondingDelegations responses: '200': @@ -34251,6 +35471,18 @@ paths: description: >- balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has + been stopped by external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -34398,7 +35630,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -34408,13 +35640,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -34436,7 +35671,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -34537,6 +35771,908 @@ paths: type: boolean tags: - Cosmos SDK + /cosmos/tx/v1beta1/decode: + post: + summary: TxDecode decodes the transaction. + description: 'Since: cosmos-sdk 0.47' + operationId: TxDecode + responses: + '200': + description: A successful response. + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.TxDecodeResponse' + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + in: body + required: true + schema: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + description: |- + TxDecodeRequest is the request type for the Service.TxDecode + RPC method. + + Since: cosmos-sdk 0.47 + tags: + - Service + /cosmos/tx/v1beta1/decode/amino: + post: + summary: TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + description: 'Since: cosmos-sdk 0.47' + operationId: TxDecodeAmino + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amino_json: + type: string + description: >- + TxDecodeAminoResponse is the response type for the + Service.TxDecodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + in: body + required: true + schema: + type: object + properties: + amino_binary: + type: string + format: byte + description: >- + TxDecodeAminoRequest is the request type for the + Service.TxDecodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + tags: + - Service + /cosmos/tx/v1beta1/encode: + post: + summary: TxEncode encodes the transaction. + description: 'Since: cosmos-sdk 0.47' + operationId: TxEncode + responses: + '200': + description: A successful response. + schema: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the encoded transaction bytes. + description: |- + TxEncodeResponse is the response type for the + Service.TxEncode method. + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + in: body + required: true + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.TxEncodeRequest' + tags: + - Service + /cosmos/tx/v1beta1/encode/amino: + post: + summary: TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + description: 'Since: cosmos-sdk 0.47' + operationId: TxEncodeAmino + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amino_binary: + type: string + format: byte + description: >- + TxEncodeAminoResponse is the response type for the + Service.TxEncodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + in: body + required: true + schema: + type: object + properties: + amino_json: + type: string + description: >- + TxEncodeAminoRequest is the request type for the + Service.TxEncodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + tags: + - Service /cosmos/tx/v1beta1/simulate: post: summary: Simulate simulates executing a transaction for estimating gas usage. @@ -34598,10 +36734,8 @@ paths: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -34722,7 +36856,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -34732,13 +36866,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -34760,7 +36897,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -34922,7 +37058,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -34932,13 +37068,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -34960,7 +37099,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -35128,7 +37266,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -35138,13 +37276,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -35166,7 +37307,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -35496,7 +37636,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -35506,13 +37646,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -35534,7 +37677,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -35595,10 +37737,8 @@ paths: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -35749,7 +37889,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -35759,13 +37899,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -35787,7 +37930,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -35848,8 +37990,9 @@ paths: TxService.Broadcast RPC method. - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - - BROADCAST_MODE_BLOCK: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - the tx to be committed in a block. + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x + onwards. - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for a CheckTx execution response only. - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns @@ -35985,7 +38128,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -35995,13 +38138,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -36023,7 +38169,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -36248,7 +38393,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -36258,13 +38403,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -36286,7 +38434,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -36464,7 +38611,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -36474,13 +38621,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -36502,7 +38652,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -36676,7 +38825,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -36686,13 +38835,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -36714,7 +38866,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -36802,9 +38953,7 @@ paths: height: type: string format: int64 - description: |- - The height at which the upgrade must be performed. - Only used if Time is not set. + description: The height at which the upgrade must be performed. info: type: string title: >- @@ -36913,7 +39062,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -36923,13 +39072,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -36951,7 +39103,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -37107,7 +39258,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -37117,13 +39268,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -37145,7 +39299,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -37336,7 +39489,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -37346,13 +39499,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -37374,7 +39530,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -37566,7 +39721,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -37576,13 +39731,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -37604,7 +39762,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -37767,7 +39924,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -37777,13 +39934,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -37805,7 +39965,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -37997,7 +40156,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -38007,13 +40166,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -38035,7 +40197,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -38266,7 +40427,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -38276,13 +40437,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -38304,7 +40468,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -38488,7 +40651,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -38498,13 +40661,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -38526,7 +40692,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -38746,7 +40911,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -38756,13 +40921,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -38784,7 +40952,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -38968,7 +41135,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -38978,13 +41145,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -39006,7 +41176,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -39125,7 +41294,7 @@ paths: QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -39178,7 +41347,7 @@ paths: method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -39263,7 +41432,7 @@ paths: method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -39331,7 +41500,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -39342,7 +41510,6 @@ paths: in: query required: false type: boolean - format: boolean tags: - IBC /ibc/apps/transfer/v1/denom_traces/{hash}: @@ -39379,7 +41546,7 @@ paths: method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -39410,6 +41577,65 @@ paths: type: string tags: - IBC + /ibc/apps/transfer/v1/denoms/{denom}/total_escrow: + get: + summary: >- + TotalEscrowForDenom returns the total amount of tokens in escrow based + on the denom. + operationId: IbcTotalEscrowForDenom + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + QueryTotalEscrowForDenomResponse is the response type for + TotalEscrowForDenom RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: denom + in: path + required: true + type: string + tags: + - IBC /ibc/apps/transfer/v1/params: get: summary: Params queries all parameters of the ibc-transfer module. @@ -39426,7 +41652,6 @@ paths: properties: send_enabled: type: boolean - format: boolean description: >- send_enabled enables or disables all cross-chain token transfers from this @@ -39434,7 +41659,6 @@ paths: chain. receive_enabled: type: boolean - format: boolean description: >- receive_enabled enables or disables all cross-chain token transfers to this @@ -39444,7 +41668,7 @@ paths: QueryParamsResponse is the response type for the Query/Params RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -39586,7 +41810,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -39596,13 +41820,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -39624,7 +41851,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -39704,7 +41930,7 @@ paths: method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -39817,7 +42043,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -39827,13 +42053,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -39855,7 +42084,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -39939,7 +42167,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -39950,7 +42177,6 @@ paths: in: query required: false type: boolean - format: boolean tags: - IBC /ibc/core/client/v1/client_states/{client_id}: @@ -40062,7 +42288,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -40072,13 +42298,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -40100,7 +42329,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -40177,7 +42405,7 @@ paths: which the proof was retrieved. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -40290,7 +42518,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -40300,13 +42528,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -40328,7 +42559,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -40391,7 +42621,7 @@ paths: method. It returns the current status of the IBC client. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -40504,7 +42734,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -40514,13 +42744,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -40542,7 +42775,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -40733,7 +42965,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -40743,13 +42975,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -40771,7 +43006,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -40850,7 +43084,7 @@ paths: QueryConsensusStatesResponse is the response type for the Query/ConsensusStates RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -40963,7 +43197,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -40973,13 +43207,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -41001,7 +43238,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -41090,7 +43326,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -41101,7 +43336,6 @@ paths: in: query required: false type: boolean - format: boolean tags: - IBC /ibc/core/client/v1/consensus_states/{client_id}/heights: @@ -41187,7 +43421,7 @@ paths: QueryConsensusStateHeightsResponse is the response type for the Query/ConsensusStateHeights RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -41300,7 +43534,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -41310,13 +43544,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -41338,7 +43575,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -41427,7 +43663,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -41438,7 +43673,6 @@ paths: in: query required: false type: boolean - format: boolean tags: - IBC /ibc/core/client/v1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}: @@ -41554,7 +43788,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -41564,13 +43798,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -41592,7 +43829,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -41674,7 +43910,7 @@ paths: RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -41787,7 +44023,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -41797,13 +44033,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -41825,7 +44064,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -41889,7 +44127,6 @@ paths: in: query required: false type: boolean - format: boolean tags: - IBC /ibc/core/client/v1/params: @@ -41912,14 +44149,20 @@ paths: type: string description: >- allowed_clients defines the list of allowed client state - types. + types which can be created + + and interacted with. If a client type is removed from the + allowed clients list, usage + + of this client will be disabled until it is added again to + the list. description: >- QueryClientParamsResponse is the response type for the Query/ClientParams RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -42032,7 +44275,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -42042,13 +44285,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -42070,7 +44316,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -42218,7 +44463,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -42228,13 +44473,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -42256,7 +44504,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -42295,7 +44542,7 @@ paths: QueryUpgradedClientStateResponse is the response type for the Query/UpgradedClientState RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -42408,7 +44655,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -42418,13 +44665,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -42446,7 +44696,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -42594,7 +44843,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -42604,13 +44853,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -42632,7 +44884,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -42671,7 +44922,7 @@ paths: QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -42784,7 +45035,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -42794,13 +45045,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -42822,7 +45076,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -42915,7 +45168,7 @@ paths: QueryClientConnectionsResponse is the response type for the Query/ClientConnections RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -43028,7 +45281,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -43038,13 +45291,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -43066,7 +45322,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -43272,7 +45527,7 @@ paths: method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -43385,7 +45640,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -43395,13 +45650,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -43423,7 +45681,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -43507,7 +45764,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -43518,7 +45774,6 @@ paths: in: query required: false type: boolean - format: boolean tags: - IBC /ibc/core/connection/v1/connections/{connection_id}: @@ -43666,7 +45921,7 @@ paths: which the proof was retrieved. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -43779,7 +46034,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -43789,13 +46044,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -43817,7 +46075,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -43981,7 +46238,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -43991,13 +46248,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -44019,7 +46279,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -44099,7 +46358,7 @@ paths: QueryConnectionClientStateResponse is the response type for the Query/ConnectionClientState RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -44212,7 +46471,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -44222,13 +46481,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -44250,7 +46512,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -44406,7 +46667,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -44416,13 +46677,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -44444,7 +46708,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -44519,7 +46782,7 @@ paths: QueryConnectionConsensusStateResponse is the response type for the Query/ConnectionConsensusState RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -44632,7 +46895,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -44642,13 +46905,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -44670,7 +46936,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -44868,7 +47133,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -44878,7 +47143,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -44909,7 +47174,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -45100,7 +47364,7 @@ paths: QueryChannelsResponse is the response type for the Query/Channels RPC method. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -45213,7 +47477,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -45223,13 +47487,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -45251,7 +47518,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -45335,7 +47601,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -45346,7 +47611,6 @@ paths: in: query required: false type: boolean - format: boolean tags: - IBC /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}: @@ -45475,7 +47739,7 @@ paths: proof was retrieved. default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -45588,7 +47852,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -45598,13 +47862,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -45626,7 +47893,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -45797,7 +48063,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -45807,13 +48073,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -45835,7 +48104,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -45915,7 +48183,7 @@ paths: QueryChannelClientStateResponse is the Response type for the Query/QueryChannelClientState RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -46028,7 +48296,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -46038,13 +48306,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -46066,7 +48337,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -46227,7 +48497,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -46237,13 +48507,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -46265,7 +48538,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -46340,7 +48612,7 @@ paths: QueryChannelClientStateResponse is the Response type for the Query/QueryChannelClientState RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -46453,7 +48725,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -46463,13 +48735,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -46491,7 +48766,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -46606,7 +48880,7 @@ paths: QuerySequenceResponse is the request type for the Query/QueryNextSequenceReceiveResponse RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -46719,7 +48993,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -46729,13 +49003,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -46757,7 +49034,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -46912,7 +49188,7 @@ paths: QueryPacketAcknowledgemetsResponse is the request type for the Query/QueryPacketAcknowledgements RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -47025,7 +49301,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -47035,13 +49311,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -47063,7 +49342,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -47157,7 +49435,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -47168,7 +49445,6 @@ paths: in: query required: false type: boolean - format: boolean - name: packet_commitment_sequences description: list of packet sequences. in: query @@ -47235,7 +49511,7 @@ paths: proof was retrieved default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -47348,7 +49624,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -47358,13 +49634,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -47386,7 +49665,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -47545,7 +49823,7 @@ paths: QueryPacketCommitmentsResponse is the request type for the Query/QueryPacketCommitments RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -47658,7 +49936,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -47668,13 +49946,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -47696,7 +49977,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -47790,7 +50070,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -47801,7 +50080,6 @@ paths: in: query required: false type: boolean - format: boolean tags: - IBC /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks: @@ -47857,7 +50135,7 @@ paths: QueryUnreceivedAcksResponse is the response type for the Query/UnreceivedAcks RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -47970,7 +50248,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -47980,13 +50258,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -48008,7 +50289,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -48121,7 +50401,7 @@ paths: QueryUnreceivedPacketsResponse is the response type for the Query/UnreceivedPacketCommitments RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -48234,7 +50514,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -48244,13 +50524,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -48272,7 +50555,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -48388,7 +50670,7 @@ paths: retrieved default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -48501,7 +50783,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -48511,13 +50793,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -48539,7 +50824,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -48611,7 +50895,6 @@ paths: properties: received: type: boolean - format: boolean title: success flag for if receipt exists proof: type: string @@ -48655,7 +50938,7 @@ paths: retrieved default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -48768,7 +51051,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -48778,13 +51061,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -48806,7 +51092,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -49016,7 +51301,7 @@ paths: QueryConnectionChannelsResponse is the Response type for the Query/QueryConnectionChannels RPC method default: - description: An unexpected error response + description: An unexpected error response. schema: type: object properties: @@ -49129,7 +51414,7 @@ paths: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -49139,13 +51424,16 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -49167,7 +51455,6 @@ paths: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -49256,7 +51543,6 @@ paths: in: query required: false type: boolean - format: boolean - name: pagination.reverse description: >- reverse is set to true if results are to be returned in the @@ -49267,7 +51553,6 @@ paths: in: query required: false type: boolean - format: boolean tags: - IBC /vesting/circulatingsupply: @@ -49455,7 +51740,6 @@ definitions: key is set. - format: boolean reverse: type: boolean description: >- @@ -49464,7 +51748,6 @@ definitions: Since: cosmos-sdk 0.43 - format: boolean description: |- message SomeRequest { Foo some_parameter = 1; @@ -57243,6 +59526,192 @@ definitions: title: >- QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + cosmos.auth.v1beta1.QueryAccountInfoResponse: + type: object + properties: + info: + description: info is the account info which is represented by BaseAccount. + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + account_number: + type: string + format: uint64 + sequence: + type: string + format: uint64 + description: |- + QueryAccountInfoResponse is the Query/AccountInfo response type. + + Since: cosmos-sdk 0.47 cosmos.auth.v1beta1.QueryAccountResponse: type: object properties: @@ -57339,7 +59808,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -57349,13 +59818,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -57373,7 +59845,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -57509,7 +59980,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -57519,13 +59990,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -57543,7 +60017,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -57697,7 +60170,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -57707,13 +60180,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -57731,7 +60207,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -57867,7 +60342,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -57877,13 +60352,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -57901,7 +60379,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -58115,6 +60592,18 @@ definitions: denom is sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. + + For genesis, use the newly added send_enabled field in the genesis + object. + + Storage, lookup, and manipulation of this information is now in the + keeper. + + + As of cosmos-sdk 0.47, this only exists for backwards compatibility of + genesis files. default_send_enabled: type: boolean description: Params defines the parameters for the bank module. @@ -58468,12 +60957,89 @@ definitions: denom is sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. + + For genesis, use the newly added send_enabled field in the genesis + object. + + Storage, lookup, and manipulation of this information is now in + the keeper. + + + As of cosmos-sdk 0.47, this only exists for backwards + compatibility of genesis files. default_send_enabled: type: boolean description: Params defines the parameters for the bank module. description: >- QueryParamsResponse defines the response type for querying x/bank parameters. + cosmos.bank.v1beta1.QuerySendEnabledResponse: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status (whether a + denom is + + sendable). + pagination: + description: |- + pagination defines the pagination in the response. This field is only + populated if the denoms field in the request is empty. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QuerySendEnabledResponse defines the RPC response of a SendEnable query. + + Since: cosmos-sdk 0.47 + cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse: + type: object + properties: + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: >- + QuerySpendableBalanceByDenomResponse defines the gRPC response structure + for + + querying an account's spendable balance for a specific denom. + + + Since: cosmos-sdk 0.47 cosmos.bank.v1beta1.QuerySpendableBalancesResponse: type: object properties: @@ -58631,19 +61197,18 @@ definitions: ProofOp defines an operation used for calculating Merkle root. The data could - be arbitrary format, providing nessecary data for example + be arbitrary format, providing necessary data for example neighbouring node hash. Note: This type is a duplicate of the ProofOp proto type defined - in - - Tendermint. - description: |- + in Tendermint. + description: >- ProofOps is Merkle proof defined by the list of ProofOps. + Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. height: @@ -58651,11 +61216,13 @@ definitions: format: int64 codespace: type: string - description: |- + description: >- ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. + Note: This type is a duplicate of the ResponseQuery proto type defined in + Tendermint. cosmos.base.tendermint.v1beta1.Block: type: object @@ -60284,9 +62851,7 @@ definitions: field converted to bech32 string. description: >- GetBlockByHeightResponse is the response type for the - Query/GetBlockByHeight - - RPC method. + Query/GetBlockByHeight RPC method. cosmos.base.tendermint.v1beta1.GetLatestBlockResponse: type: object properties: @@ -61377,9 +63942,7 @@ definitions: field converted to bech32 string. description: >- GetLatestBlockResponse is the response type for the Query/GetLatestBlock - RPC - - method. + RPC method. cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse: type: object properties: @@ -61492,7 +64055,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -61502,13 +64065,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -61529,7 +64095,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -61588,7 +64153,7 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - description: |- + description: >- GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. cosmos.base.tendermint.v1beta1.GetNodeInfoResponse: @@ -61663,7 +64228,7 @@ definitions: type: string title: 'Since: cosmos-sdk 0.43' description: VersionInfo is the type for the GetNodeInfoResponse message. - description: |- + description: >- GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. cosmos.base.tendermint.v1beta1.GetSyncingResponse: @@ -61786,7 +64351,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -61796,13 +64361,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -61823,7 +64391,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -61882,7 +64449,7 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - description: |- + description: >- GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. cosmos.base.tendermint.v1beta1.Header: @@ -61997,14 +64564,13 @@ definitions: ProofOp defines an operation used for calculating Merkle root. The data could - be arbitrary format, providing nessecary data for example neighbouring + be arbitrary format, providing necessary data for example neighbouring node hash. Note: This type is a duplicate of the ProofOp proto type defined in - Tendermint. cosmos.base.tendermint.v1beta1.ProofOps: type: object @@ -62026,18 +64592,18 @@ definitions: ProofOp defines an operation used for calculating Merkle root. The data could - be arbitrary format, providing nessecary data for example + be arbitrary format, providing necessary data for example neighbouring node hash. Note: This type is a duplicate of the ProofOp proto type defined in - Tendermint. - description: |- + description: >- ProofOps is Merkle proof defined by the list of ProofOps. + Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. cosmos.base.tendermint.v1beta1.Validator: @@ -62138,7 +64704,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -62148,13 +64714,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -62172,7 +64741,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -64663,8 +67231,18 @@ definitions: type: string base_proposer_reward: type: string + description: >- + Deprecated: The base_proposer_reward field is deprecated and is no + longer used + + in the x/distribution module's reward mechanism. bonus_proposer_reward: type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated and is no + longer used + + in the x/distribution module's reward mechanism. withdraw_addr_enabled: type: boolean description: Params defines the set of params for the distribution module. @@ -64793,8 +67371,18 @@ definitions: type: string base_proposer_reward: type: string + description: >- + Deprecated: The base_proposer_reward field is deprecated and is no + longer used + + in the x/distribution module's reward mechanism. bonus_proposer_reward: type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated and is + no longer used + + in the x/distribution module's reward mechanism. withdraw_addr_enabled: type: boolean description: QueryParamsResponse is the response type for the Query/Params RPC method. @@ -64802,7 +67390,7 @@ definitions: type: object properties: commission: - description: commission defines the commision the validator received. + description: commission defines the commission the validator received. type: object properties: commission: @@ -64826,6 +67414,45 @@ definitions: title: |- QueryValidatorCommissionResponse is the response type for the Query/ValidatorCommission RPC method + cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse: + type: object + properties: + operator_address: + type: string + description: operator_address defines the validator operator address. + self_bond_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: self_bond_rewards defines the self delegations rewards. + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: commission defines the commission the validator received. + description: >- + QueryValidatorDistributionInfoResponse is the response type for the + Query/ValidatorDistributionInfo RPC method. cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse: type: object properties: @@ -65053,7 +67680,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -65063,13 +67690,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -65087,7 +67717,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -65240,7 +67869,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -65250,13 +67879,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -65274,7 +67906,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -65315,8 +67946,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: depositor defines the deposit addresses from the proposals. amount: type: array items: @@ -65331,6 +67964,7 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. + description: amount to be deposited by depositor. description: |- Deposit defines an amount deposited by an account address to an active proposal. @@ -65357,7 +67991,8 @@ definitions: description: >- Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - months. + + months. description: DepositParams defines the params for deposits on governance proposals. cosmos.gov.v1beta1.Proposal: type: object @@ -65365,6 +68000,7 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. content: type: object properties: @@ -65458,7 +68094,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -65468,13 +68104,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -65492,7 +68131,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -65525,6 +68163,7 @@ definitions: "value": "1.212s" } status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -65534,20 +68173,6 @@ definitions: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: |- final_tally_result is the final tally result of the proposal. When @@ -65557,18 +68182,24 @@ definitions: properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: abstain is the number of abstain votes on a proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: no_with_veto is the number of no with veto votes on a proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -65583,12 +68214,15 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: voting_start_time is the starting time to vote on a proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. description: Proposal defines the core field members of a governance proposal. cosmos.gov.v1beta1.ProposalStatus: type: string @@ -65623,8 +68257,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: depositor defines the deposit addresses from the proposals. amount: type: array items: @@ -65642,6 +68278,7 @@ definitions: method signatures required by gogoproto. + description: amount to be deposited by depositor. description: |- Deposit defines an amount deposited by an account address to an active proposal. @@ -65659,8 +68296,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: depositor defines the deposit addresses from the proposals. amount: type: array items: @@ -65678,11 +68317,13 @@ definitions: method signatures required by gogoproto. + description: amount to be deposited by depositor. description: >- Deposit defines an amount deposited by an account address to an active proposal. + description: deposits defines the requested deposits. pagination: description: pagination defines the pagination in the response. type: object @@ -65714,7 +68355,7 @@ definitions: properties: voting_period: type: string - description: Length of the voting period. + description: Duration of the voting period. deposit_params: description: deposit_params defines the parameters related to deposit. type: object @@ -65742,7 +68383,8 @@ definitions: description: >- Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - months. + + months. tally_params: description: tally_params defines the parameters related to tally. type: object @@ -65753,7 +68395,8 @@ definitions: description: >- Minimum percentage of total stake needed to vote for a result to be - considered valid. + + considered valid. threshold: type: string format: byte @@ -65766,7 +68409,8 @@ definitions: description: >- Minimum value of Veto votes to Total votes ratio for proposal to be - vetoed. Default value: 1/3. + + vetoed. Default value: 1/3. description: QueryParamsResponse is the response type for the Query/Params RPC method. cosmos.gov.v1beta1.QueryProposalResponse: type: object @@ -65777,6 +68421,7 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. content: type: object properties: @@ -65874,7 +68519,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -65884,13 +68529,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -65909,7 +68557,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -65943,6 +68590,7 @@ definitions: "value": "1.212s" } status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -65952,20 +68600,6 @@ definitions: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the proposal. When @@ -65978,18 +68612,26 @@ definitions: properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: abstain is the number of abstain votes on a proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -66007,12 +68649,15 @@ definitions: method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: voting_start_time is the starting time to vote on a proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. description: Proposal defines the core field members of a governance proposal. description: >- QueryProposalResponse is the response type for the Query/Proposal RPC @@ -66028,6 +68673,7 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. content: type: object properties: @@ -66127,7 +68773,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -66137,13 +68783,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -66164,7 +68813,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -66198,6 +68846,7 @@ definitions: "value": "1.212s" } status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -66207,20 +68856,6 @@ definitions: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the proposal. @@ -66234,18 +68869,26 @@ definitions: properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: abstain is the number of abstain votes on a proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -66263,13 +68906,17 @@ definitions: method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: voting_start_time is the starting time to vote on a proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. description: Proposal defines the core field members of a governance proposal. + description: proposals defines all the requested governance proposals. pagination: description: pagination defines the pagination in the response. type: object @@ -66301,12 +68948,16 @@ definitions: properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: abstain is the number of abstain votes on a proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: no_with_veto is the number of no with veto votes on a proposal. description: >- QueryTallyResultResponse is the response type for the Query/Tally RPC method. @@ -66319,8 +68970,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. option: description: >- Deprecated: Prefer to use `options` instead. This field is set in @@ -66344,6 +68997,9 @@ definitions: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -66352,22 +69008,17 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: |- WeightedVoteOption defines a unit of vote for vote split. Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 description: |- Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option. @@ -66383,8 +69034,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. option: description: >- Deprecated: Prefer to use `options` instead. This field is set @@ -66408,6 +69061,9 @@ definitions: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -66416,26 +69072,21 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: |- WeightedVoteOption defines a unit of vote for vote split. Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 description: |- Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option. - description: votes defined the queried votes. + description: votes defines the queried votes. pagination: description: pagination defines the pagination in the response. type: object @@ -66464,7 +69115,7 @@ definitions: format: byte description: |- Minimum percentage of total stake needed to vote for a result to be - considered valid. + considered valid. threshold: type: string format: byte @@ -66476,19 +69127,23 @@ definitions: format: byte description: |- Minimum value of Veto votes to Total votes ratio for proposal to be - vetoed. Default value: 1/3. + vetoed. Default value: 1/3. description: TallyParams defines the params for tallying votes on governance proposals. cosmos.gov.v1beta1.TallyResult: type: object properties: 'yes': type: string + description: yes is the number of yes votes on a proposal. abstain: type: string + description: abstain is the number of abstain votes on a proposal. 'no': type: string + description: no is the number of no votes on a proposal. no_with_veto: type: string + description: no_with_veto is the number of no with veto votes on a proposal. description: TallyResult defines a standard tally for a governance proposal. cosmos.gov.v1beta1.Vote: type: object @@ -66496,8 +69151,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. option: description: >- Deprecated: Prefer to use `options` instead. This field is set in @@ -66521,6 +69178,9 @@ definitions: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -66529,22 +69189,17 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: |- WeightedVoteOption defines a unit of vote for vote split. Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 description: |- Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option. @@ -66571,12 +69226,15 @@ definitions: properties: voting_period: type: string - description: Length of the voting period. + description: Duration of the voting period. description: VotingParams defines the params for voting on governance proposals. cosmos.gov.v1beta1.WeightedVoteOption: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain duplicate + vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -66585,17 +69243,9 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given governance - proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: |- WeightedVoteOption defines a unit of vote for vote split. @@ -66606,8 +69256,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: depositor defines the deposit addresses from the proposals. amount: type: array items: @@ -66622,6 +69274,7 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. + description: amount to be deposited by depositor. description: |- Deposit defines an amount deposited by an account address to an active proposal. @@ -66648,14 +69301,68 @@ definitions: description: >- Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - months. + + months. description: DepositParams defines the params for deposits on governance proposals. + cosmos.gov.v1.Params: + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + voting_period: + type: string + description: Duration of the voting period. + quorum: + type: string + description: |- + Minimum percentage of total stake needed to vote for a result to be + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. Default value: + 0.5. + veto_threshold: + type: string + description: |- + Minimum value of Veto votes to Total votes ratio for proposal to be + vetoed. Default value: 1/3. + min_initial_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value that must + be paid at proposal submission. + description: |- + Params defines the parameters for the x/gov module. + + Since: cosmos-sdk 0.47 cosmos.gov.v1.Proposal: type: object properties: id: type: string format: uint64 + description: id defines the unique id of the proposal. messages: type: array items: @@ -66754,7 +69461,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -66764,13 +69471,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -66788,7 +69498,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -66820,7 +69529,11 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + description: >- + messages are the arbitrary messages to be executed if the proposal + passes. status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -66830,20 +69543,6 @@ definitions: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: |- final_tally_result is the final tally result of the proposal. When @@ -66853,18 +69552,26 @@ definitions: properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: abstain_count is the number of abstain votes on a proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -66879,15 +69586,30 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: voting_start_time is the starting time to vote on a proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. metadata: type: string description: metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter description: Proposal defines the core field members of a governance proposal. cosmos.gov.v1.ProposalStatus: type: string @@ -66922,8 +69644,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: depositor defines the deposit addresses from the proposals. amount: type: array items: @@ -66941,6 +69665,7 @@ definitions: method signatures required by gogoproto. + description: amount to be deposited by depositor. description: |- Deposit defines an amount deposited by an account address to an active proposal. @@ -66958,8 +69683,10 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. depositor: type: string + description: depositor defines the deposit addresses from the proposals. amount: type: array items: @@ -66977,11 +69704,13 @@ definitions: method signatures required by gogoproto. + description: amount to be deposited by depositor. description: >- Deposit defines an amount deposited by an account address to an active proposal. + description: deposits defines the requested deposits. pagination: description: pagination defines the pagination in the response. type: object @@ -67008,14 +69737,18 @@ definitions: type: object properties: voting_params: - description: voting_params defines the parameters related to voting. + description: |- + Deprecated: Prefer to use `params` instead. + voting_params defines the parameters related to voting. type: object properties: voting_period: type: string - description: Length of the voting period. + description: Duration of the voting period. deposit_params: - description: deposit_params defines the parameters related to deposit. + description: |- + Deprecated: Prefer to use `params` instead. + deposit_params defines the parameters related to deposit. type: object properties: min_deposit: @@ -67041,11 +69774,68 @@ definitions: description: >- Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - months. + + months. tally_params: - description: tally_params defines the parameters related to tally. + description: |- + Deprecated: Prefer to use `params` instead. + tally_params defines the parameters related to tally. type: object properties: + quorum: + type: string + description: >- + Minimum percentage of total stake needed to vote for a result to + be + + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. Default + value: 0.5. + veto_threshold: + type: string + description: >- + Minimum value of Veto votes to Total votes ratio for proposal to + be + + vetoed. Default value: 1/3. + params: + description: |- + params defines all the paramaters of x/gov module. + + Since: cosmos-sdk 0.47 + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + voting_period: + type: string + description: Duration of the voting period. quorum: type: string description: >- @@ -67063,6 +69853,11 @@ definitions: Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Default value: 1/3. + min_initial_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value that + must be paid at proposal submission. description: QueryParamsResponse is the response type for the Query/Params RPC method. cosmos.gov.v1.QueryProposalResponse: type: object @@ -67073,6 +69868,7 @@ definitions: id: type: string format: uint64 + description: id defines the unique id of the proposal. messages: type: array items: @@ -67174,7 +69970,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -67184,13 +69980,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -67211,7 +70010,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -67244,7 +70042,11 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + description: >- + messages are the arbitrary messages to be executed if the proposal + passes. status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -67254,20 +70056,6 @@ definitions: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the proposal. When @@ -67280,18 +70068,26 @@ definitions: properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: abstain_count is the number of abstain votes on a proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -67309,15 +70105,30 @@ definitions: method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: voting_start_time is the starting time to vote on a proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. metadata: type: string description: metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter description: Proposal defines the core field members of a governance proposal. description: >- QueryProposalResponse is the response type for the Query/Proposal RPC @@ -67333,6 +70144,7 @@ definitions: id: type: string format: uint64 + description: id defines the unique id of the proposal. messages: type: array items: @@ -67434,7 +70246,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -67444,13 +70256,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -67472,7 +70287,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -67506,7 +70320,11 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + description: >- + messages are the arbitrary messages to be executed if the + proposal passes. status: + description: status defines the proposal status. type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -67516,20 +70334,6 @@ definitions: - PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_FAILED default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. final_tally_result: description: >- final_tally_result is the final tally result of the proposal. @@ -67543,18 +70347,26 @@ definitions: properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: abstain_count is the number of abstain votes on a proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. submit_time: type: string format: date-time + description: submit_time is the time of proposal submission. deposit_end_time: type: string format: date-time + description: deposit_end_time is the end time for deposition. total_deposit: type: array items: @@ -67572,16 +70384,32 @@ definitions: method signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. voting_start_time: type: string format: date-time + description: voting_start_time is the starting time to vote on a proposal. voting_end_time: type: string format: date-time + description: voting_end_time is the end time of voting on a proposal. metadata: type: string description: metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter description: Proposal defines the core field members of a governance proposal. + description: proposals defines all the requested governance proposals. pagination: description: pagination defines the pagination in the response. type: object @@ -67613,12 +70441,18 @@ definitions: properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: abstain_count is the number of abstain votes on a proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. description: >- QueryTallyResultResponse is the response type for the Query/Tally RPC method. @@ -67631,14 +70465,19 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. options: type: array items: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -67647,18 +70486,11 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. metadata: type: string description: metadata is any arbitrary metadata to attached to the vote. @@ -67677,14 +70509,19 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. options: type: array items: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -67693,25 +70530,18 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. metadata: type: string description: metadata is any arbitrary metadata to attached to the vote. description: |- Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option. - description: votes defined the queried votes. + description: votes defines the queried votes. pagination: description: pagination defines the pagination in the response. type: object @@ -67739,7 +70569,7 @@ definitions: type: string description: |- Minimum percentage of total stake needed to vote for a result to be - considered valid. + considered valid. threshold: type: string description: >- @@ -67749,19 +70579,23 @@ definitions: type: string description: |- Minimum value of Veto votes to Total votes ratio for proposal to be - vetoed. Default value: 1/3. + vetoed. Default value: 1/3. description: TallyParams defines the params for tallying votes on governance proposals. cosmos.gov.v1.TallyResult: type: object properties: yes_count: type: string + description: yes_count is the number of yes votes on a proposal. abstain_count: type: string + description: abstain_count is the number of abstain votes on a proposal. no_count: type: string + description: no_count is the number of no votes on a proposal. no_with_veto_count: type: string + description: no_with_veto_count is the number of no with veto votes on a proposal. description: TallyResult defines a standard tally for a governance proposal. cosmos.gov.v1.Vote: type: object @@ -67769,14 +70603,19 @@ definitions: proposal_id: type: string format: uint64 + description: proposal_id defines the unique id of the proposal. voter: type: string + description: voter is the voter address of the proposal. options: type: array items: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -67785,18 +70624,11 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. metadata: type: string description: metadata is any arbitrary metadata to attached to the vote. @@ -67826,12 +70658,15 @@ definitions: properties: voting_period: type: string - description: Length of the voting period. + description: Duration of the voting period. description: VotingParams defines the params for voting on governance proposals. cosmos.gov.v1.WeightedVoteOption: type: object properties: option: + description: >- + option defines the valid vote options, it must not contain duplicate + vote options. type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -67840,17 +70675,9 @@ definitions: - VOTE_OPTION_NO - VOTE_OPTION_NO_WITH_VETO default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given governance - proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. weight: type: string + description: weight is the vote weight associated with the vote option. description: WeightedVoteOption defines a unit of vote for vote split. cosmos.mint.v1beta1.Params: type: object @@ -67874,7 +70701,7 @@ definitions: type: string format: uint64 title: expected blocks per year - description: Params holds parameters for the mint module. + description: Params defines the parameters for the x/mint module. cosmos.mint.v1beta1.QueryAnnualProvisionsResponse: type: object properties: @@ -68539,7 +71366,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -68549,13 +71376,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -68576,7 +71406,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -68705,6 +71534,20 @@ definitions: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator description: >- Validator defines a validator, together with the total amount of the @@ -68764,7 +71607,7 @@ definitions: title: >- min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators - description: Params defines the parameters for the staking module. + description: Params defines the parameters for the x/staking module. cosmos.staking.v1beta1.Pool: type: object properties: @@ -68946,6 +71789,16 @@ definitions: balance: type: string description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -69085,7 +71938,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -69095,13 +71948,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -69120,7 +71976,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -69247,6 +72102,20 @@ definitions: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator description: >- Validator defines a validator, together with the total amount of the @@ -69383,7 +72252,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -69393,13 +72262,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -69420,7 +72292,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -69549,6 +72420,20 @@ definitions: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator description: >- Validator defines a validator, together with the total amount of the @@ -69787,7 +72672,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -69797,13 +72682,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -69825,7 +72713,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -69958,6 +72845,20 @@ definitions: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding + of this validator description: >- Validator defines a validator, together with the total amount of the @@ -70084,6 +72985,16 @@ definitions: description: >- shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -70124,6 +73035,16 @@ definitions: description: >- shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -70204,6 +73125,16 @@ definitions: balance: type: string description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -70397,7 +73328,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -70407,13 +73338,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -70432,7 +73366,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -70559,6 +73492,20 @@ definitions: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator description: >- Validator defines a validator, together with the total amount of the @@ -70622,6 +73569,16 @@ definitions: balance: type: string description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -70765,7 +73722,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -70775,13 +73732,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -70802,7 +73762,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -70931,6 +73890,20 @@ definitions: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator description: >- Validator defines a validator, together with the total amount of the @@ -71018,6 +73991,16 @@ definitions: description: >- shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -71046,6 +74029,16 @@ definitions: description: >- shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules description: RedelegationEntry defines a redelegation object with relevant metadata. cosmos.staking.v1beta1.RedelegationEntryResponse: type: object @@ -71073,6 +74066,16 @@ definitions: description: >- shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -71131,6 +74134,16 @@ definitions: description: >- shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -71171,6 +74184,16 @@ definitions: description: >- shares_dst is the amount of destination-validator shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules description: >- RedelegationEntry defines a redelegation object with relevant metadata. @@ -71221,6 +74244,16 @@ definitions: balance: type: string description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -71247,6 +74280,16 @@ definitions: balance: type: string description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -71351,7 +74394,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -71361,13 +74404,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -71385,7 +74431,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -71509,6 +74554,20 @@ definitions: Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped by + external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of this + validator description: >- Validator defines a validator, together with the total amount of the @@ -71623,10 +74682,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -71743,7 +74800,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -71753,13 +74810,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -71777,7 +74837,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -72010,7 +75069,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -72020,13 +75079,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -72044,7 +75106,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -72100,10 +75161,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -72324,8 +75383,8 @@ definitions: method. - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - - BROADCAST_MODE_BLOCK: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - the tx to be committed in a block. + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for a CheckTx execution response only. - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns @@ -72350,8 +75409,8 @@ definitions: RPC method. - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - - BROADCAST_MODE_BLOCK: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - the tx to be committed in a block. + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for a CheckTx execution response only. - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns @@ -72543,7 +75602,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -72553,13 +75612,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -72578,7 +75640,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -72635,10 +75696,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -73492,7 +76551,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -73502,13 +76561,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -73527,7 +76589,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -73584,10 +76645,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -73813,7 +76872,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -73823,13 +76882,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -73850,7 +76912,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -73907,10 +76968,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -74263,7 +77322,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -74273,13 +77332,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -74297,7 +77359,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -74419,10 +77480,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: >- @@ -74542,7 +77601,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -74552,13 +77611,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -74579,7 +77641,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -74754,7 +77815,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -74764,13 +77825,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -74791,7 +77855,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -74960,7 +78023,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -74970,13 +78033,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -74997,7 +78063,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -75139,7 +78204,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -75149,13 +78214,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -75176,7 +78244,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -75338,7 +78405,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -75348,13 +78415,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -75372,7 +78442,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -75534,7 +78603,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -75544,13 +78613,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -75568,7 +78640,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -75705,7 +78776,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -75715,13 +78786,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -75739,7 +78813,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -75779,6 +78852,94 @@ definitions: and can't be handled, they will be ignored description: TxBody is the body of a transaction that all signers sign over. + cosmos.tx.v1beta1.TxDecodeAminoRequest: + type: object + properties: + amino_binary: + type: string + format: byte + description: |- + TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeAminoResponse: + type: object + properties: + amino_json: + type: string + description: |- + TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeRequest: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + description: |- + TxDecodeRequest is the request type for the Service.TxDecode + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeResponse: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: tx is the decoded transaction. + description: |- + TxDecodeResponse is the response type for the + Service.TxDecode method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeAminoRequest: + type: object + properties: + amino_json: + type: string + description: |- + TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeAminoResponse: + type: object + properties: + amino_binary: + type: string + format: byte + description: |- + TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeRequest: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: tx is the transaction to encode. + description: |- + TxEncodeRequest is the request type for the Service.TxEncode + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeResponse: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the encoded transaction bytes. + description: |- + TxEncodeResponse is the response type for the + Service.TxEncode method. + + Since: cosmos-sdk 0.47 tendermint.abci.Event: type: object properties: @@ -75791,10 +78952,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: EventAttribute is a single key-value pair, associated with an event. @@ -75810,10 +78969,8 @@ definitions: properties: key: type: string - format: byte value: type: string - format: byte index: type: boolean description: EventAttribute is a single key-value pair, associated with an event. @@ -75867,9 +79024,7 @@ definitions: height: type: string format: int64 - description: |- - The height at which the upgrade must be performed. - Only used if Time is not set. + description: The height at which the upgrade must be performed. info: type: string title: |- @@ -75968,7 +79123,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -75978,13 +79133,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -76002,7 +79160,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -76098,9 +79255,7 @@ definitions: height: type: string format: int64 - description: |- - The height at which the upgrade must be performed. - Only used if Time is not set. + description: The height at which the upgrade must be performed. info: type: string title: >- @@ -76205,7 +79360,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -76215,13 +79370,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -76240,7 +79398,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -76416,7 +79573,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -76426,13 +79583,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -76450,7 +79610,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -76595,7 +79754,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -76605,13 +79764,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -76629,7 +79791,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -76780,7 +79941,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -76790,13 +79951,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -76817,7 +79981,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -76992,7 +80155,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -77002,13 +80165,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -77029,7 +80195,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -77200,7 +80365,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -77210,13 +80375,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -77237,7 +80405,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -77810,7 +80977,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -77820,13 +80987,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -77844,7 +81014,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -77988,7 +81157,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -77998,13 +81167,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -78022,7 +81194,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -78062,6 +81233,7 @@ definitions: amount: type: string format: uint64 + title: amount is the number of all NFTs of a given class owned by the owner title: QueryBalanceResponse is the response type for the Query/Balance RPC method cosmos.nft.v1beta1.QueryClassResponse: type: object @@ -78190,7 +81362,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -78200,13 +81372,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -78225,7 +81400,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -78394,7 +81568,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -78404,13 +81578,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -78431,7 +81608,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -78466,7 +81642,9 @@ definitions: } title: data is the app specific metadata of the NFT class. Optional description: Class defines the class of the nft type. + description: class defines the class of the nft type. pagination: + description: pagination defines the pagination in the response. type: object properties: next_key: @@ -78484,14 +81662,6 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } title: QueryClassesResponse is the response type for the Query/Classes RPC method cosmos.nft.v1beta1.QueryNFTResponse: type: object @@ -78610,7 +81780,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -78620,13 +81790,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -78645,7 +81818,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -78680,6 +81852,7 @@ definitions: } title: data is an app specific data of the NFT. Optional description: NFT defines the NFT. + title: owner is the owner address of the nft title: QueryNFTResponse is the response type for the Query/NFT RPC method cosmos.nft.v1beta1.QueryNFTsResponse: type: object @@ -78802,7 +81975,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -78812,13 +81985,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -78839,7 +82015,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -78874,7 +82049,9 @@ definitions: } title: data is an app specific data of the NFT. Optional description: NFT defines the NFT. + title: NFT defines the NFT pagination: + description: pagination defines the pagination in the response. type: object properties: next_key: @@ -78892,20 +82069,13 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } title: QueryNFTsResponse is the response type for the Query/NFTs RPC methods cosmos.nft.v1beta1.QueryOwnerResponse: type: object properties: owner: type: string + title: owner is the owner address of the nft title: QueryOwnerResponse is the response type for the Query/Owner RPC method cosmos.nft.v1beta1.QuerySupplyResponse: type: object @@ -78913,6 +82083,7 @@ definitions: amount: type: string format: uint64 + title: amount is the number of all NFTs from the given class title: QuerySupplyResponse is the response type for the Query/Supply RPC method cosmos.group.v1.GroupInfo: type: object @@ -78990,7 +82161,7 @@ definitions: description: admin is the account address of the group admin. metadata: type: string - description: metadata is any arbitrary metadata to attached to the group policy. + description: metadata is any arbitrary metadata attached to the group policy. version: type: string format: uint64 @@ -79092,7 +82263,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -79102,13 +82273,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -79126,7 +82300,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -79196,7 +82369,7 @@ definitions: description: group_policy_address is the account address of group policy. metadata: type: string - description: metadata is any arbitrary metadata to attached to the proposal. + description: metadata is any arbitrary metadata attached to the proposal. proposers: type: array items: @@ -79268,7 +82441,7 @@ definitions: description: >- voting_period_end is the timestamp before which voting must be done. - Unless a successfull MsgExec is called before (to execute a proposal + Unless a successful MsgExec is called before (to execute a proposal whose tally is successful before the voting period ends), tallying will be @@ -79386,7 +82559,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -79396,13 +82569,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -79420,7 +82596,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -79455,6 +82630,14 @@ definitions: description: >- messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal description: >- Proposal defines a group proposal. Any member of a group can submit a proposal @@ -79507,7 +82690,7 @@ definitions: type: object properties: info: - description: info is the GroupInfo for the group. + description: info is the GroupInfo of the group. type: object properties: id: @@ -79617,9 +82800,7 @@ definitions: description: admin is the account address of the group admin. metadata: type: string - description: >- - metadata is any arbitrary metadata to attached to the group - policy. + description: metadata is any arbitrary metadata attached to the group policy. version: type: string format: uint64 @@ -79727,7 +82908,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -79737,13 +82918,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -79764,7 +82948,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -79849,9 +83032,7 @@ definitions: description: admin is the account address of the group admin. metadata: type: string - description: >- - metadata is any arbitrary metadata to attached to the group - policy. + description: metadata is any arbitrary metadata attached to the group policy. version: type: string format: uint64 @@ -79959,7 +83140,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -79969,13 +83150,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -79996,7 +83180,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -80081,9 +83264,7 @@ definitions: description: admin is the account address of the group admin. metadata: type: string - description: >- - metadata is any arbitrary metadata to attached to the group - policy. + description: metadata is any arbitrary metadata attached to the group policy. version: type: string format: uint64 @@ -80189,7 +83370,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -80199,13 +83380,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -80224,7 +83408,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -80411,7 +83594,7 @@ definitions: description: group_policy_address is the account address of group policy. metadata: type: string - description: metadata is any arbitrary metadata to attached to the proposal. + description: metadata is any arbitrary metadata attached to the proposal. proposers: type: array items: @@ -80489,7 +83672,7 @@ definitions: voting_period_end is the timestamp before which voting must be done. - Unless a successfull MsgExec is called before (to execute a + Unless a successful MsgExec is called before (to execute a proposal whose tally is successful before the voting period ends), tallying will @@ -80611,7 +83794,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -80621,13 +83804,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -80648,7 +83834,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -80684,6 +83869,14 @@ definitions: description: >- messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal description: QueryProposalResponse is the Query/Proposal response type. cosmos.group.v1.QueryProposalsByGroupPolicyResponse: type: object @@ -80702,7 +83895,7 @@ definitions: description: group_policy_address is the account address of group policy. metadata: type: string - description: metadata is any arbitrary metadata to attached to the proposal. + description: metadata is any arbitrary metadata attached to the proposal. proposers: type: array items: @@ -80781,7 +83974,7 @@ definitions: voting_period_end is the timestamp before which voting must be done. - Unless a successfull MsgExec is called before (to execute a + Unless a successful MsgExec is called before (to execute a proposal whose tally is successful before the voting period ends), tallying @@ -80903,7 +84096,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -80913,13 +84106,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -80941,7 +84137,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -80978,6 +84173,14 @@ definitions: description: >- messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal description: >- Proposal defines a group proposal. Any member of a group can submit a proposal @@ -81058,7 +84261,7 @@ definitions: default: VOTE_OPTION_UNSPECIFIED metadata: type: string - description: metadata is any arbitrary metadata to attached to the vote. + description: metadata is any arbitrary metadata attached to the vote. submit_time: type: string format: date-time @@ -81093,7 +84296,7 @@ definitions: default: VOTE_OPTION_UNSPECIFIED metadata: type: string - description: metadata is any arbitrary metadata to attached to the vote. + description: metadata is any arbitrary metadata attached to the vote. submit_time: type: string format: date-time @@ -81147,7 +84350,7 @@ definitions: default: VOTE_OPTION_UNSPECIFIED metadata: type: string - description: metadata is any arbitrary metadata to attached to the vote. + description: metadata is any arbitrary metadata attached to the vote. submit_time: type: string format: date-time @@ -81212,7 +84415,7 @@ definitions: default: VOTE_OPTION_UNSPECIFIED metadata: type: string - description: metadata is any arbitrary metadata to attached to the vote. + description: metadata is any arbitrary metadata attached to the vote. submit_time: type: string format: date-time @@ -81259,7 +84462,6 @@ definitions: properties: send_enabled: type: boolean - format: boolean description: >- send_enabled enables or disables all cross-chain token transfers from this @@ -81267,7 +84469,6 @@ definitions: chain. receive_enabled: type: boolean - format: boolean description: >- receive_enabled enables or disables all cross-chain token transfers to this @@ -81381,7 +84582,6 @@ definitions: properties: send_enabled: type: boolean - format: boolean description: >- send_enabled enables or disables all cross-chain token transfers from this @@ -81389,19 +84589,35 @@ definitions: chain. receive_enabled: type: boolean - format: boolean description: >- receive_enabled enables or disables all cross-chain token transfers to this chain. description: QueryParamsResponse is the response type for the Query/Params RPC method. + ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse: + type: object + properties: + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: >- + QueryTotalEscrowForDenomResponse is the response type for + TotalEscrowForDenom RPC method. ibc.applications.interchain_accounts.controller.v1.Params: type: object properties: controller_enabled: type: boolean - format: boolean description: controller_enabled enables or disables the controller submodule. description: |- Params defines the set of on-chain interchain accounts parameters. @@ -81423,7 +84639,6 @@ definitions: properties: controller_enabled: type: boolean - format: boolean description: controller_enabled enables or disables the controller submodule. description: QueryParamsResponse is the response type for the Query/Params RPC method. ibc.applications.interchain_accounts.host.v1.Params: @@ -81431,7 +84646,6 @@ definitions: properties: host_enabled: type: boolean - format: boolean description: host_enabled enables or disables the host submodule. allow_messages: type: array @@ -81452,7 +84666,6 @@ definitions: properties: host_enabled: type: boolean - format: boolean description: host_enabled enables or disables the host submodule. allow_messages: type: array @@ -81710,7 +84923,6 @@ definitions: properties: fee_enabled: type: boolean - format: boolean title: boolean flag representing the fee enabled channel status title: >- QueryFeeEnabledChannelResponse defines the response type for the @@ -82277,7 +85489,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -82287,13 +85499,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -82311,7 +85526,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -82474,7 +85688,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -82484,13 +85698,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -82508,7 +85725,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -82550,7 +85766,14 @@ definitions: type: array items: type: string - description: allowed_clients defines the list of allowed client state types. + description: >- + allowed_clients defines the list of allowed client state types which + can be created + + and interacted with. If a client type is removed from the allowed + clients list, usage + + of this client will be disabled until it is added again to the list. description: Params defines the set of IBC light client parameters. ibc.core.client.v1.QueryClientParamsResponse: type: object @@ -82563,7 +85786,15 @@ definitions: type: array items: type: string - description: allowed_clients defines the list of allowed client state types. + description: >- + allowed_clients defines the list of allowed client state types + which can be created + + and interacted with. If a client type is removed from the allowed + clients list, usage + + of this client will be disabled until it is added again to the + list. description: >- QueryClientParamsResponse is the response type for the Query/ClientParams RPC @@ -82665,7 +85896,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -82675,13 +85906,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -82699,7 +85933,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -82882,7 +86115,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -82892,13 +86125,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -82919,7 +86155,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -83167,7 +86402,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -83177,13 +86412,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -83201,7 +86439,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -83415,7 +86652,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -83425,13 +86662,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -83452,7 +86692,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -83618,7 +86857,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -83628,13 +86867,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -83652,7 +86894,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -83784,7 +87025,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -83794,13 +87035,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -83818,7 +87062,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -84228,7 +87471,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -84238,13 +87481,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -84263,7 +87509,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -84431,7 +87676,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -84441,13 +87686,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -84465,7 +87713,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -85152,7 +88399,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -85162,13 +88409,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -85187,7 +88437,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -85355,7 +88604,7 @@ definitions: foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -85365,13 +88614,16 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + any, err := anypb.New(foo) + if err != nil { + ... + } ... foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { + if err := any.UnmarshalTo(foo); err != nil { ... } @@ -85389,7 +88641,6 @@ definitions: JSON - ==== The JSON representation of an `Any` value uses the regular @@ -86157,7 +89408,6 @@ definitions: properties: received: type: boolean - format: boolean title: success flag for if receipt exists proof: type: string diff --git a/client/grpc/query/query.go b/client/grpc/query/query.go index 93c0efc6..190e7c24 100644 --- a/client/grpc/query/query.go +++ b/client/grpc/query/query.go @@ -18,8 +18,8 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ibctransfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types" - ibcclienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" evmtypes "github.com/evmos/ethermint/x/evm/types" feemarkettypes "github.com/evmos/ethermint/x/feemarket/types" diff --git a/client/rest/rest.go b/client/rest/rest.go index 79ed92fe..d4373205 100644 --- a/client/rest/rest.go +++ b/client/rest/rest.go @@ -13,7 +13,7 @@ import ( "strconv" "strings" - "github.com/tendermint/tendermint/types" + "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" diff --git a/client/rest/rest_test.go b/client/rest/rest_test.go index 43fd691b..6de35a45 100644 --- a/client/rest/rest_test.go +++ b/client/rest/rest_test.go @@ -12,13 +12,13 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/require" + simappparams "cosmossdk.io/simapp/params" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" "github.com/cosmos/cosmos-sdk/types" "github.com/kava-labs/kava/client/rest" ) diff --git a/cmd/kava/cmd/app.go b/cmd/kava/cmd/app.go index b6c57042..fe5efa7b 100644 --- a/cmd/kava/cmd/app.go +++ b/cmd/kava/cmd/app.go @@ -7,6 +7,9 @@ import ( "path/filepath" "strings" + cometbftdb "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" + tmtypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" @@ -19,8 +22,6 @@ import ( ethermintflags "github.com/evmos/ethermint/server/flags" "github.com/spf13/cast" "github.com/spf13/cobra" - "github.com/tendermint/tendermint/libs/log" - db "github.com/tendermint/tm-db" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/app/params" @@ -41,7 +42,7 @@ type appCreator struct { // newApp loads config from AppOptions and returns a new app. func (ac appCreator) newApp( logger log.Logger, - db db.DB, + db cometbftdb.DB, traceStore io.Writer, appOpts servertypes.AppOptions, ) servertypes.Application { @@ -62,7 +63,7 @@ func (ac appCreator) newApp( homeDir := cast.ToString(appOpts.Get(flags.FlagHome)) snapshotDir := filepath.Join(homeDir, "data", "snapshots") // TODO can these directory names be imported from somewhere? - snapshotDB, err := sdk.NewLevelDB("metadata", snapshotDir) + snapshotDB, err := cometbftdb.NewDB("metadata", server.GetAppDBBackend(appOpts), snapshotDir) if err != nil { panic(err) } @@ -89,6 +90,17 @@ func (ac appCreator) newApp( cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent)), ) + // Setup chainId + chainID := cast.ToString(appOpts.Get(flags.FlagChainID)) + if len(chainID) == 0 { + // fallback to genesis chain-id + appGenesis, err := tmtypes.GenesisDocFromFile(filepath.Join(homeDir, "config", "genesis.json")) + if err != nil { + panic(err) + } + chainID = appGenesis.ChainID + } + return app.NewApp( logger, db, homeDir, traceStore, ac.encodingConfig, app.Options{ @@ -114,18 +126,20 @@ func (ac appCreator) newApp( baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(server.FlagIAVLCacheSize))), baseapp.SetIAVLDisableFastNode(cast.ToBool(iavlDisableFastNode)), baseapp.SetIAVLLazyLoading(cast.ToBool(appOpts.Get(server.FlagIAVLLazyLoading))), + baseapp.SetChainID(chainID), ) } // appExport writes out an app's state to json. func (ac appCreator) appExport( logger log.Logger, - db db.DB, + db cometbftdb.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string, appOpts servertypes.AppOptions, + modulesToExport []string, ) (servertypes.ExportedApp, error) { homePath, ok := appOpts.Get(flags.FlagHome).(string) if !ok || homePath == "" { @@ -146,7 +160,7 @@ func (ac appCreator) appExport( } else { tempApp = app.NewApp(logger, db, homePath, traceStore, ac.encodingConfig, options) } - return tempApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs) + return tempApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) } // addStartCmdFlags adds flags to the server start command. diff --git a/cmd/kava/cmd/assert-invariants.go b/cmd/kava/cmd/assert-invariants.go index 91c1adee..de4ef717 100644 --- a/cmd/kava/cmd/assert-invariants.go +++ b/cmd/kava/cmd/assert-invariants.go @@ -4,10 +4,10 @@ import ( "encoding/json" "fmt" + tmtypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/version" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/spf13/cobra" - tmtypes "github.com/tendermint/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/app/params" diff --git a/cmd/kava/cmd/keys.go b/cmd/kava/cmd/keys.go index 8062fea5..9d8587c0 100644 --- a/cmd/kava/cmd/keys.go +++ b/cmd/kava/cmd/keys.go @@ -3,12 +3,12 @@ package cmd import ( "bufio" + "github.com/cometbft/cometbft/libs/cli" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/keys" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" - "github.com/tendermint/tendermint/libs/cli" "github.com/cosmos/cosmos-sdk/crypto/keyring" ethclient "github.com/evmos/ethermint/client" @@ -100,7 +100,7 @@ func runAddCmd(cmd *cobra.Command, args []string) error { eth, _ := cmd.Flags().GetBool(ethFlag) if eth { cmd.Print("eth flag specified: using coin-type 60 and signing algorithm eth_secp256k1\n") - cmd.Flags().Set(flags.FlagKeyAlgorithm, string(hd.EthSecp256k1Type)) + cmd.Flags().Set(flags.FlagKeyType, string(hd.EthSecp256k1Type)) cmd.Flags().Set("coin-type", "60") } diff --git a/cmd/kava/cmd/rocksdb/compact.go b/cmd/kava/cmd/rocksdb/compact.go index 6b8faf06..4adcbfe8 100644 --- a/cmd/kava/cmd/rocksdb/compact.go +++ b/cmd/kava/cmd/rocksdb/compact.go @@ -21,7 +21,7 @@ import ( "github.com/spf13/cobra" "golang.org/x/exp/slices" - "github.com/tendermint/tendermint/libs/log" + "github.com/cometbft/cometbft/libs/log" ) const ( diff --git a/cmd/kava/cmd/root.go b/cmd/kava/cmd/root.go index 117bbce1..6b9242e7 100644 --- a/cmd/kava/cmd/root.go +++ b/cmd/kava/cmd/root.go @@ -1,6 +1,7 @@ package cmd import ( + "fmt" "os" "github.com/cosmos/cosmos-sdk/client" @@ -9,16 +10,18 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" + tmcfg "github.com/cometbft/cometbft/config" + tmcli "github.com/cometbft/cometbft/libs/cli" "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/genutil" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" ethermintclient "github.com/evmos/ethermint/client" "github.com/evmos/ethermint/crypto/hd" ethermintserver "github.com/evmos/ethermint/server" servercfg "github.com/evmos/ethermint/server/config" "github.com/spf13/cobra" - tmcfg "github.com/tendermint/tendermint/config" - tmcli "github.com/tendermint/tendermint/libs/cli" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/app/params" @@ -42,7 +45,7 @@ func NewRootCmd() *cobra.Command { WithLegacyAmino(encodingConfig.Amino). WithInput(os.Stdin). WithAccountRetriever(types.AccountRetriever{}). - WithBroadcastMode(flags.BroadcastBlock). + WithBroadcastMode(flags.FlagBroadcastMode). WithHomeDir(app.DefaultNodeHome). WithKeyringOptions(hd.EthSecp256k1Option()). WithViper(EnvPrefix) @@ -86,12 +89,17 @@ func NewRootCmd() *cobra.Command { // addSubCmds registers all the sub commands used by kava. func addSubCmds(rootCmd *cobra.Command, encodingConfig params.EncodingConfig, defaultNodeHome string) { + gentxModule, ok := app.ModuleBasics[genutiltypes.ModuleName].(genutil.AppModuleBasic) + if !ok { + panic(fmt.Errorf("expected %s module to be an instance of type %T", genutiltypes.ModuleName, genutil.AppModuleBasic{})) + } + rootCmd.AddCommand( StatusCommand(), ethermintclient.ValidateChainID( genutilcli.InitCmd(app.ModuleBasics, defaultNodeHome), ), - genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, defaultNodeHome), + genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, defaultNodeHome, gentxModule.GenTxValidator), AssertInvariantsCmd(encodingConfig), genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, defaultNodeHome), genutilcli.ValidateGenesisCmd(app.ModuleBasics), diff --git a/cmd/kava/cmd/shard.go b/cmd/kava/cmd/shard.go index c43ad7dd..215c2d82 100644 --- a/cmd/kava/cmd/shard.go +++ b/cmd/kava/cmd/shard.go @@ -10,14 +10,14 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" "github.com/cosmos/cosmos-sdk/server" + pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" "github.com/cosmos/cosmos-sdk/store/rootmulti" - tmconfig "github.com/tendermint/tendermint/config" - "github.com/tendermint/tendermint/node" - tmstate "github.com/tendermint/tendermint/state" - "github.com/tendermint/tendermint/store" + tmconfig "github.com/cometbft/cometbft/config" + "github.com/cometbft/cometbft/node" + tmstate "github.com/cometbft/cometbft/state" + "github.com/cometbft/cometbft/store" ethermintserver "github.com/evmos/ethermint/server" ) diff --git a/cmd/kava/cmd/status.go b/cmd/kava/cmd/status.go index ac6028f2..bc5165a0 100644 --- a/cmd/kava/cmd/status.go +++ b/cmd/kava/cmd/status.go @@ -5,9 +5,9 @@ import ( "github.com/spf13/cobra" - "github.com/tendermint/tendermint/libs/bytes" - "github.com/tendermint/tendermint/p2p" - coretypes "github.com/tendermint/tendermint/rpc/core/types" + "github.com/cometbft/cometbft/libs/bytes" + "github.com/cometbft/cometbft/p2p" + coretypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" diff --git a/cmd/kava/opendb/opendb.go b/cmd/kava/opendb/opendb.go index 367dfd3f..35e49abb 100644 --- a/cmd/kava/opendb/opendb.go +++ b/cmd/kava/opendb/opendb.go @@ -6,8 +6,8 @@ package opendb import ( "path/filepath" + dbm "github.com/cometbft/cometbft-db" "github.com/cosmos/cosmos-sdk/server/types" - dbm "github.com/tendermint/tm-db" ) // OpenDB is a copy of default DBOpener function used by ethermint, see for details: diff --git a/cmd/kava/opendb/opendb_rocksdb.go b/cmd/kava/opendb/opendb_rocksdb.go index 5747a284..d4c8f956 100644 --- a/cmd/kava/opendb/opendb_rocksdb.go +++ b/cmd/kava/opendb/opendb_rocksdb.go @@ -29,10 +29,10 @@ import ( "strings" "time" + dbm "github.com/cometbft/cometbft-db" "github.com/cosmos/cosmos-sdk/server/types" "github.com/linxGnu/grocksdb" "github.com/spf13/cast" - dbm "github.com/tendermint/tm-db" ) var ErrUnexpectedConfiguration = errors.New("unexpected rocksdb configuration, rocksdb should have only one column family named default") diff --git a/go.mod b/go.mod index 6a531a91..a7bebac3 100644 --- a/go.mod +++ b/go.mod @@ -1,36 +1,38 @@ module github.com/kava-labs/kava -go 1.20 +go 1.21 require ( - cosmossdk.io/errors v1.0.0-beta.7 - cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 + cosmossdk.io/errors v1.0.0 + cosmossdk.io/math v1.2.0 + cosmossdk.io/simapp v0.0.0-20231127212628-044ff4d8c015 github.com/cenkalti/backoff/v4 v4.1.3 - github.com/cometbft/cometbft-db v0.7.0 + github.com/cometbft/cometbft v0.37.4 + github.com/cometbft/cometbft-db v0.9.1 github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.46.11 + github.com/cosmos/cosmos-sdk v0.47.7 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/ibc-go/v6 v6.1.1 + github.com/cosmos/gogoproto v1.4.10 + github.com/cosmos/ibc-go/v7 v7.3.1 github.com/ethereum/go-ethereum v1.10.26 github.com/evmos/ethermint v0.21.0 github.com/go-kit/kit v0.12.0 - github.com/gogo/protobuf v1.3.3 + github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.3 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/linxGnu/grocksdb v1.8.0 - github.com/pelletier/go-toml/v2 v2.0.6 + github.com/linxGnu/grocksdb v1.8.6 + github.com/pelletier/go-toml/v2 v2.0.8 github.com/prometheus/client_golang v1.14.0 - github.com/spf13/cast v1.5.0 - github.com/spf13/cobra v1.6.1 - github.com/spf13/viper v1.15.0 - github.com/stretchr/testify v1.8.3 + github.com/spf13/cast v1.5.1 + github.com/spf13/cobra v1.7.0 + github.com/spf13/viper v1.16.0 + github.com/stretchr/testify v1.8.4 github.com/subosito/gotenv v1.4.2 - github.com/tendermint/tendermint v0.34.27 - github.com/tendermint/tm-db v0.6.7 - golang.org/x/crypto v0.14.0 - google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 - google.golang.org/grpc v1.58.3 + golang.org/x/crypto v0.15.0 + golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb + google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 + google.golang.org/grpc v1.59.0 google.golang.org/protobuf v1.31.0 sigs.k8s.io/yaml v1.3.0 ) @@ -41,69 +43,76 @@ require ( cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v1.1.2 // indirect cloud.google.com/go/storage v1.30.1 // indirect - filippo.io/edwards25519 v1.0.0-rc.1 // indirect + cosmossdk.io/api v0.3.1 // indirect + cosmossdk.io/core v0.6.1 // indirect + cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/log v1.2.1 // indirect + cosmossdk.io/tools/rosetta v0.2.1 // indirect + filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/VictoriaMetrics/fastcache v1.6.0 // indirect - github.com/Workiva/go-datastructures v1.0.53 // indirect github.com/allegro/bigcache v1.2.1 // indirect github.com/armon/go-metrics v0.4.1 // indirect - github.com/aws/aws-sdk-go v1.44.122 // indirect + github.com/aws/aws-sdk-go v1.44.203 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect - github.com/bgentry/speakeasy v0.1.0 // indirect + github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/btcsuite/btcd v0.23.4 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/btcutil v1.1.3 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect + github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect + github.com/cockroachdb/errors v1.10.0 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/redact v1.1.5 // indirect github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect github.com/confio/ics23/go v0.9.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/gogoproto v1.4.6 // indirect - github.com/cosmos/iavl v0.19.5 // indirect + github.com/cosmos/gogogateway v1.2.0 // indirect + github.com/cosmos/iavl v0.20.1 // indirect + github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.1 // indirect - github.com/creachadair/taskgroup v0.3.2 // indirect + github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect + github.com/creachadair/taskgroup v0.4.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/deckarep/golang-set v1.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect - github.com/dgraph-io/badger/v3 v3.2103.2 // indirect - github.com/dgraph-io/ristretto v0.1.0 // indirect + github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91 // indirect github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf // indirect - github.com/dustin/go-humanize v1.0.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/edsrzf/mmap-go v1.0.0 // indirect - github.com/felixge/httpsnoop v1.0.1 // indirect + github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect - github.com/gin-gonic/gin v1.8.1 // indirect + github.com/getsentry/sentry-go v0.23.0 // indirect github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-playground/validator/v10 v10.11.1 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/go-stack/stack v1.8.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/gogo/gateway v1.1.0 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/gogo/googleapis v1.4.1 // indirect + github.com/golang/glog v1.1.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/flatbuffers v1.12.1 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/s2a-go v0.1.4 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/gorilla/handlers v1.5.1 // indirect @@ -119,23 +128,25 @@ require ( github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect + github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.2.1 // indirect + github.com/huandu/skiplist v1.2.0 // indirect github.com/huin/goupnp v1.0.3 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect - github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.15 // indirect + github.com/klauspost/compress v1.16.7 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect @@ -143,81 +154,72 @@ require ( github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect + github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.40.0 // indirect + github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.9.0 // indirect github.com/prometheus/tsdb v0.7.1 // indirect github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/regen-network/cosmos-proto v0.3.1 // indirect github.com/rjeczalik/notify v0.9.1 // indirect - github.com/rogpeppe/go-internal v1.9.0 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.29.0 // indirect + github.com/rs/zerolog v1.30.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect - github.com/spf13/afero v1.9.3 // indirect + github.com/spf13/afero v1.9.5 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/status-im/keycard-go v0.2.0 // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.5.0 // indirect + github.com/tidwall/btree v1.6.0 // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.4.0 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect - github.com/ugorji/go/codec v1.2.7 // indirect - github.com/ulikunitz/xz v0.5.10 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.2 // indirect - go.etcd.io/bbolt v1.3.7 // indirect + github.com/ulikunitz/xz v0.5.11 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.3.8 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/oauth2 v0.10.0 // indirect + golang.org/x/net v0.18.0 // indirect + golang.org/x/oauth2 v0.11.0 // indirect golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/term v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect + golang.org/x/sys v0.14.0 // indirect + golang.org/x/term v0.14.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.128.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c // indirect + google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect + pgregory.net/rapid v0.5.5 // indirect ) replace ( // Use the cosmos keyring code github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - // Use rocksdb 7.9.2 - github.com/cometbft/cometbft-db => github.com/kava-labs/cometbft-db v0.7.0-rocksdb-v7.9.2-kava.1 + // Use cometbft fork of tendermint + github.com/cometbft/cometbft => github.com/kava-labs/cometbft v0.37.4-kava.1 + github.com/cometbft/cometbft-db => github.com/kava-labs/cometbft-db v0.9.1-kava.1 // Use cosmos-sdk fork with backported fix for unsafe-reset-all, staking transfer events, and custom tally handler support - github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.46.11-kava.4 + github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.47.7-kava.1 // See https://github.com/cosmos/cosmos-sdk/pull/13093 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 // Use ethermint fork that respects min-gas-price with NoBaseFee true and london enabled, and includes eip712 support - github.com/evmos/ethermint => github.com/kava-labs/ethermint v0.21.0-kava-v24-1 + github.com/evmos/ethermint => github.com/kava-labs/ethermint v0.21.0-kava-v26.1 // See https://github.com/cosmos/cosmos-sdk/pull/10401, https://github.com/cosmos/cosmos-sdk/commit/0592ba6158cd0bf49d894be1cef4faeec59e8320 - github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 - // Use the cosmos modified protobufs - github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 + github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 // Downgraded to avoid bugs in following commits which causes "version does not exist" errors github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - // Use cometbft fork of tendermint - github.com/tendermint/tendermint => github.com/kava-labs/cometbft v0.34.27-kava.1 - // Indirect dependencies still use tendermint/tm-db - github.com/tendermint/tm-db => github.com/kava-labs/tm-db v0.6.7-kava.4 ) diff --git a/go.sum b/go.sum index dc4ab787..545843fa 100644 --- a/go.sum +++ b/go.sum @@ -191,13 +191,26 @@ cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuW cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= -cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= -cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= -cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= +cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= +cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= +cosmossdk.io/core v0.6.1 h1:OBy7TI2W+/gyn2z40vVvruK3di+cAluinA6cybFbE7s= +cosmossdk.io/core v0.6.1/go.mod h1:g3MMBCBXtxbDWBURDVnJE7XML4BG5qENhs0gzkcpuFA= +cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= +cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= +cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= +cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk= +cosmossdk.io/log v1.2.1/go.mod h1:GNSCc/6+DhFIj1aLn/j7Id7PaO8DzNylUZoOYBL9+I4= +cosmossdk.io/math v1.2.0 h1:8gudhTkkD3NxOP2YyyJIYYmt6dQ55ZfJkDOaxXpy7Ig= +cosmossdk.io/math v1.2.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= +cosmossdk.io/simapp v0.0.0-20231127212628-044ff4d8c015 h1:ARUqouMWNreV8e5wxPberry+tm+Uk+1eeJDt3KXQEn0= +cosmossdk.io/simapp v0.0.0-20231127212628-044ff4d8c015/go.mod h1:VNknW36ZIgwkjKtb6eyA4RZ7x9+ZpKMVCsAUA6bFWnk= +cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= +cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= +filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= @@ -206,16 +219,19 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3 github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= +github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -227,10 +243,9 @@ github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig= -github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -256,8 +271,9 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.44.122 h1:p6mw01WBaNpbdP2xrisz5tIkcNwzj/HysobNoaAHjgo= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.203 h1:pcsP805b9acL3wUqa4JR2vg1k2wnItkDYNvfmcy6F+U= +github.com/aws/aws-sdk-go v1.44.203/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= @@ -274,8 +290,9 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= -github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= +github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= @@ -310,7 +327,12 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= +github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= @@ -327,12 +349,18 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= +github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= +github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= +github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= @@ -350,6 +378,12 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU= +github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= @@ -361,11 +395,12 @@ github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSM github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= github.com/consensys/gnark-crypto v0.5.3/go.mod h1:hOdPlWQV1gDLp7faZVeg8Y0iEPFaOUnCc4XeCCk96p0= 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= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= @@ -374,23 +409,30 @@ github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960Bvc github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= -github.com/cosmos/gogoproto v1.4.6 h1:Ee7z15dWJaGlgM2rWrK8N2IX7PQcuccu8oG68jp5RL4= -github.com/cosmos/gogoproto v1.4.6/go.mod h1:VS/ASYmPgv6zkPKLjR9EB91lwbLHOzaGCirmKKhncfI= -github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY= -github.com/cosmos/iavl v0.19.5/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/ibc-go/v6 v6.1.1 h1:oqqMNyjj6SLQF8rvgCaDGwfdITEIsbhs8F77/8xvRIo= -github.com/cosmos/ibc-go/v6 v6.1.1/go.mod h1:NL17FpFAaWjRFVb1T7LUKuOoMSsATPpu+Icc4zL5/Ik= +github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= +github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= +github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= +github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= +github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= +github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= +github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/ibc-go/v7 v7.3.1 h1:bil1IjnHdyWDASFYKfwdRiNtFP6WK3osW7QFEAgU4I8= +github.com/cosmos/ibc-go/v7 v7.3.1/go.mod h1:wvx4pPBofe5ZdMNV3OFRxSI4auEP5Qfqf8JXLLNV04g= +github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= +github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.13.1 h1:12ac9+GwBb9BjP7X5ygpFk09Itwzjzfmg6A2CWFjoVs= github.com/cosmos/ledger-cosmos-go v0.13.1/go.mod h1:5tv2RVJEd2+Y38TIQN4CRjJeQGyqOEiKJDfqhk5UjqE= +github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= +github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6VqkYlkM= -github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= +github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= +github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= @@ -415,12 +457,10 @@ github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/badger/v3 v3.2103.2 h1:dpyM5eCJAtQCBcMCZcT4UBZchuTJgCywerHHgmxfxM8= -github.com/dgraph-io/badger/v3 v3.2103.2/go.mod h1:RHo4/GmYcKKh5Lxu63wLEMHJ70Pac2JqZRYGhlyAo2M= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= -github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= +github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= +github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= @@ -432,14 +472,17 @@ github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/ github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf h1:Yt+4K30SdjOkRoRRm3vYNQgR+/ZIy0RmeUDZo7Y8zeQ= github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= @@ -464,15 +507,18 @@ github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqB github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= +github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -481,14 +527,18 @@ github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqG github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= +github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= +github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= -github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= +github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -502,25 +552,23 @@ github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBj github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= -github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= -github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= -github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= +github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -529,27 +577,37 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= +github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= -github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= +github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= +github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= +github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -596,8 +654,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= -github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -616,14 +672,16 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa h1:Q75Upo5UN4JbPFURXZ8nLKYUvF85dyFRop/vQ0Rv+64= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -649,8 +707,9 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= @@ -688,7 +747,6 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaD github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -738,14 +796,18 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= -github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= +github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= +github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/holiman/uint256 v1.2.1 h1:XRtyuda/zw2l+Bq/38n5XUoEF72aSOu/77Thd9pPp2o= github.com/holiman/uint256 v1.2.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= +github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= +github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= +github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= @@ -756,8 +818,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1: github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= @@ -775,7 +837,8 @@ github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+ github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b h1:izTof8BKh/nE1wrKOrloNA5q4odOarjf+Xpe+4qow98= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -802,16 +865,16 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/kava-labs/cometbft v0.34.27-kava.1 h1:JkTspNCrz9matgrr7nsWgEkgNzDz5YwZhR5jZyxVt/0= -github.com/kava-labs/cometbft v0.34.27-kava.1/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw= -github.com/kava-labs/cometbft-db v0.7.0-rocksdb-v7.9.2-kava.1 h1:EZnZAkZ+dqK+1OM4AK+e6wYH8a5xuyg4yFTR4Ez3AXk= -github.com/kava-labs/cometbft-db v0.7.0-rocksdb-v7.9.2-kava.1/go.mod h1:mI/4J4IxRzPrXvMiwefrt0fucGwaQ5Hm9IKS7HnoJeI= -github.com/kava-labs/cosmos-sdk v0.46.11-kava.4 h1:lCcClhrGCwHunwbSG/zmY8o/g8rE6GYH1x2OOPMkk0g= -github.com/kava-labs/cosmos-sdk v0.46.11-kava.4/go.mod h1:VVdf1w8CSIhh4FnlxOGVVAlvUnvXrS8VV6DwUBCuAOs= -github.com/kava-labs/ethermint v0.21.0-kava-v24-1 h1:XgEeXbLtGpOxSt7yFVznrjics5mRsUpMMfqlrhhH2pc= -github.com/kava-labs/ethermint v0.21.0-kava-v24-1/go.mod h1:rdm6AinxZ4dzPEv/cjH+/AGyTbKufJ3RE7M2MDyklH0= -github.com/kava-labs/tm-db v0.6.7-kava.4 h1:M2RibOKmbi+k2OhAFry8z9+RJF0CYuDETB7/PrSdoro= -github.com/kava-labs/tm-db v0.6.7-kava.4/go.mod h1:70tpLhNfwCP64nAlq+bU+rOiVfWr3Nnju1D1nhGDGKs= +github.com/kava-labs/cometbft v0.37.4-kava.1 h1:QRuyBieWdUBpe4pcXgzu1SdMH2lkTaqXr/JPIeqdiHE= +github.com/kava-labs/cometbft v0.37.4-kava.1/go.mod h1:Cmg5Hp4sNpapm7j+x0xRyt2g0juQfmB752ous+pA0G8= +github.com/kava-labs/cometbft-db v0.9.1-kava.1 h1:0KmSPdXYdRp6TsgKuMxRnMZCMEGC5ysIVjuJddYr4tw= +github.com/kava-labs/cometbft-db v0.9.1-kava.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= +github.com/kava-labs/cosmos-sdk v0.47.7-kava.1 h1:35qRvLNoOSOmmDSQt2rm0q7YB+DamcJHjYzjuKvsYs8= +github.com/kava-labs/cosmos-sdk v0.47.7-kava.1/go.mod h1:7ODtonLpPpUXz1euAxNbpZEZTSnq61dibiA3X/5/oYU= +github.com/kava-labs/ethermint v0.21.0-kava-v26.1 h1:r3qsh5NayHHFlGE+RVm9z3QfWATK/o7diV3QiOvpCC4= +github.com/kava-labs/ethermint v0.21.0-kava-v26.1/go.mod h1:uEdzacGhmWtSZPm9MJA3UkjoXOv2e8lLlE03wKTHQI8= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= @@ -820,9 +883,12 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= -github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= +github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -833,6 +899,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -841,7 +908,6 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -851,8 +917,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= -github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= +github.com/linxGnu/grocksdb v1.8.6 h1:O7I6SIGPrypf3f/gmrrLUBQDKfO8uOoYdWf4gLS06tc= +github.com/linxGnu/grocksdb v1.8.6/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -878,8 +944,9 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -939,8 +1006,9 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -950,18 +1018,24 @@ github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo/v2 v2.9.1 h1:zie5Ly042PD3bsCvsSOPvRnFwyo3rKe64TJlD6nu0mk= +github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= +github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -972,6 +1046,7 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -979,17 +1054,20 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= +github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= -github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1025,8 +1103,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.40.0 h1:Afz7EVRqGg2Mqqf4JuF9vdvp1pi220m55Pi9T2JnO4Q= -github.com/prometheus/common v0.40.0/go.mod h1:L65ZJPSmfn/UBWLQIHV7dBrKFidB/wPlF1y5TlSt9OE= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1042,10 +1120,6 @@ github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Ung github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= -github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= -github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= -github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= @@ -1054,14 +1128,15 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w= -github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c= +github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1084,6 +1159,7 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1092,15 +1168,15 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= -github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -1109,8 +1185,8 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= @@ -1132,23 +1208,23 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.5.0 h1:iV0yVY/frd7r6qGBXfEYs7DH0gTDgrKTrDjS7xt/IyQ= -github.com/tidwall/btree v1.5.0/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE= +github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= +github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= @@ -1156,25 +1232,25 @@ github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZF github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= -github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= +github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= +github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= +github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= +github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= @@ -1185,6 +1261,7 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1192,13 +1269,13 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.2 h1:NDaba434N7JUVKg4P4nFv6TOjSkUosYb9sdiw3c61Zk= -github.com/zondax/ledger-go v0.14.2/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= -go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= +go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1221,6 +1298,8 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1243,11 +1322,11 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1262,8 +1341,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb h1:PaBZQdo+iSDyHT053FjUCgZQ/9uqVwPOcl7KSWhKn6w= -golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= +golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1291,7 +1370,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1358,8 +1438,10 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1385,8 +1467,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= -golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU= +golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1495,6 +1577,8 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1507,15 +1591,21 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= +golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1527,18 +1617,23 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1586,7 +1681,6 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1601,6 +1695,7 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1700,7 +1795,6 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1752,6 +1846,7 @@ google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2 google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= @@ -1786,15 +1881,14 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 h1:SeZZZx0cP0fqUyA+oRzP9k7cSwJlvDFiROO72uwD6i0= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk= -google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 h1:U7+wNaVuSTaUqNvK2+osJ9ejEZxbjHHk8F2b6Hpx0AE= -google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:RdyHbowztCGQySiCvQPgWQWgWhGnouTdCflKoDBt32U= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c h1:jHkCUWkseRf+W+edG5hMzr/Uh1xkDREY4caybAq4dpY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= +google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a h1:fwgW9j3vHirt4ObdHoYNwuO24BEZjSzbh+zPaNWoiY8= +google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:EMfReVxb80Dq1hhioy0sOsY9jCE46YDgHlJ7fWVUWRE= +google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= +google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1834,8 +1928,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= -google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1890,7 +1984,10 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= +gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1903,6 +2000,7 @@ honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= +pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/proto/kava/bep3/v1beta1/bep3.proto b/proto/kava/bep3/v1beta1/bep3.proto index 31119ec9..9b6825c0 100644 --- a/proto/kava/bep3/v1beta1/bep3.proto +++ b/proto/kava/bep3/v1beta1/bep3.proto @@ -113,7 +113,7 @@ message AtomicSwap { (gogoproto.nullable) = false ]; // random_number_hash represents the hash of the random number - bytes random_number_hash = 2 [(gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes"]; + bytes random_number_hash = 2 [(gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; // expire_height represents the height when the swap expires uint64 expire_height = 3; // timestamp represents the timestamp of the swap diff --git a/simulations/Dockerfile b/simulations/Dockerfile deleted file mode 100644 index 42309096..00000000 --- a/simulations/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM golang:1.13-alpine AS build-env - -# Set up dependencies -# bash for debugging -# git, make for installation -# libc-dev, gcc, linux-headers, eudev-dev are used for cgo and ledger installation (possibly) -RUN apk add bash git make libc-dev gcc linux-headers eudev-dev jq - -# Install aws cli -RUN apk add python py-pip -RUN pip install awscli - -# Set working directory for the build -WORKDIR /root/kava -# default home directory is /root - -# Download dependencies before adding source files to speed up build times -COPY go.mod . -COPY go.sum . -RUN go mod download - -# Add source files -COPY app app -COPY cli_test cli_test -COPY cmd cmd -COPY app app -COPY x x -COPY Makefile . - -COPY simulations simulations - -# kvd and kcli binaries are not necessary for running the simulations \ No newline at end of file diff --git a/simulations/README.md b/simulations/README.md deleted file mode 100644 index 4f48f16b..00000000 --- a/simulations/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# How To Run Sims In The Cloud - -Sims run with AWS batch, with results uploaded to S3 - -## AWS Batch - -In AWS batch you define: - -- a "compute environment"--just how many machines you want (and of what kind) -- a "job queue"--just a place to put jobs (pairs them with a compute environment) -- a "job definition"--a template for jobs - -Then to run stuff you create "jobs" and submit them to a job queue. - -The number of machines running auto-scales to match the number of jobs. When there are no jobs there are no machines, so you don't pay for anything. - -Jobs are defined as a docker image (assumed hosted on dockerhub) and a command string. ->e.g. `kava/kava-sim:version1`, `go test ./app` - -This can run sims but doesn't collect the results. This is handled by a custom script. - -## Running sims and uploading to S3 - -The dockerfile in this repo defines the docker image to run sims. It includes the kava source code, aws cli, and the custom simulation script. - -The custom script reads some input args, runs a sim and uploads the stdout and stderr to a S3 bucket. - -AWS Batch allows for "array jobs" which are a way of specifying many duplicates of a job, each with a different index passed in as an env var. - -### Steps - -- create and submit a new array job (based of the job definition) with - - image `kava/kava-sim:` - - command `run-then-upload.sh TestFullAppSimulation ` - - array size of how many sims you want to run -- any changes needed to the code or script necessitates a rebuild: - - `docker build -f simulations/Dockerfile -t kava/kava-sim: .` - - `docker push kava/kava-sim:` - -### Tips - -- click on the compute environment name, to get details, then click the link ECS Cluster Name to get details on the actual machines running -- for array jobs, click the job name to get details of the individual jobs diff --git a/simulations/run-then-upload.sh b/simulations/run-then-upload.sh deleted file mode 100755 index d44fd6cf..00000000 --- a/simulations/run-then-upload.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# This requires AWS access keys envs to be set (ie AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) -# These need to be generated from the AWS console. - -# For commands passed to the docker container, the working directory is /root/kava (which is the blockchain git repo). - - -# Parse Input Args -# get simulation type, eg TestFullAppSimulation -simType=$1 -# get seed -startingSeed=$2 -# compute the seed from the starting and the job index -# add two nums together, hence the $(()), and use 0 as the default value for array index, hence the ${:-} syntax -seed=$(($startingSeed+${AWS_BATCH_JOB_ARRAY_INDEX:-0})) -# get sim parameters -numBlocks=$3 -blockSize=$4 - - -# Run The Sim -# record cli arguments in the log file (in json in case we need to parse this) and stdout (https://stackoverflow.com/questions/418896/how-to-redirect-output-to-a-file-and-stdout) -printf "{\"simType\": \"%s\", \"startingSeed\": %s, \"seed\": %s, \"numBlocks\": %s, \"blockSize\": %s}\n" $simType $startingSeed $seed $numBlocks $blockSize | tee out.log -# run sim and redirect stdout and stderr to a file) -go test ./app -run $simType -Enabled=true -NumBlocks=$numBlocks -BlockSize=$blockSize -Commit=true -Period=5 -Seed=$seed -v -timeout 24h >> out.log 2>&1 -# get the exit code to determine how to upload results -simExitStatus=$? -if [ $simExitStatus -eq 0 ];then - echo "simulation passed" - simResult="pass" -else - echo "simulation failed" - simResult="fail" -fi - - -# Upload Sim Results To S3 -# read in the job id, using a default value if not set -jobID=${AWS_BATCH_JOB_ID:-"testJobID:"} -# job id format is "job-id:array-job-index", this removes trailing colon (and array index if present) https://stackoverflow.com/questions/3045493/parse-string-with-bash-and-extract-number -jobID=$(echo $jobID | sed 's/\(.*\):\d*/\1/') - -# create the filename from the array job index (which won't be set if this is a normal job) -fileName=$(printf "out%05d.log" $AWS_BATCH_JOB_ARRAY_INDEX) - -aws s3 cp out.log s3://simulations-1/$SIM_NAME$jobID/$simResult/$fileName \ No newline at end of file diff --git a/tests/e2e/.env b/tests/e2e/.env index fbd211dd..1d44f10b 100644 --- a/tests/e2e/.env +++ b/tests/e2e/.env @@ -8,7 +8,7 @@ E2E_RUN_KVTOOL_NETWORKS=true # E2E_KVTOOL_KAVA_CONFIG_TEMPLATE is the kvtool template used to start the chain. See the `kava.configTemplate` flag in kvtool. # Note that the config tempalte must support overriding the docker image tag via the KAVA_TAG variable. -E2E_KVTOOL_KAVA_CONFIG_TEMPLATE="master" +E2E_KVTOOL_KAVA_CONFIG_TEMPLATE="v0.26" # E2E_INCLUDE_IBC_TESTS when true will start a 2nd chain & open an IBC channel. It will enable all IBC tests. E2E_INCLUDE_IBC_TESTS=true diff --git a/tests/e2e/e2e_community_update_params_test.go b/tests/e2e/e2e_community_update_params_test.go index 301f7ed6..59fe0ccb 100644 --- a/tests/e2e/e2e_community_update_params_test.go +++ b/tests/e2e/e2e_community_update_params_test.go @@ -116,9 +116,11 @@ func (suite *IntegrationTestSuite) TestCommunityUpdateParams_Authority() { proposalMsg, err := govv1.NewMsgSubmitProposal( []sdk.Msg{&updateParamsMsg}, - govParamsRes.DepositParams.MinDeposit, + govParamsRes.Params.MinDeposit, kavaAcc.SdkAddress.String(), "community-update-params", + "title", + "summary", ) suite.NoError(err) diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 6ae43087..63e63c46 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -13,8 +13,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - ibctypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types" - ibcclienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types" + ibctypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" ethtypes "github.com/ethereum/go-ethereum/core/types" emtypes "github.com/evmos/ethermint/types" diff --git a/tests/e2e/runner/chain.go b/tests/e2e/runner/chain.go index c9969671..b11d6179 100644 --- a/tests/e2e/runner/chain.go +++ b/tests/e2e/runner/chain.go @@ -4,8 +4,8 @@ import ( "errors" "fmt" + rpchttpclient "github.com/cometbft/cometbft/rpc/client/http" "github.com/ethereum/go-ethereum/ethclient" - rpchttpclient "github.com/tendermint/tendermint/rpc/client/http" ) var ( diff --git a/tests/e2e/testutil/chain.go b/tests/e2e/testutil/chain.go index dfd38457..c0586070 100644 --- a/tests/e2e/testutil/chain.go +++ b/tests/e2e/testutil/chain.go @@ -8,14 +8,14 @@ import ( "github.com/stretchr/testify/require" + tmclient "github.com/cometbft/cometbft/rpc/client" + coretypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" evmhd "github.com/evmos/ethermint/crypto/hd" - tmclient "github.com/tendermint/tendermint/rpc/client" - coretypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" diff --git a/tests/util/events.go b/tests/util/events.go index 26bdc5fc..2d4ce611 100644 --- a/tests/util/events.go +++ b/tests/util/events.go @@ -1,7 +1,7 @@ package util import ( - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" ) // FilterEventsByType returns a slice of events that match the given type. diff --git a/tests/util/sdksigner.go b/tests/util/sdksigner.go index a81e0fb3..a37676ff 100644 --- a/tests/util/sdksigner.go +++ b/tests/util/sdksigner.go @@ -11,6 +11,7 @@ import ( grpcstatus "google.golang.org/grpc/status" errorsmod "cosmossdk.io/errors" + tmmempool "github.com/cometbft/cometbft/mempool" sdkclient "github.com/cosmos/cosmos-sdk/client" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -19,7 +20,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - tmmempool "github.com/tendermint/tendermint/mempool" ) var ( diff --git a/third_party/proto/amino/amino.proto b/third_party/proto/amino/amino.proto new file mode 100644 index 00000000..e1cc6929 --- /dev/null +++ b/third_party/proto/amino/amino.proto @@ -0,0 +1,79 @@ +syntax = "proto3"; + +package amino; + +import "google/protobuf/descriptor.proto"; + +// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/tx/amino"; + +extend google.protobuf.MessageOptions { + // name is the string used when registering a concrete + // type into the Amino type registry, via the Amino codec's + // `RegisterConcrete()` method. This string MUST be at most 39 + // characters long, or else the message will be rejected by the + // Ledger hardware device. + string name = 11110001; + + // encoding describes the encoding format used by Amino for the given + // message. The field type is chosen to be a string for + // flexibility, but it should ideally be short and expected to be + // machine-readable, for example "base64" or "utf8_json". We + // highly recommend to use underscores for word separation instead of spaces. + // + // If left empty, then the Amino encoding is expected to be the same as the + // Protobuf one. + // + // This annotation should not be confused with the `encoding` + // one which operates on the field level. + string message_encoding = 11110002; +} + +extend google.protobuf.FieldOptions { + // encoding describes the encoding format used by Amino for + // the given field. The field type is chosen to be a string for + // flexibility, but it should ideally be short and expected to be + // machine-readable, for example "base64" or "utf8_json". We + // highly recommend to use underscores for word separation instead of spaces. + // + // If left empty, then the Amino encoding is expected to be the same as the + // Protobuf one. + // + // This annotation should not be confused with the + // `message_encoding` one which operates on the message level. + string encoding = 11110003; + + // field_name sets a different field name (i.e. key name) in + // the amino JSON object for the given field. + // + // Example: + // + // message Foo { + // string bar = 1 [(amino.field_name) = "baz"]; + // } + // + // Then the Amino encoding of Foo will be: + // `{"baz":"some value"}` + string field_name = 11110004; + + // dont_omitempty sets the field in the JSON object even if + // its value is empty, i.e. equal to the Golang zero value. To learn what + // the zero values are, see https://go.dev/ref/spec#The_zero_value. + // + // Fields default to `omitempty`, which is the default behavior when this + // annotation is unset. When set to true, then the field value in the + // JSON object will be set, i.e. not `undefined`. + // + // Example: + // + // message Foo { + // string bar = 1; + // string baz = 2 [(amino.dont_omitempty) = true]; + // } + // + // f := Foo{}; + // out := AminoJSONEncoder(&f); + // out == {"baz":""} + bool dont_omitempty = 11110005; +} diff --git a/third_party/proto/cosmos/app/runtime/v1alpha1/module.proto b/third_party/proto/cosmos/app/runtime/v1alpha1/module.proto new file mode 100644 index 00000000..4598ba44 --- /dev/null +++ b/third_party/proto/cosmos/app/runtime/v1alpha1/module.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +package cosmos.app.runtime.v1alpha1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the runtime module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/runtime" + use_package: {name: "cosmos.app.v1alpha1"} + }; + + // app_name is the name of the app. + string app_name = 1; + + // begin_blockers specifies the module names of begin blockers + // to call in the order in which they should be called. If this is left empty + // no begin blocker will be registered. + repeated string begin_blockers = 2; + + // end_blockers specifies the module names of the end blockers + // to call in the order in which they should be called. If this is left empty + // no end blocker will be registered. + repeated string end_blockers = 3; + + // init_genesis specifies the module names of init genesis functions + // to call in the order in which they should be called. If this is left empty + // no init genesis function will be registered. + repeated string init_genesis = 4; + + // export_genesis specifies the order in which to export module genesis data. + // If this is left empty, the init_genesis order will be used for export genesis + // if it is specified. + repeated string export_genesis = 5; + + // override_store_keys is an optional list of overrides for the module store keys + // to be used in keeper construction. + repeated StoreKeyConfig override_store_keys = 6; +} + +// StoreKeyConfig may be supplied to override the default module store key, which +// is the module name. +message StoreKeyConfig { + // name of the module to override the store key of + string module_name = 1; + + // the kv store key to use instead of the module name. + string kv_store_key = 2; +} diff --git a/third_party/proto/cosmos/app/v1alpha1/config.proto b/third_party/proto/cosmos/app/v1alpha1/config.proto index ed775006..ee3e7065 100644 --- a/third_party/proto/cosmos/app/v1alpha1/config.proto +++ b/third_party/proto/cosmos/app/v1alpha1/config.proto @@ -14,6 +14,11 @@ import "google/protobuf/any.proto"; message Config { // modules are the module configurations for the app. repeated ModuleConfig modules = 1; + + // golang_bindings specifies explicit interface to implementation type bindings which + // depinject uses to resolve interface inputs to provider functions. The scope of this + // field's configuration is global (not module specific). + repeated GolangBinding golang_bindings = 2; } // ModuleConfig is a module configuration for an app. @@ -33,4 +38,18 @@ message ModuleConfig { // config is the config object for the module. Module config messages should // define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. google.protobuf.Any config = 2; + + // golang_bindings specifies explicit interface to implementation type bindings which + // depinject uses to resolve interface inputs to provider functions. The scope of this + // field's configuration is module specific. + repeated GolangBinding golang_bindings = 3; } + +// GolangBinding is an explicit interface type to implementing type binding for dependency injection. +message GolangBinding { + // interface_type is the interface type which will be bound to a specific implementation type + string interface_type = 1; + + // implementation is the implementing type which will be supplied when an input of type interface is requested + string implementation = 2; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/auth/module/v1/module.proto b/third_party/proto/cosmos/auth/module/v1/module.proto new file mode 100644 index 00000000..dbe46a15 --- /dev/null +++ b/third_party/proto/cosmos/auth/module/v1/module.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package cosmos.auth.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the auth module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/auth" + }; + + // bech32_prefix is the bech32 account prefix for the app. + string bech32_prefix = 1; + + // module_account_permissions are module account permissions. + repeated ModuleAccountPermission module_account_permissions = 2; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 3; +} + +// ModuleAccountPermission represents permissions for a module account. +message ModuleAccountPermission { + // account is the name of the module. + string account = 1; + + // permissions are the permissions this module has. Currently recognized + // values are minter, burner and staking. + repeated string permissions = 2; +} diff --git a/third_party/proto/cosmos/auth/v1beta1/auth.proto b/third_party/proto/cosmos/auth/v1beta1/auth.proto index 963c6f15..0578453c 100644 --- a/third_party/proto/cosmos/auth/v1beta1/auth.proto +++ b/third_party/proto/cosmos/auth/v1beta1/auth.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package cosmos.auth.v1beta1; +import "amino/amino.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; @@ -11,33 +12,43 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; // for basic account functionality. Any custom account type should extend this // type for additional functionality (e.g. vesting). message BaseAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.equal) = false; - - option (cosmos_proto.implements_interface) = "AccountI"; + option (amino.name) = "cosmos-sdk/BaseAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI"; string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty"]; + google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty", (amino.field_name) = "public_key"]; uint64 account_number = 3; uint64 sequence = 4; } // ModuleAccount defines an account for modules that holds coins on a pool. message ModuleAccount { + option (amino.name) = "cosmos-sdk/ModuleAccount"; option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (cosmos_proto.implements_interface) = "ModuleAccountI"; + option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.ModuleAccountI"; BaseAccount base_account = 1 [(gogoproto.embed) = true]; string name = 2; repeated string permissions = 3; } +// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. +// +// Since: cosmos-sdk 0.47 +message ModuleCredential { + // module_name is the name of the module used for address derivation (passed into address.Module). + string module_name = 1; + // derivation_keys is for deriving a module account address (passed into address.Module) + // adding more keys creates sub-account addresses (passed into address.Derive) + repeated bytes derivation_keys = 2; +} + // Params defines the parameters for the auth module. message Params { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; + option (amino.name) = "cosmos-sdk/x/auth/Params"; + option (gogoproto.equal) = true; uint64 max_memo_characters = 1; uint64 tx_sig_limit = 2; diff --git a/third_party/proto/cosmos/auth/v1beta1/genesis.proto b/third_party/proto/cosmos/auth/v1beta1/genesis.proto index c88b94ee..d1aa66e4 100644 --- a/third_party/proto/cosmos/auth/v1beta1/genesis.proto +++ b/third_party/proto/cosmos/auth/v1beta1/genesis.proto @@ -4,13 +4,14 @@ package cosmos.auth.v1beta1; import "google/protobuf/any.proto"; import "gogoproto/gogo.proto"; import "cosmos/auth/v1beta1/auth.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; // GenesisState defines the auth module's genesis state. message GenesisState { - // params defines all the paramaters of the module. - Params params = 1 [(gogoproto.nullable) = false]; + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // accounts are the accounts present at genesis. repeated google.protobuf.Any accounts = 2; diff --git a/third_party/proto/cosmos/auth/v1beta1/query.proto b/third_party/proto/cosmos/auth/v1beta1/query.proto index 1775f128..804f2ff0 100644 --- a/third_party/proto/cosmos/auth/v1beta1/query.proto +++ b/third_party/proto/cosmos/auth/v1beta1/query.proto @@ -7,45 +7,55 @@ import "google/protobuf/any.proto"; import "google/api/annotations.proto"; import "cosmos/auth/v1beta1/auth.proto"; import "cosmos_proto/cosmos.proto"; +import "cosmos/query/v1/query.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; // Query defines the gRPC querier service. service Query { - // Accounts returns all the existing accounts + // Accounts returns all the existing accounts. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. // // Since: cosmos-sdk 0.43 rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/accounts"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/accounts"; } // Account returns account details based on address. rpc Account(QueryAccountRequest) returns (QueryAccountResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; } // AccountAddressByID returns account address based on account number. // // Since: cosmos-sdk 0.46.2 rpc AccountAddressByID(QueryAccountAddressByIDRequest) returns (QueryAccountAddressByIDResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/address_by_id/{id}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/address_by_id/{id}"; } // Params queries all parameters. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/params"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/params"; } // ModuleAccounts returns all the existing module accounts. // // Since: cosmos-sdk 0.46 rpc ModuleAccounts(QueryModuleAccountsRequest) returns (QueryModuleAccountsResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts"; } // ModuleAccountByName returns the module account info by module name rpc ModuleAccountByName(QueryModuleAccountByNameRequest) returns (QueryModuleAccountByNameResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts/{name}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts/{name}"; } // Bech32Prefix queries bech32Prefix @@ -68,6 +78,14 @@ service Query { rpc AddressStringToBytes(AddressStringToBytesRequest) returns (AddressStringToBytesResponse) { option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_string}"; } + + // AccountInfo queries account info which is common to all account types. + // + // Since: cosmos-sdk 0.47 + rpc AccountInfo(QueryAccountInfoRequest) returns (QueryAccountInfoResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/account_info/{address}"; + } } // QueryAccountsRequest is the request type for the Query/Accounts RPC method. @@ -83,7 +101,7 @@ message QueryAccountsRequest { // Since: cosmos-sdk 0.43 message QueryAccountsResponse { // accounts are the existing accounts - repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "AccountI"]; + repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.AccountI"]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -101,7 +119,7 @@ message QueryAccountRequest { // QueryAccountResponse is the response type for the Query/Account RPC method. message QueryAccountResponse { // account defines the account of the corresponding address. - google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "AccountI"]; + google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.AccountI"]; } // QueryParamsRequest is the request type for the Query/Params RPC method. @@ -122,7 +140,7 @@ message QueryModuleAccountsRequest {} // // Since: cosmos-sdk 0.46 message QueryModuleAccountsResponse { - repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "ModuleAccountI"]; + repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.ModuleAccountI"]; } // QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. @@ -132,7 +150,7 @@ message QueryModuleAccountByNameRequest { // QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. message QueryModuleAccountByNameResponse { - google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "ModuleAccountI"]; + google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.ModuleAccountI"]; } // Bech32PrefixRequest is the request type for Bech32Prefix rpc method. @@ -179,10 +197,17 @@ message AddressStringToBytesResponse { // // Since: cosmos-sdk 0.46.2 message QueryAccountAddressByIDRequest { + // Deprecated, use account_id instead + // // id is the account number of the address to be queried. This field // should have been an uint64 (like all account numbers), and will be // updated to uint64 in a future version of the auth query. - int64 id = 1; + int64 id = 1 [deprecated = true]; + + // account_id is the account number of the address to be queried. + // + // Since: cosmos-sdk 0.47 + uint64 account_id = 2; } // QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method @@ -191,3 +216,21 @@ message QueryAccountAddressByIDRequest { message QueryAccountAddressByIDResponse { string account_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } + +// QueryAccountInfoRequest is the Query/AccountInfo request type. +// +// Since: cosmos-sdk 0.47 +message QueryAccountInfoRequest { + + // address is the account address string. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryAccountInfoResponse is the Query/AccountInfo response type. +// +// Since: cosmos-sdk 0.47 +message QueryAccountInfoResponse { + + // info is the account info which is represented by BaseAccount. + BaseAccount info = 1; +} diff --git a/third_party/proto/cosmos/auth/v1beta1/tx.proto b/third_party/proto/cosmos/auth/v1beta1/tx.proto new file mode 100644 index 00000000..1edee037 --- /dev/null +++ b/third_party/proto/cosmos/auth/v1beta1/tx.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/auth/v1beta1/auth.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// Msg defines the x/auth Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a (governance) operation for updating the x/auth module + // parameters. The authority defaults to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/auth/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/auth parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/third_party/proto/cosmos/authz/module/v1/module.proto b/third_party/proto/cosmos/authz/module/v1/module.proto new file mode 100644 index 00000000..80058668 --- /dev/null +++ b/third_party/proto/cosmos/authz/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.authz.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the authz module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/authz" + }; +} diff --git a/third_party/proto/cosmos/authz/v1beta1/authz.proto b/third_party/proto/cosmos/authz/v1beta1/authz.proto index 06ce288a..3fee7364 100644 --- a/third_party/proto/cosmos/authz/v1beta1/authz.proto +++ b/third_party/proto/cosmos/authz/v1beta1/authz.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package cosmos.authz.v1beta1; +import "amino/amino.proto"; import "cosmos_proto/cosmos.proto"; import "google/protobuf/timestamp.proto"; import "gogoproto/gogo.proto"; @@ -13,7 +14,8 @@ option (gogoproto.goproto_getters_all) = false; // GenericAuthorization gives the grantee unrestricted permissions to execute // the provided method on behalf of the granter's account. message GenericAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; + option (amino.name) = "cosmos-sdk/GenericAuthorization"; + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; // Msg, identified by it's type URL, to grant unrestricted permissions to execute string msg = 1; @@ -22,7 +24,7 @@ message GenericAuthorization { // Grant gives permissions to execute // the provide method with expiration time. message Grant { - google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "Authorization"]; + google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "cosmos.authz.v1beta1.Authorization"]; // time when the grant will expire and will be pruned. If null, then the grant // doesn't have a time expiration (other conditions in `authorization` // may apply to invalidate the grant) @@ -35,7 +37,7 @@ message GrantAuthorization { string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "Authorization"]; + google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "cosmos.authz.v1beta1.Authorization"]; google.protobuf.Timestamp expiration = 4 [(gogoproto.stdtime) = true]; } diff --git a/third_party/proto/cosmos/authz/v1beta1/genesis.proto b/third_party/proto/cosmos/authz/v1beta1/genesis.proto index 310f6265..9fefff45 100644 --- a/third_party/proto/cosmos/authz/v1beta1/genesis.proto +++ b/third_party/proto/cosmos/authz/v1beta1/genesis.proto @@ -4,10 +4,11 @@ package cosmos.authz.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/authz/v1beta1/authz.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; // GenesisState defines the authz module's genesis state. message GenesisState { - repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false]; + repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/third_party/proto/cosmos/authz/v1beta1/tx.proto b/third_party/proto/cosmos/authz/v1beta1/tx.proto index 068218ff..69277c95 100644 --- a/third_party/proto/cosmos/authz/v1beta1/tx.proto +++ b/third_party/proto/cosmos/authz/v1beta1/tx.proto @@ -7,12 +7,15 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos/authz/v1beta1/authz.proto"; import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; option (gogoproto.goproto_getters_all) = false; // Msg defines the authz Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // Grant grants the provided authorization to the grantee on the granter's // account with the provided expiration time. If there is already a grant // for the given (granter, grantee, Authorization) triple, then the grant @@ -33,11 +36,12 @@ service Msg { // on behalf of the granter with the provided expiration time. message MsgGrant { option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgGrant"; string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - cosmos.authz.v1beta1.Grant grant = 3 [(gogoproto.nullable) = false]; + cosmos.authz.v1beta1.Grant grant = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgExecResponse defines the Msg/MsgExecResponse response type. @@ -50,12 +54,13 @@ message MsgExecResponse { // one signer corresponding to the granter of the authorization. message MsgExec { option (cosmos.msg.v1.signer) = "grantee"; + option (amino.name) = "cosmos-sdk/MsgExec"; string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // Authorization Msg requests to execute. Each msg must implement Authorization interface + // Execute Msg. // The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) // triple and validate it. - repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "sdk.Msg, authz.Authorization"]; + repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "cosmos.base.v1beta1.Msg"]; } // MsgGrantResponse defines the Msg/MsgGrant response type. @@ -65,6 +70,7 @@ message MsgGrantResponse {} // granter's account with that has been granted to the grantee. message MsgRevoke { option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgRevoke"; string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; diff --git a/third_party/proto/cosmos/autocli/v1/options.proto b/third_party/proto/cosmos/autocli/v1/options.proto new file mode 100644 index 00000000..55877512 --- /dev/null +++ b/third_party/proto/cosmos/autocli/v1/options.proto @@ -0,0 +1,127 @@ +syntax = "proto3"; + +package cosmos.autocli.v1; + +option go_package = "cosmossdk.io/api/cosmos/base/cli/v1;cliv1"; + +// ModuleOptions describes the CLI options for a Cosmos SDK module. +message ModuleOptions { + // tx describes the tx command for the module. + ServiceCommandDescriptor tx = 1; + + // query describes the tx command for the module. + ServiceCommandDescriptor query = 2; +} + +// ServiceCommandDescriptor describes a CLI command based on a protobuf service. +message ServiceCommandDescriptor { + + // service is the fully qualified name of the protobuf service to build + // the command from. It can be left empty if sub_commands are used instead + // which may be the case if a module provides multiple tx and/or query services. + string service = 1; + + // rpc_command_options are options for commands generated from rpc methods. + // If no options are specified for a given rpc method on the service, a + // command will be generated for that method with the default options. + repeated RpcCommandOptions rpc_command_options = 2; + + // sub_commands is a map of optional sub-commands for this command based on + // different protobuf services. The map key is used as the name of the + // sub-command. + map sub_commands = 3; +} + +// RpcCommandOptions specifies options for commands generated from protobuf +// rpc methods. +message RpcCommandOptions { + // rpc_method is short name of the protobuf rpc method that this command is + // generated from. + string rpc_method = 1; + + // use is the one-line usage method. It also allows specifying an alternate + // name for the command as the first word of the usage text. + // + // By default the name of an rpc command is the kebab-case short name of the + // rpc method. + string use = 2; + + // long is the long message shown in the 'help ' output. + string long = 3; + + // short is the short description shown in the 'help' output. + string short = 4; + + // example is examples of how to use the command. + string example = 5; + + // alias is an array of aliases that can be used instead of the first word in Use. + repeated string alias = 6; + + // suggest_for is an array of command names for which this command will be suggested - + // similar to aliases but only suggests. + repeated string suggest_for = 7; + + // deprecated defines, if this command is deprecated and should print this string when used. + string deprecated = 8; + + // version defines the version for this command. If this value is non-empty and the command does not + // define a "version" flag, a "version" boolean flag will be added to the command and, if specified, + // will print content of the "Version" variable. A shorthand "v" flag will also be added if the + // command does not define one. + string version = 9; + + // flag_options are options for flags generated from rpc request fields. + // By default all request fields are configured as flags. They can + // also be configured as positional args instead using positional_args. + map flag_options = 10; + + // positional_args specifies positional arguments for the command. + repeated PositionalArgDescriptor positional_args = 11; + + // skip specifies whether to skip this rpc method when generating commands. + bool skip = 12; +} + +// FlagOptions are options for flags generated from rpc request fields. +// By default, all request fields are configured as flags based on the +// kebab-case name of the field. Fields can be turned into positional arguments +// instead by using RpcCommandOptions.positional_args. +message FlagOptions { + + // name is an alternate name to use for the field flag. + string name = 1; + + // shorthand is a one-letter abbreviated flag. + string shorthand = 2; + + // usage is the help message. + string usage = 3; + + // default_value is the default value as text. + string default_value = 4; + + // default value is the default value as text if the flag is used without any value. + string no_opt_default_value = 5; + + // deprecated is the usage text to show if this flag is deprecated. + string deprecated = 6; + + // shorthand_deprecated is the usage text to show if the shorthand of this flag is deprecated. + string shorthand_deprecated = 7; + + // hidden hides the flag from help/usage text + bool hidden = 8; +} + +// PositionalArgDescriptor describes a positional argument. +message PositionalArgDescriptor { + // proto_field specifies the proto field to use as the positional arg. Any + // fields used as positional args will not have a flag generated. + string proto_field = 1; + + // varargs makes a positional parameter a varargs parameter. This can only be + // applied to last positional parameter and the proto_field must a repeated + // field. + bool varargs = 2; +} diff --git a/third_party/proto/cosmos/autocli/v1/query.proto b/third_party/proto/cosmos/autocli/v1/query.proto new file mode 100644 index 00000000..a998978e --- /dev/null +++ b/third_party/proto/cosmos/autocli/v1/query.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package cosmos.autocli.v1; + +import "cosmos/autocli/v1/options.proto"; +import "cosmos/query/v1/query.proto"; + +option go_package = "cosmossdk.io/api/cosmos/base/cli/v1;cliv1"; + +// RemoteInfoService provides clients with the information they need +// to build dynamically CLI clients for remote chains. +service Query { + // AppOptions returns the autocli options for all of the modules in an app. + rpc AppOptions(AppOptionsRequest) returns (AppOptionsResponse) { + // NOTE: autocli options SHOULD NOT be part of consensus and module_query_safe + // should be kept as false. + option (cosmos.query.v1.module_query_safe) = false; + } +} + +// AppOptionsRequest is the RemoteInfoService/AppOptions request type. +message AppOptionsRequest {} + +// AppOptionsResponse is the RemoteInfoService/AppOptions response type. +message AppOptionsResponse { + // module_options is a map of module name to autocli module options. + map module_options = 1; +} diff --git a/third_party/proto/cosmos/bank/module/v1/module.proto b/third_party/proto/cosmos/bank/module/v1/module.proto new file mode 100644 index 00000000..51e3158b --- /dev/null +++ b/third_party/proto/cosmos/bank/module/v1/module.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package cosmos.bank.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the bank module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/bank" + }; + + // blocked_module_accounts configures exceptional module accounts which should be blocked from receiving funds. + // If left empty it defaults to the list of account names supplied in the auth module configuration as + // module_account_permissions + repeated string blocked_module_accounts_override = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/bank/v1beta1/authz.proto b/third_party/proto/cosmos/bank/v1beta1/authz.proto index 4f58b15e..a8303536 100644 --- a/third_party/proto/cosmos/bank/v1beta1/authz.proto +++ b/third_party/proto/cosmos/bank/v1beta1/authz.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package cosmos.bank.v1beta1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; @@ -12,8 +13,18 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; // // Since: cosmos-sdk 0.43 message SendAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; + option (amino.name) = "cosmos-sdk/SendAuthorization"; - repeated cosmos.base.v1beta1.Coin spend_limit = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin spend_limit = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + // granter. If omitted, any recipient is allowed. + // + // Since: cosmos-sdk 0.47 + repeated string allow_list = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } diff --git a/third_party/proto/cosmos/bank/v1beta1/bank.proto b/third_party/proto/cosmos/bank/v1beta1/bank.proto index 7bc9819d..f81bb923 100644 --- a/third_party/proto/cosmos/bank/v1beta1/bank.proto +++ b/third_party/proto/cosmos/bank/v1beta1/bank.proto @@ -5,13 +5,20 @@ import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; // Params defines the parameters for the bank module. message Params { - option (gogoproto.goproto_stringer) = false; - repeated SendEnabled send_enabled = 1; + option (amino.name) = "cosmos-sdk/x/bank/Params"; + option (gogoproto.goproto_stringer) = false; + // Deprecated: Use of SendEnabled in params is deprecated. + // For genesis, use the newly added send_enabled field in the genesis object. + // Storage, lookup, and manipulation of this information is now in the keeper. + // + // As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + repeated SendEnabled send_enabled = 1 [deprecated = true]; bool default_send_enabled = 2; } @@ -32,8 +39,11 @@ message Input { option (gogoproto.goproto_getters) = false; string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin coins = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // Output models transaction outputs. @@ -42,8 +52,11 @@ message Output { option (gogoproto.goproto_getters) = false; string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin coins = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // Supply represents a struct that passively keeps track of the total supply @@ -55,10 +68,13 @@ message Supply { option (gogoproto.equal) = true; option (gogoproto.goproto_getters) = false; - option (cosmos_proto.implements_interface) = "*github.com/cosmos/cosmos-sdk/x/bank/migrations/v040.SupplyI"; + option (cosmos_proto.implements_interface) = "cosmos.bank.v1beta1.SupplyI"; - repeated cosmos.base.v1beta1.Coin total = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin total = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // DenomUnit represents a struct that describes a given diff --git a/third_party/proto/cosmos/bank/v1beta1/genesis.proto b/third_party/proto/cosmos/bank/v1beta1/genesis.proto index aa35790b..34214cfb 100644 --- a/third_party/proto/cosmos/bank/v1beta1/genesis.proto +++ b/third_party/proto/cosmos/bank/v1beta1/genesis.proto @@ -5,24 +5,33 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/bank/v1beta1/bank.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; // GenesisState defines the bank module's genesis state. message GenesisState { - // params defines all the paramaters of the module. - Params params = 1 [(gogoproto.nullable) = false]; + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // balances is an array containing the balances of all the accounts. - repeated Balance balances = 2 [(gogoproto.nullable) = false]; + repeated Balance balances = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. - repeated cosmos.base.v1beta1.Coin supply = 3 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin supply = 3 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; - // denom_metadata defines the metadata of the differents coins. - repeated Metadata denom_metadata = 4 [(gogoproto.nullable) = false]; + // denom_metadata defines the metadata of the different coins. + repeated Metadata denom_metadata = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // send_enabled defines the denoms where send is enabled or disabled. + // + // Since: cosmos-sdk 0.47 + repeated SendEnabled send_enabled = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // Balance defines an account address and balance pair used in the bank module's @@ -35,6 +44,9 @@ message Balance { string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // coins defines the different coins this balance holds. - repeated cosmos.base.v1beta1.Coin coins = 2 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } diff --git a/third_party/proto/cosmos/bank/v1beta1/query.proto b/third_party/proto/cosmos/bank/v1beta1/query.proto index 635471c4..7abc31ba 100644 --- a/third_party/proto/cosmos/bank/v1beta1/query.proto +++ b/third_party/proto/cosmos/bank/v1beta1/query.proto @@ -7,6 +7,8 @@ import "google/api/annotations.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/bank/v1beta1/bank.proto"; import "cosmos_proto/cosmos.proto"; +import "cosmos/query/v1/query.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; @@ -14,54 +16,102 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; service Query { // Balance queries the balance of a single coin for a single account. rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/by_denom"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/by_denom"; } // AllBalances queries the balance of all coins for a single account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}"; } - // SpendableBalances queries the spenable balance of all coins for a single + // SpendableBalances queries the spendable balance of all coins for a single // account. // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // // Since: cosmos-sdk 0.46 rpc SpendableBalances(QuerySpendableBalancesRequest) returns (QuerySpendableBalancesResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}"; + } + + // SpendableBalanceByDenom queries the spendable balance of a single denom for + // a single account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.47 + rpc SpendableBalanceByDenom(QuerySpendableBalanceByDenomRequest) returns (QuerySpendableBalanceByDenomResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}/by_denom"; } // TotalSupply queries the total supply of all coins. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/supply"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/supply"; } // SupplyOf queries the supply of a single coin. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/supply/by_denom"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/supply/by_denom"; } // Params queries the parameters of x/bank module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/params"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/params"; } // DenomsMetadata queries the client metadata of a given coin denomination. rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; } // DenomsMetadata queries the client metadata for all registered coin // denominations. rpc DenomsMetadata(QueryDenomsMetadataRequest) returns (QueryDenomsMetadataResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata"; } // DenomOwners queries for all account addresses that own a particular token // denomination. // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // // Since: cosmos-sdk 0.46 rpc DenomOwners(QueryDenomOwnersRequest) returns (QueryDenomOwnersResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}"; + } + + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. + // + // Since: cosmos-sdk 0.47 + rpc SendEnabled(QuerySendEnabledRequest) returns (QuerySendEnabledResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/send_enabled"; } } @@ -99,8 +149,11 @@ message QueryAllBalancesRequest { // method. message QueryAllBalancesResponse { // balances is the balances of all the coins. - repeated cosmos.base.v1beta1.Coin balances = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin balances = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -127,13 +180,41 @@ message QuerySpendableBalancesRequest { // Since: cosmos-sdk 0.46 message QuerySpendableBalancesResponse { // balances is the spendable balances of all the coins. - repeated cosmos.base.v1beta1.Coin balances = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin balances = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } +// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for +// querying an account's spendable balance for a specific denom. +// +// Since: cosmos-sdk 0.47 +message QuerySpendableBalanceByDenomRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query balances for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // denom is the coin denom to query balances for. + string denom = 2; +} + +// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for +// querying an account's spendable balance for a specific denom. +// +// Since: cosmos-sdk 0.47 +message QuerySpendableBalanceByDenomResponse { + // balance is the balance of the coin. + cosmos.base.v1beta1.Coin balance = 1; +} + + // QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC // method. message QueryTotalSupplyRequest { @@ -150,8 +231,11 @@ message QueryTotalSupplyRequest { // method message QueryTotalSupplyResponse { // supply is the supply of the coins - repeated cosmos.base.v1beta1.Coin supply = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin supply = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; // pagination defines the pagination in the response. // @@ -168,7 +252,7 @@ message QuerySupplyOfRequest { // QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. message QuerySupplyOfResponse { // amount is the supply of the coin. - cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryParamsRequest defines the request type for querying x/bank parameters. @@ -176,7 +260,7 @@ message QueryParamsRequest {} // QueryParamsResponse defines the response type for querying x/bank parameters. message QueryParamsResponse { - Params params = 1 [(gogoproto.nullable) = false]; + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. @@ -189,7 +273,7 @@ message QueryDenomsMetadataRequest { // method. message QueryDenomsMetadataResponse { // metadata provides the client information for all the registered tokens. - repeated Metadata metadatas = 1 [(gogoproto.nullable) = false]; + repeated Metadata metadatas = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -205,7 +289,7 @@ message QueryDenomMetadataRequest { // method. message QueryDenomMetadataResponse { // metadata describes and provides all the client information for the requested token. - Metadata metadata = 1 [(gogoproto.nullable) = false]; + Metadata metadata = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, @@ -229,7 +313,7 @@ message DenomOwner { string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // balance is the balance of the denominated coin for an account. - cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. @@ -241,3 +325,24 @@ message QueryDenomOwnersResponse { // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } + +// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. +// +// Since: cosmos-sdk 0.47 +message QuerySendEnabledRequest { + // denoms is the specific denoms you want look up. Leave empty to get all entries. + repeated string denoms = 1; + // pagination defines an optional pagination for the request. This field is + // only read if the denoms field is empty. + cosmos.base.query.v1beta1.PageRequest pagination = 99; +} + +// QuerySendEnabledResponse defines the RPC response of a SendEnable query. +// +// Since: cosmos-sdk 0.47 +message QuerySendEnabledResponse { + repeated SendEnabled send_enabled = 1; + // pagination defines the pagination in the response. This field is only + // populated if the denoms field in the request is empty. + cosmos.base.query.v1beta1.PageResponse pagination = 99; +} diff --git a/third_party/proto/cosmos/bank/v1beta1/tx.proto b/third_party/proto/cosmos/bank/v1beta1/tx.proto index 22e62cbf..5d6926ef 100644 --- a/third_party/proto/cosmos/bank/v1beta1/tx.proto +++ b/third_party/proto/cosmos/bank/v1beta1/tx.proto @@ -6,29 +6,50 @@ import "cosmos/base/v1beta1/coin.proto"; import "cosmos/bank/v1beta1/bank.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; // Msg defines the bank Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // Send defines a method for sending coins from one account to another account. rpc Send(MsgSend) returns (MsgSendResponse); // MultiSend defines a method for sending coins from some accounts to other accounts. rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse); + + // UpdateParams defines a governance operation for updating the x/bank module parameters. + // The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // SetSendEnabled is a governance operation for setting the SendEnabled flag + // on any number of Denoms. Only the entries to add or update should be + // included. Entries that already exist in the store, but that aren't + // included in this message, will be left unchanged. + // + // Since: cosmos-sdk 0.47 + rpc SetSendEnabled(MsgSetSendEnabled) returns (MsgSetSendEnabledResponse); } // MsgSend represents a message to send coins from one account to another. message MsgSend { option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgSend"; option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // MsgSendResponse defines the Msg/Send response type. @@ -37,12 +58,65 @@ message MsgSendResponse {} // MsgMultiSend represents an arbitrary multi-in, multi-out send message. message MsgMultiSend { option (cosmos.msg.v1.signer) = "inputs"; + option (amino.name) = "cosmos-sdk/MsgMultiSend"; option (gogoproto.equal) = false; - repeated Input inputs = 1 [(gogoproto.nullable) = false]; - repeated Output outputs = 2 [(gogoproto.nullable) = false]; + // Inputs, despite being `repeated`, only allows one sender input. This is + // checked in MsgMultiSend's ValidateBasic. + repeated Input inputs = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated Output outputs = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgMultiSendResponse defines the Msg/MultiSend response type. message MsgMultiSendResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + option (amino.name) = "cosmos-sdk/x/bank/MsgUpdateParams"; + + // params defines the x/bank parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} + +// MsgSetSendEnabled is the Msg/SetSendEnabled request type. +// +// Only entries to add/update/delete need to be included. +// Existing SendEnabled entries that are not included in this +// message are left unchanged. +// +// Since: cosmos-sdk 0.47 +message MsgSetSendEnabled { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/MsgSetSendEnabled"; + + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // send_enabled is the list of entries to add or update. + repeated SendEnabled send_enabled = 2; + + // use_default_for is a list of denoms that should use the params.default_send_enabled value. + // Denoms listed here will have their SendEnabled entries deleted. + // If a denom is included that doesn't have a SendEnabled entry, + // it will be ignored. + repeated string use_default_for = 3; +} + +// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +// +// Since: cosmos-sdk 0.47 +message MsgSetSendEnabledResponse {} diff --git a/third_party/proto/cosmos/base/snapshots/v1beta1/snapshot.proto b/third_party/proto/cosmos/base/snapshots/v1beta1/snapshot.proto index 5dba369f..e8f9c2e6 100644 --- a/third_party/proto/cosmos/base/snapshots/v1beta1/snapshot.proto +++ b/third_party/proto/cosmos/base/snapshots/v1beta1/snapshot.proto @@ -29,8 +29,8 @@ message SnapshotItem { SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; SnapshotExtensionMeta extension = 3; SnapshotExtensionPayload extension_payload = 4; - SnapshotKVItem kv = 5 [(gogoproto.customname) = "KV"]; - SnapshotSchema schema = 6; + SnapshotKVItem kv = 5 [deprecated = true, (gogoproto.customname) = "KV"]; + SnapshotSchema schema = 6 [deprecated = true]; } } @@ -71,7 +71,10 @@ message SnapshotExtensionPayload { // SnapshotKVItem is an exported Key/Value Pair // // Since: cosmos-sdk 0.46 +// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. message SnapshotKVItem { + option deprecated = true; + bytes key = 1; bytes value = 2; } @@ -79,6 +82,9 @@ message SnapshotKVItem { // SnapshotSchema is an exported schema of smt store // // Since: cosmos-sdk 0.46 +// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. message SnapshotSchema { + option deprecated = true; + repeated bytes keys = 1; -} +} \ No newline at end of file diff --git a/third_party/proto/cosmos/base/store/v1beta1/commit_info.proto b/third_party/proto/cosmos/base/store/v1beta1/commit_info.proto index 98a33d30..4625cdab 100644 --- a/third_party/proto/cosmos/base/store/v1beta1/commit_info.proto +++ b/third_party/proto/cosmos/base/store/v1beta1/commit_info.proto @@ -2,14 +2,17 @@ syntax = "proto3"; package cosmos.base.store.v1beta1; import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; option go_package = "github.com/cosmos/cosmos-sdk/store/types"; // CommitInfo defines commit information used by the multi-store when committing // a version/height. message CommitInfo { - int64 version = 1; - repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false]; + int64 version = 1; + repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp timestamp = 3 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } // StoreInfo defines store-specific commit information. It contains a reference @@ -19,7 +22,7 @@ message StoreInfo { CommitID commit_id = 2 [(gogoproto.nullable) = false]; } -// CommitID defines the committment information when a specific store is +// CommitID defines the commitment information when a specific store is // committed. message CommitID { option (gogoproto.goproto_stringer) = false; diff --git a/third_party/proto/cosmos/base/tendermint/v1beta1/query.proto b/third_party/proto/cosmos/base/tendermint/v1beta1/query.proto index 2d516901..1f17b0a6 100644 --- a/third_party/proto/cosmos/base/tendermint/v1beta1/query.proto +++ b/third_party/proto/cosmos/base/tendermint/v1beta1/query.proto @@ -10,6 +10,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "cosmos/base/tendermint/v1beta1/types.proto"; import "cosmos_proto/cosmos.proto"; import "tendermint/types/block.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; @@ -45,9 +46,9 @@ service Service { option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/{height}"; } - // ABCIQuery defines a query handler that supports ABCI queries directly to - // the application, bypassing Tendermint completely. The ABCI query must - // contain a valid and supported path, including app, custom, p2p, and store. + // ABCIQuery defines a query handler that supports ABCI queries directly to the + // application, bypassing Tendermint completely. The ABCI query must contain + // a valid and supported path, including app, custom, p2p, and store. // // Since: cosmos-sdk 0.46 rpc ABCIQuery(ABCIQueryRequest) returns (ABCIQueryResponse) { @@ -55,16 +56,14 @@ service Service { } } -// GetValidatorSetByHeightRequest is the request type for the -// Query/GetValidatorSetByHeight RPC method. +// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. message GetValidatorSetByHeightRequest { int64 height = 1; // pagination defines an pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; } -// GetValidatorSetByHeightResponse is the response type for the -// Query/GetValidatorSetByHeight RPC method. +// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. message GetValidatorSetByHeightResponse { int64 block_height = 1; repeated Validator validators = 2; @@ -72,15 +71,13 @@ message GetValidatorSetByHeightResponse { cosmos.base.query.v1beta1.PageResponse pagination = 3; } -// GetLatestValidatorSetRequest is the request type for the -// Query/GetValidatorSetByHeight RPC method. +// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. message GetLatestValidatorSetRequest { // pagination defines an pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 1; } -// GetLatestValidatorSetResponse is the response type for the -// Query/GetValidatorSetByHeight RPC method. +// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. message GetLatestValidatorSetResponse { int64 block_height = 1; repeated Validator validators = 2; @@ -96,14 +93,12 @@ message Validator { int64 proposer_priority = 4; } -// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight -// RPC method. +// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. message GetBlockByHeightRequest { int64 height = 1; } -// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight -// RPC method. +// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. message GetBlockByHeightResponse { .tendermint.types.BlockID block_id = 1; @@ -114,12 +109,10 @@ message GetBlockByHeightResponse { Block sdk_block = 3; } -// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC -// method. +// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. message GetLatestBlockRequest {} -// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC -// method. +// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. message GetLatestBlockResponse { .tendermint.types.BlockID block_id = 1; @@ -141,8 +134,7 @@ message GetSyncingResponse { // GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. message GetNodeInfoRequest {} -// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC -// method. +// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. message GetNodeInfoResponse { .tendermint.p2p.DefaultNodeInfo default_node_info = 1; VersionInfo application_version = 2; @@ -179,8 +171,7 @@ message ABCIQueryRequest { bool prove = 4; } -// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC -// query. +// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. // // Note: This type is a duplicate of the ResponseQuery proto type defined in // Tendermint. @@ -199,11 +190,10 @@ message ABCIQueryResponse { } // ProofOp defines an operation used for calculating Merkle root. The data could -// be arbitrary format, providing nessecary data for example neighbouring node +// be arbitrary format, providing necessary data for example neighbouring node // hash. // -// Note: This type is a duplicate of the ProofOp proto type defined in -// Tendermint. +// Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. message ProofOp { string type = 1; bytes key = 2; @@ -212,8 +202,7 @@ message ProofOp { // ProofOps is Merkle proof defined by the list of ProofOps. // -// Note: This type is a duplicate of the ProofOps proto type defined in -// Tendermint. +// Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. message ProofOps { - repeated ProofOp ops = 1 [(gogoproto.nullable) = false]; + repeated ProofOp ops = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/third_party/proto/cosmos/base/tendermint/v1beta1/types.proto b/third_party/proto/cosmos/base/tendermint/v1beta1/types.proto index 3d6c04c2..6506997b 100644 --- a/third_party/proto/cosmos/base/tendermint/v1beta1/types.proto +++ b/third_party/proto/cosmos/base/tendermint/v1beta1/types.proto @@ -6,28 +6,30 @@ import "tendermint/types/types.proto"; import "tendermint/types/evidence.proto"; import "tendermint/version/types.proto"; import "google/protobuf/timestamp.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; // Block is tendermint type Block, with the Header proposer address // field converted to bech32 string. message Block { - Header header = 1 [(gogoproto.nullable) = false]; - .tendermint.types.Data data = 2 [(gogoproto.nullable) = false]; - .tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false]; + Header header = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + .tendermint.types.Data data = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + .tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; .tendermint.types.Commit last_commit = 4; } // Header defines the structure of a Tendermint block header. message Header { // basic block info - .tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false]; + .tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; string chain_id = 2 [(gogoproto.customname) = "ChainID"]; int64 height = 3; - google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp time = 4 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; // prev block info - .tendermint.types.BlockID last_block_id = 5 [(gogoproto.nullable) = false]; + .tendermint.types.BlockID last_block_id = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // hashes of block data bytes last_commit_hash = 6; // commit from validators from the last block diff --git a/third_party/proto/cosmos/base/v1beta1/coin.proto b/third_party/proto/cosmos/base/v1beta1/coin.proto index 69e67e09..69c96f67 100644 --- a/third_party/proto/cosmos/base/v1beta1/coin.proto +++ b/third_party/proto/cosmos/base/v1beta1/coin.proto @@ -3,6 +3,7 @@ package cosmos.base.v1beta1; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/types"; option (gogoproto.goproto_stringer_all) = false; @@ -16,8 +17,12 @@ message Coin { option (gogoproto.equal) = true; string denom = 1; - string amount = 2 - [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; + string amount = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "Int", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // DecCoin defines a token with a denomination and a decimal amount. diff --git a/third_party/proto/cosmos/capability/module/v1/module.proto b/third_party/proto/cosmos/capability/module/v1/module.proto new file mode 100644 index 00000000..eabaadc1 --- /dev/null +++ b/third_party/proto/cosmos/capability/module/v1/module.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package cosmos.capability.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the capability module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/capability" + }; + + // seal_keeper defines if keeper.Seal() will run on BeginBlock() to prevent further modules from creating a scoped + // keeper. For more details check x/capability/keeper.go. + bool seal_keeper = 1; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/capability/v1beta1/capability.proto b/third_party/proto/cosmos/capability/v1beta1/capability.proto index c433566d..6f3595f1 100644 --- a/third_party/proto/cosmos/capability/v1beta1/capability.proto +++ b/third_party/proto/cosmos/capability/v1beta1/capability.proto @@ -4,6 +4,7 @@ package cosmos.capability.v1beta1; option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; import "gogoproto/gogo.proto"; +import "amino/amino.proto"; // Capability defines an implementation of an object capability. The index // provided to a Capability must be globally unique. @@ -26,5 +27,5 @@ message Owner { // CapabilityOwners defines a set of owners of a single Capability. The set of // owners must be unique. message CapabilityOwners { - repeated Owner owners = 1 [(gogoproto.nullable) = false]; + repeated Owner owners = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/third_party/proto/cosmos/capability/v1beta1/genesis.proto b/third_party/proto/cosmos/capability/v1beta1/genesis.proto index b5482439..f119244e 100644 --- a/third_party/proto/cosmos/capability/v1beta1/genesis.proto +++ b/third_party/proto/cosmos/capability/v1beta1/genesis.proto @@ -3,6 +3,7 @@ package cosmos.capability.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/capability/v1beta1/capability.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; @@ -12,7 +13,7 @@ message GenesisOwners { uint64 index = 1; // index_owners are the owners at the given index. - CapabilityOwners index_owners = 2 [(gogoproto.nullable) = false]; + CapabilityOwners index_owners = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // GenesisState defines the capability module's genesis state. @@ -22,5 +23,5 @@ message GenesisState { // owners represents a map from index to owners of the capability index // index key is string to allow amino marshalling. - repeated GenesisOwners owners = 2 [(gogoproto.nullable) = false]; + repeated GenesisOwners owners = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/third_party/proto/cosmos/consensus/module/v1/module.proto b/third_party/proto/cosmos/consensus/module/v1/module.proto new file mode 100644 index 00000000..8e188cc7 --- /dev/null +++ b/third_party/proto/cosmos/consensus/module/v1/module.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package cosmos.consensus.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the consensus module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/consensus" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} diff --git a/third_party/proto/cosmos/consensus/v1/query.proto b/third_party/proto/cosmos/consensus/v1/query.proto new file mode 100644 index 00000000..cdcb07ba --- /dev/null +++ b/third_party/proto/cosmos/consensus/v1/query.proto @@ -0,0 +1,27 @@ +// Since: cosmos-sdk 0.47 +syntax = "proto3"; +package cosmos.consensus.v1; + +import "google/api/annotations.proto"; +import "tendermint/types/params.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; + +// Query defines the gRPC querier service. +service Query { + // Params queries the parameters of x/consensus_param module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/consensus/v1/params"; + } +} + +// QueryParamsRequest defines the request type for querying x/consensus parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/consensus parameters. +message QueryParamsResponse { + // params are the tendermint consensus params stored in the consensus module. + // Please note that `params.version` is not populated in this response, it is + // tracked separately in the x/upgrade module. + tendermint.types.ConsensusParams params = 1; +} diff --git a/third_party/proto/cosmos/consensus/v1/tx.proto b/third_party/proto/cosmos/consensus/v1/tx.proto new file mode 100644 index 00000000..0a7a3de0 --- /dev/null +++ b/third_party/proto/cosmos/consensus/v1/tx.proto @@ -0,0 +1,39 @@ +// Since: cosmos-sdk 0.47 +syntax = "proto3"; +package cosmos.consensus.v1; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "tendermint/types/params.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; + +// Msg defines the bank Msg service. +service Msg { + // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. + // The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/consensus parameters to update. + // VersionsParams is not included in this Msg because it is tracked + // separarately in x/upgrade. + // + // NOTE: All parameters must be supplied. + tendermint.types.BlockParams block = 2; + tendermint.types.EvidenceParams evidence = 3; + tendermint.types.ValidatorParams validator = 4; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} diff --git a/third_party/proto/cosmos/crisis/module/v1/module.proto b/third_party/proto/cosmos/crisis/module/v1/module.proto new file mode 100644 index 00000000..fe924962 --- /dev/null +++ b/third_party/proto/cosmos/crisis/module/v1/module.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package cosmos.crisis.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the crisis module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/crisis" + }; + + // fee_collector_name is the name of the FeeCollector ModuleAccount. + string fee_collector_name = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/crisis/v1beta1/genesis.proto b/third_party/proto/cosmos/crisis/v1beta1/genesis.proto index 5c291604..b0ddb9b6 100644 --- a/third_party/proto/cosmos/crisis/v1beta1/genesis.proto +++ b/third_party/proto/cosmos/crisis/v1beta1/genesis.proto @@ -5,10 +5,11 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; // GenesisState defines the crisis module's genesis state. message GenesisState { // constant_fee is the fee used to verify the invariant in the crisis // module. - cosmos.base.v1beta1.Coin constant_fee = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin constant_fee = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/third_party/proto/cosmos/crisis/v1beta1/tx.proto b/third_party/proto/cosmos/crisis/v1beta1/tx.proto index fea9059f..4fcf5bf6 100644 --- a/third_party/proto/cosmos/crisis/v1beta1/tx.proto +++ b/third_party/proto/cosmos/crisis/v1beta1/tx.proto @@ -6,24 +6,60 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; // Msg defines the bank Msg service. service Msg { - // VerifyInvariant defines a method to verify a particular invariance. + option (cosmos.msg.v1.service) = true; + + // VerifyInvariant defines a method to verify a particular invariant. rpc VerifyInvariant(MsgVerifyInvariant) returns (MsgVerifyInvariantResponse); + + // UpdateParams defines a governance operation for updating the x/crisis module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgVerifyInvariant represents a message to verify a particular invariance. message MsgVerifyInvariant { option (cosmos.msg.v1.signer) = "sender"; + option (amino.name) = "cosmos-sdk/MsgVerifyInvariant"; option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // sender is the account address of private key to send coins to fee collector account. + string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // name of the invariant module. string invariant_module_name = 2; - string invariant_route = 3; + + // invariant_route is the msg's invariant route. + string invariant_route = 3; } // MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. message MsgVerifyInvariantResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/crisis/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // constant_fee defines the x/crisis parameter. + cosmos.base.v1beta1.Coin constant_fee = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/third_party/proto/cosmos/crypto/ed25519/keys.proto b/third_party/proto/cosmos/crypto/ed25519/keys.proto index 6ffec344..728b5483 100644 --- a/third_party/proto/cosmos/crypto/ed25519/keys.proto +++ b/third_party/proto/cosmos/crypto/ed25519/keys.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package cosmos.crypto.ed25519; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"; @@ -11,6 +12,18 @@ option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"; // ADR-28. Nevertheless, you will like to use ed25519 in app user level // then you must create a new proto message and follow ADR-28 for Address construction. message PubKey { + option (amino.name) = "tendermint/PubKeyEd25519"; + // The Amino encoding is simply the inner bytes field, and not the Amino + // encoding of the whole PubKey struct. + // + // Example (JSON): + // s := PubKey{Key: []byte{0x01}} + // out := AminoJSONEncoder(s) + // + // Then we have: + // out == `"MQ=="` + // out != `{"key":"MQ=="}` + option (amino.message_encoding) = "key_field"; option (gogoproto.goproto_stringer) = false; bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"]; @@ -19,5 +32,8 @@ message PubKey { // Deprecated: PrivKey defines a ed25519 private key. // NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. message PrivKey { + option (amino.name) = "tendermint/PrivKeyEd25519"; + option (amino.message_encoding) = "key_field"; + bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PrivateKey"]; } diff --git a/third_party/proto/cosmos/crypto/hd/v1/hd.proto b/third_party/proto/cosmos/crypto/hd/v1/hd.proto index bb079ce6..e25b70d1 100644 --- a/third_party/proto/cosmos/crypto/hd/v1/hd.proto +++ b/third_party/proto/cosmos/crypto/hd/v1/hd.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package cosmos.crypto.hd.v1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/cosmos/cosmos-sdk/crypto/hd"; @@ -9,6 +10,8 @@ option (gogoproto.goproto_getters_all) = false; // BIP44Params is used as path field in ledger item in Record. message BIP44Params { + option (amino.name) = "crypto/keys/hd/BIP44Params"; + option (gogoproto.goproto_stringer) = false; // purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation uint32 purpose = 1; diff --git a/third_party/proto/cosmos/crypto/keyring/v1/record.proto b/third_party/proto/cosmos/crypto/keyring/v1/record.proto index 14c6da63..e79ea7f4 100644 --- a/third_party/proto/cosmos/crypto/keyring/v1/record.proto +++ b/third_party/proto/cosmos/crypto/keyring/v1/record.proto @@ -8,6 +8,7 @@ import "cosmos/crypto/hd/v1/hd.proto"; option go_package = "github.com/cosmos/cosmos-sdk/crypto/keyring"; option (gogoproto.goproto_getters_all) = false; +option (gogoproto.gogoproto_import) = false; // Record is used for representing a key in the keyring. message Record { diff --git a/third_party/proto/cosmos/crypto/multisig/keys.proto b/third_party/proto/cosmos/crypto/multisig/keys.proto index 7a11fe33..fa0dec57 100644 --- a/third_party/proto/cosmos/crypto/multisig/keys.proto +++ b/third_party/proto/cosmos/crypto/multisig/keys.proto @@ -3,6 +3,7 @@ package cosmos.crypto.multisig; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"; @@ -10,8 +11,20 @@ option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"; // which nests multiple public keys and a threshold, // it uses legacy amino address rules. message LegacyAminoPubKey { + option (amino.name) = "tendermint/PubKeyMultisigThreshold"; + // The Amino encoding of a LegacyAminoPubkey is the legacy amino + // encoding of the `PubKeyMultisigThreshold` struct defined below: + // https://github.com/tendermint/tendermint/blob/v0.33.9/crypto/multisig/threshold_pubkey.go + // + // There are 2 differences with what a "normal" Amino encoding + // would output: + // 1. The `threshold` field is always a string (whereas Amino would + // by default marshal uint32 as a number). + // 2. The `public_keys` field is renamed to `pubkeys`, which is also + // reflected in the `amino.field_name` annotation. + option (amino.message_encoding) = "threshold_string"; option (gogoproto.goproto_getters) = false; uint32 threshold = 1; - repeated google.protobuf.Any public_keys = 2 [(gogoproto.customname) = "PubKeys"]; + repeated google.protobuf.Any public_keys = 2 [(gogoproto.customname) = "PubKeys", (amino.field_name) = "pubkeys"]; } diff --git a/third_party/proto/cosmos/crypto/secp256k1/keys.proto b/third_party/proto/cosmos/crypto/secp256k1/keys.proto index a2272571..e2358d6d 100644 --- a/third_party/proto/cosmos/crypto/secp256k1/keys.proto +++ b/third_party/proto/cosmos/crypto/secp256k1/keys.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package cosmos.crypto.secp256k1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"; @@ -11,6 +12,18 @@ option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"; // the x-coordinate. Otherwise the first byte is a 0x03. // This prefix is followed with the x-coordinate. message PubKey { + option (amino.name) = "tendermint/PubKeySecp256k1"; + // The Amino encoding is simply the inner bytes field, and not the Amino + // encoding of the whole PubKey struct. + // + // Example (JSON): + // s := PubKey{Key: []byte{0x01}} + // out := AminoJSONEncoder(s) + // + // Then we have: + // out == `"MQ=="` + // out != `{"key":"MQ=="}` + option (amino.message_encoding) = "key_field"; option (gogoproto.goproto_stringer) = false; bytes key = 1; @@ -18,5 +31,8 @@ message PubKey { // PrivKey defines a secp256k1 private key. message PrivKey { + option (amino.name) = "tendermint/PrivKeySecp256k1"; + option (amino.message_encoding) = "key_field"; + bytes key = 1; } diff --git a/third_party/proto/cosmos/distribution/module/v1/module.proto b/third_party/proto/cosmos/distribution/module/v1/module.proto new file mode 100644 index 00000000..accf920c --- /dev/null +++ b/third_party/proto/cosmos/distribution/module/v1/module.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package cosmos.distribution.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the distribution module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/distribution" + }; + + string fee_collector_name = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/distribution/v1beta1/distribution.proto b/third_party/proto/cosmos/distribution/v1beta1/distribution.proto index 73174303..226003da 100644 --- a/third_party/proto/cosmos/distribution/v1beta1/distribution.proto +++ b/third_party/proto/cosmos/distribution/v1beta1/distribution.proto @@ -7,25 +7,37 @@ option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; // Params defines the set of params for the distribution module. message Params { + option (amino.name) = "cosmos-sdk/x/distribution/Params"; option (gogoproto.goproto_stringer) = false; - string community_tax = 1 [ + + string community_tax = 1 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; + + // Deprecated: The base_proposer_reward field is deprecated and is no longer used + // in the x/distribution module's reward mechanism. string base_proposer_reward = 2 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + deprecated = true ]; + + // Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + // in the x/distribution module's reward mechanism. string bonus_proposer_reward = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + deprecated = true ]; + bool withdraw_addr_enabled = 4; } @@ -42,8 +54,11 @@ message Params { // read that record) // + one per validator for the zeroeth period, set on initialization message ValidatorHistoricalRewards { - repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; uint32 reference_count = 2; } @@ -51,23 +66,32 @@ message ValidatorHistoricalRewards { // period for a validator kept as a running counter and incremented // each block as long as the validator's tokens remain constant. message ValidatorCurrentRewards { - repeated cosmos.base.v1beta1.DecCoin rewards = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; uint64 period = 2; } // ValidatorAccumulatedCommission represents accumulated commission // for a validator kept as a running counter, can be withdrawn at any time. message ValidatorAccumulatedCommission { - repeated cosmos.base.v1beta1.DecCoin commission = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin commission = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards // for a validator inexpensive to track, allows simple sanity checks. message ValidatorOutstandingRewards { - repeated cosmos.base.v1beta1.DecCoin rewards = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // ValidatorSlashEvent represents a validator slash event. @@ -86,19 +110,28 @@ message ValidatorSlashEvent { // ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. message ValidatorSlashEvents { option (gogoproto.goproto_stringer) = false; - repeated ValidatorSlashEvent validator_slash_events = 1 [(gogoproto.nullable) = false]; + repeated ValidatorSlashEvent validator_slash_events = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // FeePool is the global fee pool for distribution. message FeePool { - repeated cosmos.base.v1beta1.DecCoin community_pool = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; + repeated cosmos.base.v1beta1.DecCoin community_pool = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; } // CommunityPoolSpendProposal details a proposal for use of community funds, // together with how many coins are proposed to be spent, and to which // recipient account. +// +// Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no +// longer a need for an explicit CommunityPoolSpendProposal. To spend community +// pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov +// module via a v1 governance proposal. message CommunityPoolSpendProposal { + option deprecated = true; option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; @@ -107,8 +140,11 @@ message CommunityPoolSpendProposal { string title = 1; string description = 2; string recipient = 3; - repeated cosmos.base.v1beta1.Coin amount = 4 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin amount = 4 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // DelegatorStartingInfo represents the starting info for a delegator reward @@ -124,7 +160,8 @@ message DelegatorStartingInfo { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; - uint64 height = 3 [(gogoproto.jsontag) = "creation_height"]; + uint64 height = 3 + [(gogoproto.jsontag) = "creation_height", (amino.field_name) = "creation_height", (amino.dont_omitempty) = true]; } // DelegationDelegatorReward represents the properties @@ -135,8 +172,11 @@ message DelegationDelegatorReward { string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.DecCoin reward = 2 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin reward = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal diff --git a/third_party/proto/cosmos/distribution/v1beta1/genesis.proto b/third_party/proto/cosmos/distribution/v1beta1/genesis.proto index 4662e8df..5bf2d6bb 100644 --- a/third_party/proto/cosmos/distribution/v1beta1/genesis.proto +++ b/third_party/proto/cosmos/distribution/v1beta1/genesis.proto @@ -8,6 +8,7 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/distribution/v1beta1/distribution.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; // DelegatorWithdrawInfo is the address for where distributions rewards are // withdrawn to by default this struct is only used at genesis to feed in @@ -31,9 +32,12 @@ message ValidatorOutstandingRewardsRecord { // validator_address is the address of the validator. string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // outstanding_rewards represents the oustanding rewards of a validator. - repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + // outstanding_rewards represents the outstanding rewards of a validator. + repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // ValidatorAccumulatedCommissionRecord is used for import / export via genesis @@ -46,7 +50,7 @@ message ValidatorAccumulatedCommissionRecord { string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // accumulated is the accumulated commission of a validator. - ValidatorAccumulatedCommission accumulated = 2 [(gogoproto.nullable) = false]; + ValidatorAccumulatedCommission accumulated = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // ValidatorHistoricalRewardsRecord is used for import / export via genesis @@ -62,7 +66,7 @@ message ValidatorHistoricalRewardsRecord { uint64 period = 2; // rewards defines the historical rewards of a validator. - ValidatorHistoricalRewards rewards = 3 [(gogoproto.nullable) = false]; + ValidatorHistoricalRewards rewards = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // ValidatorCurrentRewardsRecord is used for import / export via genesis json. @@ -74,7 +78,7 @@ message ValidatorCurrentRewardsRecord { string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // rewards defines the current rewards of a validator. - ValidatorCurrentRewards rewards = 2 [(gogoproto.nullable) = false]; + ValidatorCurrentRewards rewards = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // DelegatorStartingInfoRecord used for import / export via genesis json. @@ -89,7 +93,7 @@ message DelegatorStartingInfoRecord { string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // starting_info defines the starting info of a delegator. - DelegatorStartingInfo starting_info = 3 [(gogoproto.nullable) = false]; + DelegatorStartingInfo starting_info = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // ValidatorSlashEventRecord is used for import / export via genesis json. @@ -99,12 +103,12 @@ message ValidatorSlashEventRecord { // validator_address is the address of the validator. string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // height defines the block height at which the slash event occured. + // height defines the block height at which the slash event occurred. uint64 height = 2; // period is the period of the slash event. uint64 period = 3; // validator_slash_event describes the slash event. - ValidatorSlashEvent validator_slash_event = 4 [(gogoproto.nullable) = false]; + ValidatorSlashEvent validator_slash_event = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // GenesisState defines the distribution module's genesis state. @@ -112,33 +116,40 @@ message GenesisState { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - // params defines all the paramaters of the module. - Params params = 1 [(gogoproto.nullable) = false]; + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // fee_pool defines the fee pool at genesis. - FeePool fee_pool = 2 [(gogoproto.nullable) = false]; + FeePool fee_pool = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // fee_pool defines the delegator withdraw infos at genesis. - repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 [(gogoproto.nullable) = false]; + repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // fee_pool defines the previous proposer at genesis. string previous_proposer = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // fee_pool defines the outstanding rewards of all validators at genesis. - repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 [(gogoproto.nullable) = false]; + repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // fee_pool defines the accumulated commisions of all validators at genesis. - repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 [(gogoproto.nullable) = false]; + // fee_pool defines the accumulated commissions of all validators at genesis. + repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // fee_pool defines the historical rewards of all validators at genesis. - repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 [(gogoproto.nullable) = false]; + repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // fee_pool defines the current rewards of all validators at genesis. - repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 [(gogoproto.nullable) = false]; + repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // fee_pool defines the delegator starting infos at genesis. - repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 [(gogoproto.nullable) = false]; + repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // fee_pool defines the validator slash events at genesis. - repeated ValidatorSlashEventRecord validator_slash_events = 10 [(gogoproto.nullable) = false]; + repeated ValidatorSlashEventRecord validator_slash_events = 10 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/third_party/proto/cosmos/distribution/v1beta1/query.proto b/third_party/proto/cosmos/distribution/v1beta1/query.proto index a09413fc..4788467d 100644 --- a/third_party/proto/cosmos/distribution/v1beta1/query.proto +++ b/third_party/proto/cosmos/distribution/v1beta1/query.proto @@ -7,6 +7,7 @@ import "google/api/annotations.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/distribution/v1beta1/distribution.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; @@ -17,6 +18,12 @@ service Query { option (google.api.http).get = "/cosmos/distribution/v1beta1/params"; } + // ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator + rpc ValidatorDistributionInfo(QueryValidatorDistributionInfoRequest) + returns (QueryValidatorDistributionInfoResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}"; + } + // ValidatorOutstandingRewards queries rewards of a validator address. rpc ValidatorOutstandingRewards(QueryValidatorOutstandingRewardsRequest) returns (QueryValidatorOutstandingRewardsResponse) { @@ -71,7 +78,28 @@ message QueryParamsRequest {} // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { // params defines the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. +message QueryValidatorDistributionInfoRequest { + // validator_address defines the validator address to query for. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. +message QueryValidatorDistributionInfoResponse { + // operator_address defines the validator operator address. + string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // self_bond_rewards defines the self delegations rewards. + repeated cosmos.base.v1beta1.DecCoin self_bond_rewards = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; + // commission defines the commission the validator received. + repeated cosmos.base.v1beta1.DecCoin commission = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; } // QueryValidatorOutstandingRewardsRequest is the request type for the @@ -84,7 +112,7 @@ message QueryValidatorOutstandingRewardsRequest { // QueryValidatorOutstandingRewardsResponse is the response type for the // Query/ValidatorOutstandingRewards RPC method. message QueryValidatorOutstandingRewardsResponse { - ValidatorOutstandingRewards rewards = 1 [(gogoproto.nullable) = false]; + ValidatorOutstandingRewards rewards = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryValidatorCommissionRequest is the request type for the @@ -97,8 +125,8 @@ message QueryValidatorCommissionRequest { // QueryValidatorCommissionResponse is the response type for the // Query/ValidatorCommission RPC method message QueryValidatorCommissionResponse { - // commission defines the commision the validator received. - ValidatorAccumulatedCommission commission = 1 [(gogoproto.nullable) = false]; + // commission defines the commission the validator received. + ValidatorAccumulatedCommission commission = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryValidatorSlashesRequest is the request type for the @@ -121,7 +149,7 @@ message QueryValidatorSlashesRequest { // Query/ValidatorSlashes RPC method. message QueryValidatorSlashesResponse { // slashes defines the slashes the validator received. - repeated ValidatorSlashEvent slashes = 1 [(gogoproto.nullable) = false]; + repeated ValidatorSlashEvent slashes = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -143,8 +171,11 @@ message QueryDelegationRewardsRequest { // Query/DelegationRewards RPC method. message QueryDelegationRewardsResponse { // rewards defines the rewards accrued by a delegation. - repeated cosmos.base.v1beta1.DecCoin rewards = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; + repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; } // QueryDelegationTotalRewardsRequest is the request type for the @@ -160,10 +191,13 @@ message QueryDelegationTotalRewardsRequest { // Query/DelegationTotalRewards RPC method. message QueryDelegationTotalRewardsResponse { // rewards defines all the rewards accrued by a delegator. - repeated DelegationDelegatorReward rewards = 1 [(gogoproto.nullable) = false]; + repeated DelegationDelegatorReward rewards = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // total defines the sum of all the rewards. - repeated cosmos.base.v1beta1.DecCoin total = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; + repeated cosmos.base.v1beta1.DecCoin total = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; } // QueryDelegatorValidatorsRequest is the request type for the @@ -214,6 +248,9 @@ message QueryCommunityPoolRequest {} // RPC method. message QueryCommunityPoolResponse { // pool defines community pool's coins. - repeated cosmos.base.v1beta1.DecCoin pool = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin pool = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } diff --git a/third_party/proto/cosmos/distribution/v1beta1/tx.proto b/third_party/proto/cosmos/distribution/v1beta1/tx.proto index 68fea0c2..957747cf 100644 --- a/third_party/proto/cosmos/distribution/v1beta1/tx.proto +++ b/third_party/proto/cosmos/distribution/v1beta1/tx.proto @@ -8,9 +8,13 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/distribution/v1beta1/distribution.proto"; // Msg defines the distribution Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // SetWithdrawAddress defines a method to change the withdraw address // for a delegator (or validator self-delegation). rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse); @@ -26,12 +30,27 @@ service Msg { // FundCommunityPool defines a method to allow an account to directly // fund the community pool. rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); + + // UpdateParams defines a governance operation for updating the x/distribution + // module parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // CommunityPoolSpend defines a governance operation for sending tokens from + // the community pool in the x/distribution module to another account, which + // could be the governance module itself. The authority is defined in the + // keeper. + // + // Since: cosmos-sdk 0.47 + rpc CommunityPoolSpend(MsgCommunityPoolSpend) returns (MsgCommunityPoolSpendResponse); } // MsgSetWithdrawAddress sets the withdraw address for // a delegator (or validator self-delegation). message MsgSetWithdrawAddress { option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgModifyWithdrawAddress"; option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; @@ -40,13 +59,15 @@ message MsgSetWithdrawAddress { string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } -// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. +// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response +// type. message MsgSetWithdrawAddressResponse {} // MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator // from a single validator. message MsgWithdrawDelegatorReward { option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgWithdrawDelegationReward"; option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; @@ -55,17 +76,22 @@ message MsgWithdrawDelegatorReward { string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } -// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. +// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward +// response type. message MsgWithdrawDelegatorRewardResponse { // Since: cosmos-sdk 0.46 - repeated cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // MsgWithdrawValidatorCommission withdraws the full commission to the validator // address. message MsgWithdrawValidatorCommission { option (cosmos.msg.v1.signer) = "validator_address"; + option (amino.name) = "cosmos-sdk/MsgWithdrawValCommission"; option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; @@ -73,25 +99,80 @@ message MsgWithdrawValidatorCommission { string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } -// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. +// MsgWithdrawValidatorCommissionResponse defines the +// Msg/WithdrawValidatorCommission response type. message MsgWithdrawValidatorCommissionResponse { // Since: cosmos-sdk 0.46 - repeated cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // MsgFundCommunityPool allows an account to directly // fund the community pool. message MsgFundCommunityPool { option (cosmos.msg.v1.signer) = "depositor"; + option (amino.name) = "cosmos-sdk/MsgFundCommunityPool"; option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - repeated cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. message MsgFundCommunityPoolResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/distribution/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/distribution parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} + +// MsgCommunityPoolSpend defines a message for sending tokens from the community +// pool to another account. This message is typically executed via a governance +// proposal with the governance module being the executing authority. +// +// Since: cosmos-sdk 0.47 +message MsgCommunityPoolSpend { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/distr/MsgCommunityPoolSpend"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string recipient = 2; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgCommunityPoolSpendResponse defines the response to executing a +// MsgCommunityPoolSpend message. +// +// Since: cosmos-sdk 0.47 +message MsgCommunityPoolSpendResponse {} diff --git a/third_party/proto/cosmos/evidence/module/v1/module.proto b/third_party/proto/cosmos/evidence/module/v1/module.proto new file mode 100644 index 00000000..fceea7da --- /dev/null +++ b/third_party/proto/cosmos/evidence/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.evidence.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the evidence module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/evidence" + }; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/evidence/v1beta1/evidence.proto b/third_party/proto/cosmos/evidence/v1beta1/evidence.proto index 83f9ec3d..8dca3201 100644 --- a/third_party/proto/cosmos/evidence/v1beta1/evidence.proto +++ b/third_party/proto/cosmos/evidence/v1beta1/evidence.proto @@ -4,6 +4,7 @@ package cosmos.evidence.v1beta1; option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; option (gogoproto.equal_all) = true; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; @@ -11,12 +12,21 @@ import "cosmos_proto/cosmos.proto"; // Equivocation implements the Evidence interface and defines evidence of double // signing misbehavior. message Equivocation { + option (amino.name) = "cosmos-sdk/Equivocation"; option (gogoproto.goproto_stringer) = false; option (gogoproto.goproto_getters) = false; option (gogoproto.equal) = false; - int64 height = 1; - google.protobuf.Timestamp time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - int64 power = 3; - string consensus_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // height is the equivocation height. + int64 height = 1; + + // time is the equivocation time. + google.protobuf.Timestamp time = 2 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + + // power is the equivocation validator power. + int64 power = 3; + + // consensus_address is the equivocation validator consensus address. + string consensus_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } \ No newline at end of file diff --git a/third_party/proto/cosmos/evidence/v1beta1/query.proto b/third_party/proto/cosmos/evidence/v1beta1/query.proto index eda00544..34163dd5 100644 --- a/third_party/proto/cosmos/evidence/v1beta1/query.proto +++ b/third_party/proto/cosmos/evidence/v1beta1/query.proto @@ -12,7 +12,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; service Query { // Evidence queries evidence based on evidence hash. rpc Evidence(QueryEvidenceRequest) returns (QueryEvidenceResponse) { - option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence/{evidence_hash}"; + option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence/{hash}"; } // AllEvidence queries all evidence. @@ -24,7 +24,14 @@ service Query { // QueryEvidenceRequest is the request type for the Query/Evidence RPC method. message QueryEvidenceRequest { // evidence_hash defines the hash of the requested evidence. - bytes evidence_hash = 1 [(gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes"]; + // Deprecated: Use hash, a HEX encoded string, instead. + bytes evidence_hash = 1 + [deprecated = true, (gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; + + // hash defines the evidence hash of the requested evidence. + // + // Since: cosmos-sdk 0.47 + string hash = 2; } // QueryEvidenceResponse is the response type for the Query/Evidence RPC method. diff --git a/third_party/proto/cosmos/evidence/v1beta1/tx.proto b/third_party/proto/cosmos/evidence/v1beta1/tx.proto index 223f7e11..f5646e2d 100644 --- a/third_party/proto/cosmos/evidence/v1beta1/tx.proto +++ b/third_party/proto/cosmos/evidence/v1beta1/tx.proto @@ -8,9 +8,12 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; // Msg defines the evidence Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or // counterfactual signing. rpc SubmitEvidence(MsgSubmitEvidence) returns (MsgSubmitEvidenceResponse); @@ -20,12 +23,16 @@ service Msg { // Evidence of misbehavior such as equivocation or counterfactual signing. message MsgSubmitEvidence { option (cosmos.msg.v1.signer) = "submitter"; + option (amino.name) = "cosmos-sdk/MsgSubmitEvidence"; option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; + // submitter is the signer account address of evidence. string submitter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "Evidence"]; + + // evidence defines the evidence of misbehavior. + google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "cosmos.evidence.v1beta1.Evidence"]; } // MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. diff --git a/third_party/proto/cosmos/feegrant/module/v1/module.proto b/third_party/proto/cosmos/feegrant/module/v1/module.proto new file mode 100644 index 00000000..d838f02f --- /dev/null +++ b/third_party/proto/cosmos/feegrant/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.feegrant.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the feegrant module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/feegrant" + }; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/feegrant/v1beta1/feegrant.proto b/third_party/proto/cosmos/feegrant/v1beta1/feegrant.proto index ec4e7a1e..1cfe741b 100644 --- a/third_party/proto/cosmos/feegrant/v1beta1/feegrant.proto +++ b/third_party/proto/cosmos/feegrant/v1beta1/feegrant.proto @@ -6,6 +6,7 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/duration.proto"; @@ -14,13 +15,17 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; // BasicAllowance implements Allowance with a one-time grant of coins // that optionally expires. The grantee can use up to SpendLimit to cover fees. message BasicAllowance { - option (cosmos_proto.implements_interface) = "FeeAllowanceI"; + option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; + option (amino.name) = "cosmos-sdk/BasicAllowance"; // spend_limit specifies the maximum amount of coins that can be spent // by this allowance and will be updated as coins are spent. If it is // empty, there is no spend limit and any amount of coins can be spent. - repeated cosmos.base.v1beta1.Coin spend_limit = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin spend_limit = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; // expiration specifies an optional time when this allowance expires google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true]; @@ -29,37 +34,47 @@ message BasicAllowance { // PeriodicAllowance extends Allowance to allow for both a maximum cap, // as well as a limit per time period. message PeriodicAllowance { - option (cosmos_proto.implements_interface) = "FeeAllowanceI"; + option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; + option (amino.name) = "cosmos-sdk/PeriodicAllowance"; // basic specifies a struct of `BasicAllowance` - BasicAllowance basic = 1 [(gogoproto.nullable) = false]; + BasicAllowance basic = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // period specifies the time duration in which period_spend_limit coins can // be spent before that allowance is reset - google.protobuf.Duration period = 2 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + google.protobuf.Duration period = 2 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // period_spend_limit specifies the maximum number of coins that can be spent // in the period - repeated cosmos.base.v1beta1.Coin period_spend_limit = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin period_spend_limit = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; // period_can_spend is the number of coins left to be spent before the period_reset time - repeated cosmos.base.v1beta1.Coin period_can_spend = 4 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin period_can_spend = 4 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; // period_reset is the time at which this period resets and a new one begins, // it is calculated from the start time of the first transaction after the // last period ended - google.protobuf.Timestamp period_reset = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp period_reset = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // AllowedMsgAllowance creates allowance only for specified message types. message AllowedMsgAllowance { option (gogoproto.goproto_getters) = false; - option (cosmos_proto.implements_interface) = "FeeAllowanceI"; + option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; + option (amino.name) = "cosmos-sdk/AllowedMsgAllowance"; // allowance can be any of basic and periodic fee allowance. - google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; + google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; // allowed_messages are the messages for which the grantee has the access. repeated string allowed_messages = 2; @@ -74,5 +89,5 @@ message Grant { string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // allowance can be any of basic, periodic, allowed fee allowance. - google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; } diff --git a/third_party/proto/cosmos/feegrant/v1beta1/genesis.proto b/third_party/proto/cosmos/feegrant/v1beta1/genesis.proto index 5b1ac4ca..a1ead956 100644 --- a/third_party/proto/cosmos/feegrant/v1beta1/genesis.proto +++ b/third_party/proto/cosmos/feegrant/v1beta1/genesis.proto @@ -4,10 +4,11 @@ package cosmos.feegrant.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/feegrant/v1beta1/feegrant.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; // GenesisState contains a set of fee allowances, persisted from the store message GenesisState { - repeated Grant allowances = 1 [(gogoproto.nullable) = false]; + repeated Grant allowances = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/third_party/proto/cosmos/feegrant/v1beta1/tx.proto b/third_party/proto/cosmos/feegrant/v1beta1/tx.proto index a12d9aaa..20bbaf48 100644 --- a/third_party/proto/cosmos/feegrant/v1beta1/tx.proto +++ b/third_party/proto/cosmos/feegrant/v1beta1/tx.proto @@ -5,11 +5,13 @@ package cosmos.feegrant.v1beta1; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; // Msg defines the feegrant msg service. service Msg { + option (cosmos.msg.v1.service) = true; // GrantAllowance grants fee allowance to the grantee on the granter's // account with the provided expiration time. @@ -24,6 +26,7 @@ service Msg { // of fees from the account of Granter. message MsgGrantAllowance { option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgGrantAllowance"; // granter is the address of the user granting an allowance of their funds. string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -32,7 +35,7 @@ message MsgGrantAllowance { string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // allowance can be any of basic, periodic, allowed fee allowance. - google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; } // MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. @@ -41,6 +44,7 @@ message MsgGrantAllowanceResponse {} // MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. message MsgRevokeAllowance { option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgRevokeAllowance"; // granter is the address of the user granting an allowance of their funds. string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; diff --git a/third_party/proto/cosmos/genutil/module/v1/module.proto b/third_party/proto/cosmos/genutil/module/v1/module.proto new file mode 100644 index 00000000..86e6f576 --- /dev/null +++ b/third_party/proto/cosmos/genutil/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.genutil.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the genutil module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/genutil" + }; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/genutil/v1beta1/genesis.proto b/third_party/proto/cosmos/genutil/v1beta1/genesis.proto index 958d15fe..45aa6bb2 100644 --- a/third_party/proto/cosmos/genutil/v1beta1/genesis.proto +++ b/third_party/proto/cosmos/genutil/v1beta1/genesis.proto @@ -2,11 +2,17 @@ syntax = "proto3"; package cosmos.genutil.v1beta1; import "gogoproto/gogo.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types"; // GenesisState defines the raw genesis transaction in JSON. message GenesisState { // gen_txs defines the genesis transactions. - repeated bytes gen_txs = 1 [(gogoproto.casttype) = "encoding/json.RawMessage", (gogoproto.jsontag) = "gentxs"]; + repeated bytes gen_txs = 1 [ + (gogoproto.casttype) = "encoding/json.RawMessage", + (gogoproto.jsontag) = "gentxs", + (amino.field_name) = "gentxs", + (amino.dont_omitempty) = true + ]; } diff --git a/third_party/proto/cosmos/gov/module/v1/module.proto b/third_party/proto/cosmos/gov/module/v1/module.proto new file mode 100644 index 00000000..9544cfe2 --- /dev/null +++ b/third_party/proto/cosmos/gov/module/v1/module.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package cosmos.gov.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the gov module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/gov" + }; + + // max_metadata_len defines the maximum proposal metadata length. + // Defaults to 255 if not explicitly set. + uint64 max_metadata_len = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/gov/v1/genesis.proto b/third_party/proto/cosmos/gov/v1/genesis.proto index cb44a7f3..b9cf573f 100644 --- a/third_party/proto/cosmos/gov/v1/genesis.proto +++ b/third_party/proto/cosmos/gov/v1/genesis.proto @@ -17,10 +17,17 @@ message GenesisState { repeated Vote votes = 3; // proposals defines all the proposals present at genesis. repeated Proposal proposals = 4; - // params defines all the paramaters of related to deposit. - DepositParams deposit_params = 5; - // params defines all the paramaters of related to voting. - VotingParams voting_params = 6; - // params defines all the paramaters of related to tally. - TallyParams tally_params = 7; + // Deprecated: Prefer to use `params` instead. + // deposit_params defines all the paramaters of related to deposit. + DepositParams deposit_params = 5 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. + // voting_params defines all the paramaters of related to voting. + VotingParams voting_params = 6 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. + // tally_params defines all the paramaters of related to tally. + TallyParams tally_params = 7 [deprecated = true]; + // params defines all the paramaters of x/gov module. + // + // Since: cosmos-sdk 0.47 + Params params = 8; } diff --git a/third_party/proto/cosmos/gov/v1/gov.proto b/third_party/proto/cosmos/gov/v1/gov.proto index 8a857233..49bfcc26 100644 --- a/third_party/proto/cosmos/gov/v1/gov.proto +++ b/third_party/proto/cosmos/gov/v1/gov.proto @@ -8,6 +8,7 @@ import "google/protobuf/timestamp.proto"; import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; @@ -27,35 +28,74 @@ enum VoteOption { // WeightedVoteOption defines a unit of vote for vote split. message WeightedVoteOption { + // option defines the valid vote options, it must not contain duplicate vote options. VoteOption option = 1; + + // weight is the vote weight associated with the vote option. string weight = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; } // Deposit defines an amount deposited by an account address to an active // proposal. message Deposit { + // proposal_id defines the unique id of the proposal. uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // Proposal defines the core field members of a governance proposal. message Proposal { + // id defines the unique id of the proposal. uint64 id = 1; + + // messages are the arbitrary messages to be executed if the proposal passes. repeated google.protobuf.Any messages = 2; + + // status defines the proposal status. ProposalStatus status = 3; + // final_tally_result is the final tally result of the proposal. When // querying a proposal via gRPC, this field is not populated until the // proposal's voting period has ended. TallyResult final_tally_result = 4; + + // submit_time is the time of proposal submission. google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true]; + + // deposit_end_time is the end time for deposition. google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true]; - repeated cosmos.base.v1beta1.Coin total_deposit = 7 [(gogoproto.nullable) = false]; + + // total_deposit is the total deposit on the proposal. + repeated cosmos.base.v1beta1.Coin total_deposit = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // voting_start_time is the starting time to vote on a proposal. google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true]; + + // voting_end_time is the end time of voting on a proposal. google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true]; // metadata is any arbitrary metadata attached to the proposal. string metadata = 10; + + // title is the title of the proposal + // + // Since: cosmos-sdk 0.47 + string title = 11; + + // summary is a short summary of the proposal + // + // Since: cosmos-sdk 0.47 + string summary = 12; + + // Proposer is the address of the proposal sumbitter + // + // Since: cosmos-sdk 0.47 + string proposer = 13 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // ProposalStatus enumerates the valid statuses of a proposal. @@ -81,18 +121,28 @@ enum ProposalStatus { // TallyResult defines a standard tally for a governance proposal. message TallyResult { + // yes_count is the number of yes votes on a proposal. string yes_count = 1 [(cosmos_proto.scalar) = "cosmos.Int"]; + // abstain_count is the number of abstain votes on a proposal. string abstain_count = 2 [(cosmos_proto.scalar) = "cosmos.Int"]; + // no_count is the number of no votes on a proposal. string no_count = 3 [(cosmos_proto.scalar) = "cosmos.Int"]; + // no_with_veto_count is the number of no with veto votes on a proposal. string no_with_veto_count = 4 [(cosmos_proto.scalar) = "cosmos.Int"]; } // Vote defines a vote on a governance proposal. // A Vote consists of a proposal ID, the voter, and the vote option. message Vote { + // proposal_id defines the unique id of the proposal. uint64 proposal_id = 1; + + // voter is the voter address of the proposal. string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + reserved 3; + + // options is the weighted vote options. repeated WeightedVoteOption options = 4; // metadata is any arbitrary metadata to attached to the vote. @@ -101,32 +151,70 @@ message Vote { // DepositParams defines the params for deposits on governance proposals. message DepositParams { - // Minimum deposit for a proposal to enter voting period. + // Minimum deposit for a proposal to enter voting period. repeated cosmos.base.v1beta1.Coin min_deposit = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "min_deposit,omitempty"]; - // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - // months. + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. google.protobuf.Duration max_deposit_period = 2 [(gogoproto.stdduration) = true, (gogoproto.jsontag) = "max_deposit_period,omitempty"]; } // VotingParams defines the params for voting on governance proposals. message VotingParams { - // Length of the voting period. + // Duration of the voting period. google.protobuf.Duration voting_period = 1 [(gogoproto.stdduration) = true]; } // TallyParams defines the params for tallying votes on governance proposals. message TallyParams { + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + string quorum = 1 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + string threshold = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + string veto_threshold = 3 [(cosmos_proto.scalar) = "cosmos.Dec"]; +} + +// Params defines the parameters for the x/gov module. +// +// Since: cosmos-sdk 0.47 +message Params { + // Minimum deposit for a proposal to enter voting period. + repeated cosmos.base.v1beta1.Coin min_deposit = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + google.protobuf.Duration max_deposit_period = 2 [(gogoproto.stdduration) = true]; + + // Duration of the voting period. + google.protobuf.Duration voting_period = 3 [(gogoproto.stdduration) = true]; + // Minimum percentage of total stake needed to vote for a result to be // considered valid. - string quorum = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.jsontag) = "quorum,omitempty"]; + string quorum = 4 [(cosmos_proto.scalar) = "cosmos.Dec"]; // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - string threshold = 2 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.jsontag) = "threshold,omitempty"]; + string threshold = 5 [(cosmos_proto.scalar) = "cosmos.Dec"]; // Minimum value of Veto votes to Total votes ratio for proposal to be // vetoed. Default value: 1/3. - string veto_threshold = 3 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.jsontag) = "veto_threshold,omitempty"]; + string veto_threshold = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // The ratio representing the proportion of the deposit value that must be paid at proposal submission. + string min_initial_deposit_ratio = 7 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // burn deposits if a proposal does not meet quorum + bool burn_vote_quorum = 13; + + // burn deposits if the proposal does not enter voting period + bool burn_proposal_deposit_prevote = 14; + + // burn deposits if quorum with vote type no_veto is met + bool burn_vote_veto = 15; } diff --git a/third_party/proto/cosmos/gov/v1/query.proto b/third_party/proto/cosmos/gov/v1/query.proto index b9d59145..0c1c9f2b 100644 --- a/third_party/proto/cosmos/gov/v1/query.proto +++ b/third_party/proto/cosmos/gov/v1/query.proto @@ -61,6 +61,7 @@ message QueryProposalRequest { // QueryProposalResponse is the response type for the Query/Proposal RPC method. message QueryProposalResponse { + // proposal is the requested governance proposal. Proposal proposal = 1; } @@ -82,6 +83,7 @@ message QueryProposalsRequest { // QueryProposalsResponse is the response type for the Query/Proposals RPC // method. message QueryProposalsResponse { + // proposals defines all the requested governance proposals. repeated Proposal proposals = 1; // pagination defines the pagination in the response. @@ -99,7 +101,7 @@ message QueryVoteRequest { // QueryVoteResponse is the response type for the Query/Vote RPC method. message QueryVoteResponse { - // vote defined the queried vote. + // vote defines the queried vote. Vote vote = 1; } @@ -114,7 +116,7 @@ message QueryVotesRequest { // QueryVotesResponse is the response type for the Query/Votes RPC method. message QueryVotesResponse { - // votes defined the queried votes. + // votes defines the queried votes. repeated Vote votes = 1; // pagination defines the pagination in the response. @@ -130,12 +132,19 @@ message QueryParamsRequest { // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { + // Deprecated: Prefer to use `params` instead. // voting_params defines the parameters related to voting. - VotingParams voting_params = 1; + VotingParams voting_params = 1 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. // deposit_params defines the parameters related to deposit. - DepositParams deposit_params = 2; + DepositParams deposit_params = 2 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. // tally_params defines the parameters related to tally. - TallyParams tally_params = 3; + TallyParams tally_params = 3 [deprecated = true]; + // params defines all the paramaters of x/gov module. + // + // Since: cosmos-sdk 0.47 + Params params = 4; } // QueryDepositRequest is the request type for the Query/Deposit RPC method. @@ -164,6 +173,7 @@ message QueryDepositsRequest { // QueryDepositsResponse is the response type for the Query/Deposits RPC method. message QueryDepositsResponse { + // deposits defines the requested deposits. repeated Deposit deposits = 1; // pagination defines the pagination in the response. diff --git a/third_party/proto/cosmos/gov/v1/tx.proto b/third_party/proto/cosmos/gov/v1/tx.proto index 9306c51e..1708066c 100644 --- a/third_party/proto/cosmos/gov/v1/tx.proto +++ b/third_party/proto/cosmos/gov/v1/tx.proto @@ -8,12 +8,15 @@ import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "google/protobuf/any.proto"; import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; // Msg defines the gov Msg service. service Msg { - // SubmitProposal defines a method to create new proposal given a content. + option (cosmos.msg.v1.service) = true; + + // SubmitProposal defines a method to create new proposal given the messages. rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal @@ -28,22 +31,46 @@ service Msg { // Deposit defines a method to add deposit on a specific proposal. rpc Deposit(MsgDeposit) returns (MsgDepositResponse); + + // UpdateParams defines a governance operation for updating the x/gov module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary // proposal Content. message MsgSubmitProposal { option (cosmos.msg.v1.signer) = "proposer"; + option (amino.name) = "cosmos-sdk/v1/MsgSubmitProposal"; + // messages are the arbitrary messages to be executed if proposal passes. repeated google.protobuf.Any messages = 1; - repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [(gogoproto.nullable) = false]; + + // initial_deposit is the deposit value that must be paid at proposal submission. + repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // proposer is the account address of the proposer. string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // metadata is any arbitrary metadata attached to the proposal. string metadata = 4; + + // title is the title of the proposal. + // + // Since: cosmos-sdk 0.47 + string title = 5; + + // summary is the summary of the proposal + // + // Since: cosmos-sdk 0.47 + string summary = 6; } // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. message MsgSubmitProposalResponse { + // proposal_id defines the unique id of the proposal. uint64 proposal_id = 1; } @@ -51,9 +78,10 @@ message MsgSubmitProposalResponse { // This ensures backwards compatibility with v1beta1.MsgSubmitProposal. message MsgExecLegacyContent { option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/v1/MsgExecLegacyContent"; // content is the proposal's content. - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; // authority must be the gov module address. string authority = 2; } @@ -64,10 +92,18 @@ message MsgExecLegacyContentResponse {} // MsgVote defines a message to cast a vote. message MsgVote { option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/v1/MsgVote"; - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // voter is the voter address for the proposal. string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option defines the vote option. VoteOption option = 3; + + // metadata is any arbitrary metadata attached to the Vote. string metadata = 4; } @@ -77,10 +113,18 @@ message MsgVoteResponse {} // MsgVoteWeighted defines a message to cast a vote. message MsgVoteWeighted { option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/v1/MsgVoteWeighted"; - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // voter is the voter address for the proposal. string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // options defines the weighted vote options. repeated WeightedVoteOption options = 3; + + // metadata is any arbitrary metadata attached to the VoteWeighted. string metadata = 4; } @@ -90,11 +134,39 @@ message MsgVoteWeightedResponse {} // MsgDeposit defines a message to submit a deposit to an existing proposal. message MsgDeposit { option (cosmos.msg.v1.signer) = "depositor"; + option (amino.name) = "cosmos-sdk/v1/MsgDeposit"; - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // depositor defines the deposit addresses from the proposals. string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgDepositResponse defines the Msg/Deposit response type. message MsgDepositResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/gov/v1/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/gov parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/third_party/proto/cosmos/gov/v1beta1/genesis.proto b/third_party/proto/cosmos/gov/v1beta1/genesis.proto index be9b07e4..a680590c 100644 --- a/third_party/proto/cosmos/gov/v1beta1/genesis.proto +++ b/third_party/proto/cosmos/gov/v1beta1/genesis.proto @@ -4,6 +4,7 @@ package cosmos.gov.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/gov/v1beta1/gov.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; @@ -12,15 +13,18 @@ message GenesisState { // starting_proposal_id is the ID of the starting proposal. uint64 starting_proposal_id = 1; // deposits defines all the deposits present at genesis. - repeated Deposit deposits = 2 [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false]; + repeated Deposit deposits = 2 + [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // votes defines all the votes present at genesis. - repeated Vote votes = 3 [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false]; + repeated Vote votes = 3 + [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // proposals defines all the proposals present at genesis. - repeated Proposal proposals = 4 [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false]; - // params defines all the paramaters of related to deposit. - DepositParams deposit_params = 5 [(gogoproto.nullable) = false]; - // params defines all the paramaters of related to voting. - VotingParams voting_params = 6 [(gogoproto.nullable) = false]; - // params defines all the paramaters of related to tally. - TallyParams tally_params = 7 [(gogoproto.nullable) = false]; + repeated Proposal proposals = 4 + [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // params defines all the parameters of related to deposit. + DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // params defines all the parameters of related to voting. + VotingParams voting_params = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // params defines all the parameters of related to tally. + TallyParams tally_params = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/third_party/proto/cosmos/gov/v1beta1/gov.proto b/third_party/proto/cosmos/gov/v1beta1/gov.proto index 0e65d65b..dc8fcfd3 100644 --- a/third_party/proto/cosmos/gov/v1beta1/gov.proto +++ b/third_party/proto/cosmos/gov/v1beta1/gov.proto @@ -7,6 +7,7 @@ import "google/protobuf/timestamp.proto"; import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; @@ -34,7 +35,10 @@ enum VoteOption { // // Since: cosmos-sdk 0.43 message WeightedVoteOption { + // option defines the valid vote options, it must not contain duplicate vote options. VoteOption option = 1; + + // weight is the vote weight associated with the vote option. string weight = 2 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", @@ -45,11 +49,15 @@ message WeightedVoteOption { // TextProposal defines a standard text proposal whose changes need to be // manually updated in case of approval. message TextProposal { - option (cosmos_proto.implements_interface) = "Content"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/TextProposal"; option (gogoproto.equal) = true; + // title of the proposal. string title = 1; + + // description associated with the proposal. string description = 2; } @@ -59,29 +67,59 @@ message Deposit { option (gogoproto.goproto_getters) = false; option (gogoproto.equal) = false; + // proposal_id defines the unique id of the proposal. uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // Proposal defines the core field members of a governance proposal. message Proposal { option (gogoproto.equal) = true; + // proposal_id defines the unique id of the proposal. uint64 proposal_id = 1; - google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"]; + + // content is the proposal's content. + google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + // status defines the proposal status. ProposalStatus status = 3; + // final_tally_result is the final tally result of the proposal. When // querying a proposal via gRPC, this field is not populated until the // proposal's voting period has ended. - TallyResult final_tally_result = 4 [(gogoproto.nullable) = false]; - google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - repeated cosmos.base.v1beta1.Coin total_deposit = 7 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + TallyResult final_tally_result = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // submit_time is the time of proposal submission. + google.protobuf.Timestamp submit_time = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // deposit_end_time is the end time for deposition. + google.protobuf.Timestamp deposit_end_time = 6 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // total_deposit is the total deposit on the proposal. + repeated cosmos.base.v1beta1.Coin total_deposit = 7 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // voting_start_time is the starting time to vote on a proposal. + google.protobuf.Timestamp voting_start_time = 8 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // voting_end_time is the end time of voting on a proposal. + google.protobuf.Timestamp voting_end_time = 9 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // ProposalStatus enumerates the valid statuses of a proposal. @@ -111,21 +149,28 @@ enum ProposalStatus { message TallyResult { option (gogoproto.equal) = true; + // yes is the number of yes votes on a proposal. string yes = 1 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; + + // abstain is the number of abstain votes on a proposal. string abstain = 2 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; + + // no is the number of no votes on a proposal. string no = 3 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; + + // no_with_veto is the number of no with veto votes on a proposal. string no_with_veto = 4 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", @@ -139,27 +184,33 @@ message Vote { option (gogoproto.goproto_stringer) = false; option (gogoproto.equal) = false; - uint64 proposal_id = 1 [(gogoproto.jsontag) = "id"]; + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (amino.field_name) = "id", (amino.dont_omitempty) = true]; + + // voter is the voter address of the proposal. string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Deprecated: Prefer to use `options` instead. This field is set in queries // if and only if `len(options) == 1` and that option has weight 1. In all // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. VoteOption option = 3 [deprecated = true]; + + // options is the weighted vote options. + // // Since: cosmos-sdk 0.43 - repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; + repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // DepositParams defines the params for deposits on governance proposals. message DepositParams { - // Minimum deposit for a proposal to enter voting period. + // Minimum deposit for a proposal to enter voting period. repeated cosmos.base.v1beta1.Coin min_deposit = 1 [ (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.jsontag) = "min_deposit,omitempty" ]; - // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - // months. + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. google.protobuf.Duration max_deposit_period = 2 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true, @@ -169,30 +220,30 @@ message DepositParams { // VotingParams defines the params for voting on governance proposals. message VotingParams { - // Length of the voting period. + // Duration of the voting period. google.protobuf.Duration voting_period = 1 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.jsontag) = "voting_period,omitempty"]; } // TallyParams defines the params for tallying votes on governance proposals. message TallyParams { - // Minimum percentage of total stake needed to vote for a result to be - // considered valid. + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. bytes quorum = 1 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.jsontag) = "quorum,omitempty" ]; - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. bytes threshold = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.jsontag) = "threshold,omitempty" ]; - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. bytes veto_threshold = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, diff --git a/third_party/proto/cosmos/gov/v1beta1/query.proto b/third_party/proto/cosmos/gov/v1beta1/query.proto index 168e1f5e..f225a0f6 100644 --- a/third_party/proto/cosmos/gov/v1beta1/query.proto +++ b/third_party/proto/cosmos/gov/v1beta1/query.proto @@ -6,6 +6,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/gov/v1beta1/gov.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; @@ -60,7 +61,7 @@ message QueryProposalRequest { // QueryProposalResponse is the response type for the Query/Proposal RPC method. message QueryProposalResponse { - Proposal proposal = 1 [(gogoproto.nullable) = false]; + Proposal proposal = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryProposalsRequest is the request type for the Query/Proposals RPC method. @@ -84,7 +85,8 @@ message QueryProposalsRequest { // QueryProposalsResponse is the response type for the Query/Proposals RPC // method. message QueryProposalsResponse { - repeated Proposal proposals = 1 [(gogoproto.nullable) = false]; + // proposals defines all the requested governance proposals. + repeated Proposal proposals = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -104,8 +106,8 @@ message QueryVoteRequest { // QueryVoteResponse is the response type for the Query/Vote RPC method. message QueryVoteResponse { - // vote defined the queried vote. - Vote vote = 1 [(gogoproto.nullable) = false]; + // vote defines the queried vote. + Vote vote = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryVotesRequest is the request type for the Query/Votes RPC method. @@ -119,8 +121,8 @@ message QueryVotesRequest { // QueryVotesResponse is the response type for the Query/Votes RPC method. message QueryVotesResponse { - // votes defined the queried votes. - repeated Vote votes = 1 [(gogoproto.nullable) = false]; + // votes defines the queried votes. + repeated Vote votes = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -136,11 +138,11 @@ message QueryParamsRequest { // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { // voting_params defines the parameters related to voting. - VotingParams voting_params = 1 [(gogoproto.nullable) = false]; + VotingParams voting_params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // deposit_params defines the parameters related to deposit. - DepositParams deposit_params = 2 [(gogoproto.nullable) = false]; + DepositParams deposit_params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // tally_params defines the parameters related to tally. - TallyParams tally_params = 3 [(gogoproto.nullable) = false]; + TallyParams tally_params = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryDepositRequest is the request type for the Query/Deposit RPC method. @@ -158,7 +160,7 @@ message QueryDepositRequest { // QueryDepositResponse is the response type for the Query/Deposit RPC method. message QueryDepositResponse { // deposit defines the requested deposit. - Deposit deposit = 1 [(gogoproto.nullable) = false]; + Deposit deposit = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryDepositsRequest is the request type for the Query/Deposits RPC method. @@ -172,7 +174,8 @@ message QueryDepositsRequest { // QueryDepositsResponse is the response type for the Query/Deposits RPC method. message QueryDepositsResponse { - repeated Deposit deposits = 1 [(gogoproto.nullable) = false]; + // deposits defines the requested deposits. + repeated Deposit deposits = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -187,5 +190,5 @@ message QueryTallyResultRequest { // QueryTallyResultResponse is the response type for the Query/Tally RPC method. message QueryTallyResultResponse { // tally defines the requested tally. - TallyResult tally = 1 [(gogoproto.nullable) = false]; + TallyResult tally = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/third_party/proto/cosmos/gov/v1beta1/tx.proto b/third_party/proto/cosmos/gov/v1beta1/tx.proto index 00ce2253..0afa1d56 100644 --- a/third_party/proto/cosmos/gov/v1beta1/tx.proto +++ b/third_party/proto/cosmos/gov/v1beta1/tx.proto @@ -6,13 +6,15 @@ import "cosmos/gov/v1beta1/gov.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; - import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; // Msg defines the bank Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // SubmitProposal defines a method to create new proposal given a content. rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); @@ -32,34 +34,49 @@ service Msg { // proposal Content. message MsgSubmitProposal { option (cosmos.msg.v1.signer) = "proposer"; + option (amino.name) = "cosmos-sdk/MsgSubmitProposal"; option (gogoproto.equal) = false; option (gogoproto.goproto_stringer) = false; option (gogoproto.stringer) = false; option (gogoproto.goproto_getters) = false; - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; - repeated cosmos.base.v1beta1.Coin initial_deposit = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // content is the proposal's content. + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + // initial_deposit is the deposit value that must be paid at proposal submission. + repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // proposer is the account address of the proposer. string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. message MsgSubmitProposalResponse { - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; } // MsgVote defines a message to cast a vote. message MsgVote { option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/MsgVote"; option (gogoproto.equal) = false; option (gogoproto.goproto_stringer) = false; option (gogoproto.stringer) = false; option (gogoproto.goproto_getters) = false; + // proposal_id defines the unique id of the proposal. uint64 proposal_id = 1; + + // voter is the voter address for the proposal. string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option defines the vote option. VoteOption option = 3; } @@ -71,15 +88,21 @@ message MsgVoteResponse {} // Since: cosmos-sdk 0.43 message MsgVoteWeighted { option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/MsgVoteWeighted"; option (gogoproto.equal) = false; option (gogoproto.goproto_stringer) = false; option (gogoproto.stringer) = false; option (gogoproto.goproto_getters) = false; - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // voter is the voter address for the proposal. string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; + + // options defines the weighted vote options. + repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. @@ -90,16 +113,25 @@ message MsgVoteWeightedResponse {} // MsgDeposit defines a message to submit a deposit to an existing proposal. message MsgDeposit { option (cosmos.msg.v1.signer) = "depositor"; + option (amino.name) = "cosmos-sdk/MsgDeposit"; option (gogoproto.equal) = false; option (gogoproto.goproto_stringer) = false; option (gogoproto.stringer) = false; option (gogoproto.goproto_getters) = false; - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // depositor defines the deposit addresses from the proposals. string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // MsgDepositResponse defines the Msg/Deposit response type. diff --git a/third_party/proto/cosmos/group/module/v1/module.proto b/third_party/proto/cosmos/group/module/v1/module.proto new file mode 100644 index 00000000..d1e7ffb2 --- /dev/null +++ b/third_party/proto/cosmos/group/module/v1/module.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package cosmos.group.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "amino/amino.proto"; + +// Module is the config object of the group module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/group" + }; + + // max_execution_period defines the max duration after a proposal's voting period ends that members can send a MsgExec + // to execute the proposal. + google.protobuf.Duration max_execution_period = 1 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // max_metadata_len defines the max length of the metadata bytes field for various entities within the group module. + // Defaults to 255 if not explicitly set. + uint64 max_metadata_len = 2; +} diff --git a/third_party/proto/cosmos/group/v1/events.proto b/third_party/proto/cosmos/group/v1/events.proto index c2cfe872..2b98ec9a 100644 --- a/third_party/proto/cosmos/group/v1/events.proto +++ b/third_party/proto/cosmos/group/v1/events.proto @@ -79,3 +79,16 @@ message EventLeaveGroup { // address is the account address of the group member. string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } + +// EventProposalPruned is an event emitted when a proposal is pruned. +message EventProposalPruned { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; + + // status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). + ProposalStatus status = 2; + + // tally_result is the proposal tally result (when applicable). + TallyResult tally_result = 3; +} diff --git a/third_party/proto/cosmos/group/v1/query.proto b/third_party/proto/cosmos/group/v1/query.proto index 51a011a9..80b09255 100644 --- a/third_party/proto/cosmos/group/v1/query.proto +++ b/third_party/proto/cosmos/group/v1/query.proto @@ -8,6 +8,7 @@ import "google/api/annotations.proto"; import "cosmos/group/v1/types.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/group"; @@ -24,7 +25,7 @@ service Query { option (google.api.http).get = "/cosmos/group/v1/group_policy_info/{address}"; }; - // GroupMembers queries members of a group + // GroupMembers queries members of a group by group id. rpc GroupMembers(QueryGroupMembersRequest) returns (QueryGroupMembersResponse) { option (google.api.http).get = "/cosmos/group/v1/group_members/{group_id}"; }; @@ -39,7 +40,7 @@ service Query { option (google.api.http).get = "/cosmos/group/v1/group_policies_by_group/{group_id}"; }; - // GroupsByAdmin queries group policies by admin address. + // GroupPoliciesByAdmin queries group policies by admin address. rpc GroupPoliciesByAdmin(QueryGroupPoliciesByAdminRequest) returns (QueryGroupPoliciesByAdminResponse) { option (google.api.http).get = "/cosmos/group/v1/group_policies_by_admin/{admin}"; }; @@ -59,7 +60,7 @@ service Query { option (google.api.http).get = "/cosmos/group/v1/vote_by_proposal_voter/{proposal_id}/{voter}"; }; - // VotesByProposal queries a vote by proposal. + // VotesByProposal queries a vote by proposal id. rpc VotesByProposal(QueryVotesByProposalRequest) returns (QueryVotesByProposalResponse) { option (google.api.http).get = "/cosmos/group/v1/votes_by_proposal/{proposal_id}"; }; @@ -82,39 +83,41 @@ service Query { rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { option (google.api.http).get = "/cosmos/group/v1/proposals/{proposal_id}/tally"; }; + + // Groups queries all groups in state. + // + // Since: cosmos-sdk 0.47.1 + rpc Groups(QueryGroupsRequest) returns (QueryGroupsResponse) { + option (google.api.http).get = "/cosmos/group/v1/groups"; + }; } // QueryGroupInfoRequest is the Query/GroupInfo request type. message QueryGroupInfoRequest { - // group_id is the unique ID of the group. uint64 group_id = 1; } // QueryGroupInfoResponse is the Query/GroupInfo response type. message QueryGroupInfoResponse { - - // info is the GroupInfo for the group. + // info is the GroupInfo of the group. GroupInfo info = 1; } // QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. message QueryGroupPolicyInfoRequest { - // address is the account address of the group policy. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. message QueryGroupPolicyInfoResponse { - - // info is the GroupPolicyInfo for the group policy. + // info is the GroupPolicyInfo of the group policy. GroupPolicyInfo info = 1; } // QueryGroupMembersRequest is the Query/GroupMembers request type. message QueryGroupMembersRequest { - // group_id is the unique ID of the group. uint64 group_id = 1; @@ -124,7 +127,6 @@ message QueryGroupMembersRequest { // QueryGroupMembersResponse is the Query/GroupMembersResponse response type. message QueryGroupMembersResponse { - // members are the members of the group with given group_id. repeated GroupMember members = 1; @@ -134,7 +136,6 @@ message QueryGroupMembersResponse { // QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. message QueryGroupsByAdminRequest { - // admin is the account address of a group's admin. string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -144,7 +145,6 @@ message QueryGroupsByAdminRequest { // QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. message QueryGroupsByAdminResponse { - // groups are the groups info with the provided admin. repeated GroupInfo groups = 1; @@ -154,7 +154,6 @@ message QueryGroupsByAdminResponse { // QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. message QueryGroupPoliciesByGroupRequest { - // group_id is the unique ID of the group policy's group. uint64 group_id = 1; @@ -164,7 +163,6 @@ message QueryGroupPoliciesByGroupRequest { // QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. message QueryGroupPoliciesByGroupResponse { - // group_policies are the group policies info associated with the provided group. repeated GroupPolicyInfo group_policies = 1; @@ -174,7 +172,6 @@ message QueryGroupPoliciesByGroupResponse { // QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. message QueryGroupPoliciesByAdminRequest { - // admin is the admin address of the group policy. string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -184,7 +181,6 @@ message QueryGroupPoliciesByAdminRequest { // QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. message QueryGroupPoliciesByAdminResponse { - // group_policies are the group policies info with provided admin. repeated GroupPolicyInfo group_policies = 1; @@ -194,21 +190,18 @@ message QueryGroupPoliciesByAdminResponse { // QueryProposalRequest is the Query/Proposal request type. message QueryProposalRequest { - // proposal_id is the unique ID of a proposal. uint64 proposal_id = 1; } // QueryProposalResponse is the Query/Proposal response type. message QueryProposalResponse { - // proposal is the proposal info. Proposal proposal = 1; } // QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. message QueryProposalsByGroupPolicyRequest { - // address is the account address of the group policy related to proposals. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -218,7 +211,6 @@ message QueryProposalsByGroupPolicyRequest { // QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. message QueryProposalsByGroupPolicyResponse { - // proposals are the proposals with given group policy. repeated Proposal proposals = 1; @@ -228,7 +220,6 @@ message QueryProposalsByGroupPolicyResponse { // QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. message QueryVoteByProposalVoterRequest { - // proposal_id is the unique ID of a proposal. uint64 proposal_id = 1; @@ -238,14 +229,12 @@ message QueryVoteByProposalVoterRequest { // QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. message QueryVoteByProposalVoterResponse { - // vote is the vote with given proposal_id and voter. Vote vote = 1; } // QueryVotesByProposalRequest is the Query/VotesByProposal request type. message QueryVotesByProposalRequest { - // proposal_id is the unique ID of a proposal. uint64 proposal_id = 1; @@ -255,7 +244,6 @@ message QueryVotesByProposalRequest { // QueryVotesByProposalResponse is the Query/VotesByProposal response type. message QueryVotesByProposalResponse { - // votes are the list of votes for given proposal_id. repeated Vote votes = 1; @@ -274,7 +262,6 @@ message QueryVotesByVoterRequest { // QueryVotesByVoterResponse is the Query/VotesByVoter response type. message QueryVotesByVoterResponse { - // votes are the list of votes by given voter. repeated Vote votes = 1; @@ -309,5 +296,25 @@ message QueryTallyResultRequest { // QueryTallyResultResponse is the Query/TallyResult response type. message QueryTallyResultResponse { // tally defines the requested tally. - TallyResult tally = 1 [(gogoproto.nullable) = false]; + TallyResult tally = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryGroupsRequest is the Query/Groups request type. +// +// Since: cosmos-sdk 0.47.1 +message QueryGroupsRequest { + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupsResponse is the Query/Groups response type. +// +// Since: cosmos-sdk 0.47.1 +message QueryGroupsResponse { + // `groups` is all the groups present in state. + repeated GroupInfo groups = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; } diff --git a/third_party/proto/cosmos/group/v1/tx.proto b/third_party/proto/cosmos/group/v1/tx.proto index 1983d31b..20e04cb7 100644 --- a/third_party/proto/cosmos/group/v1/tx.proto +++ b/third_party/proto/cosmos/group/v1/tx.proto @@ -9,11 +9,12 @@ import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "google/protobuf/any.proto"; import "cosmos/group/v1/types.proto"; - import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; // Msg is the cosmos.group.v1 Msg service. service Msg { + option (cosmos.msg.v1.service) = true; // CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. rpc CreateGroup(MsgCreateGroup) returns (MsgCreateGroupResponse); @@ -66,12 +67,13 @@ service Msg { // MsgCreateGroup is the Msg/CreateGroup request type. message MsgCreateGroup { option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgCreateGroup"; // admin is the account address of the group admin. string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // members defines the group members. - repeated MemberRequest members = 2 [(gogoproto.nullable) = false]; + repeated MemberRequest members = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // metadata is any arbitrary metadata to attached to the group. string metadata = 3; @@ -79,7 +81,6 @@ message MsgCreateGroup { // MsgCreateGroupResponse is the Msg/CreateGroup response type. message MsgCreateGroupResponse { - // group_id is the unique ID of the newly created group. uint64 group_id = 1; } @@ -87,6 +88,7 @@ message MsgCreateGroupResponse { // MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. message MsgUpdateGroupMembers { option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupMembers"; // admin is the account address of the group admin. string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -96,7 +98,7 @@ message MsgUpdateGroupMembers { // member_updates is the list of members to update, // set weight to 0 to remove a member. - repeated MemberRequest member_updates = 3 [(gogoproto.nullable) = false]; + repeated MemberRequest member_updates = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. @@ -105,6 +107,7 @@ message MsgUpdateGroupMembersResponse {} // MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. message MsgUpdateGroupAdmin { option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupAdmin"; // admin is the current account address of the group admin. string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -122,6 +125,7 @@ message MsgUpdateGroupAdminResponse {} // MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. message MsgUpdateGroupMetadata { option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupMetadata"; // admin is the account address of the group admin. string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -143,6 +147,7 @@ message MsgUpdateGroupMetadataResponse {} // MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. message MsgCreateGroupPolicy { option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgCreateGroupPolicy"; option (gogoproto.goproto_getters) = false; @@ -161,7 +166,6 @@ message MsgCreateGroupPolicy { // MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. message MsgCreateGroupPolicyResponse { - // address is the account address of the newly created group policy. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } @@ -169,6 +173,7 @@ message MsgCreateGroupPolicyResponse { // MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. message MsgUpdateGroupPolicyAdmin { option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupPolicyAdmin"; // admin is the account address of the group admin. string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -180,16 +185,20 @@ message MsgUpdateGroupPolicyAdmin { string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } +// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. +message MsgUpdateGroupPolicyAdminResponse {} + // MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. message MsgCreateGroupWithPolicy { option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgCreateGroupWithPolicy"; option (gogoproto.goproto_getters) = false; // admin is the account address of the group and group policy admin. string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // members defines the group members. - repeated MemberRequest members = 2 [(gogoproto.nullable) = false]; + repeated MemberRequest members = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // group_metadata is any arbitrary metadata attached to the group. string group_metadata = 3; @@ -207,7 +216,6 @@ message MsgCreateGroupWithPolicy { // MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. message MsgCreateGroupWithPolicyResponse { - // group_id is the unique ID of the newly created group with policy. uint64 group_id = 1; @@ -215,12 +223,10 @@ message MsgCreateGroupWithPolicyResponse { string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } -// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. -message MsgUpdateGroupPolicyAdminResponse {} - // MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. message MsgUpdateGroupPolicyDecisionPolicy { option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupDecisionPolicy"; option (gogoproto.goproto_getters) = false; @@ -240,6 +246,7 @@ message MsgUpdateGroupPolicyDecisionPolicyResponse {} // MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. message MsgUpdateGroupPolicyMetadata { option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupPolicyMetadata"; // admin is the account address of the group admin. string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -247,7 +254,7 @@ message MsgUpdateGroupPolicyMetadata { // group_policy_address is the account address of group policy. string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // metadata is the updated group policy metadata. + // metadata is the group policy metadata to be updated. string metadata = 3; } @@ -260,7 +267,6 @@ message MsgUpdateGroupPolicyMetadataResponse {} // Exec defines modes of execution of a proposal on creation or on new vote. enum Exec { - // An empty value means that there should be a separate // MsgExec request for the proposal to execute. EXEC_UNSPECIFIED = 0; @@ -275,6 +281,7 @@ enum Exec { // MsgSubmitProposal is the Msg/SubmitProposal request type. message MsgSubmitProposal { option (cosmos.msg.v1.signer) = "proposers"; + option (amino.name) = "cosmos-sdk/group/MsgSubmitProposal"; option (gogoproto.goproto_getters) = false; @@ -285,7 +292,7 @@ message MsgSubmitProposal { // Proposers signatures will be counted as yes votes. repeated string proposers = 2; - // metadata is any arbitrary metadata to attached to the proposal. + // metadata is any arbitrary metadata attached to the proposal. string metadata = 3; // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. @@ -295,11 +302,20 @@ message MsgSubmitProposal { // whether it should be executed immediately on creation or not. // If so, proposers signatures are considered as Yes votes. Exec exec = 5; + + // title is the title of the proposal. + // + // Since: cosmos-sdk 0.47 + string title = 6; + + // summary is the summary of the proposal. + // + // Since: cosmos-sdk 0.47 + string summary = 7; } // MsgSubmitProposalResponse is the Msg/SubmitProposal response type. message MsgSubmitProposalResponse { - // proposal is the unique ID of the proposal. uint64 proposal_id = 1; } @@ -307,6 +323,7 @@ message MsgSubmitProposalResponse { // MsgWithdrawProposal is the Msg/WithdrawProposal request type. message MsgWithdrawProposal { option (cosmos.msg.v1.signer) = "address"; + option (amino.name) = "cosmos-sdk/group/MsgWithdrawProposal"; // proposal is the unique ID of the proposal. uint64 proposal_id = 1; @@ -321,16 +338,18 @@ message MsgWithdrawProposalResponse {} // MsgVote is the Msg/Vote request type. message MsgVote { option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/group/MsgVote"; // proposal is the unique ID of the proposal. uint64 proposal_id = 1; + // voter is the voter account address. string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // option is the voter's choice on the proposal. VoteOption option = 3; - // metadata is any arbitrary metadata to attached to the vote. + // metadata is any arbitrary metadata attached to the vote. string metadata = 4; // exec defines whether the proposal should be executed @@ -344,6 +363,7 @@ message MsgVoteResponse {} // MsgExec is the Msg/Exec request type. message MsgExec { option (cosmos.msg.v1.signer) = "signer"; + option (amino.name) = "cosmos-sdk/group/MsgExec"; // proposal is the unique ID of the proposal. uint64 proposal_id = 1; @@ -361,6 +381,7 @@ message MsgExecResponse { // MsgLeaveGroup is the Msg/LeaveGroup request type. message MsgLeaveGroup { option (cosmos.msg.v1.signer) = "address"; + option (amino.name) = "cosmos-sdk/group/MsgLeaveGroup"; // address is the account address of the group member. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; diff --git a/third_party/proto/cosmos/group/v1/types.proto b/third_party/proto/cosmos/group/v1/types.proto index 83727154..4968d13c 100644 --- a/third_party/proto/cosmos/group/v1/types.proto +++ b/third_party/proto/cosmos/group/v1/types.proto @@ -10,11 +10,11 @@ import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; import "google/protobuf/any.proto"; +import "amino/amino.proto"; // Member represents a group member with an account address, // non-zero weight, metadata and added_at timestamp. message Member { - // address is the member's account address. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -25,14 +25,14 @@ message Member { string metadata = 3; // added_at is a timestamp specifying when a member was added. - google.protobuf.Timestamp added_at = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp added_at = 4 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; } // MemberRequest represents a group member to be used in Msg server requests. // Contrary to `Member`, it doesn't have any `added_at` field // since this field cannot be set as part of requests. message MemberRequest { - // address is the member's account address. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -45,12 +45,13 @@ message MemberRequest { // ThresholdDecisionPolicy is a decision policy where a proposal passes when it // satisfies the two following conditions: -// 1. The sum of all `YES` voters' weights is greater or equal than the defined +// 1. The sum of all `YES` voter's weights is greater or equal than the defined // `threshold`. // 2. The voting and execution periods of the proposal respect the parameters // given by `windows`. message ThresholdDecisionPolicy { - option (cosmos_proto.implements_interface) = "DecisionPolicy"; + option (cosmos_proto.implements_interface) = "cosmos.group.v1.DecisionPolicy"; + option (amino.name) = "cosmos-sdk/ThresholdDecisionPolicy"; // threshold is the minimum weighted sum of `YES` votes that must be met or // exceeded for a proposal to succeed. @@ -67,9 +68,10 @@ message ThresholdDecisionPolicy { // 2. The voting and execution periods of the proposal respect the parameters // given by `windows`. message PercentageDecisionPolicy { - option (cosmos_proto.implements_interface) = "DecisionPolicy"; + option (cosmos_proto.implements_interface) = "cosmos.group.v1.DecisionPolicy"; + option (amino.name) = "cosmos-sdk/PercentageDecisionPolicy"; - // percentage is the minimum percentage the weighted sum of `YES` votes must + // percentage is the minimum percentage of the weighted sum of `YES` votes must // meet for a proposal to succeed. string percentage = 1; @@ -81,7 +83,8 @@ message PercentageDecisionPolicy { message DecisionPolicyWindows { // voting_period is the duration from submission of a proposal to the end of voting period // Within this times votes can be submitted with MsgVote. - google.protobuf.Duration voting_period = 1 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + google.protobuf.Duration voting_period = 1 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // min_execution_period is the minimum duration after the proposal submission // where members can start sending MsgExec. This means that the window for @@ -94,7 +97,8 @@ message DecisionPolicyWindows { // `voting_period + max_execution_period`, or else the above execution window // is empty, meaning that all proposals created with this decision policy // won't be able to be executed. - google.protobuf.Duration min_execution_period = 2 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + google.protobuf.Duration min_execution_period = 2 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // VoteOption enumerates the valid vote options for a given proposal. @@ -120,7 +124,6 @@ enum VoteOption { // GroupInfo represents the high-level on-chain information for a group. message GroupInfo { - // id is the unique ID of the group. uint64 id = 1; @@ -140,12 +143,12 @@ message GroupInfo { string total_weight = 5; // created_at is a timestamp specifying when a group was created. - google.protobuf.Timestamp created_at = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp created_at = 6 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; } // GroupMember represents the relationship between a group and a member. message GroupMember { - // group_id is the unique ID of the group. uint64 group_id = 1; @@ -167,7 +170,9 @@ message GroupPolicyInfo { // admin is the account address of the group admin. string admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // metadata is any arbitrary metadata to attached to the group policy. + // metadata is any arbitrary metadata attached to the group policy. + // the recommended format of the metadata is to be found here: + // https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 string metadata = 4; // version is used to track changes to a group's GroupPolicyInfo structure that @@ -178,7 +183,8 @@ message GroupPolicyInfo { google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; // created_at is a timestamp specifying when a group policy was created. - google.protobuf.Timestamp created_at = 7 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp created_at = 7 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; } // Proposal defines a group proposal. Any member of a group can submit a proposal @@ -194,14 +200,17 @@ message Proposal { // group_policy_address is the account address of group policy. string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // metadata is any arbitrary metadata to attached to the proposal. + // metadata is any arbitrary metadata attached to the proposal. + // the recommended format of the metadata is to be found here: + // https://docs.cosmos.network/v0.47/modules/group#proposal-4 string metadata = 3; // proposers are the account addresses of the proposers. repeated string proposers = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // submit_time is a timestamp specifying when a proposal was submitted. - google.protobuf.Timestamp submit_time = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp submit_time = 5 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; // group_version tracks the version of the group at proposal submission. // This field is here for informational purposes only. @@ -220,20 +229,31 @@ message Proposal { // proposal for each vote option. It is empty at submission, and only // populated after tallying, at voting period end or at proposal execution, // whichever happens first. - TallyResult final_tally_result = 9 [(gogoproto.nullable) = false]; + TallyResult final_tally_result = 9 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // voting_period_end is the timestamp before which voting must be done. - // Unless a successfull MsgExec is called before (to execute a proposal whose + // Unless a successful MsgExec is called before (to execute a proposal whose // tally is successful before the voting period ends), tallying will be done // at this point, and the `final_tally_result`and `status` fields will be // accordingly updated. - google.protobuf.Timestamp voting_period_end = 10 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp voting_period_end = 10 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; // executor_result is the final result of the proposal execution. Initial value is NotRun. ProposalExecutorResult executor_result = 11; // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. repeated google.protobuf.Any messages = 12; + + // title is the title of the proposal + // + // Since: cosmos-sdk 0.47 + string title = 13; + + // summary is a short summary of the proposal + // + // Since: cosmos-sdk 0.47 + string summary = 14; } // ProposalStatus defines proposal statuses. @@ -299,7 +319,6 @@ message TallyResult { // Vote represents a vote for a proposal. message Vote { - // proposal is the unique ID of the proposal. uint64 proposal_id = 1; @@ -309,9 +328,10 @@ message Vote { // option is the voter's choice on the proposal. VoteOption option = 3; - // metadata is any arbitrary metadata to attached to the vote. + // metadata is any arbitrary metadata attached to the vote. string metadata = 4; // submit_time is the timestamp when the vote was submitted. - google.protobuf.Timestamp submit_time = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp submit_time = 5 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; } diff --git a/third_party/proto/cosmos/ics23/v1/proofs.proto b/third_party/proto/cosmos/ics23/v1/proofs.proto new file mode 100644 index 00000000..beac166b --- /dev/null +++ b/third_party/proto/cosmos/ics23/v1/proofs.proto @@ -0,0 +1,238 @@ +syntax = "proto3"; + +package cosmos.ics23.v1; + +option go_package = "github.com/cosmos/ics23/go;ics23"; + +enum HashOp { + // NO_HASH is the default if no data passed. Note this is an illegal argument some places. + NO_HASH = 0; + SHA256 = 1; + SHA512 = 2; + KECCAK = 3; + RIPEMD160 = 4; + BITCOIN = 5; // ripemd160(sha256(x)) + SHA512_256 = 6; +} + +/** +LengthOp defines how to process the key and value of the LeafOp +to include length information. After encoding the length with the given +algorithm, the length will be prepended to the key and value bytes. +(Each one with it's own encoded length) +*/ +enum LengthOp { + // NO_PREFIX don't include any length info + NO_PREFIX = 0; + // VAR_PROTO uses protobuf (and go-amino) varint encoding of the length + VAR_PROTO = 1; + // VAR_RLP uses rlp int encoding of the length + VAR_RLP = 2; + // FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer + FIXED32_BIG = 3; + // FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer + FIXED32_LITTLE = 4; + // FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer + FIXED64_BIG = 5; + // FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer + FIXED64_LITTLE = 6; + // REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) + REQUIRE_32_BYTES = 7; + // REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) + REQUIRE_64_BYTES = 8; +} + +/** +ExistenceProof takes a key and a value and a set of steps to perform on it. +The result of peforming all these steps will provide a "root hash", which can +be compared to the value in a header. + +Since it is computationally infeasible to produce a hash collission for any of the used +cryptographic hash functions, if someone can provide a series of operations to transform +a given key and value into a root hash that matches some trusted root, these key and values +must be in the referenced merkle tree. + +The only possible issue is maliablity in LeafOp, such as providing extra prefix data, +which should be controlled by a spec. Eg. with lengthOp as NONE, + prefix = FOO, key = BAR, value = CHOICE +and + prefix = F, key = OOBAR, value = CHOICE +would produce the same value. + +With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field +in the ProofSpec is valuable to prevent this mutability. And why all trees should +length-prefix the data before hashing it. +*/ +message ExistenceProof { + bytes key = 1; + bytes value = 2; + LeafOp leaf = 3; + repeated InnerOp path = 4; +} + +/* +NonExistenceProof takes a proof of two neighbors, one left of the desired key, +one right of the desired key. If both proofs are valid AND they are neighbors, +then there is no valid proof for the given key. +*/ +message NonExistenceProof { + bytes key = 1; // TODO: remove this as unnecessary??? we prove a range + ExistenceProof left = 2; + ExistenceProof right = 3; +} + +/* +CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages +*/ +message CommitmentProof { + oneof proof { + ExistenceProof exist = 1; + NonExistenceProof nonexist = 2; + BatchProof batch = 3; + CompressedBatchProof compressed = 4; + } +} + +/** +LeafOp represents the raw key-value data we wish to prove, and +must be flexible to represent the internal transformation from +the original key-value pairs into the basis hash, for many existing +merkle trees. + +key and value are passed in. So that the signature of this operation is: + leafOp(key, value) -> output + +To process this, first prehash the keys and values if needed (ANY means no hash in this case): + hkey = prehashKey(key) + hvalue = prehashValue(value) + +Then combine the bytes, and hash it + output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) +*/ +message LeafOp { + HashOp hash = 1; + HashOp prehash_key = 2; + HashOp prehash_value = 3; + LengthOp length = 4; + // prefix is a fixed bytes that may optionally be included at the beginning to differentiate + // a leaf node from an inner node. + bytes prefix = 5; +} + +/** +InnerOp represents a merkle-proof step that is not a leaf. +It represents concatenating two children and hashing them to provide the next result. + +The result of the previous step is passed in, so the signature of this op is: + innerOp(child) -> output + +The result of applying InnerOp should be: + output = op.hash(op.prefix || child || op.suffix) + + where the || operator is concatenation of binary data, +and child is the result of hashing all the tree below this step. + +Any special data, like prepending child with the length, or prepending the entire operation with +some value to differentiate from leaf nodes, should be included in prefix and suffix. +If either of prefix or suffix is empty, we just treat it as an empty string +*/ +message InnerOp { + HashOp hash = 1; + bytes prefix = 2; + bytes suffix = 3; +} + +/** +ProofSpec defines what the expected parameters are for a given proof type. +This can be stored in the client and used to validate any incoming proofs. + + verify(ProofSpec, Proof) -> Proof | Error + +As demonstrated in tests, if we don't fix the algorithm used to calculate the +LeafHash for a given tree, there are many possible key-value pairs that can +generate a given hash (by interpretting the preimage differently). +We need this for proper security, requires client knows a priori what +tree format server uses. But not in code, rather a configuration object. +*/ +message ProofSpec { + // any field in the ExistenceProof must be the same as in this spec. + // except Prefix, which is just the first bytes of prefix (spec can be longer) + LeafOp leaf_spec = 1; + InnerSpec inner_spec = 2; + // max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) + int32 max_depth = 3; + // min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) + int32 min_depth = 4; + // prehash_key_before_comparison is a flag that indicates whether to use the + // prehash_key specified by LeafOp to compare lexical ordering of keys for + // non-existence proofs. + bool prehash_key_before_comparison = 5; +} + +/* +InnerSpec contains all store-specific structure info to determine if two proofs from a +given store are neighbors. + +This enables: + + isLeftMost(spec: InnerSpec, op: InnerOp) + isRightMost(spec: InnerSpec, op: InnerOp) + isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) +*/ +message InnerSpec { + // Child order is the ordering of the children node, must count from 0 + // iavl tree is [0, 1] (left then right) + // merk is [0, 2, 1] (left, right, here) + repeated int32 child_order = 1; + int32 child_size = 2; + int32 min_prefix_length = 3; + int32 max_prefix_length = 4; + // empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) + bytes empty_child = 5; + // hash is the algorithm that must be used for each InnerOp + HashOp hash = 6; +} + +/* +BatchProof is a group of multiple proof types than can be compressed +*/ +message BatchProof { + repeated BatchEntry entries = 1; +} + +// Use BatchEntry not CommitmentProof, to avoid recursion +message BatchEntry { + oneof proof { + ExistenceProof exist = 1; + NonExistenceProof nonexist = 2; + } +} + +/****** all items here are compressed forms *******/ + +message CompressedBatchProof { + repeated CompressedBatchEntry entries = 1; + repeated InnerOp lookup_inners = 2; +} + +// Use BatchEntry not CommitmentProof, to avoid recursion +message CompressedBatchEntry { + oneof proof { + CompressedExistenceProof exist = 1; + CompressedNonExistenceProof nonexist = 2; + } +} + +message CompressedExistenceProof { + bytes key = 1; + bytes value = 2; + LeafOp leaf = 3; + // these are indexes into the lookup_inners table in CompressedBatchProof + repeated int32 path = 4; +} + +message CompressedNonExistenceProof { + bytes key = 1; // TODO: remove this as unnecessary??? we prove a range + CompressedExistenceProof left = 2; + CompressedExistenceProof right = 3; +} diff --git a/third_party/proto/cosmos/mint/module/v1/module.proto b/third_party/proto/cosmos/mint/module/v1/module.proto new file mode 100644 index 00000000..2ea1ef3d --- /dev/null +++ b/third_party/proto/cosmos/mint/module/v1/module.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package cosmos.mint.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the mint module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/mint" + }; + + string fee_collector_name = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/mint/v1beta1/genesis.proto b/third_party/proto/cosmos/mint/v1beta1/genesis.proto index 4e783fb5..b6cc1504 100644 --- a/third_party/proto/cosmos/mint/v1beta1/genesis.proto +++ b/third_party/proto/cosmos/mint/v1beta1/genesis.proto @@ -3,14 +3,15 @@ package cosmos.mint.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/mint/v1beta1/mint.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; // GenesisState defines the mint module's genesis state. message GenesisState { // minter is a space for holding current inflation information. - Minter minter = 1 [(gogoproto.nullable) = false]; + Minter minter = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // params defines all the paramaters of the module. - Params params = 2 [(gogoproto.nullable) = false]; + // params defines all the parameters of the module. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/third_party/proto/cosmos/mint/v1beta1/mint.proto b/third_party/proto/cosmos/mint/v1beta1/mint.proto index 9cfe2b76..49b00a5d 100644 --- a/third_party/proto/cosmos/mint/v1beta1/mint.proto +++ b/third_party/proto/cosmos/mint/v1beta1/mint.proto @@ -5,6 +5,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; // Minter represents the minting state. message Minter { @@ -22,9 +23,10 @@ message Minter { ]; } -// Params holds parameters for the mint module. +// Params defines the parameters for the x/mint module. message Params { option (gogoproto.goproto_stringer) = false; + option (amino.name) = "cosmos-sdk/x/mint/Params"; // type of coin to mint string mint_denom = 1; diff --git a/third_party/proto/cosmos/mint/v1beta1/query.proto b/third_party/proto/cosmos/mint/v1beta1/query.proto index acd341d7..002f2744 100644 --- a/third_party/proto/cosmos/mint/v1beta1/query.proto +++ b/third_party/proto/cosmos/mint/v1beta1/query.proto @@ -4,6 +4,7 @@ package cosmos.mint.v1beta1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/mint/v1beta1/mint.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; @@ -31,7 +32,7 @@ message QueryParamsRequest {} // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { // params defines the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryInflationRequest is the request type for the Query/Inflation RPC method. @@ -41,7 +42,11 @@ message QueryInflationRequest {} // method. message QueryInflationResponse { // inflation is the current minting inflation value. - bytes inflation = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes inflation = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // QueryAnnualProvisionsRequest is the request type for the @@ -52,6 +57,9 @@ message QueryAnnualProvisionsRequest {} // Query/AnnualProvisions RPC method. message QueryAnnualProvisionsResponse { // annual_provisions is the current minting annual provisions value. - bytes annual_provisions = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes annual_provisions = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } diff --git a/third_party/proto/cosmos/mint/v1beta1/tx.proto b/third_party/proto/cosmos/mint/v1beta1/tx.proto new file mode 100644 index 00000000..ec71fb73 --- /dev/null +++ b/third_party/proto/cosmos/mint/v1beta1/tx.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/mint/v1beta1/mint.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +// Msg defines the x/mint Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a governance operation for updating the x/mint module + // parameters. The authority is defaults to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/mint/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/mint parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/third_party/proto/cosmos/msg/v1/msg.proto b/third_party/proto/cosmos/msg/v1/msg.proto index 89bdf312..853efa1f 100644 --- a/third_party/proto/cosmos/msg/v1/msg.proto +++ b/third_party/proto/cosmos/msg/v1/msg.proto @@ -8,6 +8,14 @@ import "google/protobuf/descriptor.proto"; // We need this right now because gogoproto codegen needs to import the extension. option go_package = "github.com/cosmos/cosmos-sdk/types/msgservice"; +extend google.protobuf.ServiceOptions { + // service indicates that the service is a Msg service and that requests + // must be transported via blockchain transactions rather than gRPC. + // Tooling can use this annotation to distinguish between Msg services and + // other types of services via reflection. + bool service = 11110000; +} + extend google.protobuf.MessageOptions { // signer must be used in cosmos messages in order // to signal to external clients which fields in a @@ -19,4 +27,4 @@ extend google.protobuf.MessageOptions { // kind in case the signer information is contained within // a message inside the cosmos message. repeated string signer = 11110000; -} \ No newline at end of file +} diff --git a/third_party/proto/cosmos/nft/module/v1/module.proto b/third_party/proto/cosmos/nft/module/v1/module.proto new file mode 100644 index 00000000..8f820fa0 --- /dev/null +++ b/third_party/proto/cosmos/nft/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.nft.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the nft module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/nft" + }; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/nft/v1beta1/event.proto b/third_party/proto/cosmos/nft/v1beta1/event.proto index 96964f08..2f6d5a0d 100644 --- a/third_party/proto/cosmos/nft/v1beta1/event.proto +++ b/third_party/proto/cosmos/nft/v1beta1/event.proto @@ -5,22 +5,39 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; // EventSend is emitted on Msg/Send message EventSend { + // class_id associated with the nft string class_id = 1; - string id = 2; - string sender = 3; + + // id is a unique identifier of the nft + string id = 2; + + // sender is the address of the owner of nft + string sender = 3; + + // receiver is the receiver address of nft string receiver = 4; } // EventMint is emitted on Mint message EventMint { + // class_id associated with the nft string class_id = 1; - string id = 2; - string owner = 3; + + // id is a unique identifier of the nft + string id = 2; + + // owner is the owner address of the nft + string owner = 3; } // EventBurn is emitted on Burn message EventBurn { + // class_id associated with the nft string class_id = 1; - string id = 2; - string owner = 3; + + // id is a unique identifier of the nft + string id = 2; + + // owner is the owner address of the nft + string owner = 3; } diff --git a/third_party/proto/cosmos/nft/v1beta1/genesis.proto b/third_party/proto/cosmos/nft/v1beta1/genesis.proto index 6f36ed34..75b5245a 100644 --- a/third_party/proto/cosmos/nft/v1beta1/genesis.proto +++ b/third_party/proto/cosmos/nft/v1beta1/genesis.proto @@ -9,7 +9,9 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; message GenesisState { // class defines the class of the nft type. repeated cosmos.nft.v1beta1.Class classes = 1; - repeated Entry entries = 2; + + // entry defines all nft owned by a person. + repeated Entry entries = 2; } // Entry Defines all nft owned by a person diff --git a/third_party/proto/cosmos/nft/v1beta1/query.proto b/third_party/proto/cosmos/nft/v1beta1/query.proto index c1d8070f..ae482e4c 100644 --- a/third_party/proto/cosmos/nft/v1beta1/query.proto +++ b/third_party/proto/cosmos/nft/v1beta1/query.proto @@ -48,67 +48,91 @@ service Query { // QueryBalanceRequest is the request type for the Query/Balance RPC method message QueryBalanceRequest { + // class_id associated with the nft string class_id = 1; - string owner = 2; + + // owner is the owner address of the nft + string owner = 2; } // QueryBalanceResponse is the response type for the Query/Balance RPC method message QueryBalanceResponse { + // amount is the number of all NFTs of a given class owned by the owner uint64 amount = 1; } // QueryOwnerRequest is the request type for the Query/Owner RPC method message QueryOwnerRequest { + // class_id associated with the nft string class_id = 1; - string id = 2; + + // id is a unique identifier of the NFT + string id = 2; } // QueryOwnerResponse is the response type for the Query/Owner RPC method message QueryOwnerResponse { + // owner is the owner address of the nft string owner = 1; } // QuerySupplyRequest is the request type for the Query/Supply RPC method message QuerySupplyRequest { + // class_id associated with the nft string class_id = 1; } // QuerySupplyResponse is the response type for the Query/Supply RPC method message QuerySupplyResponse { + // amount is the number of all NFTs from the given class uint64 amount = 1; } // QueryNFTstRequest is the request type for the Query/NFTs RPC method message QueryNFTsRequest { - string class_id = 1; - string owner = 2; + // class_id associated with the nft + string class_id = 1; + + // owner is the owner address of the nft + string owner = 2; + + // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 3; } // QueryNFTsResponse is the response type for the Query/NFTs RPC methods message QueryNFTsResponse { - repeated cosmos.nft.v1beta1.NFT nfts = 1; + // NFT defines the NFT + repeated cosmos.nft.v1beta1.NFT nfts = 1; + + // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } // QueryNFTRequest is the request type for the Query/NFT RPC method message QueryNFTRequest { + // class_id associated with the nft string class_id = 1; - string id = 2; + + // id is a unique identifier of the NFT + string id = 2; } // QueryNFTResponse is the response type for the Query/NFT RPC method message QueryNFTResponse { + // owner is the owner address of the nft cosmos.nft.v1beta1.NFT nft = 1; } // QueryClassRequest is the request type for the Query/Class RPC method message QueryClassRequest { + // class_id associated with the nft string class_id = 1; } // QueryClassResponse is the response type for the Query/Class RPC method message QueryClassResponse { + // class defines the class of the nft type. cosmos.nft.v1beta1.Class class = 1; } @@ -120,6 +144,9 @@ message QueryClassesRequest { // QueryClassesResponse is the response type for the Query/Classes RPC method message QueryClassesResponse { - repeated cosmos.nft.v1beta1.Class classes = 1; + // class defines the class of the nft type. + repeated cosmos.nft.v1beta1.Class classes = 1; + + // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } diff --git a/third_party/proto/cosmos/nft/v1beta1/tx.proto b/third_party/proto/cosmos/nft/v1beta1/tx.proto index 95b402ce..0637cd8d 100644 --- a/third_party/proto/cosmos/nft/v1beta1/tx.proto +++ b/third_party/proto/cosmos/nft/v1beta1/tx.proto @@ -3,13 +3,17 @@ package cosmos.nft.v1beta1; option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; +import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; // Msg defines the nft Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // Send defines a method to send a nft from one account to another account. rpc Send(MsgSend) returns (MsgSendResponse); } + // MsgSend represents a message to send a nft from one account to another account. message MsgSend { option (cosmos.msg.v1.signer) = "sender"; @@ -21,10 +25,10 @@ message MsgSend { string id = 2; // sender is the address of the owner of nft - string sender = 3; + string sender = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // receiver is the receiver address of nft - string receiver = 4; + string receiver = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // MsgSendResponse defines the Msg/Send response type. message MsgSendResponse {} \ No newline at end of file diff --git a/third_party/proto/cosmos/orm/query/v1alpha1/query.proto b/third_party/proto/cosmos/orm/query/v1alpha1/query.proto new file mode 100644 index 00000000..4500e99d --- /dev/null +++ b/third_party/proto/cosmos/orm/query/v1alpha1/query.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; + +package cosmos.orm.query.v1alpha1; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/any.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; + +// Query is a generic gRPC service for querying ORM data. +service Query { + + // Get queries an ORM table against an unique index. + rpc Get(GetRequest) returns (GetResponse); + + // List queries an ORM table against an index. + rpc List(ListRequest) returns (ListResponse); +} + +// GetRequest is the Query/Get request type. +message GetRequest { + // message_name is the fully-qualified message name of the ORM table being queried. + string message_name = 1; + + // index is the index fields expression used in orm definitions. If it + // is empty, the table's primary key is assumed. If it is non-empty, it must + // refer to an unique index. + string index = 2; + + // values are the values of the fields corresponding to the requested index. + // There must be as many values provided as there are fields in the index and + // these values must correspond to the index field types. + repeated IndexValue values = 3; +} + +// GetResponse is the Query/Get response type. +message GetResponse { + + // result is the result of the get query. If no value is found, the gRPC + // status code NOT_FOUND will be returned. + google.protobuf.Any result = 1; +} + +// ListRequest is the Query/List request type. +message ListRequest { + // message_name is the fully-qualified message name of the ORM table being queried. + string message_name = 1; + + // index is the index fields expression used in orm definitions. If it + // is empty, the table's primary key is assumed. + string index = 2; + + // query is the query expression corresponding to the provided index. If + // neither prefix nor range is specified, the query will list all the fields + // in the index. + oneof query { + + // prefix defines a prefix query. + Prefix prefix = 3; + + // range defines a range query. + Range range = 4; + } + + // pagination is the pagination request. + cosmos.base.query.v1beta1.PageRequest pagination = 5; + + // Prefix specifies the arguments to a prefix query. + message Prefix { + // values specifies the index values for the prefix query. + // It is valid to special a partial prefix with fewer values than + // the number of fields in the index. + repeated IndexValue values = 1; + } + + // Range specifies the arguments to a range query. + message Range { + // start specifies the starting index values for the range query. + // It is valid to provide fewer values than the number of fields in the + // index. + repeated IndexValue start = 1; + + // end specifies the inclusive ending index values for the range query. + // It is valid to provide fewer values than the number of fields in the + // index. + repeated IndexValue end = 2; + } +} + +// ListResponse is the Query/List response type. +message ListResponse { + + // results are the results of the query. + repeated google.protobuf.Any results = 1; + + // pagination is the pagination response. + cosmos.base.query.v1beta1.PageResponse pagination = 5; +} + +// IndexValue represents the value of a field in an ORM index expression. +message IndexValue { + + // value specifies the index value + oneof value { + // uint specifies a value for an uint32, fixed32, uint64, or fixed64 + // index field. + uint64 uint = 1; + + // int64 specifies a value for an int32, sfixed32, int64, or sfixed64 + // index field. + int64 int = 2; + + // str specifies a value for a string index field. + string str = 3; + + // bytes specifies a value for a bytes index field. + bytes bytes = 4; + + // enum specifies a value for an enum index field. + string enum = 5; + + // bool specifies a value for a bool index field. + bool bool = 6; + + // timestamp specifies a value for a timestamp index field. + google.protobuf.Timestamp timestamp = 7; + + // duration specifies a value for a duration index field. + google.protobuf.Duration duration = 8; + } +} diff --git a/third_party/proto/cosmos/params/module/v1/module.proto b/third_party/proto/cosmos/params/module/v1/module.proto new file mode 100644 index 00000000..75e7f995 --- /dev/null +++ b/third_party/proto/cosmos/params/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.params.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the params module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/params" + }; +} diff --git a/third_party/proto/cosmos/params/v1beta1/params.proto b/third_party/proto/cosmos/params/v1beta1/params.proto index da23e1a9..7bda4651 100644 --- a/third_party/proto/cosmos/params/v1beta1/params.proto +++ b/third_party/proto/cosmos/params/v1beta1/params.proto @@ -6,16 +6,18 @@ option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; // ParameterChangeProposal defines a proposal to change one or more parameters. message ParameterChangeProposal { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/ParameterChangeProposal"; string title = 1; string description = 2; - repeated ParamChange changes = 3 [(gogoproto.nullable) = false]; + repeated ParamChange changes = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // ParamChange defines an individual parameter change, for use in diff --git a/third_party/proto/cosmos/params/v1beta1/query.proto b/third_party/proto/cosmos/params/v1beta1/query.proto index 97d0a71d..827422ea 100644 --- a/third_party/proto/cosmos/params/v1beta1/query.proto +++ b/third_party/proto/cosmos/params/v1beta1/query.proto @@ -4,6 +4,7 @@ package cosmos.params.v1beta1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/params/v1beta1/params.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; @@ -35,7 +36,7 @@ message QueryParamsRequest { // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { // param defines the queried parameter. - ParamChange param = 1 [(gogoproto.nullable) = false]; + ParamChange param = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QuerySubspacesRequest defines a request type for querying for all registered diff --git a/third_party/proto/cosmos/query/v1/query.proto b/third_party/proto/cosmos/query/v1/query.proto new file mode 100644 index 00000000..e42e73d7 --- /dev/null +++ b/third_party/proto/cosmos/query/v1/query.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package cosmos.query.v1; + +import "google/protobuf/descriptor.proto"; + +// TODO: once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/query"; + +extend google.protobuf.MethodOptions { + // module_query_safe is set to true when the query is safe to be called from + // within the state machine, for example from another module's Keeper, via + // ADR-033 calls or from CosmWasm contracts. + // Concretely, it means that the query is: + // 1. deterministic: given a block height, returns the exact same response + // upon multiple calls; and doesn't introduce any state-machine-breaking + // changes across SDK patch version. + // 2. consumes gas correctly. + // + // If you are a module developer and want to add this annotation to one of + // your own queries, please make sure that the corresponding query: + // 1. is deterministic and won't introduce state-machine-breaking changes + // without a coordinated upgrade path, + // 2. has its gas tracked, to avoid the attack vector where no gas is + // accounted for on potentially high-computation queries. + // + // For queries that potentially consume a large amount of gas (for example + // those with pagination, if the pagination field is incorrectly set), we + // also recommend adding Protobuf comments to warn module developers + // consuming these queries. + // + // When set to true, the query can safely be called + bool module_query_safe = 11110001; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/reflection/v1/reflection.proto b/third_party/proto/cosmos/reflection/v1/reflection.proto new file mode 100644 index 00000000..1f575b83 --- /dev/null +++ b/third_party/proto/cosmos/reflection/v1/reflection.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package cosmos.reflection.v1; + +import "google/protobuf/descriptor.proto"; +import "cosmos/query/v1/query.proto"; + +// Package cosmos.reflection.v1 provides support for inspecting protobuf +// file descriptors. +service ReflectionService { + // FileDescriptors queries all the file descriptors in the app in order + // to enable easier generation of dynamic clients. + rpc FileDescriptors(FileDescriptorsRequest) returns (FileDescriptorsResponse) { + // NOTE: file descriptors SHOULD NOT be part of consensus because they + // include changes to doc commands and module_query_safe should be kept as false. + option (cosmos.query.v1.module_query_safe) = false; + } +} + +// FileDescriptorsRequest is the Query/FileDescriptors request type. +message FileDescriptorsRequest {} + +// FileDescriptorsResponse is the Query/FileDescriptors response type. +message FileDescriptorsResponse { + // files is the file descriptors. + repeated google.protobuf.FileDescriptorProto files = 1; +} diff --git a/third_party/proto/cosmos/slashing/module/v1/module.proto b/third_party/proto/cosmos/slashing/module/v1/module.proto new file mode 100644 index 00000000..52433075 --- /dev/null +++ b/third_party/proto/cosmos/slashing/module/v1/module.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package cosmos.slashing.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the slashing module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/slashing" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} diff --git a/third_party/proto/cosmos/slashing/v1beta1/genesis.proto b/third_party/proto/cosmos/slashing/v1beta1/genesis.proto index 312d56aa..36bcf76f 100644 --- a/third_party/proto/cosmos/slashing/v1beta1/genesis.proto +++ b/third_party/proto/cosmos/slashing/v1beta1/genesis.proto @@ -6,19 +6,20 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; import "gogoproto/gogo.proto"; import "cosmos/slashing/v1beta1/slashing.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; // GenesisState defines the slashing module's genesis state. message GenesisState { - // params defines all the paramaters of related to deposit. - Params params = 1 [(gogoproto.nullable) = false]; + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // signing_infos represents a map between validator addresses and their // signing infos. - repeated SigningInfo signing_infos = 2 [(gogoproto.nullable) = false]; + repeated SigningInfo signing_infos = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // missed_blocks represents a map between validator addresses and their // missed blocks. - repeated ValidatorMissedBlocks missed_blocks = 3 [(gogoproto.nullable) = false]; + repeated ValidatorMissedBlocks missed_blocks = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // SigningInfo stores validator signing info of corresponding address. @@ -26,7 +27,7 @@ message SigningInfo { // address is the validator address. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // validator_signing_info represents the signing info of this validator. - ValidatorSigningInfo validator_signing_info = 2 [(gogoproto.nullable) = false]; + ValidatorSigningInfo validator_signing_info = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // ValidatorMissedBlocks contains array of missed blocks of corresponding @@ -35,7 +36,7 @@ message ValidatorMissedBlocks { // address is the validator address. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // missed_blocks is an array of missed blocks by the validator. - repeated MissedBlock missed_blocks = 2 [(gogoproto.nullable) = false]; + repeated MissedBlock missed_blocks = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MissedBlock contains height and missed status as boolean. diff --git a/third_party/proto/cosmos/slashing/v1beta1/query.proto b/third_party/proto/cosmos/slashing/v1beta1/query.proto index f742c1f8..761e1a4b 100644 --- a/third_party/proto/cosmos/slashing/v1beta1/query.proto +++ b/third_party/proto/cosmos/slashing/v1beta1/query.proto @@ -6,6 +6,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/slashing/v1beta1/slashing.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; @@ -32,7 +33,7 @@ message QueryParamsRequest {} // QueryParamsResponse is the response type for the Query/Params RPC method message QueryParamsResponse { - Params params = 1 [(gogoproto.nullable) = false]; + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC @@ -46,7 +47,7 @@ message QuerySigningInfoRequest { // method message QuerySigningInfoResponse { // val_signing_info is the signing info of requested val cons address - ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false]; + ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC @@ -59,6 +60,7 @@ message QuerySigningInfosRequest { // method message QuerySigningInfosResponse { // info is the signing info of all validators - repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } diff --git a/third_party/proto/cosmos/slashing/v1beta1/slashing.proto b/third_party/proto/cosmos/slashing/v1beta1/slashing.proto index 0aa9f61f..dc1f4211 100644 --- a/third_party/proto/cosmos/slashing/v1beta1/slashing.proto +++ b/third_party/proto/cosmos/slashing/v1beta1/slashing.proto @@ -8,6 +8,7 @@ import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; // ValidatorSigningInfo defines a validator's signing info for monitoring their // liveness activity. @@ -23,7 +24,8 @@ message ValidatorSigningInfo { // `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. int64 index_offset = 3; // Timestamp until which the validator is jailed due to liveness downtime. - google.protobuf.Timestamp jailed_until = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp jailed_until = 4 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // Whether or not a validator has been tombstoned (killed out of validator set). It is set // once the validator commits an equivocation or for any other configured misbehiavor. bool tombstoned = 5; @@ -34,12 +36,24 @@ message ValidatorSigningInfo { // Params represents the parameters used for by the slashing module. message Params { + option (amino.name) = "cosmos-sdk/x/slashing/Params"; + int64 signed_blocks_window = 1; - bytes min_signed_per_window = 2 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - google.protobuf.Duration downtime_jail_duration = 3 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; - bytes slash_fraction_double_sign = 4 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - bytes slash_fraction_downtime = 5 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes min_signed_per_window = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + google.protobuf.Duration downtime_jail_duration = 3 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdduration) = true]; + bytes slash_fraction_double_sign = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + bytes slash_fraction_downtime = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } diff --git a/third_party/proto/cosmos/slashing/v1beta1/tx.proto b/third_party/proto/cosmos/slashing/v1beta1/tx.proto index 7c90304b..300fc775 100644 --- a/third_party/proto/cosmos/slashing/v1beta1/tx.proto +++ b/third_party/proto/cosmos/slashing/v1beta1/tx.proto @@ -5,26 +5,64 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; +import "cosmos/slashing/v1beta1/slashing.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; // Msg defines the slashing Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // Unjail defines a method for unjailing a jailed validator, thus returning // them into the bonded validator set, so they can begin receiving provisions // and rewards again. rpc Unjail(MsgUnjail) returns (MsgUnjailResponse); + + // UpdateParams defines a governance operation for updating the x/slashing module + // parameters. The authority defaults to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgUnjail defines the Msg/Unjail request type message MsgUnjail { option (cosmos.msg.v1.signer) = "validator_addr"; + option (amino.name) = "cosmos-sdk/MsgUnjail"; option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = true; - string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "address"]; + string validator_addr = 1 [ + (cosmos_proto.scalar) = "cosmos.AddressString", + (gogoproto.jsontag) = "address", + (amino.field_name) = "address", + (amino.dont_omitempty) = true + ]; } // MsgUnjailResponse defines the Msg/Unjail response type message MsgUnjailResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/slashing/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/slashing parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/third_party/proto/cosmos/staking/module/v1/module.proto b/third_party/proto/cosmos/staking/module/v1/module.proto new file mode 100644 index 00000000..7ef4a06c --- /dev/null +++ b/third_party/proto/cosmos/staking/module/v1/module.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package cosmos.staking.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the staking module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/staking" + }; + + // hooks_order specifies the order of staking hooks and should be a list + // of module names which provide a staking hooks instance. If no order is + // provided, then hooks will be applied in alphabetical order of module names. + repeated string hooks_order = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} diff --git a/third_party/proto/cosmos/staking/v1beta1/authz.proto b/third_party/proto/cosmos/staking/v1beta1/authz.proto index 677edaad..055d1b64 100644 --- a/third_party/proto/cosmos/staking/v1beta1/authz.proto +++ b/third_party/proto/cosmos/staking/v1beta1/authz.proto @@ -4,6 +4,7 @@ package cosmos.staking.v1beta1; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; @@ -11,7 +12,8 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; // // Since: cosmos-sdk 0.43 message StakeAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; + option (amino.name) = "cosmos-sdk/StakeAuthorization"; // max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is // empty, there is no spend limit and any amount of coins can be delegated. diff --git a/third_party/proto/cosmos/staking/v1beta1/genesis.proto b/third_party/proto/cosmos/staking/v1beta1/genesis.proto index bf3c298e..482d50cc 100644 --- a/third_party/proto/cosmos/staking/v1beta1/genesis.proto +++ b/third_party/proto/cosmos/staking/v1beta1/genesis.proto @@ -6,32 +6,36 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; import "gogoproto/gogo.proto"; import "cosmos/staking/v1beta1/staking.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; // GenesisState defines the staking module's genesis state. message GenesisState { - // params defines all the paramaters of related to deposit. - Params params = 1 [(gogoproto.nullable) = false]; + // params defines all the parameters of related to deposit. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // last_total_power tracks the total amounts of bonded tokens recorded during // the previous end block. - bytes last_total_power = 2 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + bytes last_total_power = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; // last_validator_powers is a special index that provides a historical list // of the last-block's bonded validators. - repeated LastValidatorPower last_validator_powers = 3 [(gogoproto.nullable) = false]; + repeated LastValidatorPower last_validator_powers = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // delegations defines the validator set at genesis. - repeated Validator validators = 4 [(gogoproto.nullable) = false]; + repeated Validator validators = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // delegations defines the delegations active at genesis. - repeated Delegation delegations = 5 [(gogoproto.nullable) = false]; + repeated Delegation delegations = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // unbonding_delegations defines the unbonding delegations active at genesis. - repeated UnbondingDelegation unbonding_delegations = 6 [(gogoproto.nullable) = false]; + repeated UnbondingDelegation unbonding_delegations = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // redelegations defines the redelegations active at genesis. - repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false]; + repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; bool exported = 8; } diff --git a/third_party/proto/cosmos/staking/v1beta1/query.proto b/third_party/proto/cosmos/staking/v1beta1/query.proto index 2cbb750b..06eb5551 100644 --- a/third_party/proto/cosmos/staking/v1beta1/query.proto +++ b/third_party/proto/cosmos/staking/v1beta1/query.proto @@ -6,90 +6,127 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/staking/v1beta1/staking.proto"; import "cosmos_proto/cosmos.proto"; +import "cosmos/query/v1/query.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; // Query defines the gRPC querier service. service Query { // Validators queries all validators that match the given status. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc Validators(QueryValidatorsRequest) returns (QueryValidatorsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators"; } // Validator queries validator info for given validator address. rpc Validator(QueryValidatorRequest) returns (QueryValidatorResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}"; } // ValidatorDelegations queries delegate info for given validator. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc ValidatorDelegations(QueryValidatorDelegationsRequest) returns (QueryValidatorDelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations"; } // ValidatorUnbondingDelegations queries unbonding delegations of a validator. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc ValidatorUnbondingDelegations(QueryValidatorUnbondingDelegationsRequest) returns (QueryValidatorUnbondingDelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/" - "{validator_addr}/unbonding_delegations"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/" + "{validator_addr}/unbonding_delegations"; } // Delegation queries delegate info for given validator delegator pair. rpc Delegation(QueryDelegationRequest) returns (QueryDelegationResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" - "{delegator_addr}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" + "{delegator_addr}"; } // UnbondingDelegation queries unbonding info for given validator delegator // pair. rpc UnbondingDelegation(QueryUnbondingDelegationRequest) returns (QueryUnbondingDelegationResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" - "{delegator_addr}/unbonding_delegation"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" + "{delegator_addr}/unbonding_delegation"; } // DelegatorDelegations queries all delegations of a given delegator address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc DelegatorDelegations(QueryDelegatorDelegationsRequest) returns (QueryDelegatorDelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegations/{delegator_addr}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegations/{delegator_addr}"; } // DelegatorUnbondingDelegations queries all unbonding delegations of a given // delegator address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc DelegatorUnbondingDelegations(QueryDelegatorUnbondingDelegationsRequest) returns (QueryDelegatorUnbondingDelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/" - "{delegator_addr}/unbonding_delegations"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/" + "{delegator_addr}/unbonding_delegations"; } // Redelegations queries redelegations of given address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc Redelegations(QueryRedelegationsRequest) returns (QueryRedelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations"; } // DelegatorValidators queries all validators info for given delegator // address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators"; } // DelegatorValidator queries validator info for given delegator validator // pair. rpc DelegatorValidator(QueryDelegatorValidatorRequest) returns (QueryDelegatorValidatorResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/" - "{validator_addr}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/" + "{validator_addr}"; } // HistoricalInfo queries the historical info for given height. rpc HistoricalInfo(QueryHistoricalInfoRequest) returns (QueryHistoricalInfoResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/historical_info/{height}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/historical_info/{height}"; } // Pool queries the pool info. rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/pool"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/pool"; } // Parameters queries the staking parameters. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/params"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/params"; } } @@ -105,7 +142,7 @@ message QueryValidatorsRequest { // QueryValidatorsResponse is response type for the Query/Validators RPC method message QueryValidatorsResponse { // validators contains all the queried validators. - repeated Validator validators = 1 [(gogoproto.nullable) = false]; + repeated Validator validators = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -120,7 +157,7 @@ message QueryValidatorRequest { // QueryValidatorResponse is response type for the Query/Validator RPC method message QueryValidatorResponse { // validator defines the validator info. - Validator validator = 1 [(gogoproto.nullable) = false]; + Validator validator = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryValidatorDelegationsRequest is request type for the @@ -137,7 +174,7 @@ message QueryValidatorDelegationsRequest { // Query/ValidatorDelegations RPC method message QueryValidatorDelegationsResponse { repeated DelegationResponse delegation_responses = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "DelegationResponses"]; + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.castrepeated) = "DelegationResponses"]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -156,7 +193,7 @@ message QueryValidatorUnbondingDelegationsRequest { // QueryValidatorUnbondingDelegationsResponse is response type for the // Query/ValidatorUnbondingDelegations RPC method. message QueryValidatorUnbondingDelegationsResponse { - repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false]; + repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -197,7 +234,7 @@ message QueryUnbondingDelegationRequest { // RPC method. message QueryUnbondingDelegationResponse { // unbond defines the unbonding information of a delegation. - UnbondingDelegation unbond = 1 [(gogoproto.nullable) = false]; + UnbondingDelegation unbond = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryDelegatorDelegationsRequest is request type for the @@ -217,7 +254,7 @@ message QueryDelegatorDelegationsRequest { // Query/DelegatorDelegations RPC method. message QueryDelegatorDelegationsResponse { // delegation_responses defines all the delegations' info of a delegator. - repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false]; + repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -239,7 +276,7 @@ message QueryDelegatorUnbondingDelegationsRequest { // QueryUnbondingDelegatorDelegationsResponse is response type for the // Query/UnbondingDelegatorDelegations RPC method. message QueryDelegatorUnbondingDelegationsResponse { - repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false]; + repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -267,7 +304,8 @@ message QueryRedelegationsRequest { // QueryRedelegationsResponse is response type for the Query/Redelegations RPC // method. message QueryRedelegationsResponse { - repeated RedelegationResponse redelegation_responses = 1 [(gogoproto.nullable) = false]; + repeated RedelegationResponse redelegation_responses = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -290,7 +328,7 @@ message QueryDelegatorValidatorsRequest { // Query/DelegatorValidators RPC method. message QueryDelegatorValidatorsResponse { // validators defines the validators' info of a delegator. - repeated Validator validators = 1 [(gogoproto.nullable) = false]; + repeated Validator validators = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -313,7 +351,7 @@ message QueryDelegatorValidatorRequest { // Query/DelegatorValidator RPC method. message QueryDelegatorValidatorResponse { // validator defines the validator info. - Validator validator = 1 [(gogoproto.nullable) = false]; + Validator validator = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC @@ -336,7 +374,7 @@ message QueryPoolRequest {} // QueryPoolResponse is response type for the Query/Pool RPC method. message QueryPoolResponse { // pool defines the pool info. - Pool pool = 1 [(gogoproto.nullable) = false]; + Pool pool = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -345,5 +383,5 @@ message QueryParamsRequest {} // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/third_party/proto/cosmos/staking/v1beta1/staking.proto b/third_party/proto/cosmos/staking/v1beta1/staking.proto index 6dc965fe..e7620c55 100644 --- a/third_party/proto/cosmos/staking/v1beta1/staking.proto +++ b/third_party/proto/cosmos/staking/v1beta1/staking.proto @@ -8,7 +8,9 @@ import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; import "tendermint/types/types.proto"; +import "tendermint/abci/types.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; @@ -17,8 +19,8 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; // recent HistoricalInfo // (`n` is set by the staking module's `historical_entries` parameter). message HistoricalInfo { - tendermint.types.Header header = 1 [(gogoproto.nullable) = false]; - repeated Validator valset = 2 [(gogoproto.nullable) = false]; + tendermint.types.Header header = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated Validator valset = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // CommissionRates defines the initial commission rates to be used for creating @@ -53,9 +55,11 @@ message Commission { option (gogoproto.goproto_stringer) = false; // commission_rates defines the initial commission rates to be used for creating a validator. - CommissionRates commission_rates = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + CommissionRates commission_rates = 1 + [(gogoproto.embed) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // update_time is the last time the commission rate was changed. - google.protobuf.Timestamp update_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp update_time = 2 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; } // Description defines a validator description. @@ -109,13 +113,14 @@ message Validator { (gogoproto.nullable) = false ]; // description defines the description terms for the validator. - Description description = 7 [(gogoproto.nullable) = false]; + Description description = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. int64 unbonding_height = 8; // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. - google.protobuf.Timestamp unbonding_time = 9 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp unbonding_time = 9 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; // commission defines the commission parameters. - Commission commission = 10 [(gogoproto.nullable) = false]; + Commission commission = 10 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // min_self_delegation is the validator's self declared minimum self delegation. // // Since: cosmos-sdk 0.46 @@ -124,6 +129,12 @@ message Validator { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; + + // strictly positive if this validator's unbonding has been stopped by external modules + int64 unbonding_on_hold_ref_count = 12; + + // list of unbonding ids, each uniquely identifing an unbonding of this validator + repeated uint64 unbonding_ids = 13; } // BondStatus is the status of a validator. @@ -162,7 +173,7 @@ message DVPair { // DVPairs defines an array of DVPair objects. message DVPairs { - repeated DVPair pairs = 1 [(gogoproto.nullable) = false]; + repeated DVPair pairs = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // DVVTriplet is struct that just has a delegator-validator-validator triplet @@ -181,7 +192,7 @@ message DVVTriplet { // DVVTriplets defines an array of DVVTriplet objects. message DVVTriplets { - repeated DVVTriplet triplets = 1 [(gogoproto.nullable) = false]; + repeated DVVTriplet triplets = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // Delegation represents the bond with tokens held by an account. It is @@ -216,7 +227,8 @@ message UnbondingDelegation { // validator_address is the bech32-encoded address of the validator. string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // entries are the unbonding delegation entries. - repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false]; // unbonding delegation entries + repeated UnbondingDelegationEntry entries = 3 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // unbonding delegation entries } // UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -227,7 +239,8 @@ message UnbondingDelegationEntry { // creation_height is the height which the unbonding took place. int64 creation_height = 1; // completion_time is the unix time for unbonding completion. - google.protobuf.Timestamp completion_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp completion_time = 2 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; // initial_balance defines the tokens initially scheduled to receive at completion. string initial_balance = 3 [ (cosmos_proto.scalar) = "cosmos.Int", @@ -240,6 +253,11 @@ message UnbondingDelegationEntry { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; + // Incrementing id that uniquely identifies this entry + uint64 unbonding_id = 5; + + // Strictly positive if this entry's unbonding has been stopped by external modules + int64 unbonding_on_hold_ref_count = 6; } // RedelegationEntry defines a redelegation object with relevant metadata. @@ -250,7 +268,8 @@ message RedelegationEntry { // creation_height defines the height which the redelegation took place. int64 creation_height = 1; // completion_time defines the unix time for redelegation completion. - google.protobuf.Timestamp completion_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp completion_time = 2 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; // initial_balance defines the initial balance when redelegation started. string initial_balance = 3 [ (cosmos_proto.scalar) = "cosmos.Int", @@ -263,6 +282,11 @@ message RedelegationEntry { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; + // Incrementing id that uniquely identifies this entry + uint64 unbonding_id = 5; + + // Strictly positive if this entry's unbonding has been stopped by external modules + int64 unbonding_on_hold_ref_count = 6; } // Redelegation contains the list of a particular delegator's redelegating bonds @@ -279,16 +303,19 @@ message Redelegation { // validator_dst_address is the validator redelegation destination operator address. string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // entries are the redelegation entries. - repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries + repeated RedelegationEntry entries = 4 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // redelegation entries } -// Params defines the parameters for the staking module. +// Params defines the parameters for the x/staking module. message Params { + option (amino.name) = "cosmos-sdk/x/staking/Params"; option (gogoproto.equal) = true; option (gogoproto.goproto_stringer) = false; // unbonding_time is the time duration of unbonding. - google.protobuf.Duration unbonding_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + google.protobuf.Duration unbonding_time = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdduration) = true]; // max_validators is the maximum number of validators. uint32 max_validators = 2; // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). @@ -311,9 +338,9 @@ message DelegationResponse { option (gogoproto.equal) = false; option (gogoproto.goproto_stringer) = false; - Delegation delegation = 1 [(gogoproto.nullable) = false]; + Delegation delegation = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // RedelegationEntryResponse is equivalent to a RedelegationEntry except that it @@ -322,7 +349,7 @@ message DelegationResponse { message RedelegationEntryResponse { option (gogoproto.equal) = true; - RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false]; + RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; string balance = 4 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", @@ -336,8 +363,8 @@ message RedelegationEntryResponse { message RedelegationResponse { option (gogoproto.equal) = false; - Redelegation redelegation = 1 [(gogoproto.nullable) = false]; - repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false]; + Redelegation redelegation = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // Pool is used for tracking bonded and not-bonded token supply of the bond @@ -349,12 +376,30 @@ message Pool { (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false, - (gogoproto.jsontag) = "not_bonded_tokens" + (gogoproto.jsontag) = "not_bonded_tokens", + (amino.dont_omitempty) = true ]; string bonded_tokens = 2 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false, - (gogoproto.jsontag) = "bonded_tokens" + (gogoproto.jsontag) = "bonded_tokens", + (amino.dont_omitempty) = true ]; } + +// Infraction indicates the infraction a validator commited. +enum Infraction { + // UNSPECIFIED defines an empty infraction. + INFRACTION_UNSPECIFIED = 0; + // DOUBLE_SIGN defines a validator that double-signs a block. + INFRACTION_DOUBLE_SIGN = 1; + // DOWNTIME defines a validator that missed signing too many blocks. + INFRACTION_DOWNTIME = 2; +} + +// ValidatorUpdates defines an array of abci.ValidatorUpdate objects. +// TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence +message ValidatorUpdates { + repeated tendermint.abci.ValidatorUpdate updates = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/third_party/proto/cosmos/staking/v1beta1/tx.proto b/third_party/proto/cosmos/staking/v1beta1/tx.proto index b4866d36..42e2218e 100644 --- a/third_party/proto/cosmos/staking/v1beta1/tx.proto +++ b/third_party/proto/cosmos/staking/v1beta1/tx.proto @@ -8,13 +8,15 @@ import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/staking/v1beta1/staking.proto"; - import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; // Msg defines the staking Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // CreateValidator defines a method for creating a new validator. rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse); @@ -38,6 +40,11 @@ service Msg { // // Since: cosmos-sdk 0.46 rpc CancelUnbondingDelegation(MsgCancelUnbondingDelegation) returns (MsgCancelUnbondingDelegationResponse); + + // UpdateParams defines an operation for updating the x/staking module + // parameters. + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgCreateValidator defines a SDK message for creating a new validator. @@ -47,12 +54,13 @@ message MsgCreateValidator { // is expected to sign, otherwise both are. option (cosmos.msg.v1.signer) = "delegator_address"; option (cosmos.msg.v1.signer) = "validator_address"; + option (amino.name) = "cosmos-sdk/MsgCreateValidator"; option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - Description description = 1 [(gogoproto.nullable) = false]; - CommissionRates commission = 2 [(gogoproto.nullable) = false]; + Description description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + CommissionRates commission = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; string min_self_delegation = 3 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", @@ -61,7 +69,7 @@ message MsgCreateValidator { string delegator_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string validator_address = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"]; google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; - cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgCreateValidatorResponse defines the Msg/CreateValidator response type. @@ -70,11 +78,12 @@ message MsgCreateValidatorResponse {} // MsgEditValidator defines a SDK message for editing an existing validator. message MsgEditValidator { option (cosmos.msg.v1.signer) = "validator_address"; + option (amino.name) = "cosmos-sdk/MsgEditValidator"; option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - Description description = 1 [(gogoproto.nullable) = false]; + Description description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // We pass a reference to the new commission rate and min self delegation as @@ -94,12 +103,14 @@ message MsgEditValidatorResponse {} // from a delegator to a validator. message MsgDelegate { option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgDelegate"; - option (gogoproto.equal) = false; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgDelegateResponse defines the Msg/Delegate response type. @@ -109,48 +120,56 @@ message MsgDelegateResponse {} // of coins from a delegator and source validator to a destination validator. message MsgBeginRedelegate { option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgBeginRedelegate"; - option (gogoproto.equal) = false; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. message MsgBeginRedelegateResponse { - google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp completion_time = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; } // MsgUndelegate defines a SDK message for performing an undelegation from a // delegate and a validator. message MsgUndelegate { option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgUndelegate"; - option (gogoproto.equal) = false; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgUndelegateResponse defines the Msg/Undelegate response type. message MsgUndelegateResponse { - google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp completion_time = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; } // MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator // // Since: cosmos-sdk 0.46 message MsgCancelUnbondingDelegation { - option (cosmos.msg.v1.signer) = "delegator_address"; - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgCancelUnbondingDelegation"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // amount is always less than or equal to unbonding delegation entry balance - cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // creation_height is the height which the unbonding took place. int64 creation_height = 4; } @@ -159,3 +178,24 @@ message MsgCancelUnbondingDelegation { // // Since: cosmos-sdk 0.46 message MsgCancelUnbondingDelegationResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/staking/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // params defines the x/staking parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +}; + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {}; diff --git a/third_party/proto/cosmos/tx/config/v1/config.proto b/third_party/proto/cosmos/tx/config/v1/config.proto new file mode 100644 index 00000000..15553a28 --- /dev/null +++ b/third_party/proto/cosmos/tx/config/v1/config.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package cosmos.tx.config.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Config is the config object of the x/auth/tx package. +message Config { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/auth/tx" + }; + + // skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override + // this functionality. + bool skip_ante_handler = 1; + + // skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override + // this functionality. + bool skip_post_handler = 2; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/tx/v1beta1/service.proto b/third_party/proto/cosmos/tx/v1beta1/service.proto index 4dd9b535..16b3de0d 100644 --- a/third_party/proto/cosmos/tx/v1beta1/service.proto +++ b/third_party/proto/cosmos/tx/v1beta1/service.proto @@ -40,6 +40,42 @@ service Service { rpc GetBlockWithTxs(GetBlockWithTxsRequest) returns (GetBlockWithTxsResponse) { option (google.api.http).get = "/cosmos/tx/v1beta1/txs/block/{height}"; } + // TxDecode decodes the transaction. + // + // Since: cosmos-sdk 0.47 + rpc TxDecode(TxDecodeRequest) returns (TxDecodeResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/decode" + body: "*" + }; + } + // TxEncode encodes the transaction. + // + // Since: cosmos-sdk 0.47 + rpc TxEncode(TxEncodeRequest) returns (TxEncodeResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/encode" + body: "*" + }; + } + // TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + // + // Since: cosmos-sdk 0.47 + rpc TxEncodeAmino(TxEncodeAminoRequest) returns (TxEncodeAminoResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/encode/amino" + body: "*" + }; + } + // TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + // + // Since: cosmos-sdk 0.47 + rpc TxDecodeAmino(TxDecodeAminoRequest) returns (TxDecodeAminoResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/decode/amino" + body: "*" + }; + } } // GetTxsEventRequest is the request type for the Service.TxsByEvents @@ -50,7 +86,7 @@ message GetTxsEventRequest { // pagination defines a pagination for the request. // Deprecated post v0.46.x: use page and limit instead. cosmos.base.query.v1beta1.PageRequest pagination = 2 [deprecated = true]; - ; + OrderBy order_by = 3; // page is the page number to query, starts at 1. If not provided, will default to first page. uint64 page = 4; @@ -95,9 +131,9 @@ message BroadcastTxRequest { enum BroadcastMode { // zero-value for mode ordering BROADCAST_MODE_UNSPECIFIED = 0; - // BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - // the tx to be committed in a block. - BROADCAST_MODE_BLOCK = 1; + // DEPRECATED: use BROADCAST_MODE_SYNC instead, + // BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. + BROADCAST_MODE_BLOCK = 1 [deprecated = true]; // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for // a CheckTx execution response only. BROADCAST_MODE_SYNC = 2; @@ -170,4 +206,72 @@ message GetBlockWithTxsResponse { .tendermint.types.Block block = 3; // pagination defines a pagination for the response. cosmos.base.query.v1beta1.PageResponse pagination = 4; -} \ No newline at end of file +} + +// TxDecodeRequest is the request type for the Service.TxDecode +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeRequest { + // tx_bytes is the raw transaction. + bytes tx_bytes = 1; +} + +// TxDecodeResponse is the response type for the +// Service.TxDecode method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeResponse { + // tx is the decoded transaction. + cosmos.tx.v1beta1.Tx tx = 1; +} + +// TxEncodeRequest is the request type for the Service.TxEncode +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeRequest { + // tx is the transaction to encode. + cosmos.tx.v1beta1.Tx tx = 1; +} + +// TxEncodeResponse is the response type for the +// Service.TxEncode method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeResponse { + // tx_bytes is the encoded transaction bytes. + bytes tx_bytes = 1; +} + +// TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeAminoRequest { + string amino_json = 1; +} + +// TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeAminoResponse { + bytes amino_binary = 1; +} + +// TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeAminoRequest { + bytes amino_binary = 1; +} + +// TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeAminoResponse { + string amino_json = 1; +} diff --git a/third_party/proto/cosmos/upgrade/module/v1/module.proto b/third_party/proto/cosmos/upgrade/module/v1/module.proto new file mode 100644 index 00000000..a4cf5808 --- /dev/null +++ b/third_party/proto/cosmos/upgrade/module/v1/module.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package cosmos.upgrade.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the upgrade module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/upgrade" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/upgrade/v1beta1/tx.proto b/third_party/proto/cosmos/upgrade/v1beta1/tx.proto index 7a2931da..293bea02 100644 --- a/third_party/proto/cosmos/upgrade/v1beta1/tx.proto +++ b/third_party/proto/cosmos/upgrade/v1beta1/tx.proto @@ -6,17 +6,21 @@ import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/upgrade/v1beta1/upgrade.proto"; import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; // Msg defines the upgrade Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // SoftwareUpgrade is a governance operation for initiating a software upgrade. // // Since: cosmos-sdk 0.46 rpc SoftwareUpgrade(MsgSoftwareUpgrade) returns (MsgSoftwareUpgradeResponse); + // CancelUpgrade is a governance operation for cancelling a previously - // approvid software upgrade. + // approved software upgrade. // // Since: cosmos-sdk 0.46 rpc CancelUpgrade(MsgCancelUpgrade) returns (MsgCancelUpgradeResponse); @@ -27,12 +31,13 @@ service Msg { // Since: cosmos-sdk 0.46 message MsgSoftwareUpgrade { option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/MsgSoftwareUpgrade"; - // authority is the address of the governance account. + // authority is the address that controls the module (defaults to x/gov unless overwritten). string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // plan is the upgrade plan. - Plan plan = 2 [(gogoproto.nullable) = false]; + Plan plan = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. @@ -45,8 +50,9 @@ message MsgSoftwareUpgradeResponse {} // Since: cosmos-sdk 0.46 message MsgCancelUpgrade { option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/MsgCancelUpgrade"; - // authority is the address of the governance account. + // authority is the address that controls the module (defaults to x/gov unless overwritten). string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } diff --git a/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto b/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto index 4d19a299..0a967168 100644 --- a/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ b/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -5,12 +5,14 @@ import "google/protobuf/any.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; option (gogoproto.goproto_getters_all) = false; // Plan specifies information about a planned upgrade and when it should occur. message Plan { + option (amino.name) = "cosmos-sdk/Plan"; option (gogoproto.equal) = true; option (gogoproto.goproto_stringer) = false; @@ -26,10 +28,10 @@ message Plan { // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic // has been removed from the SDK. // If this field is not empty, an error will be thrown. - google.protobuf.Timestamp time = 2 [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp time = 2 + [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // The height at which the upgrade must be performed. - // Only used if Time is not set. int64 height = 3; // Any application specific upgrade info to be included on-chain @@ -49,12 +51,18 @@ message Plan { message SoftwareUpgradeProposal { option deprecated = true; option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/SoftwareUpgradeProposal"; option (gogoproto.equal) = true; option (gogoproto.goproto_stringer) = false; + // title of the proposal string title = 1; + + // description of the proposal string description = 2; - Plan plan = 3 [(gogoproto.nullable) = false]; + + // plan of the proposal + Plan plan = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software @@ -64,10 +72,14 @@ message SoftwareUpgradeProposal { message CancelSoftwareUpgradeProposal { option deprecated = true; option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/CancelSoftwareUpgradeProposal"; option (gogoproto.equal) = true; option (gogoproto.goproto_stringer) = false; + // title of the proposal string title = 1; + + // description of the proposal string description = 2; } diff --git a/third_party/proto/cosmos/vesting/module/v1/module.proto b/third_party/proto/cosmos/vesting/module/v1/module.proto new file mode 100644 index 00000000..88bb89c1 --- /dev/null +++ b/third_party/proto/cosmos/vesting/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.vesting.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the vesting module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/auth/vesting" + }; +} \ No newline at end of file diff --git a/third_party/proto/cosmos/vesting/v1beta1/tx.proto b/third_party/proto/cosmos/vesting/v1beta1/tx.proto index 27511ba8..42d3213f 100644 --- a/third_party/proto/cosmos/vesting/v1beta1/tx.proto +++ b/third_party/proto/cosmos/vesting/v1beta1/tx.proto @@ -5,13 +5,15 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/vesting/v1beta1/vesting.proto"; - import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; // Msg defines the bank Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // CreateVestingAccount defines a method that enables creating a vesting // account. rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); @@ -31,14 +33,19 @@ service Msg { // account. message MsgCreateVestingAccount { option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgCreateVestingAccount"; option (gogoproto.equal) = true; string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // end of vesting as unix time (in seconds). int64 end_time = 4; bool delayed = 5; } @@ -51,12 +58,17 @@ message MsgCreateVestingAccountResponse {} // // Since: cosmos-sdk 0.46 message MsgCreatePermanentLockedAccount { - option (gogoproto.equal) = true; + option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgCreatePermLockedAccount"; + option (gogoproto.equal) = true; string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. @@ -70,13 +82,15 @@ message MsgCreatePermanentLockedAccountResponse {} // Since: cosmos-sdk 0.46 message MsgCreatePeriodicVestingAccount { option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgCreatePeriodicVestingAccount"; option (gogoproto.equal) = false; string from_address = 1; string to_address = 2; + // start of vesting as unix time (in seconds). int64 start_time = 3; - repeated Period vesting_periods = 4 [(gogoproto.nullable) = false]; + repeated Period vesting_periods = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount diff --git a/third_party/proto/cosmos/vesting/v1beta1/vesting.proto b/third_party/proto/cosmos/vesting/v1beta1/vesting.proto index 824cc30d..7ab1fb79 100644 --- a/third_party/proto/cosmos/vesting/v1beta1/vesting.proto +++ b/third_party/proto/cosmos/vesting/v1beta1/vesting.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package cosmos.vesting.v1beta1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/auth/v1beta1/auth.proto"; @@ -10,26 +11,39 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; // BaseVestingAccount implements the VestingAccount interface. It contains all // the necessary fields needed for any vesting account implementation. message BaseVestingAccount { + option (amino.name) = "cosmos-sdk/BaseVestingAccount"; option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true]; - repeated cosmos.base.v1beta1.Coin original_vesting = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - repeated cosmos.base.v1beta1.Coin delegated_free = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin original_vesting = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + repeated cosmos.base.v1beta1.Coin delegated_free = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // Vesting end time, as unix timestamp (in seconds). int64 end_time = 5; } // ContinuousVestingAccount implements the VestingAccount interface. It // continuously vests by unlocking coins linearly with respect to time. message ContinuousVestingAccount { + option (amino.name) = "cosmos-sdk/ContinuousVestingAccount"; option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + // Vesting start time, as unix timestamp (in seconds). int64 start_time = 2; } @@ -37,6 +51,7 @@ message ContinuousVestingAccount { // coins after a specific time, but non prior. In other words, it keeps them // locked until a specified time. message DelayedVestingAccount { + option (amino.name) = "cosmos-sdk/DelayedVestingAccount"; option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; @@ -47,20 +62,25 @@ message DelayedVestingAccount { message Period { option (gogoproto.goproto_stringer) = false; + // Period duration in seconds. int64 length = 1; - repeated cosmos.base.v1beta1.Coin amount = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // PeriodicVestingAccount implements the VestingAccount interface. It // periodically vests by unlocking coins during each specified period. message PeriodicVestingAccount { + option (amino.name) = "cosmos-sdk/PeriodicVestingAccount"; option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; int64 start_time = 2; - repeated Period vesting_periods = 3 [(gogoproto.nullable) = false]; + repeated Period vesting_periods = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // PermanentLockedAccount implements the VestingAccount interface. It does @@ -69,6 +89,7 @@ message PeriodicVestingAccount { // // Since: cosmos-sdk 0.43 message PermanentLockedAccount { + option (amino.name) = "cosmos-sdk/PermanentLockedAccount"; option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; diff --git a/third_party/proto/gogoproto/gogo.proto b/third_party/proto/gogoproto/gogo.proto index 49e78f99..974b36a7 100644 --- a/third_party/proto/gogoproto/gogo.proto +++ b/third_party/proto/gogoproto/gogo.proto @@ -1,7 +1,7 @@ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf +// http://github.com/cosmos/gogoproto // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -33,7 +33,7 @@ import "google/protobuf/descriptor.proto"; option java_package = "com.google.protobuf"; option java_outer_classname = "GoGoProtos"; -option go_package = "github.com/gogo/protobuf/gogoproto"; +option go_package = "github.com/cosmos/gogoproto/gogoproto"; extend google.protobuf.EnumOptions { optional bool goproto_enum_prefix = 62001; diff --git a/third_party/proto/ibc/applications/fee/v1/ack.proto b/third_party/proto/ibc/applications/fee/v1/ack.proto index be0d74a4..ec1342bb 100644 --- a/third_party/proto/ibc/applications/fee/v1/ack.proto +++ b/third_party/proto/ibc/applications/fee/v1/ack.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.fee.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/29-fee/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/ibc/applications/fee/v1/fee.proto b/third_party/proto/ibc/applications/fee/v1/fee.proto index b38ae9d6..1a025ddc 100644 --- a/third_party/proto/ibc/applications/fee/v1/fee.proto +++ b/third_party/proto/ibc/applications/fee/v1/fee.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.fee.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/29-fee/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types"; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/ibc/applications/fee/v1/genesis.proto b/third_party/proto/ibc/applications/fee/v1/genesis.proto index 8f52be19..6bba6cff 100644 --- a/third_party/proto/ibc/applications/fee/v1/genesis.proto +++ b/third_party/proto/ibc/applications/fee/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.fee.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/29-fee/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types"; import "gogoproto/gogo.proto"; import "ibc/applications/fee/v1/fee.proto"; diff --git a/third_party/proto/ibc/applications/fee/v1/metadata.proto b/third_party/proto/ibc/applications/fee/v1/metadata.proto index 3afdba16..0c0a72c9 100644 --- a/third_party/proto/ibc/applications/fee/v1/metadata.proto +++ b/third_party/proto/ibc/applications/fee/v1/metadata.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.fee.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/29-fee/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/ibc/applications/fee/v1/query.proto b/third_party/proto/ibc/applications/fee/v1/query.proto index 3153051c..871cfdac 100644 --- a/third_party/proto/ibc/applications/fee/v1/query.proto +++ b/third_party/proto/ibc/applications/fee/v1/query.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.fee.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/29-fee/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; diff --git a/third_party/proto/ibc/applications/fee/v1/tx.proto b/third_party/proto/ibc/applications/fee/v1/tx.proto index b099b5ee..3a46de74 100644 --- a/third_party/proto/ibc/applications/fee/v1/tx.proto +++ b/third_party/proto/ibc/applications/fee/v1/tx.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.fee.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/29-fee/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types"; import "gogoproto/gogo.proto"; import "ibc/applications/fee/v1/fee.proto"; diff --git a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto index 072d2617..a505b463 100644 --- a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto +++ b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.controller.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/query.proto b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/query.proto index db7e888b..8c237a15 100644 --- a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/query.proto +++ b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/query.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.controller.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types"; import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto index 31de5e7e..284ffe70 100644 --- a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto +++ b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.controller.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types"; import "gogoproto/gogo.proto"; import "ibc/applications/interchain_accounts/v1/packet.proto"; @@ -15,7 +15,7 @@ service Msg { rpc SendTx(MsgSendTx) returns (MsgSendTxResponse); } -// MsgRegisterInterchainAccount defines the payload for Msg/MsgRegisterInterchainAccount +// MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount message MsgRegisterInterchainAccount { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; @@ -25,9 +25,10 @@ message MsgRegisterInterchainAccount { string version = 3; } -// MsgRegisterInterchainAccountResponse defines the response for Msg/MsgRegisterInterchainAccountResponse +// MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount message MsgRegisterInterchainAccountResponse { string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string port_id = 2 [(gogoproto.moretags) = "yaml:\"port_id\""]; } // MsgSendTx defines the payload for Msg/SendTx diff --git a/third_party/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto b/third_party/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto index c52bab73..2fed3763 100644 --- a/third_party/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto +++ b/third_party/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.genesis.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/genesis/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/genesis/types"; import "gogoproto/gogo.proto"; import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; diff --git a/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto b/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto index e5baae5d..18cc1d13 100644 --- a/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto +++ b/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.host.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/host/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/ibc/applications/interchain_accounts/host/v1/query.proto b/third_party/proto/ibc/applications/interchain_accounts/host/v1/query.proto index 4b773917..b89ed8ed 100644 --- a/third_party/proto/ibc/applications/interchain_accounts/host/v1/query.proto +++ b/third_party/proto/ibc/applications/interchain_accounts/host/v1/query.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.host.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/host/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"; import "google/api/annotations.proto"; import "ibc/applications/interchain_accounts/host/v1/host.proto"; diff --git a/third_party/proto/ibc/applications/interchain_accounts/v1/account.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/account.proto index 56ea941e..d60c27a9 100644 --- a/third_party/proto/ibc/applications/interchain_accounts/v1/account.proto +++ b/third_party/proto/ibc/applications/interchain_accounts/v1/account.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; @@ -12,7 +12,7 @@ import "cosmos/auth/v1beta1/auth.proto"; message InterchainAccount { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; - option (cosmos_proto.implements_interface) = "InterchainAccountI"; + option (cosmos_proto.implements_interface) = "ibc.applications.interchain_accounts.v1.InterchainAccountI"; cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""]; diff --git a/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto index eba844f9..9ea7eeca 100644 --- a/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto +++ b/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/ibc/applications/interchain_accounts/v1/packet.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/packet.proto index ac337fd5..d2dcf518 100644 --- a/third_party/proto/ibc/applications/interchain_accounts/v1/packet.proto +++ b/third_party/proto/ibc/applications/interchain_accounts/v1/packet.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types"; import "google/protobuf/any.proto"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/ibc/applications/transfer/v1/authz.proto b/third_party/proto/ibc/applications/transfer/v1/authz.proto new file mode 100644 index 00000000..8b27ac9c --- /dev/null +++ b/third_party/proto/ibc/applications/transfer/v1/authz.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +// Allocation defines the spend limit for a particular port and channel +message Allocation { + // the port on which the packet will be sent + string source_port = 1 [(gogoproto.moretags) = "yaml:\"source_port\""]; + // the channel by which the packet will be sent + string source_channel = 2 [(gogoproto.moretags) = "yaml:\"source_channel\""]; + // spend limitation on the channel + repeated cosmos.base.v1beta1.Coin spend_limit = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // allow list of receivers, an empty allow list permits any receiver address + repeated string allow_list = 4; +} + +// TransferAuthorization allows the grantee to spend up to spend_limit coins from +// the granter's account for ibc transfer on a specific channel +message TransferAuthorization { + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; + + // port and channel amounts + repeated Allocation allocations = 1 [(gogoproto.nullable) = false]; +} diff --git a/third_party/proto/ibc/applications/transfer/v1/genesis.proto b/third_party/proto/ibc/applications/transfer/v1/genesis.proto index 71d3f383..b3f013e1 100644 --- a/third_party/proto/ibc/applications/transfer/v1/genesis.proto +++ b/third_party/proto/ibc/applications/transfer/v1/genesis.proto @@ -2,9 +2,10 @@ syntax = "proto3"; package ibc.applications.transfer.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"; import "ibc/applications/transfer/v1/transfer.proto"; +import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; // GenesisState defines the ibc-transfer genesis state @@ -16,4 +17,11 @@ message GenesisState { (gogoproto.moretags) = "yaml:\"denom_traces\"" ]; Params params = 3 [(gogoproto.nullable) = false]; + // total_escrowed contains the total amount of tokens escrowed + // by the transfer module + repeated cosmos.base.v1beta1.Coin total_escrowed = 4 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"total_escrowed\"" + ]; } diff --git a/third_party/proto/ibc/applications/transfer/v1/query.proto b/third_party/proto/ibc/applications/transfer/v1/query.proto index cf8896fe..66670407 100644 --- a/third_party/proto/ibc/applications/transfer/v1/query.proto +++ b/third_party/proto/ibc/applications/transfer/v1/query.proto @@ -3,24 +3,25 @@ syntax = "proto3"; package ibc.applications.transfer.v1; import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "ibc/applications/transfer/v1/transfer.proto"; import "google/api/annotations.proto"; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"; // Query provides defines the gRPC querier service. service Query { - // DenomTrace queries a denomination trace information. - rpc DenomTrace(QueryDenomTraceRequest) returns (QueryDenomTraceResponse) { - option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces/{hash}"; - } - // DenomTraces queries all denomination traces. rpc DenomTraces(QueryDenomTracesRequest) returns (QueryDenomTracesResponse) { option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces"; } + // DenomTrace queries a denomination trace information. + rpc DenomTrace(QueryDenomTraceRequest) returns (QueryDenomTraceResponse) { + option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces/{hash=**}"; + } + // Params queries all parameters of the ibc-transfer module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/ibc/apps/transfer/v1/params"; @@ -28,13 +29,18 @@ service Query { // DenomHash queries a denomination hash information. rpc DenomHash(QueryDenomHashRequest) returns (QueryDenomHashResponse) { - option (google.api.http).get = "/ibc/apps/transfer/v1/denom_hashes/{trace}"; + option (google.api.http).get = "/ibc/apps/transfer/v1/denom_hashes/{trace=**}"; } // EscrowAddress returns the escrow address for a particular port and channel id. rpc EscrowAddress(QueryEscrowAddressRequest) returns (QueryEscrowAddressResponse) { option (google.api.http).get = "/ibc/apps/transfer/v1/channels/{channel_id}/ports/{port_id}/escrow_address"; } + + // TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. + rpc TotalEscrowForDenom(QueryTotalEscrowForDenomRequest) returns (QueryTotalEscrowForDenomResponse) { + option (google.api.http).get = "/ibc/apps/transfer/v1/denoms/{denom=**}/total_escrow"; + } } // QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC @@ -102,4 +108,14 @@ message QueryEscrowAddressRequest { message QueryEscrowAddressResponse { // the escrow account address string escrow_address = 1; -} \ No newline at end of file +} + +// QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. +message QueryTotalEscrowForDenomRequest { + string denom = 1; +} + +// QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. +message QueryTotalEscrowForDenomResponse { + cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false]; +} diff --git a/third_party/proto/ibc/applications/transfer/v1/transfer.proto b/third_party/proto/ibc/applications/transfer/v1/transfer.proto index 9c60ad65..21710747 100644 --- a/third_party/proto/ibc/applications/transfer/v1/transfer.proto +++ b/third_party/proto/ibc/applications/transfer/v1/transfer.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.transfer.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/ibc/applications/transfer/v1/tx.proto b/third_party/proto/ibc/applications/transfer/v1/tx.proto index 7504a905..1c67aafb 100644 --- a/third_party/proto/ibc/applications/transfer/v1/tx.proto +++ b/third_party/proto/ibc/applications/transfer/v1/tx.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.transfer.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; diff --git a/third_party/proto/ibc/applications/transfer/v2/packet.proto b/third_party/proto/ibc/applications/transfer/v2/packet.proto index 5b3b004c..7dc31347 100644 --- a/third_party/proto/ibc/applications/transfer/v2/packet.proto +++ b/third_party/proto/ibc/applications/transfer/v2/packet.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.transfer.v2; -option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"; // FungibleTokenPacketData defines a struct for the packet payload // See FungibleTokenPacketData spec: diff --git a/third_party/proto/ibc/core/channel/v1/channel.proto b/third_party/proto/ibc/core/channel/v1/channel.proto index 2d301af2..5fbb0d42 100644 --- a/third_party/proto/ibc/core/channel/v1/channel.proto +++ b/third_party/proto/ibc/core/channel/v1/channel.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.channel.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; diff --git a/third_party/proto/ibc/core/channel/v1/genesis.proto b/third_party/proto/ibc/core/channel/v1/genesis.proto index ef0e5148..65cc928a 100644 --- a/third_party/proto/ibc/core/channel/v1/genesis.proto +++ b/third_party/proto/ibc/core/channel/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.channel.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"; import "gogoproto/gogo.proto"; import "ibc/core/channel/v1/channel.proto"; diff --git a/third_party/proto/ibc/core/channel/v1/query.proto b/third_party/proto/ibc/core/channel/v1/query.proto index f22a3753..2d5bdb2f 100644 --- a/third_party/proto/ibc/core/channel/v1/query.proto +++ b/third_party/proto/ibc/core/channel/v1/query.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.channel.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"; import "ibc/core/client/v1/client.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; diff --git a/third_party/proto/ibc/core/channel/v1/tx.proto b/third_party/proto/ibc/core/channel/v1/tx.proto index eba65f1e..a67a3755 100644 --- a/third_party/proto/ibc/core/channel/v1/tx.proto +++ b/third_party/proto/ibc/core/channel/v1/tx.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.channel.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; @@ -92,7 +92,8 @@ message MsgChannelOpenTry { // MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. message MsgChannelOpenTryResponse { - string version = 1; + string version = 1; + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; } // MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge diff --git a/third_party/proto/ibc/core/client/v1/client.proto b/third_party/proto/ibc/core/client/v1/client.proto index 0f1e6ab2..15b47e55 100644 --- a/third_party/proto/ibc/core/client/v1/client.proto +++ b/third_party/proto/ibc/core/client/v1/client.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; @@ -98,6 +98,8 @@ message Height { // Params defines the set of IBC light client parameters. message Params { - // allowed_clients defines the list of allowed client state types. + // allowed_clients defines the list of allowed client state types which can be created + // and interacted with. If a client type is removed from the allowed clients list, usage + // of this client will be disabled until it is added again to the list. repeated string allowed_clients = 1 [(gogoproto.moretags) = "yaml:\"allowed_clients\""]; } diff --git a/third_party/proto/ibc/core/client/v1/genesis.proto b/third_party/proto/ibc/core/client/v1/genesis.proto index 02bafd81..78821244 100644 --- a/third_party/proto/ibc/core/client/v1/genesis.proto +++ b/third_party/proto/ibc/core/client/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"; import "ibc/core/client/v1/client.proto"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/ibc/core/client/v1/query.proto b/third_party/proto/ibc/core/client/v1/query.proto index de16d917..0d26cf62 100644 --- a/third_party/proto/ibc/core/client/v1/query.proto +++ b/third_party/proto/ibc/core/client/v1/query.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"; import "cosmos/base/query/v1beta1/pagination.proto"; import "ibc/core/client/v1/client.proto"; diff --git a/third_party/proto/ibc/core/client/v1/tx.proto b/third_party/proto/ibc/core/client/v1/tx.proto index 74ad6d9d..23302d5e 100644 --- a/third_party/proto/ibc/core/client/v1/tx.proto +++ b/third_party/proto/ibc/core/client/v1/tx.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; @@ -40,15 +40,15 @@ message MsgCreateClient { message MsgCreateClientResponse {} // MsgUpdateClient defines an sdk.Msg to update a IBC client state using -// the given header. +// the given client message. message MsgUpdateClient { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; // client unique identifier string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // header to update the light client - google.protobuf.Any header = 2; + // client message to update the light client + google.protobuf.Any client_message = 2; // signer address string signer = 3; } @@ -82,16 +82,17 @@ message MsgUpgradeClientResponse {} // MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for // light client misbehaviour. +// Warning: DEPRECATED message MsgSubmitMisbehaviour { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\"", deprecated = true]; // misbehaviour used for freezing the light client - google.protobuf.Any misbehaviour = 2; + google.protobuf.Any misbehaviour = 2 [deprecated = true]; // signer address - string signer = 3; + string signer = 3 [deprecated = true]; } // MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response diff --git a/third_party/proto/ibc/core/commitment/v1/commitment.proto b/third_party/proto/ibc/core/commitment/v1/commitment.proto index 38526624..4840ff3e 100644 --- a/third_party/proto/ibc/core/commitment/v1/commitment.proto +++ b/third_party/proto/ibc/core/commitment/v1/commitment.proto @@ -2,10 +2,10 @@ syntax = "proto3"; package ibc.core.commitment.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/core/23-commitment/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types"; import "gogoproto/gogo.proto"; -import "proofs.proto"; +import "cosmos/ics23/v1/proofs.proto"; // MerkleRoot defines a merkle root hash. // In the Cosmos SDK, the AppHash of a block header becomes the root. @@ -37,5 +37,5 @@ message MerklePath { // should be succinct. // MerkleProofs are ordered from leaf-to-root message MerkleProof { - repeated ics23.CommitmentProof proofs = 1; + repeated cosmos.ics23.v1.CommitmentProof proofs = 1; } diff --git a/third_party/proto/ibc/core/connection/v1/connection.proto b/third_party/proto/ibc/core/connection/v1/connection.proto index 8ec7a00a..ba367c14 100644 --- a/third_party/proto/ibc/core/connection/v1/connection.proto +++ b/third_party/proto/ibc/core/connection/v1/connection.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.connection.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/core/03-connection/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; import "ibc/core/commitment/v1/commitment.proto"; diff --git a/third_party/proto/ibc/core/connection/v1/genesis.proto b/third_party/proto/ibc/core/connection/v1/genesis.proto index c9d46081..122c5a46 100644 --- a/third_party/proto/ibc/core/connection/v1/genesis.proto +++ b/third_party/proto/ibc/core/connection/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.connection.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/core/03-connection/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; import "ibc/core/connection/v1/connection.proto"; diff --git a/third_party/proto/ibc/core/connection/v1/query.proto b/third_party/proto/ibc/core/connection/v1/query.proto index 04d7c3ea..3c76b238 100644 --- a/third_party/proto/ibc/core/connection/v1/query.proto +++ b/third_party/proto/ibc/core/connection/v1/query.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.connection.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/core/03-connection/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; diff --git a/third_party/proto/ibc/core/connection/v1/tx.proto b/third_party/proto/ibc/core/connection/v1/tx.proto index 94d676bb..af8f505c 100644 --- a/third_party/proto/ibc/core/connection/v1/tx.proto +++ b/third_party/proto/ibc/core/connection/v1/tx.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.connection.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/core/03-connection/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; @@ -67,6 +67,8 @@ message MsgConnectionOpenTry { ibc.core.client.v1.Height consensus_height = 11 [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; string signer = 12; + // optional proof data for host state machines that are unable to introspect their own consensus state + bytes host_consensus_state_proof = 13; } // MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. @@ -94,6 +96,8 @@ message MsgConnectionOpenAck { ibc.core.client.v1.Height consensus_height = 9 [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; string signer = 10; + // optional proof data for host state machines that are unable to introspect their own consensus state + bytes host_consensus_state_proof = 11; } // MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. diff --git a/third_party/proto/ibc/core/types/v1/genesis.proto b/third_party/proto/ibc/core/types/v1/genesis.proto index dd389d41..4e07551f 100644 --- a/third_party/proto/ibc/core/types/v1/genesis.proto +++ b/third_party/proto/ibc/core/types/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.types.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/core/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/types"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/genesis.proto"; diff --git a/third_party/proto/ibc/lightclients/localhost/v2/localhost.proto b/third_party/proto/ibc/lightclients/localhost/v2/localhost.proto new file mode 100644 index 00000000..ec970eb0 --- /dev/null +++ b/third_party/proto/ibc/lightclients/localhost/v2/localhost.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package ibc.lightclients.localhost.v2; + +option go_package = "github.com/cosmos/ibc-go/v7/modules/light-clients/09-localhost;localhost"; + +import "ibc/core/client/v1/client.proto"; +import "gogoproto/gogo.proto"; + +// ClientState defines the 09-localhost client state +message ClientState { + option (gogoproto.goproto_getters) = false; + + // the latest block height + ibc.core.client.v1.Height latest_height = 1 [(gogoproto.nullable) = false]; +} diff --git a/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto index ea5cb89d..25031331 100644 --- a/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto +++ b/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.lightclients.solomachine.v2; -option go_package = "github.com/cosmos/ibc-go/v6/modules/light-clients/06-solomachine/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/02-client/migrations/v7"; import "ibc/core/connection/v1/connection.proto"; import "ibc/core/channel/v1/channel.proto"; diff --git a/third_party/proto/ibc/lightclients/solomachine/v3/solomachine.proto b/third_party/proto/ibc/lightclients/solomachine/v3/solomachine.proto new file mode 100644 index 00000000..40e76b72 --- /dev/null +++ b/third_party/proto/ibc/lightclients/solomachine/v3/solomachine.proto @@ -0,0 +1,99 @@ +syntax = "proto3"; + +package ibc.lightclients.solomachine.v3; + +option go_package = "github.com/cosmos/ibc-go/v7/modules/light-clients/06-solomachine;solomachine"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +// ClientState defines a solo machine client that tracks the current consensus +// state and if the client is frozen. +message ClientState { + option (gogoproto.goproto_getters) = false; + // latest sequence of the client state + uint64 sequence = 1; + // frozen sequence of the solo machine + bool is_frozen = 2 [(gogoproto.moretags) = "yaml:\"is_frozen\""]; + ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; +} + +// ConsensusState defines a solo machine consensus state. The sequence of a +// consensus state is contained in the "height" key used in storing the +// consensus state. +message ConsensusState { + option (gogoproto.goproto_getters) = false; + // public key of the solo machine + google.protobuf.Any public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""]; + // diversifier allows the same public key to be re-used across different solo + // machine clients (potentially on different chains) without being considered + // misbehaviour. + string diversifier = 2; + uint64 timestamp = 3; +} + +// Header defines a solo machine consensus header +message Header { + option (gogoproto.goproto_getters) = false; + + uint64 timestamp = 1; + bytes signature = 2; + google.protobuf.Any new_public_key = 3 [(gogoproto.moretags) = "yaml:\"new_public_key\""]; + string new_diversifier = 4 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; +} + +// Misbehaviour defines misbehaviour for a solo machine which consists +// of a sequence and two signatures over different messages at that sequence. +message Misbehaviour { + option (gogoproto.goproto_getters) = false; + + uint64 sequence = 1; + SignatureAndData signature_one = 2 [(gogoproto.moretags) = "yaml:\"signature_one\""]; + SignatureAndData signature_two = 3 [(gogoproto.moretags) = "yaml:\"signature_two\""]; +} + +// SignatureAndData contains a signature and the data signed over to create that +// signature. +message SignatureAndData { + option (gogoproto.goproto_getters) = false; + + bytes signature = 1; + bytes path = 2; + bytes data = 3; + uint64 timestamp = 4; +} + +// TimestampedSignatureData contains the signature data and the timestamp of the +// signature. +message TimestampedSignatureData { + option (gogoproto.goproto_getters) = false; + + bytes signature_data = 1 [(gogoproto.moretags) = "yaml:\"signature_data\""]; + uint64 timestamp = 2; +} + +// SignBytes defines the signed bytes used for signature verification. +message SignBytes { + option (gogoproto.goproto_getters) = false; + + // the sequence number + uint64 sequence = 1; + // the proof timestamp + uint64 timestamp = 2; + // the public key diversifier + string diversifier = 3; + // the standardised path bytes + bytes path = 4; + // the marshaled data bytes + bytes data = 5; +} + +// HeaderData returns the SignBytes data for update verification. +message HeaderData { + option (gogoproto.goproto_getters) = false; + + // header public key + google.protobuf.Any new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""]; + // header diversifier + string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; +} diff --git a/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto b/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto index cb0544b5..83fa59c9 100644 --- a/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto +++ b/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto @@ -2,11 +2,11 @@ syntax = "proto3"; package ibc.lightclients.tendermint.v1; -option go_package = "github.com/cosmos/ibc-go/v6/modules/light-clients/07-tendermint/types"; +option go_package = "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint;tendermint"; import "tendermint/types/validator.proto"; import "tendermint/types/types.proto"; -import "proofs.proto"; +import "cosmos/ics23/v1/proofs.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "ibc/core/client/v1/client.proto"; @@ -41,7 +41,7 @@ message ClientState { [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"latest_height\""]; // Proof specifications used in verifying counterparty state - repeated ics23.ProofSpec proof_specs = 8 [(gogoproto.moretags) = "yaml:\"proof_specs\""]; + repeated cosmos.ics23.v1.ProofSpec proof_specs = 8 [(gogoproto.moretags) = "yaml:\"proof_specs\""]; // Path at which next upgraded client will be committed. // Each element corresponds to the key for a single CommitmentProof in the @@ -69,7 +69,7 @@ message ConsensusState { // commitment root (i.e app hash) ibc.core.commitment.v1.MerkleRoot root = 2 [(gogoproto.nullable) = false]; bytes next_validators_hash = 3 [ - (gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes", + (gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes", (gogoproto.moretags) = "yaml:\"next_validators_hash\"" ]; } @@ -79,7 +79,8 @@ message ConsensusState { message Misbehaviour { option (gogoproto.goproto_getters) = false; - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // ClientID is deprecated + string client_id = 1 [deprecated = true, (gogoproto.moretags) = "yaml:\"client_id\""]; Header header_1 = 2 [(gogoproto.customname) = "Header1", (gogoproto.moretags) = "yaml:\"header_1\""]; Header header_2 = 3 [(gogoproto.customname) = "Header2", (gogoproto.moretags) = "yaml:\"header_2\""]; } diff --git a/third_party/proto/tendermint/abci/types.proto b/third_party/proto/tendermint/abci/types.proto index 44f86112..cf9927d7 100644 --- a/third_party/proto/tendermint/abci/types.proto +++ b/third_party/proto/tendermint/abci/types.proto @@ -1,10 +1,10 @@ syntax = "proto3"; package tendermint.abci; -option go_package = "github.com/tendermint/tendermint/abci/types"; +option go_package = "github.com/cometbft/cometbft/abci/types"; // For more information on gogo.proto, see: -// https://github.com/gogo/protobuf/blob/master/extensions.md +// https://github.com/cosmos/gogoproto/blob/master/extensions.md import "tendermint/crypto/proof.proto"; import "tendermint/types/types.proto"; import "tendermint/crypto/keys.proto"; @@ -14,7 +14,7 @@ import "gogoproto/gogo.proto"; // This file is copied from http://github.com/tendermint/abci // NOTE: When using custom types, mind the warnings. -// https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues +// https://github.com/cosmos/gogoproto/blob/master/custom_types.md#warnings-and-issues //---------------------------------------- // Request types @@ -24,7 +24,6 @@ message Request { RequestEcho echo = 1; RequestFlush flush = 2; RequestInfo info = 3; - RequestSetOption set_option = 4; RequestInitChain init_chain = 5; RequestQuery query = 6; RequestBeginBlock begin_block = 7; @@ -36,7 +35,10 @@ message Request { RequestOfferSnapshot offer_snapshot = 13; RequestLoadSnapshotChunk load_snapshot_chunk = 14; RequestApplySnapshotChunk apply_snapshot_chunk = 15; + RequestPrepareProposal prepare_proposal = 16; + RequestProcessProposal process_proposal = 17; } + reserved 4; } message RequestEcho { @@ -49,22 +51,17 @@ message RequestInfo { string version = 1; uint64 block_version = 2; uint64 p2p_version = 3; -} - -// nondeterministic -message RequestSetOption { - string key = 1; - string value = 2; + string abci_version = 4; } message RequestInitChain { google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - string chain_id = 2; - ConsensusParams consensus_params = 3; - repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; - bytes app_state_bytes = 5; - int64 initial_height = 6; + string chain_id = 2; + tendermint.types.ConsensusParams consensus_params = 3; + repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; + bytes app_state_bytes = 5; + int64 initial_height = 6; } message RequestQuery { @@ -77,8 +74,8 @@ message RequestQuery { message RequestBeginBlock { bytes hash = 1; tendermint.types.Header header = 2 [(gogoproto.nullable) = false]; - LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; - repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; + CommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; + repeated Misbehavior byzantine_validators = 4 [(gogoproto.nullable) = false]; } enum CheckTxType { @@ -124,6 +121,34 @@ message RequestApplySnapshotChunk { string sender = 3; } +message RequestPrepareProposal { + // the modified transactions cannot exceed this size. + int64 max_tx_bytes = 1; + // txs is an array of transactions that will be included in a block, + // sent to the app for possible modifications. + repeated bytes txs = 2; + ExtendedCommitInfo local_last_commit = 3 [(gogoproto.nullable) = false]; + repeated Misbehavior misbehavior = 4 [(gogoproto.nullable) = false]; + int64 height = 5; + google.protobuf.Timestamp time = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes next_validators_hash = 7; + // address of the public key of the validator proposing the block. + bytes proposer_address = 8; +} + +message RequestProcessProposal { + repeated bytes txs = 1; + CommitInfo proposed_last_commit = 2 [(gogoproto.nullable) = false]; + repeated Misbehavior misbehavior = 3 [(gogoproto.nullable) = false]; + // hash is the merkle root hash of the fields of the proposed block. + bytes hash = 4; + int64 height = 5; + google.protobuf.Timestamp time = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes next_validators_hash = 7; + // address of the public key of the original proposer of the block. + bytes proposer_address = 8; +} + //---------------------------------------- // Response types @@ -133,7 +158,6 @@ message Response { ResponseEcho echo = 2; ResponseFlush flush = 3; ResponseInfo info = 4; - ResponseSetOption set_option = 5; ResponseInitChain init_chain = 6; ResponseQuery query = 7; ResponseBeginBlock begin_block = 8; @@ -145,7 +169,10 @@ message Response { ResponseOfferSnapshot offer_snapshot = 14; ResponseLoadSnapshotChunk load_snapshot_chunk = 15; ResponseApplySnapshotChunk apply_snapshot_chunk = 16; + ResponsePrepareProposal prepare_proposal = 17; + ResponseProcessProposal process_proposal = 18; } + reserved 5; } // nondeterministic @@ -169,18 +196,10 @@ message ResponseInfo { bytes last_block_app_hash = 5; } -// nondeterministic -message ResponseSetOption { - uint32 code = 1; - // bytes data = 2; - string log = 3; - string info = 4; -} - message ResponseInitChain { - ConsensusParams consensus_params = 1; - repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; - bytes app_hash = 3; + tendermint.types.ConsensusParams consensus_params = 1; + repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; + bytes app_hash = 3; } message ResponseQuery { @@ -234,9 +253,9 @@ message ResponseDeliverTx { } message ResponseEndBlock { - repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable) = false]; - ConsensusParams consensus_param_updates = 2; - repeated Event events = 3 + repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable) = false]; + tendermint.types.ConsensusParams consensus_param_updates = 2; + repeated Event events = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; } @@ -282,31 +301,36 @@ message ResponseApplySnapshotChunk { } } +message ResponsePrepareProposal { + repeated bytes txs = 1; +} + +message ResponseProcessProposal { + ProposalStatus status = 1; + + enum ProposalStatus { + UNKNOWN = 0; + ACCEPT = 1; + REJECT = 2; + } +} + //---------------------------------------- // Misc. -// ConsensusParams contains all consensus-relevant parameters -// that can be adjusted by the abci app -message ConsensusParams { - BlockParams block = 1; - tendermint.types.EvidenceParams evidence = 2; - tendermint.types.ValidatorParams validator = 3; - tendermint.types.VersionParams version = 4; -} - -// BlockParams contains limits on the block size. -message BlockParams { - // Note: must be greater than 0 - int64 max_bytes = 1; - // Note: must be greater or equal to -1 - int64 max_gas = 2; -} - -message LastCommitInfo { +message CommitInfo { int32 round = 1; repeated VoteInfo votes = 2 [(gogoproto.nullable) = false]; } +message ExtendedCommitInfo { + // The round at which the block proposer decided in the previous height. + int32 round = 1; + // List of validators' addresses in the last validator set with their voting + // information, including vote extensions. + repeated ExtendedVoteInfo votes = 2 [(gogoproto.nullable) = false]; +} + // Event allows application developers to attach additional information to // ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. // Later, transactions may be queried using these events. @@ -320,9 +344,9 @@ message Event { // EventAttribute is a single key-value pair, associated with an event. message EventAttribute { - bytes key = 1; - bytes value = 2; - bool index = 3; // nondeterministic + string key = 1; + string value = 2; + bool index = 3; // nondeterministic } // TxResult contains results of executing the transaction. @@ -357,14 +381,20 @@ message VoteInfo { bool signed_last_block = 2; } -enum EvidenceType { +message ExtendedVoteInfo { + Validator validator = 1 [(gogoproto.nullable) = false]; + bool signed_last_block = 2; + bytes vote_extension = 3; // Reserved for future use +} + +enum MisbehaviorType { UNKNOWN = 0; DUPLICATE_VOTE = 1; LIGHT_CLIENT_ATTACK = 2; } -message Evidence { - EvidenceType type = 1; +message Misbehavior { + MisbehaviorType type = 1; // The offending validator Validator validator = 2 [(gogoproto.nullable) = false]; // The height when the offense occurred @@ -396,7 +426,6 @@ service ABCIApplication { rpc Echo(RequestEcho) returns (ResponseEcho); rpc Flush(RequestFlush) returns (ResponseFlush); rpc Info(RequestInfo) returns (ResponseInfo); - rpc SetOption(RequestSetOption) returns (ResponseSetOption); rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); rpc Query(RequestQuery) returns (ResponseQuery); @@ -410,4 +439,6 @@ service ABCIApplication { returns (ResponseLoadSnapshotChunk); rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk); + rpc PrepareProposal(RequestPrepareProposal) returns (ResponsePrepareProposal); + rpc ProcessProposal(RequestProcessProposal) returns (ResponseProcessProposal); } diff --git a/third_party/proto/tendermint/blocksync/types.proto b/third_party/proto/tendermint/blocksync/types.proto new file mode 100644 index 00000000..f33d2697 --- /dev/null +++ b/third_party/proto/tendermint/blocksync/types.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; +package tendermint.blocksync; + +option go_package = "github.com/cometbft/cometbft/proto/tendermint/blocksync"; + +import "tendermint/types/block.proto"; + +// BlockRequest requests a block for a specific height +message BlockRequest { + int64 height = 1; +} + +// NoBlockResponse informs the node that the peer does not have block at the requested height +message NoBlockResponse { + int64 height = 1; +} + +// BlockResponse returns block to the requested +message BlockResponse { + tendermint.types.Block block = 1; +} + +// StatusRequest requests the status of a peer. +message StatusRequest { +} + +// StatusResponse is a peer response to inform their status. +message StatusResponse { + int64 height = 1; + int64 base = 2; +} + +message Message { + oneof sum { + BlockRequest block_request = 1; + NoBlockResponse no_block_response = 2; + BlockResponse block_response = 3; + StatusRequest status_request = 4; + StatusResponse status_response = 5; + } +} diff --git a/third_party/proto/tendermint/consensus/types.proto b/third_party/proto/tendermint/consensus/types.proto index 5048f854..542bdc19 100644 --- a/third_party/proto/tendermint/consensus/types.proto +++ b/third_party/proto/tendermint/consensus/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.consensus; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/consensus"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/consensus"; import "gogoproto/gogo.proto"; import "tendermint/types/types.proto"; diff --git a/third_party/proto/tendermint/consensus/wal.proto b/third_party/proto/tendermint/consensus/wal.proto index 44afa2c0..fafcf11f 100644 --- a/third_party/proto/tendermint/consensus/wal.proto +++ b/third_party/proto/tendermint/consensus/wal.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.consensus; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/consensus"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/consensus"; import "gogoproto/gogo.proto"; import "tendermint/consensus/types.proto"; diff --git a/third_party/proto/tendermint/crypto/keys.proto b/third_party/proto/tendermint/crypto/keys.proto index 5b94ddae..8fa192fa 100644 --- a/third_party/proto/tendermint/crypto/keys.proto +++ b/third_party/proto/tendermint/crypto/keys.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.crypto; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/crypto"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/tendermint/crypto/proof.proto b/third_party/proto/tendermint/crypto/proof.proto index 975df768..ae72195e 100644 --- a/third_party/proto/tendermint/crypto/proof.proto +++ b/third_party/proto/tendermint/crypto/proof.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.crypto; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/crypto"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/tendermint/libs/bits/types.proto b/third_party/proto/tendermint/libs/bits/types.proto index 3111d113..e6afc5e8 100644 --- a/third_party/proto/tendermint/libs/bits/types.proto +++ b/third_party/proto/tendermint/libs/bits/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.libs.bits; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/libs/bits"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/libs/bits"; message BitArray { int64 bits = 1; diff --git a/third_party/proto/tendermint/mempool/types.proto b/third_party/proto/tendermint/mempool/types.proto index b55d9717..60bafff0 100644 --- a/third_party/proto/tendermint/mempool/types.proto +++ b/third_party/proto/tendermint/mempool/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.mempool; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/mempool"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/mempool"; message Txs { repeated bytes txs = 1; diff --git a/third_party/proto/tendermint/p2p/conn.proto b/third_party/proto/tendermint/p2p/conn.proto index b12de6c8..a7de695a 100644 --- a/third_party/proto/tendermint/p2p/conn.proto +++ b/third_party/proto/tendermint/p2p/conn.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.p2p; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/p2p"; import "gogoproto/gogo.proto"; import "tendermint/crypto/keys.proto"; diff --git a/third_party/proto/tendermint/p2p/pex.proto b/third_party/proto/tendermint/p2p/pex.proto index dfe238db..21918666 100644 --- a/third_party/proto/tendermint/p2p/pex.proto +++ b/third_party/proto/tendermint/p2p/pex.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.p2p; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/p2p"; import "tendermint/p2p/types.proto"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/tendermint/p2p/types.proto b/third_party/proto/tendermint/p2p/types.proto index 0d42ea40..157d8ba1 100644 --- a/third_party/proto/tendermint/p2p/types.proto +++ b/third_party/proto/tendermint/p2p/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.p2p; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/p2p"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/tendermint/privval/types.proto b/third_party/proto/tendermint/privval/types.proto index 0fc8b61d..13190ca4 100644 --- a/third_party/proto/tendermint/privval/types.proto +++ b/third_party/proto/tendermint/privval/types.proto @@ -5,7 +5,7 @@ import "tendermint/crypto/keys.proto"; import "tendermint/types/types.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/privval"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/privval"; enum Errors { ERRORS_UNKNOWN = 0; diff --git a/third_party/proto/tendermint/rpc/grpc/types.proto b/third_party/proto/tendermint/rpc/grpc/types.proto index ee948a40..ad79f048 100644 --- a/third_party/proto/tendermint/rpc/grpc/types.proto +++ b/third_party/proto/tendermint/rpc/grpc/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package tendermint.rpc.grpc; -option go_package = "github.com/tendermint/tendermint/rpc/grpc;coregrpc"; +option go_package = "github.com/cometbft/cometbft/rpc/grpc;coregrpc"; import "tendermint/abci/types.proto"; diff --git a/third_party/proto/tendermint/state/types.proto b/third_party/proto/tendermint/state/types.proto index f3fdc0ef..4f28f0b6 100644 --- a/third_party/proto/tendermint/state/types.proto +++ b/third_party/proto/tendermint/state/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.state; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/state"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/state"; import "gogoproto/gogo.proto"; import "tendermint/abci/types.proto"; diff --git a/third_party/proto/tendermint/statesync/types.proto b/third_party/proto/tendermint/statesync/types.proto index 8d4a714c..eac36b3d 100644 --- a/third_party/proto/tendermint/statesync/types.proto +++ b/third_party/proto/tendermint/statesync/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.statesync; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/statesync"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/statesync"; message Message { oneof sum { diff --git a/third_party/proto/tendermint/store/types.proto b/third_party/proto/tendermint/store/types.proto index af2f97ad..b510169a 100644 --- a/third_party/proto/tendermint/store/types.proto +++ b/third_party/proto/tendermint/store/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.store; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/store"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/store"; message BlockStoreState { int64 base = 1; diff --git a/third_party/proto/tendermint/types/block.proto b/third_party/proto/tendermint/types/block.proto index 84e9bb15..d531c06a 100644 --- a/third_party/proto/tendermint/types/block.proto +++ b/third_party/proto/tendermint/types/block.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "tendermint/types/types.proto"; diff --git a/third_party/proto/tendermint/types/canonical.proto b/third_party/proto/tendermint/types/canonical.proto index e88fd6ff..c4ce1613 100644 --- a/third_party/proto/tendermint/types/canonical.proto +++ b/third_party/proto/tendermint/types/canonical.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "tendermint/types/types.proto"; diff --git a/third_party/proto/tendermint/types/events.proto b/third_party/proto/tendermint/types/events.proto index a1e5cc49..98ce811b 100644 --- a/third_party/proto/tendermint/types/events.proto +++ b/third_party/proto/tendermint/types/events.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; message EventDataRoundState { int64 height = 1; diff --git a/third_party/proto/tendermint/types/evidence.proto b/third_party/proto/tendermint/types/evidence.proto index 451b8dca..1f35049b 100644 --- a/third_party/proto/tendermint/types/evidence.proto +++ b/third_party/proto/tendermint/types/evidence.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; diff --git a/third_party/proto/tendermint/types/params.proto b/third_party/proto/tendermint/types/params.proto index 0de7d846..66963eec 100644 --- a/third_party/proto/tendermint/types/params.proto +++ b/third_party/proto/tendermint/types/params.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; @@ -11,10 +11,10 @@ option (gogoproto.equal_all) = true; // ConsensusParams contains consensus critical parameters that determine the // validity of blocks. message ConsensusParams { - BlockParams block = 1 [(gogoproto.nullable) = false]; - EvidenceParams evidence = 2 [(gogoproto.nullable) = false]; - ValidatorParams validator = 3 [(gogoproto.nullable) = false]; - VersionParams version = 4 [(gogoproto.nullable) = false]; + BlockParams block = 1; + EvidenceParams evidence = 2; + ValidatorParams validator = 3; + VersionParams version = 4; } // BlockParams contains limits on the block size. @@ -25,11 +25,8 @@ message BlockParams { // Max gas per block. // Note: must be greater or equal to -1 int64 max_gas = 2; - // Minimum time increment between consecutive blocks (in milliseconds) If the - // block header timestamp is ahead of the system clock, decrease this value. - // - // Not exposed to the application. - int64 time_iota_ms = 3; + + reserved 3; // was TimeIotaMs see https://github.com/cometbft/cometbft/pull/5792 } // EvidenceParams determine how we handle evidence of malfeasance. @@ -68,7 +65,7 @@ message VersionParams { option (gogoproto.populate) = true; option (gogoproto.equal) = true; - uint64 app_version = 1; + uint64 app = 1; } // HashedParams is a subset of ConsensusParams. diff --git a/third_party/proto/tendermint/types/types.proto b/third_party/proto/tendermint/types/types.proto index 3ce16945..425f041d 100644 --- a/third_party/proto/tendermint/types/types.proto +++ b/third_party/proto/tendermint/types/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; diff --git a/third_party/proto/tendermint/types/validator.proto b/third_party/proto/tendermint/types/validator.proto index 49860b96..3e170262 100644 --- a/third_party/proto/tendermint/types/validator.proto +++ b/third_party/proto/tendermint/types/validator.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "tendermint/crypto/keys.proto"; diff --git a/third_party/proto/tendermint/version/types.proto b/third_party/proto/tendermint/version/types.proto index 6061868b..3b6ef454 100644 --- a/third_party/proto/tendermint/version/types.proto +++ b/third_party/proto/tendermint/version/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.version; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/version"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/version"; import "gogoproto/gogo.proto"; diff --git a/x/auction/genesis_test.go b/x/auction/genesis_test.go index d4413ae1..b8d32399 100644 --- a/x/auction/genesis_test.go +++ b/x/auction/genesis_test.go @@ -8,9 +8,9 @@ import ( "github.com/stretchr/testify/require" sdkmath "cosmossdk.io/math" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/auction" diff --git a/x/auction/keeper/bidding_test.go b/x/auction/keeper/bidding_test.go index 21c6439a..5918e62c 100644 --- a/x/auction/keeper/bidding_test.go +++ b/x/auction/keeper/bidding_test.go @@ -8,9 +8,9 @@ import ( "github.com/stretchr/testify/require" sdkmath "cosmossdk.io/math" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/auction/types" @@ -560,7 +560,7 @@ func TestAuctionBidding(t *testing.T) { if oldBidder.Equals(authtypes.NewModuleAddress(oldAuction.GetInitiator())) { require.Equal(t, oldBidderOldCoins.Add(oldAuction.GetBid()).Add(c("debt", oldAuction.GetBid().Amount.Int64())), bank.GetAllBalances(ctx, oldBidder)) } else if oldBidder.Empty() { - require.Equal(t, oldBidderOldCoins.Add(oldAuction.GetBid()).Add(c("debt", oldAuction.GetBid().Amount.Int64())), oldBidderOldCoins) + require.Equal(t, oldBidderOldCoins.Add(oldAuction.GetBid()).Add(c("debt", oldAuction.GetBid().Amount.Int64())).Empty(), oldBidderOldCoins.Empty()) } else { require.Equal(t, cs(oldBidderOldCoins.Add(oldAuction.GetBid())...), bank.GetAllBalances(ctx, oldBidder)) } diff --git a/x/auction/keeper/grpc_query.go b/x/auction/keeper/grpc_query.go index 3cd62472..be3e7b8c 100644 --- a/x/auction/keeper/grpc_query.go +++ b/x/auction/keeper/grpc_query.go @@ -11,7 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - proto "github.com/gogo/protobuf/proto" + proto "github.com/cosmos/gogoproto/proto" "github.com/kava-labs/kava/x/auction/types" ) diff --git a/x/auction/keeper/grpc_query_test.go b/x/auction/keeper/grpc_query_test.go index 8e7cc357..12a25aec 100644 --- a/x/auction/keeper/grpc_query_test.go +++ b/x/auction/keeper/grpc_query_test.go @@ -7,11 +7,11 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/auction/keeper" "github.com/kava-labs/kava/x/auction/types" "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ) func TestGrpcAuctionsFilter(t *testing.T) { diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 2858a825..4b922ecc 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -10,7 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/tendermint/tendermint/libs/log" + "github.com/cometbft/cometbft/libs/log" "github.com/kava-labs/kava/x/auction/types" ) diff --git a/x/auction/keeper/keeper_test.go b/x/auction/keeper/keeper_test.go index c45bfaf5..16aab50a 100644 --- a/x/auction/keeper/keeper_test.go +++ b/x/auction/keeper/keeper_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/auction/types" diff --git a/x/auction/keeper/querier.go b/x/auction/keeper/querier.go deleted file mode 100644 index 52c600bb..00000000 --- a/x/auction/keeper/querier.go +++ /dev/null @@ -1,157 +0,0 @@ -package keeper - -import ( - "fmt" - - abci "github.com/tendermint/tendermint/abci/types" - - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/kava-labs/kava/x/auction/types" -) - -// NewQuerier is the module level router for state queries -func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(ctx sdk.Context, path []string, req abci.RequestQuery) (res []byte, err error) { - switch path[0] { - case types.QueryGetAuction: - return queryAuction(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetAuctions: - return queryAuctions(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetParams: - return queryGetParams(ctx, req, keeper, legacyQuerierCdc) - case types.QueryNextAuctionID: - return queryNextAuctionID(ctx, req, keeper, legacyQuerierCdc) - default: - return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unknown %s query endpoint", types.ModuleName) - } - } -} - -// query params in the auction store -func queryGetParams(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - // Get params - params := keeper.GetParams(ctx) - - // Encode results - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, params) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -func queryAuction(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryAuctionParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - auction, ok := k.GetAuction(ctx, params.AuctionID) - if !ok { - return nil, errorsmod.Wrap(types.ErrAuctionNotFound, fmt.Sprintf("%d", params.AuctionID)) - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, auction) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryAuctions(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryAllAuctionParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - unfilteredAuctions := k.GetAllAuctions(ctx) - auctions := filterAuctions(ctx, unfilteredAuctions, params, legacyQuerierCdc) - if auctions == nil { - auctions = []types.Auction{} - } - - res, err := codec.MarshalJSONIndent(legacyQuerierCdc, auctions) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return res, nil -} - -func queryNextAuctionID(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - nextAuctionID, _ := keeper.GetNextAuctionID(ctx) - - bz, err := legacyQuerierCdc.MarshalJSON(nextAuctionID) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - return bz, nil -} - -// filterAuctions retrieves auctions filtered by a given set of params. -// If no filters are provided, all auctions will be returned in paginated form. -func filterAuctions(ctx sdk.Context, auctions []types.Auction, params types.QueryAllAuctionParams, legacyQuerierCdc *codec.LegacyAmino) []types.Auction { - filteredAuctions := make([]types.Auction, 0, len(auctions)) - for _, auc := range auctions { - isMatch := auctionIsMatch(auc, params) - if isMatch { - filteredAuctions = append(filteredAuctions, auc) - } - } - - start, end := client.Paginate(len(filteredAuctions), params.Page, params.Limit, 100) - if start < 0 || end < 0 { - filteredAuctions = []types.Auction{} - } else { - filteredAuctions = filteredAuctions[start:end] - } - - return filteredAuctions -} - -func auctionIsMatch(auc types.Auction, params types.QueryAllAuctionParams) bool { - matchType, matchOwner, matchDenom, matchPhase := true, true, true, true - - // match auction type (if supplied) - if len(params.Type) > 0 { - matchType = auc.GetType() == params.Type - } - - // match auction owner (if supplied) - if len(params.Owner) > 0 { - if cAuc, ok := auc.(*types.CollateralAuction); ok { - foundOwnerAddr := false - for _, addr := range cAuc.GetLotReturns().Addresses { - if addr.Equals(params.Owner) { - foundOwnerAddr = true - break - } - } - if !foundOwnerAddr { - matchOwner = false - } - } - } - - // match auction denom (if supplied) - if len(params.Denom) > 0 { - matchDenom = auc.GetBid().Denom == params.Denom || auc.GetLot().Denom == params.Denom - } - - // match auction phase (if supplied) - if len(params.Phase) > 0 { - matchPhase = auc.GetPhase() == params.Phase - } - - if matchType && matchOwner && matchDenom && matchPhase { - return true - } - return false -} diff --git a/x/auction/keeper/querier_test.go b/x/auction/keeper/querier_test.go deleted file mode 100644 index 2d2fcba4..00000000 --- a/x/auction/keeper/querier_test.go +++ /dev/null @@ -1,129 +0,0 @@ -package keeper_test - -import ( - "math/rand" - "strings" - "testing" - - sdkmath "cosmossdk.io/math" - "github.com/stretchr/testify/suite" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/kava-labs/kava/x/auction/keeper" - "github.com/kava-labs/kava/x/auction/testutil" - "github.com/kava-labs/kava/x/auction/types" -) - -const ( - custom = "custom" - TestAuctionCount = 10 -) - -type querierTestSuite struct { - testutil.Suite - - auctions []types.Auction - legacyAmino *codec.LegacyAmino - querier sdk.Querier -} - -func (suite *querierTestSuite) SetupTest() { - suite.Suite.SetupTest(10) - // Populate with auctions - for j := 0; j < TestAuctionCount; j++ { - var id uint64 - var err error - lotAmount := int64(rand.Intn(100-10) + 10) - - // Add coins required for auction creation to module account - suite.AddCoinsToNamedModule(suite.ModAcc.Name, cs(c("token1", lotAmount), c("usdx", 20), c("debt", 10))) - - ownerAddrIndex := rand.Intn(9-1) + 1 - if ownerAddrIndex%2 == 0 { - id, err = suite.Keeper.StartSurplusAuction(suite.Ctx, suite.ModAcc.Name, c("token1", lotAmount), "token2") - } else { - id, err = suite.Keeper.StartCollateralAuction(suite.Ctx, suite.ModAcc.Name, c("token1", lotAmount), c("usdx", int64(20)), - []sdk.AccAddress{suite.Addrs[ownerAddrIndex]}, []sdkmath.Int{sdkmath.NewInt(lotAmount)}, c("debt", int64(10))) - } - suite.NoError(err) - - auc, found := suite.Keeper.GetAuction(suite.Ctx, id) - suite.True(found) - suite.auctions = append(suite.auctions, auc) - } - suite.legacyAmino = suite.App.LegacyAmino() - suite.querier = keeper.NewQuerier(suite.Keeper, suite.legacyAmino) -} - -func TestQuerierTestSuite(t *testing.T) { - suite.Run(t, new(querierTestSuite)) -} - -func (suite *querierTestSuite) assertQuerierResponse(expected interface{}, actual []byte) { - expectedJson, err := suite.legacyAmino.MarshalJSONIndent(expected, "", " ") - suite.Require().NoError(err) - suite.Require().Equal(string(expectedJson), string(actual)) -} - -func (suite *querierTestSuite) TestQueryParams() { - bz, err := suite.querier(suite.Ctx, []string{types.QueryGetParams}, abci.RequestQuery{}) - suite.Require().NoError(err) - suite.Require().NotNil(bz) - - var params types.Params - suite.Require().NoError(suite.legacyAmino.UnmarshalJSON(bz, ¶ms)) - - expectedParams := suite.Keeper.GetParams(suite.Ctx) - suite.Require().Equal(expectedParams, params) -} - -func (suite *querierTestSuite) TestQueryAuction() { - ctx := suite.Ctx.WithIsCheckTx(false) - - // Set up request query - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetAuction}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryAuctionParams(suite.auctions[0].GetID())), - } - - // Execute query and check the []byte result - bz, err := suite.querier(ctx, []string{types.QueryGetAuction}, query) - suite.NoError(err) - suite.NotNil(bz) - suite.assertQuerierResponse(suite.auctions[0], bz) -} - -func (suite *querierTestSuite) TestQueryAuctions() { - ctx := suite.Ctx.WithIsCheckTx(false) - - // Set up request query - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetAuctions}, "/"), - Data: suite.legacyAmino.MustMarshalJSON( - types.NewQueryAllAuctionParams(1, TestAuctionCount, "", "", "", nil), - ), - } - - // Execute query and check the []byte result - bz, err := suite.querier(ctx, []string{types.QueryGetAuctions}, query) - suite.Require().NoError(err) - suite.Require().NotNil(bz) - - suite.assertQuerierResponse(suite.Keeper.GetAllAuctions(suite.Ctx), bz) -} - -func (suite *querierTestSuite) TestQueryNextAuctionID() { - bz, err := suite.querier(suite.Ctx, []string{types.QueryNextAuctionID}, abci.RequestQuery{}) - suite.Require().NoError(err) - suite.Require().NotNil(bz) - - var nextAuctionID uint64 - suite.Require().NoError(suite.legacyAmino.UnmarshalJSON(bz, &nextAuctionID)) - - expectedID, _ := suite.Keeper.GetNextAuctionID(suite.Ctx) - suite.Require().Equal(expectedID, nextAuctionID) -} diff --git a/x/auction/module.go b/x/auction/module.go index af65a4dd..c18b968b 100644 --- a/x/auction/module.go +++ b/x/auction/module.go @@ -13,7 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/kava-labs/kava/x/auction/client/cli" "github.com/kava-labs/kava/x/auction/keeper" @@ -23,7 +23,6 @@ import ( var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - // _ module.AppModuleSimulation = AppModule{} ) // AppModuleBasic implements the sdk.AppModuleBasic interface. @@ -103,21 +102,6 @@ func (AppModule) Name() string { // RegisterInvariants register module invariants func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} -// Route module message route name -func (am AppModule) Route() sdk.Route { - return sdk.Route{} -} - -// QuerierRoute module querier route name -func (AppModule) QuerierRoute() string { - return types.QuerierRoute -} - -// LegacyQuerierHandler returns no sdk.Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return keeper.NewQuerier(am.keeper, legacyQuerierCdc) -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 1 @@ -153,30 +137,3 @@ func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } - -// //____________________________________________________________________________ - -// // GenerateGenesisState creates a randomized GenState of the auction module -// func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState) { -// simulation.RandomizedGenState(simState) -// } - -// // ProposalContents doesn't return any content functions for governance proposals. -// func (AppModuleBasic) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent { -// return nil -// } - -// // RandomizedParams returns nil because auction has no params. -// func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange { -// return simulation.ParamChanges(r) -// } - -// // RegisterStoreDecoder registers a decoder for auction module's types -// func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { -// sdr[StoreKey] = simulation.DecodeStore -// } - -// // WeightedOperations returns the all the auction module operations with their respective weights. -// func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation { -// return simulation.WeightedOperations(simState.AppParams, simState.Cdc, am.accountKeeper, am.keeper) -// } diff --git a/x/auction/simulation/decoder.go b/x/auction/simulation/decoder.go deleted file mode 100644 index a6a58e92..00000000 --- a/x/auction/simulation/decoder.go +++ /dev/null @@ -1,33 +0,0 @@ -package simulation - -import ( - "bytes" - "encoding/binary" - "fmt" - - "github.com/tendermint/tendermint/libs/kv" - - "github.com/cosmos/cosmos-sdk/codec" - - "github.com/kava-labs/kava/x/auction/types" -) - -// DecodeStore unmarshals the KVPair's Value to the corresponding auction type -func DecodeStore(cdc *codec.Codec, kvA, kvB kv.Pair) string { - switch { - case bytes.Equal(kvA.Key[:1], types.AuctionKeyPrefix): - var auctionA, auctionB types.Auction - cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &auctionA) - cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &auctionB) - return fmt.Sprintf("%v\n%v", auctionA, auctionB) - - case bytes.Equal(kvA.Key[:1], types.AuctionByTimeKeyPrefix), - bytes.Equal(kvA.Key[:1], types.NextAuctionIDKey): - auctionIDA := binary.BigEndian.Uint64(kvA.Value) - auctionIDB := binary.BigEndian.Uint64(kvB.Value) - return fmt.Sprintf("%d\n%d", auctionIDA, auctionIDB) - - default: - panic(fmt.Sprintf("invalid %s key prefix %X", types.ModuleName, kvA.Key[:1])) - } -} diff --git a/x/auction/simulation/decoder_test.go b/x/auction/simulation/decoder_test.go deleted file mode 100644 index e46f2a72..00000000 --- a/x/auction/simulation/decoder_test.go +++ /dev/null @@ -1,58 +0,0 @@ -package simulation - -import ( - "fmt" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/tendermint/tendermint/libs/kv" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/kava-labs/kava/x/auction/types" -) - -func makeTestCodec() (cdc *codec.Codec) { - cdc = codec.New() - sdk.RegisterCodec(cdc) - types.RegisterCodec(cdc) - return -} - -func TestDecodeDistributionStore(t *testing.T) { - cdc := makeTestCodec() - - oneCoin := sdk.NewCoin("coin", sdk.OneInt()) - auction := types.NewSurplusAuction("me", oneCoin, "coin", time.Now().UTC()) - - kvPairs := kv.Pairs{ - kv.Pair{Key: types.AuctionKeyPrefix, Value: cdc.MustMarshalBinaryLengthPrefixed(&auction)}, - kv.Pair{Key: types.AuctionByTimeKeyPrefix, Value: sdk.Uint64ToBigEndian(2)}, - kv.Pair{Key: types.NextAuctionIDKey, Value: sdk.Uint64ToBigEndian(10)}, - kv.Pair{Key: []byte{0x99}, Value: []byte{0x99}}, - } - - tests := []struct { - name string - expectedLog string - }{ - {"Auction", fmt.Sprintf("%v\n%v", auction, auction)}, - {"AuctionByTime", "2\n2"}, - {"NextAuctionI", "10\n10"}, - {"other", ""}, - } - for i, tt := range tests { - i, tt := i, tt - t.Run(tt.name, func(t *testing.T) { - switch i { - case len(tests) - 1: - require.Panics(t, func() { DecodeStore(cdc, kvPairs[i], kvPairs[i]) }, tt.name) - default: - require.Equal(t, tt.expectedLog, DecodeStore(cdc, kvPairs[i], kvPairs[i]), tt.name) - } - }) - } -} diff --git a/x/auction/simulation/genesis.go b/x/auction/simulation/genesis.go deleted file mode 100644 index 0f875cbb..00000000 --- a/x/auction/simulation/genesis.go +++ /dev/null @@ -1,173 +0,0 @@ -package simulation - -import ( - "fmt" - "math/rand" - "time" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/x/auth" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/cosmos/cosmos-sdk/x/supply" - - "github.com/kava-labs/kava/x/auction/types" - cdptypes "github.com/kava-labs/kava/x/cdp/types" -) - -const ( - // Block time params are un-exported constants in cosmos-sdk/x/simulation. - // Copy them here in lieu of importing them. - minTimePerBlock time.Duration = (10000 / 2) * time.Second - maxTimePerBlock time.Duration = 10000 * time.Second - - // Calculate the average block time - AverageBlockTime time.Duration = (maxTimePerBlock - minTimePerBlock) / 2 - // MaxBidDuration is a crude way of ensuring that BidDuration ≤ MaxAuctionDuration for all generated params - MaxBidDuration time.Duration = AverageBlockTime * 50 -) - -func GenBidDuration(r *rand.Rand) time.Duration { - d, err := RandomPositiveDuration(r, 0, MaxBidDuration) - if err != nil { - panic(err) - } - return d -} - -func GenMaxAuctionDuration(r *rand.Rand) time.Duration { - d, err := RandomPositiveDuration(r, MaxBidDuration, AverageBlockTime*200) - if err != nil { - panic(err) - } - return d -} - -func GenIncrementCollateral(r *rand.Rand) sdk.Dec { - return simulation.RandomDecAmount(r, sdk.MustNewDecFromStr("1")) -} - -var ( - GenIncrementDebt = GenIncrementCollateral - GenIncrementSurplus = GenIncrementCollateral -) - -// RandomizedGenState generates a random GenesisState for auction -func RandomizedGenState(simState *module.SimulationState) { - p := types.NewParams( - GenMaxAuctionDuration(simState.Rand), - GenBidDuration(simState.Rand), - GenIncrementSurplus(simState.Rand), - GenIncrementDebt(simState.Rand), - GenIncrementCollateral(simState.Rand), - ) - if err := p.Validate(); err != nil { - panic(err) - } - auctionGenesis := types.NewGenesisState( - types.DefaultNextAuctionID, - p, - nil, - ) - - // Add auctions - auctions := types.GenesisAuctions{ - types.NewDebtAuction( - cdptypes.LiquidatorMacc, // using cdp account rather than generic test one to avoid having to set permissions on the supply keeper - sdk.NewInt64Coin("usdx", 100), - sdk.NewInt64Coin("ukava", 1000000000000), - simState.GenTimestamp.Add(time.Hour*5), - sdk.NewInt64Coin("debt", 100), // same as usdx - ), - } - startingID := auctionGenesis.NextAuctionID - var ok bool - var totalAuctionCoins sdk.Coins - for i, a := range auctions { - auctions[i], ok = a.WithID(uint64(i) + startingID).(types.GenesisAuction) - if !ok { - panic("can't convert Auction to GenesisAuction") - } - totalAuctionCoins = totalAuctionCoins.Add(a.GetModuleAccountCoins()...) - } - auctionGenesis.NextAuctionID = startingID + uint64(len(auctions)) - auctionGenesis.Auctions = append(auctionGenesis.Auctions, auctions...) - - // Also need to update the auction module account (to reflect the coins held in the auctions) - var authGenesis auth.GenesisState - simState.Cdc.MustUnmarshalJSON(simState.GenState[auth.ModuleName], &authGenesis) - - auctionModAcc, found := getAccount(authGenesis.Accounts, supply.NewModuleAddress(types.ModuleName)) - if !found { - auctionModAcc = supply.NewEmptyModuleAccount(types.ModuleName) - } - if err := auctionModAcc.SetCoins(totalAuctionCoins); err != nil { - panic(err) - } - authGenesis.Accounts = replaceOrAppendAccount(authGenesis.Accounts, auctionModAcc) - - // TODO adding bidder coins as well - this should be moved elsewhere - bidder, found := getAccount(authGenesis.Accounts, simState.Accounts[0].Address) // 0 is the bidder // FIXME - if !found { - panic("bidder not found") - } - bidderCoins := sdk.NewCoins(sdk.NewInt64Coin("usdx", 10000000000)) - if err := bidder.SetCoins(bidder.GetCoins().Add(bidderCoins...)); err != nil { - panic(err) - } - authGenesis.Accounts = replaceOrAppendAccount(authGenesis.Accounts, bidder) - - simState.GenState[auth.ModuleName] = simState.Cdc.MustMarshalJSON(authGenesis) - - // Update the supply genesis state to reflect the new coins - // TODO find some way for this to happen automatically / move it elsewhere - var supplyGenesis supply.GenesisState - simState.Cdc.MustUnmarshalJSON(simState.GenState[supply.ModuleName], &supplyGenesis) - supplyGenesis.Supply = supplyGenesis.Supply.Add(totalAuctionCoins...).Add(bidderCoins...) - simState.GenState[supply.ModuleName] = simState.Cdc.MustMarshalJSON(supplyGenesis) - - // TODO liquidator mod account doesn't need to be initialized for this example - // - it just mints kava, doesn't need a starting balance - // - and supply.GetModuleAccount creates one if it doesn't exist - - // Note: this line prints out the auction genesis state, not just the auction parameters. Some sdk modules print out just the parameters. - fmt.Printf("Selected randomly generated %s parameters:\n%s\n", types.ModuleName, codec.MustMarshalJSONIndent(simState.Cdc, auctionGenesis)) - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(auctionGenesis) -} - -// Return an account from a list of accounts that matches an address. -func getAccount(accounts []authexported.GenesisAccount, addr sdk.AccAddress) (authexported.GenesisAccount, bool) { - for _, a := range accounts { - if a.GetAddress().Equals(addr) { - return a, true - } - } - return nil, false -} - -// In a list of accounts, replace the first account found with the same address. If not found, append the account. -func replaceOrAppendAccount(accounts []authexported.GenesisAccount, acc authexported.GenesisAccount) []authexported.GenesisAccount { - newAccounts := accounts - for i, a := range accounts { - if a.GetAddress().Equals(acc.GetAddress()) { - newAccounts[i] = acc - return newAccounts - } - } - return append(newAccounts, acc) -} - -func RandomPositiveDuration(r *rand.Rand, inclusiveMin, exclusiveMax time.Duration) (time.Duration, error) { - min := int64(inclusiveMin) - max := int64(exclusiveMax) - if min < 0 || max < 0 { - return 0, fmt.Errorf("min and max must be positive") - } - if min >= max { - return 0, fmt.Errorf("max must be < min") - } - randPositiveInt64 := r.Int63n(max-min) + min - return time.Duration(randPositiveInt64), nil -} diff --git a/x/auction/simulation/go.mod b/x/auction/simulation/go.mod deleted file mode 100644 index e69de29b..00000000 diff --git a/x/auction/simulation/operations.go b/x/auction/simulation/operations.go deleted file mode 100644 index 08c8aa2f..00000000 --- a/x/auction/simulation/operations.go +++ /dev/null @@ -1,251 +0,0 @@ -package simulation - -import ( - "errors" - "fmt" - "math/big" - "math/rand" - "time" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/simapp/helpers" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" - "github.com/cosmos/cosmos-sdk/x/simulation" - - appparams "github.com/kava-labs/kava/app/params" - "github.com/kava-labs/kava/x/auction/keeper" - "github.com/kava-labs/kava/x/auction/types" -) - -var ( - errorNotEnoughCoins = errors.New("account doesn't have enough coins") - errorCantReceiveBids = errors.New("auction can't receive bids (lot = 0 in reverse auction)") -) - -// Simulation operation weights constants -const ( - OpWeightMsgPlaceBid = "op_weight_msg_place_bid" -) - -// WeightedOperations returns all the operations from the module with their respective weights -func WeightedOperations( - appParams simulation.AppParams, cdc *codec.Codec, ak auth.AccountKeeper, k keeper.Keeper, -) simulation.WeightedOperations { - var weightMsgPlaceBid int - - appParams.GetOrGenerate(cdc, OpWeightMsgPlaceBid, &weightMsgPlaceBid, nil, - func(_ *rand.Rand) { - weightMsgPlaceBid = appparams.DefaultWeightMsgPlaceBid - }, - ) - - return simulation.WeightedOperations{ - simulation.NewWeightedOperation( - weightMsgPlaceBid, - SimulateMsgPlaceBid(ak, k), - ), - } -} - -// SimulateMsgPlaceBid returns a function that runs a random state change on the module keeper. -// There's two error paths -// - return a OpMessage, but nil error - this will log a message but keep running the simulation -// - return an error - this will stop the simulation -func SimulateMsgPlaceBid(ak auth.AccountKeeper, keeper keeper.Keeper) simulation.Operation { - return func( - r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, - ) (simulation.OperationMsg, []simulation.FutureOperation, error) { - // get open auctions - openAuctions := types.Auctions{} - keeper.IterateAuctions(ctx, func(a types.Auction) bool { - openAuctions = append(openAuctions, a) - return false - }) - - // shuffle auctions slice so that bids are evenly distributed across auctions - r.Shuffle(len(openAuctions), func(i, j int) { - openAuctions[i], openAuctions[j] = openAuctions[j], openAuctions[i] - }) - - // search through auctions and accounts to find a pair where a bid can be placed (ie account has enough coins to place bid on auction) - blockTime := ctx.BlockHeader().Time - params := keeper.GetParams(ctx) - bidder, openAuction, found := findValidAccountAuctionPair(accs, openAuctions, func(acc simulation.Account, auc types.Auction) bool { - account := ak.GetAccount(ctx, acc.Address) - _, err := generateBidAmount(r, params, auc, account, blockTime) - if err == errorNotEnoughCoins || err == errorCantReceiveBids { - return false // keep searching - } else if err != nil { - panic(err) // raise errors - } - return true // found valid pair - }) - if !found { - return simulation.NewOperationMsgBasic(types.ModuleName, "no-operation (no valid auction and bidder)", "", false, nil), nil, nil - } - - bidderAcc := ak.GetAccount(ctx, bidder.Address) - if bidderAcc == nil { - return simulation.NoOpMsg(types.ModuleName), nil, fmt.Errorf("couldn't find account %s", bidder.Address) - } - - // pick a bid amount for the chosen auction and bidder - amount, err := generateBidAmount(r, params, openAuction, bidderAcc, blockTime) - if err != nil { // shouldn't happen given the checks above - return simulation.NoOpMsg(types.ModuleName), nil, err - } - - // create and deliver a tx - msg := types.NewMsgPlaceBid(openAuction.GetID(), bidder.Address, amount) - - tx := helpers.GenTx( - []sdk.Msg{msg}, - sdk.NewCoins(), // TODO pick a random amount fees - helpers.DefaultGenTxGas, - chainID, - []uint64{bidderAcc.GetAccountNumber()}, - []uint64{bidderAcc.GetSequence()}, - bidder.PrivKey, - ) - - _, _, err = app.Deliver(tx) - if err != nil { - // to aid debugging, add the stack trace to the comment field of the returned opMsg - return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err - } - return simulation.NewOperationMsg(msg, true, ""), nil, nil - } -} - -func generateBidAmount( - r *rand.Rand, params types.Params, auc types.Auction, - bidder authexported.Account, blockTime time.Time, -) (sdk.Coin, error) { - bidderBalance := bidder.SpendableCoins(blockTime) - - switch a := auc.(type) { - - case types.DebtAuction: - // Check bidder has enough (stable coin) to pay in - if bidderBalance.AmountOf(a.Bid.Denom).LT(a.Bid.Amount) { // stable coin - return sdk.Coin{}, errorNotEnoughCoins - } - // Check auction can still receive new bids - if a.Lot.Amount.Equal(sdk.ZeroInt()) { - return sdk.Coin{}, errorCantReceiveBids - } - // Generate a new lot amount (gov coin) - maxNewLotAmt := a.Lot.Amount.Sub( // new lot must be some % less than old lot, and at least 1 smaller to avoid replacing an old bid at no cost - sdk.MaxInt( - sdkmath.NewInt(1), - sdk.NewDecFromInt(a.Lot.Amount).Mul(params.IncrementDebt).RoundInt(), - ), - ) - amt, err := RandIntInclusive(r, sdk.ZeroInt(), maxNewLotAmt) // maxNewLotAmt shouldn't be < 0 given the check above - if err != nil { - panic(err) - } - return sdk.NewCoin(a.Lot.Denom, amt), nil // gov coin - - case types.SurplusAuction: - // Check the bidder has enough (gov coin) to pay in - minNewBidAmt := a.Bid.Amount.Add( // new bids must be some % greater than old bid, and at least 1 larger to avoid replacing an old bid at no cost - sdk.MaxInt( - sdkmath.NewInt(1), - sdk.NewDecFromInt(a.Bid.Amount).Mul(params.IncrementSurplus).RoundInt(), - ), - ) - if bidderBalance.AmountOf(a.Bid.Denom).LT(minNewBidAmt) { // gov coin - return sdk.Coin{}, errorNotEnoughCoins - } - // Generate a new bid amount (gov coin) - amt, err := RandIntInclusive(r, minNewBidAmt, bidderBalance.AmountOf(a.Bid.Denom)) - if err != nil { - panic(err) - } - return sdk.NewCoin(a.Bid.Denom, amt), nil // gov coin - - case types.CollateralAuction: - // Check the bidder has enough (stable coin) to pay in - minNewBidAmt := a.Bid.Amount.Add( // new bids must be some % greater than old bid, and at least 1 larger to avoid replacing an old bid at no cost - sdk.MaxInt( - sdkmath.NewInt(1), - sdk.NewDecFromInt(a.Bid.Amount).Mul(params.IncrementCollateral).RoundInt(), - ), - ) - minNewBidAmt = sdk.MinInt(minNewBidAmt, a.MaxBid.Amount) // allow new bids to hit MaxBid even though it may be less than the increment % - if bidderBalance.AmountOf(a.Bid.Denom).LT(minNewBidAmt) { - return sdk.Coin{}, errorNotEnoughCoins - } - // Check auction can still receive new bids - if a.IsReversePhase() && a.Lot.Amount.Equal(sdk.ZeroInt()) { - return sdk.Coin{}, errorCantReceiveBids - } - // Generate a new bid amount (collateral coin in reverse phase) - if a.IsReversePhase() { - maxNewLotAmt := a.Lot.Amount.Sub( // new lot must be some % less than old lot, and at least 1 smaller to avoid replacing an old bid at no cost - sdk.MaxInt( - sdkmath.NewInt(1), - sdk.NewDecFromInt(a.Lot.Amount).Mul(params.IncrementCollateral).RoundInt(), - ), - ) - amt, err := RandIntInclusive(r, sdk.ZeroInt(), maxNewLotAmt) // maxNewLotAmt shouldn't be < 0 given the check above - if err != nil { - panic(err) - } - return sdk.NewCoin(a.Lot.Denom, amt), nil // collateral coin - - // Generate a new bid amount (stable coin in forward phase) - } else { - amt, err := RandIntInclusive(r, minNewBidAmt, sdk.MinInt(bidderBalance.AmountOf(a.Bid.Denom), a.MaxBid.Amount)) - if err != nil { - panic(err) - } - // when the bidder has enough coins, pick the MaxBid amount more frequently to increase chance auctions phase get into reverse phase - if r.Intn(2) == 0 && bidderBalance.AmountOf(a.Bid.Denom).GTE(a.MaxBid.Amount) { // 50% - amt = a.MaxBid.Amount - } - return sdk.NewCoin(a.Bid.Denom, amt), nil // stable coin - } - - default: - return sdk.Coin{}, fmt.Errorf("unknown auction type") - } -} - -// findValidAccountAuctionPair finds an auction and account for which the callback func returns true -func findValidAccountAuctionPair(accounts []simulation.Account, auctions types.Auctions, cb func(simulation.Account, types.Auction) bool) (simulation.Account, types.Auction, bool) { - for _, auc := range auctions { - for _, acc := range accounts { - if isValid := cb(acc, auc); isValid { - return acc, auc, true - } - } - } - return simulation.Account{}, nil, false -} - -// RandIntInclusive randomly generates an sdkmath.Int in the range [inclusiveMin, inclusiveMax]. It works for negative and positive integers. -func RandIntInclusive(r *rand.Rand, inclusiveMin, inclusiveMax sdkmath.Int) (sdkmath.Int, error) { - if inclusiveMin.GT(inclusiveMax) { - return sdkmath.Int{}, fmt.Errorf("min larger than max") - } - return RandInt(r, inclusiveMin, inclusiveMax.Add(sdk.OneInt())) -} - -// RandInt randomly generates an sdkmath.Int in the range [inclusiveMin, exclusiveMax). It works for negative and positive integers. -func RandInt(r *rand.Rand, inclusiveMin, exclusiveMax sdkmath.Int) (sdkmath.Int, error) { - // validate input - if inclusiveMin.GTE(exclusiveMax) { - return sdkmath.Int{}, fmt.Errorf("min larger or equal to max") - } - // shift the range to start at 0 - shiftedRange := exclusiveMax.Sub(inclusiveMin) // should always be positive given the check above - // randomly pick from the shifted range - shiftedRandInt := sdkmath.NewIntFromBigInt(new(big.Int).Rand(r, shiftedRange.BigInt())) - // shift back to the original range - return shiftedRandInt.Add(inclusiveMin), nil -} diff --git a/x/auction/simulation/params.go b/x/auction/simulation/params.go deleted file mode 100644 index a241c17c..00000000 --- a/x/auction/simulation/params.go +++ /dev/null @@ -1,46 +0,0 @@ -package simulation - -import ( - "fmt" - "math/rand" - - "github.com/cosmos/cosmos-sdk/x/simulation" - - "github.com/kava-labs/kava/x/auction/types" -) - -// ParamChanges defines the parameters that can be modified by param change proposals -// on the simulation -func ParamChanges(r *rand.Rand) []simulation.ParamChange { - // Note: params are encoded to JSON before being stored in the param store. These param changes - // update the raw values in the store so values need to be JSON. This is why values that are represented - // as strings in JSON (such as time.Duration) have the escaped quotes. - // TODO should we encode the values properly with ModuleCdc.MustMarshalJSON()? - return []simulation.ParamChange{ - simulation.NewSimParamChange(types.ModuleName, string(types.KeyBidDuration), - func(r *rand.Rand) string { - return fmt.Sprintf("%d", GenBidDuration(r)) - }, - ), - simulation.NewSimParamChange(types.ModuleName, string(types.KeyMaxAuctionDuration), - func(r *rand.Rand) string { - return fmt.Sprintf("%d", GenMaxAuctionDuration(r)) - }, - ), - simulation.NewSimParamChange(types.ModuleName, string(types.KeyIncrementCollateral), - func(r *rand.Rand) string { - return fmt.Sprintf("%d", GenIncrementCollateral(r)) - }, - ), - simulation.NewSimParamChange(types.ModuleName, string(types.KeyIncrementDebt), - func(r *rand.Rand) string { - return fmt.Sprintf("%d", GenIncrementDebt(r)) - }, - ), - simulation.NewSimParamChange(types.ModuleName, string(types.KeyIncrementSurplus), - func(r *rand.Rand) string { - return fmt.Sprintf("%d", GenIncrementSurplus(r)) - }, - ), - } -} diff --git a/x/auction/testutil/suite.go b/x/auction/testutil/suite.go index 68dda6b2..d4373c4d 100644 --- a/x/auction/testutil/suite.go +++ b/x/auction/testutil/suite.go @@ -6,8 +6,8 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" diff --git a/x/auction/types/auction.pb.go b/x/auction/types/auction.pb.go index 9ac38369..8e7191d1 100644 --- a/x/auction/types/auction.pb.go +++ b/x/auction/types/auction.pb.go @@ -8,9 +8,9 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -317,7 +317,7 @@ func (m *BaseAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.MaxEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.MaxEndTime):]) + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.MaxEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.MaxEndTime):]) if err1 != nil { return 0, err1 } @@ -325,7 +325,7 @@ func (m *BaseAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAuction(dAtA, i, uint64(n1)) i-- dAtA[i] = 0x42 - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) if err2 != nil { return 0, err2 } @@ -605,9 +605,9 @@ func (m *BaseAuction) Size() (n int) { if m.HasReceivedBids { n += 2 } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime) n += 1 + l + sovAuction(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.MaxEndTime) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.MaxEndTime) n += 1 + l + sovAuction(uint64(l)) return n } @@ -909,7 +909,7 @@ func (m *BaseAuction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -942,7 +942,7 @@ func (m *BaseAuction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.MaxEndTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.MaxEndTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/auction/types/auctions.go b/x/auction/types/auctions.go index 6dca2b75..73fcb9cf 100644 --- a/x/auction/types/auctions.go +++ b/x/auction/types/auctions.go @@ -9,7 +9,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/gogo/protobuf/proto" + "github.com/cosmos/gogoproto/proto" ) const ( diff --git a/x/auction/types/genesis.pb.go b/x/auction/types/genesis.pb.go index f70dbfe7..d47b786a 100644 --- a/x/auction/types/genesis.pb.go +++ b/x/auction/types/genesis.pb.go @@ -8,9 +8,9 @@ import ( _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" @@ -230,7 +230,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ReverseBidDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ReverseBidDuration):]) + n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.ReverseBidDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.ReverseBidDuration):]) if err2 != nil { return 0, err2 } @@ -238,7 +238,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(n2)) i-- dAtA[i] = 0x3a - n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ForwardBidDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ForwardBidDuration):]) + n3, err3 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.ForwardBidDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.ForwardBidDuration):]) if err3 != nil { return 0, err3 } @@ -276,7 +276,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x1a - n4, err4 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxAuctionDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxAuctionDuration):]) + n4, err4 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.MaxAuctionDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MaxAuctionDuration):]) if err4 != nil { return 0, err4 } @@ -324,7 +324,7 @@ func (m *Params) Size() (n int) { } var l int _ = l - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxAuctionDuration) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MaxAuctionDuration) n += 1 + l + sovGenesis(uint64(l)) l = m.IncrementSurplus.Size() n += 1 + l + sovGenesis(uint64(l)) @@ -332,9 +332,9 @@ func (m *Params) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) l = m.IncrementCollateral.Size() n += 1 + l + sovGenesis(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.ForwardBidDuration) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.ForwardBidDuration) n += 1 + l + sovGenesis(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.ReverseBidDuration) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.ReverseBidDuration) n += 1 + l + sovGenesis(uint64(l)) return n } @@ -539,7 +539,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.MaxAuctionDuration, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.MaxAuctionDuration, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -671,7 +671,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.ForwardBidDuration, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.ForwardBidDuration, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -704,7 +704,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.ReverseBidDuration, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.ReverseBidDuration, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/auction/types/keys.go b/x/auction/types/keys.go index b32188d0..6709bbd1 100644 --- a/x/auction/types/keys.go +++ b/x/auction/types/keys.go @@ -19,9 +19,6 @@ const ( // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName - - // QuerierRoute route used for abci queries - QuerierRoute = ModuleName ) // Key prefixes diff --git a/x/auction/types/query.pb.go b/x/auction/types/query.pb.go index ae6fa41f..7a6f9014 100644 --- a/x/auction/types/query.pb.go +++ b/x/auction/types/query.pb.go @@ -8,9 +8,9 @@ import ( fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/x/auction/types/tx.pb.go b/x/auction/types/tx.pb.go index 3d009b3a..2853a56f 100644 --- a/x/auction/types/tx.pb.go +++ b/x/auction/types/tx.pb.go @@ -7,9 +7,9 @@ import ( context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/x/bep3/abci_test.go b/x/bep3/abci_test.go index cbb5bbc2..c07f843f 100644 --- a/x/bep3/abci_test.go +++ b/x/bep3/abci_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/suite" - tmbytes "github.com/tendermint/tendermint/libs/bytes" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmbytes "github.com/cometbft/cometbft/libs/bytes" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/bep3/client/cli/query.go b/x/bep3/client/cli/query.go index 4a45c8e4..fe7bdecc 100644 --- a/x/bep3/client/cli/query.go +++ b/x/bep3/client/cli/query.go @@ -7,11 +7,11 @@ import ( "strconv" "strings" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/x/bep3/types" ) diff --git a/x/bep3/client/cli/tx.go b/x/bep3/client/cli/tx.go index 08c1ebd6..62e3cc00 100644 --- a/x/bep3/client/cli/tx.go +++ b/x/bep3/client/cli/tx.go @@ -14,7 +14,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" - tmtime "github.com/tendermint/tendermint/types/time" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/x/bep3/types" ) diff --git a/x/bep3/genesis_test.go b/x/bep3/genesis_test.go index 530c07ed..c1eb3a15 100644 --- a/x/bep3/genesis_test.go +++ b/x/bep3/genesis_test.go @@ -4,11 +4,11 @@ import ( "testing" "cosmossdk.io/math" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/bep3/keeper" diff --git a/x/bep3/integration_test.go b/x/bep3/integration_test.go index 8c33cc54..332dad70 100644 --- a/x/bep3/integration_test.go +++ b/x/bep3/integration_test.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/bep3/types" diff --git a/x/bep3/keeper/asset_test.go b/x/bep3/keeper/asset_test.go index 8bc5e081..4e8a7835 100644 --- a/x/bep3/keeper/asset_test.go +++ b/x/bep3/keeper/asset_test.go @@ -10,8 +10,8 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/bep3/keeper" diff --git a/x/bep3/keeper/integration_test.go b/x/bep3/keeper/integration_test.go index 2b0e9226..ffe94eb6 100644 --- a/x/bep3/keeper/integration_test.go +++ b/x/bep3/keeper/integration_test.go @@ -8,8 +8,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/tendermint/tendermint/crypto" - tmtime "github.com/tendermint/tendermint/types/time" + "github.com/cometbft/cometbft/crypto" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/bep3/types" diff --git a/x/bep3/keeper/keeper.go b/x/bep3/keeper/keeper.go index 405d8ec2..6a32a81b 100644 --- a/x/bep3/keeper/keeper.go +++ b/x/bep3/keeper/keeper.go @@ -4,12 +4,12 @@ import ( "fmt" "time" + "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/tendermint/tendermint/libs/log" "github.com/kava-labs/kava/x/bep3/types" ) diff --git a/x/bep3/keeper/keeper_test.go b/x/bep3/keeper/keeper_test.go index 04922060..52924720 100644 --- a/x/bep3/keeper/keeper_test.go +++ b/x/bep3/keeper/keeper_test.go @@ -8,8 +8,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/bep3/keeper" diff --git a/x/bep3/keeper/msg_server_test.go b/x/bep3/keeper/msg_server_test.go index 4bf83a0f..badad26c 100644 --- a/x/bep3/keeper/msg_server_test.go +++ b/x/bep3/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/suite" - tmbytes "github.com/tendermint/tendermint/libs/bytes" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmbytes "github.com/cometbft/cometbft/libs/bytes" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/bep3/keeper/params_test.go b/x/bep3/keeper/params_test.go index e09cf106..0f339d44 100644 --- a/x/bep3/keeper/params_test.go +++ b/x/bep3/keeper/params_test.go @@ -8,8 +8,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/bep3/keeper" diff --git a/x/bep3/keeper/querier.go b/x/bep3/keeper/querier.go deleted file mode 100644 index 3791e4ec..00000000 --- a/x/bep3/keeper/querier.go +++ /dev/null @@ -1,187 +0,0 @@ -package keeper - -import ( - abci "github.com/tendermint/tendermint/abci/types" - - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/kava-labs/kava/x/bep3/types" -) - -// NewQuerier is the module level router for state queries -func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(ctx sdk.Context, path []string, req abci.RequestQuery) (res []byte, err error) { - switch path[0] { - case types.QueryGetAssetSupply: - return queryAssetSupply(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetAssetSupplies: - return queryAssetSupplies(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetAtomicSwap: - return queryAtomicSwap(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetAtomicSwaps: - return queryAtomicSwaps(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetParams: - return queryGetParams(ctx, req, keeper, legacyQuerierCdc) - default: - return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unknown %s query endpoint", types.ModuleName) - } - } -} - -func queryAssetSupply(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - // Decode request - var requestParams types.QueryAssetSupply - err := legacyQuerierCdc.UnmarshalJSON(req.Data, &requestParams) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - assetSupply, found := keeper.GetAssetSupply(ctx, requestParams.Denom) - if !found { - return nil, errorsmod.Wrap(types.ErrAssetSupplyNotFound, string(requestParams.Denom)) - } - - // Encode results - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, assetSupply) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -func queryAssetSupplies(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) (res []byte, err error) { - assets := keeper.GetAllAssetSupplies(ctx) - if assets == nil { - assets = types.AssetSupplies{} - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, assets) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -func queryAtomicSwap(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - // Decode request - var requestParams types.QueryAtomicSwapByID - err := legacyQuerierCdc.UnmarshalJSON(req.Data, &requestParams) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - // Lookup atomic swap - atomicSwap, found := keeper.GetAtomicSwap(ctx, requestParams.SwapID) - if !found { - return nil, errorsmod.Wrapf(types.ErrAtomicSwapNotFound, "%d", requestParams.SwapID) - } - - augmentedAtomicSwap := types.NewLegacyAugmentedAtomicSwap(atomicSwap) - - // Encode results - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, augmentedAtomicSwap) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -func queryAtomicSwaps(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryAtomicSwaps - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - unfilteredSwaps := keeper.GetAllAtomicSwaps(ctx) - swaps := filterAtomicSwaps(ctx, unfilteredSwaps, params) - if swaps == nil { - swaps = types.AtomicSwaps{} - } - - augmentedSwaps := types.LegacyAugmentedAtomicSwaps{} - - for _, swap := range swaps { - augmentedSwaps = append(augmentedSwaps, types.NewLegacyAugmentedAtomicSwap(swap)) - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, augmentedSwaps) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -// query params in the bep3 store -func queryGetParams(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - // Get params - params := keeper.GetParams(ctx) - - // Encode results - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, params) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -// filterAtomicSwaps retrieves atomic swaps filtered by a given set of params. -// If no filters are provided, all atomic swaps will be returned in paginated form. -func filterAtomicSwaps(ctx sdk.Context, swaps types.AtomicSwaps, params types.QueryAtomicSwaps) types.AtomicSwaps { - filteredSwaps := make(types.AtomicSwaps, 0, len(swaps)) - - for _, s := range swaps { - if legacyAtomicSwapIsMatch(s, params) { - filteredSwaps = append(filteredSwaps, s) - } - } - - start, end := client.Paginate(len(filteredSwaps), params.Page, params.Limit, 100) - if start < 0 || end < 0 { - filteredSwaps = types.AtomicSwaps{} - } else { - filteredSwaps = filteredSwaps[start:end] - } - - return filteredSwaps -} - -func legacyAtomicSwapIsMatch(swap types.AtomicSwap, params types.QueryAtomicSwaps) bool { - // match involved address (if supplied) - if len(params.Involve) > 0 { - if !swap.Sender.Equals(params.Involve) && !swap.Recipient.Equals(params.Involve) { - return false - } - } - - // match expiration block limit (if supplied) - if params.Expiration > 0 { - if swap.ExpireHeight > params.Expiration { - return false - } - } - - // match status (if supplied/valid) - if params.Status.IsValid() { - if swap.Status != params.Status { - return false - } - } - - // match direction (if supplied/valid) - if params.Direction.IsValid() { - if swap.Direction != params.Direction { - return false - } - } - - return true -} diff --git a/x/bep3/keeper/querier_test.go b/x/bep3/keeper/querier_test.go deleted file mode 100644 index b325b252..00000000 --- a/x/bep3/keeper/querier_test.go +++ /dev/null @@ -1,192 +0,0 @@ -package keeper_test - -import ( - "encoding/hex" - "strings" - "testing" - "time" - - "github.com/stretchr/testify/suite" - - abci "github.com/tendermint/tendermint/abci/types" - tmbytes "github.com/tendermint/tendermint/libs/bytes" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/kava-labs/kava/app" - "github.com/kava-labs/kava/x/bep3/keeper" - "github.com/kava-labs/kava/x/bep3/types" -) - -const ( - custom = "custom" -) - -type QuerierTestSuite struct { - suite.Suite - keeper keeper.Keeper - app app.TestApp - ctx sdk.Context - querier sdk.Querier - addrs []sdk.AccAddress - swapIDs []tmbytes.HexBytes - isSwapID map[string]bool -} - -func (suite *QuerierTestSuite) SetupTest() { - tApp := app.NewTestApp() - ctx := tApp.NewContext(true, tmproto.Header{Height: 1, Time: tmtime.Now()}) - - // Set up auth GenesisState - _, addrs := app.GeneratePrivKeyAddressPairs(11) - coins := sdk.NewCoins(c("bnb", 10000000000), c("ukava", 10000000000)) - authGS := app.NewFundedGenStateWithSameCoins(tApp.AppCodec(), coins, addrs) - - tApp.InitializeFromGenesisStates( - authGS, - NewBep3GenStateMulti(tApp.AppCodec(), addrs[10]), - ) - - suite.ctx = ctx - suite.app = tApp - suite.keeper = tApp.GetBep3Keeper() - suite.querier = keeper.NewQuerier(suite.keeper, tApp.LegacyAmino()) - suite.addrs = addrs - - // Create atomic swaps and save IDs - var swapIDs []tmbytes.HexBytes - isSwapID := make(map[string]bool) - for i := 0; i < 10; i++ { - // Set up atomic swap variables - expireHeight := types.DefaultMinBlockLock - amount := cs(c("bnb", 100)) - timestamp := ts(0) - randomNumber, _ := types.GenerateSecureRandomNumber() - randomNumberHash := types.CalculateRandomHash(randomNumber[:], timestamp) - - // Create atomic swap and check err - err := suite.keeper.CreateAtomicSwap(suite.ctx, randomNumberHash, timestamp, expireHeight, - addrs[10], suite.addrs[i], TestSenderOtherChain, TestRecipientOtherChain, amount, true) - suite.Nil(err) - - // Calculate swap ID and save - swapID := types.CalculateSwapID(randomNumberHash, suite.addrs[10], TestSenderOtherChain) - swapIDs = append(swapIDs, swapID) - isSwapID[hex.EncodeToString(swapID)] = true - } - suite.swapIDs = swapIDs - suite.isSwapID = isSwapID -} - -func (suite *QuerierTestSuite) TestQueryAssetSupply() { - ctx := suite.ctx.WithIsCheckTx(false) - - // Set up request query - denom := "bnb" - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetAssetSupply}, "/"), - Data: types.ModuleCdc.Amino.MustMarshalJSON(types.NewQueryAssetSupply(denom)), - } - - // Execute query and check the []byte result - bz, err := suite.querier(ctx, []string{types.QueryGetAssetSupply}, query) - suite.Nil(err) - suite.NotNil(bz) - - // Unmarshal the bytes into type asset supply - var supply types.AssetSupply - suite.Nil(suite.app.AppCodec().UnmarshalJSON(bz, &supply)) - - expectedSupply := types.NewAssetSupply(c(denom, 1000), - c(denom, 0), c(denom, 0), c(denom, 0), time.Duration(0)) - suite.Equal(supply, expectedSupply) -} - -func (suite *QuerierTestSuite) TestQueryAtomicSwap() { - ctx := suite.ctx.WithIsCheckTx(false) - - // Set up request query - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetAtomicSwap}, "/"), - Data: types.ModuleCdc.LegacyAmino.MustMarshalJSON(types.NewQueryAtomicSwapByID(suite.swapIDs[0])), - } - - // Execute query and check the []byte result - bz, err := suite.querier(ctx, []string{types.QueryGetAtomicSwap}, query) - suite.Nil(err) - suite.NotNil(bz) - - // Unmarshal the bytes into type atomic swap - var swap types.LegacyAugmentedAtomicSwap - suite.Nil(types.ModuleCdc.LegacyAmino.UnmarshalJSON(bz, &swap)) - - // Check the returned atomic swap's ID - suite.True(suite.isSwapID[swap.ID]) -} - -func (suite *QuerierTestSuite) TestQueryAssetSupplies() { - ctx := suite.ctx.WithIsCheckTx(false) - // Set up request query - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetAssetSupplies}, "/"), - Data: types.ModuleCdc.LegacyAmino.MustMarshalJSON(types.NewQueryAssetSupplies(1, 100)), - } - - bz, err := suite.querier(ctx, []string{types.QueryGetAssetSupplies}, query) - suite.Nil(err) - suite.NotNil(bz) - - var supplies types.AssetSupplies - suite.Nil(types.ModuleCdc.LegacyAmino.UnmarshalJSON(bz, &supplies)) - - // Check that returned value matches asset supplies in state - storeSupplies := suite.keeper.GetAllAssetSupplies(ctx) - suite.Equal(len(storeSupplies), len(supplies)) - suite.Equal(supplies, storeSupplies) -} - -func (suite *QuerierTestSuite) TestQueryAtomicSwaps() { - ctx := suite.ctx.WithIsCheckTx(false) - // Set up request query - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetAtomicSwaps}, "/"), - Data: types.ModuleCdc.LegacyAmino.MustMarshalJSON(types.NewQueryAtomicSwaps( - 1, 100, sdk.AccAddress{}, 0, types.SWAP_STATUS_OPEN, types.SWAP_DIRECTION_INCOMING)), - } - - bz, err := suite.querier(ctx, []string{types.QueryGetAtomicSwaps}, query) - suite.Nil(err) - suite.NotNil(bz) - - var swaps types.LegacyAugmentedAtomicSwaps - suite.Nil(types.ModuleCdc.LegacyAmino.UnmarshalJSON(bz, &swaps)) - - suite.Equal(len(suite.swapIDs), len(swaps)) - for _, swap := range swaps { - suite.True(suite.isSwapID[swap.ID]) - } -} - -func (suite *QuerierTestSuite) TestQueryParams() { - ctx := suite.ctx.WithIsCheckTx(false) - bz, err := suite.querier(ctx, []string{types.QueryGetParams}, abci.RequestQuery{}) - suite.Nil(err) - suite.NotNil(bz) - - var p types.Params - // Querier uses LegacyAmino - suite.Nil(suite.app.LegacyAmino().UnmarshalJSON(bz, &p)) - - bep3GenesisState := NewBep3GenStateMulti(suite.app.AppCodec(), suite.addrs[10]) - gs := types.GenesisState{} - // Genesis uses proto codec - suite.app.AppCodec().UnmarshalJSON(bep3GenesisState["bep3"], &gs) - // update asset supply to account for swaps that were created in setup - suite.Equal(gs.Params, p) -} - -func TestQuerierTestSuite(t *testing.T) { - suite.Run(t, new(QuerierTestSuite)) -} diff --git a/x/bep3/keeper/swap_test.go b/x/bep3/keeper/swap_test.go index a5dcc7dd..056a5147 100644 --- a/x/bep3/keeper/swap_test.go +++ b/x/bep3/keeper/swap_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/suite" - tmbytes "github.com/tendermint/tendermint/libs/bytes" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmbytes "github.com/cometbft/cometbft/libs/bytes" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/bep3/legacy/v0_17/migrate_test.go b/x/bep3/legacy/v0_17/migrate_test.go index 8072d7b8..e648f297 100644 --- a/x/bep3/legacy/v0_17/migrate_test.go +++ b/x/bep3/legacy/v0_17/migrate_test.go @@ -7,10 +7,10 @@ import ( "time" sdkmath "cosmossdk.io/math" + "github.com/cometbft/cometbft/libs/bytes" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - "github.com/tendermint/tendermint/libs/bytes" app "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/bep3/types" diff --git a/x/bep3/module.go b/x/bep3/module.go index 6603803f..a2ef32c3 100644 --- a/x/bep3/module.go +++ b/x/bep3/module.go @@ -13,7 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/kava-labs/kava/x/bep3/client/cli" "github.com/kava-labs/kava/x/bep3/keeper" @@ -23,8 +23,6 @@ import ( var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - // TODO: Simulations - // _ module.AppModuleSimulation = AppModule{} ) // AppModuleBasic defines the basic application module used by the bep3 module. @@ -67,11 +65,6 @@ func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } -// LegacyQuerierHandler returns no sdk.Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return keeper.NewQuerier(am.keeper, legacyQuerierCdc) -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 1 @@ -116,16 +109,6 @@ func (AppModule) Name() string { // RegisterInvariants registers the bep3 module invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} -// Route returns the message routing key for the bep3 module. -func (am AppModule) Route() sdk.Route { - return sdk.Route{} -} - -// QuerierRoute returns the bep3 module's querier route name. -func (AppModule) QuerierRoute() string { - return types.QuerierRoute -} - // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) @@ -159,30 +142,3 @@ func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } - -//____________________________________________________________________________ - -// // GenerateGenesisState creates a randomized GenState of the bep3 module -// func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState) { -// simulation.RandomizedGenState(simState) -// } - -// // ProposalContents doesn't return any content functions for governance proposals. -// func (AppModuleBasic) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent { -// return nil -// } - -// // RandomizedParams returns nil because bep3 has no params. -// func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange { -// return simulation.ParamChanges(r) -// } - -// // RegisterStoreDecoder registers a decoder for bep3 module's types -// func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { -// sdr[StoreKey] = simulation.DecodeStore -// } - -// // WeightedOperations returns the all the bep3 module operations with their respective weights. -// func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation { -// return simulation.WeightedOperations(simState.AppParams, simState.Cdc, am.accountKeeper, am.keeper) -// } diff --git a/x/bep3/simulation/decoder.go b/x/bep3/simulation/decoder.go deleted file mode 100644 index ff152b37..00000000 --- a/x/bep3/simulation/decoder.go +++ /dev/null @@ -1,44 +0,0 @@ -package simulation - -import ( - "bytes" - "fmt" - "time" - - tmbytes "github.com/tendermint/tendermint/libs/bytes" - "github.com/tendermint/tendermint/libs/kv" - - "github.com/cosmos/cosmos-sdk/codec" - - "github.com/kava-labs/kava/x/bep3/types" -) - -// DecodeStore unmarshals the KVPair's Value to the module's corresponding type -func DecodeStore(cdc *codec.Codec, kvA, kvB kv.Pair) string { - switch { - case bytes.Equal(kvA.Key[:1], types.AtomicSwapKeyPrefix): - var swapA, swapB types.AtomicSwap - cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &swapA) - cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &swapB) - return fmt.Sprintf("%v\n%v", swapA, swapB) - - case bytes.Equal(kvA.Key[:1], types.AtomicSwapByBlockPrefix), - bytes.Equal(kvA.Key[:1], types.AtomicSwapLongtermStoragePrefix): - var bytesA tmbytes.HexBytes = kvA.Value - var bytesB tmbytes.HexBytes = kvA.Value - return fmt.Sprintf("%s\n%s", bytesA.String(), bytesB.String()) - case bytes.Equal(kvA.Key[:1], types.AssetSupplyPrefix): - var supplyA, supplyB types.AssetSupply - cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &supplyA) - cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &supplyB) - return fmt.Sprintf("%s\n%s", supplyA, supplyB) - case bytes.Equal(kvA.Key[:1], types.PreviousBlockTimeKey): - var timeA, timeB time.Time - cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &timeA) - cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &timeB) - return fmt.Sprintf("%s\n%s", timeA, timeB) - - default: - panic(fmt.Sprintf("invalid %s key prefix %X", types.ModuleName, kvA.Key[:1])) - } -} diff --git a/x/bep3/simulation/decoder_test.go b/x/bep3/simulation/decoder_test.go deleted file mode 100644 index 75a1a2f3..00000000 --- a/x/bep3/simulation/decoder_test.go +++ /dev/null @@ -1,66 +0,0 @@ -package simulation - -import ( - "fmt" - "testing" - "time" - - "github.com/stretchr/testify/require" - - tmbytes "github.com/tendermint/tendermint/libs/bytes" - "github.com/tendermint/tendermint/libs/kv" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/kava-labs/kava/x/bep3/types" -) - -func makeTestCodec() (cdc *codec.Codec) { - cdc = codec.New() - sdk.RegisterCodec(cdc) - types.RegisterCodec(cdc) - return -} - -func TestDecodeBep3Store(t *testing.T) { - cdc := makeTestCodec() - prevBlockTime := time.Now().UTC() - - oneCoin := sdk.NewCoin("coin", sdk.OneInt()) - swap := types.NewAtomicSwap(sdk.Coins{oneCoin}, nil, 10, 100, nil, nil, "otherChainSender", "otherChainRec", 200, types.Completed, true, types.Outgoing) - supply := types.AssetSupply{IncomingSupply: oneCoin, OutgoingSupply: oneCoin, CurrentSupply: oneCoin, TimeLimitedCurrentSupply: oneCoin, TimeElapsed: time.Duration(0)} - bz := tmbytes.HexBytes([]byte{1, 2}) - - kvPairs := kv.Pairs{ - kv.Pair{Key: types.AtomicSwapKeyPrefix, Value: cdc.MustMarshalBinaryLengthPrefixed(swap)}, - kv.Pair{Key: types.AssetSupplyPrefix, Value: cdc.MustMarshalBinaryLengthPrefixed(supply)}, - kv.Pair{Key: types.AtomicSwapByBlockPrefix, Value: bz}, - kv.Pair{Key: types.AtomicSwapByBlockPrefix, Value: bz}, - kv.Pair{Key: types.PreviousBlockTimeKey, Value: cdc.MustMarshalBinaryLengthPrefixed(prevBlockTime)}, - kv.Pair{Key: []byte{0x99}, Value: []byte{0x99}}, - } - - tests := []struct { - name string - expectedLog string - }{ - {"AtomicSwap", fmt.Sprintf("%v\n%v", swap, swap)}, - {"AssetSupply", fmt.Sprintf("%v\n%v", supply, supply)}, - {"AtomicSwapByBlock", fmt.Sprintf("%s\n%s", bz, bz)}, - {"AtomicSwapLongtermStorage", fmt.Sprintf("%s\n%s", bz, bz)}, - {"PreviousBlockTime", fmt.Sprintf("%s\n%s", prevBlockTime, prevBlockTime)}, - {"other", ""}, - } - for i, tt := range tests { - i, tt := i, tt - t.Run(tt.name, func(t *testing.T) { - switch i { - case len(tests) - 1: - require.Panics(t, func() { DecodeStore(cdc, kvPairs[i], kvPairs[i]) }, tt.name) - default: - require.Equal(t, tt.expectedLog, DecodeStore(cdc, kvPairs[i], kvPairs[i]), tt.name) - } - }) - } -} diff --git a/x/bep3/simulation/genesis.go b/x/bep3/simulation/genesis.go deleted file mode 100644 index 441eb4a8..00000000 --- a/x/bep3/simulation/genesis.go +++ /dev/null @@ -1,208 +0,0 @@ -package simulation - -import ( - "fmt" - "math/rand" - "strings" - "time" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/x/auth" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/cosmos/cosmos-sdk/x/supply" - - "github.com/kava-labs/kava/x/bep3/types" -) - -var ( - MaxSupplyLimit = 1000000000000 - MinSupplyLimit = 100000000 - MinSwapAmountLimit = 999 - accs []simulation.Account - ConsistentDenoms = [3]string{"bnb", "xrp", "btc"} - MinBlockLock = uint64(5) -) - -// GenRandBnbDeputy randomized BnbDeputyAddress -func GenRandBnbDeputy(r *rand.Rand) simulation.Account { - acc, _ := simulation.RandomAcc(r, accs) - return acc -} - -// GenRandFixedFee randomized FixedFee in range [1, 10000] -func GenRandFixedFee(r *rand.Rand) sdkmath.Int { - min := int(1) - max := types.DefaultBnbDeputyFixedFee.Int64() - return sdkmath.NewInt(int64(r.Intn(int(max)-min) + min)) -} - -// GenMinSwapAmount randomized MinAmount in range [1, 1000] -func GenMinSwapAmount(r *rand.Rand) sdkmath.Int { - return sdk.OneInt().Add(simulation.RandomAmount(r, sdkmath.NewInt(int64(MinSwapAmountLimit)))) -} - -// GenMaxSwapAmount randomized MaxAmount -func GenMaxSwapAmount(r *rand.Rand, minAmount sdkmath.Int, supplyMax sdkmath.Int) sdkmath.Int { - min := minAmount.Int64() - max := supplyMax.Quo(sdkmath.NewInt(100)).Int64() - - return sdkmath.NewInt((int64(r.Intn(int(max-min))) + min)) -} - -// GenSupplyLimit generates a random SupplyLimit -func GenSupplyLimit(r *rand.Rand, max int) sdkmath.Int { - max = simulation.RandIntBetween(r, MinSupplyLimit, max) - return sdkmath.NewInt(int64(max)) -} - -// GenSupplyLimit generates a random SupplyLimit -func GenAssetSupply(r *rand.Rand, denom string) types.AssetSupply { - return types.NewAssetSupply( - sdk.NewCoin(denom, sdk.ZeroInt()), sdk.NewCoin(denom, sdk.ZeroInt()), - sdk.NewCoin(denom, sdk.ZeroInt()), sdk.NewCoin(denom, sdk.ZeroInt()), time.Duration(0)) -} - -// GenMinBlockLock randomized MinBlockLock -func GenMinBlockLock(r *rand.Rand) uint64 { - return MinBlockLock -} - -// GenMaxBlockLock randomized MaxBlockLock -func GenMaxBlockLock(r *rand.Rand, minBlockLock uint64) uint64 { - max := int(50) - return uint64(r.Intn(max-int(MinBlockLock)) + int(MinBlockLock+1)) -} - -// GenSupportedAssets gets randomized SupportedAssets -func GenSupportedAssets(r *rand.Rand) types.AssetParams { - numAssets := (r.Intn(10) + 1) - assets := make(types.AssetParams, numAssets+1) - for i := 0; i < numAssets; i++ { - denom := strings.ToLower(simulation.RandStringOfLength(r, (r.Intn(3) + 3))) - asset := genSupportedAsset(r, denom) - assets[i] = asset - } - // Add bnb, btc, or xrp as a supported asset for interactions with other modules - assets[len(assets)-1] = genSupportedAsset(r, ConsistentDenoms[r.Intn(3)]) - - return assets -} - -func genSupportedAsset(r *rand.Rand, denom string) types.AssetParam { - coinID, _ := simulation.RandPositiveInt(r, sdkmath.NewInt(100000)) - limit := GenSupplyLimit(r, MaxSupplyLimit) - - minSwapAmount := GenMinSwapAmount(r) - minBlockLock := GenMinBlockLock(r) - timeLimited := r.Float32() < 0.5 - timeBasedLimit := sdk.ZeroInt() - if timeLimited { - // set time-based limit to between 10 and 25% of the total limit - min := int(limit.Quo(sdkmath.NewInt(10)).Int64()) - max := int(limit.Quo(sdkmath.NewInt(4)).Int64()) - timeBasedLimit = sdkmath.NewInt(int64(simulation.RandIntBetween(r, min, max))) - } - return types.AssetParam{ - Denom: denom, - CoinID: int(coinID.Int64()), - SupplyLimit: types.SupplyLimit{ - Limit: limit, - TimeLimited: timeLimited, - TimePeriod: time.Hour * 24, - TimeBasedLimit: timeBasedLimit, - }, - Active: true, - DeputyAddress: GenRandBnbDeputy(r).Address, - FixedFee: GenRandFixedFee(r), - MinSwapAmount: minSwapAmount, - MaxSwapAmount: GenMaxSwapAmount(r, minSwapAmount, limit), - MinBlockLock: minBlockLock, - MaxBlockLock: GenMaxBlockLock(r, minBlockLock), - } -} - -// RandomizedGenState generates a random GenesisState -func RandomizedGenState(simState *module.SimulationState) { - accs = simState.Accounts - - bep3Genesis := loadRandomBep3GenState(simState) - fmt.Printf("Selected randomly generated %s parameters:\n%s\n", types.ModuleName, codec.MustMarshalJSONIndent(simState.Cdc, bep3Genesis)) - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(bep3Genesis) - - authGenesis, totalCoins := loadAuthGenState(simState, bep3Genesis) - simState.GenState[auth.ModuleName] = simState.Cdc.MustMarshalJSON(authGenesis) - - // Update supply to match amount of coins in auth - var supplyGenesis supply.GenesisState - simState.Cdc.MustUnmarshalJSON(simState.GenState[supply.ModuleName], &supplyGenesis) - - for _, deputyCoin := range totalCoins { - supplyGenesis.Supply = supplyGenesis.Supply.Add(deputyCoin...) - } - simState.GenState[supply.ModuleName] = simState.Cdc.MustMarshalJSON(supplyGenesis) -} - -func loadRandomBep3GenState(simState *module.SimulationState) types.GenesisState { - supportedAssets := GenSupportedAssets(simState.Rand) - supplies := types.AssetSupplies{} - for _, asset := range supportedAssets { - supply := GenAssetSupply(simState.Rand, asset.Denom) - supplies = append(supplies, supply) - } - - bep3Genesis := types.GenesisState{ - Params: types.Params{ - AssetParams: supportedAssets, - }, - Supplies: supplies, - PreviousBlockTime: types.DefaultPreviousBlockTime, - } - - return bep3Genesis -} - -func loadAuthGenState(simState *module.SimulationState, bep3Genesis types.GenesisState) (auth.GenesisState, []sdk.Coins) { - var authGenesis auth.GenesisState - simState.Cdc.MustUnmarshalJSON(simState.GenState[auth.ModuleName], &authGenesis) - // Load total limit of each supported asset to deputy's account - var totalCoins []sdk.Coins - for _, asset := range bep3Genesis.Params.AssetParams { - deputy, found := getAccount(authGenesis.Accounts, asset.DeputyAddress) - if !found { - panic("deputy address not found in available accounts") - } - assetCoin := sdk.NewCoins(sdk.NewCoin(asset.Denom, asset.SupplyLimit.Limit)) - if err := deputy.SetCoins(deputy.GetCoins().Add(assetCoin...)); err != nil { - panic(err) - } - totalCoins = append(totalCoins, assetCoin) - authGenesis.Accounts = replaceOrAppendAccount(authGenesis.Accounts, deputy) - } - - return authGenesis, totalCoins -} - -// Return an account from a list of accounts that matches an address. -func getAccount(accounts []authexported.GenesisAccount, addr sdk.AccAddress) (authexported.GenesisAccount, bool) { - for _, a := range accounts { - if a.GetAddress().Equals(addr) { - return a, true - } - } - return nil, false -} - -// In a list of accounts, replace the first account found with the same address. If not found, append the account. -func replaceOrAppendAccount(accounts []authexported.GenesisAccount, acc authexported.GenesisAccount) []authexported.GenesisAccount { - newAccounts := accounts - for i, a := range accounts { - if a.GetAddress().Equals(acc.GetAddress()) { - newAccounts[i] = acc - return newAccounts - } - } - return append(newAccounts, acc) -} diff --git a/x/bep3/simulation/go.mod b/x/bep3/simulation/go.mod deleted file mode 100644 index e69de29b..00000000 diff --git a/x/bep3/simulation/operations.go b/x/bep3/simulation/operations.go deleted file mode 100644 index 5f8f8d74..00000000 --- a/x/bep3/simulation/operations.go +++ /dev/null @@ -1,342 +0,0 @@ -package simulation - -import ( - "fmt" - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/simapp/helpers" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/simulation" - - appparams "github.com/kava-labs/kava/app/params" - "github.com/kava-labs/kava/x/bep3/keeper" - "github.com/kava-labs/kava/x/bep3/types" -) - -var ( - noOpMsg = simulation.NoOpMsg(types.ModuleName) - randomNumber = []byte{114, 21, 74, 180, 81, 92, 21, 91, 173, 164, 143, 111, 120, 58, 241, 58, 40, 22, 59, 133, 102, 233, 55, 149, 12, 199, 231, 63, 122, 23, 88, 9} -) - -// Simulation operation weights constants -const ( - OpWeightMsgCreateAtomicSwap = "op_weight_msg_create_atomic_swap" -) - -// WeightedOperations returns all the operations from the module with their respective weights -func WeightedOperations( - appParams simulation.AppParams, cdc *codec.Codec, ak types.AccountKeeper, k keeper.Keeper, -) simulation.WeightedOperations { - var weightCreateAtomicSwap int - - appParams.GetOrGenerate(cdc, OpWeightMsgCreateAtomicSwap, &weightCreateAtomicSwap, nil, - func(_ *rand.Rand) { - weightCreateAtomicSwap = appparams.DefaultWeightMsgCreateAtomicSwap - }, - ) - - return simulation.WeightedOperations{ - simulation.NewWeightedOperation( - weightCreateAtomicSwap, - SimulateMsgCreateAtomicSwap(ak, k), - ), - } -} - -// SimulateMsgCreateAtomicSwap generates a MsgCreateAtomicSwap with random values -func SimulateMsgCreateAtomicSwap(ak types.AccountKeeper, k keeper.Keeper) simulation.Operation { - return func( - r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, - ) (simulation.OperationMsg, []simulation.FutureOperation, error) { - // Get asset supplies and shuffle them - assets, found := k.GetAssets(ctx) - if !found { - return noOpMsg, nil, nil - } - r.Shuffle(len(assets), func(i, j int) { - assets[i], assets[j] = assets[j], assets[i] - }) - senderOutgoing, selectedAsset, found := findValidAccountAssetPair(accs, assets, func(simAcc simulation.Account, asset types.AssetParam) bool { - supply, found := k.GetAssetSupply(ctx, asset.Denom) - if !found { - return false - } - if supply.CurrentSupply.Amount.IsPositive() { - authAcc := ak.GetAccount(ctx, simAcc.Address) - // deputy cannot be sender of outgoing swap - if authAcc.GetAddress().Equals(asset.DeputyAddress) { - return false - } - // Search for an account that holds coins received by an atomic swap - minAmountPlusFee := asset.MinSwapAmount.Add(asset.FixedFee) - if authAcc.SpendableCoins(ctx.BlockTime()).AmountOf(asset.Denom).GT(minAmountPlusFee) { - return true - } - } - return false - }) - var sender simulation.Account - var recipient simulation.Account - var asset types.AssetParam - - // If an outgoing swap can be created, it's chosen 50% of the time. - if found && r.Intn(100) < 50 { - deputy, found := simulation.FindAccount(accs, selectedAsset.DeputyAddress) - if !found { - return noOpMsg, nil, nil - } - sender = senderOutgoing - recipient = deputy - asset = selectedAsset - } else { - // if an outgoing swap cannot be created or was not selected, simulate an incoming swap - assets, _ := k.GetAssets(ctx) - asset = assets[r.Intn(len(assets))] - var eligibleAccs []simulation.Account - for _, simAcc := range accs { - // don't allow recipient of incoming swap to be the deputy - if simAcc.Address.Equals(asset.DeputyAddress) { - continue - } - eligibleAccs = append(eligibleAccs, simAcc) - } - recipient, _ = simulation.RandomAcc(r, eligibleAccs) - deputy, found := simulation.FindAccount(accs, asset.DeputyAddress) - if !found { - return noOpMsg, nil, nil - } - sender = deputy - - } - - recipientOtherChain := simulation.RandStringOfLength(r, 43) - senderOtherChain := simulation.RandStringOfLength(r, 43) - - // Use same random number for determinism - timestamp := ctx.BlockTime().Unix() - randomNumberHash := types.CalculateRandomHash(randomNumber, timestamp) - - // Check that the sender has coins for fee - senderAcc := ak.GetAccount(ctx, sender.Address) - fees, err := simulation.RandomFees(r, ctx, senderAcc.SpendableCoins(ctx.BlockTime())) - if err != nil { - return simulation.NoOpMsg(types.ModuleName), nil, err - } - - // Get maximum valid amount - maximumAmount := senderAcc.SpendableCoins(ctx.BlockTime()).Sub(fees).AmountOf(asset.Denom) - assetSupply, foundAssetSupply := k.GetAssetSupply(ctx, asset.Denom) - if !foundAssetSupply { - return noOpMsg, nil, fmt.Errorf("no asset supply found for %s", asset.Denom) - } - // The maximum amount for outgoing swaps is limited by the asset's current supply - if recipient.Address.Equals(asset.DeputyAddress) { - if maximumAmount.GT(assetSupply.CurrentSupply.Amount.Sub(assetSupply.OutgoingSupply.Amount)) { - maximumAmount = assetSupply.CurrentSupply.Amount.Sub(assetSupply.OutgoingSupply.Amount) - } - } else { - // the maximum amount for incoming swaps in limited by the asset's incoming supply + current supply (rate-limited if applicable) + swap amount being less than the supply limit - var currentRemainingSupply sdkmath.Int - if asset.SupplyLimit.TimeLimited { - currentRemainingSupply = asset.SupplyLimit.Limit.Sub(assetSupply.IncomingSupply.Amount).Sub(assetSupply.TimeLimitedCurrentSupply.Amount) - } else { - currentRemainingSupply = asset.SupplyLimit.Limit.Sub(assetSupply.IncomingSupply.Amount).Sub(assetSupply.CurrentSupply.Amount) - } - if currentRemainingSupply.LT(maximumAmount) { - maximumAmount = currentRemainingSupply - } - } - - // The maximum amount for all swaps is limited by the total max limit - if maximumAmount.GT(asset.MaxSwapAmount) { - maximumAmount = asset.MaxSwapAmount - } - - // Get an amount of coins between 0.1 and 2% of total coins - amount := maximumAmount.Quo(sdkmath.NewInt(int64(simulation.RandIntBetween(r, 50, 1000)))) - minAmountPlusFee := asset.MinSwapAmount.Add(asset.FixedFee) - if amount.LTE(minAmountPlusFee) { - return simulation.NewOperationMsgBasic(types.ModuleName, fmt.Sprintf("no-operation (account funds exhausted for asset %s)", asset.Denom), "", false, nil), nil, nil - } - coins := sdk.NewCoins(sdk.NewCoin(asset.Denom, amount)) - - // We're assuming that sims are run with -NumBlocks=100 - heightSpan := uint64(simulation.RandIntBetween(r, int(asset.MinBlockLock), int(asset.MaxBlockLock))) - - msg := types.NewMsgCreateAtomicSwap( - sender.Address, recipient.Address, recipientOtherChain, senderOtherChain, - randomNumberHash, timestamp, coins, heightSpan, - ) - - tx := helpers.GenTx( - []sdk.Msg{msg}, - fees, - helpers.DefaultGenTxGas, - chainID, - []uint64{senderAcc.GetAccountNumber()}, - []uint64{senderAcc.GetSequence()}, - sender.PrivKey, - ) - - _, result, err := app.Deliver(tx) - if err != nil { - return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err - } - - // Construct a MsgClaimAtomicSwap or MsgRefundAtomicSwap future operation - var futureOp simulation.FutureOperation - swapID := types.CalculateSwapID(msg.RandomNumberHash, msg.From, msg.SenderOtherChain) - if r.Intn(100) < 50 { - // Claim future operation - choose between next block and the block before height span - executionBlock := uint64( - int(ctx.BlockHeight()+1) + r.Intn(int(heightSpan-1))) - - futureOp = simulation.FutureOperation{ - BlockHeight: int(executionBlock), - Op: operationClaimAtomicSwap(ak, k, swapID, randomNumber), - } - } else { - // Refund future operation - executionBlock := uint64(ctx.BlockHeight()) + msg.HeightSpan - futureOp = simulation.FutureOperation{ - BlockHeight: int(executionBlock), - Op: operationRefundAtomicSwap(ak, k, swapID), - } - } - - return simulation.NewOperationMsg(msg, true, result.Log), []simulation.FutureOperation{futureOp}, nil - } -} - -func operationClaimAtomicSwap(ak types.AccountKeeper, k keeper.Keeper, swapID []byte, randomNumber []byte) simulation.Operation { - return func( - r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, - ) (simulation.OperationMsg, []simulation.FutureOperation, error) { - simAccount, _ := simulation.RandomAcc(r, accs) - acc := ak.GetAccount(ctx, simAccount.Address) - - swap, found := k.GetAtomicSwap(ctx, swapID) - if !found { - return simulation.NoOpMsg(types.ModuleName), nil, fmt.Errorf("cannot claim: swap with ID %s not found", swapID) - } - // check that asset supply supports claiming (it could have changed due to a param change proposal) - // use CacheContext so changes don't take effect - cacheCtx, _ := ctx.CacheContext() - switch swap.Direction { - case types.Incoming: - err := k.DecrementIncomingAssetSupply(cacheCtx, swap.Amount[0]) - if err != nil { - return simulation.NewOperationMsgBasic(types.ModuleName, fmt.Sprintf("no-operation (could not claim - unable to decrement incoming asset supply %s)", swap.Amount[0].Denom), "", false, nil), nil, nil - } - err = k.IncrementCurrentAssetSupply(cacheCtx, swap.Amount[0]) - if err != nil { - return simulation.NewOperationMsgBasic(types.ModuleName, fmt.Sprintf("no-operation (could not claim - unable to increment current asset supply %s)", swap.Amount[0].Denom), "", false, nil), nil, nil - } - case types.Outgoing: - err := k.DecrementOutgoingAssetSupply(cacheCtx, swap.Amount[0]) - if err != nil { - return simulation.NewOperationMsgBasic(types.ModuleName, fmt.Sprintf("no-operation (could not claim - unable to decrement outgoing asset supply %s)", swap.Amount[0].Denom), "", false, nil), nil, nil - } - err = k.DecrementCurrentAssetSupply(cacheCtx, swap.Amount[0]) - if err != nil { - return simulation.NewOperationMsgBasic(types.ModuleName, fmt.Sprintf("no-operation (could not claim - unable to decrement current asset supply %s)", swap.Amount[0].Denom), "", false, nil), nil, nil - } - } - - asset, err := k.GetAsset(ctx, swap.Amount[0].Denom) - if err != nil { - return simulation.NewOperationMsgBasic(types.ModuleName, fmt.Sprintf("no-operation (could not claim - asset not found %s)", swap.Amount[0].Denom), "", false, nil), nil, nil - } - supply, found := k.GetAssetSupply(ctx, asset.Denom) - if !found { - return simulation.NewOperationMsgBasic(types.ModuleName, fmt.Sprintf("no-operation (could not claim - asset supply not found %s)", swap.Amount[0].Denom), "", false, nil), nil, nil - } - if asset.SupplyLimit.Limit.LT(supply.CurrentSupply.Amount.Add(swap.Amount[0].Amount)) { - return simulation.NoOpMsg(types.ModuleName), nil, nil - } - - msg := types.NewMsgClaimAtomicSwap(acc.GetAddress(), swapID, randomNumber) - fees, err := simulation.RandomFees(r, ctx, acc.SpendableCoins(ctx.BlockTime())) - if err != nil { - return simulation.NoOpMsg(types.ModuleName), nil, err - } - tx := helpers.GenTx( - []sdk.Msg{msg}, - fees, - helpers.DefaultGenTxGas, - chainID, - []uint64{acc.GetAccountNumber()}, - []uint64{acc.GetSequence()}, - simAccount.PrivKey, - ) - _, result, err := app.Deliver(tx) - if err != nil { - return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err - } - return simulation.NewOperationMsg(msg, true, result.Log), nil, nil - } -} - -func operationRefundAtomicSwap(ak types.AccountKeeper, k keeper.Keeper, swapID []byte) simulation.Operation { - return func( - r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, - ) (simulation.OperationMsg, []simulation.FutureOperation, error) { - simAccount, _ := simulation.RandomAcc(r, accs) - acc := ak.GetAccount(ctx, simAccount.Address) - - swap, found := k.GetAtomicSwap(ctx, swapID) - if !found { - return simulation.NoOpMsg(types.ModuleName), nil, fmt.Errorf("cannot refund: swap with ID %s not found", swapID) - } - cacheCtx, _ := ctx.CacheContext() - switch swap.Direction { - case types.Incoming: - if err := k.DecrementIncomingAssetSupply(cacheCtx, swap.Amount[0]); err != nil { - return simulation.NewOperationMsgBasic(types.ModuleName, fmt.Sprintf("no-operation (could not refund - unable to decrement incoming asset supply %s)", swap.Amount[0].Denom), "", false, nil), nil, nil - } - case types.Outgoing: - if err := k.DecrementOutgoingAssetSupply(cacheCtx, swap.Amount[0]); err != nil { - return simulation.NewOperationMsgBasic(types.ModuleName, fmt.Sprintf("no-operation (could not refund - unable to decrement outgoing asset supply %s)", swap.Amount[0].Denom), "", false, nil), nil, nil - } - } - - msg := types.NewMsgRefundAtomicSwap(acc.GetAddress(), swapID) - - fees, err := simulation.RandomFees(r, ctx, acc.SpendableCoins(ctx.BlockTime())) - if err != nil { - return simulation.NoOpMsg(types.ModuleName), nil, err - } - - tx := helpers.GenTx( - []sdk.Msg{msg}, - fees, - helpers.DefaultGenTxGas, - chainID, - []uint64{acc.GetAccountNumber()}, - []uint64{acc.GetSequence()}, - simAccount.PrivKey, - ) - - _, result, err := app.Deliver(tx) - if err != nil { - return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err - } - return simulation.NewOperationMsg(msg, true, result.Log), nil, nil - } -} - -// findValidAccountAssetSupplyPair finds an account for which the callback func returns true -func findValidAccountAssetPair(accounts []simulation.Account, assets types.AssetParams, - cb func(simulation.Account, types.AssetParam) bool, -) (simulation.Account, types.AssetParam, bool) { - for _, asset := range assets { - for _, acc := range accounts { - if isValid := cb(acc, asset); isValid { - return acc, asset, true - } - } - } - return simulation.Account{}, types.AssetParam{}, false -} diff --git a/x/bep3/simulation/params.go b/x/bep3/simulation/params.go deleted file mode 100644 index 6ebaa469..00000000 --- a/x/bep3/simulation/params.go +++ /dev/null @@ -1,25 +0,0 @@ -package simulation - -import ( - "fmt" - "math/rand" - - "github.com/cosmos/cosmos-sdk/x/simulation" - - "github.com/kava-labs/kava/x/bep3/types" -) - -const ( - keyAssetParams = "AssetParams" -) - -// ParamChanges defines the parameters that can be modified by param change proposals -func ParamChanges(r *rand.Rand) []simulation.ParamChange { - return []simulation.ParamChange{ - simulation.NewSimParamChange(types.ModuleName, keyAssetParams, - func(r *rand.Rand) string { - return fmt.Sprintf("\"%s\"", GenSupportedAssets(r)) - }, - ), - } -} diff --git a/x/bep3/types/bep3.pb.go b/x/bep3/types/bep3.pb.go index cec67879..5a9c3ab5 100644 --- a/x/bep3/types/bep3.pb.go +++ b/x/bep3/types/bep3.pb.go @@ -5,13 +5,13 @@ package types import ( fmt "fmt" + github_com_cometbft_cometbft_libs_bytes "github.com/cometbft/cometbft/libs/bytes" _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - github_com_tendermint_tendermint_libs_bytes "github.com/tendermint/tendermint/libs/bytes" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" @@ -315,7 +315,7 @@ type AtomicSwap struct { // amount represents the amount being swapped Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` // random_number_hash represents the hash of the random number - RandomNumberHash github_com_tendermint_tendermint_libs_bytes.HexBytes `protobuf:"bytes,2,opt,name=random_number_hash,json=randomNumberHash,proto3,casttype=github.com/tendermint/tendermint/libs/bytes.HexBytes" json:"random_number_hash,omitempty"` + RandomNumberHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,2,opt,name=random_number_hash,json=randomNumberHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"random_number_hash,omitempty"` // expire_height represents the height when the swap expires ExpireHeight uint64 `protobuf:"varint,3,opt,name=expire_height,json=expireHeight,proto3" json:"expire_height,omitempty"` // timestamp represents the timestamp of the swap @@ -378,7 +378,7 @@ func (m *AtomicSwap) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { return nil } -func (m *AtomicSwap) GetRandomNumberHash() github_com_tendermint_tendermint_libs_bytes.HexBytes { +func (m *AtomicSwap) GetRandomNumberHash() github_com_cometbft_cometbft_libs_bytes.HexBytes { if m != nil { return m.RandomNumberHash } @@ -550,79 +550,79 @@ func init() { func init() { proto.RegisterFile("kava/bep3/v1beta1/bep3.proto", fileDescriptor_01a01937d931b013) } var fileDescriptor_01a01937d931b013 = []byte{ - // 1151 bytes of a gzipped FileDescriptorProto + // 1147 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x6f, 0x1a, 0x57, - 0x17, 0xf6, 0x18, 0x4c, 0xec, 0x03, 0x76, 0x78, 0xaf, 0x93, 0x37, 0xd8, 0x49, 0x81, 0x38, 0x55, - 0x85, 0xa2, 0x1a, 0x9a, 0xa4, 0x95, 0xba, 0xa8, 0xaa, 0x32, 0x80, 0x63, 0x24, 0xc7, 0xa0, 0xc1, - 0x56, 0x3f, 0x16, 0x9d, 0xde, 0x99, 0xb9, 0xc0, 0x95, 0x99, 0xb9, 0xa3, 0xb9, 0x43, 0x82, 0xd7, - 0xdd, 0x74, 0xd1, 0x45, 0xbb, 0xeb, 0xbe, 0xbb, 0x2e, 0xab, 0xfc, 0x88, 0x2c, 0xa3, 0xac, 0xaa, - 0x2e, 0x9c, 0xca, 0xf9, 0x17, 0x59, 0x55, 0xf7, 0xc3, 0x30, 0x4e, 0xdd, 0x8a, 0x05, 0x1b, 0x7b, - 0xce, 0xc7, 0xf3, 0x9c, 0x33, 0x77, 0xce, 0x79, 0x2e, 0x70, 0xe7, 0x04, 0x3f, 0xc5, 0x35, 0x87, - 0x84, 0x8f, 0x6a, 0x4f, 0x1f, 0x38, 0x24, 0xc6, 0x0f, 0xa4, 0x51, 0x0d, 0x23, 0x16, 0x33, 0xf4, - 0x3f, 0x11, 0xad, 0x4a, 0x87, 0x8e, 0x6e, 0x17, 0x5d, 0xc6, 0x7d, 0xc6, 0x6b, 0x0e, 0xe6, 0x64, - 0x0a, 0x71, 0x19, 0x0d, 0x14, 0x64, 0x7b, 0x4b, 0xc5, 0x6d, 0x69, 0xd5, 0x94, 0xa1, 0x43, 0x37, - 0x06, 0x6c, 0xc0, 0x94, 0x5f, 0x3c, 0x69, 0x6f, 0x71, 0xc0, 0xd8, 0x60, 0x44, 0x6a, 0xd2, 0x72, - 0xc6, 0xfd, 0x9a, 0x37, 0x8e, 0x70, 0x4c, 0x99, 0x26, 0xdc, 0xb1, 0x21, 0xd3, 0xc5, 0x11, 0xf6, - 0x39, 0x3a, 0x86, 0x1c, 0xe6, 0x9c, 0xc4, 0x76, 0x28, 0xed, 0x82, 0x51, 0x4e, 0x55, 0xb2, 0x0f, - 0xdf, 0xab, 0xfe, 0xa3, 0xc9, 0x6a, 0x5d, 0xa4, 0x49, 0x94, 0xb9, 0xf9, 0xe2, 0xac, 0xb4, 0xf4, - 0xdb, 0xeb, 0x52, 0x76, 0xe6, 0xe3, 0x56, 0x16, 0xcf, 0x8c, 0x9d, 0x1f, 0x57, 0x00, 0x66, 0x41, - 0x74, 0x03, 0x56, 0x3c, 0x12, 0x30, 0xbf, 0x60, 0x94, 0x8d, 0xca, 0x9a, 0xa5, 0x0c, 0x74, 0x0f, - 0xae, 0x89, 0x97, 0xb4, 0xa9, 0x57, 0x58, 0x2e, 0x1b, 0x95, 0x94, 0x09, 0xe7, 0x67, 0xa5, 0x4c, - 0x83, 0xd1, 0xa0, 0xdd, 0xb4, 0x32, 0x22, 0xd4, 0xf6, 0xd0, 0x63, 0xc8, 0xf1, 0x71, 0x18, 0x8e, - 0x4e, 0xed, 0x11, 0xf5, 0x69, 0x5c, 0x48, 0x95, 0x8d, 0x4a, 0xf6, 0x61, 0xf1, 0x8a, 0x06, 0x7b, - 0x32, 0xed, 0x40, 0x64, 0x99, 0x69, 0xd1, 0xa1, 0x95, 0xe5, 0x33, 0x17, 0xfa, 0x3f, 0x64, 0xb0, - 0x1b, 0xd3, 0xa7, 0xa4, 0x90, 0x2e, 0x1b, 0x95, 0x55, 0x4b, 0x5b, 0x88, 0xc1, 0x86, 0x47, 0xc2, - 0x71, 0x7c, 0x6a, 0x63, 0xcf, 0x8b, 0x08, 0xe7, 0x85, 0x95, 0xb2, 0x51, 0xc9, 0x99, 0xfb, 0x6f, - 0xcf, 0x4a, 0xbb, 0x03, 0x1a, 0x0f, 0xc7, 0x4e, 0xd5, 0x65, 0xbe, 0x3e, 0x76, 0xfd, 0x6f, 0x97, - 0x7b, 0x27, 0xb5, 0xf8, 0x34, 0x24, 0xbc, 0x5a, 0x77, 0xdd, 0xba, 0x02, 0xbe, 0x7a, 0xbe, 0xbb, - 0xa9, 0x3f, 0x8e, 0xf6, 0x98, 0xa7, 0x31, 0xe1, 0xd6, 0xba, 0xe2, 0xd7, 0x3e, 0xf4, 0x35, 0xac, - 0xf5, 0xe9, 0x84, 0x78, 0x76, 0x9f, 0x90, 0x42, 0x46, 0x1c, 0x88, 0xf9, 0x99, 0x68, 0xf7, 0xcf, - 0xb3, 0xd2, 0x07, 0x73, 0xd4, 0x6b, 0x07, 0xf1, 0xab, 0xe7, 0xbb, 0xa0, 0x0b, 0xb5, 0x83, 0xd8, - 0x5a, 0x95, 0x74, 0x7b, 0x84, 0x20, 0x0f, 0xae, 0xfb, 0x34, 0xb0, 0xf9, 0x33, 0x1c, 0xda, 0xd8, - 0x67, 0xe3, 0x20, 0x2e, 0x5c, 0x5b, 0x40, 0x81, 0x75, 0x9f, 0x06, 0xbd, 0x67, 0x38, 0xac, 0x4b, - 0x4a, 0x59, 0x05, 0x4f, 0x2e, 0x55, 0x59, 0x5d, 0x48, 0x15, 0x3c, 0x49, 0x54, 0x79, 0x1f, 0x36, - 0xc4, 0xbb, 0x38, 0x23, 0xe6, 0x9e, 0xd8, 0xe2, 0x4f, 0x61, 0xad, 0x6c, 0x54, 0xd2, 0x56, 0xce, - 0xa7, 0x81, 0x29, 0xec, 0x03, 0xe6, 0x9e, 0xc8, 0x2c, 0x3c, 0x49, 0x66, 0x81, 0xce, 0xc2, 0x93, - 0x69, 0xd6, 0xce, 0xef, 0xcb, 0x90, 0x4d, 0x8c, 0x07, 0xb2, 0x60, 0x45, 0x4d, 0x93, 0xb1, 0x80, - 0xbe, 0x15, 0x15, 0xba, 0x0b, 0xb9, 0x98, 0xfa, 0x44, 0x8d, 0x29, 0x51, 0x23, 0xbd, 0x6a, 0x65, - 0x85, 0xef, 0x40, 0xb9, 0x50, 0x13, 0xa4, 0x69, 0x87, 0x24, 0xa2, 0xcc, 0xd3, 0xa3, 0xbc, 0x55, - 0x55, 0xcb, 0x5a, 0xbd, 0x58, 0xd6, 0x6a, 0x53, 0x2f, 0xab, 0xb9, 0x2a, 0xfa, 0xfa, 0xe5, 0x75, - 0xc9, 0xb0, 0x40, 0xe0, 0xba, 0x12, 0x86, 0xfa, 0x90, 0x97, 0x2c, 0x42, 0x2d, 0x3c, 0xbd, 0x15, - 0xe9, 0x05, 0xbc, 0xc7, 0x86, 0x60, 0x35, 0x05, 0xa9, 0xec, 0x77, 0xe7, 0xfb, 0x0c, 0x40, 0x3d, - 0x66, 0x3e, 0x75, 0xc5, 0x57, 0x41, 0x2e, 0x64, 0xf4, 0xc7, 0x56, 0x1a, 0xb1, 0x55, 0xd5, 0x58, - 0xd1, 0xc7, 0x74, 0x09, 0xc5, 0xf6, 0x9a, 0x1f, 0x69, 0x7d, 0xa8, 0xcc, 0xd1, 0x87, 0x00, 0x70, - 0x4b, 0x53, 0xa3, 0x3e, 0xa0, 0x08, 0x07, 0x1e, 0xf3, 0xed, 0x60, 0xec, 0x3b, 0x24, 0xb2, 0x87, - 0x98, 0x0f, 0xe5, 0x51, 0xe6, 0xcc, 0x4f, 0xdf, 0x9e, 0x95, 0x3e, 0x4e, 0x30, 0xc6, 0x24, 0xf0, - 0x48, 0xe4, 0xd3, 0x20, 0x4e, 0x3e, 0x8e, 0xa8, 0xc3, 0x6b, 0x8e, 0xd8, 0xbb, 0xea, 0x3e, 0x99, - 0xa8, 0x05, 0xcc, 0x2b, 0xce, 0x43, 0x49, 0xb9, 0x8f, 0xf9, 0x10, 0xdd, 0x83, 0x75, 0x32, 0x09, - 0x69, 0x44, 0xec, 0x21, 0xa1, 0x83, 0xa1, 0x92, 0x95, 0xb4, 0x95, 0x53, 0xce, 0x7d, 0xe9, 0x43, - 0x77, 0x60, 0x4d, 0x1c, 0x09, 0x8f, 0xb1, 0x1f, 0xca, 0x13, 0x4e, 0x59, 0x33, 0x07, 0xfa, 0x0e, - 0x32, 0x5c, 0x96, 0x5d, 0xb8, 0x5e, 0x68, 0x5e, 0xd4, 0x87, 0xb5, 0x88, 0xb8, 0x34, 0xa4, 0x24, - 0x88, 0xa5, 0x50, 0x2c, 0xb2, 0xc8, 0x8c, 0x1a, 0x7d, 0x08, 0x48, 0x55, 0xb4, 0x59, 0x3c, 0x24, - 0x91, 0xed, 0x0e, 0x31, 0x0d, 0x94, 0x70, 0x58, 0x79, 0x15, 0xe9, 0x88, 0x40, 0x43, 0xf8, 0xd1, - 0x43, 0xb8, 0x39, 0x85, 0x5e, 0x02, 0x48, 0x0d, 0xb0, 0x36, 0xa7, 0xc1, 0x04, 0xe6, 0x2e, 0xe4, - 0xdc, 0x11, 0x13, 0xe3, 0xea, 0x4c, 0x37, 0x39, 0x65, 0x65, 0x95, 0x4f, 0xae, 0x29, 0xfa, 0x04, - 0x32, 0x3c, 0xc6, 0xf1, 0x98, 0xcb, 0x05, 0xde, 0xb8, 0xf2, 0x0a, 0x12, 0x73, 0xd8, 0x93, 0x49, - 0x96, 0x4e, 0x46, 0x25, 0xc8, 0xba, 0x11, 0xe3, 0x5c, 0xf7, 0x90, 0x95, 0x4b, 0x07, 0xd2, 0xa5, - 0x4a, 0x7f, 0x0e, 0x6b, 0x1e, 0x8d, 0x88, 0x2b, 0x16, 0xaa, 0x90, 0x93, 0xd4, 0xe5, 0x7f, 0xa1, - 0x6e, 0x5e, 0xe4, 0x59, 0x33, 0xc8, 0xce, 0xcf, 0x29, 0x50, 0xd7, 0x9c, 0xd2, 0x0f, 0xb4, 0x0f, - 0xd7, 0x69, 0xe0, 0x32, 0x9f, 0x06, 0x03, 0x5b, 0x5d, 0x2f, 0x52, 0x44, 0xfe, 0x73, 0x1f, 0xd4, - 0x6d, 0xb4, 0x71, 0x81, 0x9b, 0x31, 0xb1, 0x71, 0x3c, 0x60, 0x09, 0xa6, 0xe5, 0x39, 0x99, 0x2e, - 0x70, 0x9a, 0x69, 0x0f, 0x36, 0xdc, 0x71, 0x14, 0x89, 0x0f, 0xa2, 0x89, 0x52, 0xf3, 0x11, 0xad, - 0x6b, 0x98, 0xe6, 0xf9, 0x16, 0x6e, 0x27, 0x25, 0xcc, 0x7e, 0x87, 0x34, 0x3d, 0x1f, 0x69, 0x21, - 0x21, 0x79, 0x8d, 0x4b, 0xfc, 0x7b, 0x5a, 0x22, 0xc9, 0x08, 0x87, 0x9c, 0x78, 0x72, 0x71, 0xe6, - 0x14, 0x40, 0x29, 0x9c, 0x2d, 0x85, 0xbb, 0x7f, 0x0a, 0x30, 0x1b, 0x05, 0x74, 0x1b, 0x6e, 0xf5, - 0xbe, 0xac, 0x77, 0xed, 0xde, 0x51, 0xfd, 0xe8, 0xb8, 0x67, 0x1f, 0x1f, 0xf6, 0xba, 0xad, 0x46, - 0x7b, 0xaf, 0xdd, 0x6a, 0xe6, 0x97, 0xd0, 0x0d, 0xc8, 0x27, 0x83, 0x9d, 0x6e, 0xeb, 0x30, 0x6f, - 0xa0, 0x2d, 0xb8, 0x99, 0xf4, 0x36, 0x3a, 0x4f, 0xba, 0x07, 0xad, 0xa3, 0x56, 0x33, 0xbf, 0x8c, - 0x6e, 0xc1, 0x66, 0x32, 0xd4, 0xfa, 0xaa, 0xdb, 0xb6, 0x5a, 0xcd, 0x7c, 0x6a, 0x3b, 0xfd, 0xc3, - 0xaf, 0xc5, 0xa5, 0xfb, 0x0c, 0xd6, 0x2f, 0x8d, 0x0a, 0x2a, 0xc2, 0xb6, 0xcc, 0x6f, 0xb6, 0xad, - 0x56, 0xe3, 0xa8, 0xdd, 0x39, 0x7c, 0xa7, 0x81, 0x8b, 0xee, 0x66, 0xf1, 0xf6, 0x61, 0xa3, 0xf3, - 0xa4, 0x7d, 0xf8, 0x38, 0x6f, 0x5c, 0x11, 0xec, 0x1c, 0x1f, 0x3d, 0xee, 0x88, 0xe0, 0xb2, 0x2a, - 0x68, 0x7e, 0xf1, 0xe2, 0xbc, 0x68, 0xbc, 0x3c, 0x2f, 0x1a, 0x7f, 0x9d, 0x17, 0x8d, 0x9f, 0xde, - 0x14, 0x97, 0x5e, 0xbe, 0x29, 0x2e, 0xfd, 0xf1, 0xa6, 0xb8, 0xf4, 0x4d, 0x52, 0xe5, 0xc5, 0x40, - 0xef, 0x8e, 0xb0, 0xc3, 0xe5, 0x53, 0x6d, 0xa2, 0x7e, 0x7d, 0x4a, 0x2d, 0x70, 0x32, 0xf2, 0x5c, - 0x1f, 0xfd, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x87, 0x2c, 0x8f, 0xa6, 0x97, 0x0a, 0x00, 0x00, + 0x17, 0xf6, 0x18, 0x4c, 0xec, 0x03, 0x26, 0xbc, 0xd7, 0xc9, 0x1b, 0xec, 0xa4, 0x40, 0x9c, 0xaa, + 0x42, 0x51, 0x0d, 0xf9, 0x68, 0x77, 0x55, 0x55, 0x06, 0x70, 0x8c, 0xe4, 0x00, 0x1a, 0x6c, 0xf5, + 0x63, 0xd1, 0xe9, 0x9d, 0x99, 0x0b, 0x5c, 0x99, 0x99, 0x3b, 0x9a, 0x3b, 0x24, 0xf8, 0x1f, 0x74, + 0xd1, 0x45, 0xbb, 0xeb, 0xbe, 0xbb, 0x2e, 0xab, 0xfc, 0x88, 0x2c, 0xa3, 0xac, 0xaa, 0x2e, 0x9c, + 0xca, 0xf9, 0x17, 0xd9, 0xb4, 0xba, 0x1f, 0x06, 0x9c, 0xba, 0x15, 0x0b, 0x36, 0xf6, 0x9c, 0xaf, + 0xe7, 0x9c, 0xb9, 0x73, 0x9e, 0xe7, 0x02, 0x77, 0x4e, 0xf0, 0x33, 0x5c, 0x75, 0x48, 0xf8, 0xb8, + 0xfa, 0xec, 0xa1, 0x43, 0x62, 0xfc, 0x50, 0x1a, 0x95, 0x30, 0x62, 0x31, 0x43, 0xff, 0x13, 0xd1, + 0x8a, 0x74, 0xe8, 0xe8, 0x4e, 0xc1, 0x65, 0xdc, 0x67, 0xbc, 0xea, 0x60, 0x4e, 0xa6, 0x25, 0x2e, + 0xa3, 0x81, 0x2a, 0xd9, 0xd9, 0x56, 0x71, 0x5b, 0x5a, 0x55, 0x65, 0xe8, 0xd0, 0x8d, 0x01, 0x1b, + 0x30, 0xe5, 0x17, 0x4f, 0xda, 0x5b, 0x18, 0x30, 0x36, 0x18, 0x91, 0xaa, 0xb4, 0x9c, 0x71, 0xbf, + 0xea, 0x8d, 0x23, 0x1c, 0x53, 0xa6, 0x01, 0x77, 0x6d, 0x48, 0x75, 0x71, 0x84, 0x7d, 0x8e, 0x8e, + 0x21, 0x83, 0x39, 0x27, 0xb1, 0x1d, 0x4a, 0x3b, 0x6f, 0x94, 0x12, 0xe5, 0xf4, 0xa3, 0x0f, 0x2a, + 0xff, 0x18, 0xb2, 0x52, 0x13, 0x69, 0xb2, 0xca, 0xdc, 0x7a, 0x79, 0x56, 0x5c, 0xf9, 0xf5, 0x4d, + 0x31, 0x3d, 0xf3, 0x71, 0x2b, 0x8d, 0x67, 0xc6, 0xee, 0x0f, 0x6b, 0x00, 0xb3, 0x20, 0xba, 0x01, + 0x6b, 0x1e, 0x09, 0x98, 0x9f, 0x37, 0x4a, 0x46, 0x79, 0xc3, 0x52, 0x06, 0xba, 0x07, 0xd7, 0xc4, + 0x4b, 0xda, 0xd4, 0xcb, 0xaf, 0x96, 0x8c, 0x72, 0xc2, 0x84, 0xf3, 0xb3, 0x62, 0xaa, 0xce, 0x68, + 0xd0, 0x6a, 0x58, 0x29, 0x11, 0x6a, 0x79, 0xe8, 0x09, 0x64, 0xf8, 0x38, 0x0c, 0x47, 0xa7, 0xf6, + 0x88, 0xfa, 0x34, 0xce, 0x27, 0x4a, 0x46, 0x39, 0xfd, 0xa8, 0x70, 0xc5, 0x80, 0x3d, 0x99, 0x76, + 0x28, 0xb2, 0xcc, 0xa4, 0x98, 0xd0, 0x4a, 0xf3, 0x99, 0x0b, 0xfd, 0x1f, 0x52, 0xd8, 0x8d, 0xe9, + 0x33, 0x92, 0x4f, 0x96, 0x8c, 0xf2, 0xba, 0xa5, 0x2d, 0xc4, 0x20, 0xeb, 0x91, 0x70, 0x1c, 0x9f, + 0xda, 0xd8, 0xf3, 0x22, 0xc2, 0x79, 0x7e, 0xad, 0x64, 0x94, 0x33, 0xe6, 0xc1, 0xbb, 0xb3, 0xe2, + 0xde, 0x80, 0xc6, 0xc3, 0xb1, 0x53, 0x71, 0x99, 0xaf, 0x8f, 0x5d, 0xff, 0xdb, 0xe3, 0xde, 0x49, + 0x35, 0x3e, 0x0d, 0x09, 0xaf, 0xd4, 0x5c, 0xb7, 0xa6, 0x0a, 0x5f, 0xbf, 0xd8, 0xdb, 0xd2, 0x1f, + 0x47, 0x7b, 0xcc, 0xd3, 0x98, 0x70, 0x6b, 0x53, 0xe1, 0x6b, 0x1f, 0xfa, 0x1a, 0x36, 0xfa, 0x74, + 0x42, 0x3c, 0xbb, 0x4f, 0x48, 0x3e, 0x25, 0x0e, 0xc4, 0xfc, 0x4c, 0x8c, 0xfb, 0xc7, 0x59, 0xf1, + 0xa3, 0x05, 0xfa, 0xb5, 0x82, 0xf8, 0xf5, 0x8b, 0x3d, 0xd0, 0x8d, 0x5a, 0x41, 0x6c, 0xad, 0x4b, + 0xb8, 0x7d, 0x42, 0x90, 0x07, 0xd7, 0x7d, 0x1a, 0xd8, 0xfc, 0x39, 0x0e, 0x6d, 0xec, 0xb3, 0x71, + 0x10, 0xe7, 0xaf, 0x2d, 0xa1, 0xc1, 0xa6, 0x4f, 0x83, 0xde, 0x73, 0x1c, 0xd6, 0x24, 0xa4, 0xec, + 0x82, 0x27, 0x97, 0xba, 0xac, 0x2f, 0xa5, 0x0b, 0x9e, 0xcc, 0x75, 0xf9, 0x10, 0xb2, 0xe2, 0x5d, + 0x9c, 0x11, 0x73, 0x4f, 0x6c, 0xf1, 0x27, 0xbf, 0x51, 0x32, 0xca, 0x49, 0x2b, 0xe3, 0xd3, 0xc0, + 0x14, 0xf6, 0x21, 0x73, 0x4f, 0x64, 0x16, 0x9e, 0xcc, 0x67, 0x81, 0xce, 0xc2, 0x93, 0x69, 0xd6, + 0xee, 0x6f, 0xab, 0x90, 0x9e, 0x5b, 0x0f, 0x64, 0xc1, 0x9a, 0xda, 0x26, 0x63, 0x09, 0x73, 0x2b, + 0x28, 0x74, 0x17, 0x32, 0x31, 0xf5, 0x89, 0x5a, 0x53, 0xa2, 0x56, 0x7a, 0xdd, 0x4a, 0x0b, 0xdf, + 0xa1, 0x72, 0xa1, 0x06, 0x48, 0xd3, 0x0e, 0x49, 0x44, 0x99, 0xa7, 0x57, 0x79, 0xbb, 0xa2, 0xc8, + 0x5a, 0xb9, 0x20, 0x6b, 0xa5, 0xa1, 0xc9, 0x6a, 0xae, 0x8b, 0xb9, 0x7e, 0x7e, 0x53, 0x34, 0x2c, + 0x10, 0x75, 0x5d, 0x59, 0x86, 0xfa, 0x90, 0x93, 0x28, 0x42, 0x2d, 0x3c, 0xcd, 0x8a, 0xe4, 0x12, + 0xde, 0x23, 0x2b, 0x50, 0x4d, 0x01, 0x2a, 0xe7, 0xdd, 0xfd, 0x4b, 0x70, 0x38, 0x66, 0x3e, 0x75, + 0xc5, 0x57, 0x41, 0x2e, 0xa4, 0xf4, 0xc7, 0x56, 0x1a, 0xb1, 0x5d, 0xd1, 0xb5, 0x62, 0x8e, 0x29, + 0x09, 0x05, 0x7b, 0xcd, 0x07, 0x5a, 0x1f, 0xca, 0x0b, 0xcc, 0x21, 0x0a, 0xb8, 0xa5, 0xa1, 0x91, + 0x03, 0x28, 0xc2, 0x81, 0xc7, 0x7c, 0x3b, 0x18, 0xfb, 0x0e, 0x89, 0xec, 0x21, 0xe6, 0x43, 0x79, + 0x94, 0x19, 0xf3, 0x93, 0x77, 0x67, 0xc5, 0x07, 0x97, 0x10, 0x7d, 0x12, 0x3b, 0xfd, 0x78, 0xf6, + 0x30, 0xa2, 0x0e, 0xaf, 0x3a, 0x82, 0x73, 0x95, 0x03, 0x32, 0x51, 0xe4, 0xcb, 0x29, 0xbc, 0xb6, + 0x84, 0x3b, 0xc0, 0x7c, 0x88, 0xee, 0xc1, 0x26, 0x99, 0x84, 0x34, 0x22, 0xf6, 0x90, 0xd0, 0xc1, + 0x50, 0x49, 0x4a, 0xd2, 0xca, 0x28, 0xe7, 0x81, 0xf4, 0xa1, 0x3b, 0xb0, 0x21, 0x8e, 0x83, 0xc7, + 0xd8, 0x0f, 0xe5, 0xe9, 0x26, 0xac, 0x99, 0x03, 0x7d, 0x07, 0x29, 0x4e, 0x02, 0x8f, 0x44, 0x4b, + 0xd7, 0x0a, 0x8d, 0x8b, 0xfa, 0xb0, 0x11, 0x11, 0x97, 0x86, 0x94, 0x04, 0xb1, 0x14, 0x89, 0x65, + 0x36, 0x99, 0x41, 0xa3, 0x8f, 0x01, 0xa9, 0x8e, 0x36, 0x8b, 0x87, 0x24, 0xb2, 0xdd, 0x21, 0xa6, + 0x81, 0x12, 0x0d, 0x2b, 0xa7, 0x22, 0x1d, 0x11, 0xa8, 0x0b, 0x3f, 0x7a, 0x04, 0x37, 0xa7, 0xa5, + 0x97, 0x0a, 0x24, 0xff, 0xad, 0xad, 0x69, 0x70, 0xae, 0xe6, 0x2e, 0x64, 0xdc, 0x11, 0x13, 0xab, + 0xea, 0x4c, 0x59, 0x9c, 0xb0, 0xd2, 0xca, 0x27, 0x29, 0x8a, 0x3e, 0x85, 0x14, 0x8f, 0x71, 0x3c, + 0xe6, 0x92, 0xbc, 0xd9, 0x2b, 0xaf, 0x1f, 0xb1, 0x83, 0x3d, 0x99, 0x64, 0xe9, 0x64, 0x54, 0x84, + 0xb4, 0x1b, 0x31, 0xce, 0xf5, 0x0c, 0x69, 0x49, 0x38, 0x90, 0x2e, 0xd5, 0xfa, 0x73, 0xd8, 0xf0, + 0x68, 0x44, 0x5c, 0x41, 0xa6, 0x7c, 0x46, 0x42, 0x97, 0xfe, 0x05, 0xba, 0x71, 0x91, 0x67, 0xcd, + 0x4a, 0x76, 0x7f, 0x4a, 0x80, 0xba, 0xe2, 0x94, 0x76, 0xa0, 0x03, 0xb8, 0x4e, 0x03, 0x97, 0xf9, + 0x34, 0x18, 0xd8, 0xea, 0x6a, 0x91, 0x02, 0xf2, 0x9f, 0x5c, 0x50, 0x37, 0x51, 0xf6, 0xa2, 0x6e, + 0x86, 0xc4, 0xc6, 0xf1, 0x80, 0xcd, 0x21, 0xad, 0x2e, 0x88, 0x74, 0x51, 0xa7, 0x91, 0xf6, 0x21, + 0xeb, 0x8e, 0xa3, 0x48, 0x7c, 0x10, 0x0d, 0x94, 0x58, 0x0c, 0x68, 0x53, 0x97, 0x69, 0x9c, 0x6f, + 0xe1, 0xf6, 0xbc, 0x7c, 0xd9, 0xef, 0x81, 0x26, 0x17, 0x03, 0xcd, 0xcf, 0xc9, 0x5d, 0xfd, 0x12, + 0xfe, 0xbe, 0x96, 0x47, 0x32, 0xc2, 0x21, 0x27, 0x9e, 0x24, 0xce, 0x82, 0xe2, 0x27, 0x45, 0xb3, + 0xa9, 0xea, 0xee, 0x9f, 0x02, 0xcc, 0x56, 0x01, 0xdd, 0x86, 0x5b, 0xbd, 0x2f, 0x6b, 0x5d, 0xbb, + 0x77, 0x54, 0x3b, 0x3a, 0xee, 0xd9, 0xc7, 0xed, 0x5e, 0xb7, 0x59, 0x6f, 0xed, 0xb7, 0x9a, 0x8d, + 0xdc, 0x0a, 0xba, 0x01, 0xb9, 0xf9, 0x60, 0xa7, 0xdb, 0x6c, 0xe7, 0x0c, 0xb4, 0x0d, 0x37, 0xe7, + 0xbd, 0xf5, 0xce, 0xd3, 0xee, 0x61, 0xf3, 0xa8, 0xd9, 0xc8, 0xad, 0xa2, 0x5b, 0xb0, 0x35, 0x1f, + 0x6a, 0x7e, 0xd5, 0x6d, 0x59, 0xcd, 0x46, 0x2e, 0xb1, 0x93, 0xfc, 0xfe, 0x97, 0xc2, 0xca, 0x7d, + 0x06, 0x9b, 0x97, 0x56, 0x05, 0x15, 0x60, 0x47, 0xe6, 0x37, 0x5a, 0x56, 0xb3, 0x7e, 0xd4, 0xea, + 0xb4, 0xdf, 0x1b, 0xe0, 0x62, 0xba, 0x59, 0xbc, 0xd5, 0xae, 0x77, 0x9e, 0xb6, 0xda, 0x4f, 0x72, + 0xc6, 0x15, 0xc1, 0xce, 0xf1, 0xd1, 0x93, 0x8e, 0x08, 0xae, 0xaa, 0x86, 0xe6, 0x17, 0x2f, 0xcf, + 0x0b, 0xc6, 0xab, 0xf3, 0x82, 0xf1, 0xe7, 0x79, 0xc1, 0xf8, 0xf1, 0x6d, 0x61, 0xe5, 0xd5, 0xdb, + 0xc2, 0xca, 0xef, 0x6f, 0x0b, 0x2b, 0xdf, 0xcc, 0x2b, 0xbc, 0x58, 0xe8, 0xbd, 0x11, 0x76, 0xb8, + 0x7c, 0xaa, 0x4e, 0xd4, 0x2f, 0x4f, 0xa9, 0x05, 0x4e, 0x4a, 0x9e, 0xeb, 0xe3, 0xbf, 0x03, 0x00, + 0x00, 0xff, 0xff, 0x79, 0xfe, 0xe7, 0xb2, 0x93, 0x0a, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -794,7 +794,7 @@ func (m *SupplyLimit) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x22 - n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.TimePeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.TimePeriod):]) + n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TimePeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TimePeriod):]) if err2 != nil { return 0, err2 } @@ -952,7 +952,7 @@ func (m *AssetSupply) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.TimeElapsed, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.TimeElapsed):]) + n3, err3 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TimeElapsed, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TimeElapsed):]) if err3 != nil { return 0, err3 } @@ -1077,7 +1077,7 @@ func (m *SupplyLimit) Size() (n int) { if m.TimeLimited { n += 2 } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.TimePeriod) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TimePeriod) n += 1 + l + sovBep3(uint64(l)) l = m.TimeBasedLimit.Size() n += 1 + l + sovBep3(uint64(l)) @@ -1151,7 +1151,7 @@ func (m *AssetSupply) Size() (n int) { n += 1 + l + sovBep3(uint64(l)) l = m.TimeLimitedCurrentSupply.Size() n += 1 + l + sovBep3(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.TimeElapsed) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TimeElapsed) n += 1 + l + sovBep3(uint64(l)) return n } @@ -1686,7 +1686,7 @@ func (m *SupplyLimit) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.TimePeriod, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TimePeriod, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2300,7 +2300,7 @@ func (m *AssetSupply) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.TimeElapsed, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TimeElapsed, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/bep3/types/common_test.go b/x/bep3/types/common_test.go index 95be3918..d566a3b0 100644 --- a/x/bep3/types/common_test.go +++ b/x/bep3/types/common_test.go @@ -6,7 +6,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/x/bep3/types" ) diff --git a/x/bep3/types/genesis.pb.go b/x/bep3/types/genesis.pb.go index 85ecafc4..b5f132d9 100644 --- a/x/bep3/types/genesis.pb.go +++ b/x/bep3/types/genesis.pb.go @@ -5,9 +5,9 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -153,7 +153,7 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.PreviousBlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.PreviousBlockTime):]) + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.PreviousBlockTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PreviousBlockTime):]) if err1 != nil { return 0, err1 } @@ -233,7 +233,7 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.PreviousBlockTime) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PreviousBlockTime) n += 1 + l + sovGenesis(uint64(l)) return n } @@ -403,7 +403,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.PreviousBlockTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.PreviousBlockTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/bep3/types/hash.go b/x/bep3/types/hash.go index 79ef25e4..fffab2e9 100644 --- a/x/bep3/types/hash.go +++ b/x/bep3/types/hash.go @@ -5,8 +5,8 @@ import ( "encoding/binary" "strings" + "github.com/cometbft/cometbft/crypto/tmhash" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/tendermint/crypto/tmhash" ) // GenerateSecureRandomNumber generates cryptographically strong pseudo-random number diff --git a/x/bep3/types/keys.go b/x/bep3/types/keys.go index b7b67de4..d4e5ddfc 100644 --- a/x/bep3/types/keys.go +++ b/x/bep3/types/keys.go @@ -14,9 +14,6 @@ const ( // RouterKey to be used for routing msgs RouterKey = ModuleName - // QuerierRoute is the querier route for bep3 - QuerierRoute = ModuleName - // DefaultParamspace default namestore DefaultParamspace = ModuleName diff --git a/x/bep3/types/msg.go b/x/bep3/types/msg.go index e71da632..fe299fd1 100644 --- a/x/bep3/types/msg.go +++ b/x/bep3/types/msg.go @@ -6,8 +6,8 @@ import ( "fmt" "strings" - "github.com/tendermint/tendermint/crypto" - tmbytes "github.com/tendermint/tendermint/libs/bytes" + "github.com/cometbft/cometbft/crypto" + tmbytes "github.com/cometbft/cometbft/libs/bytes" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/bep3/types/msg_test.go b/x/bep3/types/msg_test.go index 43c3687e..9bcf43b6 100644 --- a/x/bep3/types/msg_test.go +++ b/x/bep3/types/msg_test.go @@ -3,10 +3,10 @@ package types_test import ( "testing" + "github.com/cometbft/cometbft/crypto" + tmbytes "github.com/cometbft/cometbft/libs/bytes" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - "github.com/tendermint/tendermint/crypto" - tmbytes "github.com/tendermint/tendermint/libs/bytes" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/bep3/types" diff --git a/x/bep3/types/params.go b/x/bep3/types/params.go index 0f47ae10..0ec12dc1 100644 --- a/x/bep3/types/params.go +++ b/x/bep3/types/params.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmtime "github.com/cometbft/cometbft/types/time" ) const ( diff --git a/x/bep3/types/querier.go b/x/bep3/types/querier.go index 892a7a6f..63fa418d 100644 --- a/x/bep3/types/querier.go +++ b/x/bep3/types/querier.go @@ -1,8 +1,8 @@ package types import ( + tmbytes "github.com/cometbft/cometbft/libs/bytes" sdk "github.com/cosmos/cosmos-sdk/types" - tmbytes "github.com/tendermint/tendermint/libs/bytes" ) const ( diff --git a/x/bep3/types/query.pb.go b/x/bep3/types/query.pb.go index 04ac4ebf..55eaa124 100644 --- a/x/bep3/types/query.pb.go +++ b/x/bep3/types/query.pb.go @@ -10,10 +10,10 @@ import ( github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -1143,7 +1143,7 @@ func (m *AssetSupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.TimeElapsed, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.TimeElapsed):]) + n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TimeElapsed, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TimeElapsed):]) if err2 != nil { return 0, err2 } @@ -1628,7 +1628,7 @@ func (m *AssetSupplyResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.TimeLimitedCurrentSupply.Size() n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.TimeElapsed) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TimeElapsed) n += 1 + l + sovQuery(uint64(l)) return n } @@ -2205,7 +2205,7 @@ func (m *AssetSupplyResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.TimeElapsed, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TimeElapsed, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/bep3/types/swap.go b/x/bep3/types/swap.go index 136abc44..d5203223 100644 --- a/x/bep3/types/swap.go +++ b/x/bep3/types/swap.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - tmbytes "github.com/tendermint/tendermint/libs/bytes" + tmbytes "github.com/cometbft/cometbft/libs/bytes" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/bep3/types/swap_test.go b/x/bep3/types/swap_test.go index 4fd77829..ca0d6071 100644 --- a/x/bep3/types/swap_test.go +++ b/x/bep3/types/swap_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/suite" - tmbytes "github.com/tendermint/tendermint/libs/bytes" + tmbytes "github.com/cometbft/cometbft/libs/bytes" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/bep3/types/tx.pb.go b/x/bep3/types/tx.pb.go index e281b380..8929798a 100644 --- a/x/bep3/types/tx.pb.go +++ b/x/bep3/types/tx.pb.go @@ -9,9 +9,9 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/x/cdp/abci.go b/x/cdp/abci.go index a982a10b..b44b276b 100644 --- a/x/cdp/abci.go +++ b/x/cdp/abci.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/kava-labs/kava/x/cdp/keeper" "github.com/kava-labs/kava/x/cdp/types" diff --git a/x/cdp/abci_test.go b/x/cdp/abci_test.go index 564f9a84..0640aa06 100644 --- a/x/cdp/abci_test.go +++ b/x/cdp/abci_test.go @@ -10,9 +10,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/simulation" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" auctiontypes "github.com/kava-labs/kava/x/auction/types" diff --git a/x/cdp/genesis_test.go b/x/cdp/genesis_test.go index 3b43f2f3..ef9254f0 100644 --- a/x/cdp/genesis_test.go +++ b/x/cdp/genesis_test.go @@ -7,10 +7,10 @@ import ( "testing" "time" + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/cdp/integration_test.go b/x/cdp/integration_test.go index 8cc8f050..84255c29 100644 --- a/x/cdp/integration_test.go +++ b/x/cdp/integration_test.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/cdp/types" diff --git a/x/cdp/keeper/auctions_test.go b/x/cdp/keeper/auctions_test.go index 47e498a7..ba230542 100644 --- a/x/cdp/keeper/auctions_test.go +++ b/x/cdp/keeper/auctions_test.go @@ -13,9 +13,9 @@ import ( "github.com/stretchr/testify/suite" - "github.com/tendermint/tendermint/crypto" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + "github.com/cometbft/cometbft/crypto" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" ) type AuctionTestSuite struct { diff --git a/x/cdp/keeper/cdp_test.go b/x/cdp/keeper/cdp_test.go index 31efcce2..9c4b5203 100644 --- a/x/cdp/keeper/cdp_test.go +++ b/x/cdp/keeper/cdp_test.go @@ -10,8 +10,8 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/cdp/keeper" diff --git a/x/cdp/keeper/deposit_test.go b/x/cdp/keeper/deposit_test.go index faad7677..070c50b1 100644 --- a/x/cdp/keeper/deposit_test.go +++ b/x/cdp/keeper/deposit_test.go @@ -8,8 +8,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/cdp/keeper" diff --git a/x/cdp/keeper/draw_test.go b/x/cdp/keeper/draw_test.go index 960bc8cb..e3d6f979 100644 --- a/x/cdp/keeper/draw_test.go +++ b/x/cdp/keeper/draw_test.go @@ -9,8 +9,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/cdp/keeper" diff --git a/x/cdp/keeper/grpc_query_test.go b/x/cdp/keeper/grpc_query_test.go index ea022c68..3c1e06d0 100644 --- a/x/cdp/keeper/grpc_query_test.go +++ b/x/cdp/keeper/grpc_query_test.go @@ -5,13 +5,13 @@ import ( "time" sdkmath "cosmossdk.io/math" + tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/cdp/keeper" "github.com/kava-labs/kava/x/cdp/types" "github.com/stretchr/testify/suite" - tmprototypes "github.com/tendermint/tendermint/proto/tendermint/types" ) type grpcQueryTestSuite struct { diff --git a/x/cdp/keeper/integration_test.go b/x/cdp/keeper/integration_test.go index bff8b1f1..8f64e3f1 100644 --- a/x/cdp/keeper/integration_test.go +++ b/x/cdp/keeper/integration_test.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/cdp/types" diff --git a/x/cdp/keeper/interest_test.go b/x/cdp/keeper/interest_test.go index 0f27605e..d3881fc2 100644 --- a/x/cdp/keeper/interest_test.go +++ b/x/cdp/keeper/interest_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/cdp/keeper" diff --git a/x/cdp/keeper/keeper_bench_test.go b/x/cdp/keeper/keeper_bench_test.go index 077baa53..974451fd 100644 --- a/x/cdp/keeper/keeper_bench_test.go +++ b/x/cdp/keeper/keeper_bench_test.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/cdp/keeper" diff --git a/x/cdp/keeper/keeper_test.go b/x/cdp/keeper/keeper_test.go index dfbe8cc6..dff4095d 100644 --- a/x/cdp/keeper/keeper_test.go +++ b/x/cdp/keeper/keeper_test.go @@ -1,10 +1,10 @@ package keeper_test import ( + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/cdp/keeper" diff --git a/x/cdp/keeper/querier.go b/x/cdp/keeper/querier.go index 2171abe2..143dbff0 100644 --- a/x/cdp/keeper/querier.go +++ b/x/cdp/keeper/querier.go @@ -2,343 +2,13 @@ package keeper import ( "fmt" - "sort" - abci "github.com/tendermint/tendermint/abci/types" - - errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/kava-labs/kava/x/cdp/types" ) -// NewQuerier returns a new querier function -func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(ctx sdk.Context, path []string, req abci.RequestQuery) (res []byte, err error) { - switch path[0] { - case types.QueryGetCdp: - return queryGetCdp(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetCdps: - return queryGetCdps(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetCdpDeposits: - return queryGetDeposits(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetCdpsByCollateralType: // legacy, maintained for REST API - return queryGetCdpsByCollateralType(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetCdpsByCollateralization: // legacy, maintained for REST API - return queryGetCdpsByRatio(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetParams: - return queryGetParams(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetAccounts: - return queryGetAccounts(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetTotalPrincipal: - return queryGetTotalPrincipal(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetTotalCollateral: - return queryGetTotalCollateral(ctx, req, keeper, legacyQuerierCdc) - default: - return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unknown %s query endpoint %s", types.ModuleName, path[0]) - } - } -} - -// query a specific cdp -func queryGetCdp(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var requestParams types.QueryCdpParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, &requestParams) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - _, valid := keeper.GetCollateral(ctx, requestParams.CollateralType) - if !valid { - return nil, errorsmod.Wrap(types.ErrInvalidCollateral, requestParams.CollateralType) - } - - cdp, found := keeper.GetCdpByOwnerAndCollateralType(ctx, requestParams.Owner, requestParams.CollateralType) - if !found { - return nil, errorsmod.Wrapf(types.ErrCdpNotFound, "owner %s, denom %s", requestParams.Owner, requestParams.CollateralType) - } - - augmentedCDP := keeper.LoadAugmentedCDP(ctx, cdp) - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, augmentedCDP) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -// query deposits on a particular cdp -func queryGetDeposits(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var requestParams types.QueryCdpDeposits - err := legacyQuerierCdc.UnmarshalJSON(req.Data, &requestParams) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - _, valid := keeper.GetCollateral(ctx, requestParams.CollateralType) - if !valid { - return nil, errorsmod.Wrap(types.ErrInvalidCollateral, requestParams.CollateralType) - } - - cdp, found := keeper.GetCdpByOwnerAndCollateralType(ctx, requestParams.Owner, requestParams.CollateralType) - if !found { - return nil, errorsmod.Wrapf(types.ErrCdpNotFound, "owner %s, denom %s", requestParams.Owner, requestParams.CollateralType) - } - - deposits := keeper.GetDeposits(ctx, cdp.ID) - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, deposits) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -// query cdps with matching denom and ratio LESS THAN the input ratio -func queryGetCdpsByRatio(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var requestParams types.QueryCdpsByRatioParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, &requestParams) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - _, valid := keeper.GetCollateral(ctx, requestParams.CollateralType) - if !valid { - return nil, errorsmod.Wrap(types.ErrInvalidCollateral, requestParams.CollateralType) - } - - ratio, err := keeper.CalculateCollateralizationRatioFromAbsoluteRatio(ctx, requestParams.CollateralType, requestParams.Ratio, "liquidation") - if err != nil { - return nil, errorsmod.Wrap(err, "couldn't get collateralization ratio from absolute ratio") - } - - cdps := keeper.GetAllCdpsByCollateralTypeAndRatio(ctx, requestParams.CollateralType, ratio) - // augment CDPs by adding collateral value and collateralization ratio - var augmentedCDPs types.AugmentedCDPs - for _, cdp := range cdps { - augmentedCDP := keeper.LoadAugmentedCDP(ctx, cdp) - augmentedCDPs = append(augmentedCDPs, augmentedCDP) - } - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, augmentedCDPs) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -// query all cdps with matching collateral type -func queryGetCdpsByCollateralType(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var requestParams types.QueryCdpsByCollateralTypeParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, &requestParams) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - _, valid := keeper.GetCollateral(ctx, requestParams.CollateralType) - if !valid { - return nil, errorsmod.Wrap(types.ErrInvalidCollateral, requestParams.CollateralType) - } - - cdps := keeper.GetAllCdpsByCollateralType(ctx, requestParams.CollateralType) - // augment CDPs by adding collateral value and collateralization ratio - var augmentedCDPs types.AugmentedCDPs - for _, cdp := range cdps { - augmentedCDP := keeper.LoadAugmentedCDP(ctx, cdp) - augmentedCDPs = append(augmentedCDPs, augmentedCDP) - } - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, augmentedCDPs) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -// query params in the cdp store -func queryGetParams(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - // Get params - params := keeper.GetParams(ctx) - - // Encode results - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, params) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -// query cdp module accounts -func queryGetAccounts(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - cdpAccAccount := keeper.accountKeeper.GetModuleAccount(ctx, types.ModuleName) - liquidatorAccAccount := keeper.accountKeeper.GetModuleAccount(ctx, types.LiquidatorMacc) - - accounts := []authtypes.ModuleAccount{ - *cdpAccAccount.(*authtypes.ModuleAccount), - *liquidatorAccAccount.(*authtypes.ModuleAccount), - } - - // Encode results - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, accounts) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -// query cdps in store and filter by request params -func queryGetCdps(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryCdpsParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - // Filter CDPs - filteredCDPs, err := FilterCDPs(ctx, keeper, params) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, filteredCDPs) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -// query total amount of principal (ie. usdx) that has been minted with a particular collateral type -func queryGetTotalPrincipal(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryGetTotalPrincipalParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - var queryCollateralTypes []string - - if params.CollateralType != "" { - // Single collateralType provided - queryCollateralTypes = append(queryCollateralTypes, params.CollateralType) - } else { - // No collateralType provided, respond with all of them - keeperParams := keeper.GetParams(ctx) - - for _, collateral := range keeperParams.CollateralParams { - queryCollateralTypes = append(queryCollateralTypes, collateral.Type) - } - } - - var collateralPrincipals types.TotalPrincipals - - for _, queryType := range queryCollateralTypes { - // Hardcoded to default USDX - principalAmount := keeper.GetTotalPrincipal(ctx, queryType, types.DefaultStableDenom) - // Wrap it in an sdk.Coin - totalAmountCoin := sdk.NewCoin(types.DefaultStableDenom, principalAmount) - - totalPrincipal := types.NewTotalPrincipal(queryType, totalAmountCoin) - collateralPrincipals = append(collateralPrincipals, totalPrincipal) - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, collateralPrincipals) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -// query total amount of collateral (ie. btcb) that has been deposited with a particular collateral type -func queryGetTotalCollateral(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var request types.QueryGetTotalCollateralParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, &request) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - params := keeper.GetParams(ctx) - denomCollateralTypes := make(map[string][]string) - - // collect collateral types for each denom - for _, collateralParam := range params.CollateralParams { - denomCollateralTypes[collateralParam.Denom] = append(denomCollateralTypes[collateralParam.Denom], collateralParam.Type) - } - - // sort collateral types alphabetically - for _, collateralTypes := range denomCollateralTypes { - sort.Slice(collateralTypes, func(i int, j int) bool { - return collateralTypes[i] < collateralTypes[j] - }) - } - - // get total collateral in all cdps - cdpAccount := keeper.accountKeeper.GetModuleAccount(ctx, types.ModuleName) - totalCdpCollateral := keeper.bankKeeper.GetAllBalances(ctx, cdpAccount.GetAddress()) - - var response types.TotalCollaterals - - for denom, collateralTypes := range denomCollateralTypes { - // skip any denoms that do not match the requested collateral type - if request.CollateralType != "" { - match := false - for _, ctype := range collateralTypes { - if ctype == request.CollateralType { - match = true - } - } - - if !match { - continue - } - } - - totalCollateral := totalCdpCollateral.AmountOf(denom) - - // we need to query individual cdps for denoms with more than one collateral type - for i := len(collateralTypes) - 1; i > 0; i-- { - cdps := keeper.GetAllCdpsByCollateralType(ctx, collateralTypes[i]) - - collateral := sdk.ZeroInt() - - for _, cdp := range cdps { - collateral = collateral.Add(cdp.Collateral.Amount) - } - - totalCollateral = totalCollateral.Sub(collateral) - - // if we have no collateralType filter, or the filter matches, include it in the response - if request.CollateralType == "" || collateralTypes[i] == request.CollateralType { - response = append(response, types.NewTotalCollateral(collateralTypes[i], sdk.NewCoin(denom, collateral))) - } - - // skip the rest of the cdp queries if we have a matching filter - if collateralTypes[i] == request.CollateralType { - break - } - } - - if request.CollateralType == "" || collateralTypes[0] == request.CollateralType { - // all leftover total collateral belongs to the first collateral type - response = append(response, types.NewTotalCollateral(collateralTypes[0], sdk.NewCoin(denom, totalCollateral))) - } - } - - // sort to ensure deterministic response - sort.Slice(response, func(i int, j int) bool { - return response[i].CollateralType < response[j].CollateralType - }) - - // encode response - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, response) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - // FilterCDPs queries the store for all CDPs that match query params func FilterCDPs(ctx sdk.Context, k Keeper, params types.QueryCdpsParams) (types.AugmentedCDPs, error) { var matchCollateralType, matchOwner, matchID, matchRatio types.CDPs diff --git a/x/cdp/keeper/querier_test.go b/x/cdp/keeper/querier_test.go deleted file mode 100644 index 41fa16b1..00000000 --- a/x/cdp/keeper/querier_test.go +++ /dev/null @@ -1,474 +0,0 @@ -package keeper_test - -import ( - "math/rand" - "sort" - "strings" - "testing" - "time" - - "github.com/stretchr/testify/suite" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/simulation" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" - - "github.com/kava-labs/kava/app" - "github.com/kava-labs/kava/x/cdp/keeper" - "github.com/kava-labs/kava/x/cdp/types" - pfkeeper "github.com/kava-labs/kava/x/pricefeed/keeper" - pftypes "github.com/kava-labs/kava/x/pricefeed/types" -) - -const ( - custom = "custom" -) - -type QuerierTestSuite struct { - suite.Suite - - keeper keeper.Keeper - pricefeedKeeper pfkeeper.Keeper - addrs []sdk.AccAddress - app app.TestApp - cdps types.CDPs - augmentedCDPs types.AugmentedCDPs - ctx sdk.Context - querier sdk.Querier - cdc codec.Codec - legacyAmino codec.LegacyAmino -} - -func (suite *QuerierTestSuite) SetupTest() { - tApp := app.NewTestApp() - ctx := tApp.NewContext(true, tmproto.Header{Height: 1, Time: tmtime.Now()}) - suite.cdc = tApp.AppCodec() - suite.legacyAmino = *tApp.LegacyAmino() - - cdps := make(types.CDPs, 100) - augmentedCDPs := make(types.AugmentedCDPs, 100) - _, addrs := app.GeneratePrivKeyAddressPairs(100) - coins := cs(c("btc", 10000000000), c("xrp", 10000000000)) - - authGS := app.NewFundedGenStateWithSameCoins(tApp.AppCodec(), coins, addrs) - tApp.InitializeFromGenesisStates( - authGS, - NewPricefeedGenStateMulti(suite.cdc), - NewCDPGenStateHighDebtLimit(suite.cdc), - ) - - suite.ctx = ctx - suite.app = tApp - suite.keeper = tApp.GetCDPKeeper() - suite.pricefeedKeeper = tApp.GetPriceFeedKeeper() - - // Set up markets - oracle := addrs[9] - marketParams := pftypes.Params{ - Markets: pftypes.Markets{ - pftypes.Market{MarketID: "xrp-usd", BaseAsset: "xrp", QuoteAsset: "usd", Oracles: []sdk.AccAddress{oracle}, Active: true}, - pftypes.Market{MarketID: "btc-usd", BaseAsset: "btc", QuoteAsset: "usd", Oracles: []sdk.AccAddress{oracle}, Active: true}, - }, - } - suite.pricefeedKeeper.SetParams(ctx, marketParams) - - // Set collateral prices for use in collateralization calculations - _, err := suite.pricefeedKeeper.SetPrice( - ctx, oracle, "xrp-usd", - sdk.MustNewDecFromStr("0.75"), - time.Now().Add(1*time.Hour)) - suite.Nil(err) - - _, err = suite.pricefeedKeeper.SetPrice( - ctx, oracle, "btc-usd", - sdk.MustNewDecFromStr("5000"), - time.Now().Add(1*time.Hour)) - suite.Nil(err) - - for j := 0; j < 100; j++ { - collateral := "xrp" - amount := simulation.RandIntBetween(rand.New(rand.NewSource(int64(j))), 2500000000, 9000000000) - debt := simulation.RandIntBetween(rand.New(rand.NewSource(int64(j))), 50000000, 250000000) - if j%2 == 0 { - collateral = "btc" - amount = simulation.RandIntBetween(rand.New(rand.NewSource(int64(j))), 500000000, 5000000000) - debt = simulation.RandIntBetween(rand.New(rand.NewSource(int64(j))), 1000000000, 25000000000) - } - err = suite.keeper.AddCdp(suite.ctx, addrs[j], c(collateral, int64(amount)), c("usdx", int64(debt)), collateral+"-a") - suite.NoError(err) - c, f := suite.keeper.GetCDP(suite.ctx, collateral+"-a", uint64(j+1)) - suite.True(f) - cdps[j] = c - aCDP := suite.keeper.LoadAugmentedCDP(suite.ctx, c) - augmentedCDPs[j] = aCDP - } - - suite.cdps = cdps - suite.augmentedCDPs = augmentedCDPs - suite.querier = keeper.NewQuerier(suite.keeper, tApp.LegacyAmino()) - suite.addrs = addrs -} - -func (suite *QuerierTestSuite) TestQueryCdp() { - ctx := suite.ctx.WithIsCheckTx(false) - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetCdp}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryCdpParams(suite.cdps[0].Owner, suite.cdps[0].Type)), - } - bz, err := suite.querier(ctx, []string{types.QueryGetCdp}, query) - suite.Nil(err) - suite.NotNil(bz) - - var c types.AugmentedCDP - suite.Nil(suite.legacyAmino.UnmarshalJSON(bz, &c)) - suite.Equal(suite.augmentedCDPs[0], c) - - query = abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetCdp}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryCdpParams(suite.cdps[0].Owner, "lol-a")), - } - _, err = suite.querier(ctx, []string{types.QueryGetCdp}, query) - suite.Error(err) - - query = abci.RequestQuery{ - Path: strings.Join([]string{custom, "nonsense"}, "/"), - Data: []byte("nonsense"), - } - - _, err = suite.querier(ctx, []string{query.Path}, query) - suite.Error(err) - - _, err = suite.querier(ctx, []string{types.QueryGetCdp}, query) - suite.Error(err) - - query = abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetCdp}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryCdpParams(suite.cdps[0].Owner, "xrp-a")), - } - _, err = suite.querier(ctx, []string{types.QueryGetCdp}, query) - suite.Error(err) -} - -func (suite *QuerierTestSuite) TestQueryCdpsByCollateralType() { - ctx := suite.ctx.WithIsCheckTx(false) - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetCdpsByCollateralType}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryCdpsByCollateralTypeParams(suite.cdps[0].Type)), - } - bz, err := suite.querier(ctx, []string{types.QueryGetCdpsByCollateralType}, query) - suite.Nil(err) - suite.NotNil(bz) - - var c types.AugmentedCDPs - suite.Nil(suite.legacyAmino.UnmarshalJSON(bz, &c)) - suite.Equal(50, len(c)) - - query = abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetCdpsByCollateralType}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryCdpsByCollateralTypeParams("lol-a")), - } - _, err = suite.querier(ctx, []string{types.QueryGetCdpsByCollateralType}, query) - suite.Error(err) -} - -func (suite *QuerierTestSuite) TestQueryCdpsByRatio() { - ratioCountBtc := 0 - ratioCountXrp := 0 - xrpRatio := d("2.0") - btcRatio := d("2500") - expectedXrpIds := []int{} - expectedBtcIds := []int{} - for _, cdp := range suite.cdps { - absoluteRatio := suite.keeper.CalculateCollateralToDebtRatio(suite.ctx, cdp.Collateral, cdp.Type, cdp.Principal) - collateralizationRatio, err := suite.keeper.CalculateCollateralizationRatioFromAbsoluteRatio(suite.ctx, cdp.Type, absoluteRatio, "liquidation") - suite.Nil(err) - if cdp.Collateral.Denom == "xrp" { - if collateralizationRatio.LT(xrpRatio) { - ratioCountXrp += 1 - expectedXrpIds = append(expectedXrpIds, int(cdp.ID)) - } - } else { - if collateralizationRatio.LT(btcRatio) { - ratioCountBtc += 1 - expectedBtcIds = append(expectedBtcIds, int(cdp.ID)) - } - } - } - - ctx := suite.ctx.WithIsCheckTx(false) - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetCdpsByCollateralization}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryCdpsByRatioParams("xrp-a", xrpRatio)), - } - bz, err := suite.querier(ctx, []string{types.QueryGetCdpsByCollateralization}, query) - suite.Nil(err) - suite.NotNil(bz) - - var c types.AugmentedCDPs - actualXrpIds := []int{} - suite.Nil(suite.legacyAmino.UnmarshalJSON(bz, &c)) - for _, k := range c { - actualXrpIds = append(actualXrpIds, int(k.ID)) - } - sort.Ints(actualXrpIds) - suite.Equal(expectedXrpIds, actualXrpIds) - - query = abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetCdpsByCollateralization}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryCdpsByRatioParams("btc-a", btcRatio)), - } - bz, err = suite.querier(ctx, []string{types.QueryGetCdpsByCollateralization}, query) - suite.Nil(err) - suite.NotNil(bz) - - c = types.AugmentedCDPs{} - actualBtcIds := []int{} - suite.Nil(suite.legacyAmino.UnmarshalJSON(bz, &c)) - for _, k := range c { - actualBtcIds = append(actualBtcIds, int(k.ID)) - } - sort.Ints(actualBtcIds) - suite.Equal(expectedBtcIds, actualBtcIds) - - query = abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetCdpsByCollateralization}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryCdpsByRatioParams("xrp-a", d("0.003"))), - } - bz, err = suite.querier(ctx, []string{types.QueryGetCdpsByCollateralization}, query) - suite.Nil(err) - suite.NotNil(bz) - c = types.AugmentedCDPs{} - suite.Nil(suite.legacyAmino.UnmarshalJSON(bz, &c)) - suite.Equal(0, len(c)) -} - -func (suite *QuerierTestSuite) TestQueryParams() { - ctx := suite.ctx.WithIsCheckTx(false) - bz, err := suite.querier(ctx, []string{types.QueryGetParams}, abci.RequestQuery{}) - suite.NoError(err) - suite.NotNil(bz) - - var p types.Params - err = suite.legacyAmino.UnmarshalJSON(bz, &p) - suite.NoError(err) - - cdpGS := NewCDPGenStateHighDebtLimit(suite.app.AppCodec()) - gs := types.GenesisState{} - err = suite.legacyAmino.UnmarshalJSON(cdpGS["cdp"], &gs) - suite.NoError(err) - - suite.Equal(gs.Params, p) -} - -func (suite *QuerierTestSuite) TestQueryDeposits() { - ctx := suite.ctx.WithIsCheckTx(false) - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetCdpDeposits}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryCdpDeposits(suite.cdps[0].Owner, suite.cdps[0].Type)), - } - - bz, err := suite.querier(ctx, []string{types.QueryGetCdpDeposits}, query) - suite.Nil(err) - suite.NotNil(bz) - - deposits := suite.keeper.GetDeposits(ctx, suite.cdps[0].ID) - - var d types.Deposits - suite.Nil(suite.legacyAmino.UnmarshalJSON(bz, &d)) - suite.Equal(deposits, d) -} - -func (suite *QuerierTestSuite) TestQueryAccounts() { - bz, err := suite.querier(suite.ctx, []string{types.QueryGetAccounts}, abci.RequestQuery{}) - suite.Require().NoError(err) - suite.Require().NotNil(bz) - - var accounts []authtypes.ModuleAccount - suite.Require().Nil(suite.legacyAmino.UnmarshalJSON(bz, &accounts)) - suite.Require().Equal(2, len(accounts)) - - findByName := func(name string) bool { - for _, account := range accounts { - if account.GetName() == name { - return true - } - } - return false - } - - suite.Require().True(findByName("cdp")) - suite.Require().True(findByName("liquidator")) -} - -func (suite *QuerierTestSuite) TestFindIntersection() { - a := types.CDPs{suite.cdps[0], suite.cdps[1], suite.cdps[2], suite.cdps[3], suite.cdps[4]} - b := types.CDPs{suite.cdps[3], suite.cdps[4], suite.cdps[5], suite.cdps[6], suite.cdps[7]} - expectedIntersection1 := types.CDPs{suite.cdps[3], suite.cdps[4]} - - intersection1 := keeper.FindIntersection(a, b) - suite.Require().Equal(expectedIntersection1, intersection1) - - c := types.CDPs{suite.cdps[0], suite.cdps[1], suite.cdps[2], suite.cdps[3], suite.cdps[4]} - d := types.CDPs{suite.cdps[5], suite.cdps[6], suite.cdps[7], suite.cdps[8], suite.cdps[9]} - expectedIntersection2 := types.CDPs{} - - intersection2 := keeper.FindIntersection(c, d) - suite.Require().Equal(expectedIntersection2, intersection2) - - e := types.CDPs{suite.cdps[0]} - f := types.CDPs{} - expectedIntersection3 := types.CDPs{} - - intersection3 := keeper.FindIntersection(e, f) - suite.Require().Equal(expectedIntersection3, intersection3) -} - -func (suite *QuerierTestSuite) TestFilterCDPs() { - paramsType := types.NewQueryCdpsParams(1, 100, "btc-a", sdk.AccAddress{}, 0, sdk.ZeroDec()) - filteredCDPs1, err := keeper.FilterCDPs(suite.ctx, suite.keeper, paramsType) - suite.Require().NoError(err) - suite.Require().Equal(50, len(filteredCDPs1)) - - paramsOwner := types.NewQueryCdpsParams(1, 100, "", suite.cdps[10].Owner, 0, sdk.ZeroDec()) - filteredCDPs2, err := keeper.FilterCDPs(suite.ctx, suite.keeper, paramsOwner) - suite.Require().NoError(err) - suite.Require().Equal(1, len(filteredCDPs2)) - suite.Require().Equal(suite.cdps[10].Owner, filteredCDPs2[0].Owner) - - paramsID := types.NewQueryCdpsParams(1, 100, "", sdk.AccAddress{}, 68, sdk.ZeroDec()) - filteredCDPs3, err := keeper.FilterCDPs(suite.ctx, suite.keeper, paramsID) - suite.Require().NoError(err) - suite.Require().Equal(1, len(filteredCDPs3)) - suite.Require().Equal(suite.cdps[68-1].ID, filteredCDPs3[0].ID) - - ratioCountBtc := 0 - btcRatio := d("2500") - for _, cdp := range suite.cdps { - if cdp.Type == "btc-a" { - absoluteRatio := suite.keeper.CalculateCollateralToDebtRatio(suite.ctx, cdp.Collateral, cdp.Type, cdp.Principal) - collateralizationRatio, _ := suite.keeper.CalculateCollateralizationRatioFromAbsoluteRatio(suite.ctx, cdp.Type, absoluteRatio, "liquidation") - if collateralizationRatio.LT(btcRatio) { - ratioCountBtc += 1 - } - } - } - paramsTypeAndRatio := types.NewQueryCdpsParams(1, 100, "btc-a", sdk.AccAddress{}, 0, sdk.NewDec(2500)) - filteredCDPs4, err := keeper.FilterCDPs(suite.ctx, suite.keeper, paramsTypeAndRatio) - suite.Require().NoError(err) - suite.Require().Equal(ratioCountBtc, len(filteredCDPs4)) -} - -func (suite *QuerierTestSuite) TestQueryCdps() { - ctx := suite.ctx.WithIsCheckTx(false) - params := types.NewQueryCdpsParams(1, 100, "btc-a", sdk.AccAddress{}, 0, sdk.ZeroDec()) - - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetCdps}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(params), - } - - bz, err := suite.querier(ctx, []string{types.QueryGetCdps}, query) - suite.Nil(err) - suite.NotNil(bz) - - output := types.AugmentedCDPs{} - suite.Nil(suite.legacyAmino.UnmarshalJSON(bz, &output)) - suite.Equal(50, len(output)) -} - -func (suite *QuerierTestSuite) TestQueryTotalPrincipal() { - ctx := suite.ctx.WithIsCheckTx(false) - params := types.NewQueryGetTotalPrincipalParams("btc-a") - - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetTotalPrincipal}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(params), - } - - bz, err := suite.querier(ctx, []string{types.QueryGetTotalPrincipal}, query) - suite.Nil(err) - suite.NotNil(bz) - - var output types.TotalPrincipals - suite.Nil(suite.legacyAmino.UnmarshalJSON(bz, &output)) - suite.Equal(1, len(output)) - suite.Equal("btc-a", output[0].CollateralType) -} - -func (suite *QuerierTestSuite) TestQueryTotalPrincipalAll() { - ctx := suite.ctx.WithIsCheckTx(false) - params := types.NewQueryGetTotalPrincipalParams("") - - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetTotalPrincipal}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(params), - } - - bz, err := suite.querier(ctx, []string{types.QueryGetTotalPrincipal}, query) - suite.Nil(err) - suite.NotNil(bz) - - var output types.TotalPrincipals - suite.Nil(suite.legacyAmino.UnmarshalJSON(bz, &output)) - - var outputTypes []string - for _, c := range output { - outputTypes = append(outputTypes, c.CollateralType) - } - - suite.Greater(len(output), 0) - suite.Subset(outputTypes, []string{"btc-a", "xrp-a"}) -} - -func (suite *QuerierTestSuite) TestQueryTotalCollateral() { - ctx := suite.ctx.WithIsCheckTx(false) - params := types.NewQueryGetTotalCollateralParams("btc-a") - - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetTotalCollateral}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(params), - } - - bz, err := suite.querier(ctx, []string{types.QueryGetTotalCollateral}, query) - suite.Nil(err) - suite.NotNil(bz) - - var output types.TotalCollaterals - suite.Nil(suite.legacyAmino.UnmarshalJSON(bz, &output)) - suite.Equal(1, len(output)) - suite.Equal("btc-a", output[0].CollateralType) -} - -func (suite *QuerierTestSuite) TestQueryTotalCollateralAll() { - ctx := suite.ctx.WithIsCheckTx(false) - params := types.NewQueryGetTotalCollateralParams("") - - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryGetTotalCollateral}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(params), - } - - bz, err := suite.querier(ctx, []string{types.QueryGetTotalCollateral}, query) - suite.Nil(err) - suite.NotNil(bz) - - var output types.TotalCollaterals - suite.Nil(suite.legacyAmino.UnmarshalJSON(bz, &output)) - - var outputTypes []string - for _, c := range output { - outputTypes = append(outputTypes, c.CollateralType) - } - - suite.Greater(len(output), 0) - suite.Subset(outputTypes, []string{"btc-a", "xrp-a"}) -} - -func TestQuerierTestSuite(t *testing.T) { - suite.Run(t, new(QuerierTestSuite)) -} diff --git a/x/cdp/keeper/seize_test.go b/x/cdp/keeper/seize_test.go index 45a985c6..37c8428a 100644 --- a/x/cdp/keeper/seize_test.go +++ b/x/cdp/keeper/seize_test.go @@ -14,9 +14,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/simulation" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" auctiontypes "github.com/kava-labs/kava/x/auction/types" @@ -43,7 +43,7 @@ type liquidationTracker struct { func (suite *SeizeTestSuite) SetupTest() { tApp := app.NewTestApp() - ctx := tApp.NewContext(true, tmproto.Header{Height: 1, Time: tmtime.Now(), ChainID: "kavatest_1-1"}) + ctx := tApp.NewContext(true, tmproto.Header{Height: 1, Time: tmtime.Now(), ChainID: app.TestChainId}) tracker := liquidationTracker{} coins := cs(c("btc", 100000000), c("xrp", 10000000000)) _, addrs := app.GeneratePrivKeyAddressPairs(100) diff --git a/x/cdp/migrations/v2/store_test.go b/x/cdp/migrations/v2/store_test.go index 9a585967..13da0382 100644 --- a/x/cdp/migrations/v2/store_test.go +++ b/x/cdp/migrations/v2/store_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" v2cdp "github.com/kava-labs/kava/x/cdp/migrations/v2" @@ -15,7 +15,7 @@ import ( ) func TestStoreMigrationAddsKeyTableIncludingNewParam(t *testing.T) { - encCfg := simapp.MakeTestEncodingConfig() + encCfg := moduletestutil.MakeTestEncodingConfig() cdpKey := sdk.NewKVStoreKey(types.ModuleName) tcdpKey := sdk.NewTransientStoreKey("transient_test") ctx := testutil.DefaultContext(cdpKey, tcdpKey) @@ -37,7 +37,7 @@ func TestStoreMigrationAddsKeyTableIncludingNewParam(t *testing.T) { } func TestStoreMigrationSetsNewParamOnExistingKeyTable(t *testing.T) { - encCfg := simapp.MakeTestEncodingConfig() + encCfg := moduletestutil.MakeTestEncodingConfig() cdpKey := sdk.NewKVStoreKey(types.ModuleName) tcdpKey := sdk.NewTransientStoreKey("transient_test") ctx := testutil.DefaultContext(cdpKey, tcdpKey) diff --git a/x/cdp/module.go b/x/cdp/module.go index 8061ea42..32d07d1c 100644 --- a/x/cdp/module.go +++ b/x/cdp/module.go @@ -14,7 +14,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/kava-labs/kava/x/cdp/client/cli" "github.com/kava-labs/kava/x/cdp/keeper" @@ -24,7 +24,6 @@ import ( var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - // _ module.AppModuleSimulation = AppModule{} ) // ConsensusVersion defines the current module consensus version. @@ -72,11 +71,6 @@ func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux } } -// LegacyQuerierHandler returns no sdk.Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return keeper.NewQuerier(am.keeper, legacyQuerierCdc) -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion @@ -123,16 +117,6 @@ func (AppModule) Name() string { // RegisterInvariants register module invariants func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} -// Route module message route name -func (am AppModule) Route() sdk.Route { - return sdk.Route{} -} - -// QuerierRoute module querier route name -func (AppModule) QuerierRoute() string { - return types.QuerierRoute -} - // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) @@ -169,30 +153,3 @@ func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } - -//____________________________________________________________________________ - -// // GenerateGenesisState creates a randomized GenState of the cdp module -// func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState) { -// simulation.RandomizedGenState(simState) -// } - -// // ProposalContents doesn't return any content functions for governance proposals. -// func (AppModuleBasic) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent { -// return nil -// } - -// // RandomizedParams returns nil because cdp has no params. -// func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange { -// return simulation.ParamChanges(r) -// } - -// // RegisterStoreDecoder registers a decoder for cdp module's types -// func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { -// sdr[StoreKey] = simulation.DecodeStore -// } - -// // WeightedOperations returns the all the cdp module operations with their respective weights. -// func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation { -// return simulation.WeightedOperations(simState.AppParams, simState.Cdc, am.accountKeeper, am.keeper, am.pricefeedKeeper) -// } diff --git a/x/cdp/simulation/decoder.go b/x/cdp/simulation/decoder.go deleted file mode 100644 index d0cf96f7..00000000 --- a/x/cdp/simulation/decoder.go +++ /dev/null @@ -1,64 +0,0 @@ -package simulation - -// import ( -// "bytes" -// "encoding/binary" -// "fmt" - -// "github.com/tendermint/tendermint/libs/kv" - -// "github.com/cosmos/cosmos-sdk/codec" -// sdk "github.com/cosmos/cosmos-sdk/types" - -// "github.com/kava-labs/kava/x/cdp/types" -// ) - -// // DecodeStore unmarshals the KVPair's Value to the corresponding cdp type -// func DecodeStore(cdc *codec.Codec, kvA, kvB kv.Pair) string { -// switch { -// case bytes.Equal(kvA.Key[:1], types.CdpIDKeyPrefix): -// var cdpIDsA, cdpIDsB []uint64 -// cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &cdpIDsA) -// cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &cdpIDsB) -// return fmt.Sprintf("%v\n%v", cdpIDsA, cdpIDsB) - -// case bytes.Equal(kvA.Key[:1], types.CdpKeyPrefix): -// var cdpA, cdpB types.CDP -// cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &cdpA) -// cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &cdpB) -// return fmt.Sprintf("%v\n%v", cdpA, cdpB) - -// case bytes.Equal(kvA.Key[:1], types.CdpIDKey), -// bytes.Equal(kvA.Key[:1], types.CollateralRatioIndexPrefix): -// idA := binary.BigEndian.Uint64(kvA.Value) -// idB := binary.BigEndian.Uint64(kvB.Value) -// return fmt.Sprintf("%d\n%d", idA, idB) - -// case bytes.Equal(kvA.Key[:1], types.DebtDenomKey), -// bytes.Equal(kvA.Key[:1], types.GovDenomKey): -// var denomA, denomB string -// cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &denomA) -// cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &denomB) -// return fmt.Sprintf("%s\n%s", denomA, denomB) - -// case bytes.Equal(kvA.Key[:1], types.DepositKeyPrefix): -// var depositA, depositB types.Deposit -// cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &depositA) -// cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &depositB) -// return fmt.Sprintf("%s\n%s", depositA, depositB) - -// case bytes.Equal(kvA.Key[:1], types.PrincipalKeyPrefix): -// var totalA, totalB sdkmath.Int -// cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &totalA) -// cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &totalB) -// return fmt.Sprintf("%s\n%s", totalA, totalB) - -// case bytes.Equal(kvA.Key[:1], types.InterestFactorPrefix): -// var totalA, totalB sdk.Dec -// cdc.MustUnmarshalBinaryBare(kvA.Value, &totalA) -// cdc.MustUnmarshalBinaryBare(kvB.Value, &totalB) -// return fmt.Sprintf("%s\n%s", totalA, totalB) -// default: -// panic(fmt.Sprintf("invalid %s key prefix %X", types.ModuleName, kvA.Key[:1])) -// } -// } diff --git a/x/cdp/simulation/decoder_test.go b/x/cdp/simulation/decoder_test.go deleted file mode 100644 index 2aa9914a..00000000 --- a/x/cdp/simulation/decoder_test.go +++ /dev/null @@ -1,74 +0,0 @@ -package simulation - -// import ( -// "fmt" -// "testing" -// "time" - -// "github.com/stretchr/testify/require" - -// "github.com/tendermint/tendermint/libs/kv" - -// "github.com/cosmos/cosmos-sdk/codec" -// sdk "github.com/cosmos/cosmos-sdk/types" - -// "github.com/kava-labs/kava/x/cdp/types" -// ) - -// func makeTestCodec() (cdc *codec.Codec) { -// cdc = codec.New() -// sdk.RegisterCodec(cdc) -// codec.RegisterCrypto(cdc) -// types.RegisterCodec(cdc) -// return -// } - -// func TestDecodeDistributionStore(t *testing.T) { -// cdc := makeTestCodec() - -// cdpIds := []uint64{1, 2, 3, 4, 5} -// denom := "denom" -// oneCoins := sdk.NewCoin(denom, sdk.OneInt()) -// deposit := types.Deposit{CdpID: 1, Amount: oneCoins} -// principal := sdk.OneInt() -// prevDistTime := time.Now().UTC() -// cdp := types.CDP{ID: 1, FeesUpdated: prevDistTime, Collateral: oneCoins, Principal: oneCoins, AccumulatedFees: oneCoins, InterestFactor: sdk.OneDec()} - -// kvPairs := kv.Pairs{ -// kv.Pair{Key: types.CdpIDKeyPrefix, Value: cdc.MustMarshalBinaryLengthPrefixed(cdpIds)}, -// kv.Pair{Key: types.CdpKeyPrefix, Value: cdc.MustMarshalBinaryLengthPrefixed(cdp)}, -// kv.Pair{Key: types.CdpIDKey, Value: sdk.Uint64ToBigEndian(2)}, -// kv.Pair{Key: types.CollateralRatioIndexPrefix, Value: sdk.Uint64ToBigEndian(10)}, -// kv.Pair{Key: []byte(types.DebtDenomKey), Value: cdc.MustMarshalBinaryLengthPrefixed(denom)}, -// kv.Pair{Key: []byte(types.GovDenomKey), Value: cdc.MustMarshalBinaryLengthPrefixed(denom)}, -// kv.Pair{Key: []byte(types.DepositKeyPrefix), Value: cdc.MustMarshalBinaryLengthPrefixed(deposit)}, -// kv.Pair{Key: []byte(types.PrincipalKeyPrefix), Value: cdc.MustMarshalBinaryLengthPrefixed(principal)}, -// kv.Pair{Key: []byte{0x99}, Value: []byte{0x99}}, -// } - -// tests := []struct { -// name string -// expectedLog string -// }{ -// {"CdpIDs", fmt.Sprintf("%v\n%v", cdpIds, cdpIds)}, -// {"CDP", fmt.Sprintf("%v\n%v", cdp, cdp)}, -// {"CdpID", "2\n2"}, -// {"CollateralRatioIndex", "10\n10"}, -// {"DebtDenom", fmt.Sprintf("%s\n%s", denom, denom)}, -// {"GovDenom", fmt.Sprintf("%s\n%s", denom, denom)}, -// {"DepositKeyPrefix", fmt.Sprintf("%v\n%v", deposit, deposit)}, -// {"Principal", fmt.Sprintf("%v\n%v", principal, principal)}, -// {"other", ""}, -// } -// for i, tt := range tests { -// i, tt := i, tt -// t.Run(tt.name, func(t *testing.T) { -// switch i { -// case len(tests) - 1: -// require.Panics(t, func() { DecodeStore(cdc, kvPairs[i], kvPairs[i]) }, tt.name) -// default: -// require.Equal(t, tt.expectedLog, DecodeStore(cdc, kvPairs[i], kvPairs[i]), tt.name) -// } -// }) -// } -// } diff --git a/x/cdp/simulation/genesis.go b/x/cdp/simulation/genesis.go deleted file mode 100644 index 365e5232..00000000 --- a/x/cdp/simulation/genesis.go +++ /dev/null @@ -1,194 +0,0 @@ -package simulation - -// import ( -// "fmt" -// "time" - -// "github.com/cosmos/cosmos-sdk/codec" -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/cosmos/cosmos-sdk/types/module" -// "github.com/cosmos/cosmos-sdk/x/auth" -// authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" -// "github.com/cosmos/cosmos-sdk/x/supply" -// supplyexported "github.com/cosmos/cosmos-sdk/x/supply/exported" - -// "github.com/kava-labs/kava/x/cdp/types" -// ) - -// // RandomizedGenState generates a random GenesisState for cdp -// func RandomizedGenState(simState *module.SimulationState) { - -// cdpGenesis := randomCdpGenState(simState.Rand.Intn(2)) - -// // hacky way to give accounts coins so they can create cdps (coins includes usdx so it's possible to have sufficient balance to close a cdp) -// var authGenesis auth.GenesisState -// simState.Cdc.MustUnmarshalJSON(simState.GenState[auth.ModuleName], &authGenesis) -// totalCdpCoins := sdk.NewCoins() -// for _, acc := range authGenesis.Accounts { -// _, ok := acc.(supplyexported.ModuleAccountI) -// if ok { -// continue -// } -// coinsToAdd := sdk.NewCoins( -// sdk.NewCoin("bnb", sdkmath.NewInt(int64(simState.Rand.Intn(100000000000)))), -// sdk.NewCoin("xrp", sdkmath.NewInt(int64(simState.Rand.Intn(100000000000)))), -// sdk.NewCoin("btc", sdkmath.NewInt(int64(simState.Rand.Intn(500000000)))), -// sdk.NewCoin("usdx", sdkmath.NewInt(int64(simState.Rand.Intn(1000000000)))), -// sdk.NewCoin("ukava", sdkmath.NewInt(int64(simState.Rand.Intn(500000000000)))), -// ) -// err := acc.SetCoins(acc.GetCoins().Add(coinsToAdd...)) -// if err != nil { -// panic(err) -// } -// totalCdpCoins = totalCdpCoins.Add(coinsToAdd...) -// authGenesis.Accounts = replaceOrAppendAccount(authGenesis.Accounts, acc) -// } -// simState.GenState[auth.ModuleName] = simState.Cdc.MustMarshalJSON(authGenesis) - -// var supplyGenesis supply.GenesisState -// simState.Cdc.MustUnmarshalJSON(simState.GenState[supply.ModuleName], &supplyGenesis) -// supplyGenesis.Supply = supplyGenesis.Supply.Add(totalCdpCoins...) -// simState.GenState[supply.ModuleName] = simState.Cdc.MustMarshalJSON(supplyGenesis) - -// fmt.Printf("Selected randomly generated %s parameters:\n%s\n", types.ModuleName, codec.MustMarshalJSONIndent(simState.Cdc, cdpGenesis)) -// simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(cdpGenesis) -// } - -// // In a list of accounts, replace the first account found with the same address. If not found, append the account. -// func replaceOrAppendAccount(accounts []authexported.GenesisAccount, acc authexported.GenesisAccount) []authexported.GenesisAccount { -// newAccounts := accounts -// for i, a := range accounts { -// if a.GetAddress().Equals(acc.GetAddress()) { -// newAccounts[i] = acc -// return newAccounts -// } -// } -// return append(newAccounts, acc) -// } - -// func randomCdpGenState(selection int) types.GenesisState { -// switch selection { -// case 0: -// return types.GenesisState{ -// Params: types.Params{ -// GlobalDebtLimit: sdk.NewInt64Coin("usdx", 100000000000000), -// SurplusAuctionThreshold: types.DefaultSurplusThreshold, -// SurplusAuctionLot: types.DefaultSurplusLot, -// DebtAuctionLot: types.DefaultDebtLot, -// DebtAuctionThreshold: types.DefaultDebtThreshold, -// CollateralParams: types.CollateralParams{ -// { -// Denom: "xrp", -// Type: "xrp-a", -// LiquidationRatio: sdk.MustNewDecFromStr("2.0"), -// DebtLimit: sdk.NewInt64Coin("usdx", 20000000000000), -// StabilityFee: sdk.MustNewDecFromStr("1.000000004431822130"), -// LiquidationPenalty: sdk.MustNewDecFromStr("0.075"), -// AuctionSize: sdkmath.NewInt(100000000000), -// Prefix: 0x20, -// SpotMarketID: "xrp:usd", -// LiquidationMarketID: "xrp:usd", -// ConversionFactor: sdkmath.NewInt(6), -// }, -// { -// Denom: "btc", -// Type: "btc-a", -// LiquidationRatio: sdk.MustNewDecFromStr("1.25"), -// DebtLimit: sdk.NewInt64Coin("usdx", 50000000000000), -// StabilityFee: sdk.MustNewDecFromStr("1.000000000782997609"), -// LiquidationPenalty: sdk.MustNewDecFromStr("0.05"), -// AuctionSize: sdkmath.NewInt(1000000000), -// Prefix: 0x21, -// SpotMarketID: "btc:usd", -// LiquidationMarketID: "btc:usd", -// ConversionFactor: sdkmath.NewInt(8), -// }, -// { -// Denom: "bnb", -// Type: "bnb-a", -// LiquidationRatio: sdk.MustNewDecFromStr("1.5"), -// DebtLimit: sdk.NewInt64Coin("usdx", 30000000000000), -// StabilityFee: sdk.MustNewDecFromStr("1.000000002293273137"), -// LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), -// AuctionSize: sdkmath.NewInt(1000000000000), -// Prefix: 0x22, -// SpotMarketID: "bnb:usd", -// LiquidationMarketID: "bnb:usd", -// ConversionFactor: sdkmath.NewInt(8), -// }, -// }, -// DebtParam: types.DebtParam{ -// Denom: "usdx", -// ReferenceAsset: "usd", -// ConversionFactor: sdkmath.NewInt(6), -// DebtFloor: sdkmath.NewInt(10000000), -// }, -// }, -// StartingCdpID: types.DefaultCdpStartingID, -// DebtDenom: types.DefaultDebtDenom, -// GovDenom: types.DefaultGovDenom, -// CDPs: types.CDPs{}, -// PreviousAccumulationTimes: types.GenesisAccumulationTimes{ -// types.GenesisAccumulationTime{ -// CollateralType: "xrp-a", -// PreviousAccumulationTime: time.Unix(0, 0), -// InterestFactor: sdk.OneDec(), -// }, -// types.GenesisAccumulationTime{ -// CollateralType: "btc-a", -// PreviousAccumulationTime: time.Unix(0, 0), -// InterestFactor: sdk.OneDec(), -// }, -// types.GenesisAccumulationTime{ -// CollateralType: "bnb-a", -// PreviousAccumulationTime: time.Unix(0, 0), -// InterestFactor: sdk.OneDec(), -// }, -// }, -// } -// case 1: -// return types.GenesisState{ -// Params: types.Params{ -// GlobalDebtLimit: sdk.NewInt64Coin("usdx", 100000000000000), -// SurplusAuctionThreshold: types.DefaultSurplusThreshold, -// DebtAuctionThreshold: types.DefaultDebtThreshold, -// SurplusAuctionLot: types.DefaultSurplusLot, -// DebtAuctionLot: types.DefaultDebtLot, -// CollateralParams: types.CollateralParams{ -// { -// Denom: "bnb", -// Type: "bnb-a", -// LiquidationRatio: sdk.MustNewDecFromStr("1.5"), -// DebtLimit: sdk.NewInt64Coin("usdx", 100000000000000), -// StabilityFee: sdk.MustNewDecFromStr("1.000000002293273137"), -// LiquidationPenalty: sdk.MustNewDecFromStr("0.075"), -// AuctionSize: sdkmath.NewInt(10000000000), -// Prefix: 0x20, -// SpotMarketID: "bnb:usd", -// LiquidationMarketID: "bnb:usd", -// ConversionFactor: sdkmath.NewInt(8), -// }, -// }, -// DebtParam: types.DebtParam{ -// Denom: "usdx", -// ReferenceAsset: "usd", -// ConversionFactor: sdkmath.NewInt(6), -// DebtFloor: sdkmath.NewInt(10000000), -// }, -// }, -// StartingCdpID: types.DefaultCdpStartingID, -// DebtDenom: types.DefaultDebtDenom, -// GovDenom: types.DefaultGovDenom, -// CDPs: types.CDPs{}, -// PreviousAccumulationTimes: types.GenesisAccumulationTimes{ -// types.GenesisAccumulationTime{ -// CollateralType: "bnb-a", -// PreviousAccumulationTime: time.Unix(0, 0), -// InterestFactor: sdk.OneDec(), -// }, -// }, -// } -// default: -// panic("invalid genesis state selector") -// } -// } diff --git a/x/cdp/simulation/operations.go b/x/cdp/simulation/operations.go deleted file mode 100644 index c66bbe38..00000000 --- a/x/cdp/simulation/operations.go +++ /dev/null @@ -1,297 +0,0 @@ -package simulation - -// import ( -// "fmt" -// "math/rand" - -// "github.com/cosmos/cosmos-sdk/baseapp" -// "github.com/cosmos/cosmos-sdk/codec" -// "github.com/cosmos/cosmos-sdk/simapp/helpers" -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/cosmos/cosmos-sdk/x/simulation" - -// appparams "github.com/kava-labs/kava/app/params" -// "github.com/kava-labs/kava/x/cdp/keeper" -// "github.com/kava-labs/kava/x/cdp/types" -// ) - -// // Simulation operation weights constants -// const ( -// OpWeightMsgCdp = "op_weight_msg_cdp" -// ) - -// // WeightedOperations returns all the operations from the module with their respective weights -// func WeightedOperations( -// appParams simulation.AppParams, cdc *codec.Codec, ak types.AccountKeeper, -// k keeper.Keeper, pfk types.PricefeedKeeper, -// ) simulation.WeightedOperations { -// var weightMsgCdp int - -// appParams.GetOrGenerate(cdc, OpWeightMsgCdp, &weightMsgCdp, nil, -// func(_ *rand.Rand) { -// weightMsgCdp = appparams.DefaultWeightMsgCdp -// }, -// ) - -// return simulation.WeightedOperations{ -// simulation.NewWeightedOperation( -// weightMsgCdp, -// SimulateMsgCdp(ak, k, pfk), -// ), -// } -// } - -// // SimulateMsgCdp generates a MsgCreateCdp or MsgDepositCdp with random values. -// func SimulateMsgCdp(ak types.AccountKeeper, k keeper.Keeper, pfk types.PricefeedKeeper) simulation.Operation { -// return func( -// r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, -// ) (simulation.OperationMsg, []simulation.FutureOperation, error) { - -// simAccount, _ := simulation.RandomAcc(r, accs) -// acc := ak.GetAccount(ctx, simAccount.Address) -// if acc == nil { -// return simulation.NoOpMsg(types.ModuleName), nil, nil -// } - -// coins := acc.GetCoins() -// collateralParams := k.GetParams(ctx).CollateralParams -// if len(collateralParams) == 0 { -// return simulation.NoOpMsg(types.ModuleName), nil, nil -// } - -// randCollateralParam := collateralParams[r.Intn(len(collateralParams))] -// debtParam, _ := k.GetDebtParam(ctx, randCollateralParam.DebtLimit.Denom) -// if coins.AmountOf(randCollateralParam.Denom).IsZero() { -// return simulation.NoOpMsg(types.ModuleName), nil, nil -// } - -// price, err := pfk.GetCurrentPrice(ctx, randCollateralParam.SpotMarketID) -// if err != nil { -// return simulation.NoOpMsg(types.ModuleName), nil, nil // pricefeed going down is an expected event -// } -// // convert the price to the same units as the debt param -// priceShifted := ShiftDec(price.Price, debtParam.ConversionFactor) - -// spendableCoins := acc.SpendableCoins(ctx.BlockTime()) -// fees, err := simulation.RandomFees(r, ctx, spendableCoins) -// if err != nil { -// return simulation.NoOpMsg(types.ModuleName), nil, err -// } -// spendableCoins = spendableCoins.Sub(fees) - -// existingCDP, found := k.GetCdpByOwnerAndCollateralType(ctx, acc.GetAddress(), randCollateralParam.Type) -// if !found { -// // calculate the minimum amount of collateral that is needed to create a cdp with the debt floor amount of debt and the minimum liquidation ratio -// // (debtFloor * liquidationRatio)/priceShifted -// minCollateralDeposit := (sdk.NewDecFromInt(debtParam.DebtFloor).Mul(randCollateralParam.LiquidationRatio)).Quo(priceShifted) -// // convert to proper collateral units -// minCollateralDeposit = ShiftDec(minCollateralDeposit, randCollateralParam.ConversionFactor) -// // convert to integer and always round up -// minCollateralDepositRounded := minCollateralDeposit.TruncateInt().Add(sdk.OneInt()) -// if spendableCoins.AmountOf(randCollateralParam.Denom).LT(minCollateralDepositRounded) { -// // account doesn't have enough funds to open a cdp for the min debt amount -// return simulation.NewOperationMsgBasic(types.ModuleName, "no-operation", "insufficient funds to open cdp", false, nil), nil, nil -// } -// // set the max collateral deposit to the amount of coins in the account -// maxCollateralDeposit := spendableCoins.AmountOf(randCollateralParam.Denom) - -// // randomly select a collateral deposit amount -// collateralDeposit := sdkmath.NewInt(int64(simulation.RandIntBetween(r, int(minCollateralDepositRounded.Int64()), int(maxCollateralDeposit.Int64())))) -// // calculate how much the randomly selected deposit is worth -// collateralDepositValue := ShiftDec(sdk.NewDecFromInt(collateralDeposit), randCollateralParam.ConversionFactor.Neg()).Mul(priceShifted) -// // calculate the max amount of debt that could be drawn for the chosen deposit -// maxDebtDraw := collateralDepositValue.Quo(randCollateralParam.LiquidationRatio).TruncateInt() -// // check that the debt limit hasn't been reached -// availableAssetDebt := randCollateralParam.DebtLimit.Amount.Sub(k.GetTotalPrincipal(ctx, randCollateralParam.Type, debtParam.Denom)) -// if availableAssetDebt.LTE(debtParam.DebtFloor) { -// // debt limit has been reached -// return simulation.NewOperationMsgBasic(types.ModuleName, "no-operation", "debt limit reached, cannot open cdp", false, nil), nil, nil -// } -// // ensure that the debt draw does not exceed the debt limit -// maxDebtDraw = sdk.MinInt(maxDebtDraw, availableAssetDebt) -// // randomly select a debt draw amount -// debtDraw := sdkmath.NewInt(int64(simulation.RandIntBetween(r, int(debtParam.DebtFloor.Int64()), int(maxDebtDraw.Int64())))) - -// msg := types.NewMsgCreateCDP(acc.GetAddress(), sdk.NewCoin(randCollateralParam.Denom, collateralDeposit), sdk.NewCoin(debtParam.Denom, debtDraw), randCollateralParam.Type) - -// tx := helpers.GenTx( -// []sdk.Msg{msg}, -// fees, -// helpers.DefaultGenTxGas, -// chainID, -// []uint64{acc.GetAccountNumber()}, -// []uint64{acc.GetSequence()}, -// simAccount.PrivKey, -// ) - -// _, _, err := app.Deliver(tx) -// if err != nil { -// // to aid debugging, add the stack trace to the comment field of the returned opMsg -// return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err -// } - -// return simulation.NewOperationMsg(msg, true, ""), nil, nil -// } - -// // a cdp already exists, deposit to it, draw debt from it, or repay debt to it -// // close 25% of the time -// if canClose(spendableCoins, existingCDP, debtParam.Denom) && shouldClose(r) { -// repaymentAmount := spendableCoins.AmountOf(debtParam.Denom) -// // check that repayment isn't below the debt floor -// if existingCDP.Principal.Amount.Add(existingCDP.AccumulatedFees.Amount).Sub(repaymentAmount).LT(debtParam.DebtFloor) { -// repaymentAmount = existingCDP.Principal.Amount.Add(existingCDP.AccumulatedFees.Amount).Sub(debtParam.DebtFloor) -// } -// msg := types.NewMsgRepayDebt(acc.GetAddress(), randCollateralParam.Type, sdk.NewCoin(debtParam.Denom, repaymentAmount)) - -// tx := helpers.GenTx( -// []sdk.Msg{msg}, -// fees, -// helpers.DefaultGenTxGas, -// chainID, -// []uint64{acc.GetAccountNumber()}, -// []uint64{acc.GetSequence()}, -// simAccount.PrivKey, -// ) - -// _, _, err := app.Deliver(tx) -// if err != nil { -// return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err -// } - -// return simulation.NewOperationMsg(msg, true, ""), nil, nil -// } - -// // deposit 25% of the time -// if hasCoins(spendableCoins, randCollateralParam.Denom) && shouldDeposit(r) { -// randDepositAmount := sdkmath.NewInt(int64(simulation.RandIntBetween(r, 1, int(spendableCoins.AmountOf(randCollateralParam.Denom).Int64())))) -// msg := types.NewMsgDeposit(acc.GetAddress(), acc.GetAddress(), sdk.NewCoin(randCollateralParam.Denom, randDepositAmount), randCollateralParam.Type) - -// tx := helpers.GenTx( -// []sdk.Msg{msg}, -// fees, -// helpers.DefaultGenTxGas, -// chainID, -// []uint64{acc.GetAccountNumber()}, -// []uint64{acc.GetSequence()}, -// simAccount.PrivKey, -// ) - -// _, _, err := app.Deliver(tx) -// if err != nil { -// return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err -// } - -// return simulation.NewOperationMsg(msg, true, ""), nil, nil -// } - -// // draw debt 25% of the time -// if shouldDraw(r) { -// collateralShifted := ShiftDec(sdk.NewDecFromInt(existingCDP.Collateral.Amount), randCollateralParam.ConversionFactor.Neg()) -// collateralValue := collateralShifted.Mul(priceShifted) -// newFeesAccumulated := k.CalculateNewInterest(ctx, existingCDP) -// totalFees := existingCDP.AccumulatedFees.Add(newFeesAccumulated) -// // given the current collateral value, calculate how much debt we could add while maintaining a valid liquidation ratio -// debt := existingCDP.Principal.Add(totalFees) -// maxTotalDebt := collateralValue.Quo(randCollateralParam.LiquidationRatio) -// maxDebt := (maxTotalDebt.Sub(sdk.NewDecFromInt(debt.Amount))).Mul(sdk.MustNewDecFromStr("0.95")).TruncateInt() -// if maxDebt.LTE(sdk.OneInt()) { -// // debt in cdp is maxed out -// return simulation.NewOperationMsgBasic(types.ModuleName, "no-operation", "cdp debt maxed out, cannot draw more debt", false, nil), nil, nil -// } -// // check if the debt limit has been reached -// availableAssetDebt := randCollateralParam.DebtLimit.Amount.Sub(k.GetTotalPrincipal(ctx, randCollateralParam.Type, debtParam.Denom)) -// if availableAssetDebt.LTE(sdk.OneInt()) { -// // debt limit has been reached -// return simulation.NewOperationMsgBasic(types.ModuleName, "no-operation", "debt limit reached, cannot draw more debt", false, nil), nil, nil -// } -// maxDraw := sdk.MinInt(maxDebt, availableAssetDebt) - -// randDrawAmount := sdkmath.NewInt(int64(simulation.RandIntBetween(r, 1, int(maxDraw.Int64())))) -// msg := types.NewMsgDrawDebt(acc.GetAddress(), randCollateralParam.Type, sdk.NewCoin(debtParam.Denom, randDrawAmount)) - -// tx := helpers.GenTx( -// []sdk.Msg{msg}, -// fees, -// helpers.DefaultGenTxGas, -// chainID, -// []uint64{acc.GetAccountNumber()}, -// []uint64{acc.GetSequence()}, -// simAccount.PrivKey, -// ) - -// _, _, err := app.Deliver(tx) -// if err != nil { -// return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err -// } - -// return simulation.NewOperationMsg(msg, true, ""), nil, nil -// } - -// // repay debt 25% of the time -// if hasCoins(spendableCoins, debtParam.Denom) { -// debt := existingCDP.Principal.Amount.Add(existingCDP.AccumulatedFees.Amount) -// payableDebt := debt.Sub(debtParam.DebtFloor) -// if payableDebt.IsZero() { -// return simulation.NewOperationMsgBasic(types.ModuleName, "no-operation", "cannot make partial repayment, cdp at debt floor", false, nil), nil, nil -// } -// maxRepay := sdk.MinInt( -// spendableCoins.AmountOf(debtParam.Denom), -// payableDebt, -// ) -// var randRepayAmount sdkmath.Int -// if maxRepay.Equal(sdk.OneInt()) { -// randRepayAmount = sdk.OneInt() -// } else { -// randRepayAmount = sdkmath.NewInt(int64(simulation.RandIntBetween(r, 1, int(maxRepay.Int64())))) -// } - -// msg := types.NewMsgRepayDebt(acc.GetAddress(), randCollateralParam.Type, sdk.NewCoin(debtParam.Denom, randRepayAmount)) - -// tx := helpers.GenTx( -// []sdk.Msg{msg}, -// fees, -// helpers.DefaultGenTxGas, -// chainID, -// []uint64{acc.GetAccountNumber()}, -// []uint64{acc.GetSequence()}, -// simAccount.PrivKey, -// ) - -// _, _, err := app.Deliver(tx) -// if err != nil { -// return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err -// } - -// return simulation.NewOperationMsg(msg, true, ""), nil, nil -// } - -// return simulation.NoOpMsg(types.ModuleName), nil, nil -// } -// } - -// func shouldDraw(r *rand.Rand) bool { -// threshold := 50 -// value := simulation.RandIntBetween(r, 1, 100) -// return value > threshold -// } - -// func shouldDeposit(r *rand.Rand) bool { -// threshold := 66 -// value := simulation.RandIntBetween(r, 1, 100) -// return value > threshold -// } - -// func hasCoins(spendableCoins sdk.Coins, denom string) bool { -// return spendableCoins.AmountOf(denom).IsPositive() -// } - -// func shouldClose(r *rand.Rand) bool { -// threshold := 75 -// value := simulation.RandIntBetween(r, 1, 100) -// return value > threshold -// } - -// func canClose(spendableCoins sdk.Coins, c types.CDP, denom string) bool { -// repaymentAmount := c.Principal.Add(c.AccumulatedFees).Amount -// return spendableCoins.AmountOf(denom).GTE(repaymentAmount) -// } diff --git a/x/cdp/simulation/params.go b/x/cdp/simulation/params.go deleted file mode 100644 index 729f93dc..00000000 --- a/x/cdp/simulation/params.go +++ /dev/null @@ -1,13 +0,0 @@ -package simulation - -// import ( -// "math/rand" - -// "github.com/cosmos/cosmos-sdk/x/simulation" -// ) - -// // ParamChanges defines the parameters that can be modified by param change proposals -// // on the simulation -// func ParamChanges(r *rand.Rand) []simulation.ParamChange { -// return []simulation.ParamChange{} -// } diff --git a/x/cdp/simulation/utils.go b/x/cdp/simulation/utils.go deleted file mode 100644 index 6bd23d0e..00000000 --- a/x/cdp/simulation/utils.go +++ /dev/null @@ -1,26 +0,0 @@ -package simulation - -// import ( -// sdk "github.com/cosmos/cosmos-sdk/types" -// ) - -// func ShiftDec(x sdk.Dec, places sdkmath.Int) sdk.Dec { -// neg := places.IsNegative() -// for i := 0; i < int(abs(places.Int64())); i++ { -// if neg { -// x = x.Mul(sdk.MustNewDecFromStr("0.1")) -// } else { -// x = x.Mul(sdk.NewDecFromInt(sdkmath.NewInt(10))) -// } - -// } -// return x -// } - -// // abs returns the absolute value of x. -// func abs(x int64) int64 { -// if x < 0 { -// return -x -// } -// return x -// } diff --git a/x/cdp/simulation/utils_test.go b/x/cdp/simulation/utils_test.go deleted file mode 100644 index 1b6b6dd7..00000000 --- a/x/cdp/simulation/utils_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package simulation_test - -// import ( -// "testing" - -// "github.com/stretchr/testify/require" - -// sdk "github.com/cosmos/cosmos-sdk/types" - -// "github.com/kava-labs/kava/x/cdp/simulation" -// ) - -// func TestShiftDec(t *testing.T) { -// tests := []struct { -// value sdk.Dec -// shift sdkmath.Int -// expected sdk.Dec -// }{ -// {sdk.MustNewDecFromStr("5.5"), sdkmath.NewInt(1), sdk.MustNewDecFromStr("55")}, -// {sdk.MustNewDecFromStr("5.5"), sdkmath.NewInt(-1), sdk.MustNewDecFromStr("0.55")}, -// {sdk.MustNewDecFromStr("5.5"), sdkmath.NewInt(2), sdk.MustNewDecFromStr("550")}, -// {sdk.MustNewDecFromStr("5.5"), sdkmath.NewInt(-2), sdk.MustNewDecFromStr("0.055")}, -// } - -// for _, tt := range tests { -// t.Run(tt.value.String(), func(t *testing.T) { -// require.Equal(t, tt.expected, simulation.ShiftDec(tt.value, tt.shift)) -// }) -// } -// } diff --git a/x/cdp/types/cdp.pb.go b/x/cdp/types/cdp.pb.go index 748ce867..a59e9caf 100644 --- a/x/cdp/types/cdp.pb.go +++ b/x/cdp/types/cdp.pb.go @@ -8,9 +8,9 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -314,7 +314,7 @@ func (m *CDP) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x42 - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.FeesUpdated, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.FeesUpdated):]) + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.FeesUpdated, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.FeesUpdated):]) if err1 != nil { return 0, err1 } @@ -574,7 +574,7 @@ func (m *CDP) Size() (n int) { n += 1 + l + sovCdp(uint64(l)) l = m.AccumulatedFees.Size() n += 1 + l + sovCdp(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.FeesUpdated) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.FeesUpdated) n += 1 + l + sovCdp(uint64(l)) l = m.InterestFactor.Size() n += 1 + l + sovCdp(uint64(l)) @@ -893,7 +893,7 @@ func (m *CDP) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.FeesUpdated, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.FeesUpdated, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/cdp/types/cdp_test.go b/x/cdp/types/cdp_test.go index f5014157..424899b6 100644 --- a/x/cdp/types/cdp_test.go +++ b/x/cdp/types/cdp_test.go @@ -10,8 +10,8 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/tendermint/crypto/secp256k1" - tmtime "github.com/tendermint/tendermint/types/time" + "github.com/cometbft/cometbft/crypto/secp256k1" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/x/cdp/types" ) diff --git a/x/cdp/types/genesis.pb.go b/x/cdp/types/genesis.pb.go index c40fc9f4..87c4b5d9 100644 --- a/x/cdp/types/genesis.pb.go +++ b/x/cdp/types/genesis.pb.go @@ -8,9 +8,9 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -981,7 +981,7 @@ func (m *GenesisAccumulationTime) MarshalToSizedBuffer(dAtA []byte) (int, error) } i-- dAtA[i] = 0x1a - n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.PreviousAccumulationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.PreviousAccumulationTime):]) + n5, err5 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.PreviousAccumulationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PreviousAccumulationTime):]) if err5 != nil { return 0, err5 } @@ -1201,7 +1201,7 @@ func (m *GenesisAccumulationTime) Size() (n int) { if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.PreviousAccumulationTime) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PreviousAccumulationTime) n += 1 + l + sovGenesis(uint64(l)) l = m.InterestFactor.Size() n += 1 + l + sovGenesis(uint64(l)) @@ -2577,7 +2577,7 @@ func (m *GenesisAccumulationTime) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.PreviousAccumulationTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.PreviousAccumulationTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/cdp/types/keys.go b/x/cdp/types/keys.go index 4949ce2a..67921b6a 100644 --- a/x/cdp/types/keys.go +++ b/x/cdp/types/keys.go @@ -17,9 +17,6 @@ const ( // RouterKey Top level router key RouterKey = ModuleName - // QuerierRoute Top level query string - QuerierRoute = ModuleName - // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName diff --git a/x/cdp/types/keys_test.go b/x/cdp/types/keys_test.go index 1b9fb83a..adb3b839 100644 --- a/x/cdp/types/keys_test.go +++ b/x/cdp/types/keys_test.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/tendermint/crypto/ed25519" + "github.com/cometbft/cometbft/crypto/ed25519" ) var addr = sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address()) diff --git a/x/cdp/types/query.pb.go b/x/cdp/types/query.pb.go index 8b04caa4..ca16689f 100644 --- a/x/cdp/types/query.pb.go +++ b/x/cdp/types/query.pb.go @@ -10,10 +10,10 @@ import ( types1 "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" types "github.com/cosmos/cosmos-sdk/x/auth/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -1772,7 +1772,7 @@ func (m *CDPResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x42 } - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.FeesUpdated, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.FeesUpdated):]) + n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.FeesUpdated, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.FeesUpdated):]) if err6 != nil { return 0, err6 } @@ -2073,7 +2073,7 @@ func (m *CDPResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.AccumulatedFees.Size() n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.FeesUpdated) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.FeesUpdated) n += 1 + l + sovQuery(uint64(l)) l = len(m.InterestFactor) if l > 0 { @@ -3649,7 +3649,7 @@ func (m *CDPResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.FeesUpdated, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.FeesUpdated, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/cdp/types/tx.pb.go b/x/cdp/types/tx.pb.go index a4dcf538..f21bd475 100644 --- a/x/cdp/types/tx.pb.go +++ b/x/cdp/types/tx.pb.go @@ -8,9 +8,9 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/x/committee/abci.go b/x/committee/abci.go index 3e4a7459..107c2289 100644 --- a/x/committee/abci.go +++ b/x/committee/abci.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/kava-labs/kava/x/committee/keeper" "github.com/kava-labs/kava/x/committee/types" diff --git a/x/committee/abci_test.go b/x/committee/abci_test.go index 3056d290..80bba989 100644 --- a/x/committee/abci_test.go +++ b/x/committee/abci_test.go @@ -6,10 +6,10 @@ import ( "github.com/stretchr/testify/suite" + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" // "github.com/kava-labs/kava/x/cdp" diff --git a/x/committee/client/cli/tx.go b/x/committee/client/cli/tx.go index 2bfd20eb..8aaaa882 100644 --- a/x/committee/client/cli/tx.go +++ b/x/committee/client/cli/tx.go @@ -9,8 +9,8 @@ import ( "strings" "time" + "github.com/cometbft/cometbft/crypto" "github.com/spf13/cobra" - "github.com/tendermint/tendermint/crypto" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" diff --git a/x/committee/genesis_test.go b/x/committee/genesis_test.go index 4aab900b..64f321f0 100644 --- a/x/committee/genesis_test.go +++ b/x/committee/genesis_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/suite" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/committee" diff --git a/x/committee/keeper/_param_permission_test.go b/x/committee/keeper/_param_permission_test.go index 2d31d29c..8ebe9c26 100644 --- a/x/committee/keeper/_param_permission_test.go +++ b/x/committee/keeper/_param_permission_test.go @@ -4,12 +4,13 @@ import ( "testing" "time" + sdkmath "cosmossdk.io/math" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" "github.com/kava-labs/kava/app" bep3types "github.com/kava-labs/kava/x/bep3/types" diff --git a/x/committee/keeper/committee_test.go b/x/committee/keeper/committee_test.go index be0ae06a..dca7454c 100644 --- a/x/committee/keeper/committee_test.go +++ b/x/committee/keeper/committee_test.go @@ -5,7 +5,7 @@ package keeper_test // "time" // "github.com/stretchr/testify/suite" -// abci "github.com/tendermint/tendermint/abci/types" +// abci "github.com/cometbft/cometbft/abci/types" // govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" // paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" diff --git a/x/committee/keeper/msg_server_test.go b/x/committee/keeper/msg_server_test.go index 5b808711..f0141ca6 100644 --- a/x/committee/keeper/msg_server_test.go +++ b/x/committee/keeper/msg_server_test.go @@ -7,10 +7,10 @@ import ( "github.com/stretchr/testify/suite" sdkmath "cosmossdk.io/math" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" proposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/committee/keeper" diff --git a/x/committee/keeper/proposal_test.go b/x/committee/keeper/proposal_test.go index 792c43dc..7fa10db5 100644 --- a/x/committee/keeper/proposal_test.go +++ b/x/committee/keeper/proposal_test.go @@ -8,7 +8,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/kava-labs/kava/app" // bep3types "github.com/kava-labs/kava/x/bep3/types" diff --git a/x/committee/keeper/querier.go b/x/committee/keeper/querier.go deleted file mode 100644 index 4fab66a6..00000000 --- a/x/committee/keeper/querier.go +++ /dev/null @@ -1,208 +0,0 @@ -package keeper - -import ( - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/kava-labs/kava/x/committee/types" -) - -// NewQuerier creates a new gov Querier instance -func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(ctx sdk.Context, path []string, req abci.RequestQuery) (res []byte, err error) { - switch path[0] { - case types.QueryCommittees: - return queryCommittees(ctx, req, k, legacyQuerierCdc) - case types.QueryCommittee: - return queryCommittee(ctx, req, k, legacyQuerierCdc) - case types.QueryProposals: - return queryProposals(ctx, req, k, legacyQuerierCdc) - case types.QueryProposal: - return queryProposal(ctx, req, k, legacyQuerierCdc) - case types.QueryVotes: - return queryVotes(ctx, req, k, legacyQuerierCdc) - case types.QueryVote: - return queryVote(ctx, req, k, legacyQuerierCdc) - case types.QueryTally: - return queryTally(ctx, req, k, legacyQuerierCdc) - case types.QueryNextProposalID: - return queryNextProposalID(ctx, req, k, legacyQuerierCdc) - case types.QueryRawParams: - return queryRawParams(ctx, req, k, legacyQuerierCdc) - - default: - return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unknown %s query endpoint", types.ModuleName) - } - } -} - -// ------------------------------------------ -// Committees -// ------------------------------------------ - -func queryCommittees(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - committees := keeper.GetCommittees(ctx) - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, committees) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryCommittee(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryCommitteeParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - committee, found := keeper.GetCommittee(ctx, params.CommitteeID) - if !found { - return nil, errorsmod.Wrapf(types.ErrUnknownCommittee, "%d", params.CommitteeID) - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, committee) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -// ------------------------------------------ -// Proposals -// ------------------------------------------ - -func queryProposals(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryCommitteeParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - proposals := keeper.GetProposalsByCommittee(ctx, params.CommitteeID) - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, proposals) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryProposal(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryProposalParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - proposal, found := keeper.GetProposal(ctx, params.ProposalID) - if !found { - return nil, errorsmod.Wrapf(types.ErrUnknownProposal, "%d", params.ProposalID) - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, proposal) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryNextProposalID(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - nextProposalID, _ := k.GetNextProposalID(ctx) - - bz, err := types.ModuleCdc.LegacyAmino.MarshalJSON(nextProposalID) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - return bz, nil -} - -// ------------------------------------------ -// Votes -// ------------------------------------------ - -func queryVotes(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryProposalParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - votes := keeper.GetVotesByProposal(ctx, params.ProposalID) - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, votes) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryVote(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryVoteParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - vote, found := keeper.GetVote(ctx, params.ProposalID, params.Voter) - if !found { - return nil, errorsmod.Wrapf(types.ErrUnknownVote, "proposal id: %d, voter: %s", params.ProposalID, params.Voter) - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, vote) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -// ------------------------------------------ -// Tally -// ------------------------------------------ - -func queryTally(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryProposalParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - tally, found := keeper.GetProposalTallyResponse(ctx, params.ProposalID) - if !found { - return nil, errorsmod.Wrapf(types.ErrNotFoundProposalTally, "proposal id: %d", params.ProposalID) - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, tally) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -// ------------------------------------------ -// Raw Params -// ------------------------------------------ - -func queryRawParams(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryRawParamsParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - subspace, found := keeper.paramKeeper.GetSubspace(params.Subspace) - if !found { - return nil, errorsmod.Wrapf(types.ErrUnknownSubspace, "subspace: %s", params.Subspace) - } - rawParams := subspace.GetRaw(ctx, []byte(params.Key)) - - // encode the raw params as json, which converts them to a base64 string - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, rawParams) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} diff --git a/x/committee/keeper/querier_test.go b/x/committee/keeper/querier_test.go deleted file mode 100644 index cb0d5ee2..00000000 --- a/x/committee/keeper/querier_test.go +++ /dev/null @@ -1,278 +0,0 @@ -package keeper_test - -import ( - "strings" - "testing" - - "github.com/stretchr/testify/suite" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - "github.com/kava-labs/kava/app" - "github.com/kava-labs/kava/x/committee/keeper" - "github.com/kava-labs/kava/x/committee/testutil" - "github.com/kava-labs/kava/x/committee/types" -) - -const ( - custom = "custom" -) - -type QuerierTestSuite struct { - suite.Suite - - keeper keeper.Keeper - app app.TestApp - ctx sdk.Context - cdc codec.Codec - legacyAmino *codec.LegacyAmino - - querier sdk.Querier - - addresses []sdk.AccAddress - testGenesis *types.GenesisState - votes map[uint64]([]types.Vote) -} - -func (suite *QuerierTestSuite) SetupTest() { - suite.app = app.NewTestApp() - suite.keeper = suite.app.GetCommitteeKeeper() - suite.ctx = suite.app.NewContext(true, tmproto.Header{}) - suite.cdc = suite.app.AppCodec() - suite.legacyAmino = suite.app.LegacyAmino() - suite.querier = keeper.NewQuerier(suite.keeper, suite.legacyAmino) - - _, suite.addresses = app.GeneratePrivKeyAddressPairs(5) - memberCommittee := mustNewTestMemberCommittee(suite.addresses[:3]) - memberCommittee.ID = 1 - noPermCommittee := mustNewTestMemberCommittee(suite.addresses[2:]) - noPermCommittee.ID = 2 - noPermCommittee.SetPermissions([]types.Permission{}) - proposalOne := mustNewTestProposal() - proposalTwo := mustNewTestProposal() - proposalTwo.ID = 2 - suite.testGenesis = types.NewGenesisState( - 3, - []types.Committee{memberCommittee, noPermCommittee}, - types.Proposals{proposalOne, proposalTwo}, - []types.Vote{ - {ProposalID: 1, Voter: suite.addresses[0], VoteType: types.VOTE_TYPE_YES}, - {ProposalID: 1, Voter: suite.addresses[1], VoteType: types.VOTE_TYPE_YES}, - {ProposalID: 2, Voter: suite.addresses[2], VoteType: types.VOTE_TYPE_YES}, - }, - ) - genState := NewCommitteeGenesisState(suite.cdc, suite.testGenesis) - suite.app.InitializeFromGenesisStates(genState) - - suite.votes = getProposalVoteMap(suite.keeper, suite.ctx) -} - -func (suite *QuerierTestSuite) assertQuerierResponse(expected interface{}, actual []byte) { - expectedJson, err := suite.legacyAmino.MarshalJSONIndent(expected, "", " ") - suite.Require().NoError(err) - suite.Require().Equal(string(expectedJson), string(actual)) -} - -func (suite *QuerierTestSuite) TestQueryCommittees() { - ctx := suite.ctx.WithIsCheckTx(false) - // Set up request query - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryCommittees}, "/"), - } - - // Execute query and check the []byte result - bz, err := suite.querier(ctx, []string{types.QueryCommittees}, query) - suite.Require().NoError(err) - suite.Require().NotNil(bz) - suite.assertQuerierResponse(suite.testGenesis.GetCommittees(), bz) -} - -func (suite *QuerierTestSuite) TestQueryCommittee() { - ctx := suite.ctx.WithIsCheckTx(false) - // Set up request query - targetCommittee := suite.testGenesis.GetCommittees()[0] - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryCommittee}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryCommitteeParams(targetCommittee.GetID())), - } - - // Execute query and check the []byte result - bz, err := suite.querier(ctx, []string{types.QueryCommittee}, query) - suite.NoError(err) - suite.NotNil(bz) - suite.assertQuerierResponse(targetCommittee, bz) -} - -func (suite *QuerierTestSuite) TestQueryProposals() { - ctx := suite.ctx.WithIsCheckTx(false) - // Set up request query - comID := suite.testGenesis.Proposals[0].CommitteeID - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryProposals}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryCommitteeParams(comID)), - } - - // Execute query and check the []byte result - bz, err := suite.querier(ctx, []string{types.QueryProposals}, query) - suite.NoError(err) - suite.NotNil(bz) - - // Check - expectedProposals := types.Proposals{} - for _, p := range suite.testGenesis.Proposals { - if p.CommitteeID == comID { - expectedProposals = append(expectedProposals, p) - } - } - suite.assertQuerierResponse(expectedProposals, bz) -} - -func (suite *QuerierTestSuite) TestQueryProposal() { - ctx := suite.ctx.WithIsCheckTx(false) - // Set up request query - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryProposal}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryProposalParams(suite.testGenesis.Proposals[0].ID)), - } - - // Execute query and check the []byte result - bz, err := suite.querier(ctx, []string{types.QueryProposal}, query) - suite.NoError(err) - suite.NotNil(bz) - suite.assertQuerierResponse(suite.testGenesis.Proposals[0], bz) -} - -func (suite *QuerierTestSuite) TestQueryNextProposalID() { - bz, err := suite.querier(suite.ctx, []string{types.QueryNextProposalID}, abci.RequestQuery{}) - suite.Require().NoError(err) - suite.Require().NotNil(bz) - - var nextProposalID uint64 - suite.Require().NoError(suite.legacyAmino.UnmarshalJSON(bz, &nextProposalID)) - - expectedID, _ := suite.keeper.GetNextProposalID(suite.ctx) - suite.Require().Equal(expectedID, nextProposalID) -} - -func (suite *QuerierTestSuite) TestQueryVotes() { - ctx := suite.ctx.WithIsCheckTx(false) - // Set up request query - propID := suite.testGenesis.Proposals[0].ID - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryVotes}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryProposalParams(propID)), - } - - // Execute query and check the []byte result - bz, err := suite.querier(ctx, []string{types.QueryVotes}, query) - suite.NoError(err) - suite.NotNil(bz) - suite.assertQuerierResponse(suite.votes[propID], bz) -} - -func (suite *QuerierTestSuite) TestQueryVote() { - ctx := suite.ctx.WithIsCheckTx(false) - // Set up request query - propID := suite.testGenesis.Proposals[0].ID - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryVote}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryVoteParams(propID, suite.votes[propID][0].Voter)), - } - - // Execute query and check the []byte result - bz, err := suite.querier(ctx, []string{types.QueryVote}, query) - suite.NoError(err) - suite.NotNil(bz) - suite.assertQuerierResponse(suite.votes[propID][0], bz) -} - -func (suite *QuerierTestSuite) TestQueryTally() { - ctx := suite.ctx.WithIsCheckTx(false) - - // Expected result - propID := suite.testGenesis.Proposals[0].ID - expectedPollingStatus := types.QueryTallyResponse{ - ProposalID: 1, - YesVotes: sdk.NewDec(int64(len(suite.votes[propID]))), - NoVotes: sdk.ZeroDec(), - CurrentVotes: sdk.NewDec(int64(len(suite.votes[propID]))), - PossibleVotes: testutil.D("3.0"), - VoteThreshold: testutil.D("0.667"), - Quorum: testutil.D("0"), - } - - // Set up request query - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryTally}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryProposalParams(propID)), - } - - // Execute query and check the []byte result - bz, err := suite.querier(ctx, []string{types.QueryTally}, query) - suite.NoError(err) - suite.NotNil(bz) - suite.assertQuerierResponse(expectedPollingStatus, bz) -} - -type TestSubParam struct { - Some string - Test sdk.Dec - Params []types.Vote -} -type TestParams struct { - TestKey TestSubParam -} - -const paramKey = "TestKey" - -func (p *TestParams) ParamSetPairs() paramstypes.ParamSetPairs { - return paramstypes.ParamSetPairs{ - paramstypes.NewParamSetPair([]byte(paramKey), &p.TestKey, func(interface{}) error { return nil }), - } -} - -func (suite *QuerierTestSuite) TestQueryRawParams() { - ctx := suite.ctx.WithIsCheckTx(false) - - // Create a new param subspace to avoid adding dependency to another module. Set a test param value. - subspaceName := "test" - subspace := suite.app.GetParamsKeeper().Subspace(subspaceName) - subspace = subspace.WithKeyTable(paramstypes.NewKeyTable().RegisterParamSet(&TestParams{})) - - paramValue := TestSubParam{ - Some: "test", - Test: testutil.D("1000000000000.000000000000000001"), - Params: []types.Vote{ - types.NewVote(1, suite.addresses[0], types.VOTE_TYPE_YES), - types.NewVote(12, suite.addresses[1], types.VOTE_TYPE_YES), - }, - } - subspace.Set(ctx, []byte(paramKey), paramValue) - - // Set up request query - query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryRawParams}, "/"), - Data: suite.legacyAmino.MustMarshalJSON(types.NewQueryRawParamsParams(subspaceName, paramKey)), - } - - // Execute query - bz, err := suite.querier(ctx, []string{types.QueryRawParams}, query) - suite.NoError(err) - suite.NotNil(bz) - - // Unmarshal the bytes - var returnedParamValue []byte - suite.NoError(suite.legacyAmino.UnmarshalJSON(bz, &returnedParamValue)) - - // Check - suite.Equal(suite.legacyAmino.MustMarshalJSON(paramValue), returnedParamValue) -} - -func TestQuerierTestSuite(t *testing.T) { - suite.Run(t, new(QuerierTestSuite)) -} diff --git a/x/committee/module.go b/x/committee/module.go index 7dbfb0a5..f444e184 100644 --- a/x/committee/module.go +++ b/x/committee/module.go @@ -8,7 +8,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -27,7 +27,6 @@ const ConsensusVersion = 1 var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - // _ module.AppModuleSimulation = AppModule{} ) // ---------------------------------------------------------------------------- @@ -107,17 +106,6 @@ func (am AppModule) Name() string { return am.AppModuleBasic.Name() } -// Route returns committee module's message route. -func (am AppModule) Route() sdk.Route { return sdk.Route{} } - -// QuerierRoute returns committee module's query routing key. -func (AppModule) QuerierRoute() string { return types.QuerierRoute } - -// LegacyQuerierHandler returns committee module's Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return keeper.NewQuerier(am.keeper, legacyQuerierCdc) -} - // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { @@ -156,30 +144,3 @@ func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } - -//____________________________________________________________________________ - -// // GenerateGenesisState creates a randomized GenState of the auction module -// func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState) { -// simulation.RandomizedGenState(simState) -// } - -// // ProposalContents doesn't return any content functions for governance proposals. -// func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { -// return simulation.ProposalContents(am.keeper, simState.ParamChanges) -// } - -// RandomizedParams returns functions that generate params for the module -// func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange { -// return nil -// } - -// // RegisterStoreDecoder registers a decoder for the module's types -// func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { -// sdr[StoreKey] = simulation.DecodeStore -// } - -// // WeightedOperations returns the module operations for use in simulations -// func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation { -// return simulation.WeightedOperations(simState.AppParams, simState.Cdc, am.accountKeeper, am.keeper, simState.Contents) -// } diff --git a/x/committee/proposal_handler_test.go b/x/committee/proposal_handler_test.go index 586cac89..117554c8 100644 --- a/x/committee/proposal_handler_test.go +++ b/x/committee/proposal_handler_test.go @@ -10,7 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/committee" diff --git a/x/committee/simulation/common.go b/x/committee/simulation/common.go deleted file mode 100644 index cc5301f1..00000000 --- a/x/committee/simulation/common.go +++ /dev/null @@ -1,72 +0,0 @@ -package simulation - -import ( - "fmt" - "math/big" - "math/rand" - "time" - - sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/simulation" -) - -func RandomAddresses(r *rand.Rand, accs []simulation.Account) []sdk.AccAddress { - r.Shuffle(len(accs), func(i, j int) { - accs[i], accs[j] = accs[j], accs[i] - }) - - var addresses []sdk.AccAddress - numAddresses := r.Intn(len(accs) + 1) - for i := 0; i < numAddresses; i++ { - addresses = append(addresses, accs[i].Address) - } - return addresses -} - -func RandomPositiveDuration(r *rand.Rand, inclusiveMin, exclusiveMax time.Duration) (time.Duration, error) { - min := int64(inclusiveMin) - max := int64(exclusiveMax) - if min < 0 || max < 0 { - return 0, fmt.Errorf("min and max must be positive") - } - if min >= max { - return 0, fmt.Errorf("max must be < min") - } - randPositiveInt64 := r.Int63n(max-min) + min - return time.Duration(randPositiveInt64), nil -} - -func RandomTime(r *rand.Rand, inclusiveMin, exclusiveMax time.Time) (time.Time, error) { - if exclusiveMax.Before(inclusiveMin) { - return time.Time{}, fmt.Errorf("max must be > min") - } - period := exclusiveMax.Sub(inclusiveMin) - subPeriod, err := RandomPositiveDuration(r, 0, period) - if err != nil { - return time.Time{}, err - } - return inclusiveMin.Add(subPeriod), nil -} - -// RandInt randomly generates an sdkmath.Int in the range [inclusiveMin, inclusiveMax]. It works for negative and positive integers. -func RandIntInclusive(r *rand.Rand, inclusiveMin, inclusiveMax sdkmath.Int) (sdkmath.Int, error) { - if inclusiveMin.GT(inclusiveMax) { - return sdkmath.Int{}, fmt.Errorf("min larger than max") - } - return RandInt(r, inclusiveMin, inclusiveMax.Add(sdk.OneInt())) -} - -// RandInt randomly generates an sdkmath.Int in the range [inclusiveMin, exclusiveMax). It works for negative and positive integers. -func RandInt(r *rand.Rand, inclusiveMin, exclusiveMax sdkmath.Int) (sdkmath.Int, error) { - // validate input - if inclusiveMin.GTE(exclusiveMax) { - return sdkmath.Int{}, fmt.Errorf("min larger or equal to max") - } - // shift the range to start at 0 - shiftedRange := exclusiveMax.Sub(inclusiveMin) // should always be positive given the check above - // randomly pick from the shifted range - shiftedRandInt := sdkmath.NewIntFromBigInt(new(big.Int).Rand(r, shiftedRange.BigInt())) - // shift back to the original range - return shiftedRandInt.Add(inclusiveMin), nil -} diff --git a/x/committee/simulation/decoder.go b/x/committee/simulation/decoder.go deleted file mode 100644 index 8b2946a8..00000000 --- a/x/committee/simulation/decoder.go +++ /dev/null @@ -1,43 +0,0 @@ -package simulation - -import ( - "bytes" - "fmt" - - "github.com/cosmos/cosmos-sdk/codec" - - "github.com/tendermint/tendermint/libs/kv" - - "github.com/kava-labs/kava/x/committee/types" -) - -// DecodeStore unmarshals the KVPair's Value to the corresponding module type -func DecodeStore(cdc *codec.Codec, kvA, kvB kv.Pair) string { - switch { - case bytes.Equal(kvA.Key[:1], types.CommitteeKeyPrefix): - var committeeA, committeeB types.Committee - cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &committeeA) - cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &committeeB) - return fmt.Sprintf("%v\n%v", committeeA, committeeB) - - case bytes.Equal(kvA.Key[:1], types.ProposalKeyPrefix): - var proposalA, proposalB types.Proposal - cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &proposalA) - cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &proposalB) - return fmt.Sprintf("%v\n%v", proposalA, proposalB) - - case bytes.Equal(kvA.Key[:1], types.VoteKeyPrefix): - var voteA, voteB types.Vote - cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &voteA) - cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &voteB) - return fmt.Sprintf("%v\n%v", voteA, voteB) - - case bytes.Equal(kvA.Key[:1], types.NextProposalIDKey): - proposalIDA := types.Uint64FromBytes(kvA.Value) - proposalIDB := types.Uint64FromBytes(kvB.Value) - return fmt.Sprintf("%d\n%d", proposalIDA, proposalIDB) - - default: - panic(fmt.Sprintf("invalid %s key prefix %X", types.ModuleName, kvA.Key[:1])) - } -} diff --git a/x/committee/simulation/decoder_test.go b/x/committee/simulation/decoder_test.go deleted file mode 100644 index bd41a0e3..00000000 --- a/x/committee/simulation/decoder_test.go +++ /dev/null @@ -1,78 +0,0 @@ -package simulation - -import ( - "fmt" - "testing" - "time" - - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/kv" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - - "github.com/kava-labs/kava/x/committee/types" -) - -func makeTestCodec() (cdc *codec.Codec) { - cdc = codec.New() - sdk.RegisterCodec(cdc) - govtypes.RegisterCodec(cdc) - types.RegisterCodec(cdc) - return cdc -} - -func TestDecodeStore(t *testing.T) { - cdc := makeTestCodec() - - committee := types.NewMemberCommittee( - 12, - "This committee is for testing.", - nil, - []types.Permission{types.TextPermission{}}, - sdk.MustNewDecFromStr("0.667"), - time.Hour*24*7, - types.FirstPastThePost, - ) - proposal := types.Proposal{ - ID: 34, - CommitteeID: 12, - Deadline: time.Date(1998, time.January, 1, 1, 0, 0, 0, time.UTC), - PubProposal: govtypes.NewTextProposal("A Title", "A description of this proposal."), - } - vote := types.Vote{ - ProposalID: 9, - Voter: nil, - } - - kvPairs := kv.Pairs{ - kv.Pair{Key: types.CommitteeKeyPrefix, Value: cdc.MustMarshalBinaryLengthPrefixed(&committee)}, - kv.Pair{Key: types.ProposalKeyPrefix, Value: cdc.MustMarshalBinaryLengthPrefixed(&proposal)}, - kv.Pair{Key: types.VoteKeyPrefix, Value: cdc.MustMarshalBinaryLengthPrefixed(&vote)}, - kv.Pair{Key: types.NextProposalIDKey, Value: sdk.Uint64ToBigEndian(10)}, - kv.Pair{Key: []byte{0x99}, Value: []byte{0x99}}, - } - - tests := []struct { - name string - expectedLog string - }{ - {"Committee", fmt.Sprintf("%v\n%v", committee, committee)}, - {"Proposal", fmt.Sprintf("%v\n%v", proposal, proposal)}, - {"Vote", fmt.Sprintf("%v\n%v", vote, vote)}, - {"NextProposalID", "10\n10"}, - {"other", ""}, - } - for i, tt := range tests { - i, tt := i, tt - t.Run(tt.name, func(t *testing.T) { - switch i { - case len(tests) - 1: - require.Panics(t, func() { DecodeStore(cdc, kvPairs[i], kvPairs[i]) }, tt.name) - default: - require.Equal(t, tt.expectedLog, DecodeStore(cdc, kvPairs[i], kvPairs[i]), tt.name) - } - }) - } -} diff --git a/x/committee/simulation/genesis.go b/x/committee/simulation/genesis.go deleted file mode 100644 index 1886d517..00000000 --- a/x/committee/simulation/genesis.go +++ /dev/null @@ -1,146 +0,0 @@ -package simulation - -import ( - "fmt" - "math/rand" - "strings" - "time" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/x/simulation" - - "github.com/kava-labs/kava/x/committee/types" -) - -const ( - // Block time params are un-exported constants in cosmos-sdk/x/simulation. - // Copy them here in lieu of importing them. - minTimePerBlock time.Duration = (10000 / 2) * time.Second - maxTimePerBlock time.Duration = 10000 * time.Second - // Calculate the average block time - AverageBlockTime time.Duration = (maxTimePerBlock - minTimePerBlock) / 2 - - FallbackCommitteeID uint64 = 0 -) - -// RandomizedGenState generates a random GenesisState for the module -func RandomizedGenState(simState *module.SimulationState) { - r := simState.Rand - - // Create an always present committee with god permissions to ensure any randomly generated proposal can always be submitted. - // Without this, proposals can often not be submitted as there aren't any committees with the right set of permissions available. - // It provides more control over how often different proposal types happen during simulation. - // It also makes the code simpler--proposals can just be randomly generated and submitted without having to comply to permissions that happen to be available at the time. - fallbackCommittee := types.NewMemberCommittee( - FallbackCommitteeID, - "A committee with god permissions that will always be in state and not deleted. It ensures any generated proposal can always be submitted and passed.", - RandomAddresses(r, simState.Accounts), - []types.Permission{types.GodPermission{}}, - sdk.MustNewDecFromStr("0.5"), - AverageBlockTime*10, - types.FirstPastThePost, - ) - - // Create other committees - numCommittees := r.Intn(100) - committees := []types.Committee{fallbackCommittee} - for i := 0; i < numCommittees; i++ { - com, err := RandomCommittee(r, firstNAccounts(25, simState.Accounts), paramChangeToAllowedParams(simState.ParamChanges)) - if err != nil { - panic(err) - } - committees = append(committees, com) - } - - // Add genesis state to simState - genesisState := types.NewGenesisState( - types.DefaultNextProposalID, - committees, - []types.Proposal{}, - []types.Vote{}, - ) - fmt.Printf("Selected randomly generated %s parameters:\n%s\n", types.ModuleName, codec.MustMarshalJSONIndent(simState.Cdc, genesisState)) - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(genesisState) -} - -func RandomCommittee(r *rand.Rand, availableAccs []simulation.Account, allowedParams []types.AllowedParam) (types.Committee, error) { - // pick committee members - if len(availableAccs) < 1 { - return types.MemberCommittee{}, fmt.Errorf("must be ≥ 1 addresses") - } - var members []sdk.AccAddress - for len(members) < 1 { - members = RandomAddresses(r, availableAccs) - } - - // pick proposal duration - dur, err := RandomPositiveDuration(r, 0, AverageBlockTime*10) - if err != nil { - return types.MemberCommittee{}, err - } - - // pick committee vote threshold, must be in interval (0,1] - threshold := simulation.RandomDecAmount(r, sdk.MustNewDecFromStr("1").Sub(sdk.SmallestDec())).Add(sdk.SmallestDec()) - - var committee types.Committee - if r.Uint64()%2 == 0 { - committee = types.NewMemberCommittee( - r.Uint64(), // could collide with other committees, but unlikely - simulation.RandStringOfLength(r, r.Intn(types.MaxCommitteeDescriptionLength+1)), - members, - RandomPermissions(r, allowedParams), - threshold, - dur, - types.FirstPastThePost, - ) - } else { - tallyDenom := strings.ToLower(simulation.RandStringOfLength(r, (r.Intn(3) + 3))) - - committee = types.NewTokenCommittee( - r.Uint64(), // could collide with other committees, but unlikely - simulation.RandStringOfLength(r, r.Intn(types.MaxCommitteeDescriptionLength+1)), - members, - RandomPermissions(r, allowedParams), - threshold, - dur, - types.FirstPastThePost, - sdk.MustNewDecFromStr("0.25"), - tallyDenom, - ) - } - - return committee, nil -} - -func RandomPermissions(r *rand.Rand, allowedParams []types.AllowedParam) []types.Permission { - var permissions []types.Permission - if r.Intn(100) < 50 { - permissions = append(permissions, types.TextPermission{}) - } - if r.Intn(100) < 50 { - r.Shuffle(len(allowedParams), func(i, j int) { - allowedParams[i], allowedParams[j] = allowedParams[j], allowedParams[i] - }) - permissions = append(permissions, - types.SimpleParamChangePermission{ - AllowedParams: allowedParams[:r.Intn(len(allowedParams)+1)], - }) - } - return permissions -} - -func paramChangeToAllowedParams(paramChanges []simulation.ParamChange) []types.AllowedParam { - var allowedParams []types.AllowedParam - for _, pc := range paramChanges { - allowedParams = append( - allowedParams, - types.AllowedParam{ - Subspace: pc.Subspace, - Key: pc.Key, - }, - ) - } - return allowedParams -} diff --git a/x/committee/simulation/go.mod b/x/committee/simulation/go.mod deleted file mode 100644 index 9029ae40..00000000 --- a/x/committee/simulation/go.mod +++ /dev/null @@ -1,2 +0,0 @@ -// This file exists to make the go mod tools ignore this directory. -// Without it, go mod will try and download the old sdk v0.39 imports in this directory. diff --git a/x/committee/simulation/operations.go b/x/committee/simulation/operations.go deleted file mode 100644 index 908dc788..00000000 --- a/x/committee/simulation/operations.go +++ /dev/null @@ -1,209 +0,0 @@ -package simulation - -import ( - "fmt" - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/simapp/helpers" - sdk "github.com/cosmos/cosmos-sdk/types" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" - distsim "github.com/cosmos/cosmos-sdk/x/distribution/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - - "github.com/kava-labs/kava/x/committee/keeper" - "github.com/kava-labs/kava/x/committee/types" -) - -var proposalPassPercentage = 0.9 - -type AccountKeeper interface { - GetAccount(sdk.Context, sdk.AccAddress) authexported.Account -} - -// WeightedOperations creates an operation (with weight) for each type of proposal generator. -// Custom proposal generators can be added for more control over types of proposal submitted, eg to increase likelyhood of particular cdp param changes. -func WeightedOperations(appParams simulation.AppParams, cdc *codec.Codec, ak AccountKeeper, - k keeper.Keeper, wContents []simulation.WeightedProposalContent, -) simulation.WeightedOperations { - var wops simulation.WeightedOperations - - for _, wContent := range wContents { - wContent := wContent // pin variable - if wContent.AppParamsKey == OpWeightSubmitCommitteeChangeProposal || wContent.AppParamsKey == distsim.OpWeightSubmitCommunitySpendProposal { - // don't include committee change/delete proposals as they're not enabled for submission to committees - // don't include community pool proposals as the generator func sometimes returns nil // TODO replace generator with a better one - continue - } - var weight int - // TODO this doesn't allow weights to be different from what they are in the gov module - appParams.GetOrGenerate(cdc, wContent.AppParamsKey, &weight, nil, - func(_ *rand.Rand) { weight = wContent.DefaultWeight }) - - wops = append( - wops, - simulation.NewWeightedOperation( - weight, - SimulateMsgSubmitProposal(cdc, ak, k, wContent.ContentSimulatorFn), - ), - ) - } - return wops -} - -// SimulateMsgSubmitProposal creates a proposal using the passed contentSimulatorFn and tries to find a committee that has permissions for it. If it can't then it uses the fallback committee. -// If the fallback committee isn't there (eg when using an non-generated genesis) and no committee can be found this emits a no-op msg and doesn't do anything. -// For each submit proposal msg, future ops for the vote messages are generated. Sometimes it doesn't run enough votes to allow the proposal to timeout - the likelihood of this happening is controlled by a parameter. -func SimulateMsgSubmitProposal(cdc *codec.Codec, ak AccountKeeper, k keeper.Keeper, contentSim simulation.ContentSimulatorFn) simulation.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string) (simulation.OperationMsg, []simulation.FutureOperation, error) { - // 1) Send a submit proposal msg - - committees := k.GetCommittees(ctx) - // shuffle committees to ensure proposals are distributed across them evenly - r.Shuffle(len(committees), func(i, j int) { - committees[i], committees[j] = committees[j], committees[i] - }) - // move fallback committee to the end of slice - for i, c := range committees { - if c.GetID() == FallbackCommitteeID { - // switch places with last element - committees[i], committees[len(committees)-1] = committees[len(committees)-1], committees[i] - } - } - // pick a committee that has permissions for proposal - pp := types.PubProposal(contentSim(r, ctx, accs)) - if pp == nil { - return simulation.NewOperationMsgBasic(types.ModuleName, "no-operation (conent generation function returned nil)", "", false, nil), nil, nil - } - var selectedCommittee types.Committee - var found bool - for _, c := range committees { - if c.HasPermissionsFor(ctx, cdc, k.ParamKeeper, pp) { - selectedCommittee = c - found = true - break - } - } - if !found { - // fallback committee was not present, this should only happen if not using the generated genesis state - return simulation.NewOperationMsgBasic(types.ModuleName, "no-operation (no committee has permissions for proposal)", "", false, nil), nil, nil - } - - // create the msg and tx - proposer := selectedCommittee.GetMembers()[r.Intn(len(selectedCommittee.GetMembers()))] // won't panic as committees must have ≥ 1 members - msg := types.NewMsgSubmitProposal( - pp, - proposer, - selectedCommittee.GetID(), - ) - account := ak.GetAccount(ctx, proposer) - fees, err := simulation.RandomFees(r, ctx, account.SpendableCoins(ctx.BlockTime())) - if err != nil { - return simulation.NoOpMsg(types.ModuleName), nil, err - } - proposerAcc, found := simulation.FindAccount(accs, proposer) - if !found { - return simulation.NoOpMsg(types.ModuleName), nil, fmt.Errorf("address not in account list") - } - tx := helpers.GenTx( - []sdk.Msg{msg}, - fees, - helpers.DefaultGenTxGas, - chainID, - []uint64{account.GetAccountNumber()}, - []uint64{account.GetSequence()}, - proposerAcc.PrivKey, - ) - // submit tx - _, result, err := app.Deliver(tx) - if err != nil { - // to aid debugging, add the stack trace to the comment field of the returned opMsg - return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err - } - // to aid debugging, add the result log to the comment field - submitOpMsg := simulation.NewOperationMsg(msg, true, result.Log) - - // 2) Schedule vote operations - - // get submitted proposal - proposalID := types.Uint64FromBytes(result.Data) - proposal, found := k.GetProposal(ctx, proposalID) - if !found { - return simulation.NoOpMsg(types.ModuleName), nil, fmt.Errorf("can't find proposal with ID '%d'", proposalID) - } - - // pick the voters - // num voters determined by whether the proposal should pass or not - numMembers := int64(len(selectedCommittee.GetMembers())) - majority := selectedCommittee.GetVoteThreshold().Mul(sdk.NewDec(numMembers)).Ceil().TruncateInt64() - - numVoters := r.Int63n(majority) // in interval [0, majority) - shouldPass := r.Float64() < proposalPassPercentage - if shouldPass { - numVoters = majority + r.Int63n(numMembers-majority+1) // in interval [majority, numMembers] - } - voters := selectedCommittee.GetMembers()[:numVoters] - - // schedule vote operations - var futureOps []simulation.FutureOperation - for _, v := range voters { - voteTime, err := RandomTime(r, ctx.BlockTime(), proposal.Deadline) - if err != nil { - return simulation.NoOpMsg(types.ModuleName), nil, fmt.Errorf("random time generation failed: %w", err) - } - - // Valid vote types: 0, 1, 2 - randInt, err := RandIntInclusive(r, sdk.ZeroInt(), sdkmath.NewInt(2)) - if err != nil { - return simulation.NoOpMsg(types.ModuleName), nil, fmt.Errorf("random vote type generation failed: %w", err) - } - voteType := types.VoteType(randInt.Int64()) - - fop := simulation.FutureOperation{ - BlockTime: voteTime, - Op: SimulateMsgVote(k, ak, v, proposal.ID, voteType), - } - futureOps = append(futureOps, fop) - } - - return submitOpMsg, futureOps, nil - } -} - -func SimulateMsgVote(k keeper.Keeper, ak AccountKeeper, voter sdk.AccAddress, proposalID uint64, voteType types.VoteType) simulation.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string) ( - opMsg simulation.OperationMsg, fOps []simulation.FutureOperation, err error, - ) { - msg := types.NewMsgVote(voter, proposalID, voteType) - - account := ak.GetAccount(ctx, voter) - fees, err := simulation.RandomFees(r, ctx, account.SpendableCoins(ctx.BlockTime())) - if err != nil { - return simulation.NoOpMsg(types.ModuleName), nil, err - } - - voterAcc, found := simulation.FindAccount(accs, voter) - if !found { - return simulation.NoOpMsg(types.ModuleName), nil, fmt.Errorf("address not in account list") - } - - tx := helpers.GenTx( - []sdk.Msg{msg}, - fees, - helpers.DefaultGenTxGas, - chainID, - []uint64{account.GetAccountNumber()}, - []uint64{account.GetSequence()}, - voterAcc.PrivKey, - ) - - _, result, err := app.Deliver(tx) - if err != nil { - // to aid debugging, add the stack trace to the comment field of the returned opMsg - return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err - } - // to aid debugging, add the result log to the comment field - return simulation.NewOperationMsg(msg, true, result.Log), nil, nil - } -} diff --git a/x/committee/simulation/proposals.go b/x/committee/simulation/proposals.go deleted file mode 100644 index ae213198..00000000 --- a/x/committee/simulation/proposals.go +++ /dev/null @@ -1,173 +0,0 @@ -package simulation - -import ( - "fmt" - "math/rand" - - sdk "github.com/cosmos/cosmos-sdk/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/simulation" - - appparams "github.com/kava-labs/kava/app/params" - "github.com/kava-labs/kava/x/committee/keeper" - "github.com/kava-labs/kava/x/committee/types" -) - -const OpWeightSubmitCommitteeChangeProposal = "op_weight_submit_committee_change_proposal" - -// ProposalContents defines the module weighted proposals' contents -func ProposalContents(k keeper.Keeper, paramChanges []simulation.ParamChange) []simulation.WeightedProposalContent { - return []simulation.WeightedProposalContent{ - { - AppParamsKey: OpWeightSubmitCommitteeChangeProposal, - DefaultWeight: appparams.OpWeightSubmitCommitteeChangeProposal, - ContentSimulatorFn: SimulateCommitteeChangeProposalContent(k, paramChanges), - }, - } -} - -// SimulateCommitteeChangeProposalContent generates gov proposal contents that either: -// - create new committees -// - change existing committees -// - delete committees -// It does not alter the fallback committee. -func SimulateCommitteeChangeProposalContent(k keeper.Keeper, paramChanges []simulation.ParamChange) simulation.ContentSimulatorFn { - return func(r *rand.Rand, ctx sdk.Context, accs []simulation.Account) govtypes.Content { - allowedParams := paramChangeToAllowedParams(paramChanges) - - // get current committees, ignoring the fallback committee - var committees []types.Committee - k.IterateCommittees(ctx, func(com types.Committee) bool { - if com.GetID() != FallbackCommitteeID { - committees = append(committees, com) - } - return false - }) - if len(committees) < 1 { // create a committee if none exist - com, err := RandomCommittee(r, firstNAccounts(25, accs), allowedParams) // limit num members to avoid overflowing hardcoded gov ops gas limit - if err != nil { - panic(err) - } - return types.NewCommitteeChangeProposal( - simulation.RandStringOfLength(r, 10), - simulation.RandStringOfLength(r, 100), - com, - ) - } - - // create a proposal content - - var content govtypes.Content - switch choice := r.Intn(100); { - - // create committee - case choice < 20: - com, err := RandomCommittee(r, firstNAccounts(25, accs), allowedParams) // limit num members to avoid overflowing hardcoded gov ops gas limit - if err != nil { - panic(err) - } - content = types.NewCommitteeChangeProposal( - simulation.RandStringOfLength(r, 10), - simulation.RandStringOfLength(r, 100), - com, - ) - - // update committee - case choice < 80: - com := committees[r.Intn(len(committees))] - - // update members - if r.Intn(100) < 50 { - if len(accs) == 0 { - panic("must have at least one account available to use as committee member") - } - var members []sdk.AccAddress - for len(members) < 1 { - members = RandomAddresses(r, firstNAccounts(25, accs)) // limit num members to avoid overflowing hardcoded gov ops gas limit - } - com.SetMembers(members) - } - // update permissions - if r.Intn(100) < 50 { - com.SetPermissions(RandomPermissions(r, allowedParams)) - } - // update proposal duration - if r.Intn(100) < 50 { - dur, err := RandomPositiveDuration(r, 0, AverageBlockTime*100) - if err != nil { - panic(err) - } - com.SetProposalDuration(dur) - } - // update vote threshold - if r.Intn(100) < 50 { - // VoteThreshold must be in interval (0,1] - com.SetVoteThreshold(simulation.RandomDecAmount(r, sdk.MustNewDecFromStr("1").Sub(sdk.SmallestDec())).Add(sdk.SmallestDec())) - } - - content = types.NewCommitteeChangeProposal( - simulation.RandStringOfLength(r, 10), - simulation.RandStringOfLength(r, 100), - com, - ) - - // delete committee - default: - com := committees[r.Intn(len(committees))] - content = types.NewCommitteeDeleteProposal( - simulation.RandStringOfLength(r, 10), - simulation.RandStringOfLength(r, 100), - com.GetID(), - ) - } - - return content - } -} - -// Example custom ParamChangeProposal generator to only generate change to interesting cdp params. -// This allows more control over what params are changed within a simulation. -/* -func SimulateCDPParamChangeProposalContent(cdpKeeper cdpkeeper.Keeper, paramChangePool []simulation.ParamChange) simulation.ContentSimulatorFn { - return func(r *rand.Rand, ctx sdk.Context, _ []simulation.Account) govtypes.Content { - - var paramChanges []paramstypes.ParamChange - - // alter sub params - cp := cdpKeeper.GetParams(ctx).CollateralParams - if len(cp) == 0 { - return nil - } - cp[0].StabilityFee = sdk.MustNewDecFromStr("0.000001") - paramChanges = append( - paramChanges, - paramstypes.NewParamChange(cdptypes.ModuleName, "?", string(cdptypes.ModuleCdc.MustMarshalJSON(cp))), - ) - - // alter normal param - for _, pc := range paramChangePool { - if pc.Subspace == cdptypes.ModuleName && pc.Key == string(cdptypes.KeyGlobalDebtLimit) { - paramChanges = append( - paramChanges, - paramstypes.NewParamChange(pc.Subspace, pc.Key, pc.SimValue(r)), - ) - } - } - - return paramstypes.NewParameterChangeProposal( - simulation.RandStringOfLength(r, 140), // title - simulation.RandStringOfLength(r, 5000), // description - paramChanges, // set of changes - ) - } -} -*/ -func firstNAccounts(n int, accs []simulation.Account) []simulation.Account { - if n < 0 { - panic(fmt.Sprintf("n must be ≥ 0")) - } - if n > len(accs) { - return accs - } - return accs[:n] -} diff --git a/x/committee/testutil/suite.go b/x/committee/testutil/suite.go index 40a2a103..abc31441 100644 --- a/x/committee/testutil/suite.go +++ b/x/committee/testutil/suite.go @@ -1,10 +1,10 @@ package testutil import ( + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/committee/keeper" diff --git a/x/committee/testutil/types.go b/x/committee/testutil/types.go index 1ae3828c..ec5c409c 100644 --- a/x/committee/testutil/types.go +++ b/x/committee/testutil/types.go @@ -6,7 +6,7 @@ import ( sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/gogo/protobuf/proto" + "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/assert" ) diff --git a/x/committee/types/codec.go b/x/committee/types/codec.go index c8c3b058..753bd011 100644 --- a/x/committee/types/codec.go +++ b/x/committee/types/codec.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/msgservice" authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" proposaltypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" @@ -39,7 +40,7 @@ func init() { // CommitteeChange/Delete proposals along with Permission types are // registered on gov's ModuleCdc - RegisterLegacyAminoCodec(govv1beta1.ModuleCdc.LegacyAmino) + RegisterLegacyAminoCodec(govcodec.Amino) // Register external module pubproposal types. Ideally these would be registered within the modules' types pkg init function. // However registration happens here as a work-around. diff --git a/x/committee/types/committee.go b/x/committee/types/committee.go index d5e5990d..9da95bda 100644 --- a/x/committee/types/committee.go +++ b/x/committee/types/committee.go @@ -8,7 +8,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - proto "github.com/gogo/protobuf/proto" + proto "github.com/cosmos/gogoproto/proto" "sigs.k8s.io/yaml" ) diff --git a/x/committee/types/committee.pb.go b/x/committee/types/committee.pb.go index 87553527..12e02536 100644 --- a/x/committee/types/committee.pb.go +++ b/x/committee/types/committee.pb.go @@ -8,9 +8,9 @@ import ( _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" @@ -264,7 +264,7 @@ func (m *BaseCommittee) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x38 } - n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ProposalDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ProposalDuration):]) + n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.ProposalDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.ProposalDuration):]) if err1 != nil { return 0, err1 } @@ -445,7 +445,7 @@ func (m *BaseCommittee) Size() (n int) { } l = m.VoteThreshold.Size() n += 1 + l + sovCommittee(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.ProposalDuration) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.ProposalDuration) n += 1 + l + sovCommittee(uint64(l)) if m.TallyOption != 0 { n += 1 + sovCommittee(uint64(m.TallyOption)) @@ -700,7 +700,7 @@ func (m *BaseCommittee) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.ProposalDuration, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.ProposalDuration, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/committee/types/committee_test.go b/x/committee/types/committee_test.go index f4500d38..f467cac5 100644 --- a/x/committee/types/committee_test.go +++ b/x/committee/types/committee_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" + "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/crypto" "github.com/kava-labs/kava/x/committee/testutil" "github.com/kava-labs/kava/x/committee/types" diff --git a/x/committee/types/genesis.go b/x/committee/types/genesis.go index cd9e78d0..e34331b3 100644 --- a/x/committee/types/genesis.go +++ b/x/committee/types/genesis.go @@ -4,7 +4,7 @@ import ( "fmt" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - proto "github.com/gogo/protobuf/proto" + proto "github.com/cosmos/gogoproto/proto" ) // DefaultNextProposalID is the starting poiint for proposal IDs. diff --git a/x/committee/types/genesis.pb.go b/x/committee/types/genesis.pb.go index 13b4e022..056c0700 100644 --- a/x/committee/types/genesis.pb.go +++ b/x/committee/types/genesis.pb.go @@ -8,9 +8,9 @@ import ( _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -333,7 +333,7 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Deadline, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Deadline):]) + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Deadline, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Deadline):]) if err1 != nil { return 0, err1 } @@ -463,7 +463,7 @@ func (m *Proposal) Size() (n int) { if m.CommitteeID != 0 { n += 1 + sovGenesis(uint64(m.CommitteeID)) } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Deadline) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Deadline) n += 1 + l + sovGenesis(uint64(l)) return n } @@ -796,7 +796,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Deadline, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Deadline, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/committee/types/genesis_test.go b/x/committee/types/genesis_test.go index 6b2d46ce..98f6e8e5 100644 --- a/x/committee/types/genesis_test.go +++ b/x/committee/types/genesis_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/require" + "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/tendermint/tendermint/crypto" "github.com/kava-labs/kava/x/committee/testutil" "github.com/kava-labs/kava/x/committee/types" diff --git a/x/committee/types/keys.go b/x/committee/types/keys.go index 43455f39..3888a98f 100644 --- a/x/committee/types/keys.go +++ b/x/committee/types/keys.go @@ -16,9 +16,6 @@ const ( // RouterKey Top level router key RouterKey = ModuleName - // QuerierRoute Top level query string - QuerierRoute = ModuleName - // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName ) diff --git a/x/committee/types/msg.go b/x/committee/types/msg.go index 1de69699..6b3d2aac 100644 --- a/x/committee/types/msg.go +++ b/x/committee/types/msg.go @@ -6,7 +6,7 @@ import ( errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/gogo/protobuf/proto" + "github.com/cosmos/gogoproto/proto" ) const ( diff --git a/x/committee/types/msg_test.go b/x/committee/types/msg_test.go index 65ecfe28..e3d65bc6 100644 --- a/x/committee/types/msg_test.go +++ b/x/committee/types/msg_test.go @@ -3,8 +3,8 @@ package types import ( "testing" + "github.com/cometbft/cometbft/crypto" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/crypto" "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/committee/types/param_permissions_test.go b/x/committee/types/param_permissions_test.go index d0fde24c..d4251714 100644 --- a/x/committee/types/param_permissions_test.go +++ b/x/committee/types/param_permissions_test.go @@ -5,12 +5,12 @@ import ( "testing" sdkmath "cosmossdk.io/math" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" paramsproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" cdptypes "github.com/kava-labs/kava/x/cdp/types" diff --git a/x/committee/types/permissions.go b/x/committee/types/permissions.go index 4b44117a..3e4d6e77 100644 --- a/x/committee/types/permissions.go +++ b/x/committee/types/permissions.go @@ -11,7 +11,7 @@ import ( govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" paramsproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - proto "github.com/gogo/protobuf/proto" + proto "github.com/cosmos/gogoproto/proto" communitytypes "github.com/kava-labs/kava/x/community/types" ) diff --git a/x/committee/types/permissions.pb.go b/x/committee/types/permissions.pb.go index da731135..6b570947 100644 --- a/x/committee/types/permissions.pb.go +++ b/x/committee/types/permissions.pb.go @@ -6,8 +6,8 @@ package types import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/committee/types/proposal.pb.go b/x/committee/types/proposal.pb.go index 48268fa5..a329a925 100644 --- a/x/committee/types/proposal.pb.go +++ b/x/committee/types/proposal.pb.go @@ -7,8 +7,8 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/committee/types/query.pb.go b/x/committee/types/query.pb.go index a97aa73c..335f8d8f 100644 --- a/x/committee/types/query.pb.go +++ b/x/committee/types/query.pb.go @@ -10,10 +10,10 @@ import ( types "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -1463,7 +1463,7 @@ func (m *QueryProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Deadline, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Deadline):]) + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Deadline, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Deadline):]) if err2 != nil { return 0, err2 } @@ -2009,7 +2009,7 @@ func (m *QueryProposalResponse) Size() (n int) { if m.CommitteeID != 0 { n += 1 + sovQuery(uint64(m.CommitteeID)) } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Deadline) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Deadline) n += 1 + l + sovQuery(uint64(l)) return n } @@ -2820,7 +2820,7 @@ func (m *QueryProposalResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Deadline, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Deadline, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/committee/types/tx.pb.go b/x/committee/types/tx.pb.go index 3cffce1a..7a3570e3 100644 --- a/x/committee/types/tx.pb.go +++ b/x/committee/types/tx.pb.go @@ -8,9 +8,9 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/x/community/abci_test.go b/x/community/abci_test.go index 1b654da7..c74938bd 100644 --- a/x/community/abci_test.go +++ b/x/community/abci_test.go @@ -5,13 +5,13 @@ import ( "time" sdkmath "cosmossdk.io/math" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/community" "github.com/kava-labs/kava/x/community/types" "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ) func TestABCIStakingRewardsArePaidOutOnDisableInflationBlock(t *testing.T) { diff --git a/x/community/keeper/disable_inflation.go b/x/community/keeper/disable_inflation.go index 7c44c9ca..1a88f53b 100644 --- a/x/community/keeper/disable_inflation.go +++ b/x/community/keeper/disable_inflation.go @@ -58,7 +58,9 @@ func (k Keeper) disableInflation(ctx sdk.Context) { mintParams := k.mintKeeper.GetParams(ctx) mintParams.InflationMin = sdk.ZeroDec() mintParams.InflationMax = sdk.ZeroDec() - k.mintKeeper.SetParams(ctx, mintParams) + if err := k.mintKeeper.SetParams(ctx, mintParams); err != nil { + panic(err) + } logger.Info("x/mint inflation set to 0") // disable kavadist inflation @@ -74,6 +76,8 @@ func (k Keeper) disableCommunityTax(ctx sdk.Context) { distrParams := k.distrKeeper.GetParams(ctx) distrParams.CommunityTax = sdk.ZeroDec() - k.distrKeeper.SetParams(ctx, distrParams) + if err := k.distrKeeper.SetParams(ctx, distrParams); err != nil { + panic(err) + } logger.Info("x/distribution community tax set to 0") } diff --git a/x/community/keeper/keeper.go b/x/community/keeper/keeper.go index af982228..585afaca 100644 --- a/x/community/keeper/keeper.go +++ b/x/community/keeper/keeper.go @@ -3,10 +3,10 @@ package keeper import ( "fmt" + "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/tendermint/libs/log" "github.com/kava-labs/kava/x/community/types" ) diff --git a/x/community/keeper/params_test.go b/x/community/keeper/params_test.go index ad1a7b50..7dff215e 100644 --- a/x/community/keeper/params_test.go +++ b/x/community/keeper/params_test.go @@ -5,10 +5,10 @@ import ( "time" sdkmath "cosmossdk.io/math" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/community/keeper" diff --git a/x/community/keeper/proposal_handler_test.go b/x/community/keeper/proposal_handler_test.go index b65bb382..7f6a6f54 100644 --- a/x/community/keeper/proposal_handler_test.go +++ b/x/community/keeper/proposal_handler_test.go @@ -6,11 +6,11 @@ import ( "time" sdkmath "cosmossdk.io/math" + abcitypes "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - abcitypes "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" cdpkeeper "github.com/kava-labs/kava/x/cdp/keeper" @@ -22,7 +22,7 @@ import ( pricefeedtypes "github.com/kava-labs/kava/x/pricefeed/types" ) -const chainID = "kavatest_2221-1" +const chainID = app.TestChainId func c(denom string, amount int64) sdk.Coin { return sdk.NewInt64Coin(denom, amount) } func ukava(amt int64) sdk.Coins { diff --git a/x/community/module.go b/x/community/module.go index be697fc9..83eaef6e 100644 --- a/x/community/module.go +++ b/x/community/module.go @@ -14,7 +14,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/kava-labs/kava/x/community/client/cli" "github.com/kava-labs/kava/x/community/keeper" @@ -108,20 +108,6 @@ func (am AppModule) Name() string { // RegisterInvariants register module invariants func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} -// Route module message route name -// Deprecated: unused but necessary to fulfill AppModule interface -func (am AppModule) Route() sdk.Route { return sdk.Route{} } - -// QuerierRoute module querier route name -// Deprecated: unused but necessary to fulfill AppModule interface -func (AppModule) QuerierRoute() string { return types.RouterKey } - -// LegacyQuerierHandler returns no sdk.Querier. -// Deprecated: unused but necessary to fulfill AppModule interface -func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { - return nil -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } diff --git a/x/community/module_test.go b/x/community/module_test.go index 3c73285a..4e74874a 100644 --- a/x/community/module_test.go +++ b/x/community/module_test.go @@ -3,8 +3,8 @@ package community_test import ( "testing" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/kava-labs/kava/app" diff --git a/x/community/testutil/disable_inflation.go b/x/community/testutil/disable_inflation.go index 6868fd4f..4d37cc73 100644 --- a/x/community/testutil/disable_inflation.go +++ b/x/community/testutil/disable_inflation.go @@ -3,12 +3,12 @@ package testutil import ( "time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" sdkmath "cosmossdk.io/math" "github.com/kava-labs/kava/app" @@ -171,7 +171,8 @@ func (suite *disableInflationTestSuite) TestDisableInflation() { // test idempotence only if upgrade should have been ran if tc.shouldUpgrade { // reset mint and kavadist state to their initial values - suite.App.GetMintKeeper().SetParams(suite.Ctx, suite.genesisMintState.Params) + err := suite.App.GetMintKeeper().SetParams(suite.Ctx, suite.genesisMintState.Params) + suite.Require().NoError(err) suite.App.GetKavadistKeeper().SetParams(suite.Ctx, suite.genesisKavadistState.Params) // modify staking rewards per second to ensure they are not overridden again diff --git a/x/community/testutil/main.go b/x/community/testutil/main.go index b802e9dc..1016b68e 100644 --- a/x/community/testutil/main.go +++ b/x/community/testutil/main.go @@ -3,9 +3,9 @@ package testutil import ( "github.com/stretchr/testify/suite" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/community/keeper" diff --git a/x/community/testutil/staking_rewards.go b/x/community/testutil/staking_rewards.go index 429e24ec..dbecab2c 100644 --- a/x/community/testutil/staking_rewards.go +++ b/x/community/testutil/staking_rewards.go @@ -6,8 +6,8 @@ import ( "math/rand" "time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/community/types/expected_keepers.go b/x/community/types/expected_keepers.go index c6f5845e..468b4efc 100644 --- a/x/community/types/expected_keepers.go +++ b/x/community/types/expected_keepers.go @@ -47,13 +47,13 @@ type DistributionKeeper interface { GetFeePool(ctx sdk.Context) distrtypes.FeePool SetFeePool(ctx sdk.Context, feePool distrtypes.FeePool) GetParams(ctx sdk.Context) distrtypes.Params - SetParams(ctx sdk.Context, params distrtypes.Params) + SetParams(ctx sdk.Context, params distrtypes.Params) error GetCommunityTax(ctx sdk.Context) sdk.Dec } type MintKeeper interface { GetParams(ctx sdk.Context) (params minttypes.Params) - SetParams(ctx sdk.Context, params minttypes.Params) + SetParams(ctx sdk.Context, params minttypes.Params) error GetMinter(ctx sdk.Context) (minter minttypes.Minter) } diff --git a/x/community/types/genesis.pb.go b/x/community/types/genesis.pb.go index 6917d6dc..82025aef 100644 --- a/x/community/types/genesis.pb.go +++ b/x/community/types/genesis.pb.go @@ -5,8 +5,8 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/community/types/params.pb.go b/x/community/types/params.pb.go index 24559641..d84bf309 100644 --- a/x/community/types/params.pb.go +++ b/x/community/types/params.pb.go @@ -7,9 +7,9 @@ import ( cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -188,7 +188,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x12 - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UpgradeTimeDisableInflation, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.UpgradeTimeDisableInflation):]) + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.UpgradeTimeDisableInflation, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.UpgradeTimeDisableInflation):]) if err1 != nil { return 0, err1 } @@ -216,7 +216,7 @@ func (m *Params) Size() (n int) { } var l int _ = l - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.UpgradeTimeDisableInflation) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.UpgradeTimeDisableInflation) n += 1 + l + sovParams(uint64(l)) l = m.StakingRewardsPerSecond.Size() n += 1 + l + sovParams(uint64(l)) @@ -289,7 +289,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.UpgradeTimeDisableInflation, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.UpgradeTimeDisableInflation, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/community/types/proposal.go b/x/community/types/proposal.go index e7bcbde9..9000fc29 100644 --- a/x/community/types/proposal.go +++ b/x/community/types/proposal.go @@ -8,6 +8,7 @@ import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -32,13 +33,13 @@ var ( func init() { govv1beta1.RegisterProposalType(ProposalTypeCommunityPoolLendDeposit) - govv1beta1.ModuleCdc.Amino.RegisterConcrete(&CommunityPoolLendDepositProposal{}, "kava/CommunityPoolLendDepositProposal", nil) + govcodec.ModuleCdc.Amino.RegisterConcrete(&CommunityPoolLendDepositProposal{}, "kava/CommunityPoolLendDepositProposal", nil) govv1beta1.RegisterProposalType(ProposalTypeCommunityPoolLendWithdraw) - govv1beta1.ModuleCdc.Amino.RegisterConcrete(&CommunityPoolLendWithdrawProposal{}, "kava/CommunityPoolLendWithdrawProposal", nil) + govcodec.ModuleCdc.Amino.RegisterConcrete(&CommunityPoolLendWithdrawProposal{}, "kava/CommunityPoolLendWithdrawProposal", nil) govv1beta1.RegisterProposalType(ProposalTypeCommunityCDPRepayDebt) - govv1beta1.ModuleCdc.Amino.RegisterConcrete(&CommunityCDPRepayDebtProposal{}, "kava/CommunityCDPRepayDebtProposal", nil) + govcodec.ModuleCdc.Amino.RegisterConcrete(&CommunityCDPRepayDebtProposal{}, "kava/CommunityCDPRepayDebtProposal", nil) govv1beta1.RegisterProposalType(ProposalTypeCommunityCDPWithdrawCollateral) - govv1beta1.ModuleCdc.Amino.RegisterConcrete(&CommunityCDPWithdrawCollateralProposal{}, "kava/CommunityCDPWithdrawCollateralProposal", nil) + govcodec.ModuleCdc.Amino.RegisterConcrete(&CommunityCDPWithdrawCollateralProposal{}, "kava/CommunityCDPWithdrawCollateralProposal", nil) } ////////////////// diff --git a/x/community/types/proposal.pb.go b/x/community/types/proposal.pb.go index 32fcc492..81c9f67d 100644 --- a/x/community/types/proposal.pb.go +++ b/x/community/types/proposal.pb.go @@ -7,8 +7,8 @@ import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/community/types/query.pb.go b/x/community/types/query.pb.go index 61d4993f..c1451fd4 100644 --- a/x/community/types/query.pb.go +++ b/x/community/types/query.pb.go @@ -10,9 +10,9 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/x/community/types/staking.pb.go b/x/community/types/staking.pb.go index 440bfd3e..8b803366 100644 --- a/x/community/types/staking.pb.go +++ b/x/community/types/staking.pb.go @@ -7,9 +7,9 @@ import ( cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -142,7 +142,7 @@ func (m *StakingRewardsState) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x12 - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastAccumulationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastAccumulationTime):]) + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.LastAccumulationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastAccumulationTime):]) if err1 != nil { return 0, err1 } @@ -170,7 +170,7 @@ func (m *StakingRewardsState) Size() (n int) { } var l int _ = l - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastAccumulationTime) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastAccumulationTime) n += 1 + l + sovStaking(uint64(l)) l = m.LastTruncationError.Size() n += 1 + l + sovStaking(uint64(l)) @@ -241,7 +241,7 @@ func (m *StakingRewardsState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastAccumulationTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.LastAccumulationTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/community/types/tx.pb.go b/x/community/types/tx.pb.go index ac4b1b26..96e55333 100644 --- a/x/community/types/tx.pb.go +++ b/x/community/types/tx.pb.go @@ -9,9 +9,9 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/x/earn/keeper/msg_server_test.go b/x/earn/keeper/msg_server_test.go index aa20ff44..04efa27d 100644 --- a/x/earn/keeper/msg_server_test.go +++ b/x/earn/keeper/msg_server_test.go @@ -6,11 +6,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cometbft/cometbft/crypto" "github.com/kava-labs/kava/x/earn/keeper" "github.com/kava-labs/kava/x/earn/testutil" "github.com/kava-labs/kava/x/earn/types" "github.com/stretchr/testify/suite" - "github.com/tendermint/tendermint/crypto" ) var moduleAccAddress = sdk.AccAddress(crypto.AddressHash([]byte(types.ModuleAccountName))) diff --git a/x/earn/module.go b/x/earn/module.go index c6dd2855..03374364 100644 --- a/x/earn/module.go +++ b/x/earn/module.go @@ -14,7 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/kava-labs/kava/x/earn/client/cli" "github.com/kava-labs/kava/x/earn/keeper" @@ -24,7 +24,6 @@ import ( var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - // _ module.AppModuleSimulation = AppModule{} // TODO simulation ) // AppModuleBasic app module basics object @@ -109,21 +108,6 @@ func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { keeper.RegisterInvariants(ir, am.keeper) } -// Route module message route name -func (am AppModule) Route() sdk.Route { - return sdk.Route{} -} - -// QuerierRoute module querier route name -func (AppModule) QuerierRoute() string { - return types.QuerierRoute -} - -// LegacyQuerierHandler returns no sdk.Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return nil -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 1 diff --git a/x/earn/testutil/suite.go b/x/earn/testutil/suite.go index 886402c4..063dca41 100644 --- a/x/earn/testutil/suite.go +++ b/x/earn/testutil/suite.go @@ -18,6 +18,9 @@ import ( savingskeeper "github.com/kava-labs/kava/x/savings/keeper" savingstypes "github.com/kava-labs/kava/x/savings/types" + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -27,9 +30,6 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" ) var TestBkavaDenoms = []string{ diff --git a/x/earn/types/genesis.pb.go b/x/earn/types/genesis.pb.go index f6964bf0..c7a2b2f3 100644 --- a/x/earn/types/genesis.pb.go +++ b/x/earn/types/genesis.pb.go @@ -5,8 +5,8 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/earn/types/keys.go b/x/earn/types/keys.go index 1e647f7c..ede49dfd 100644 --- a/x/earn/types/keys.go +++ b/x/earn/types/keys.go @@ -15,9 +15,6 @@ const ( // RouterKey Top level router key RouterKey = ModuleName - // QuerierRoute Top level query string - QuerierRoute = ModuleName - // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName ) diff --git a/x/earn/types/params.pb.go b/x/earn/types/params.pb.go index 3062b1cd..da8b8274 100644 --- a/x/earn/types/params.pb.go +++ b/x/earn/types/params.pb.go @@ -5,8 +5,8 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/earn/types/proposal.go b/x/earn/types/proposal.go index 91dfaa37..ee4433b8 100644 --- a/x/earn/types/proposal.go +++ b/x/earn/types/proposal.go @@ -5,6 +5,7 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" + govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -23,9 +24,9 @@ var ( func init() { govv1beta1.RegisterProposalType(ProposalTypeCommunityPoolDeposit) - govv1beta1.ModuleCdc.Amino.RegisterConcrete(&CommunityPoolDepositProposal{}, "kava/CommunityPoolDepositProposal", nil) + govcodec.ModuleCdc.Amino.RegisterConcrete(&CommunityPoolDepositProposal{}, "kava/CommunityPoolDepositProposal", nil) govv1beta1.RegisterProposalType(ProposalTypeCommunityPoolWithdraw) - govv1beta1.ModuleCdc.Amino.RegisterConcrete(&CommunityPoolWithdrawProposal{}, "kava/CommunityPoolWithdrawProposal", nil) + govcodec.ModuleCdc.Amino.RegisterConcrete(&CommunityPoolWithdrawProposal{}, "kava/CommunityPoolWithdrawProposal", nil) } // NewCommunityPoolDepositProposal creates a new community pool deposit proposal. diff --git a/x/earn/types/proposal.pb.go b/x/earn/types/proposal.pb.go index 17c9c36c..8a4408c5 100644 --- a/x/earn/types/proposal.pb.go +++ b/x/earn/types/proposal.pb.go @@ -7,8 +7,8 @@ import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/earn/types/query.pb.go b/x/earn/types/query.pb.go index 27f445ed..a470d300 100644 --- a/x/earn/types/query.pb.go +++ b/x/earn/types/query.pb.go @@ -10,9 +10,9 @@ import ( github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/x/earn/types/strategy.pb.go b/x/earn/types/strategy.pb.go index f7134816..a20f602c 100644 --- a/x/earn/types/strategy.pb.go +++ b/x/earn/types/strategy.pb.go @@ -5,8 +5,8 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" math "math" ) diff --git a/x/earn/types/tx.pb.go b/x/earn/types/tx.pb.go index 68587a81..44555c8d 100644 --- a/x/earn/types/tx.pb.go +++ b/x/earn/types/tx.pb.go @@ -8,9 +8,9 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/x/earn/types/vault.pb.go b/x/earn/types/vault.pb.go index 3d96d2d6..55b37c2e 100644 --- a/x/earn/types/vault.pb.go +++ b/x/earn/types/vault.pb.go @@ -7,8 +7,8 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/evmutil/keeper/bank_keeper.go b/x/evmutil/keeper/bank_keeper.go index 080bec2c..8061561b 100644 --- a/x/evmutil/keeper/bank_keeper.go +++ b/x/evmutil/keeper/bank_keeper.go @@ -163,6 +163,16 @@ func (k EvmBankKeeper) BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coi return k.akavaKeeper.RemoveBalance(ctx, moduleAddr, akava) } +// IsSendEnabledCoins checks the coins provided and returns an ErrSendDisabled +// if any of the coins are not configured for sending. Returns nil if sending is +// enabled for all provided coins. +func (k EvmBankKeeper) IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error { + // IsSendEnabledCoins method is not used by the evm module, but is required by the + // evmtypes.BankKeeper interface. This must be updated if the evm module + // is updated to use IsSendEnabledCoins. + panic("not implemented") +} + // ConvertOneUkavaToAkavaIfNeeded converts 1 ukava to akava for an address if // its akava balance is smaller than the akavaNeeded amount. func (k EvmBankKeeper) ConvertOneUkavaToAkavaIfNeeded(ctx sdk.Context, addr sdk.AccAddress, akavaNeeded sdkmath.Int) error { diff --git a/x/evmutil/keeper/bank_keeper_test.go b/x/evmutil/keeper/bank_keeper_test.go index e1a89c38..96b3b747 100644 --- a/x/evmutil/keeper/bank_keeper_test.go +++ b/x/evmutil/keeper/bank_keeper_test.go @@ -5,9 +5,9 @@ import ( "time" sdkmath "cosmossdk.io/math" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - tmtime "github.com/tendermint/tendermint/types/time" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" diff --git a/x/evmutil/keeper/conversion_evm_native_test.go b/x/evmutil/keeper/conversion_evm_native_test.go index ec5821f7..3cd9d1c7 100644 --- a/x/evmutil/keeper/conversion_evm_native_test.go +++ b/x/evmutil/keeper/conversion_evm_native_test.go @@ -49,7 +49,7 @@ func (suite *ConversionTestSuite) TestBurn_InsufficientBalance() { err := suite.Keeper.BurnConversionPairCoin(suite.Ctx, pair, sdk.NewCoin(pair.Denom, amount), recipient) suite.Require().Error(err) - suite.Require().Equal("0erc20/usdc is smaller than 100erc20/usdc: insufficient funds", err.Error()) + suite.Require().Equal("spendable balance is smaller than 100erc20/usdc: insufficient funds", err.Error()) } func (suite *ConversionTestSuite) TestBurn() { @@ -237,7 +237,7 @@ func (suite *ConversionTestSuite) TestConvertCoinToERC20_InsufficientBalance() { ) suite.Require().Error(err) - suite.Require().Equal("0erc20/usdc is smaller than 100erc20/usdc: insufficient funds", err.Error()) + suite.Require().Equal("spendable balance is smaller than 100erc20/usdc: insufficient funds", err.Error()) } func (suite *ConversionTestSuite) TestConvertCoinToERC20_NotEnabled() { diff --git a/x/evmutil/keeper/grpc_query_test.go b/x/evmutil/keeper/grpc_query_test.go index cd45bbaa..4f6c6c05 100644 --- a/x/evmutil/keeper/grpc_query_test.go +++ b/x/evmutil/keeper/grpc_query_test.go @@ -5,11 +5,11 @@ import ( "fmt" "testing" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/evmutil/keeper" diff --git a/x/evmutil/migrations/v2/store_test.go b/x/evmutil/migrations/v2/store_test.go index d5768236..69a6cd99 100644 --- a/x/evmutil/migrations/v2/store_test.go +++ b/x/evmutil/migrations/v2/store_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" v2evmutil "github.com/kava-labs/kava/x/evmutil/migrations/v2" @@ -15,7 +15,7 @@ import ( ) func TestStoreMigrationAddsKeyTableIncludingNewParam(t *testing.T) { - encCfg := simapp.MakeTestEncodingConfig() + encCfg := moduletestutil.MakeTestEncodingConfig() evmutilKey := sdk.NewKVStoreKey(types.ModuleName) tEvmutilKey := sdk.NewTransientStoreKey("transient_test") ctx := testutil.DefaultContext(evmutilKey, tEvmutilKey) @@ -33,7 +33,7 @@ func TestStoreMigrationAddsKeyTableIncludingNewParam(t *testing.T) { } func TestStoreMigrationSetsNewParamOnExistingKeyTable(t *testing.T) { - encCfg := simapp.MakeTestEncodingConfig() + encCfg := moduletestutil.MakeTestEncodingConfig() evmutilKey := sdk.NewKVStoreKey(types.ModuleName) tEvmutilKey := sdk.NewTransientStoreKey("transient_test") ctx := testutil.DefaultContext(evmutilKey, tEvmutilKey) diff --git a/x/evmutil/module.go b/x/evmutil/module.go index c2e85907..09ed8b11 100644 --- a/x/evmutil/module.go +++ b/x/evmutil/module.go @@ -7,7 +7,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -115,17 +115,6 @@ func (am AppModule) Name() string { return am.AppModuleBasic.Name() } -// Route returns evmutil module's message route. -func (am AppModule) Route() sdk.Route { return sdk.Route{} } - -// QuerierRoute returns evmutil module's query routing key. -func (AppModule) QuerierRoute() string { return "" } - -// LegacyQuerierHandler returns evmutil module's Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return nil -} - // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { diff --git a/x/evmutil/testutil/suite.go b/x/evmutil/testutil/suite.go index f69a8cd7..c09ec153 100644 --- a/x/evmutil/testutil/suite.go +++ b/x/evmutil/testutil/suite.go @@ -10,6 +10,12 @@ import ( "time" sdkmath "cosmossdk.io/math" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/crypto/tmhash" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmversion "github.com/cometbft/cometbft/proto/tendermint/version" + tmtime "github.com/cometbft/cometbft/types/time" + "github.com/cometbft/cometbft/version" "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" @@ -29,12 +35,6 @@ import ( evmtypes "github.com/evmos/ethermint/x/evm/types" feemarkettypes "github.com/evmos/ethermint/x/feemarket/types" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/crypto/tmhash" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmversion "github.com/tendermint/tendermint/proto/tendermint/version" - tmtime "github.com/tendermint/tendermint/types/time" - "github.com/tendermint/tendermint/version" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/evmutil/keeper" @@ -108,7 +108,7 @@ func (suite *Suite) SetupTest() { // InitializeFromGenesisStates commits first block so we start at 2 here suite.Ctx = suite.App.NewContext(false, tmproto.Header{ Height: suite.App.LastBlockHeight() + 1, - ChainID: "kavatest_1-1", + ChainID: app.TestChainId, Time: time.Now().UTC(), ProposerAddress: consAddress.Bytes(), Version: tmversion.Consensus{ diff --git a/x/evmutil/types/conversion_pair.pb.go b/x/evmutil/types/conversion_pair.pb.go index 91565618..637dd783 100644 --- a/x/evmutil/types/conversion_pair.pb.go +++ b/x/evmutil/types/conversion_pair.pb.go @@ -6,8 +6,8 @@ package types import ( bytes "bytes" fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/evmutil/types/genesis.pb.go b/x/evmutil/types/genesis.pb.go index 698880ab..93aa0b97 100644 --- a/x/evmutil/types/genesis.pb.go +++ b/x/evmutil/types/genesis.pb.go @@ -8,8 +8,8 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/evmutil/types/query.pb.go b/x/evmutil/types/query.pb.go index b51d3ada..9336d95d 100644 --- a/x/evmutil/types/query.pb.go +++ b/x/evmutil/types/query.pb.go @@ -7,9 +7,9 @@ import ( context "context" fmt "fmt" query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/x/evmutil/types/tx.pb.go b/x/evmutil/types/tx.pb.go index 1d63fcfc..d4aa63b4 100644 --- a/x/evmutil/types/tx.pb.go +++ b/x/evmutil/types/tx.pb.go @@ -9,9 +9,9 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/x/hard/genesis_test.go b/x/hard/genesis_test.go index a67a45ba..8d8b923a 100644 --- a/x/hard/genesis_test.go +++ b/x/hard/genesis_test.go @@ -8,9 +8,9 @@ import ( "github.com/stretchr/testify/suite" sdkmath "cosmossdk.io/math" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/hard" diff --git a/x/hard/keeper/borrow_test.go b/x/hard/keeper/borrow_test.go index b12cf70d..3d254cc2 100644 --- a/x/hard/keeper/borrow_test.go +++ b/x/hard/keeper/borrow_test.go @@ -5,10 +5,10 @@ import ( "time" sdkmath "cosmossdk.io/math" + "github.com/cometbft/cometbft/crypto" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/tendermint/crypto" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/hard" diff --git a/x/hard/keeper/deposit_test.go b/x/hard/keeper/deposit_test.go index 7758703e..8eb7cdf1 100644 --- a/x/hard/keeper/deposit_test.go +++ b/x/hard/keeper/deposit_test.go @@ -5,10 +5,10 @@ import ( "time" sdkmath "cosmossdk.io/math" + "github.com/cometbft/cometbft/crypto" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/tendermint/crypto" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/hard" diff --git a/x/hard/keeper/grpc_query_test.go b/x/hard/keeper/grpc_query_test.go index 1a0faf67..0f3e48ba 100644 --- a/x/hard/keeper/grpc_query_test.go +++ b/x/hard/keeper/grpc_query_test.go @@ -4,12 +4,12 @@ import ( "testing" "time" + tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/hard/keeper" "github.com/kava-labs/kava/x/hard/types" "github.com/stretchr/testify/suite" - tmprototypes "github.com/tendermint/tendermint/proto/tendermint/types" ) type grpcQueryTestSuite struct { diff --git a/x/hard/keeper/interest_test.go b/x/hard/keeper/interest_test.go index fde46ee7..753e75db 100644 --- a/x/hard/keeper/interest_test.go +++ b/x/hard/keeper/interest_test.go @@ -6,11 +6,11 @@ import ( "time" sdkmath "cosmossdk.io/math" + "github.com/cometbft/cometbft/crypto" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - "github.com/tendermint/tendermint/crypto" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/hard" diff --git a/x/hard/keeper/keeper_test.go b/x/hard/keeper/keeper_test.go index 9884457e..8d2054be 100644 --- a/x/hard/keeper/keeper_test.go +++ b/x/hard/keeper/keeper_test.go @@ -11,8 +11,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" auctionkeeper "github.com/kava-labs/kava/x/auction/keeper" diff --git a/x/hard/keeper/liquidation_test.go b/x/hard/keeper/liquidation_test.go index 3476618f..d9c3fe33 100644 --- a/x/hard/keeper/liquidation_test.go +++ b/x/hard/keeper/liquidation_test.go @@ -5,9 +5,9 @@ import ( "time" sdkmath "cosmossdk.io/math" + "github.com/cometbft/cometbft/crypto" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/tendermint/crypto" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" auctiontypes "github.com/kava-labs/kava/x/auction/types" diff --git a/x/hard/keeper/querier.go b/x/hard/keeper/querier.go deleted file mode 100644 index 63678a15..00000000 --- a/x/hard/keeper/querier.go +++ /dev/null @@ -1,536 +0,0 @@ -package keeper - -import ( - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/kava-labs/kava/x/hard/types" -) - -// NewQuerier is the module level router for state queries -func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(ctx sdk.Context, path []string, req abci.RequestQuery) (res []byte, err error) { - switch path[0] { - case types.QueryGetParams: - return queryGetParams(ctx, req, k, legacyQuerierCdc) - case types.QueryGetModuleAccounts: - return queryGetModAccounts(ctx, req, k, legacyQuerierCdc) - case types.QueryGetDeposits: - return queryGetDeposits(ctx, req, k, legacyQuerierCdc) - case types.QueryGetUnsyncedDeposits: - return queryGetUnsyncedDeposits(ctx, req, k, legacyQuerierCdc) - case types.QueryGetTotalDeposited: - return queryGetTotalDeposited(ctx, req, k, legacyQuerierCdc) - case types.QueryGetBorrows: - return queryGetBorrows(ctx, req, k, legacyQuerierCdc) - case types.QueryGetUnsyncedBorrows: - return queryGetUnsyncedBorrows(ctx, req, k, legacyQuerierCdc) - case types.QueryGetTotalBorrowed: - return queryGetTotalBorrowed(ctx, req, k, legacyQuerierCdc) - case types.QueryGetInterestRate: - return queryGetInterestRate(ctx, req, k, legacyQuerierCdc) - case types.QueryGetReserves: - return queryGetReserves(ctx, req, k, legacyQuerierCdc) - case types.QueryGetInterestFactors: - return queryGetInterestFactors(ctx, req, k, legacyQuerierCdc) - default: - return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unknown %s query endpoint", types.ModuleName) - } - } -} - -func queryGetParams(ctx sdk.Context, _ abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - // Get params - params := k.GetParams(ctx) - - // Encode results - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, params) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetModAccounts(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryAccountParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - var accs []authtypes.ModuleAccountI - if len(params.Name) > 0 { - acc := k.accountKeeper.GetModuleAccount(ctx, params.Name) - accs = append(accs, acc) - } else { - acc := k.accountKeeper.GetModuleAccount(ctx, types.ModuleAccountName) - accs = append(accs, acc) - } - - // Include module account coins with its account to keep backwards compatibility with v39 account behavior - response := make([]types.ModAccountWithCoins, len(accs)) - for i, acc := range accs { - coins := k.bankKeeper.GetAllBalances(ctx, acc.GetAddress()) - response[i] = types.ModAccountWithCoins{ - Account: acc, - Coins: coins, - } - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, response) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -func queryGetDeposits(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryDepositsParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - denom := len(params.Denom) > 0 - owner := len(params.Owner) > 0 - - var deposits types.Deposits - switch { - case owner && denom: - deposit, found := k.GetSyncedDeposit(ctx, params.Owner) - if found { - for _, coin := range deposit.Amount { - if coin.Denom == params.Denom { - deposits = append(deposits, deposit) - } - } - } - case owner: - deposit, found := k.GetSyncedDeposit(ctx, params.Owner) - if found { - deposits = append(deposits, deposit) - } - case denom: - k.IterateDeposits(ctx, func(deposit types.Deposit) (stop bool) { - if deposit.Amount.AmountOf(params.Denom).IsPositive() { - deposits = append(deposits, deposit) - } - return false - }) - default: - k.IterateDeposits(ctx, func(deposit types.Deposit) (stop bool) { - deposits = append(deposits, deposit) - return false - }) - } - - var bz []byte - - // If owner param was specified then deposits array already contains the user's synced deposit - if owner { - bz, err = codec.MarshalJSONIndent(legacyQuerierCdc, deposits) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil - } - - // Otherwise we need to simulate syncing of each deposit - var syncedDeposits types.Deposits - for _, deposit := range deposits { - syncedDeposit, _ := k.GetSyncedDeposit(ctx, deposit.Depositor) - syncedDeposits = append(syncedDeposits, syncedDeposit) - } - - start, end := client.Paginate(len(syncedDeposits), params.Page, params.Limit, 100) - if start < 0 || end < 0 { - syncedDeposits = types.Deposits{} - } else { - syncedDeposits = syncedDeposits[start:end] - } - - bz, err = codec.MarshalJSONIndent(legacyQuerierCdc, syncedDeposits) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetUnsyncedDeposits(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryUnsyncedDepositsParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - denom := len(params.Denom) > 0 - owner := len(params.Owner) > 0 - - var deposits types.Deposits - switch { - case owner && denom: - deposit, found := k.GetDeposit(ctx, params.Owner) - if found { - for _, coin := range deposit.Amount { - if coin.Denom == params.Denom { - deposits = append(deposits, deposit) - } - } - } - case owner: - deposit, found := k.GetDeposit(ctx, params.Owner) - if found { - deposits = append(deposits, deposit) - } - case denom: - k.IterateDeposits(ctx, func(deposit types.Deposit) (stop bool) { - if deposit.Amount.AmountOf(params.Denom).IsPositive() { - deposits = append(deposits, deposit) - } - return false - }) - default: - k.IterateDeposits(ctx, func(deposit types.Deposit) (stop bool) { - deposits = append(deposits, deposit) - return false - }) - } - - var bz []byte - - start, end := client.Paginate(len(deposits), params.Page, params.Limit, 100) - if start < 0 || end < 0 { - deposits = types.Deposits{} - } else { - deposits = deposits[start:end] - } - - bz, err = codec.MarshalJSONIndent(legacyQuerierCdc, deposits) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetBorrows(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryBorrowsParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - denom := len(params.Denom) > 0 - owner := len(params.Owner) > 0 - - var borrows types.Borrows - switch { - case owner && denom: - borrow, found := k.GetSyncedBorrow(ctx, params.Owner) - if found { - for _, coin := range borrow.Amount { - if coin.Denom == params.Denom { - borrows = append(borrows, borrow) - } - } - } - case owner: - borrow, found := k.GetSyncedBorrow(ctx, params.Owner) - if found { - borrows = append(borrows, borrow) - } - case denom: - k.IterateBorrows(ctx, func(borrow types.Borrow) (stop bool) { - if borrow.Amount.AmountOf(params.Denom).IsPositive() { - borrows = append(borrows, borrow) - } - return false - }) - default: - k.IterateBorrows(ctx, func(borrow types.Borrow) (stop bool) { - borrows = append(borrows, borrow) - return false - }) - } - - var bz []byte - - // If owner param was specified then borrows array already contains the user's synced borrow - if owner { - bz, err = codec.MarshalJSONIndent(legacyQuerierCdc, borrows) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil - } - - // Otherwise we need to simulate syncing of each borrow - var syncedBorrows types.Borrows - for _, borrow := range borrows { - syncedBorrow, _ := k.GetSyncedBorrow(ctx, borrow.Borrower) - syncedBorrows = append(syncedBorrows, syncedBorrow) - } - - start, end := client.Paginate(len(syncedBorrows), params.Page, params.Limit, 100) - if start < 0 || end < 0 { - syncedBorrows = types.Borrows{} - } else { - syncedBorrows = syncedBorrows[start:end] - } - - bz, err = codec.MarshalJSONIndent(legacyQuerierCdc, syncedBorrows) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetUnsyncedBorrows(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryUnsyncedBorrowsParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - denom := len(params.Denom) > 0 - owner := len(params.Owner) > 0 - - var borrows types.Borrows - switch { - case owner && denom: - borrow, found := k.GetBorrow(ctx, params.Owner) - if found { - for _, coin := range borrow.Amount { - if coin.Denom == params.Denom { - borrows = append(borrows, borrow) - } - } - } - case owner: - borrow, found := k.GetBorrow(ctx, params.Owner) - if found { - borrows = append(borrows, borrow) - } - case denom: - k.IterateBorrows(ctx, func(borrow types.Borrow) (stop bool) { - if borrow.Amount.AmountOf(params.Denom).IsPositive() { - borrows = append(borrows, borrow) - } - return false - }) - default: - k.IterateBorrows(ctx, func(borrow types.Borrow) (stop bool) { - borrows = append(borrows, borrow) - return false - }) - } - - var bz []byte - - start, end := client.Paginate(len(borrows), params.Page, params.Limit, 100) - if start < 0 || end < 0 { - borrows = types.Borrows{} - } else { - borrows = borrows[start:end] - } - - bz, err = codec.MarshalJSONIndent(legacyQuerierCdc, borrows) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetTotalBorrowed(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryTotalBorrowedParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - borrowedCoins, found := k.GetBorrowedCoins(ctx) - if !found { - borrowedCoins = sdk.NewCoins() - } - - // If user specified a denom only return coins of that denom type - if len(params.Denom) > 0 { - borrowedCoins = sdk.NewCoins(sdk.NewCoin(params.Denom, borrowedCoins.AmountOf(params.Denom))) - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, borrowedCoins) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -func queryGetTotalDeposited(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryTotalDepositedParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - suppliedCoins, found := k.GetSuppliedCoins(ctx) - if !found { - suppliedCoins = sdk.NewCoins() - } - - // If user specified a denom only return coins of that denom type - if len(params.Denom) > 0 { - suppliedCoins = sdk.NewCoins(sdk.NewCoin(params.Denom, suppliedCoins.AmountOf(params.Denom))) - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, suppliedCoins) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -func queryGetInterestRate(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryInterestRateParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - var moneyMarketInterestRates types.MoneyMarketInterestRates - var moneyMarkets types.MoneyMarkets - if len(params.Denom) > 0 { - moneyMarket, found := k.GetMoneyMarket(ctx, params.Denom) - if !found { - return nil, types.ErrMoneyMarketNotFound - } - moneyMarkets = append(moneyMarkets, moneyMarket) - } else { - moneyMarkets = k.GetAllMoneyMarkets(ctx) - } - - // Calculate the borrow and supply APY interest rates for each money market - for _, moneyMarket := range moneyMarkets { - denom := moneyMarket.Denom - macc := k.accountKeeper.GetModuleAccount(ctx, types.ModuleName) - cash := k.bankKeeper.GetBalance(ctx, macc.GetAddress(), denom).Amount - - borrowed := sdk.NewCoin(denom, sdk.ZeroInt()) - borrowedCoins, foundBorrowedCoins := k.GetBorrowedCoins(ctx) - if foundBorrowedCoins { - borrowed = sdk.NewCoin(denom, borrowedCoins.AmountOf(denom)) - } - - reserves, foundReserves := k.GetTotalReserves(ctx) - if !foundReserves { - reserves = sdk.NewCoins() - } - - // CalculateBorrowRate calculates the current interest rate based on utilization (the fraction of supply that has been borrowed) - borrowAPY, err := CalculateBorrowRate(moneyMarket.InterestRateModel, sdk.NewDecFromInt(cash), sdk.NewDecFromInt(borrowed.Amount), sdk.NewDecFromInt(reserves.AmountOf(denom))) - if err != nil { - return nil, err - } - - utilRatio := CalculateUtilizationRatio(sdk.NewDecFromInt(cash), sdk.NewDecFromInt(borrowed.Amount), sdk.NewDecFromInt(reserves.AmountOf(denom))) - fullSupplyAPY := borrowAPY.Mul(utilRatio) - realSupplyAPY := fullSupplyAPY.Mul(sdk.OneDec().Sub(moneyMarket.ReserveFactor)) - - moneyMarketInterestRate := types.MoneyMarketInterestRate{ - Denom: denom, - SupplyInterestRate: realSupplyAPY.String(), - BorrowInterestRate: borrowAPY.String(), - } - - moneyMarketInterestRates = append(moneyMarketInterestRates, moneyMarketInterestRate) - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, moneyMarketInterestRates) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -func queryGetReserves(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryReservesParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - reserveCoins, found := k.GetTotalReserves(ctx) - if !found { - reserveCoins = sdk.Coins{} - } - - // If user specified a denom only return coins of that denom type - if len(params.Denom) > 0 { - reserveCoins = sdk.NewCoins(sdk.NewCoin(params.Denom, reserveCoins.AmountOf(params.Denom))) - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, reserveCoins) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -func queryGetInterestFactors(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryInterestFactorsParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - var interestFactors types.InterestFactors - if len(params.Denom) > 0 { - // Fetch supply/borrow interest factors for a single denom - interestFactor := types.InterestFactor{} - interestFactor.Denom = params.Denom - supplyInterestFactor, found := k.GetSupplyInterestFactor(ctx, params.Denom) - if found { - interestFactor.SupplyInterestFactor = supplyInterestFactor.String() - } - borrowInterestFactor, found := k.GetBorrowInterestFactor(ctx, params.Denom) - if found { - interestFactor.BorrowInterestFactor = borrowInterestFactor.String() - } - interestFactors = append(interestFactors, interestFactor) - } else { - interestFactorMap := make(map[string]types.InterestFactor) - // Populate mapping with supply interest factors - k.IterateSupplyInterestFactors(ctx, func(denom string, factor sdk.Dec) (stop bool) { - interestFactor := types.InterestFactor{Denom: denom, SupplyInterestFactor: factor.String()} - interestFactorMap[denom] = interestFactor - return false - }) - // Populate mapping with borrow interest factors - k.IterateBorrowInterestFactors(ctx, func(denom string, factor sdk.Dec) (stop bool) { - interestFactor, ok := interestFactorMap[denom] - if !ok { - newInterestFactor := types.InterestFactor{Denom: denom, BorrowInterestFactor: factor.String()} - interestFactorMap[denom] = newInterestFactor - } else { - interestFactor.BorrowInterestFactor = factor.String() - interestFactorMap[denom] = interestFactor - } - return false - }) - // Translate mapping to slice - for _, val := range interestFactorMap { - interestFactors = append(interestFactors, val) - } - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, interestFactors) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} diff --git a/x/hard/keeper/repay_test.go b/x/hard/keeper/repay_test.go index 75e162bf..9d9e9e39 100644 --- a/x/hard/keeper/repay_test.go +++ b/x/hard/keeper/repay_test.go @@ -4,10 +4,10 @@ import ( "time" sdkmath "cosmossdk.io/math" + "github.com/cometbft/cometbft/crypto" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/tendermint/crypto" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/hard" diff --git a/x/hard/keeper/withdraw_test.go b/x/hard/keeper/withdraw_test.go index 610a47aa..02682831 100644 --- a/x/hard/keeper/withdraw_test.go +++ b/x/hard/keeper/withdraw_test.go @@ -5,10 +5,10 @@ import ( "time" sdkmath "cosmossdk.io/math" + "github.com/cometbft/cometbft/crypto" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/tendermint/crypto" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/hard" diff --git a/x/hard/module.go b/x/hard/module.go index 1f8e77b1..952ff860 100644 --- a/x/hard/module.go +++ b/x/hard/module.go @@ -13,7 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/kava-labs/kava/x/hard/client/cli" "github.com/kava-labs/kava/x/hard/keeper" @@ -23,7 +23,6 @@ import ( var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - // _ module.AppModuleSimulation = AppModule{} ) // AppModuleBasic app module basics object @@ -68,11 +67,6 @@ func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux } } -// LegacyQuerierHandler returns sdk.Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return keeper.NewQuerier(am.keeper, legacyQuerierCdc) -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 1 @@ -119,16 +113,6 @@ func (AppModule) Name() string { // RegisterInvariants register module invariants func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} -// Route returns the message routing key for the hard module. -func (am AppModule) Route() sdk.Route { - return sdk.Route{} -} - -// QuerierRoute returns the hard module's querier route name. -func (AppModule) QuerierRoute() string { - return types.QuerierRoute -} - // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) @@ -162,30 +146,3 @@ func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } - -//____________________________________________________________________________ - -// // GenerateGenesisState creates a randomized GenState of the hard module -// func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState) { -// simulation.RandomizedGenState(simState) -// } - -// // ProposalContents doesn't return any content functions for governance proposals. -// func (AppModuleBasic) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent { -// return nil -// } - -// // RandomizedParams returns nil because hard has no params. -// func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange { -// return simulation.ParamChanges(r) -// } - -// // RegisterStoreDecoder registers a decoder for hard module's types -// func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { -// sdr[types.StoreKey] = simulation.DecodeStore -// } - -// // WeightedOperations returns the all the hard module operations with their respective weights. -// func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation { -// return nil -// } diff --git a/x/hard/simulation/decoder.go b/x/hard/simulation/decoder.go deleted file mode 100644 index b18a6c2e..00000000 --- a/x/hard/simulation/decoder.go +++ /dev/null @@ -1,25 +0,0 @@ -package simulation - -import ( - "bytes" - "fmt" - - "github.com/tendermint/tendermint/libs/kv" - - "github.com/cosmos/cosmos-sdk/codec" - - "github.com/kava-labs/kava/x/hard/types" -) - -// DecodeStore unmarshals the KVPair's Value to the corresponding hard type -func DecodeStore(cdc *codec.Codec, kvA, kvB kv.Pair) string { - switch { - case bytes.Equal(kvA.Key[:1], types.DepositsKeyPrefix): - var depA, depB types.Deposit - cdc.MustUnmarshalBinaryBare(kvA.Value, &depA) - cdc.MustUnmarshalBinaryBare(kvB.Value, &depB) - return fmt.Sprintf("%s\n%s", depA, depB) - default: - panic(fmt.Sprintf("invalid %s key prefix %X", types.ModuleName, kvA.Key[:1])) - } -} diff --git a/x/hard/simulation/decoder_test.go b/x/hard/simulation/decoder_test.go deleted file mode 100644 index 165dad86..00000000 --- a/x/hard/simulation/decoder_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package simulation - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/tendermint/tendermint/libs/kv" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/kava-labs/kava/x/hard/types" -) - -func makeTestCodec() (cdc *codec.Codec) { - cdc = codec.New() - sdk.RegisterCodec(cdc) - codec.RegisterCrypto(cdc) - types.RegisterCodec(cdc) - return -} - -func TestDecodeDistributionStore(t *testing.T) { - cdc := makeTestCodec() - - deposit := types.NewDeposit(sdk.AccAddress("test"), sdk.NewCoins(sdk.NewCoin("bnb", sdkmath.NewInt(1))), types.SupplyInterestFactors{}) - - kvPairs := kv.Pairs{ - kv.Pair{Key: []byte(types.DepositsKeyPrefix), Value: cdc.MustMarshalBinaryBare(deposit)}, - kv.Pair{Key: []byte{0x99}, Value: []byte{0x99}}, - } - - tests := []struct { - name string - expectedLog string - }{ - {"Deposit", fmt.Sprintf("%s\n%s", deposit, deposit)}, - {"other", ""}, - } - for i, tt := range tests { - i, tt := i, tt - t.Run(tt.name, func(t *testing.T) { - switch i { - case len(tests) - 1: - require.Panics(t, func() { DecodeStore(cdc, kvPairs[i], kvPairs[i]) }, tt.name) - default: - require.Equal(t, tt.expectedLog, DecodeStore(cdc, kvPairs[i], kvPairs[i]), tt.name) - } - }) - } -} diff --git a/x/hard/simulation/genesis.go b/x/hard/simulation/genesis.go deleted file mode 100644 index 15328118..00000000 --- a/x/hard/simulation/genesis.go +++ /dev/null @@ -1,79 +0,0 @@ -package simulation - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/types/module" - - "github.com/kava-labs/kava/x/hard/types" -) - -// SecondsPerYear is the number of seconds in a year -const ( - SecondsPerYear = 31536000 - // BaseAprPadding sets the minimum inflation to the calculated SPR inflation rate from being 0.0 - BaseAprPadding = "0.000000003022265980" -) - -// RandomizedGenState generates a random GenesisState for hard module -func RandomizedGenState(simState *module.SimulationState) { - // params := genRandomParams(simState) - // if err := params.Validate(); err != nil { - // panic(err) - // } - - hardGenesis := types.DefaultGenesisState() - if err := hardGenesis.Validate(); err != nil { - panic(err) - } - - fmt.Printf("Selected randomly generated %s parameters:\n%s\n", types.ModuleName, codec.MustMarshalJSONIndent(simState.Cdc, hardGenesis)) - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(hardGenesis) -} - -// func genRandomParams(simState *module.SimulationState) types.Params { -// periods := genRandomPeriods(simState.Rand, simState.GenTimestamp) -// params := types.NewParams(true, periods) -// return params -// } - -// func genRandomPeriods(r *rand.Rand, timestamp time.Time) types.Periods { -// var periods types.Periods -// numPeriods := simulation.RandIntBetween(r, 1, 10) -// periodStart := timestamp -// for i := 0; i < numPeriods; i++ { -// // set periods to be between 1-3 days -// durationMultiplier := simulation.RandIntBetween(r, 1, 3) -// duration := time.Duration(int64(24*durationMultiplier)) * time.Hour -// periodEnd := periodStart.Add(duration) -// inflation := genRandomInflation(r) -// period := types.NewPeriod(periodStart, periodEnd, inflation) -// periods = append(periods, period) -// periodStart = periodEnd -// } -// return periods -// } - -// func genRandomInflation(r *rand.Rand) sdk.Dec { -// // If sim.RandomDecAmount is less than base apr padding, add base apr padding -// aprPadding, _ := sdk.NewDecFromStr(BaseAprPadding) -// extraAprInflation := simulation.RandomDecAmount(r, sdk.MustNewDecFromStr("0.25")) -// for extraAprInflation.LT(aprPadding) { -// extraAprInflation = extraAprInflation.Add(aprPadding) -// } -// aprInflation := sdk.OneDec().Add(extraAprInflation) - -// // convert APR inflation to SPR (inflation per second) -// inflationSpr, err := aprInflation.ApproxRoot(uint64(SecondsPerYear)) -// if err != nil { -// panic(fmt.Sprintf("error generating random inflation %v", err)) -// } -// return inflationSpr -// } - -// func genRandomActive(r *rand.Rand) bool { -// threshold := 50 -// value := simulation.RandIntBetween(r, 1, 100) -// return value > threshold -// } diff --git a/x/hard/simulation/go.mod b/x/hard/simulation/go.mod deleted file mode 100644 index e69de29b..00000000 diff --git a/x/hard/simulation/params.go b/x/hard/simulation/params.go deleted file mode 100644 index 36ff612a..00000000 --- a/x/hard/simulation/params.go +++ /dev/null @@ -1,13 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/x/simulation" -) - -// ParamChanges defines the parameters that can be modified by param change proposals -// on the simulation -func ParamChanges(r *rand.Rand) []simulation.ParamChange { - return []simulation.ParamChange{} -} diff --git a/x/hard/types/genesis.pb.go b/x/hard/types/genesis.pb.go index bfd25fd1..45dcb84d 100644 --- a/x/hard/types/genesis.pb.go +++ b/x/hard/types/genesis.pb.go @@ -8,9 +8,9 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -383,7 +383,7 @@ func (m *GenesisAccumulationTime) MarshalToSizedBuffer(dAtA []byte) (int, error) } i-- dAtA[i] = 0x1a - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.PreviousAccumulationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.PreviousAccumulationTime):]) + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.PreviousAccumulationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PreviousAccumulationTime):]) if err2 != nil { return 0, err2 } @@ -469,7 +469,7 @@ func (m *GenesisAccumulationTime) Size() (n int) { if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.PreviousAccumulationTime) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PreviousAccumulationTime) n += 1 + l + sovGenesis(uint64(l)) l = m.SupplyInterestFactor.Size() n += 1 + l + sovGenesis(uint64(l)) @@ -861,7 +861,7 @@ func (m *GenesisAccumulationTime) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.PreviousAccumulationTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.PreviousAccumulationTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/hard/types/hard.pb.go b/x/hard/types/hard.pb.go index eb6c7917..e7de080b 100644 --- a/x/hard/types/hard.pb.go +++ b/x/hard/types/hard.pb.go @@ -8,8 +8,8 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/hard/types/keys.go b/x/hard/types/keys.go index 44ccc13e..cc42bec0 100644 --- a/x/hard/types/keys.go +++ b/x/hard/types/keys.go @@ -13,9 +13,6 @@ const ( // RouterKey Top level router key RouterKey = ModuleName - // QuerierRoute Top level query string - QuerierRoute = ModuleName - // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName ) diff --git a/x/hard/types/query.pb.go b/x/hard/types/query.pb.go index 631f7864..35d2b877 100644 --- a/x/hard/types/query.pb.go +++ b/x/hard/types/query.pb.go @@ -11,9 +11,9 @@ import ( types1 "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" types "github.com/cosmos/cosmos-sdk/x/auth/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/x/hard/types/tx.pb.go b/x/hard/types/tx.pb.go index 480cf1eb..e14cb5d5 100644 --- a/x/hard/types/tx.pb.go +++ b/x/hard/types/tx.pb.go @@ -9,9 +9,9 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/x/incentive/genesis_test.go b/x/incentive/genesis_test.go index 83a06947..78b75cc7 100644 --- a/x/incentive/genesis_test.go +++ b/x/incentive/genesis_test.go @@ -9,7 +9,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/kava-labs/kava/app" hardtypes "github.com/kava-labs/kava/x/hard/types" diff --git a/x/incentive/keeper/grpc_query_test.go b/x/incentive/keeper/grpc_query_test.go index 355f2c8f..a4ac6c5b 100644 --- a/x/incentive/keeper/grpc_query_test.go +++ b/x/incentive/keeper/grpc_query_test.go @@ -5,6 +5,7 @@ import ( "time" sdkmath "cosmossdk.io/math" + tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/kava-labs/kava/app" @@ -12,7 +13,6 @@ import ( "github.com/kava-labs/kava/x/incentive/keeper" "github.com/kava-labs/kava/x/incentive/types" "github.com/stretchr/testify/suite" - tmprototypes "github.com/tendermint/tendermint/proto/tendermint/types" ) const ( diff --git a/x/incentive/keeper/hooks.go b/x/incentive/keeper/hooks.go index c1e0381c..2fa7e6dc 100644 --- a/x/incentive/keeper/hooks.go +++ b/x/incentive/keeper/hooks.go @@ -176,6 +176,12 @@ func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, return nil } +// AfterUnbondingInitiated is called when an unbonding operation +// (validator unbonding, unbonding delegation, redelegation) was initiated +func (h Hooks) AfterUnbondingInitiated(_ sdk.Context, _ uint64) error { + return nil +} + // ------------------- Swap Module Hooks ------------------- func (h Hooks) AfterPoolDepositCreated(ctx sdk.Context, poolID string, depositor sdk.AccAddress, _ sdkmath.Int) { diff --git a/x/incentive/keeper/keeper_test.go b/x/incentive/keeper/keeper_test.go index 962ee55d..3ab619aa 100644 --- a/x/incentive/keeper/keeper_test.go +++ b/x/incentive/keeper/keeper_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/suite" + tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" - tmprototypes "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/incentive/keeper" diff --git a/x/incentive/keeper/msg_server_earn_test.go b/x/incentive/keeper/msg_server_earn_test.go index daf9018f..98fd3a53 100644 --- a/x/incentive/keeper/msg_server_earn_test.go +++ b/x/incentive/keeper/msg_server_earn_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "time" + abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" - abci "github.com/tendermint/tendermint/abci/types" "github.com/cosmos/cosmos-sdk/x/distribution" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" @@ -148,7 +148,7 @@ func (suite *HandlerTestSuite) TestEarnLiquidClaim() { distribution.BeginBlocker( suite.Ctx, abci.RequestBeginBlock{ - LastCommitInfo: abci.LastCommitInfo{ + LastCommitInfo: abci.CommitInfo{ Votes: []abci.VoteInfo{{ Validator: val, SignedLastBlock: true, diff --git a/x/incentive/keeper/msg_server_swap_test.go b/x/incentive/keeper/msg_server_swap_test.go index a66a319f..366fccb8 100644 --- a/x/incentive/keeper/msg_server_swap_test.go +++ b/x/incentive/keeper/msg_server_swap_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/incentive/testutil" diff --git a/x/incentive/keeper/payout_test.go b/x/incentive/keeper/payout_test.go index 2dd5378e..0c20bfce 100644 --- a/x/incentive/keeper/payout_test.go +++ b/x/incentive/keeper/payout_test.go @@ -7,10 +7,10 @@ import ( "github.com/stretchr/testify/suite" + tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - tmprototypes "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" cdpkeeper "github.com/kava-labs/kava/x/cdp/keeper" diff --git a/x/incentive/keeper/querier.go b/x/incentive/keeper/querier.go index 8e4e3581..fc5832b3 100644 --- a/x/incentive/keeper/querier.go +++ b/x/incentive/keeper/querier.go @@ -3,13 +3,8 @@ package keeper import ( "fmt" - errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - abci "github.com/tendermint/tendermint/abci/types" earntypes "github.com/kava-labs/kava/x/earn/types" "github.com/kava-labs/kava/x/incentive/types" @@ -20,408 +15,6 @@ const ( SecondsPerYear = 31536000 ) -// NewQuerier is the module level router for state queries -func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(ctx sdk.Context, path []string, req abci.RequestQuery) (res []byte, err error) { - switch path[0] { - case types.QueryGetParams: - return queryGetParams(ctx, req, k, legacyQuerierCdc) - - case types.QueryGetHardRewards: - return queryGetHardRewards(ctx, req, k, legacyQuerierCdc) - case types.QueryGetUSDXMintingRewards: - return queryGetUSDXMintingRewards(ctx, req, k, legacyQuerierCdc) - case types.QueryGetDelegatorRewards: - return queryGetDelegatorRewards(ctx, req, k, legacyQuerierCdc) - case types.QueryGetSwapRewards: - return queryGetSwapRewards(ctx, req, k, legacyQuerierCdc) - case types.QueryGetSavingsRewards: - return queryGetSavingsRewards(ctx, req, k, legacyQuerierCdc) - case types.QueryGetRewardFactors: - return queryGetRewardFactors(ctx, req, k, legacyQuerierCdc) - case types.QueryGetEarnRewards: - return queryGetEarnRewards(ctx, req, k, legacyQuerierCdc) - case types.QueryGetAPYs: - return queryGetAPYs(ctx, req, k, legacyQuerierCdc) - default: - return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unknown %s query endpoint", types.ModuleName) - } - } -} - -// query params in the store -func queryGetParams(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - // Get params - params := k.GetParams(ctx) - - // Encode results - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, params) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetHardRewards(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryRewardsParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - owner := len(params.Owner) > 0 - - var hardClaims types.HardLiquidityProviderClaims - switch { - case owner: - hardClaim, foundHardClaim := k.GetHardLiquidityProviderClaim(ctx, params.Owner) - if foundHardClaim { - hardClaims = append(hardClaims, hardClaim) - } - default: - hardClaims = k.GetAllHardLiquidityProviderClaims(ctx) - } - - var paginatedHardClaims types.HardLiquidityProviderClaims - startH, endH := client.Paginate(len(hardClaims), params.Page, params.Limit, 100) - if startH < 0 || endH < 0 { - paginatedHardClaims = types.HardLiquidityProviderClaims{} - } else { - paginatedHardClaims = hardClaims[startH:endH] - } - - if !params.Unsynchronized { - for i, claim := range paginatedHardClaims { - paginatedHardClaims[i] = k.SimulateHardSynchronization(ctx, claim) - } - } - - // Marshal Hard claims - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, paginatedHardClaims) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetUSDXMintingRewards(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryRewardsParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - owner := len(params.Owner) > 0 - - var usdxMintingClaims types.USDXMintingClaims - switch { - case owner: - usdxMintingClaim, foundUsdxMintingClaim := k.GetUSDXMintingClaim(ctx, params.Owner) - if foundUsdxMintingClaim { - usdxMintingClaims = append(usdxMintingClaims, usdxMintingClaim) - } - default: - usdxMintingClaims = k.GetAllUSDXMintingClaims(ctx) - } - - var paginatedUsdxMintingClaims types.USDXMintingClaims - startU, endU := client.Paginate(len(usdxMintingClaims), params.Page, params.Limit, 100) - if startU < 0 || endU < 0 { - paginatedUsdxMintingClaims = types.USDXMintingClaims{} - } else { - paginatedUsdxMintingClaims = usdxMintingClaims[startU:endU] - } - - if !params.Unsynchronized { - for i, claim := range paginatedUsdxMintingClaims { - paginatedUsdxMintingClaims[i] = k.SimulateUSDXMintingSynchronization(ctx, claim) - } - } - - // Marshal USDX minting claims - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, paginatedUsdxMintingClaims) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetDelegatorRewards(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryRewardsParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - owner := len(params.Owner) > 0 - - var delegatorClaims types.DelegatorClaims - switch { - case owner: - delegatorClaim, foundDelegatorClaim := k.GetDelegatorClaim(ctx, params.Owner) - if foundDelegatorClaim { - delegatorClaims = append(delegatorClaims, delegatorClaim) - } - default: - delegatorClaims = k.GetAllDelegatorClaims(ctx) - } - - var paginatedDelegatorClaims types.DelegatorClaims - startH, endH := client.Paginate(len(delegatorClaims), params.Page, params.Limit, 100) - if startH < 0 || endH < 0 { - paginatedDelegatorClaims = types.DelegatorClaims{} - } else { - paginatedDelegatorClaims = delegatorClaims[startH:endH] - } - - if !params.Unsynchronized { - for i, claim := range paginatedDelegatorClaims { - paginatedDelegatorClaims[i] = k.SimulateDelegatorSynchronization(ctx, claim) - } - } - - // Marshal Hard claims - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, paginatedDelegatorClaims) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetSwapRewards(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryRewardsParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - owner := len(params.Owner) > 0 - - var claims types.SwapClaims - switch { - case owner: - claim, found := k.GetSwapClaim(ctx, params.Owner) - if found { - claims = append(claims, claim) - } - default: - claims = k.GetAllSwapClaims(ctx) - } - - var paginatedClaims types.SwapClaims - startH, endH := client.Paginate(len(claims), params.Page, params.Limit, 100) - if startH < 0 || endH < 0 { - paginatedClaims = types.SwapClaims{} - } else { - paginatedClaims = claims[startH:endH] - } - - if !params.Unsynchronized { - for i, claim := range paginatedClaims { - syncedClaim, found := k.GetSynchronizedSwapClaim(ctx, claim.Owner) - if !found { - panic("previously found claim should still be found") - } - paginatedClaims[i] = syncedClaim - } - } - - // Marshal claims - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, paginatedClaims) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetSavingsRewards(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryRewardsParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - owner := len(params.Owner) > 0 - - var claims types.SavingsClaims - switch { - case owner: - claim, found := k.GetSavingsClaim(ctx, params.Owner) - if found { - claims = append(claims, claim) - } - default: - claims = k.GetAllSavingsClaims(ctx) - } - - var paginatedClaims types.SavingsClaims - startH, endH := client.Paginate(len(claims), params.Page, params.Limit, 100) - if startH < 0 || endH < 0 { - paginatedClaims = types.SavingsClaims{} - } else { - paginatedClaims = claims[startH:endH] - } - - if !params.Unsynchronized { - for i, claim := range paginatedClaims { - syncedClaim, found := k.GetSynchronizedSavingsClaim(ctx, claim.Owner) - if !found { - panic("previously found claim should still be found") - } - paginatedClaims[i] = syncedClaim - } - } - - // Marshal claims - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, paginatedClaims) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetEarnRewards(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryRewardsParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - owner := len(params.Owner) > 0 - - var claims types.EarnClaims - switch { - case owner: - claim, found := k.GetEarnClaim(ctx, params.Owner) - if found { - claims = append(claims, claim) - } - default: - claims = k.GetAllEarnClaims(ctx) - } - - var paginatedClaims types.EarnClaims - startH, endH := client.Paginate(len(claims), params.Page, params.Limit, 100) - if startH < 0 || endH < 0 { - paginatedClaims = types.EarnClaims{} - } else { - paginatedClaims = claims[startH:endH] - } - - if !params.Unsynchronized { - for i, claim := range paginatedClaims { - syncedClaim, found := k.GetSynchronizedEarnClaim(ctx, claim.Owner) - if !found { - panic("previously found claim should still be found") - } - paginatedClaims[i] = syncedClaim - } - } - - // Marshal claims - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, paginatedClaims) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetRewardFactors(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var usdxFactors types.RewardIndexes - k.IterateUSDXMintingRewardFactors(ctx, func(collateralType string, factor sdk.Dec) (stop bool) { - usdxFactors = usdxFactors.With(collateralType, factor) - return false - }) - - var supplyFactors types.MultiRewardIndexes - k.IterateHardSupplyRewardIndexes(ctx, func(denom string, indexes types.RewardIndexes) (stop bool) { - supplyFactors = supplyFactors.With(denom, indexes) - return false - }) - - var borrowFactors types.MultiRewardIndexes - k.IterateHardBorrowRewardIndexes(ctx, func(denom string, indexes types.RewardIndexes) (stop bool) { - borrowFactors = borrowFactors.With(denom, indexes) - return false - }) - - var delegatorFactors types.MultiRewardIndexes - k.IterateDelegatorRewardIndexes(ctx, func(denom string, indexes types.RewardIndexes) (stop bool) { - delegatorFactors = delegatorFactors.With(denom, indexes) - return false - }) - - var swapFactors types.MultiRewardIndexes - k.IterateSwapRewardIndexes(ctx, func(poolID string, indexes types.RewardIndexes) (stop bool) { - swapFactors = swapFactors.With(poolID, indexes) - return false - }) - - var savingsFactors types.MultiRewardIndexes - k.IterateSavingsRewardIndexes(ctx, func(denom string, indexes types.RewardIndexes) (stop bool) { - savingsFactors = savingsFactors.With(denom, indexes) - return false - }) - - var earnFactors types.MultiRewardIndexes - k.IterateEarnRewardIndexes(ctx, func(denom string, indexes types.RewardIndexes) (stop bool) { - earnFactors = earnFactors.With(denom, indexes) - return false - }) - - response := types.NewQueryGetRewardFactorsResponse( - usdxFactors, - supplyFactors, - borrowFactors, - delegatorFactors, - swapFactors, - savingsFactors, - earnFactors, - ) - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, response) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -func queryGetAPYs(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - params := k.GetParams(ctx) - var apys types.APYs - - // bkava APY (staking + incentive rewards) - stakingAPR, err := GetStakingAPR(ctx, k, params) - if err != nil { - return nil, err - } - - apys = append(apys, types.NewAPY(liquidtypes.DefaultDerivativeDenom, stakingAPR)) - - // Incentive only APYs - for _, param := range params.EarnRewardPeriods { - // Skip bkava as it's calculated earlier with staking rewards - if param.CollateralType == liquidtypes.DefaultDerivativeDenom { - continue - } - - // Value in the vault in the same denom as CollateralType - vaultTotalValue, err := k.earnKeeper.GetVaultTotalValue(ctx, param.CollateralType) - if err != nil { - return nil, err - } - apy, err := GetAPYFromMultiRewardPeriod(ctx, k, param.CollateralType, param, vaultTotalValue.Amount) - if err != nil { - return nil, err - } - - apys = append(apys, types.NewAPY(param.CollateralType, apy)) - } - - // Marshal APYs - res := types.NewQueryGetAPYsResponse(apys) - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, res) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - // GetStakingAPR returns the total APR for staking and incentive rewards func GetStakingAPR(ctx sdk.Context, k Keeper, params types.Params) (sdk.Dec, error) { // Get staking APR + incentive APR diff --git a/x/incentive/keeper/rewards_borrow_sync_test.go b/x/incentive/keeper/rewards_borrow_sync_test.go index 46c6e0be..8f9f9dc3 100644 --- a/x/incentive/keeper/rewards_borrow_sync_test.go +++ b/x/incentive/keeper/rewards_borrow_sync_test.go @@ -479,7 +479,7 @@ func TestCalculateRewards(t *testing.T) { sourceAmount: d("1000000000"), }, expected: expected{ - coins: nil, + coins: sdk.Coins{}, }, }, { diff --git a/x/incentive/keeper/rewards_borrow_test.go b/x/incentive/keeper/rewards_borrow_test.go index eb6aa81d..c76dd2ff 100644 --- a/x/incentive/keeper/rewards_borrow_test.go +++ b/x/incentive/keeper/rewards_borrow_test.go @@ -5,11 +5,11 @@ import ( "time" sdkmath "cosmossdk.io/math" + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" proposaltypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/committee" diff --git a/x/incentive/keeper/rewards_delegator_test.go b/x/incentive/keeper/rewards_delegator_test.go index 61d937af..6402e17a 100644 --- a/x/incentive/keeper/rewards_delegator_test.go +++ b/x/incentive/keeper/rewards_delegator_test.go @@ -5,14 +5,14 @@ import ( "time" sdkmath "cosmossdk.io/math" + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/incentive/keeper" @@ -25,7 +25,7 @@ type DelegatorRewardsTestSuite struct { suite.Suite keeper keeper.Keeper - stakingKeeper stakingkeeper.Keeper + stakingKeeper *stakingkeeper.Keeper app app.TestApp ctx sdk.Context @@ -54,7 +54,7 @@ func (suite *DelegatorRewardsTestSuite) SetupApp() { suite.keeper = suite.app.GetIncentiveKeeper() suite.stakingKeeper = suite.app.GetStakingKeeper() - suite.ctx = suite.app.NewContext(true, tmproto.Header{Height: 1, Time: suite.genesisTime, ChainID: "kavatest_1-1"}) + suite.ctx = suite.app.NewContext(true, tmproto.Header{Height: 1, Time: suite.genesisTime, ChainID: app.TestChainId}) } func (suite *DelegatorRewardsTestSuite) SetupWithGenState(authBuilder *app.AuthBankGenesisBuilder, incentBuilder testutil.IncentiveGenesisBuilder) { diff --git a/x/incentive/keeper/rewards_earn_accum_integration_test.go b/x/incentive/keeper/rewards_earn_accum_integration_test.go index df7d7282..892323db 100644 --- a/x/incentive/keeper/rewards_earn_accum_integration_test.go +++ b/x/incentive/keeper/rewards_earn_accum_integration_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" + abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" "github.com/kava-labs/kava/app" earntypes "github.com/kava-labs/kava/x/earn/types" @@ -143,7 +143,7 @@ func (suite *AccumulateEarnRewardsIntegrationTests) TestStateUpdatedWhenBlockTim 1*time.Hour, abci.RequestEndBlock{}, abci.RequestBeginBlock{ - LastCommitInfo: abci.LastCommitInfo{ + LastCommitInfo: abci.CommitInfo{ Votes: []abci.VoteInfo{ { Validator: val0, @@ -267,7 +267,7 @@ func (suite *AccumulateEarnRewardsIntegrationTests) TestStateUpdatedWhenBlockTim 1*time.Hour, abci.RequestEndBlock{}, abci.RequestBeginBlock{ - LastCommitInfo: abci.LastCommitInfo{ + LastCommitInfo: abci.CommitInfo{ Votes: []abci.VoteInfo{ { Validator: val0, @@ -309,7 +309,7 @@ func (suite *AccumulateEarnRewardsIntegrationTests) TestStateUpdatedWhenBlockTim }, { CollateralType: "ukava", - RewardFactor: d("4.154285714285714285").Add(stakingRewardIndexes0), + RewardFactor: d("4.154285714285714286").Add(stakingRewardIndexes0), }, }) @@ -455,7 +455,7 @@ func (suite *AccumulateEarnRewardsIntegrationTests) TestNoAccumulationWhenSource 1*time.Hour, abci.RequestEndBlock{}, abci.RequestBeginBlock{ - LastCommitInfo: abci.LastCommitInfo{ + LastCommitInfo: abci.CommitInfo{ Votes: []abci.VoteInfo{ { Validator: val0, @@ -511,7 +511,7 @@ func (suite *AccumulateEarnRewardsIntegrationTests) TestStateAddedWhenStateDoesN 1*time.Hour, abci.RequestEndBlock{}, abci.RequestBeginBlock{ - LastCommitInfo: abci.LastCommitInfo{ + LastCommitInfo: abci.CommitInfo{ Votes: []abci.VoteInfo{ { Validator: val0, @@ -563,7 +563,7 @@ func (suite *AccumulateEarnRewardsIntegrationTests) TestStateAddedWhenStateDoesN 1*time.Hour, abci.RequestEndBlock{}, abci.RequestBeginBlock{ - LastCommitInfo: abci.LastCommitInfo{ + LastCommitInfo: abci.CommitInfo{ Votes: []abci.VoteInfo{ { Validator: val0, diff --git a/x/incentive/keeper/rewards_earn_staking_integration_test.go b/x/incentive/keeper/rewards_earn_staking_integration_test.go index a7e14d33..59466c13 100644 --- a/x/incentive/keeper/rewards_earn_staking_integration_test.go +++ b/x/incentive/keeper/rewards_earn_staking_integration_test.go @@ -4,13 +4,13 @@ import ( "testing" "time" + abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/kava-labs/kava/app" earntypes "github.com/kava-labs/kava/x/earn/types" "github.com/kava-labs/kava/x/incentive/testutil" "github.com/kava-labs/kava/x/incentive/types" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" ) type EarnStakingRewardsIntegrationTestSuite struct { @@ -145,7 +145,7 @@ func (suite *EarnStakingRewardsIntegrationTestSuite) TestStakingRewardsDistribut 1*time.Hour, abci.RequestEndBlock{}, abci.RequestBeginBlock{ - LastCommitInfo: abci.LastCommitInfo{ + LastCommitInfo: abci.CommitInfo{ Votes: []abci.VoteInfo{{ Validator: val, SignedLastBlock: true, diff --git a/x/incentive/keeper/rewards_savings_accum_test.go b/x/incentive/keeper/rewards_savings_accum_test.go index 802f6026..2485669a 100644 --- a/x/incentive/keeper/rewards_savings_accum_test.go +++ b/x/incentive/keeper/rewards_savings_accum_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" savingskeeper "github.com/kava-labs/kava/x/savings/keeper" savingstypes "github.com/kava-labs/kava/x/savings/types" diff --git a/x/incentive/keeper/rewards_supply_test.go b/x/incentive/keeper/rewards_supply_test.go index ed51e423..2780a843 100644 --- a/x/incentive/keeper/rewards_supply_test.go +++ b/x/incentive/keeper/rewards_supply_test.go @@ -4,11 +4,11 @@ import ( "testing" "time" + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" proposaltypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/committee" diff --git a/x/incentive/keeper/rewards_usdx_test.go b/x/incentive/keeper/rewards_usdx_test.go index 646feb62..eb45570e 100644 --- a/x/incentive/keeper/rewards_usdx_test.go +++ b/x/incentive/keeper/rewards_usdx_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" proposaltypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" cdpkeeper "github.com/kava-labs/kava/x/cdp/keeper" diff --git a/x/incentive/keeper/unit_test.go b/x/incentive/keeper/unit_test.go index 18e12e57..8e459dd0 100644 --- a/x/incentive/keeper/unit_test.go +++ b/x/incentive/keeper/unit_test.go @@ -6,6 +6,8 @@ import ( "time" sdkmath "cosmossdk.io/math" + db "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -15,13 +17,11 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" pricefeedtypes "github.com/kava-labs/kava/x/pricefeed/types" "github.com/stretchr/testify/suite" - "github.com/tendermint/tendermint/libs/log" - db "github.com/tendermint/tm-db" + tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/kava-labs/kava/app" cdptypes "github.com/kava-labs/kava/x/cdp/types" earntypes "github.com/kava-labs/kava/x/earn/types" - tmprototypes "github.com/tendermint/tendermint/proto/tendermint/types" hardtypes "github.com/kava-labs/kava/x/hard/types" "github.com/kava-labs/kava/x/incentive/keeper" diff --git a/x/incentive/module.go b/x/incentive/module.go index b98e7661..f3a9dfc6 100644 --- a/x/incentive/module.go +++ b/x/incentive/module.go @@ -13,7 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/kava-labs/kava/x/incentive/client/cli" "github.com/kava-labs/kava/x/incentive/keeper" @@ -23,7 +23,6 @@ import ( var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - // _ module.AppModuleSimulation = AppModule{} ) // AppModuleBasic defines the basic application module used by the incentive module. @@ -67,11 +66,6 @@ func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux } } -// LegacyQuerierHandler returns sdk.Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return keeper.NewQuerier(am.keeper, legacyQuerierCdc) -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 1 @@ -116,16 +110,6 @@ func (AppModule) Name() string { // RegisterInvariants registers the incentive module invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} -// Route returns the message routing key for the incentive module. -func (am AppModule) Route() sdk.Route { - return sdk.Route{} -} - -// QuerierRoute returns the incentive module's querier route name. -func (AppModule) QuerierRoute() string { - return types.QuerierRoute -} - // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) @@ -157,30 +141,3 @@ func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } - -//____________________________________________________________________________ - -// // RegisterStoreDecoder registers a decoder for incentive module's types -// func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { -// sdr[types.StoreKey] = simulation.DecodeStore -// } - -// // GenerateGenesisState creates a randomized GenState of the incentive module -// func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState) { -// simulation.RandomizedGenState(simState) -// } - -// // RandomizedParams creates randomized incentive param changes for the simulator. -// func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange { -// return simulation.ParamChanges(r) -// } - -// // ProposalContents doesn't return any content functions for governance proposals. -// func (AppModuleBasic) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent { -// return nil -// } - -// // WeightedOperations returns the all the incentive module operations with their respective weights. -// func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation { -// return simulation.WeightedOperations(simState.AppParams, simState.Cdc, am.accountKeeper, am.supplyKeeper, am.keeper) -// } diff --git a/x/incentive/simulation/decoder.go b/x/incentive/simulation/decoder.go deleted file mode 100644 index 03da4f2f..00000000 --- a/x/incentive/simulation/decoder.go +++ /dev/null @@ -1,83 +0,0 @@ -package simulation - -import ( - "bytes" - "fmt" - "time" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/tendermint/tendermint/libs/kv" - - "github.com/kava-labs/kava/x/incentive/types" -) - -// DecodeStore unmarshals the KVPair's Value to the module's corresponding type -func DecodeStore(cdc *codec.Codec, kvA, kvB kv.Pair) string { - switch { - - case bytes.Equal(kvA.Key[:1], types.USDXMintingClaimKeyPrefix): - var claimA, claimB types.USDXMintingClaim - cdc.MustUnmarshalBinaryBare(kvA.Value, &claimA) - cdc.MustUnmarshalBinaryBare(kvB.Value, &claimB) - return fmt.Sprintf("%v\n%v", claimA, claimB) - - case bytes.Equal(kvA.Key[:1], types.PreviousUSDXMintingRewardAccrualTimeKeyPrefix): - var timeA, timeB time.Time - cdc.MustUnmarshalBinaryBare(kvA.Value, &timeA) - cdc.MustUnmarshalBinaryBare(kvB.Value, &timeB) - return fmt.Sprintf("%s\n%s", timeA, timeB) - - case bytes.Equal(kvA.Key[:1], types.USDXMintingRewardFactorKeyPrefix): - var factorA, factorB sdk.Dec - cdc.MustUnmarshalBinaryBare(kvA.Value, &factorA) - cdc.MustUnmarshalBinaryBare(kvB.Value, &factorB) - return fmt.Sprintf("%s\n%s", factorA, factorB) - - // case bytes.Equal(kvA.Key[:1], types.HardLiquidityClaimKeyPrefix): - // var claimA, claimB types.HardLiquidityProviderClaim - // cdc.MustUnmarshalBinaryBare(kvA.Value, &claimA) - // cdc.MustUnmarshalBinaryBare(kvB.Value, &claimB) - // return fmt.Sprintf("%v\n%v", claimA, claimB) - - // case bytes.Equal(kvA.Key[:1], types.PreviousHardSupplyRewardAccrualTimeKeyPrefix): - // var timeA, timeB time.Time - // cdc.MustUnmarshalBinaryBare(kvA.Value, &timeA) - // cdc.MustUnmarshalBinaryBare(kvB.Value, &timeB) - // return fmt.Sprintf("%s\n%s", timeA, timeB) - - // case bytes.Equal(kvA.Key[:1], types.HardSupplyRewardFactorKeyPrefix): - // var factorA, factorB sdk.Dec - // cdc.MustUnmarshalBinaryBare(kvA.Value, &factorA) - // cdc.MustUnmarshalBinaryBare(kvB.Value, &factorB) - // return fmt.Sprintf("%s\n%s", factorA, factorB) - - // case bytes.Equal(kvA.Key[:1], types.PreviousHardBorrowRewardAccrualTimeKeyPrefix): - // var timeA, timeB time.Time - // cdc.MustUnmarshalBinaryBare(kvA.Value, &timeA) - // cdc.MustUnmarshalBinaryBare(kvB.Value, &timeB) - // return fmt.Sprintf("%s\n%s", timeA, timeB) - - // case bytes.Equal(kvA.Key[:1], types.HardSupplyRewardFactorKeyPrefix): - // var factorA, factorB sdk.Dec - // cdc.MustUnmarshalBinaryBare(kvA.Value, &factorA) - // cdc.MustUnmarshalBinaryBare(kvB.Value, &factorB) - // return fmt.Sprintf("%s\n%s", factorA, factorB) - - // case bytes.Equal(kvA.Key[:1], types.PreviousHardDelegatorRewardAccrualTimeKeyPrefix): - // var timeA, timeB time.Time - // cdc.MustUnmarshalBinaryBare(kvA.Value, &timeA) - // cdc.MustUnmarshalBinaryBare(kvB.Value, &timeB) - // return fmt.Sprintf("%s\n%s", timeA, timeB) - - // case bytes.Equal(kvA.Key[:1], types.HardDelegatorRewardFactorKeyPrefix): - // var factorA, factorB sdk.Dec - // cdc.MustUnmarshalBinaryBare(kvA.Value, &factorA) - // cdc.MustUnmarshalBinaryBare(kvB.Value, &factorB) - // return fmt.Sprintf("%s\n%s", factorA, factorB) - - default: - panic(fmt.Sprintf("invalid %s key prefix %X", types.ModuleName, kvA.Key[:1])) - } -} diff --git a/x/incentive/simulation/decoder_test.go b/x/incentive/simulation/decoder_test.go deleted file mode 100644 index ef711aa9..00000000 --- a/x/incentive/simulation/decoder_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package simulation - -import ( - "fmt" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/tendermint/tendermint/libs/kv" - - "github.com/kava-labs/kava/x/incentive/types" -) - -func makeTestCodec() (cdc *codec.Codec) { - cdc = codec.New() - sdk.RegisterCodec(cdc) - types.RegisterCodec(cdc) - return -} - -func TestDecodeDistributionStore(t *testing.T) { - cdc := makeTestCodec() - addr, _ := sdk.AccAddressFromBech32("kava15qdefkmwswysgg4qxgqpqr35k3m49pkx2jdfnw") - claim := types.NewUSDXMintingClaim(addr, sdk.NewCoin("ukava", sdkmath.NewInt(1000000)), types.RewardIndexes{types.NewRewardIndex("bnb-a", sdk.ZeroDec())}) - prevBlockTime := time.Now().Add(time.Hour * -1).UTC() - factor := sdk.ZeroDec() - - kvPairs := kv.Pairs{ - kv.Pair{Key: types.USDXMintingClaimKeyPrefix, Value: cdc.MustMarshalBinaryBare(claim)}, - kv.Pair{Key: []byte(types.PreviousUSDXMintingRewardAccrualTimeKeyPrefix), Value: cdc.MustMarshalBinaryBare(prevBlockTime)}, - kv.Pair{Key: []byte(types.USDXMintingRewardFactorKeyPrefix), Value: cdc.MustMarshalBinaryBare(factor)}, - // kv.Pair{Key: types.HardLiquidityClaimKeyPrefix, Value: cdc.MustMarshalBinaryBare(claim)}, - // kv.Pair{Key: []byte(types.HardSupplyRewardFactorKeyPrefix), Value: cdc.MustMarshalBinaryBare(factor)}, - // kv.Pair{Key: []byte(types.PreviousHardSupplyRewardAccrualTimeKeyPrefix), Value: cdc.MustMarshalBinaryBare(prevBlockTime)}, - // kv.Pair{Key: []byte(types.HardBorrowRewardFactorKeyPrefix), Value: cdc.MustMarshalBinaryBare(factor)}, - // kv.Pair{Key: []byte(types.PreviousHardBorrowRewardAccrualTimeKeyPrefix), Value: cdc.MustMarshalBinaryBare(prevBlockTime)}, - // kv.Pair{Key: []byte(types.HardDelegatorRewardFactorKeyPrefix), Value: cdc.MustMarshalBinaryBare(factor)}, - // kv.Pair{Key: []byte(types.PreviousHardDelegatorRewardAccrualTimeKeyPrefix), Value: cdc.MustMarshalBinaryBare(prevBlockTime)}, - kv.Pair{Key: []byte{0x99}, Value: []byte{0x99}}, - } - - tests := []struct { - name string - expectedLog string - }{ - {"USDXMintingClaim", fmt.Sprintf("%v\n%v", claim, claim)}, - {"PreviousUSDXMintingRewardAccrualTime", fmt.Sprintf("%v\n%v", prevBlockTime, prevBlockTime)}, - {"USDXMintingRewardFactor", fmt.Sprintf("%v\n%v", factor, factor)}, - // {"HardLiquidityClaim", fmt.Sprintf("%v\n%v", claim, claim)}, - // {"PreviousHardSupplyRewardAccrualTime", fmt.Sprintf("%v\n%v", prevBlockTime, prevBlockTime)}, - // {"HardSupplyRewardFactor", fmt.Sprintf("%v\n%v", factor, factor)}, - // {"PreviousHardBorrowRewardAccrualTime", fmt.Sprintf("%v\n%v", prevBlockTime, prevBlockTime)}, - // {"HardBorrowRewardFactor", fmt.Sprintf("%v\n%v", factor, factor)}, - // {"PreviousHardDelegatorRewardAccrualTime", fmt.Sprintf("%v\n%v", prevBlockTime, prevBlockTime)}, - // {"HardSupplyDelegatorFactor", fmt.Sprintf("%v\n%v", factor, factor)}, - {"other", ""}, - } - for i, tt := range tests { - i, tt := i, tt - t.Run(tt.name, func(t *testing.T) { - switch i { - case len(tests) - 1: - require.Panics(t, func() { DecodeStore(cdc, kvPairs[i], kvPairs[i]) }, tt.name) - default: - require.Equal(t, tt.expectedLog, DecodeStore(cdc, kvPairs[i], kvPairs[i]), tt.name) - } - }) - } -} diff --git a/x/incentive/simulation/genesis.go b/x/incentive/simulation/genesis.go deleted file mode 100644 index 1e529d0b..00000000 --- a/x/incentive/simulation/genesis.go +++ /dev/null @@ -1,25 +0,0 @@ -package simulation - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/types/module" - - "github.com/kava-labs/kava/x/incentive/types" -) - -var ( - CollateralDenoms = []string{} - RewardDenom = "ukava" - MaxTotalAssetReward = sdkmath.NewInt(1000000000) -) - -// RandomizedGenState generates a random GenesisState for incentive module -func RandomizedGenState(simState *module.SimulationState) { - // New genesis state holds valid, linked reward periods, claim periods, and claim period IDs - incentiveGenesis := types.DefaultGenesisState() - - fmt.Printf("Selected randomly generated %s parameters:\n%s\n", types.ModuleName, codec.MustMarshalJSONIndent(simState.Cdc, incentiveGenesis)) - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(incentiveGenesis) -} diff --git a/x/incentive/simulation/go.mod b/x/incentive/simulation/go.mod deleted file mode 100644 index e69de29b..00000000 diff --git a/x/incentive/simulation/operations.go b/x/incentive/simulation/operations.go deleted file mode 100644 index b4cb1103..00000000 --- a/x/incentive/simulation/operations.go +++ /dev/null @@ -1,50 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth" - "github.com/cosmos/cosmos-sdk/x/simulation" - - appparams "github.com/kava-labs/kava/app/params" - "github.com/kava-labs/kava/x/incentive/keeper" - "github.com/kava-labs/kava/x/incentive/types" -) - -// Simulation operation weights constants -const ( - OpWeightMsgClaimReward = "op_weight_msg_claim_reward" -) - -// WeightedOperations returns all the operations from the module with their respective weights -func WeightedOperations( - appParams simulation.AppParams, cdc *codec.Codec, ak auth.AccountKeeper, sk types.SupplyKeeper, k keeper.Keeper, -) simulation.WeightedOperations { - var weightMsgClaimReward int - - appParams.GetOrGenerate(cdc, OpWeightMsgClaimReward, &weightMsgClaimReward, nil, - func(_ *rand.Rand) { - weightMsgClaimReward = appparams.DefaultWeightMsgClaimReward - }, - ) - - return simulation.WeightedOperations{ - simulation.NewWeightedOperation( - weightMsgClaimReward, - SimulateMsgClaimReward(ak, sk, k), - ), - } -} - -// SimulateMsgClaimReward generates a MsgClaimReward -func SimulateMsgClaimReward(ak auth.AccountKeeper, sk types.SupplyKeeper, k keeper.Keeper) simulation.Operation { - return func( - r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, - ) (simulation.OperationMsg, []simulation.FutureOperation, error) { - return simulation.NewOperationMsgBasic(types.ModuleName, - "no-operation (no accounts currently have fulfillable claims)", "", false, nil), nil, nil - } -} diff --git a/x/incentive/simulation/params.go b/x/incentive/simulation/params.go deleted file mode 100644 index 77007be8..00000000 --- a/x/incentive/simulation/params.go +++ /dev/null @@ -1,24 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/x/simulation" -) - -const ( - keyActive = "Active" - keyRewards = "Rewards" -) - -// genActive generates active bool with 80% chance of true -func genActive(r *rand.Rand) bool { - threshold := 80 - value := simulation.RandIntBetween(r, 1, 100) - return value <= threshold -} - -// ParamChanges defines the parameters that can be modified by param change proposals -func ParamChanges(r *rand.Rand) []simulation.ParamChange { - return []simulation.ParamChange{} -} diff --git a/x/incentive/testutil/integration.go b/x/incentive/testutil/integration.go index d9c8a90d..549a2105 100644 --- a/x/incentive/testutil/integration.go +++ b/x/incentive/testutil/integration.go @@ -6,6 +6,8 @@ import ( "time" sdkmath "cosmossdk.io/math" + abcitypes "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,8 +18,6 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/suite" - abcitypes "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" cdpkeeper "github.com/kava-labs/kava/x/cdp/keeper" @@ -38,8 +38,6 @@ import ( swaptypes "github.com/kava-labs/kava/x/swap/types" ) -var testChainID = "kavatest_1-1" - type IntegrationTester struct { suite.Suite App app.TestApp @@ -80,14 +78,14 @@ func (suite *IntegrationTester) StartChainWithBuilders(builders ...GenesisBuilde func (suite *IntegrationTester) StartChain(genesisStates ...app.GenesisState) { suite.App.InitializeFromGenesisStatesWithTimeAndChainID( suite.GenesisTime, - testChainID, + app.TestChainId, genesisStates..., ) suite.Ctx = suite.App.NewContext(false, tmproto.Header{ Height: 1, Time: suite.GenesisTime, - ChainID: testChainID, + ChainID: app.TestChainId, }) } @@ -132,7 +130,7 @@ func (suite *IntegrationTester) NextBlockAtWithRequest( blockHeight := suite.Ctx.BlockHeight() + 1 responseEndBlock := suite.App.EndBlocker(suite.Ctx, reqEnd) - suite.Ctx = suite.Ctx.WithBlockTime(blockTime).WithBlockHeight(blockHeight).WithChainID(testChainID) + suite.Ctx = suite.Ctx.WithBlockTime(blockTime).WithBlockHeight(blockHeight).WithChainID(app.TestChainId) responseBeginBlock := suite.App.BeginBlocker(suite.Ctx, reqBegin) // height and time in RequestBeginBlock are ignored by module begin blockers return responseEndBlock, responseBeginBlock diff --git a/x/incentive/types/apy.pb.go b/x/incentive/types/apy.pb.go index 53f5fccf..ecf4ca3b 100644 --- a/x/incentive/types/apy.pb.go +++ b/x/incentive/types/apy.pb.go @@ -7,8 +7,8 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/incentive/types/claims.pb.go b/x/incentive/types/claims.pb.go index 31ecc304..8f098c55 100644 --- a/x/incentive/types/claims.pb.go +++ b/x/incentive/types/claims.pb.go @@ -8,8 +8,8 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/incentive/types/claims_test.go b/x/incentive/types/claims_test.go index b8cc8e35..143b6f9d 100644 --- a/x/incentive/types/claims_test.go +++ b/x/incentive/types/claims_test.go @@ -4,10 +4,10 @@ import ( "fmt" "testing" + "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/crypto" ) // d is a helper function for creating sdk.Dec values in tests diff --git a/x/incentive/types/genesis.pb.go b/x/incentive/types/genesis.pb.go index ccb87391..e4cadfa4 100644 --- a/x/incentive/types/genesis.pb.go +++ b/x/incentive/types/genesis.pb.go @@ -5,9 +5,9 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -240,7 +240,7 @@ func (m *AccumulationTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.PreviousAccumulationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.PreviousAccumulationTime):]) + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.PreviousAccumulationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PreviousAccumulationTime):]) if err1 != nil { return 0, err1 } @@ -517,7 +517,7 @@ func (m *AccumulationTime) Size() (n int) { if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.PreviousAccumulationTime) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PreviousAccumulationTime) n += 1 + l + sovGenesis(uint64(l)) return n } @@ -700,7 +700,7 @@ func (m *AccumulationTime) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.PreviousAccumulationTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.PreviousAccumulationTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/incentive/types/genesis_test.go b/x/incentive/types/genesis_test.go index ae07c6ee..4cf95d2a 100644 --- a/x/incentive/types/genesis_test.go +++ b/x/incentive/types/genesis_test.go @@ -6,9 +6,9 @@ import ( "time" sdkmath "cosmossdk.io/math" + "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/crypto" ) func TestGenesisState_Validate(t *testing.T) { diff --git a/x/incentive/types/keys.go b/x/incentive/types/keys.go index db921b3d..803a8e18 100644 --- a/x/incentive/types/keys.go +++ b/x/incentive/types/keys.go @@ -12,9 +12,6 @@ const ( // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName - - // QuerierRoute route used for abci queries - QuerierRoute = ModuleName ) // Key Prefixes diff --git a/x/incentive/types/msg_test.go b/x/incentive/types/msg_test.go index 2c2898bd..9e9a1dae 100644 --- a/x/incentive/types/msg_test.go +++ b/x/incentive/types/msg_test.go @@ -5,10 +5,10 @@ import ( "fmt" "testing" + "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/crypto" "github.com/kava-labs/kava/x/incentive/types" ) diff --git a/x/incentive/types/params.go b/x/incentive/types/params.go index decf2376..72184c6b 100644 --- a/x/incentive/types/params.go +++ b/x/incentive/types/params.go @@ -6,9 +6,9 @@ import ( "strings" "time" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - tmtime "github.com/tendermint/tendermint/types/time" kavadistTypes "github.com/kava-labs/kava/x/kavadist/types" ) diff --git a/x/incentive/types/params.pb.go b/x/incentive/types/params.pb.go index 05faf395..9656459b 100644 --- a/x/incentive/types/params.pb.go +++ b/x/incentive/types/params.pb.go @@ -7,9 +7,9 @@ import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -333,7 +333,7 @@ func (m *RewardPeriod) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x2a - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.End, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.End):]) + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.End, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.End):]) if err2 != nil { return 0, err2 } @@ -341,7 +341,7 @@ func (m *RewardPeriod) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(n2)) i-- dAtA[i] = 0x22 - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Start, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Start):]) + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Start, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Start):]) if err3 != nil { return 0, err3 } @@ -403,7 +403,7 @@ func (m *MultiRewardPeriod) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x2a } } - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.End, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.End):]) + n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.End, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.End):]) if err4 != nil { return 0, err4 } @@ -411,7 +411,7 @@ func (m *MultiRewardPeriod) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(n4)) i-- dAtA[i] = 0x22 - n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Start, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Start):]) + n5, err5 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Start, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Start):]) if err5 != nil { return 0, err5 } @@ -576,7 +576,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x42 } } - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ClaimEnd, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ClaimEnd):]) + n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.ClaimEnd, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ClaimEnd):]) if err6 != nil { return 0, err6 } @@ -695,9 +695,9 @@ func (m *RewardPeriod) Size() (n int) { if l > 0 { n += 1 + l + sovParams(uint64(l)) } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Start) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Start) n += 1 + l + sovParams(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.End) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.End) n += 1 + l + sovParams(uint64(l)) l = m.RewardsPerSecond.Size() n += 1 + l + sovParams(uint64(l)) @@ -717,9 +717,9 @@ func (m *MultiRewardPeriod) Size() (n int) { if l > 0 { n += 1 + l + sovParams(uint64(l)) } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Start) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Start) n += 1 + l + sovParams(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.End) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.End) n += 1 + l + sovParams(uint64(l)) if len(m.RewardsPerSecond) > 0 { for _, e := range m.RewardsPerSecond { @@ -809,7 +809,7 @@ func (m *Params) Size() (n int) { n += 1 + l + sovParams(uint64(l)) } } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ClaimEnd) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ClaimEnd) n += 1 + l + sovParams(uint64(l)) if len(m.SavingsRewardPeriods) > 0 { for _, e := range m.SavingsRewardPeriods { @@ -942,7 +942,7 @@ func (m *RewardPeriod) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Start, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Start, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -975,7 +975,7 @@ func (m *RewardPeriod) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.End, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.End, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1143,7 +1143,7 @@ func (m *MultiRewardPeriod) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Start, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Start, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1176,7 +1176,7 @@ func (m *MultiRewardPeriod) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.End, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.End, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1747,7 +1747,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ClaimEnd, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.ClaimEnd, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/incentive/types/query.pb.go b/x/incentive/types/query.pb.go index 7fbf63f8..d639bf69 100644 --- a/x/incentive/types/query.pb.go +++ b/x/incentive/types/query.pb.go @@ -6,9 +6,9 @@ package types import ( context "context" fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/x/incentive/types/tx.pb.go b/x/incentive/types/tx.pb.go index 7a700217..30dd8bec 100644 --- a/x/incentive/types/tx.pb.go +++ b/x/incentive/types/tx.pb.go @@ -6,9 +6,9 @@ package types import ( context "context" fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/x/issuance/abci_test.go b/x/issuance/abci_test.go index 4b2498ff..9805b9f4 100644 --- a/x/issuance/abci_test.go +++ b/x/issuance/abci_test.go @@ -9,8 +9,8 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/issuance" diff --git a/x/issuance/keeper/issuance_test.go b/x/issuance/keeper/issuance_test.go index 39343d46..03e9c9e8 100644 --- a/x/issuance/keeper/issuance_test.go +++ b/x/issuance/keeper/issuance_test.go @@ -11,10 +11,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - tmprototypes "github.com/tendermint/tendermint/proto/tendermint/types" + tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/tendermint/tendermint/crypto" - tmtime "github.com/tendermint/tendermint/types/time" + "github.com/cometbft/cometbft/crypto" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/issuance/keeper" diff --git a/x/issuance/keeper/querier.go b/x/issuance/keeper/querier.go deleted file mode 100644 index 65408622..00000000 --- a/x/issuance/keeper/querier.go +++ /dev/null @@ -1,37 +0,0 @@ -package keeper - -import ( - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/kava-labs/kava/x/issuance/types" -) - -// NewQuerier is the module level router for state queries -func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(ctx sdk.Context, path []string, req abci.RequestQuery) (res []byte, err error) { - switch path[0] { - case types.QueryGetParams: - return queryGetParams(ctx, req, k, legacyQuerierCdc) - default: - return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unknown %s query endpoint", types.ModuleName) - } - } -} - -// query params in the store -func queryGetParams(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - // Get params - params := k.GetParams(ctx) - - // Encode results - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, params) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} diff --git a/x/issuance/module.go b/x/issuance/module.go index 2dee05fd..a5b5f4ae 100644 --- a/x/issuance/module.go +++ b/x/issuance/module.go @@ -13,7 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/kava-labs/kava/x/issuance/client/cli" "github.com/kava-labs/kava/x/issuance/keeper" @@ -23,7 +23,6 @@ import ( var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - // _ module.AppModuleSimulation = AppModule{} ) // AppModuleBasic app module basics object @@ -104,21 +103,6 @@ func (AppModule) Name() string { // RegisterInvariants register module invariants func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} -// Route module message route name -func (am AppModule) Route() sdk.Route { - return sdk.NewRoute(types.RouterKey, nil) -} - -// QuerierRoute module querier route name -func (AppModule) QuerierRoute() string { - return types.QuerierRoute -} - -// LegacyQuerierHandler returns no sdk.Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return keeper.NewQuerier(am.keeper, legacyQuerierCdc) -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 1 @@ -152,30 +136,3 @@ func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {} func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } - -//____________________________________________________________________________ - -// // GenerateGenesisState creates a randomized GenState of the issuance module -// func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState) { -// simulation.RandomizedGenState(simState) -// } - -// // ProposalContents doesn't return any content functions for governance proposals. -// func (AppModuleBasic) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent { -// return nil -// } - -// // RandomizedParams returns nil because issuance has no params. -// func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange { -// return simulation.ParamChanges(r) -// } - -// // RegisterStoreDecoder registers a decoder for issuance module's types -// func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { -// sdr[StoreKey] = simulation.DecodeStore -// } - -// // WeightedOperations returns the all the issuance module operations with their respective weights. -// func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation { -// return simulation.WeightedOperations(simState.AppParams, simState.Cdc, am.accountKeeper, am.keeper) -// } diff --git a/x/issuance/simulation/decoder.go b/x/issuance/simulation/decoder.go deleted file mode 100644 index 0576e59e..00000000 --- a/x/issuance/simulation/decoder.go +++ /dev/null @@ -1,33 +0,0 @@ -package simulation - -// import ( -// "bytes" -// "fmt" -// "time" - -// "github.com/cosmos/cosmos-sdk/codec" - -// "github.com/kava-labs/kava/x/issuance/types" - -// "github.com/tendermint/tendermint/libs/kv" -// ) - -// // DecodeStore the issuance module has no store keys -- all state is stored in params -// func DecodeStore(cdc *codec.Codec, kvA, kvB kv.Pair) string { -// switch { -// case bytes.Equal(kvA.Key[:1], types.AssetSupplyPrefix): -// var supplyA, supplyB types.AssetSupply -// cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &supplyA) -// cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &supplyB) -// return fmt.Sprintf("%s\n%s", supplyA, supplyB) -// case bytes.Equal(kvA.Key[:1], types.PreviousBlockTimeKey): -// var timeA, timeB time.Time -// cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &timeA) -// cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &timeB) -// return fmt.Sprintf("%s\n%s", timeA, timeB) -// default: -// panic(fmt.Sprintf("invalid %s key prefix %X", types.ModuleName, kvA.Key[:1])) - -// } - -// } diff --git a/x/issuance/simulation/decoder_test.go b/x/issuance/simulation/decoder_test.go deleted file mode 100644 index 740c72d4..00000000 --- a/x/issuance/simulation/decoder_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package simulation - -// import ( -// "fmt" -// "testing" -// "time" - -// "github.com/stretchr/testify/require" - -// "github.com/tendermint/tendermint/libs/kv" - -// "github.com/cosmos/cosmos-sdk/codec" -// sdk "github.com/cosmos/cosmos-sdk/types" - -// "github.com/kava-labs/kava/x/issuance/types" -// ) - -// func makeTestCodec() (cdc *codec.Codec) { -// cdc = codec.New() -// sdk.RegisterCodec(cdc) -// types.RegisterCodec(cdc) -// return -// } - -// func TestDecodeIssuanceStore(t *testing.T) { -// cdc := makeTestCodec() -// supply := types.NewAssetSupply(sdk.NewCoin("usdtoken", sdk.ZeroInt()), time.Hour) -// prevBlockTime := time.Now().UTC() - -// kvPairs := kv.Pairs{ -// kv.Pair{Key: types.AssetSupplyPrefix, Value: cdc.MustMarshalBinaryLengthPrefixed(supply)}, -// kv.Pair{Key: []byte(types.PreviousBlockTimeKey), Value: cdc.MustMarshalBinaryLengthPrefixed(prevBlockTime)}, -// } - -// tests := []struct { -// name string -// expectedLog string -// }{ -// {"AssetSupply", fmt.Sprintf("%v\n%v", supply, supply)}, -// {"PreviousBlockTime", fmt.Sprintf("%s\n%s", prevBlockTime, prevBlockTime)}, -// {"other", ""}, -// } -// for i, tt := range tests { -// i, tt := i, tt -// t.Run(tt.name, func(t *testing.T) { -// switch i { -// case len(tests) - 1: -// require.Panics(t, func() { DecodeStore(cdc, kvPairs[i], kvPairs[i]) }, tt.name) -// default: -// require.Equal(t, tt.expectedLog, DecodeStore(cdc, kvPairs[i], kvPairs[i]), tt.name) -// } -// }) -// } -// } diff --git a/x/issuance/simulation/genesis.go b/x/issuance/simulation/genesis.go deleted file mode 100644 index 698e69ec..00000000 --- a/x/issuance/simulation/genesis.go +++ /dev/null @@ -1,66 +0,0 @@ -package simulation - -// import ( -// "fmt" -// "math/rand" -// "strings" -// "time" - -// "github.com/cosmos/cosmos-sdk/codec" -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/cosmos/cosmos-sdk/types/module" -// "github.com/cosmos/cosmos-sdk/x/simulation" - -// "github.com/kava-labs/kava/x/issuance/types" -// ) - -// var ( -// accs []simulation.Account -// ) - -// // RandomizedGenState generates a random GenesisState for the module -// func RandomizedGenState(simState *module.SimulationState) { -// accs = simState.Accounts -// params := randomizedParams(simState.Rand) -// gs := types.NewGenesisState(params, types.AssetSupplies{}) -// fmt.Printf("Selected randomly generated %s parameters:\n%s\n", types.ModuleName, codec.MustMarshalJSONIndent(simState.Cdc, gs)) -// simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(gs) -// } - -// func randomizedParams(r *rand.Rand) types.Params { -// assets := randomizedAssets(r) -// return types.NewParams(assets) -// } - -// func randomizedAssets(r *rand.Rand) types.Assets { -// randomAssets := types.Assets{} -// numAssets := Max(1, r.Intn(5)) -// for i := 0; i < numAssets; i++ { -// denom := strings.ToLower(simulation.RandStringOfLength(r, (r.Intn(3) + 3))) -// owner := randomOwner(r) -// paused := r.Intn(2) == 0 -// rateLimited := r.Intn(2) == 0 -// rateLimit := types.NewRateLimit(false, sdk.ZeroInt(), time.Duration(0)) -// if rateLimited { -// timeLimit := time.Duration(3600000000000 + (r.Intn(24) + 1)) -// assetLimit := simulation.RandIntBetween(r, 100000000000, 1000000000000) -// rateLimit = types.NewRateLimit(true, sdkmath.NewInt(int64(assetLimit)), timeLimit) -// } -// randomAsset := types.NewAsset(owner.Address, denom, []sdk.AccAddress{}, paused, true, rateLimit) -// randomAssets = append(randomAssets, randomAsset) -// } -// return randomAssets -// } - -// func randomOwner(r *rand.Rand) simulation.Account { -// acc, _ := simulation.RandomAcc(r, accs) -// return acc -// } - -// // Max return max of two ints -// func Max(x, y int) int { -// if x > y { -// return x -// } -// return y -// } diff --git a/x/issuance/simulation/operations.go b/x/issuance/simulation/operations.go deleted file mode 100644 index 45f6b1fa..00000000 --- a/x/issuance/simulation/operations.go +++ /dev/null @@ -1,322 +0,0 @@ -package simulation - -// import ( -// "fmt" -// "math/rand" - -// "github.com/cosmos/cosmos-sdk/baseapp" -// "github.com/cosmos/cosmos-sdk/codec" -// "github.com/cosmos/cosmos-sdk/simapp/helpers" -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/cosmos/cosmos-sdk/x/simulation" -// simappparams "github.com/kava-labs/kava/app/params" - -// "github.com/kava-labs/kava/x/issuance/keeper" -// "github.com/kava-labs/kava/x/issuance/types" -// ) - -// // Simulation operation weights constants -// const ( -// OpWeightMsgIssue = "op_weight_msg_issue" -// OpWeightMsgRedeem = "op_weight_msg_redeem" -// OpWeightMsgBlock = "op_weight_msg_block" -// OpWeightMsgPause = "op_weight_msg_pause" -// ) - -// // WeightedOperations returns all the operations from the module with their respective weights -// func WeightedOperations( -// appParams simulation.AppParams, cdc *codec.Codec, ak types.AccountKeeper, k keeper.Keeper, -// ) simulation.WeightedOperations { -// var ( -// weightMsgIssue int -// weightMsgReedem int -// weightMsgBlock int -// weightMsgPause int -// ) - -// appParams.GetOrGenerate(cdc, OpWeightMsgIssue, &weightMsgIssue, nil, -// func(_ *rand.Rand) { -// weightMsgIssue = simappparams.DefaultWeightMsgIssue -// }, -// ) - -// appParams.GetOrGenerate(cdc, OpWeightMsgRedeem, &weightMsgReedem, nil, -// func(_ *rand.Rand) { -// weightMsgReedem = simappparams.DefaultWeightMsgRedeem -// }, -// ) - -// appParams.GetOrGenerate(cdc, OpWeightMsgBlock, &weightMsgBlock, nil, -// func(_ *rand.Rand) { -// weightMsgBlock = simappparams.DefaultWeightMsgBlock -// }, -// ) - -// appParams.GetOrGenerate(cdc, OpWeightMsgPause, &weightMsgPause, nil, -// func(_ *rand.Rand) { -// weightMsgPause = simappparams.DefaultWeightMsgPause -// }, -// ) - -// return simulation.WeightedOperations{ -// simulation.NewWeightedOperation( -// weightMsgIssue, -// SimulateMsgIssueTokens(ak, k), -// ), -// simulation.NewWeightedOperation( -// weightMsgReedem, -// SimulateMsgRedeemTokens(ak, k), -// ), -// simulation.NewWeightedOperation( -// weightMsgBlock, -// SimulateMsgBlockAddress(ak, k), -// ), -// simulation.NewWeightedOperation( -// weightMsgPause, -// SimulateMsgPause(ak, k), -// ), -// } -// } - -// // SimulateMsgIssueTokens generates a MsgIssueTokens with random values -// func SimulateMsgIssueTokens(ak types.AccountKeeper, k keeper.Keeper) simulation.Operation { -// return func( -// r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, -// ) (simulation.OperationMsg, []simulation.FutureOperation, error) { -// // shuffle the assets and get a random one -// assets := k.GetParams(ctx).Assets -// r.Shuffle(len(assets), func(i, j int) { -// assets[i], assets[j] = assets[j], assets[i] -// }) -// asset := assets[0] - -// if asset.Paused { -// return simulation.NoOpMsg(types.ModuleName), nil, nil -// } - -// // make sure owner account exists -// ownerSimAcc, found := simulation.FindAccount(accs, asset.Owner) -// if !found { -// return simulation.NoOpMsg(types.ModuleName), nil, fmt.Errorf("asset owner not found: %s", asset) -// } - -// // issue new tokens to the owner 50% of the time so we have funds to redeem -// ownerAcc := ak.GetAccount(ctx, asset.Owner) -// recipient := ownerAcc -// if r.Intn(2) == 0 { -// simAccount, _ := simulation.RandomAcc(r, accs) -// recipient = ak.GetAccount(ctx, simAccount.Address) -// } -// if recipient == nil { -// return simulation.NoOpMsg(types.ModuleName), nil, nil -// } -// for _, blockedAddr := range asset.BlockedAddresses { -// if recipient.GetAddress().Equals(blockedAddr) { -// return simulation.NoOpMsg(types.ModuleName), nil, nil -// } -// } -// randomAmount := simulation.RandIntBetween(r, 10000000, 1000000000000) -// if asset.RateLimit.Active { -// supply, found := k.GetAssetSupply(ctx, asset.Denom) -// if !found { -// return simulation.NoOpMsg(types.ModuleName), nil, fmt.Errorf("issuance - no asset supply for %s", asset.Denom) -// } -// if asset.RateLimit.Limit.LT(supply.CurrentSupply.Amount.Add(sdkmath.NewInt(int64(randomAmount)))) { -// maxAmount := asset.RateLimit.Limit.Sub(supply.CurrentSupply.Amount) -// if maxAmount.IsPositive() && maxAmount.GT(sdk.OneInt()) { -// randomAmount = simulation.RandIntBetween(r, 1, int(maxAmount.Int64())) -// } else if maxAmount.Equal(sdk.OneInt()) { -// randomAmount = 1 -// } else { -// return simulation.NoOpMsg(types.ModuleName), nil, nil -// } -// } - -// } -// msg := types.NewMsgIssueTokens(asset.Owner, sdk.NewCoin(asset.Denom, sdkmath.NewInt(int64(randomAmount))), recipient.GetAddress()) -// spendableCoins := ownerAcc.SpendableCoins(ctx.BlockTime()) -// fees, err := simulation.RandomFees(r, ctx, spendableCoins) -// if err != nil { -// return simulation.NoOpMsg(types.ModuleName), nil, err -// } -// tx := helpers.GenTx( -// []sdk.Msg{msg}, -// fees, -// helpers.DefaultGenTxGas, -// chainID, -// []uint64{ownerAcc.GetAccountNumber()}, -// []uint64{ownerAcc.GetSequence()}, -// ownerSimAcc.PrivKey, -// ) - -// _, _, err = app.Deliver(tx) -// if err != nil { -// fmt.Printf("error on issue %s\n%s\n", msg, asset) -// return simulation.NoOpMsg(types.ModuleName), nil, err -// } -// return simulation.NewOperationMsg(msg, true, ""), nil, nil -// } -// } - -// // SimulateMsgRedeemTokens generates a MsgRedeemTokens with random values -// func SimulateMsgRedeemTokens(ak types.AccountKeeper, k keeper.Keeper) simulation.Operation { -// return func( -// r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, -// ) (simulation.OperationMsg, []simulation.FutureOperation, error) { -// // shuffle the assets and get a random one -// assets := k.GetParams(ctx).Assets -// r.Shuffle(len(assets), func(i, j int) { -// assets[i], assets[j] = assets[j], assets[i] -// }) -// asset := assets[0] -// if asset.Paused { -// return simulation.NoOpMsg(types.ModuleName), nil, nil -// } - -// // make sure owner account exists -// ownerSimAcc, found := simulation.FindAccount(accs, asset.Owner) -// if !found { -// return simulation.NoOpMsg(types.ModuleName), nil, fmt.Errorf("asset owner not found: %s", asset) -// } - -// ownerAcc := ak.GetAccount(ctx, asset.Owner) - -// spendableCoinAmount := ownerAcc.SpendableCoins(ctx.BlockTime()).AmountOf(asset.Denom) -// if spendableCoinAmount.IsZero() { -// return simulation.NoOpMsg(types.ModuleName), nil, nil -// } -// var redeemAmount sdkmath.Int -// if spendableCoinAmount.Equal(sdk.OneInt()) { -// redeemAmount = sdk.OneInt() -// } else { -// redeemAmount = sdkmath.NewInt(int64(simulation.RandIntBetween(r, 1, int(spendableCoinAmount.Int64())))) -// } - -// msg := types.NewMsgRedeemTokens(asset.Owner, sdk.NewCoin(asset.Denom, redeemAmount)) -// spendableCoins := ownerAcc.SpendableCoins(ctx.BlockTime()).Sub(sdk.NewCoins(sdk.NewCoin(asset.Denom, redeemAmount))) -// fees, err := simulation.RandomFees(r, ctx, spendableCoins) -// if err != nil { -// fmt.Printf("%s\n", msg) -// return simulation.NoOpMsg(types.ModuleName), nil, err -// } -// tx := helpers.GenTx( -// []sdk.Msg{msg}, -// fees, -// helpers.DefaultGenTxGas, -// chainID, -// []uint64{ownerAcc.GetAccountNumber()}, -// []uint64{ownerAcc.GetSequence()}, -// ownerSimAcc.PrivKey, -// ) - -// _, _, err = app.Deliver(tx) -// if err != nil { -// fmt.Printf("error on redeem %s\n%s\n", msg, asset) -// return simulation.NoOpMsg(types.ModuleName), nil, err -// } -// return simulation.NewOperationMsg(msg, true, ""), nil, nil -// } -// } - -// // SimulateMsgBlockAddress generates a MsgBlockAddress with random values -// func SimulateMsgBlockAddress(ak types.AccountKeeper, k keeper.Keeper) simulation.Operation { -// return func( -// r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, -// ) (simulation.OperationMsg, []simulation.FutureOperation, error) { -// // shuffle the assets and get a random one -// assets := k.GetParams(ctx).Assets -// r.Shuffle(len(assets), func(i, j int) { -// assets[i], assets[j] = assets[j], assets[i] -// }) -// asset := assets[0] - -// // make sure owner account exists -// ownerSimAcc, found := simulation.FindAccount(accs, asset.Owner) -// if !found { -// return simulation.NoOpMsg(types.ModuleName), nil, fmt.Errorf("asset owner not found: %s", asset) -// } -// ownerAcc := ak.GetAccount(ctx, asset.Owner) - -// // find an account to block -// simAccount, _ := simulation.RandomAcc(r, accs) -// blockedAccount := ak.GetAccount(ctx, simAccount.Address) -// if blockedAccount.GetAddress().Equals(asset.Owner) { -// return simulation.NoOpMsg(types.ModuleName), nil, nil -// } -// for _, blockedAddr := range asset.BlockedAddresses { -// if blockedAccount.GetAddress().Equals(blockedAddr) { -// return simulation.NoOpMsg(types.ModuleName), nil, nil -// } -// } - -// msg := types.NewMsgBlockAddress(asset.Owner, asset.Denom, blockedAccount.GetAddress()) -// spendableCoins := ownerAcc.SpendableCoins(ctx.BlockTime()) -// fees, err := simulation.RandomFees(r, ctx, spendableCoins) -// if err != nil { -// return simulation.NoOpMsg(types.ModuleName), nil, err -// } -// tx := helpers.GenTx( -// []sdk.Msg{msg}, -// fees, -// helpers.DefaultGenTxGas*2, -// chainID, -// []uint64{ownerAcc.GetAccountNumber()}, -// []uint64{ownerAcc.GetSequence()}, -// ownerSimAcc.PrivKey, -// ) - -// _, _, err = app.Deliver(tx) -// if err != nil { -// fmt.Printf("error on block %s\n%s\n", msg, asset) -// return simulation.NoOpMsg(types.ModuleName), nil, err -// } -// return simulation.NewOperationMsg(msg, true, ""), nil, nil -// } -// } - -// // SimulateMsgPause generates a MsgChangePauseStatus with random values -// func SimulateMsgPause(ak types.AccountKeeper, k keeper.Keeper) simulation.Operation { -// return func( -// r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, -// ) (simulation.OperationMsg, []simulation.FutureOperation, error) { -// // shuffle the assets and get a random one -// assets := k.GetParams(ctx).Assets -// r.Shuffle(len(assets), func(i, j int) { -// assets[i], assets[j] = assets[j], assets[i] -// }) -// asset := assets[0] - -// // make sure owner account exists -// ownerSimAcc, found := simulation.FindAccount(accs, asset.Owner) -// if !found { -// return simulation.NoOpMsg(types.ModuleName), nil, fmt.Errorf("asset owner not found: %s", asset) -// } -// ownerAcc := ak.GetAccount(ctx, asset.Owner) - -// // set status to paused/un-paused -// status := r.Intn(2) == 0 - -// msg := types.NewMsgSetPauseStatus(asset.Owner, asset.Denom, status) -// spendableCoins := ownerAcc.SpendableCoins(ctx.BlockTime()) -// fees, err := simulation.RandomFees(r, ctx, spendableCoins) -// if err != nil { -// return simulation.NoOpMsg(types.ModuleName), nil, err -// } -// tx := helpers.GenTx( -// []sdk.Msg{msg}, -// fees, -// helpers.DefaultGenTxGas*2, -// chainID, -// []uint64{ownerAcc.GetAccountNumber()}, -// []uint64{ownerAcc.GetSequence()}, -// ownerSimAcc.PrivKey, -// ) - -// _, _, err = app.Deliver(tx) -// if err != nil { -// fmt.Printf("error on pause %s\n%s\n", msg, asset) -// return simulation.NoOpMsg(types.ModuleName), nil, err -// } -// return simulation.NewOperationMsg(msg, true, ""), nil, nil -// } -// } diff --git a/x/issuance/simulation/params.go b/x/issuance/simulation/params.go deleted file mode 100644 index e780494d..00000000 --- a/x/issuance/simulation/params.go +++ /dev/null @@ -1,25 +0,0 @@ -package simulation - -// import ( -// "fmt" -// "math/rand" - -// "github.com/cosmos/cosmos-sdk/x/simulation" - -// "github.com/kava-labs/kava/x/issuance/types" -// ) - -// const ( -// keyAssets = "Assets" -// ) - -// // ParamChanges defines the parameters that can be modified by param change proposals -// func ParamChanges(r *rand.Rand) []simulation.ParamChange { -// return []simulation.ParamChange{ -// simulation.NewSimParamChange(types.ModuleName, keyAssets, -// func(r *rand.Rand) string { -// return fmt.Sprintf("\"%s\"", randomizedAssets(r)) -// }, -// ), -// } -// } diff --git a/x/issuance/types/genesis.pb.go b/x/issuance/types/genesis.pb.go index a1244665..2dcb5067 100644 --- a/x/issuance/types/genesis.pb.go +++ b/x/issuance/types/genesis.pb.go @@ -7,9 +7,9 @@ import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" @@ -551,7 +551,7 @@ func (m *RateLimit) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.TimePeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.TimePeriod):]) + n3, err3 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TimePeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TimePeriod):]) if err3 != nil { return 0, err3 } @@ -602,7 +602,7 @@ func (m *AssetSupply) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n4, err4 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.TimeElapsed, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.TimeElapsed):]) + n4, err4 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TimeElapsed, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TimeElapsed):]) if err4 != nil { return 0, err4 } @@ -708,7 +708,7 @@ func (m *RateLimit) Size() (n int) { } l = m.Limit.Size() n += 1 + l + sovGenesis(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.TimePeriod) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TimePeriod) n += 1 + l + sovGenesis(uint64(l)) return n } @@ -721,7 +721,7 @@ func (m *AssetSupply) Size() (n int) { _ = l l = m.CurrentSupply.Size() n += 1 + l + sovGenesis(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.TimeElapsed) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TimeElapsed) n += 1 + l + sovGenesis(uint64(l)) return n } @@ -1263,7 +1263,7 @@ func (m *RateLimit) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.TimePeriod, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TimePeriod, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1379,7 +1379,7 @@ func (m *AssetSupply) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.TimeElapsed, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TimeElapsed, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/issuance/types/keys.go b/x/issuance/types/keys.go index 0da2b917..57d33fd6 100644 --- a/x/issuance/types/keys.go +++ b/x/issuance/types/keys.go @@ -12,9 +12,6 @@ const ( // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName - - // QuerierRoute route used for abci queries - QuerierRoute = ModuleName ) // KVStore key prefixes diff --git a/x/issuance/types/query.pb.go b/x/issuance/types/query.pb.go index fcf07520..3cefbb8b 100644 --- a/x/issuance/types/query.pb.go +++ b/x/issuance/types/query.pb.go @@ -6,9 +6,9 @@ package types import ( context "context" fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/x/issuance/types/tx.pb.go b/x/issuance/types/tx.pb.go index d5978353..e0416cc9 100644 --- a/x/issuance/types/tx.pb.go +++ b/x/issuance/types/tx.pb.go @@ -7,9 +7,9 @@ import ( context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/x/kavadist/genesis_test.go b/x/kavadist/genesis_test.go index e5c58e55..171a4fee 100644 --- a/x/kavadist/genesis_test.go +++ b/x/kavadist/genesis_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/suite" - tmtime "github.com/tendermint/tendermint/types/time" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/kavadist/keeper/querier.go b/x/kavadist/keeper/querier.go deleted file mode 100644 index d60cb252..00000000 --- a/x/kavadist/keeper/querier.go +++ /dev/null @@ -1,51 +0,0 @@ -package keeper - -import ( - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/kava-labs/kava/x/kavadist/types" -) - -// NewQuerier is the module level router for state queries -func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(ctx sdk.Context, path []string, req abci.RequestQuery) (res []byte, err error) { - switch path[0] { - case types.QueryGetParams: - return queryGetParams(ctx, req, k, legacyQuerierCdc) - case types.QueryGetBalance: - return queryGetBalance(ctx, req, k, legacyQuerierCdc) - default: - return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unknown %s query endpoint: %s", types.ModuleName, path[0]) - } - } -} - -// query params in the store -func queryGetParams(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - // Get params - params := k.GetParams(ctx) - - // Encode results - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, params) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -// queryGetBalance returns current balance of kavadist module account -func queryGetBalance(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - acc := k.accountKeeper.GetModuleAccount(ctx, types.KavaDistMacc) - balance := k.bankKeeper.GetAllBalances(ctx, acc.GetAddress()) - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, balance) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} diff --git a/x/kavadist/keeper/querier_test.go b/x/kavadist/keeper/querier_test.go deleted file mode 100644 index 5ebf0b1e..00000000 --- a/x/kavadist/keeper/querier_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package keeper_test - -// import ( -// sdk "github.com/cosmos/cosmos-sdk/types" -// abci "github.com/tendermint/tendermint/abci/types" - -// "github.com/kava-labs/kava/x/kavadist/keeper" -// "github.com/kava-labs/kava/x/kavadist/types" -// ) - -// func (suite *KeeperTestSuite) TestQuerierGetParams() { -// querier := keeper.NewQuerier(suite.keeper) -// bz, err := querier(suite.ctx, []string{types.QueryGetParams}, abci.RequestQuery{}) -// suite.Require().NoError(err) -// suite.NotNil(bz) - -// testParams := types.NewParams(true, testPeriods) -// var p types.Params -// suite.Nil(types.ModuleCdc.UnmarshalJSON(bz, &p)) -// suite.Require().Equal(testParams, p) -// } - -// func (suite *KeeperTestSuite) TestQuerierGetBalance() { -// sk := suite.supplyKeeper - -// sk.MintCoins(suite.ctx, types.KavaDistMacc, sdk.NewCoins(sdk.NewCoin("ukava", sdkmath.NewInt(100e6)))) - -// querier := keeper.NewQuerier(suite.keeper) -// bz, err := querier(suite.ctx, []string{types.QueryGetBalance}, abci.RequestQuery{}) -// suite.Require().NoError(err) -// suite.Require().NotNil(bz) - -// var coins sdk.Coins -// types.ModuleCdc.UnmarshalJSON(bz, &coins) -// suite.Require().Equal(sdkmath.NewInt(100e6), coins.AmountOf("ukava")) -// } diff --git a/x/kavadist/module.go b/x/kavadist/module.go index 7e2f913b..11d01d8b 100644 --- a/x/kavadist/module.go +++ b/x/kavadist/module.go @@ -4,30 +4,26 @@ import ( "context" "encoding/json" "fmt" - "math/rand" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/kava-labs/kava/x/kavadist/client/cli" "github.com/kava-labs/kava/x/kavadist/keeper" - "github.com/kava-labs/kava/x/kavadist/simulation" "github.com/kava-labs/kava/x/kavadist/types" ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleSimulation = AppModule{} + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} ) // ---------------------------------------------------------------------------- @@ -109,17 +105,6 @@ func (am AppModule) Name() string { return am.AppModuleBasic.Name() } -// Route returns kavadist module's message route. -func (am AppModule) Route() sdk.Route { return sdk.Route{} } - -// QuerierRoute returns kavadist module's query routing key. -func (AppModule) QuerierRoute() string { return types.QuerierRoute } - -// LegacyQuerierHandler returns kavadist module's Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return keeper.NewQuerier(am.keeper, legacyQuerierCdc) -} - // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { @@ -157,30 +142,3 @@ func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } - -//____________________________________________________________________________ - -// GenerateGenesisState creates a randomized GenState of the auction module -func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState) { - simulation.RandomizedGenState(simState) -} - -// ProposalContents doesn't return any content functions for governance proposals. -func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - -// RandomizedParams creates randomized param changes for the simulator. -func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { - return simulation.ParamChanges(r) -} - -// RegisterStoreDecoder registers a decoder for kavadist module's types -func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { - sdr[types.StoreKey] = simulation.DecodeStore -} - -// WeightedOperations does not return any content -func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { - return nil -} diff --git a/x/kavadist/simulation/decoder.go b/x/kavadist/simulation/decoder.go deleted file mode 100644 index 949869bc..00000000 --- a/x/kavadist/simulation/decoder.go +++ /dev/null @@ -1,25 +0,0 @@ -package simulation - -import ( - "bytes" - "fmt" - "time" - - "github.com/cosmos/cosmos-sdk/types/kv" - - "github.com/kava-labs/kava/x/kavadist/types" -) - -// DecodeStore unmarshals the KVPair's Value to the corresponding cdp type -func DecodeStore(kvA, kvB kv.Pair) string { - switch { - case bytes.Equal(kvA.Key[:1], types.PreviousBlockTimeKey): - var timeA, timeB time.Time - timeA.UnmarshalBinary(kvA.Value) - timeB.UnmarshalBinary(kvB.Value) - return fmt.Sprintf("%s\n%s", timeA, timeB) - - default: - panic(fmt.Sprintf("invalid %s key prefix %X", types.ModuleName, kvA.Key[:1])) - } -} diff --git a/x/kavadist/simulation/decoder_test.go b/x/kavadist/simulation/decoder_test.go deleted file mode 100644 index b459283e..00000000 --- a/x/kavadist/simulation/decoder_test.go +++ /dev/null @@ -1,52 +0,0 @@ -package simulation - -import ( - "fmt" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/kava-labs/kava/x/kavadist/types" - - "github.com/cosmos/cosmos-sdk/types/kv" -) - -func TestDecodeDistributionStore(t *testing.T) { - prevBlockTime := time.Now().UTC() - bPrevBlockTime, err := prevBlockTime.MarshalBinary() - if err != nil { - panic(err) - } - kvPairs := kv.Pairs{ - Pairs: []kv.Pair{ - { - Key: []byte(types.PreviousBlockTimeKey), - Value: bPrevBlockTime, - }, - { - Key: []byte{0x99}, - Value: []byte{0x99}, - }, - }, - } - - tests := []struct { - name string - expectedLog string - }{ - {"PreviousBlockTime", fmt.Sprintf("%s\n%s", prevBlockTime, prevBlockTime)}, - {"other", ""}, - } - for i, tt := range tests { - i, tt := i, tt - t.Run(tt.name, func(t *testing.T) { - switch i { - case len(tests) - 1: - require.Panics(t, func() { DecodeStore(kvPairs.GetPairs()[i], kvPairs.GetPairs()[i]) }, tt.name) - default: - require.Equal(t, tt.expectedLog, DecodeStore(kvPairs.GetPairs()[i], kvPairs.GetPairs()[i]), tt.name) - } - }) - } -} diff --git a/x/kavadist/simulation/genesis.go b/x/kavadist/simulation/genesis.go deleted file mode 100644 index 6ff289de..00000000 --- a/x/kavadist/simulation/genesis.go +++ /dev/null @@ -1,87 +0,0 @@ -package simulation - -import ( - "encoding/json" - "fmt" - "math/rand" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/types/simulation" - - "github.com/kava-labs/kava/x/kavadist/types" -) - -// SecondsPerYear is the number of seconds in a year -const ( - SecondsPerYear = 31536000 - // BaseAprPadding sets the minimum inflation to the calculated SPR inflation rate from being 0.0 - BaseAprPadding = "0.000000003022265980" -) - -// RandomizedGenState generates a random GenesisState for kavadist module -func RandomizedGenState(simState *module.SimulationState) { - params := genRandomParams(simState) - if err := params.Validate(); err != nil { - panic(err) - } - - kavadistGenesis := types.NewGenesisState(params, types.DefaultPreviousBlockTime) - if err := kavadistGenesis.Validate(); err != nil { - panic(err) - } - - bz, err := json.MarshalIndent(&kavadistGenesis, "", " ") - if err != nil { - panic(err) - } - fmt.Printf("Selected randomly generated %s parameters:\n%s\n", types.ModuleName, bz) - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(kavadistGenesis) -} - -func genRandomParams(simState *module.SimulationState) types.Params { - periods := genRandomPeriods(simState.Rand, simState.GenTimestamp) - params := types.NewParams(true, periods, types.DefaultInfraParams) - return params -} - -func genRandomPeriods(r *rand.Rand, timestamp time.Time) []types.Period { - var periods []types.Period - numPeriods := simulation.RandIntBetween(r, 1, 10) - periodStart := timestamp - for i := 0; i < numPeriods; i++ { - // set periods to be between 1-3 days - durationMultiplier := simulation.RandIntBetween(r, 1, 3) - duration := time.Duration(int64(24*durationMultiplier)) * time.Hour - periodEnd := periodStart.Add(duration) - inflation := genRandomInflation(r) - period := types.NewPeriod(periodStart, periodEnd, inflation) - periods = append(periods, period) - periodStart = periodEnd - } - return periods -} - -func genRandomInflation(r *rand.Rand) sdk.Dec { - // If sim.RandomDecAmount is less than base apr padding, add base apr padding - aprPadding, _ := sdk.NewDecFromStr(BaseAprPadding) - extraAprInflation := simulation.RandomDecAmount(r, sdk.MustNewDecFromStr("0.25")) - for extraAprInflation.LT(aprPadding) { - extraAprInflation = extraAprInflation.Add(aprPadding) - } - aprInflation := sdk.OneDec().Add(extraAprInflation) - - // convert APR inflation to SPR (inflation per second) - inflationSpr, err := aprInflation.ApproxRoot(uint64(SecondsPerYear)) - if err != nil { - panic(fmt.Sprintf("error generating random inflation %v", err)) - } - return inflationSpr -} - -func genRandomActive(r *rand.Rand) bool { - threshold := 50 - value := simulation.RandIntBetween(r, 1, 100) - return value > threshold -} diff --git a/x/kavadist/simulation/params.go b/x/kavadist/simulation/params.go deleted file mode 100644 index ad7fb968..00000000 --- a/x/kavadist/simulation/params.go +++ /dev/null @@ -1,35 +0,0 @@ -package simulation - -import ( - "fmt" - "math/rand" - - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - - "github.com/kava-labs/kava/x/kavadist/types" -) - -// ParamChanges defines the parameters that can be modified by param change proposals -// on the simulation -func ParamChanges(r *rand.Rand) []simtypes.ParamChange { - // Hacky way to validate periods since validation is wrapped in params - active := genRandomActive(r) - periods := genRandomPeriods(r, simtypes.RandTimestamp(r)) - if err := types.NewParams(active, periods, types.DefaultInfraParams).Validate(); err != nil { - panic(err) - } - - return []simtypes.ParamChange{ - simulation.NewSimParamChange(types.ModuleName, string(types.KeyActive), - func(r *rand.Rand) string { - return fmt.Sprintf("%t", active) - }, - ), - simulation.NewSimParamChange(types.ModuleName, string(types.KeyPeriods), - func(r *rand.Rand) string { - return fmt.Sprintf("%v", periods) - }, - ), - } -} diff --git a/x/kavadist/testutil/suite.go b/x/kavadist/testutil/suite.go index 8841fb6d..58a001da 100644 --- a/x/kavadist/testutil/suite.go +++ b/x/kavadist/testutil/suite.go @@ -9,8 +9,8 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" accountkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" diff --git a/x/kavadist/types/genesis.pb.go b/x/kavadist/types/genesis.pb.go index dab0e6fa..d89ed141 100644 --- a/x/kavadist/types/genesis.pb.go +++ b/x/kavadist/types/genesis.pb.go @@ -5,9 +5,9 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -130,7 +130,7 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.PreviousBlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.PreviousBlockTime):]) + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.PreviousBlockTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PreviousBlockTime):]) if err1 != nil { return 0, err1 } @@ -170,7 +170,7 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.PreviousBlockTime) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PreviousBlockTime) n += 1 + l + sovGenesis(uint64(l)) return n } @@ -272,7 +272,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.PreviousBlockTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.PreviousBlockTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/kavadist/types/keys.go b/x/kavadist/types/keys.go index bb246cd3..a7b91014 100644 --- a/x/kavadist/types/keys.go +++ b/x/kavadist/types/keys.go @@ -10,9 +10,6 @@ const ( // RouterKey Top level router key RouterKey = ModuleName - // QuerierRoute Top level query string - QuerierRoute = ModuleName - // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName diff --git a/x/kavadist/types/params.go b/x/kavadist/types/params.go index 3053a6dc..ad807448 100644 --- a/x/kavadist/types/params.go +++ b/x/kavadist/types/params.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmtime "github.com/cometbft/cometbft/types/time" // cdptypes "github.com/kava-labs/kava/x/cdp/types" ) diff --git a/x/kavadist/types/params.pb.go b/x/kavadist/types/params.pb.go index f20a4857..49eb8475 100644 --- a/x/kavadist/types/params.pb.go +++ b/x/kavadist/types/params.pb.go @@ -8,9 +8,9 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -549,7 +549,7 @@ func (m *Period) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x1a - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.End, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.End):]) + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.End, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.End):]) if err3 != nil { return 0, err3 } @@ -557,7 +557,7 @@ func (m *Period) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(n3)) i-- dAtA[i] = 0x12 - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Start, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Start):]) + n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Start, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Start):]) if err4 != nil { return 0, err4 } @@ -662,9 +662,9 @@ func (m *Period) Size() (n int) { } var l int _ = l - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Start) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Start) n += 1 + l + sovParams(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.End) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.End) n += 1 + l + sovParams(uint64(l)) l = m.Inflation.Size() n += 1 + l + sovParams(uint64(l)) @@ -1259,7 +1259,7 @@ func (m *Period) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Start, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Start, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1292,7 +1292,7 @@ func (m *Period) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.End, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.End, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/kavadist/types/proposal.go b/x/kavadist/types/proposal.go index ad6892ba..3fa8e06f 100644 --- a/x/kavadist/types/proposal.go +++ b/x/kavadist/types/proposal.go @@ -5,6 +5,7 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" + govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -18,7 +19,7 @@ var _ govv1beta1.Content = CommunityPoolMultiSpendProposal{} func init() { govv1beta1.RegisterProposalType(ProposalTypeCommunityPoolMultiSpend) - govv1beta1.ModuleCdc.Amino.RegisterConcrete(CommunityPoolMultiSpendProposal{}, "kava/CommunityPoolMultiSpendProposal", nil) + govcodec.ModuleCdc.Amino.RegisterConcrete(CommunityPoolMultiSpendProposal{}, "kava/CommunityPoolMultiSpendProposal", nil) } // NewCommunityPoolMultiSpendProposal creates a new community pool multi-spend proposal. diff --git a/x/kavadist/types/proposal.pb.go b/x/kavadist/types/proposal.pb.go index 39bea9f4..22f201f0 100644 --- a/x/kavadist/types/proposal.pb.go +++ b/x/kavadist/types/proposal.pb.go @@ -7,8 +7,8 @@ import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/kavadist/types/query.pb.go b/x/kavadist/types/query.pb.go index 74963761..397fc89f 100644 --- a/x/kavadist/types/query.pb.go +++ b/x/kavadist/types/query.pb.go @@ -8,9 +8,9 @@ import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/x/liquid/keeper/keeper.go b/x/liquid/keeper/keeper.go index 7ad528f8..ab167239 100644 --- a/x/liquid/keeper/keeper.go +++ b/x/liquid/keeper/keeper.go @@ -3,9 +3,9 @@ package keeper import ( "fmt" + "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/tendermint/libs/log" "github.com/kava-labs/kava/x/liquid/types" ) diff --git a/x/liquid/keeper/keeper_test.go b/x/liquid/keeper/keeper_test.go index aa2cee56..af60bf41 100644 --- a/x/liquid/keeper/keeper_test.go +++ b/x/liquid/keeper/keeper_test.go @@ -6,6 +6,9 @@ import ( "testing" sdkmath "cosmossdk.io/math" + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -14,9 +17,6 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/liquid/keeper" @@ -29,7 +29,7 @@ type KeeperTestSuite struct { Ctx sdk.Context Keeper keeper.Keeper BankKeeper bankkeeper.Keeper - StakingKeeper stakingkeeper.Keeper + StakingKeeper *stakingkeeper.Keeper } // The default state used by each test diff --git a/x/liquid/module.go b/x/liquid/module.go index b7766c7b..63639201 100644 --- a/x/liquid/module.go +++ b/x/liquid/module.go @@ -13,7 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/kava-labs/kava/x/liquid/client/cli" "github.com/kava-labs/kava/x/liquid/keeper" @@ -95,21 +95,6 @@ func (am AppModule) Name() string { // RegisterInvariants register module invariants func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} -// Route module message route name -func (am AppModule) Route() sdk.Route { - return sdk.Route{} -} - -// QuerierRoute module querier route name -func (AppModule) QuerierRoute() string { - return "" -} - -// LegacyQuerierHandler returns no sdk.Querier. -func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { - return nil -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 1 diff --git a/x/liquid/types/query.pb.go b/x/liquid/types/query.pb.go index c771f429..f771eb3b 100644 --- a/x/liquid/types/query.pb.go +++ b/x/liquid/types/query.pb.go @@ -9,9 +9,9 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/x/liquid/types/tx.pb.go b/x/liquid/types/tx.pb.go index 1e7912b5..1fde9eba 100644 --- a/x/liquid/types/tx.pb.go +++ b/x/liquid/types/tx.pb.go @@ -9,9 +9,9 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/x/metrics/abci_test.go b/x/metrics/abci_test.go index 5ab542ee..141d501b 100644 --- a/x/metrics/abci_test.go +++ b/x/metrics/abci_test.go @@ -6,8 +6,8 @@ import ( kitmetrics "github.com/go-kit/kit/metrics" "github.com/stretchr/testify/require" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/metrics" diff --git a/x/metrics/module.go b/x/metrics/module.go index 3b74fad5..2ee0d656 100644 --- a/x/metrics/module.go +++ b/x/metrics/module.go @@ -12,7 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/kava-labs/kava/x/metrics/types" ) @@ -84,20 +84,6 @@ func (am AppModule) Name() string { // RegisterInvariants register module invariants func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} -// Route module message route name -// Deprecated: unused but necessary to fulfill AppModule interface -func (am AppModule) Route() sdk.Route { return sdk.Route{} } - -// QuerierRoute module querier route name -// Deprecated: unused but necessary to fulfill AppModule interface -func (AppModule) QuerierRoute() string { return types.ModuleName } - -// LegacyQuerierHandler returns no sdk.Querier. -// Deprecated: unused but necessary to fulfill AppModule interface -func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { - return nil -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 1 } diff --git a/x/pricefeed/client/cli/tx.go b/x/pricefeed/client/cli/tx.go index 8717c4c1..0b41cde0 100644 --- a/x/pricefeed/client/cli/tx.go +++ b/x/pricefeed/client/cli/tx.go @@ -13,7 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" - tmtime "github.com/tendermint/tendermint/types/time" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/x/pricefeed/types" ) diff --git a/x/pricefeed/genesis_test.go b/x/pricefeed/genesis_test.go index 86514259..b8d0889d 100644 --- a/x/pricefeed/genesis_test.go +++ b/x/pricefeed/genesis_test.go @@ -3,8 +3,8 @@ package pricefeed_test import ( "testing" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/pricefeed/keeper/grpc_query_test.go b/x/pricefeed/keeper/grpc_query_test.go index 372a10e4..abe950dc 100644 --- a/x/pricefeed/keeper/grpc_query_test.go +++ b/x/pricefeed/keeper/grpc_query_test.go @@ -4,12 +4,12 @@ import ( "testing" "time" + tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/pricefeed/keeper" "github.com/kava-labs/kava/x/pricefeed/types" "github.com/stretchr/testify/suite" - tmprototypes "github.com/tendermint/tendermint/proto/tendermint/types" ) type grpcQueryTestSuite struct { diff --git a/x/pricefeed/keeper/keeper.go b/x/pricefeed/keeper/keeper.go index 5a7af7f1..d305df2a 100644 --- a/x/pricefeed/keeper/keeper.go +++ b/x/pricefeed/keeper/keeper.go @@ -5,7 +5,7 @@ import ( "sort" "time" - "github.com/tendermint/tendermint/libs/log" + "github.com/cometbft/cometbft/libs/log" errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/pricefeed/keeper/keeper_test.go b/x/pricefeed/keeper/keeper_test.go index 220a2f61..0acd571f 100644 --- a/x/pricefeed/keeper/keeper_test.go +++ b/x/pricefeed/keeper/keeper_test.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - tmprototypes "github.com/tendermint/tendermint/proto/tendermint/types" + tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/pricefeed/types" diff --git a/x/pricefeed/keeper/msg_server_test.go b/x/pricefeed/keeper/msg_server_test.go index d80acd4e..2ffcd8bb 100644 --- a/x/pricefeed/keeper/msg_server_test.go +++ b/x/pricefeed/keeper/msg_server_test.go @@ -4,12 +4,12 @@ import ( "testing" "time" + tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/pricefeed/keeper" "github.com/kava-labs/kava/x/pricefeed/types" "github.com/stretchr/testify/require" - tmprototypes "github.com/tendermint/tendermint/proto/tendermint/types" ) func TestKeeper_PostPrice(t *testing.T) { diff --git a/x/pricefeed/keeper/params_test.go b/x/pricefeed/keeper/params_test.go index 9bc00317..ffad3c88 100644 --- a/x/pricefeed/keeper/params_test.go +++ b/x/pricefeed/keeper/params_test.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - tmprototypes "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/pricefeed/keeper" diff --git a/x/pricefeed/keeper/querier.go b/x/pricefeed/keeper/querier.go deleted file mode 100644 index 1a75ef11..00000000 --- a/x/pricefeed/keeper/querier.go +++ /dev/null @@ -1,138 +0,0 @@ -package keeper - -import ( - abci "github.com/tendermint/tendermint/abci/types" - - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/kava-labs/kava/x/pricefeed/types" -) - -// NewQuerier is the module level router for state queries -func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(ctx sdk.Context, path []string, req abci.RequestQuery) (res []byte, err error) { - switch path[0] { - case types.QueryPrice: - return queryPrice(ctx, req, keeper, legacyQuerierCdc) - case types.QueryPrices: - return queryPrices(ctx, req, keeper, legacyQuerierCdc) - case types.QueryRawPrices: - return queryRawPrices(ctx, req, keeper, legacyQuerierCdc) - case types.QueryOracles: - return queryOracles(ctx, req, keeper, legacyQuerierCdc) - case types.QueryMarkets: - return queryMarkets(ctx, req, keeper, legacyQuerierCdc) - case types.QueryGetParams: - return queryGetParams(ctx, req, keeper, legacyQuerierCdc) - default: - return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unknown %s query endpoint", types.ModuleName) - } - } -} - -func queryPrice(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) (res []byte, sdkErr error) { - var requestParams types.QueryWithMarketIDParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, &requestParams) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - _, found := keeper.GetMarket(ctx, requestParams.MarketID) - if !found { - return nil, errorsmod.Wrap(types.ErrAssetNotFound, requestParams.MarketID) - } - currentPrice, sdkErr := keeper.GetCurrentPrice(ctx, requestParams.MarketID) - if sdkErr != nil { - return nil, sdkErr - } - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, currentPrice) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -func queryPrices(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) (res []byte, sdkErr error) { - currentPrices := keeper.GetCurrentPrices(ctx) - - // Filter out invalid markets without a price - var validCurrentPrices types.CurrentPrices - for _, cp := range currentPrices { - if cp.MarketID != "" { - validCurrentPrices = append(validCurrentPrices, types.CurrentPrice(cp)) - } - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, validCurrentPrices) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryRawPrices(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) (res []byte, sdkErr error) { - var requestParams types.QueryWithMarketIDParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, &requestParams) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - _, found := keeper.GetMarket(ctx, requestParams.MarketID) - if !found { - return nil, errorsmod.Wrap(types.ErrAssetNotFound, requestParams.MarketID) - } - - rawPrices := keeper.GetRawPrices(ctx, requestParams.MarketID) - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, rawPrices) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -func queryOracles(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) (res []byte, sdkErr error) { - var requestParams types.QueryWithMarketIDParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, &requestParams) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - oracles, err := keeper.GetOracles(ctx, requestParams.MarketID) - if err != nil { - return nil, errorsmod.Wrap(types.ErrAssetNotFound, requestParams.MarketID) - } - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, oracles) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -func queryMarkets(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) (res []byte, sdkErr error) { - markets := keeper.GetMarkets(ctx) - - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, markets) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -// query params in the pricefeed store -func queryGetParams(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - params := keeper.GetParams(ctx) - - // Encode results - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, params) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} diff --git a/x/pricefeed/keeper/querier_test.go b/x/pricefeed/keeper/querier_test.go deleted file mode 100644 index 8584e31d..00000000 --- a/x/pricefeed/keeper/querier_test.go +++ /dev/null @@ -1,147 +0,0 @@ -package keeper_test - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/kava-labs/kava/x/pricefeed/keeper" - "github.com/kava-labs/kava/x/pricefeed/types" -) - -func (suite *KeeperTestSuite) TestQuerierGetParams() { - querier := keeper.NewQuerier(suite.keeper, types.ModuleCdc.LegacyAmino) - bz, err := querier(suite.ctx, []string{types.QueryGetParams}, abci.RequestQuery{}) - suite.Require().NoError(err) - suite.NotNil(bz) - - expParams := types.Params{ - Markets: []types.Market{ - {MarketID: "btc:usd", BaseAsset: "btc", QuoteAsset: "usd", Oracles: []sdk.AccAddress{}, Active: true}, - {MarketID: "xrp:usd", BaseAsset: "xrp", QuoteAsset: "usd", Oracles: []sdk.AccAddress{}, Active: true}, - }, - } - var p types.Params - suite.Nil(types.ModuleCdc.UnmarshalJSON(bz, &p)) - suite.Require().NoError(expParams.VerboseEqual(p)) -} - -func (suite *KeeperTestSuite) TestQuerierGetPrice() { - // Invalid market - requestParams := types.NewQueryWithMarketIDParams("invalid") - data, err := types.ModuleCdc.LegacyAmino.MarshalJSON(requestParams) - suite.Require().NoError(err) - - querier := keeper.NewQuerier(suite.keeper, types.ModuleCdc.LegacyAmino) - bz, err := querier(suite.ctx, []string{types.QueryPrice}, abci.RequestQuery{Data: data}) - suite.Require().Error(err) - suite.Nil(bz) - - // Valid market - requestParams = types.NewQueryWithMarketIDParams("btc:usd") - data, err = types.ModuleCdc.LegacyAmino.MarshalJSON(requestParams) - suite.Require().NoError(err) - - bz, err = querier(suite.ctx, []string{types.QueryPrice}, abci.RequestQuery{Data: data}) - suite.Require().NoError(err) - suite.NotNil(bz) - - expPrice := types.CurrentPrice{ - MarketID: "btc:usd", - Price: sdk.MustNewDecFromStr("8000.00"), - } - var p types.CurrentPrice - suite.Nil(types.ModuleCdc.UnmarshalJSON(bz, &p)) - suite.Require().NoError(expPrice.VerboseEqual(p)) -} - -func (suite *KeeperTestSuite) TestQuerierGetPrices() { - querier := keeper.NewQuerier(suite.keeper, types.ModuleCdc.LegacyAmino) - bz, err := querier(suite.ctx, []string{types.QueryPrices}, abci.RequestQuery{}) - suite.Require().NoError(err) - suite.NotNil(bz) - - expPrices := []types.CurrentPrice{ - { - MarketID: "btc:usd", - Price: sdk.MustNewDecFromStr("8000.00"), - }, - { - MarketID: "xrp:usd", - Price: sdk.MustNewDecFromStr("0.25"), - }, - } - var p []types.CurrentPrice - suite.Nil(types.ModuleCdc.LegacyAmino.UnmarshalJSON(bz, &p)) - suite.Require().Len(p, 2, "should have 2 prices") - - suite.Equal(expPrices[0], p[0]) - suite.Equal(expPrices[1], p[1]) -} - -func (suite *KeeperTestSuite) TestQuerierGetRawPrices() { - requestParams := types.NewQueryWithMarketIDParams("btc:usd") - data, err := types.ModuleCdc.LegacyAmino.MarshalJSON(requestParams) - suite.Require().NoError(err) - - querier := keeper.NewQuerier(suite.keeper, types.ModuleCdc.LegacyAmino) - bz, err := querier(suite.ctx, []string{types.QueryRawPrices}, abci.RequestQuery{Data: data}) - suite.Require().NoError(err) - suite.NotNil(bz) - - expPrices := []types.PostedPrice{ - { - MarketID: "btc:usd", - Price: sdk.MustNewDecFromStr("8000.00"), - }, - { - MarketID: "xrp:usd", - Price: sdk.MustNewDecFromStr("0.25"), - }, - } - var p []types.PostedPrice - suite.Nil(types.ModuleCdc.LegacyAmino.UnmarshalJSON(bz, &p)) - suite.Require().Len(p, 1, "should have 1 raw price for btc:usd") - - // Expire time different so only compare prices - suite.True(expPrices[0].Price.Equal(p[0].Price), "first posted price should be equal") -} - -func (suite *KeeperTestSuite) TestQuerierGetOracles() { - requestParams := types.NewQueryWithMarketIDParams("btc:usd") - data, err := types.ModuleCdc.LegacyAmino.MarshalJSON(requestParams) - suite.Require().NoError(err) - - querier := keeper.NewQuerier(suite.keeper, types.ModuleCdc.LegacyAmino) - bz, err := querier(suite.ctx, []string{types.QueryOracles}, abci.RequestQuery{Data: data}) - suite.Require().NoError(err) - suite.NotNil(bz) - - var p []string - suite.Nil(types.ModuleCdc.LegacyAmino.UnmarshalJSON(bz, &p)) - suite.Require().Empty(p, "there should be no oracles") -} - -func (suite *KeeperTestSuite) TestQuerierGetMarkets() { - querier := keeper.NewQuerier(suite.keeper, types.ModuleCdc.LegacyAmino) - bz, err := querier(suite.ctx, []string{types.QueryMarkets}, abci.RequestQuery{}) - suite.Require().NoError(err) - suite.NotNil(bz) - - expMarkets := []types.Market{ - types.NewMarket("btc:usd", "btc", "usd", []sdk.AccAddress(nil), true), - types.NewMarket("xrp:usd", "xrp", "usd", []sdk.AccAddress(nil), true), - } - - var p []types.Market - suite.Nil(types.ModuleCdc.LegacyAmino.UnmarshalJSON(bz, &p)) - suite.Require().Len(p, 2) - - suite.Equal(expMarkets[0], p[0]) -} - -func (suite *KeeperTestSuite) TestQuerierInvalid() { - querier := keeper.NewQuerier(suite.keeper, types.ModuleCdc.LegacyAmino) - bz, err := querier(suite.ctx, []string{"invalidpath"}, abci.RequestQuery{}) - suite.Require().Error(err) - suite.Nil(bz) -} diff --git a/x/pricefeed/module.go b/x/pricefeed/module.go index d12d4f64..11ceb784 100644 --- a/x/pricefeed/module.go +++ b/x/pricefeed/module.go @@ -14,7 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" sdkkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/kava-labs/kava/x/pricefeed/client/cli" "github.com/kava-labs/kava/x/pricefeed/keeper" @@ -24,7 +24,6 @@ import ( var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - // _ module.AppModuleSimulation = AppModule{} // TODO simulation ) // AppModuleBasic app module basics object @@ -105,21 +104,6 @@ func (am AppModule) Name() string { // RegisterInvariants register module invariants func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {} -// Route module message route name -func (am AppModule) Route() sdk.Route { - return sdk.Route{} -} - -// QuerierRoute module querier route name -func (AppModule) QuerierRoute() string { - return types.QuerierRoute -} - -// LegacyQuerierHandler returns no sdk.Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return keeper.NewQuerier(am.keeper, legacyQuerierCdc) -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 1 @@ -158,32 +142,3 @@ func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Val return []abci.ValidatorUpdate{} } - -//____________________________________________________________________________ - -// AppModuleSimulation functions - -// GenerateGenesisState creates a randomized GenState of the price feed module -// func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState) { -// simulation.RandomizedGenState(simState) -// } - -// // ProposalContents doesn't return any content functions for governance proposals. -// func (AppModuleBasic) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent { -// return nil -// } - -// // RandomizedParams returns nil because price feed has no params. -// func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange { -// return simulation.ParamChanges(r) -// } - -// // RegisterStoreDecoder registers a decoder for price feed module's types -// func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { -// sdr[StoreKey] = simulation.DecodeStore -// } - -// // WeightedOperations returns the all the price feed module operations with their respective weights. -// func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation { -// return simulation.WeightedOperations(simState.AppParams, simState.Cdc, am.accountKeeper, am.keeper) -// } diff --git a/x/pricefeed/simulation/decoder.go b/x/pricefeed/simulation/decoder.go deleted file mode 100644 index d9a7d684..00000000 --- a/x/pricefeed/simulation/decoder.go +++ /dev/null @@ -1,32 +0,0 @@ -package simulation - -// import ( -// "bytes" -// "fmt" - -// "github.com/cosmos/cosmos-sdk/codec" - -// "github.com/tendermint/tendermint/libs/kv" - -// "github.com/kava-labs/kava/x/pricefeed/types" -// ) - -// // DecodeStore unmarshals the KVPair's Value to the corresponding pricefeed type -// func DecodeStore(cdc *codec.Codec, kvA, kvB kv.Pair) string { -// switch { -// case bytes.Contains(kvA.Key, []byte(types.CurrentPricePrefix)): -// var priceA, priceB types.CurrentPrice -// cdc.MustUnmarshalBinaryBare(kvA.Value, &priceA) -// cdc.MustUnmarshalBinaryBare(kvB.Value, &priceB) -// return fmt.Sprintf("%s\n%s", priceA, priceB) - -// case bytes.Contains(kvA.Key, []byte(types.RawPriceFeedPrefix)): -// var postedPriceA, postedPriceB []types.PostedPrice -// cdc.MustUnmarshalBinaryBare(kvA.Value, &postedPriceA) -// cdc.MustUnmarshalBinaryBare(kvB.Value, &postedPriceB) -// return fmt.Sprintf("%s\n%s", postedPriceA, postedPriceB) - -// default: -// panic(fmt.Sprintf("invalid %s key prefix %X", types.ModuleName, kvA.Key[:1])) -// } -// } diff --git a/x/pricefeed/simulation/decoder_test.go b/x/pricefeed/simulation/decoder_test.go deleted file mode 100644 index cd279f74..00000000 --- a/x/pricefeed/simulation/decoder_test.go +++ /dev/null @@ -1,57 +0,0 @@ -package simulation - -// import ( -// "fmt" -// "testing" -// "time" - -// "github.com/stretchr/testify/require" - -// "github.com/tendermint/tendermint/libs/kv" - -// "github.com/cosmos/cosmos-sdk/codec" -// sdk "github.com/cosmos/cosmos-sdk/types" - -// "github.com/kava-labs/kava/x/pricefeed/types" -// ) - -// func makeTestCodec() (cdc *codec.Codec) { -// cdc = codec.New() -// sdk.RegisterCodec(cdc) -// codec.RegisterCrypto(cdc) -// types.RegisterCodec(cdc) -// return -// } - -// func TestDecodeDistributionStore(t *testing.T) { -// cdc := makeTestCodec() - -// currentPrice := types.CurrentPrice{MarketID: "current", Price: sdk.OneDec()} -// postedPrice := []types.PostedPrice{{MarketID: "posted", Price: sdk.OneDec(), Expiry: time.Now().UTC()}} - -// kvPairs := kv.Pairs{ -// kv.Pair{Key: []byte(types.CurrentPricePrefix), Value: cdc.MustMarshalBinaryBare(currentPrice)}, -// kv.Pair{Key: []byte(types.RawPriceFeedPrefix), Value: cdc.MustMarshalBinaryBare(postedPrice)}, -// kv.Pair{Key: []byte{0x99}, Value: []byte{0x99}}, -// } - -// tests := []struct { -// name string -// expectedLog string -// }{ -// {"CurrentPrice", fmt.Sprintf("%v\n%v", currentPrice, currentPrice)}, -// {"PostedPrice", fmt.Sprintf("%s\n%s", postedPrice, postedPrice)}, -// {"other", ""}, -// } -// for i, tt := range tests { -// i, tt := i, tt -// t.Run(tt.name, func(t *testing.T) { -// switch i { -// case len(tests) - 1: -// require.Panics(t, func() { DecodeStore(cdc, kvPairs[i], kvPairs[i]) }, tt.name) -// default: -// require.Equal(t, tt.expectedLog, DecodeStore(cdc, kvPairs[i], kvPairs[i]), tt.name) -// } -// }) -// } -// } diff --git a/x/pricefeed/simulation/genesis.go b/x/pricefeed/simulation/genesis.go deleted file mode 100644 index dda2375f..00000000 --- a/x/pricefeed/simulation/genesis.go +++ /dev/null @@ -1,73 +0,0 @@ -package simulation - -// import ( -// "fmt" -// "time" - -// "github.com/cosmos/cosmos-sdk/codec" -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/cosmos/cosmos-sdk/types/module" -// "github.com/cosmos/cosmos-sdk/x/simulation" - -// "github.com/kava-labs/kava/x/pricefeed/types" -// pricefeed "github.com/kava-labs/kava/x/pricefeed/types" -// ) - -// var ( -// // BaseAssets is a list of collateral asset denoms -// BaseAssets = [3]string{"bnb", "xrp", "btc"} -// QuoteAsset = "usd" -// ) - -// // RandomizedGenState generates a random GenesisState for pricefeed -// func RandomizedGenState(simState *module.SimulationState) { -// pricefeedGenesis := loadPricefeedGenState(simState) -// fmt.Printf("Selected randomly generated %s parameters:\n%s\n", types.ModuleName, codec.MustMarshalJSONIndent(simState.Cdc, pricefeedGenesis)) -// simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(pricefeedGenesis) -// } - -// // loadPricefeedGenState loads a valid pricefeed gen state -// func loadPricefeedGenState(simState *module.SimulationState) pricefeed.GenesisState { -// var markets []pricefeed.Market -// var postedPrices []pricefeed.PostedPrice -// for _, denom := range BaseAssets { -// // Select an account to be the oracle -// oracle, _ := simulation.RandomAcc(simState.Rand, simState.Accounts) - -// marketID := fmt.Sprintf("%s:%s", denom, QuoteAsset) -// // Construct market for asset -// market := pricefeed.Market{ -// MarketID: marketID, -// BaseAsset: denom, -// QuoteAsset: QuoteAsset, -// Oracles: []sdk.AccAddress{oracle.Address}, -// Active: true, -// } - -// // Construct posted price for asset -// postedPrice := pricefeed.PostedPrice{ -// MarketID: market.MarketId, -// OracleAddress: oracle.Address, -// Price: getInitialPrice(marketID), -// Expiry: simState.GenTimestamp.Add(time.Hour * 24), -// } -// markets = append(markets, market) -// postedPrices = append(postedPrices, postedPrice) -// } -// params := pricefeed.NewParams(markets) -// return pricefeed.NewGenesisState(params, postedPrices) -// } - -// // getInitialPrice gets the starting price for each of the base assets -// func getInitialPrice(marketID string) (price sdk.Dec) { -// switch marketID { -// case "btc:usd": -// return sdk.MustNewDecFromStr("7000") -// case "bnb:usd": -// return sdk.MustNewDecFromStr("14") -// case "xrp:usd": -// return sdk.MustNewDecFromStr("0.2") -// default: -// return sdk.MustNewDecFromStr("20") // Catch future additional assets -// } -// } diff --git a/x/pricefeed/simulation/operations.go b/x/pricefeed/simulation/operations.go deleted file mode 100644 index ac760f8a..00000000 --- a/x/pricefeed/simulation/operations.go +++ /dev/null @@ -1,140 +0,0 @@ -package simulation - -// import ( -// "fmt" -// "math/rand" -// "time" - -// "github.com/cosmos/cosmos-sdk/baseapp" -// "github.com/cosmos/cosmos-sdk/codec" -// "github.com/cosmos/cosmos-sdk/simapp/helpers" -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/cosmos/cosmos-sdk/x/auth" -// "github.com/cosmos/cosmos-sdk/x/simulation" - -// appparams "github.com/kava-labs/kava/app/params" -// "github.com/kava-labs/kava/x/pricefeed/keeper" -// "github.com/kava-labs/kava/x/pricefeed/types" -// ) - -// // Simulation operation weights constants -// const ( -// OpWeightMsgUpdatePrices = "op_weight_msg_update_prices" - -// // Block time params are un-exported constants in cosmos-sdk/x/simulation. -// // Copy them here in lieu of importing them. -// minTimePerBlock time.Duration = (10000 / 2) * time.Second -// maxTimePerBlock time.Duration = 10000 * time.Second - -// // Calculate the average block time -// AverageBlockTime time.Duration = (maxTimePerBlock - minTimePerBlock) / 2 -// ) - -// // WeightedOperations returns all the operations from the module with their respective weights -// func WeightedOperations( -// appParams simulation.AppParams, cdc *codec.Codec, ak auth.AccountKeeper, k keeper.Keeper, -// ) simulation.WeightedOperations { -// var weightMsgUpdatePrices int -// // var numBlocks int - -// appParams.GetOrGenerate(cdc, OpWeightMsgUpdatePrices, &weightMsgUpdatePrices, nil, -// func(_ *rand.Rand) { -// weightMsgUpdatePrices = appparams.DefaultWeightMsgUpdatePrices -// }, -// ) - -// return simulation.WeightedOperations{ -// simulation.NewWeightedOperation( -// weightMsgUpdatePrices, -// SimulateMsgUpdatePrices(ak, k, 10000), -// ), -// } -// } - -// // SimulateMsgUpdatePrices updates the prices of various assets by randomly varying them based on current price -// func SimulateMsgUpdatePrices(ak auth.AccountKeeper, keeper keeper.Keeper, blocks int) simulation.Operation { -// // runs one at the start of each simulation -// startingPrices := map[string]sdk.Dec{ -// "btc:usd": sdk.MustNewDecFromStr("7000"), -// "bnb:usd": sdk.MustNewDecFromStr("15"), -// "xrp:usd": sdk.MustNewDecFromStr("0.25"), -// } - -// // creates the new price generator from starting prices - resets for each sim -// priceGenerator := NewPriceGenerator(startingPrices) - -// return func( -// r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, -// ) (simulation.OperationMsg, []simulation.FutureOperation, error) { -// // walk prices to current block height, noop if already called for current height -// priceGenerator.Step(r, ctx.BlockHeight()) - -// randomMarket := pickRandomAsset(ctx, keeper, r) -// marketID := randommarket.MarketId -// address := getRandomOracle(r, randomMarket) - -// oracle, found := simulation.FindAccount(accs, address) -// if !found { -// return simulation.NoOpMsg(types.ModuleName), nil, nil -// } - -// oracleAcc := ak.GetAccount(ctx, oracle.Address) -// if oracleAcc == nil { -// return simulation.NoOpMsg(types.ModuleName), nil, nil -// } - -// // get price for marketID and current block height set in Step -// price := priceGenerator.GetCurrentPrice(marketID) - -// // get the expiry time based off the current time -// expiry := getExpiryTime(ctx) - -// // now create the msg to post price -// msg := types.NewMsgPostPrice(oracle.Address, marketID, price, expiry) - -// spendable := oracleAcc.SpendableCoins(ctx.BlockTime()) -// fees, err := simulation.RandomFees(r, ctx, spendable) -// if err != nil { -// return simulation.NoOpMsg(types.ModuleName), nil, err -// } - -// tx := helpers.GenTx( -// []sdk.Msg{msg}, -// fees, -// helpers.DefaultGenTxGas, -// chainID, -// []uint64{oracleAcc.GetAccountNumber()}, -// []uint64{oracleAcc.GetSequence()}, -// oracle.PrivKey, -// ) - -// _, result, err := app.Deliver(tx) -// if err != nil { -// // to aid debugging, add the stack trace to the comment field of the returned opMsg -// return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err -// } -// return simulation.NewOperationMsg(msg, true, result.Log), nil, nil -// } -// } - -// // getRandomOracle picks a random oracle from the list of oracles -// func getRandomOracle(r *rand.Rand, market types.Market) sdk.AccAddress { -// randomIndex := simulation.RandIntBetween(r, 0, len(market.Oracles)) -// return market.Oracles[randomIndex] -// } - -// // pickRandomAsset picks a random asset out of the assets with equal probability -// // it returns the Market which includes the base asset as one of its fields -// func pickRandomAsset(ctx sdk.Context, keeper keeper.Keeper, r *rand.Rand) (market types.Market) { -// // get the params -// params := keeper.GetParams(ctx) -// // now pick a random asset -// randomIndex := simulation.RandIntBetween(r, 0, len(params.Markets)) -// return params.Markets[randomIndex] -// } - -// // getExpiryTime gets a price expiry time by taking the current time and adding a delta to it -// func getExpiryTime(ctx sdk.Context) (t time.Time) { -// // need to use the blocktime from the context as the context generates random start time when running simulations -// return ctx.BlockTime().Add(AverageBlockTime * 5000) // if blocks were 6 seconds, the expiry would be 8 hrs -// } diff --git a/x/pricefeed/simulation/params.go b/x/pricefeed/simulation/params.go deleted file mode 100644 index 36ff612a..00000000 --- a/x/pricefeed/simulation/params.go +++ /dev/null @@ -1,13 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/x/simulation" -) - -// ParamChanges defines the parameters that can be modified by param change proposals -// on the simulation -func ParamChanges(r *rand.Rand) []simulation.ParamChange { - return []simulation.ParamChange{} -} diff --git a/x/pricefeed/simulation/types.go b/x/pricefeed/simulation/types.go deleted file mode 100644 index bc61f63e..00000000 --- a/x/pricefeed/simulation/types.go +++ /dev/null @@ -1,98 +0,0 @@ -package simulation - -import ( - "math/rand" - "sort" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// PriceGenerator allows deterministic price generation in simulations -type PriceGenerator struct { - markets []string - currentPrice map[string]sdk.Dec - maxPrice map[string]sdk.Dec - minPrice map[string]sdk.Dec - increment map[string]sdk.Dec - currentBlockHeight int64 -} - -// NewPriceGenerator returns a new market price generator from starting values -func NewPriceGenerator(startingPrice map[string]sdk.Dec) *PriceGenerator { - p := &PriceGenerator{ - markets: []string{}, - currentPrice: startingPrice, - maxPrice: map[string]sdk.Dec{}, - minPrice: map[string]sdk.Dec{}, - increment: map[string]sdk.Dec{}, - currentBlockHeight: 0, - } - - divisor := sdk.MustNewDecFromStr("20") - - for marketID, startPrice := range startingPrice { - p.markets = append(p.markets, marketID) - // allow 10x price increase - p.maxPrice[marketID] = sdk.MustNewDecFromStr("10.0").Mul(startPrice) - // allow 100x price decrease - p.minPrice[marketID] = sdk.MustNewDecFromStr("0.01").Mul(startPrice) - // set increment - should we use a random increment? - p.increment[marketID] = startPrice.Quo(divisor) - } - - // market prices must be calculated in a deterministic order - // this sort order defines the the order we update each market - // price in the step function - sort.Strings(p.markets) - - return p -} - -// Step walks prices to a current block height from the previously called height -// noop if called more than once for the same height -func (p *PriceGenerator) Step(r *rand.Rand, blockHeight int64) { - if p.currentBlockHeight == blockHeight { - // step already called for blockHeight - return - } - - if p.currentBlockHeight > blockHeight { - // step is called with a previous blockHeight - panic("step out of order") - } - - for _, marketID := range p.markets { - lastPrice := p.currentPrice[marketID] - minPrice := p.minPrice[marketID] - maxPrice := p.maxPrice[marketID] - increment := p.increment[marketID] - lastHeight := p.currentBlockHeight - - for lastHeight < blockHeight { - upDown := r.Intn(2) - - if upDown == 0 { - lastPrice = sdk.MinDec(lastPrice.Add(increment), maxPrice) - } else { - lastPrice = sdk.MaxDec(lastPrice.Sub(increment), minPrice) - } - - lastHeight++ - } - - p.currentPrice[marketID] = lastPrice - } - - p.currentBlockHeight = blockHeight -} - -// GetCurrentPrice returns price for last blockHeight set by Step -func (p *PriceGenerator) GetCurrentPrice(marketID string) sdk.Dec { - price, ok := p.currentPrice[marketID] - - if !ok { - panic("unknown market") - } - - return price -} diff --git a/x/pricefeed/types/genesis.pb.go b/x/pricefeed/types/genesis.pb.go index 93aeba5c..23e11c0c 100644 --- a/x/pricefeed/types/genesis.pb.go +++ b/x/pricefeed/types/genesis.pb.go @@ -5,8 +5,8 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/pricefeed/types/genesis_test.go b/x/pricefeed/types/genesis_test.go index e9c9e632..acdc45b3 100644 --- a/x/pricefeed/types/genesis_test.go +++ b/x/pricefeed/types/genesis_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - tmtypes "github.com/tendermint/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/pricefeed/types/key.go b/x/pricefeed/types/key.go index c8062ed5..13168977 100644 --- a/x/pricefeed/types/key.go +++ b/x/pricefeed/types/key.go @@ -12,9 +12,6 @@ const ( // RouterKey Top level router key RouterKey = ModuleName - // QuerierRoute is the querier route for gov - QuerierRoute = ModuleName - // DefaultParamspace default namestore DefaultParamspace = ModuleName ) diff --git a/x/pricefeed/types/market_test.go b/x/pricefeed/types/market_test.go index 7a329190..1dbcae87 100644 --- a/x/pricefeed/types/market_test.go +++ b/x/pricefeed/types/market_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - tmtypes "github.com/tendermint/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/pricefeed/types/msgs_test.go b/x/pricefeed/types/msgs_test.go index a530b4d8..9bbb84c7 100644 --- a/x/pricefeed/types/msgs_test.go +++ b/x/pricefeed/types/msgs_test.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - tmtime "github.com/tendermint/tendermint/types/time" + tmtime "github.com/cometbft/cometbft/types/time" ) func TestMsgPlaceBid_ValidateBasic(t *testing.T) { diff --git a/x/pricefeed/types/query.pb.go b/x/pricefeed/types/query.pb.go index ffeff348..a4111a2d 100644 --- a/x/pricefeed/types/query.pb.go +++ b/x/pricefeed/types/query.pb.go @@ -7,10 +7,10 @@ import ( context "context" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -2311,7 +2311,7 @@ func (m *PostedPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Expiry, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Expiry):]) + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Expiry, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Expiry):]) if err3 != nil { return 0, err3 } @@ -2624,7 +2624,7 @@ func (m *PostedPriceResponse) Size() (n int) { } l = m.Price.Size() n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Expiry) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Expiry) n += 1 + l + sovQuery(uint64(l)) return n } @@ -3732,7 +3732,7 @@ func (m *PostedPriceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Expiry, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Expiry, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/pricefeed/types/store.pb.go b/x/pricefeed/types/store.pb.go index 654c7e04..6b8f2ae2 100644 --- a/x/pricefeed/types/store.pb.go +++ b/x/pricefeed/types/store.pb.go @@ -8,9 +8,9 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -712,7 +712,7 @@ func (m *PostedPrice) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Expiry, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Expiry):]) + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Expiry, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Expiry):]) if err1 != nil { return 0, err1 } @@ -859,7 +859,7 @@ func (m *PostedPrice) Size() (n int) { } l = m.Price.Size() n += 1 + l + sovStore(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Expiry) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Expiry) n += 1 + l + sovStore(uint64(l)) return n } @@ -1325,7 +1325,7 @@ func (m *PostedPrice) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Expiry, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Expiry, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/pricefeed/types/tx.pb.go b/x/pricefeed/types/tx.pb.go index 1b0758fb..358f29a7 100644 --- a/x/pricefeed/types/tx.pb.go +++ b/x/pricefeed/types/tx.pb.go @@ -7,10 +7,10 @@ import ( context "context" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -370,7 +370,7 @@ func (m *MsgPostPrice) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Expiry, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Expiry):]) + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Expiry, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Expiry):]) if err1 != nil { return 0, err1 } @@ -455,7 +455,7 @@ func (m *MsgPostPrice) Size() (n int) { } l = m.Price.Size() n += 1 + l + sovTx(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Expiry) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Expiry) n += 1 + l + sovTx(uint64(l)) return n } @@ -631,7 +631,7 @@ func (m *MsgPostPrice) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Expiry, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Expiry, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/router/keeper/msg_server_test.go b/x/router/keeper/msg_server_test.go index 4fed27a9..a53b6852 100644 --- a/x/router/keeper/msg_server_test.go +++ b/x/router/keeper/msg_server_test.go @@ -234,7 +234,7 @@ func (suite *msgServerTestSuite) TestDelegateMintDepositAndWithdrawBurnUndelegat suite.Require().NoError(err) // All spendable balance should be withdrawn - suite.AccountSpendableBalanceEqual(user, nil) + suite.AccountSpendableBalanceEqual(user, sdk.NewCoins()) // Since shares are newly created, the exact amount should be converted to derivatives, leaving none behind suite.DelegationSharesEqual(valAddr, user, sdk.ZeroDec()) // All derivative coins should be deposited to earn diff --git a/x/router/module.go b/x/router/module.go index eebd4ed5..41be3f30 100644 --- a/x/router/module.go +++ b/x/router/module.go @@ -3,6 +3,7 @@ package router import ( "encoding/json" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -10,7 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" "github.com/kava-labs/kava/x/router/client/cli" "github.com/kava-labs/kava/x/router/keeper" @@ -89,21 +89,6 @@ func (am AppModule) Name() string { // RegisterInvariants register module invariants func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} -// Route module message route name -func (am AppModule) Route() sdk.Route { - return sdk.Route{} -} - -// QuerierRoute module querier route name -func (AppModule) QuerierRoute() string { - return "" -} - -// LegacyQuerierHandler returns no sdk.Querier. -func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { - return nil -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 1 diff --git a/x/router/testutil/suite.go b/x/router/testutil/suite.go index 86917e6b..8bbbfdd1 100644 --- a/x/router/testutil/suite.go +++ b/x/router/testutil/suite.go @@ -5,6 +5,9 @@ import ( "reflect" sdkmath "cosmossdk.io/math" + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -14,9 +17,6 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" earnkeeper "github.com/kava-labs/kava/x/earn/keeper" @@ -32,7 +32,7 @@ type Suite struct { Ctx sdk.Context Keeper keeper.Keeper BankKeeper bankkeeper.Keeper - StakingKeeper stakingkeeper.Keeper + StakingKeeper *stakingkeeper.Keeper EarnKeeper earnkeeper.Keeper } @@ -104,7 +104,11 @@ func (suite *Suite) AccountBalanceOfEqual(addr sdk.AccAddress, denom string, amo // AccountSpendableBalanceEqual checks if an account has the specified coins unlocked. func (suite *Suite) AccountSpendableBalanceEqual(addr sdk.AccAddress, amount sdk.Coins) { balance := suite.BankKeeper.SpendableCoins(suite.Ctx, addr) - suite.Equalf(amount, balance, "expected account spendable balance to equal coins %s, but got %s", amount, balance) + expectedAmt := amount + if expectedAmt == nil { + expectedAmt = sdk.NewCoins() + } + suite.Equalf(expectedAmt, balance, "expected account spendable balance to equal coins %s, but got %s", amount, balance) } func (suite *Suite) QueryBank_SpendableBalance(user sdk.AccAddress) sdk.Coins { diff --git a/x/router/types/tx.pb.go b/x/router/types/tx.pb.go index d909b306..5f0dc219 100644 --- a/x/router/types/tx.pb.go +++ b/x/router/types/tx.pb.go @@ -8,9 +8,9 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/x/savings/genesis_test.go b/x/savings/genesis_test.go index 2ab78d6b..d2becb56 100644 --- a/x/savings/genesis_test.go +++ b/x/savings/genesis_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/suite" sdkmath "cosmossdk.io/math" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/savings" diff --git a/x/savings/keeper/deposit_test.go b/x/savings/keeper/deposit_test.go index 3d23fb7a..c6e4e2ca 100644 --- a/x/savings/keeper/deposit_test.go +++ b/x/savings/keeper/deposit_test.go @@ -5,12 +5,12 @@ import ( "strings" sdkmath "cosmossdk.io/math" + "github.com/cometbft/cometbft/crypto" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/tendermint/tendermint/crypto" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/savings/types" diff --git a/x/savings/keeper/grpcquery_test.go b/x/savings/keeper/grpcquery_test.go index 41261bde..87081302 100644 --- a/x/savings/keeper/grpcquery_test.go +++ b/x/savings/keeper/grpcquery_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/suite" sdkmath "cosmossdk.io/math" + tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" - tmprototypes "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" diff --git a/x/savings/keeper/invariants_test.go b/x/savings/keeper/invariants_test.go index 10849630..866a5aed 100644 --- a/x/savings/keeper/invariants_test.go +++ b/x/savings/keeper/invariants_test.go @@ -3,9 +3,9 @@ package keeper_test import ( "testing" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/savings/keeper/keeper.go b/x/savings/keeper/keeper.go index 63a70a25..76ca0caa 100644 --- a/x/savings/keeper/keeper.go +++ b/x/savings/keeper/keeper.go @@ -3,12 +3,12 @@ package keeper import ( "fmt" + "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/tendermint/tendermint/libs/log" "github.com/kava-labs/kava/x/savings/types" ) diff --git a/x/savings/keeper/keeper_test.go b/x/savings/keeper/keeper_test.go index b8067c30..5b862fa5 100644 --- a/x/savings/keeper/keeper_test.go +++ b/x/savings/keeper/keeper_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/savings/keeper/withdraw_test.go b/x/savings/keeper/withdraw_test.go index 9d427ba0..b4f61f98 100644 --- a/x/savings/keeper/withdraw_test.go +++ b/x/savings/keeper/withdraw_test.go @@ -5,12 +5,12 @@ import ( "strings" sdkmath "cosmossdk.io/math" + "github.com/cometbft/cometbft/crypto" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/tendermint/tendermint/crypto" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" "github.com/kava-labs/kava/app" "github.com/kava-labs/kava/x/savings/types" diff --git a/x/savings/module.go b/x/savings/module.go index 87dfeb8c..f7649ec3 100644 --- a/x/savings/module.go +++ b/x/savings/module.go @@ -14,7 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/kava-labs/kava/x/savings/client/cli" "github.com/kava-labs/kava/x/savings/keeper" @@ -24,7 +24,6 @@ import ( var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - // _ module.AppModuleSimulation = AppModule{} // TODO simulation ) // AppModuleBasic app module basics object @@ -109,21 +108,6 @@ func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { keeper.RegisterInvariants(ir, am.keeper) } -// Route module message route name -func (am AppModule) Route() sdk.Route { - return sdk.Route{} -} - -// QuerierRoute module querier route name -func (AppModule) QuerierRoute() string { - return types.QuerierRoute -} - -// LegacyQuerierHandler returns no sdk.Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return nil -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 1 @@ -160,32 +144,3 @@ func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } - -//____________________________________________________________________________ - -// AppModuleSimulation functions - -// GenerateGenesisState creates a randomized GenState of the price feed module -// func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState) { -// simulation.RandomizedGenState(simState) -// } - -// // ProposalContents doesn't return any content functions for governance proposals. -// func (AppModuleBasic) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent { -// return nil -// } - -// // RandomizedParams returns nil because price feed has no params. -// func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange { -// return simulation.ParamChanges(r) -// } - -// // RegisterStoreDecoder registers a decoder for price feed module's types -// func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { -// sdr[StoreKey] = simulation.DecodeStore -// } - -// // WeightedOperations returns the all the price feed module operations with their respective weights. -// func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation { -// return simulation.WeightedOperations(simState.AppParams, simState.Cdc, am.accountKeeper, am.keeper) -// } diff --git a/x/savings/types/genesis.pb.go b/x/savings/types/genesis.pb.go index 31423a1f..5c2f1f55 100644 --- a/x/savings/types/genesis.pb.go +++ b/x/savings/types/genesis.pb.go @@ -5,8 +5,8 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/savings/types/key.go b/x/savings/types/key.go index 6d0f484d..6bf64608 100644 --- a/x/savings/types/key.go +++ b/x/savings/types/key.go @@ -10,9 +10,6 @@ const ( // RouterKey Top level router key RouterKey = ModuleName - // QuerierRoute is the querier route for gov - QuerierRoute = ModuleName - // DefaultParamspace default namestore DefaultParamspace = ModuleName diff --git a/x/savings/types/query.pb.go b/x/savings/types/query.pb.go index e31fd4c3..5e1340de 100644 --- a/x/savings/types/query.pb.go +++ b/x/savings/types/query.pb.go @@ -10,9 +10,9 @@ import ( github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/x/savings/types/store.pb.go b/x/savings/types/store.pb.go index ae9537de..02ee9143 100644 --- a/x/savings/types/store.pb.go +++ b/x/savings/types/store.pb.go @@ -8,8 +8,8 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/savings/types/tx.pb.go b/x/savings/types/tx.pb.go index eb68bb02..392172d5 100644 --- a/x/savings/types/tx.pb.go +++ b/x/savings/types/tx.pb.go @@ -9,9 +9,9 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/x/swap/keeper/deposit_test.go b/x/swap/keeper/deposit_test.go index 1bf50fa6..f0bf042a 100644 --- a/x/swap/keeper/deposit_test.go +++ b/x/swap/keeper/deposit_test.go @@ -7,10 +7,10 @@ import ( "github.com/kava-labs/kava/x/swap/types" sdkmath "cosmossdk.io/math" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" ) func (suite *keeperTestSuite) TestDeposit_CreatePool_PoolNotAllowed() { diff --git a/x/swap/keeper/msg_server_test.go b/x/swap/keeper/msg_server_test.go index 6dc1952d..483cc656 100644 --- a/x/swap/keeper/msg_server_test.go +++ b/x/swap/keeper/msg_server_test.go @@ -5,17 +5,17 @@ import ( "testing" "time" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" "github.com/kava-labs/kava/x/swap/keeper" "github.com/kava-labs/kava/x/swap/testutil" "github.com/kava-labs/kava/x/swap/types" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" sdkmath "cosmossdk.io/math" + "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" bank "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/tendermint/tendermint/crypto" ) var swapModuleAccountAddress = sdk.AccAddress(crypto.AddressHash([]byte(types.ModuleAccountName))) diff --git a/x/swap/keeper/querier.go b/x/swap/keeper/querier.go deleted file mode 100644 index f604cee3..00000000 --- a/x/swap/keeper/querier.go +++ /dev/null @@ -1,164 +0,0 @@ -package keeper - -import ( - "strings" - - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/kava-labs/kava/x/swap/types" -) - -// NewQuerier is the module level router for state queries -func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(ctx sdk.Context, path []string, req abci.RequestQuery) (res []byte, err error) { - switch path[0] { - case types.QueryGetParams: - return queryGetParams(ctx, req, k, legacyQuerierCdc) - case types.QueryGetDeposits: - return queryGetDeposits(ctx, req, k, legacyQuerierCdc) - case types.QueryGetPool: - return queryGetPool(ctx, req, k, legacyQuerierCdc) - case types.QueryGetPools: - return queryGetPools(ctx, req, k, legacyQuerierCdc) - default: - return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unknown %s query endpoint", types.ModuleName) - } - } -} - -// query params in the swap store -func queryGetParams(ctx sdk.Context, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - // Get params - params := keeper.GetParams(ctx) - - // Encode results - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, params) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetDeposits(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryDepositsParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - var records types.ShareRecords - if len(params.Owner) > 0 { - records = k.GetAllDepositorSharesByOwner(ctx, params.Owner) - } else { - unfilteredRecords := k.GetAllDepositorShares(ctx) - records = filterShareRecords(ctx, unfilteredRecords, params) - } - - // Augment each deposit result with the actual share value of depositor's shares - var queryResults types.DepositsQueryResults - for _, record := range records { - pool, err := k.loadDenominatedPool(ctx, record.PoolID) - if err != nil { - return nil, err - } - shareValue := pool.ShareValue(record.SharesOwned) - queryResult := types.NewDepositsQueryResult(record, shareValue) - queryResults = append(queryResults, queryResult) - } - - var bz []byte - bz, err = codec.MarshalJSONIndent(legacyQuerierCdc, queryResults) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetPool(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params types.QueryPoolParams - err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - - hasPoolParam := len(params.Pool) > 0 - if !hasPoolParam { - return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "must specify pool param") - } - - pool, err := k.loadDenominatedPool(ctx, params.Pool) - if err != nil { - return nil, err - } - totalCoins := pool.ShareValue(pool.TotalShares()) - poolStats := types.NewPoolStatsQueryResult(params.Pool, totalCoins, pool.TotalShares()) - - var bz []byte - bz, err = codec.MarshalJSONIndent(legacyQuerierCdc, poolStats) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - return bz, nil -} - -func queryGetPools(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - pools := k.GetAllPools(ctx) - - var queryResults types.PoolStatsQueryResults - for _, pool := range pools { - denomPool, err := k.loadDenominatedPool(ctx, pool.PoolID) - if err != nil { - return nil, err - } - totalCoins := denomPool.ShareValue(denomPool.TotalShares()) - queryResult := types.NewPoolStatsQueryResult(pool.PoolID, totalCoins, denomPool.TotalShares()) - queryResults = append(queryResults, queryResult) - } - - // Encode results - bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, queryResults) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) - } - - return bz, nil -} - -// filterShareRecords retrieves share records filtered by a given set of params. -// If no filters are provided, all share records will be returned in paginated form. -func filterShareRecords(ctx sdk.Context, records types.ShareRecords, params types.QueryDepositsParams) types.ShareRecords { - filteredRecords := make(types.ShareRecords, 0, len(records)) - - for _, s := range records { - matchOwner, matchPool := true, true - - // match owner address (if supplied) - if len(params.Owner) > 0 { - matchOwner = s.Depositor.Equals(params.Owner) - } - - // match pool ID (if supplied) - if len(params.Pool) > 0 { - matchPool = strings.Compare(s.PoolID, params.Pool) == 0 - } - - if matchOwner && matchPool { - filteredRecords = append(filteredRecords, s) - } - } - - start, end := client.Paginate(len(filteredRecords), params.Page, params.Limit, 100) - if start < 0 || end < 0 { - filteredRecords = types.ShareRecords{} - } else { - filteredRecords = filteredRecords[start:end] - } - - return filteredRecords -} diff --git a/x/swap/keeper/querier_test.go b/x/swap/keeper/querier_test.go deleted file mode 100644 index 1756872e..00000000 --- a/x/swap/keeper/querier_test.go +++ /dev/null @@ -1,173 +0,0 @@ -package keeper_test - -// import ( -// "strings" -// "testing" - -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/stretchr/testify/suite" -// abci "github.com/tendermint/tendermint/abci/types" - -// "github.com/kava-labs/kava/app" -// "github.com/kava-labs/kava/x/swap/keeper" -// "github.com/kava-labs/kava/x/swap/testutil" -// "github.com/kava-labs/kava/x/swap/types" -// ) - -// type querierTestSuite struct { -// testutil.Suite -// querier sdk.Querier -// addresses []sdk.AccAddress -// } - -// func (suite *querierTestSuite) SetupTest() { -// suite.Suite.SetupTest() - -// // Set up auth GenesisState -// _, addrs := app.GeneratePrivKeyAddressPairs(5) -// coins := []sdk.Coins{} -// for j := 0; j < 5; j++ { -// coins = append(coins, cs(c("ukava", 10000000000), c("bnb", 10000000000), c("usdx", 10000000000))) -// } -// suite.addresses = addrs -// authGS := app.NewAuthGenState(addrs, coins) - -// suite.App.InitializeFromGenesisStates( -// authGS, -// NewSwapGenStateMulti(), -// ) -// suite.querier = keeper.NewQuerier(suite.Keeper) -// } - -// func (suite *querierTestSuite) TestUnkownRequest() { -// ctx := suite.Ctx.WithIsCheckTx(false) -// bz, err := suite.querier(ctx, []string{"invalid-path"}, abci.RequestQuery{}) -// suite.Nil(bz) -// suite.EqualError(err, "unknown request: unknown swap query endpoint") -// } - -// func (suite *querierTestSuite) TestQueryParams() { -// ctx := suite.Ctx.WithIsCheckTx(false) -// bz, err := suite.querier(ctx, []string{types.QueryGetParams}, abci.RequestQuery{}) -// suite.Nil(err) -// suite.NotNil(bz) - -// var p types.Params -// suite.Nil(types.ModuleCdc.UnmarshalJSON(bz, &p)) - -// swapGenesisState := NewSwapGenStateMulti() -// gs := types.GenesisState{} -// err = types.ModuleCdc.UnmarshalJSON(swapGenesisState["swap"], &gs) -// suite.Require().NoError(err) - -// suite.Equal(gs.Params, p) -// } - -// func (suite *querierTestSuite) TestQueryPool() { -// // Set up pool in store -// coinA := sdk.NewCoin("ukava", sdkmath.NewInt(10)) -// coinB := sdk.NewCoin("usdx", sdkmath.NewInt(200)) - -// pool, err := types.NewDenominatedPool(sdk.NewCoins(coinA, coinB)) -// suite.Nil(err) -// poolRecord := types.NewPoolRecordFromPool(pool) -// suite.Keeper.SetPool(suite.Ctx, poolRecord) - -// ctx := suite.Ctx.WithIsCheckTx(false) -// // Set up request query -// query := abci.RequestQuery{ -// Path: strings.Join([]string{"custom", types.QuerierRoute, types.QueryGetPool}, "/"), -// Data: types.ModuleCdc.MustMarshalJSON(types.NewQueryPoolParams(poolRecord.PoolID)), -// } - -// bz, err := suite.querier(ctx, []string{types.QueryGetPool}, query) -// suite.Nil(err) -// suite.NotNil(bz) - -// var res types.PoolStatsQueryResult -// suite.Nil(types.ModuleCdc.UnmarshalJSON(bz, &res)) - -// // Check that result matches expected result -// totalCoins := pool.ShareValue(pool.TotalShares()) -// expectedResult := types.NewPoolStatsQueryResult(poolRecord.PoolID, totalCoins, pool.TotalShares()) -// suite.Equal(expectedResult, res) -// } - -// func (suite *querierTestSuite) TestQueryPools() { -// // Set up pools in store -// coinA := sdk.NewCoin("ukava", sdkmath.NewInt(10)) -// coinB := sdk.NewCoin("usdx", sdkmath.NewInt(200)) -// coinC := sdk.NewCoin("usdx", sdkmath.NewInt(200)) - -// poolAB, err := types.NewDenominatedPool(sdk.NewCoins(coinA, coinB)) -// suite.Nil(err) -// poolRecordAB := types.NewPoolRecordFromPool(poolAB) -// suite.Keeper.SetPool(suite.Ctx, poolRecordAB) - -// poolAC, err := types.NewDenominatedPool(sdk.NewCoins(coinA, coinC)) -// suite.Nil(err) -// poolRecordAC := types.NewPoolRecordFromPool(poolAC) -// suite.Keeper.SetPool(suite.Ctx, poolRecordAC) - -// // Build a map of pools to compare to query results -// pools := types.PoolRecords{poolRecordAB, poolRecordAC} -// poolsMap := make(map[string]types.PoolRecord) -// for _, pool := range pools { -// poolsMap[pool.PoolID] = pool -// } - -// ctx := suite.Ctx.WithIsCheckTx(false) -// bz, err := suite.querier(ctx, []string{types.QueryGetPools}, abci.RequestQuery{}) -// suite.Nil(err) -// suite.NotNil(bz) - -// var res types.PoolStatsQueryResults -// suite.Nil(types.ModuleCdc.UnmarshalJSON(bz, &res)) - -// // Check that all pools are accounted for -// suite.Equal(len(poolsMap), len(res)) -// // Check that each individual result matches the expected result -// for _, pool := range res { -// expectedPool, ok := poolsMap[pool.Name] -// suite.True(ok) -// suite.Equal(expectedPool.PoolID, pool.Name) -// suite.Equal(sdk.NewCoins(expectedPool.ReservesA, expectedPool.ReservesB), pool.Coins) -// suite.Equal(expectedPool.TotalShares, pool.TotalShares) -// } -// } - -// func (suite *querierTestSuite) TestQueryDeposit() { -// // Set up pool in store -// coinA := sdk.NewCoin("ukava", sdkmath.NewInt(10)) -// coinB := sdk.NewCoin("usdx", sdkmath.NewInt(200)) -// pool, err := types.NewDenominatedPool(sdk.NewCoins(coinA, coinB)) -// suite.Nil(err) -// poolRecord := types.NewPoolRecordFromPool(pool) -// suite.Keeper.SetPool(suite.Ctx, poolRecord) - -// // Deposit into pool -// owner := suite.addresses[0] -// err = suite.Keeper.Deposit(suite.Ctx, owner, coinA, coinB, sdk.MustNewDecFromStr("0.20")) -// suite.Nil(err) - -// ctx := suite.Ctx.WithIsCheckTx(false) -// // Set up request query -// query := abci.RequestQuery{ -// Path: strings.Join([]string{"custom", types.QuerierRoute, types.QueryGetDeposits}, "/"), -// Data: types.ModuleCdc.MustMarshalJSON(types.NewQueryDepositsParams(1, 100, owner, poolRecord.PoolID)), -// } - -// bz, err := suite.querier(ctx, []string{types.QueryGetDeposits}, query) -// suite.Nil(err) -// suite.NotNil(bz) - -// var res types.DepositsQueryResults -// suite.Nil(types.ModuleCdc.UnmarshalJSON(bz, &res)) - -// // As the only depositor all pool shares should belong to the owner -// suite.Equal(poolRecord.TotalShares, res[0].SharesOwned) -// } - -// func TestQuerierTestSuite(t *testing.T) { -// suite.Run(t, new(querierTestSuite)) -// } diff --git a/x/swap/keeper/swap_test.go b/x/swap/keeper/swap_test.go index 369adb7b..12d13af6 100644 --- a/x/swap/keeper/swap_test.go +++ b/x/swap/keeper/swap_test.go @@ -5,11 +5,11 @@ import ( "fmt" sdkmath "cosmossdk.io/math" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/kava-labs/kava/x/swap/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" ) func (suite *keeperTestSuite) TestSwapExactForTokens() { diff --git a/x/swap/module.go b/x/swap/module.go index 25232f6d..8a9ac1fe 100644 --- a/x/swap/module.go +++ b/x/swap/module.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -11,7 +12,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" "github.com/kava-labs/kava/x/swap/client/cli" "github.com/kava-labs/kava/x/swap/keeper" @@ -21,7 +21,6 @@ import ( var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - // _ module.AppModuleSimulation = AppModule{} // TODO simulation ) // AppModuleBasic app module basics object @@ -104,21 +103,6 @@ func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { keeper.RegisterInvariants(ir, am.keeper) } -// Route module message route name -func (am AppModule) Route() sdk.Route { - return sdk.Route{} -} - -// QuerierRoute module querier route name -func (AppModule) QuerierRoute() string { - return types.QuerierRoute -} - -// LegacyQuerierHandler returns no sdk.Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return keeper.NewQuerier(am.keeper, legacyQuerierCdc) -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 1 @@ -155,30 +139,3 @@ func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } - -//____________________________________________________________________________ - -// // GenerateGenesisState creates a randomized GenState of the swap module -// func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState) { -// simulation.RandomizedGenState(simState) -// } - -// // ProposalContents doesn't return any content functions for governance proposals. -// func (AppModuleBasic) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent { -// return nil -// } - -// // RandomizedParams returns nil because swap has no params. -// func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange { -// return simulation.ParamChanges(r) -// } - -// // RegisterStoreDecoder registers a decoder for swap module's types -// func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { -// sdr[StoreKey] = simulation.DecodeStore -// } - -// // WeightedOperations returns the all the swap module operations with their respective weights. -// func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation { -// return simulation.WeightedOperations(simState.AppParams, simState.Cdc, am.accountKeeper, am.keeper) -// } diff --git a/x/swap/simulation/decoder.go b/x/swap/simulation/decoder.go deleted file mode 100644 index 5c7e1327..00000000 --- a/x/swap/simulation/decoder.go +++ /dev/null @@ -1,29 +0,0 @@ -package simulation - -// import ( -// "bytes" -// "fmt" - -// "github.com/cosmos/cosmos-sdk/codec" -// "github.com/tendermint/tendermint/libs/kv" - -// "github.com/kava-labs/kava/x/swap/types" -// ) - -// // DecodeStore unmarshals the KVPair's Value to the module's corresponding type -// func DecodeStore(cdc *codec.Codec, kvA, kvB kv.Pair) string { -// switch { -// case bytes.Equal(kvA.Key[:1], types.PoolKeyPrefix): -// var poolRecordA, poolRecordB types.PoolRecord -// cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &poolRecordA) -// cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &poolRecordB) -// return fmt.Sprintf("%v\n%v", poolRecordA, poolRecordB) -// case bytes.Equal(kvA.Key[:1], types.DepositorPoolSharesPrefix): -// var shareRecordA, shareRecordB types.ShareRecord -// cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &shareRecordA) -// cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &shareRecordB) -// return fmt.Sprintf("%v\n%v", shareRecordA, shareRecordB) -// default: -// panic(fmt.Sprintf("invalid %s key prefix %X", types.ModuleName, kvA.Key[:1])) -// } -// } diff --git a/x/swap/simulation/decoder_test.go b/x/swap/simulation/decoder_test.go deleted file mode 100644 index d998db34..00000000 --- a/x/swap/simulation/decoder_test.go +++ /dev/null @@ -1,62 +0,0 @@ -package simulation - -// import ( -// "fmt" -// "testing" - -// "github.com/cosmos/cosmos-sdk/codec" -// "github.com/stretchr/testify/require" - -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/tendermint/tendermint/crypto" -// "github.com/tendermint/tendermint/libs/kv" - -// "github.com/kava-labs/kava/x/swap/types" -// ) - -// func makeTestCodec() (cdc *codec.Codec) { -// cdc = codec.New() -// sdk.RegisterCodec(cdc) -// types.RegisterCodec(cdc) -// return -// } - -// func TestDecodeSwapStore(t *testing.T) { -// cdc := makeTestCodec() - -// depositor := sdk.AccAddress(crypto.AddressHash([]byte("DepositorAddress"))) -// reserves := sdk.NewCoins( -// sdk.NewCoin("ukava", sdkmath.NewInt(100000000)), -// sdk.NewCoin("usdx", sdkmath.NewInt(200000000)), -// ) -// shares := sdkmath.NewInt(123456) - -// poolRecord := types.NewPoolRecord(reserves, shares) -// shareRecord := types.NewShareRecord(depositor, poolRecord.PoolID, shares) - -// kvPairs := kv.Pairs{ -// kv.Pair{Key: types.PoolKeyPrefix, Value: cdc.MustMarshalBinaryLengthPrefixed(poolRecord)}, -// kv.Pair{Key: types.DepositorPoolSharesPrefix, Value: cdc.MustMarshalBinaryLengthPrefixed(shareRecord)}, -// kv.Pair{Key: []byte{0x99}, Value: []byte{0x99}}, -// } - -// tests := []struct { -// name string -// expectedLog string -// }{ -// {"PoolRecord", fmt.Sprintf("%v\n%v", poolRecord, poolRecord)}, -// {"ShareRecord", fmt.Sprintf("%v\n%v", shareRecord, shareRecord)}, -// {"other", ""}, -// } -// for i, tt := range tests { -// i, tt := i, tt -// t.Run(tt.name, func(t *testing.T) { -// switch i { -// case len(tests) - 1: -// require.Panics(t, func() { DecodeStore(cdc, kvPairs[i], kvPairs[i]) }, tt.name) -// default: -// require.Equal(t, tt.expectedLog, DecodeStore(cdc, kvPairs[i], kvPairs[i]), tt.name) -// } -// }) -// } -// } diff --git a/x/swap/simulation/genesis.go b/x/swap/simulation/genesis.go deleted file mode 100644 index 8074bee9..00000000 --- a/x/swap/simulation/genesis.go +++ /dev/null @@ -1,100 +0,0 @@ -package simulation - -// import ( -// "fmt" -// "math/rand" -// "sort" -// "strings" - -// "github.com/cosmos/cosmos-sdk/codec" -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/cosmos/cosmos-sdk/types/module" -// "github.com/cosmos/cosmos-sdk/x/simulation" - -// "github.com/kava-labs/kava/x/swap/types" -// ) - -// var ( -// //nolint -// accs []simulation.Account -// consistentPools = [2][2]string{{"ukava", "usdx"}, {"bnb", "xrp"}} -// ) - -// // GenSwapFee generates a random SwapFee in range [0.01, 1.00] -// func GenSwapFee(r *rand.Rand) sdk.Dec { -// min := int(1) -// max := int(100) -// percentage := int64(r.Intn(int(max)-min) + min) -// return sdk.NewDec(percentage).Quo(sdk.NewDec(100)) -// } - -// // GenAllowedPools generates random allowed pools -// func GenAllowedPools(r *rand.Rand) types.AllowedPools { -// var pools types.AllowedPools - -// // Generate a set [1, 10] of random pools -// numRandPools := (r.Intn(10) + 1) -// for i := 0; i < numRandPools; i++ { -// tokenA, tokenB := genTokenDenoms(r) -// for strings.Compare(tokenA, tokenB) == 0 { -// tokenA, tokenB = genTokenDenoms(r) -// } -// newPool := types.NewAllowedPool(tokenA, tokenB) -// pools = append(pools, newPool) -// } - -// // Append consistent pools -// for i := 0; i < len(consistentPools); i++ { -// tokenA := consistentPools[i][0] -// tokenB := consistentPools[i][1] -// newPool := types.NewAllowedPool(tokenA, tokenB) -// pools = append(pools, newPool) -// } - -// return pools -// } - -// func genTokenDenoms(r *rand.Rand) (string, string) { -// tokenA := genTokenDenom(r) -// tokenB := genTokenDenom(r) -// for strings.Compare(tokenA, tokenB) == 0 { -// tokenA = genTokenDenom(r) -// } -// tokens := []string{tokenA, tokenB} -// sort.Strings(tokens) -// return tokens[0], tokens[1] -// } - -// func genTokenDenom(r *rand.Rand) string { -// denom := strings.ToLower(simulation.RandStringOfLength(r, 3)) -// for err := sdk.ValidateDenom(denom); err != nil; { -// denom = strings.ToLower(simulation.RandStringOfLength(r, 3)) -// } -// return denom -// } - -// // RandomizedGenState generates a random GenesisState -// func RandomizedGenState(simState *module.SimulationState) { -// accs = simState.Accounts - -// swapGenesis := loadRandomSwapGenState(simState) -// fmt.Printf("Selected randomly generated %s parameters:\n%s\n", types.ModuleName, codec.MustMarshalJSONIndent(simState.Cdc, swapGenesis)) -// simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(swapGenesis) -// } - -// func loadRandomSwapGenState(simState *module.SimulationState) types.GenesisState { -// pools := GenAllowedPools(simState.Rand) -// swapFee := GenSwapFee(simState.Rand) - -// swapGenesis := types.GenesisState{ -// Params: types.Params{ -// AllowedPools: pools, -// SwapFee: swapFee, -// }, -// } - -// if err := swapGenesis.Validate(); err != nil { -// panic(err) -// } -// return swapGenesis -// } diff --git a/x/swap/simulation/operations.go b/x/swap/simulation/operations.go deleted file mode 100644 index 65b7cc6b..00000000 --- a/x/swap/simulation/operations.go +++ /dev/null @@ -1,548 +0,0 @@ -package simulation - -// import ( -// "errors" -// "fmt" -// "math/big" -// "math/rand" -// "time" - -// "github.com/cosmos/cosmos-sdk/baseapp" -// "github.com/cosmos/cosmos-sdk/codec" -// "github.com/cosmos/cosmos-sdk/simapp/helpers" -// sdk "github.com/cosmos/cosmos-sdk/types" -// authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" -// "github.com/cosmos/cosmos-sdk/x/simulation" - -// appparams "github.com/kava-labs/kava/app/params" -// "github.com/kava-labs/kava/x/swap/keeper" -// "github.com/kava-labs/kava/x/swap/types" -// ) - -// var ( -// //nolint -// noOpMsg = simulation.NoOpMsg(types.ModuleName) -// errorNotEnoughCoins = errors.New("account doesn't have enough coins") -// ) - -// // Simulation operation weights constants -// const ( -// OpWeightMsgDeposit = "op_weight_msg_deposit" -// OpWeightMsgWithdraw = "op_weight_msg_withdraw" -// OpWeightMsgSwapExactForTokens = "op_weight_msg_swap_exact_for_tokens" -// OpWeightMsgSwapForExactTokens = "op_weight_msg_swap_for_exact_tokens" -// ) - -// // WeightedOperations returns all the operations from the module with their respective weights -// func WeightedOperations( -// appParams simulation.AppParams, cdc *codec.Codec, ak types.AccountKeeper, k keeper.Keeper, -// ) simulation.WeightedOperations { -// var weightMsgDeposit int -// var weightMsgWithdraw int -// var weightMsgSwapExactForTokens int -// var weightMsgSwapForExactTokens int - -// appParams.GetOrGenerate(cdc, OpWeightMsgDeposit, &weightMsgDeposit, nil, -// func(_ *rand.Rand) { -// weightMsgDeposit = appparams.DefaultWeightMsgDeposit -// }, -// ) - -// appParams.GetOrGenerate(cdc, OpWeightMsgWithdraw, &weightMsgWithdraw, nil, -// func(_ *rand.Rand) { -// weightMsgWithdraw = appparams.DefaultWeightMsgWithdraw -// }, -// ) - -// appParams.GetOrGenerate(cdc, OpWeightMsgSwapExactForTokens, &weightMsgSwapExactForTokens, nil, -// func(_ *rand.Rand) { -// weightMsgSwapExactForTokens = appparams.DefaultWeightMsgSwapExactForTokens -// }, -// ) - -// appParams.GetOrGenerate(cdc, OpWeightMsgSwapForExactTokens, &weightMsgSwapForExactTokens, nil, -// func(_ *rand.Rand) { -// weightMsgSwapForExactTokens = appparams.DefaultWeightMsgSwapForExactTokens -// }, -// ) - -// return simulation.WeightedOperations{ -// simulation.NewWeightedOperation( -// weightMsgDeposit, -// SimulateMsgDeposit(ak, k), -// ), -// simulation.NewWeightedOperation( -// weightMsgWithdraw, -// SimulateMsgWithdraw(ak, k), -// ), -// simulation.NewWeightedOperation( -// weightMsgSwapExactForTokens, -// SimulateMsgSwapExactForTokens(ak, k), -// ), -// simulation.NewWeightedOperation( -// weightMsgSwapForExactTokens, -// SimulateMsgSwapForExactTokens(ak, k), -// ), -// } -// } - -// // SimulateMsgDeposit generates a MsgDeposit -// func SimulateMsgDeposit(ak types.AccountKeeper, k keeper.Keeper) simulation.Operation { -// return func( -// r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, -// ) (simulation.OperationMsg, []simulation.FutureOperation, error) { -// // Get possible pools and shuffle so that deposits are evenly distributed across pools -// params := k.GetParams(ctx) -// allowedPools := params.AllowedPools -// r.Shuffle(len(allowedPools), func(i, j int) { -// allowedPools[i], allowedPools[j] = allowedPools[j], allowedPools[i] -// }) - -// // Find an account-pool pair that is likely to result in a successful deposit -// blockTime := ctx.BlockHeader().Time -// depositor, allowedPool, found := findValidAccountAllowedPoolPair(accs, allowedPools, func(acc simulation.Account, pool types.AllowedPool) bool { -// account := ak.GetAccount(ctx, acc.Address) - -// err := validateDepositor(ctx, k, pool, account, blockTime) -// if err == errorNotEnoughCoins { -// return false // keep searching -// } else if err != nil { -// panic(err) // raise errors -// } -// return true // found valid pair -// }) -// if !found { -// return simulation.NewOperationMsgBasic(types.ModuleName, "no-operation (no valid allowed pool and depositor)", "", false, nil), nil, nil -// } - -// // Get random slippage amount between 1-99% -// slippageRaw, err := RandIntInclusive(r, sdk.OneInt(), sdkmath.NewInt(99)) -// if err != nil { -// panic(err) -// } -// slippage := slippageRaw.ToDec().Quo(sdk.NewDec(100)) - -// // Generate random deadline -// deadline := genRandDeadline(r, blockTime) - -// depositorAcc := ak.GetAccount(ctx, depositor.Address) -// depositorCoins := depositorAcc.SpendableCoins(blockTime) - -// // Construct initial msg (without coin amounts) -// msg := types.NewMsgDeposit(depositorAcc.GetAddress(), sdk.Coin{}, sdk.Coin{}, slippage, deadline) - -// // Populate msg with randomized token amounts -// pool, found := k.GetPool(ctx, allowedPool.Name()) -// if !found { // Pool doesn't exist: first deposit -// depositTokenA := randCoinFromCoins(r, depositorCoins, allowedPool.TokenA) -// msg.TokenA = depositTokenA - -// depositTokenB := randCoinFromCoins(r, depositorCoins, allowedPool.TokenB) -// msg.TokenB = depositTokenB -// } else { // Pool exists: successive deposit -// var denomX string // Denom X is the token denom in the pool with the larger amount -// var denomY string // Denom Y is the token denom in the pool with the larger amount -// if pool.ReservesA.Amount.GTE(pool.ReservesB.Amount) { -// denomX = pool.ReservesA.Denom -// denomY = pool.ReservesB.Denom -// } else { -// denomX = pool.ReservesB.Denom -// denomY = pool.ReservesA.Denom -// } -// depositTokenY := randCoinFromCoins(r, depositorCoins, denomY) -// msg.TokenA = depositTokenY - -// // Calculate the pool's slippage ratio and use it to build other coin -// ratio := pool.Reserves().AmountOf(denomX).ToDec().Quo(pool.Reserves().AmountOf(denomY).ToDec()) -// amtTokenX := depositTokenY.Amount.ToDec().Mul(ratio).RoundInt() -// depositTokenX := sdk.NewCoin(denomX, amtTokenX) -// if depositorCoins.AmountOf(denomX).LT(amtTokenX) { -// return simulation.NewOperationMsgBasic(types.ModuleName, "no-operation (depositor has insufficient coins)", "", false, nil), nil, nil -// } -// msg.TokenB = depositTokenX -// } - -// err = msg.ValidateBasic() -// if err != nil { -// return noOpMsg, nil, nil -// } - -// tx := helpers.GenTx( -// []sdk.Msg{msg}, -// sdk.NewCoins(), -// helpers.DefaultGenTxGas, -// chainID, -// []uint64{depositorAcc.GetAccountNumber()}, -// []uint64{depositorAcc.GetSequence()}, -// depositor.PrivKey, -// ) - -// _, result, err := app.Deliver(tx) -// if err != nil { -// // to aid debugging, add the stack trace to the comment field of the returned opMsg -// return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err -// } -// return simulation.NewOperationMsg(msg, true, result.Log), nil, nil -// } -// } - -// // SimulateMsgWithdraw generates a MsgWithdraw -// func SimulateMsgWithdraw(ak types.AccountKeeper, k keeper.Keeper) simulation.Operation { -// return func( -// r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, -// ) (simulation.OperationMsg, []simulation.FutureOperation, error) { - -// poolRecords := k.GetAllPools(ctx) -// r.Shuffle(len(poolRecords), func(i, j int) { -// poolRecords[i], poolRecords[j] = poolRecords[j], poolRecords[i] -// }) - -// // Find an account-pool pair for which withdraw is possible -// withdrawer, poolRecord, found := findValidAccountPoolRecordPair(accs, poolRecords, func(acc simulation.Account, poolRecord types.PoolRecord) bool { -// _, found := k.GetDepositorShares(ctx, acc.Address, poolRecord.PoolID) -// return found -// }) -// if !found { -// return simulation.NewOperationMsgBasic(types.ModuleName, "no-operation (no valid pool record and withdrawer)", "", false, nil), nil, nil -// } - -// withdrawerAcc := ak.GetAccount(ctx, withdrawer.Address) -// shareRecord, _ := k.GetDepositorShares(ctx, withdrawerAcc.GetAddress(), poolRecord.PoolID) -// denominatedPool, err := types.NewDenominatedPoolWithExistingShares(poolRecord.Reserves(), poolRecord.TotalShares) -// if err != nil { -// return noOpMsg, nil, nil -// } -// coinsOwned := denominatedPool.ShareValue(shareRecord.SharesOwned) - -// // Get random amount of shares between 2-10% of the total -// sharePercentage, err := RandIntInclusive(r, sdkmath.NewInt(2), sdkmath.NewInt(10)) -// if err != nil { -// panic(err) -// } -// shares := shareRecord.SharesOwned.Mul(sharePercentage).Quo(sdkmath.NewInt(100)) - -// // Expect minimum token amounts relative to the % of shares owned and withdrawn -// oneLessThanSharePercentage := sharePercentage.Sub(sdk.OneInt()) - -// amtTokenAOwned := coinsOwned.AmountOf(poolRecord.ReservesA.Denom) -// minAmtTokenA := amtTokenAOwned.Mul(oneLessThanSharePercentage).Quo(sdkmath.NewInt(100)) -// minTokenA := sdk.NewCoin(poolRecord.ReservesA.Denom, minAmtTokenA) - -// amtTokenBOwned := coinsOwned.AmountOf(poolRecord.ReservesB.Denom) -// minTokenAmtB := amtTokenBOwned.Mul(oneLessThanSharePercentage).Quo(sdkmath.NewInt(100)) -// minTokenB := sdk.NewCoin(poolRecord.ReservesB.Denom, minTokenAmtB) - -// // Generate random deadline -// blockTime := ctx.BlockHeader().Time -// deadline := genRandDeadline(r, blockTime) - -// // Construct MsgWithdraw -// msg := types.NewMsgWithdraw(withdrawerAcc.GetAddress(), shares, minTokenA, minTokenB, deadline) -// err = msg.ValidateBasic() -// if err != nil { -// return noOpMsg, nil, nil -// } - -// tx := helpers.GenTx( -// []sdk.Msg{msg}, -// sdk.NewCoins(), -// helpers.DefaultGenTxGas, -// chainID, -// []uint64{withdrawerAcc.GetAccountNumber()}, -// []uint64{withdrawerAcc.GetSequence()}, -// withdrawer.PrivKey, -// ) - -// _, result, err := app.Deliver(tx) -// if err != nil { -// // to aid debugging, add the stack trace to the comment field of the returned opMsg -// return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err -// } -// return simulation.NewOperationMsg(msg, true, result.Log), nil, nil - -// } -// } - -// // SimulateMsgSwapExactForTokens generates a MsgSwapExactForTokens -// func SimulateMsgSwapExactForTokens(ak types.AccountKeeper, k keeper.Keeper) simulation.Operation { -// return func( -// r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, -// ) (simulation.OperationMsg, []simulation.FutureOperation, error) { - -// poolRecords := k.GetAllPools(ctx) -// r.Shuffle(len(poolRecords), func(i, j int) { -// poolRecords[i], poolRecords[j] = poolRecords[j], poolRecords[i] -// }) - -// // Find an account-pool pair for which trade is possible -// trader, poolRecord, found := findValidAccountPoolRecordPair(accs, poolRecords, func(acc simulation.Account, poolRecord types.PoolRecord) bool { -// traderAcc := ak.GetAccount(ctx, acc.Address) -// balanceTokenA := traderAcc.GetCoins().AmountOf(poolRecord.ReservesA.Denom) -// balanceTokenB := traderAcc.GetCoins().AmountOf(poolRecord.ReservesB.Denom) -// if !balanceTokenA.IsPositive() || !balanceTokenB.IsPositive() { -// return false -// } -// return true -// }) -// if !found { -// return simulation.NewOperationMsgBasic(types.ModuleName, "no-operation (no valid pool record and trader)", "", false, nil), nil, nil -// } - -// // Select input token -// randInt, err := RandInt(r, sdk.OneInt(), sdkmath.NewInt(9)) -// if err != nil { -// panic(err) -// } -// inputToken := poolRecord.ReservesA -// outputToken := poolRecord.ReservesB -// if randInt.Int64()%2 == 0 { -// inputToken = poolRecord.ReservesB -// outputToken = poolRecord.ReservesA -// } - -// // Select entity (trader account or pool) with smaller token amount -// traderAcc := ak.GetAccount(ctx, trader.Address) -// maxTradeAmount := inputToken.Amount -// if traderAcc.GetCoins().AmountOf(inputToken.Denom).LT(inputToken.Amount) { -// maxTradeAmount = traderAcc.GetCoins().AmountOf(inputToken.Denom) -// } - -// // Exact input token is between 2-10% of the max trade amount -// percentage, err := RandIntInclusive(r, sdkmath.NewInt(2), sdkmath.NewInt(10)) -// if err != nil { -// panic(err) -// } -// tradeAmount := maxTradeAmount.Mul(percentage).Quo(sdkmath.NewInt(100)) -// exactInputToken := sdk.NewCoin(inputToken.Denom, tradeAmount) - -// // Calculate expected output coin -// globalSwapFee := k.GetSwapFee(ctx) -// tradeAmountAfterFee := exactInputToken.Amount.ToDec().Mul(sdk.OneDec().Sub(globalSwapFee)).TruncateInt() - -// var outputAmt big.Int -// outputAmt.Mul(outputToken.Amount.BigInt(), tradeAmountAfterFee.BigInt()) -// outputAmt.Quo(&outputAmt, inputToken.Amount.Add(tradeAmountAfterFee).BigInt()) -// expectedOutTokenAmount := sdkmath.NewIntFromBigInt(&outputAmt) -// expectedOutputToken := sdk.NewCoin(outputToken.Denom, expectedOutTokenAmount) - -// // Get random slippage amount between 50-100% -// slippageRaw, err := RandIntInclusive(r, sdkmath.NewInt(50), sdkmath.NewInt(99)) -// if err != nil { -// panic(err) -// } -// slippage := slippageRaw.ToDec().Quo(sdk.NewDec(100)) - -// // Generate random deadline -// blockTime := ctx.BlockHeader().Time -// deadline := genRandDeadline(r, blockTime) - -// // Construct MsgSwapExactForTokens -// msg := types.NewMsgSwapExactForTokens(traderAcc.GetAddress(), exactInputToken, expectedOutputToken, slippage, deadline) -// err = msg.ValidateBasic() -// if err != nil { -// return noOpMsg, nil, nil -// } - -// tx := helpers.GenTx( -// []sdk.Msg{msg}, -// sdk.NewCoins(), -// helpers.DefaultGenTxGas, -// chainID, -// []uint64{traderAcc.GetAccountNumber()}, -// []uint64{traderAcc.GetSequence()}, -// trader.PrivKey, -// ) - -// _, result, err := app.Deliver(tx) -// if err != nil { -// // to aid debugging, add the stack trace to the comment field of the returned opMsg -// return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err -// } -// return simulation.NewOperationMsg(msg, true, result.Log), nil, nil -// } -// } - -// // SimulateMsgSwapForExactTokens generates a MsgSwapForExactTokens -// func SimulateMsgSwapForExactTokens(ak types.AccountKeeper, k keeper.Keeper) simulation.Operation { -// return func( -// r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simulation.Account, chainID string, -// ) (simulation.OperationMsg, []simulation.FutureOperation, error) { - -// poolRecords := k.GetAllPools(ctx) -// r.Shuffle(len(poolRecords), func(i, j int) { -// poolRecords[i], poolRecords[j] = poolRecords[j], poolRecords[i] -// }) - -// // Find an account-pool pair for which trade is possible -// trader, poolRecord, found := findValidAccountPoolRecordPair(accs, poolRecords, func(acc simulation.Account, poolRecord types.PoolRecord) bool { -// traderAcc := ak.GetAccount(ctx, acc.Address) -// balanceTokenA := traderAcc.GetCoins().AmountOf(poolRecord.ReservesA.Denom) -// balanceTokenB := traderAcc.GetCoins().AmountOf(poolRecord.ReservesB.Denom) -// if !balanceTokenA.IsPositive() || !balanceTokenB.IsPositive() { -// return false -// } -// return true -// }) -// if !found { -// return simulation.NewOperationMsgBasic(types.ModuleName, "no-operation (no valid pool record and trader)", "", false, nil), nil, nil -// } - -// // Select input token -// randInt, err := RandInt(r, sdk.OneInt(), sdkmath.NewInt(9)) -// if err != nil { -// panic(err) -// } -// inputToken := poolRecord.ReservesA -// outputToken := poolRecord.ReservesB -// if randInt.Int64()%2 == 0 { -// inputToken = poolRecord.ReservesB -// outputToken = poolRecord.ReservesA -// } - -// // Select entity (trader account or pool) with smaller token amount -// traderAcc := ak.GetAccount(ctx, trader.Address) -// maxTradeAmount := inputToken.Amount -// if traderAcc.GetCoins().AmountOf(inputToken.Denom).LT(inputToken.Amount) { -// maxTradeAmount = traderAcc.GetCoins().AmountOf(inputToken.Denom) -// } - -// // Expected input token is between 2-10% of the max trade amount -// percentage, err := RandIntInclusive(r, sdkmath.NewInt(2), sdkmath.NewInt(10)) -// if err != nil { -// panic(err) -// } -// tradeAmount := maxTradeAmount.Mul(percentage).Quo(sdkmath.NewInt(100)) -// expectedInputToken := sdk.NewCoin(inputToken.Denom, tradeAmount) - -// // Calculate exact output coin -// globalSwapFee := k.GetSwapFee(ctx) -// tradeAmountAfterFee := expectedInputToken.Amount.ToDec().Mul(sdk.OneDec().Sub(globalSwapFee)).TruncateInt() - -// var outputAmt big.Int -// outputAmt.Mul(outputToken.Amount.BigInt(), tradeAmountAfterFee.BigInt()) -// outputAmt.Quo(&outputAmt, inputToken.Amount.Add(tradeAmountAfterFee).BigInt()) -// outputTokenAmount := sdkmath.NewIntFromBigInt(&outputAmt) -// exactOutputToken := sdk.NewCoin(outputToken.Denom, outputTokenAmount) - -// // Get random slippage amount between 50-100% -// slippageRaw, err := RandIntInclusive(r, sdkmath.NewInt(50), sdkmath.NewInt(99)) -// if err != nil { -// panic(err) -// } -// slippage := slippageRaw.ToDec().Quo(sdk.NewDec(100)) - -// // Generate random deadline -// blockTime := ctx.BlockHeader().Time -// deadline := genRandDeadline(r, blockTime) - -// // Construct MsgSwapForExactTokens -// msg := types.NewMsgSwapForExactTokens(traderAcc.GetAddress(), expectedInputToken, exactOutputToken, slippage, deadline) -// err = msg.ValidateBasic() -// if err != nil { -// return noOpMsg, nil, nil -// } - -// tx := helpers.GenTx( -// []sdk.Msg{msg}, -// sdk.NewCoins(), -// helpers.DefaultGenTxGas, -// chainID, -// []uint64{traderAcc.GetAccountNumber()}, -// []uint64{traderAcc.GetSequence()}, -// trader.PrivKey, -// ) - -// _, result, err := app.Deliver(tx) -// if err != nil { -// // to aid debugging, add the stack trace to the comment field of the returned opMsg -// return simulation.NewOperationMsg(msg, false, fmt.Sprintf("%+v", err)), nil, err -// } -// return simulation.NewOperationMsg(msg, true, result.Log), nil, nil -// } -// } - -// // From a set of coins return a coin of the specified denom with 1-10% of the total amount -// func randCoinFromCoins(r *rand.Rand, coins sdk.Coins, denom string) sdk.Coin { -// percentOfBalance, err := RandIntInclusive(r, sdk.OneInt(), sdkmath.NewInt(10)) -// if err != nil { -// panic(err) -// } -// balance := coins.AmountOf(denom) -// amtToken := balance.Mul(percentOfBalance).Quo(sdkmath.NewInt(100)) -// return sdk.NewCoin(denom, amtToken) -// } - -// func validateDepositor(ctx sdk.Context, k keeper.Keeper, allowedPool types.AllowedPool, -// depositor authexported.Account, blockTime time.Time) error { -// depositorCoins := depositor.SpendableCoins(blockTime) -// tokenABalance := depositorCoins.AmountOf(allowedPool.TokenA) -// tokenBBalance := depositorCoins.AmountOf(allowedPool.TokenB) - -// oneThousand := sdkmath.NewInt(1000) -// if tokenABalance.LT(oneThousand) || tokenBBalance.LT(oneThousand) { -// return errorNotEnoughCoins -// } - -// return nil -// } - -// // findValidAccountAllowedPoolPair finds an account for which the callback func returns true -// func findValidAccountAllowedPoolPair(accounts []simulation.Account, pools types.AllowedPools, -// cb func(simulation.Account, types.AllowedPool) bool) (simulation.Account, types.AllowedPool, bool) { -// for _, pool := range pools { -// for _, acc := range accounts { -// if isValid := cb(acc, pool); isValid { -// return acc, pool, true -// } -// } -// } -// return simulation.Account{}, types.AllowedPool{}, false -// } - -// // findValidAccountPoolRecordPair finds an account for which the callback func returns true -// func findValidAccountPoolRecordPair(accounts []simulation.Account, pools types.PoolRecords, -// cb func(simulation.Account, types.PoolRecord) bool) (simulation.Account, types.PoolRecord, bool) { -// for _, pool := range pools { -// for _, acc := range accounts { -// if isValid := cb(acc, pool); isValid { -// return acc, pool, true -// } -// } -// } -// return simulation.Account{}, types.PoolRecord{}, false -// } - -// func genRandDeadline(r *rand.Rand, blockTime time.Time) int64 { -// // Set up deadline -// durationNanoseconds, err := RandIntInclusive(r, -// sdkmath.NewInt((time.Second * 10).Nanoseconds()), // ten seconds -// sdkmath.NewInt((time.Hour * 24).Nanoseconds()), // one day -// ) -// if err != nil { -// panic(err) -// } -// extraTime := time.Duration(durationNanoseconds.Int64()) -// return blockTime.Add(extraTime).Unix() -// } - -// // RandIntInclusive randomly generates an sdkmath.Int in the range [inclusiveMin, inclusiveMax]. It works for negative and positive integers. -// func RandIntInclusive(r *rand.Rand, inclusiveMin, inclusiveMax sdkmath.Int) (sdkmath.Int, error) { -// if inclusiveMin.GT(inclusiveMax) { -// return sdkmath.Int{}, fmt.Errorf("min larger than max") -// } -// return RandInt(r, inclusiveMin, inclusiveMax.Add(sdk.OneInt())) -// } - -// // RandInt randomly generates an sdkmath.Int in the range [inclusiveMin, exclusiveMax). It works for negative and positive integers. -// func RandInt(r *rand.Rand, inclusiveMin, exclusiveMax sdkmath.Int) (sdkmath.Int, error) { -// // validate input -// if inclusiveMin.GTE(exclusiveMax) { -// return sdkmath.Int{}, fmt.Errorf("min larger or equal to max") -// } -// // shift the range to start at 0 -// shiftedRange := exclusiveMax.Sub(inclusiveMin) // should always be positive given the check above -// // randomly pick from the shifted range -// shiftedRandInt := sdkmath.NewIntFromBigInt(new(big.Int).Rand(r, shiftedRange.BigInt())) -// // shift back to the original range -// return shiftedRandInt.Add(inclusiveMin), nil -// } diff --git a/x/swap/simulation/params.go b/x/swap/simulation/params.go deleted file mode 100644 index 44ef71a1..00000000 --- a/x/swap/simulation/params.go +++ /dev/null @@ -1,32 +0,0 @@ -package simulation - -// import ( -// "fmt" -// "math/rand" - -// "github.com/cosmos/cosmos-sdk/x/simulation" - -// "github.com/kava-labs/kava/x/swap/types" -// ) - -// const ( -// keyAllowedPools = "AllowedPools" -// keySwapFee = "SwapFee" -// ) - -// // ParamChanges defines the parameters that can be modified by param change proposals -// // on the simulation -// func ParamChanges(r *rand.Rand) []simulation.ParamChange { -// return []simulation.ParamChange{ -// simulation.NewSimParamChange(types.ModuleName, keyAllowedPools, -// func(r *rand.Rand) string { -// return fmt.Sprintf("\"%s\"", GenAllowedPools(r)) -// }, -// ), -// simulation.NewSimParamChange(types.ModuleName, keySwapFee, -// func(r *rand.Rand) string { -// return fmt.Sprintf("\"%s\"", GenSwapFee(r)) -// }, -// ), -// } -// } diff --git a/x/swap/testutil/suite.go b/x/swap/testutil/suite.go index 484d3971..35e5429b 100644 --- a/x/swap/testutil/suite.go +++ b/x/swap/testutil/suite.go @@ -10,6 +10,9 @@ import ( "github.com/kava-labs/kava/x/swap/types" sdkmath "cosmossdk.io/math" + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -17,9 +20,6 @@ import ( BankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" ) var defaultSwapFee = sdk.MustNewDecFromStr("0.003") diff --git a/x/swap/types/genesis.pb.go b/x/swap/types/genesis.pb.go index 5eb578c8..7796cf76 100644 --- a/x/swap/types/genesis.pb.go +++ b/x/swap/types/genesis.pb.go @@ -5,8 +5,8 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/swap/types/keys.go b/x/swap/types/keys.go index 2bf88521..a3e52a58 100644 --- a/x/swap/types/keys.go +++ b/x/swap/types/keys.go @@ -17,9 +17,6 @@ const ( // RouterKey Top level router key RouterKey = ModuleName - // QuerierRoute Top level query string - QuerierRoute = ModuleName - // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName ) diff --git a/x/swap/types/query.pb.go b/x/swap/types/query.pb.go index c5b7f1b6..fc239a03 100644 --- a/x/swap/types/query.pb.go +++ b/x/swap/types/query.pb.go @@ -10,9 +10,9 @@ import ( github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/x/swap/types/swap.pb.go b/x/swap/types/swap.pb.go index 704abe0a..e1a71cd7 100644 --- a/x/swap/types/swap.pb.go +++ b/x/swap/types/swap.pb.go @@ -8,8 +8,8 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/x/swap/types/tx.pb.go b/x/swap/types/tx.pb.go index 2ba28798..0eea5aa7 100644 --- a/x/swap/types/tx.pb.go +++ b/x/swap/types/tx.pb.go @@ -9,9 +9,9 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/x/validator-vesting/module.go b/x/validator-vesting/module.go index 8d068181..eb4c73aa 100644 --- a/x/validator-vesting/module.go +++ b/x/validator-vesting/module.go @@ -6,7 +6,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -88,17 +88,6 @@ func (am AppModule) Name() string { return am.AppModuleBasic.Name() } -// Route returns validator-vesting module's message route. -func (am AppModule) Route() sdk.Route { return sdk.Route{} } - -// QuerierRoute returns validator-vesting module's query routing key. -func (AppModule) QuerierRoute() string { return types.QuerierRoute } - -// LegacyQuerierHandler returns validator-vesting module's Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return NewQuerier(am.bankKeeper, legacyQuerierCdc) -} - // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) {} diff --git a/x/validator-vesting/querier.go b/x/validator-vesting/querier.go deleted file mode 100644 index 90f72cb9..00000000 --- a/x/validator-vesting/querier.go +++ /dev/null @@ -1,358 +0,0 @@ -package validator_vesting - -import ( - "time" - - errorsmod "cosmossdk.io/errors" - sdkmath "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/kava-labs/kava/x/validator-vesting/types" - - abci "github.com/tendermint/tendermint/abci/types" -) - -const SafuFund int64 = 10000000 // 10 million KAVA - -// NewQuerier is the module level router for state queries -func NewQuerier(bk types.BankKeeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(ctx sdk.Context, path []string, req abci.RequestQuery) (res []byte, err error) { - switch path[0] { - case types.QueryCirculatingSupply: - return queryGetCirculatingSupply(ctx, req, bk, legacyQuerierCdc) - case types.QueryTotalSupply: - return queryGetTotalSupply(ctx, req, bk, legacyQuerierCdc) - case types.QueryCirculatingSupplyHARD: - return getCirculatingSupplyHARD(ctx, req, legacyQuerierCdc) - case types.QueryCirculatingSupplyUSDX: - return getCirculatingSupplyUSDX(ctx, req, bk, legacyQuerierCdc) - case types.QueryCirculatingSupplySWP: - return getCirculatingSupplySWP(ctx, req, legacyQuerierCdc) - case types.QueryTotalSupplyHARD: - return getTotalSupplyHARD(ctx, req, bk, legacyQuerierCdc) - case types.QueryTotalSupplyUSDX: - return getCirculatingSupplyUSDX(ctx, req, bk, legacyQuerierCdc) // Intentional - USDX total supply is the circulating supply - default: - return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unknown %s query endpoint: %s", types.ModuleName, path[0]) - } - } -} - -func queryGetTotalSupply(ctx sdk.Context, req abci.RequestQuery, bk types.BankKeeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - totalSupply := bk.GetSupply(ctx, "ukava").Amount - supplyInt := sdk.NewDecFromInt(totalSupply).Mul(sdk.MustNewDecFromStr("0.000001")).TruncateInt64() - bz, err := legacyQuerierCdc.MarshalJSON(supplyInt) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - return bz, nil -} - -func queryGetCirculatingSupply(ctx sdk.Context, req abci.RequestQuery, bk types.BankKeeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - totalSupply := bk.GetSupply(ctx, "ukava").Amount - supplyInt := getCirculatingSupply(ctx.BlockTime(), totalSupply) - bz, err := legacyQuerierCdc.MarshalJSON(supplyInt) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - return bz, nil -} - -func getCirculatingSupply(blockTime time.Time, totalSupply sdkmath.Int) sdkmath.Int { - vestingDates := []time.Time{ - time.Date(2022, 2, 5, 14, 0, 0, 0, time.UTC), - time.Date(2022, 5, 5, 14, 0, 0, 0, time.UTC), - time.Date(2022, 8, 5, 14, 0, 0, 0, time.UTC), - time.Date(2022, 11, 5, 14, 0, 0, 0, time.UTC), - } - - switch { - case blockTime.Before(vestingDates[0]): - return sdk.NewDecFromInt(totalSupply.Sub(sdkmath.NewInt(9937500000000))).Mul(sdk.MustNewDecFromStr("0.000001")).RoundInt() - case blockTime.After(vestingDates[0]) && blockTime.Before(vestingDates[1]) || blockTime.Equal(vestingDates[0]): - return sdk.NewDecFromInt(totalSupply.Sub(sdkmath.NewInt(7453125000000))).Mul(sdk.MustNewDecFromStr("0.000001")).RoundInt() - case blockTime.After(vestingDates[1]) && blockTime.Before(vestingDates[2]) || blockTime.Equal(vestingDates[1]): - return sdk.NewDecFromInt(totalSupply.Sub(sdkmath.NewInt(4968750000000))).Mul(sdk.MustNewDecFromStr("0.000001")).RoundInt() - case blockTime.After(vestingDates[2]) && blockTime.Before(vestingDates[3]) || blockTime.Equal(vestingDates[2]): - return sdk.NewDecFromInt(totalSupply.Sub(sdkmath.NewInt(2484375000000))).Mul(sdk.MustNewDecFromStr("0.000001")).RoundInt() - default: - return sdk.NewDecFromInt(totalSupply).Mul(sdk.MustNewDecFromStr("0.000001")).RoundInt() - } -} - -func getCirculatingSupplyHARD(ctx sdk.Context, req abci.RequestQuery, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - supplyIncreaseDates := []time.Time{ - time.Date(2020, 10, 15, 14, 0, 0, 0, time.UTC), // + 30,000,000 *** Year ONE *** - time.Date(2020, 11, 15, 14, 0, 0, 0, time.UTC), // + 5,000,000 - time.Date(2020, 12, 15, 14, 0, 0, 0, time.UTC), // + 5,000,000 - time.Date(2021, 1, 15, 14, 0, 0, 0, time.UTC), // + 7,708,334 - time.Date(2021, 2, 15, 14, 0, 0, 0, time.UTC), // + 3,333,333 - time.Date(2021, 3, 15, 14, 0, 0, 0, time.UTC), // + 3,333,333 - time.Date(2021, 4, 15, 14, 0, 0, 0, time.UTC), // + 6,875,000 - time.Date(2021, 5, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2021, 6, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2021, 7, 15, 14, 0, 0, 0, time.UTC), // + 6,875,000 - time.Date(2021, 8, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2021, 9, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 *** Year ONE *** - time.Date(2021, 10, 15, 14, 0, 0, 0, time.UTC), // + 13,541,667 *** Year TWO *** - time.Date(2021, 11, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2021, 12, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2022, 1, 15, 14, 0, 0, 0, time.UTC), // + 8,541,667 - time.Date(2022, 2, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2022, 3, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2022, 4, 15, 14, 0, 0, 0, time.UTC), // + 8,541,667 - time.Date(2022, 5, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2022, 6, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2022, 7, 15, 14, 0, 0, 0, time.UTC), // + 8,541,667 - time.Date(2022, 8, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2022, 9, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 *** Year TWO *** - time.Date(2022, 10, 15, 14, 0, 0, 0, time.UTC), // + 8,541,667 *** Year THREE *** - time.Date(2022, 11, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2022, 12, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2023, 1, 15, 14, 0, 0, 0, time.UTC), // + 4,166,667 - time.Date(2023, 2, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2023, 3, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2023, 4, 15, 14, 0, 0, 0, time.UTC), // + 4,166,667 - time.Date(2023, 5, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2023, 6, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2023, 7, 15, 14, 0, 0, 0, time.UTC), // + 4,166,667 - time.Date(2023, 8, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 - time.Date(2023, 9, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 *** Year THREE *** - time.Date(2023, 10, 15, 14, 0, 0, 0, time.UTC), // + 3,333,334 *** Year FOUR *** - time.Date(2023, 11, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 - time.Date(2023, 12, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 - time.Date(2024, 1, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 - time.Date(2024, 2, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 - time.Date(2024, 3, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 - time.Date(2024, 4, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 - time.Date(2024, 5, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 - time.Date(2024, 6, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 - time.Date(2024, 7, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 - time.Date(2024, 8, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 - time.Date(2024, 9, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 *** Year FOUR *** - } - - circSupply := sdk.ZeroInt() - blockTime := ctx.BlockTime() - switch { - case blockTime.Before(supplyIncreaseDates[0]): - circSupply = sdkmath.NewInt(0) - case blockTime.After(supplyIncreaseDates[0]) && blockTime.Before(supplyIncreaseDates[1]) || blockTime.Equal(supplyIncreaseDates[0]): - circSupply = sdkmath.NewInt(30000000) // Start year ONE - case blockTime.After(supplyIncreaseDates[1]) && blockTime.Before(supplyIncreaseDates[2]) || blockTime.Equal(supplyIncreaseDates[1]): - circSupply = sdkmath.NewInt(35000000) - case blockTime.After(supplyIncreaseDates[2]) && blockTime.Before(supplyIncreaseDates[3]) || blockTime.Equal(supplyIncreaseDates[2]): - circSupply = sdkmath.NewInt(40000000) - case blockTime.After(supplyIncreaseDates[3]) && blockTime.Before(supplyIncreaseDates[4]) || blockTime.Equal(supplyIncreaseDates[3]): - circSupply = sdkmath.NewInt(47708334) - case blockTime.After(supplyIncreaseDates[4]) && blockTime.Before(supplyIncreaseDates[5]) || blockTime.Equal(supplyIncreaseDates[4]): - circSupply = sdkmath.NewInt(51041667) - case blockTime.After(supplyIncreaseDates[5]) && blockTime.Before(supplyIncreaseDates[6]) || blockTime.Equal(supplyIncreaseDates[5]): - circSupply = sdkmath.NewInt(54375000) - case blockTime.After(supplyIncreaseDates[6]) && blockTime.Before(supplyIncreaseDates[7]) || blockTime.Equal(supplyIncreaseDates[6]): - circSupply = sdkmath.NewInt(61250000) - case blockTime.After(supplyIncreaseDates[7]) && blockTime.Before(supplyIncreaseDates[8]) || blockTime.Equal(supplyIncreaseDates[7]): - circSupply = sdkmath.NewInt(63750000) - case blockTime.After(supplyIncreaseDates[8]) && blockTime.Before(supplyIncreaseDates[9]) || blockTime.Equal(supplyIncreaseDates[8]): - circSupply = sdkmath.NewInt(66250000) - case blockTime.After(supplyIncreaseDates[9]) && blockTime.Before(supplyIncreaseDates[10]) || blockTime.Equal(supplyIncreaseDates[9]): - circSupply = sdkmath.NewInt(73125000) - case blockTime.After(supplyIncreaseDates[10]) && blockTime.Before(supplyIncreaseDates[11]) || blockTime.Equal(supplyIncreaseDates[10]): - circSupply = sdkmath.NewInt(75625000) - case blockTime.After(supplyIncreaseDates[11]) && blockTime.Before(supplyIncreaseDates[12]) || blockTime.Equal(supplyIncreaseDates[11]): - circSupply = sdkmath.NewInt(78125000) // End year ONE - case blockTime.After(supplyIncreaseDates[12]) && blockTime.Before(supplyIncreaseDates[13]) || blockTime.Equal(supplyIncreaseDates[12]): - circSupply = sdkmath.NewInt(91666667) // Start year TWO - case blockTime.After(supplyIncreaseDates[13]) && blockTime.Before(supplyIncreaseDates[14]) || blockTime.Equal(supplyIncreaseDates[13]): - circSupply = sdkmath.NewInt(94166667) - case blockTime.After(supplyIncreaseDates[14]) && blockTime.Before(supplyIncreaseDates[15]) || blockTime.Equal(supplyIncreaseDates[14]): - circSupply = sdkmath.NewInt(96666667) - case blockTime.After(supplyIncreaseDates[15]) && blockTime.Before(supplyIncreaseDates[16]) || blockTime.Equal(supplyIncreaseDates[15]): - circSupply = sdkmath.NewInt(105208334) - case blockTime.After(supplyIncreaseDates[16]) && blockTime.Before(supplyIncreaseDates[17]) || blockTime.Equal(supplyIncreaseDates[16]): - circSupply = sdkmath.NewInt(107708334) - case blockTime.After(supplyIncreaseDates[17]) && blockTime.Before(supplyIncreaseDates[18]) || blockTime.Equal(supplyIncreaseDates[17]): - circSupply = sdkmath.NewInt(110208334) - case blockTime.After(supplyIncreaseDates[18]) && blockTime.Before(supplyIncreaseDates[19]) || blockTime.Equal(supplyIncreaseDates[18]): - circSupply = sdkmath.NewInt(118750000) - case blockTime.After(supplyIncreaseDates[19]) && blockTime.Before(supplyIncreaseDates[20]) || blockTime.Equal(supplyIncreaseDates[19]): - circSupply = sdkmath.NewInt(121250000) - case blockTime.After(supplyIncreaseDates[20]) && blockTime.Before(supplyIncreaseDates[21]) || blockTime.Equal(supplyIncreaseDates[20]): - circSupply = sdkmath.NewInt(123750000) - case blockTime.After(supplyIncreaseDates[21]) && blockTime.Before(supplyIncreaseDates[22]) || blockTime.Equal(supplyIncreaseDates[21]): - circSupply = sdkmath.NewInt(132291668) - case blockTime.After(supplyIncreaseDates[22]) && blockTime.Before(supplyIncreaseDates[23]) || blockTime.Equal(supplyIncreaseDates[22]): - circSupply = sdkmath.NewInt(134791668) - case blockTime.After(supplyIncreaseDates[23]) && blockTime.Before(supplyIncreaseDates[24]) || blockTime.Equal(supplyIncreaseDates[23]): - circSupply = sdkmath.NewInt(137291668) // End year TWO - case blockTime.After(supplyIncreaseDates[24]) && blockTime.Before(supplyIncreaseDates[25]) || blockTime.Equal(supplyIncreaseDates[24]): - circSupply = sdkmath.NewInt(145833335) // Start year THREE - case blockTime.After(supplyIncreaseDates[25]) && blockTime.Before(supplyIncreaseDates[26]) || blockTime.Equal(supplyIncreaseDates[25]): - circSupply = sdkmath.NewInt(148333335) - case blockTime.After(supplyIncreaseDates[26]) && blockTime.Before(supplyIncreaseDates[27]) || blockTime.Equal(supplyIncreaseDates[26]): - circSupply = sdkmath.NewInt(150833335) - case blockTime.After(supplyIncreaseDates[27]) && blockTime.Before(supplyIncreaseDates[28]) || blockTime.Equal(supplyIncreaseDates[27]): - circSupply = sdkmath.NewInt(155000000) - case blockTime.After(supplyIncreaseDates[28]) && blockTime.Before(supplyIncreaseDates[29]) || blockTime.Equal(supplyIncreaseDates[28]): - circSupply = sdkmath.NewInt(157500000) - case blockTime.After(supplyIncreaseDates[29]) && blockTime.Before(supplyIncreaseDates[30]) || blockTime.Equal(supplyIncreaseDates[29]): - circSupply = sdkmath.NewInt(160000000) - case blockTime.After(supplyIncreaseDates[30]) && blockTime.Before(supplyIncreaseDates[31]) || blockTime.Equal(supplyIncreaseDates[30]): - circSupply = sdkmath.NewInt(164166669) - case blockTime.After(supplyIncreaseDates[31]) && blockTime.Before(supplyIncreaseDates[32]) || blockTime.Equal(supplyIncreaseDates[31]): - circSupply = sdkmath.NewInt(166666669) - case blockTime.After(supplyIncreaseDates[32]) && blockTime.Before(supplyIncreaseDates[33]) || blockTime.Equal(supplyIncreaseDates[32]): - circSupply = sdkmath.NewInt(169166669) - case blockTime.After(supplyIncreaseDates[33]) && blockTime.Before(supplyIncreaseDates[34]) || blockTime.Equal(supplyIncreaseDates[33]): - circSupply = sdkmath.NewInt(173333336) - case blockTime.After(supplyIncreaseDates[34]) && blockTime.Before(supplyIncreaseDates[35]) || blockTime.Equal(supplyIncreaseDates[34]): - circSupply = sdkmath.NewInt(175833336) - case blockTime.After(supplyIncreaseDates[35]) && blockTime.Before(supplyIncreaseDates[36]) || blockTime.Equal(supplyIncreaseDates[35]): - circSupply = sdkmath.NewInt(178333336) // End year THREE - case blockTime.After(supplyIncreaseDates[36]) && blockTime.Before(supplyIncreaseDates[37]) || blockTime.Equal(supplyIncreaseDates[36]): - circSupply = sdkmath.NewInt(181666670) // Start year FOUR - case blockTime.After(supplyIncreaseDates[37]) && blockTime.Before(supplyIncreaseDates[38]) || blockTime.Equal(supplyIncreaseDates[37]): - circSupply = sdkmath.NewInt(183333337) - case blockTime.After(supplyIncreaseDates[38]) && blockTime.Before(supplyIncreaseDates[39]) || blockTime.Equal(supplyIncreaseDates[38]): - circSupply = sdkmath.NewInt(185000000) - case blockTime.After(supplyIncreaseDates[39]) && blockTime.Before(supplyIncreaseDates[40]) || blockTime.Equal(supplyIncreaseDates[39]): - circSupply = sdkmath.NewInt(186666670) - case blockTime.After(supplyIncreaseDates[40]) && blockTime.Before(supplyIncreaseDates[41]) || blockTime.Equal(supplyIncreaseDates[40]): - circSupply = sdkmath.NewInt(188333338) - case blockTime.After(supplyIncreaseDates[41]) && blockTime.Before(supplyIncreaseDates[42]) || blockTime.Equal(supplyIncreaseDates[41]): - circSupply = sdkmath.NewInt(190000000) - case blockTime.After(supplyIncreaseDates[42]) && blockTime.Before(supplyIncreaseDates[43]) || blockTime.Equal(supplyIncreaseDates[42]): - circSupply = sdkmath.NewInt(191666670) - case blockTime.After(supplyIncreaseDates[43]) && blockTime.Before(supplyIncreaseDates[44]) || blockTime.Equal(supplyIncreaseDates[43]): - circSupply = sdkmath.NewInt(193333339) - case blockTime.After(supplyIncreaseDates[44]) && blockTime.Before(supplyIncreaseDates[45]) || blockTime.Equal(supplyIncreaseDates[44]): - circSupply = sdkmath.NewInt(195000000) - case blockTime.After(supplyIncreaseDates[45]) && blockTime.Before(supplyIncreaseDates[46]) || blockTime.Equal(supplyIncreaseDates[45]): - circSupply = sdkmath.NewInt(196666670) - case blockTime.After(supplyIncreaseDates[46]) && blockTime.Before(supplyIncreaseDates[47]) || blockTime.Equal(supplyIncreaseDates[46]): - circSupply = sdkmath.NewInt(198333340) - case blockTime.After(supplyIncreaseDates[47]) && blockTime.Before(supplyIncreaseDates[48]) || blockTime.Equal(supplyIncreaseDates[47]): - circSupply = sdkmath.NewInt(200000000) // End year FOUR - default: - circSupply = sdkmath.NewInt(200000000) - } - - bz, err := legacyQuerierCdc.MarshalJSON(circSupply) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - return bz, nil -} - -func getCirculatingSupplyUSDX(ctx sdk.Context, req abci.RequestQuery, bk types.BankKeeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - totalSupply := bk.GetSupply(ctx, "usdx").Amount - supplyInt := sdk.NewDecFromInt(totalSupply).Mul(sdk.MustNewDecFromStr("0.000001")).TruncateInt64() - bz, err := legacyQuerierCdc.MarshalJSON(supplyInt) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - return bz, nil -} - -func getCirculatingSupplySWP(ctx sdk.Context, req abci.RequestQuery, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - // Start values - year := 2021 - month := 8 - - var supplyIncreaseDates []time.Time - - // Add month times for 4 years - for i := 0; i < 12*4; i++ { - // Always day 30 unless it's Feb - day := 30 - if month == 2 { - day = 28 - } - - date := time.Date(year, time.Month(month), day, 15 /* hour */, 0, 0, 0, time.UTC) - supplyIncreaseDates = append(supplyIncreaseDates, date) - - // Update year and month - if month == 12 { - month = 1 - year += 1 - } else { - month += 1 - } - } - - // Repeated tokens released - teamSwp := int64(4_687_500) - treasurySwp := int64(5_859_375) - monthlyStakersSwp := int64(520_833) - monthlyLPIncentivesSwp := int64(2_343_750) - - // []{Ecosystem, Team, Treasury, Kava Stakers, LP Incentives} - scheduleAmounts := [][]int64{ - {12_500_000, 0, 15_625_000, monthlyStakersSwp, monthlyLPIncentivesSwp}, // *** Year ONE *** - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 1 - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 2 - {0, 0, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 3 - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 4 - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 5 - {0, 0, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 6 - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 7 - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 8 - {0, 0, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 9 - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 10 - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 11 - {0, 18_750_000, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // *** Year TWO *** - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 13 - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 14 - {0, teamSwp, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 15 - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 16 - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 17 - {0, teamSwp, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 18 - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 19 - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 20 - {0, teamSwp, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 21 - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 22 - {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 23 - {0, teamSwp, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // *** Year THREE *** - } - - // Months 25-47 are the same - for i := 0; i < 23; i++ { - scheduleAmounts = append(scheduleAmounts, []int64{0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}) - } - - circSupply := sdk.ZeroInt() - blockTime := ctx.BlockTime() - - for i := 0; i < len(scheduleAmounts); i++ { - if blockTime.Before(supplyIncreaseDates[i]) { - break - } - - // Sum up each category of token release - monthTotal := int64(0) - for _, val := range scheduleAmounts[i] { - monthTotal += val - } - - circSupply = circSupply.Add(sdkmath.NewInt(monthTotal)) - } - - bz, err := legacyQuerierCdc.MarshalJSON(circSupply) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - return bz, nil -} - -func getTotalSupplyHARD(ctx sdk.Context, req abci.RequestQuery, bk types.BankKeeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - totalSupply := bk.GetSupply(ctx, "hard").Amount - supplyInt := sdk.NewDecFromInt(totalSupply).Mul(sdk.MustNewDecFromStr("0.000001")).TruncateInt64() - bz, err := legacyQuerierCdc.MarshalJSON(supplyInt) - if err != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) - } - return bz, nil -}