From 257eff3f6c61681950e5171770ba9b5e9bc56e06 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 9 Oct 2020 16:08:02 +0200 Subject: [PATCH 01/84] docs: Update the code.MarshalYAML docs (#7496) --- codec/yaml.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/codec/yaml.go b/codec/yaml.go index 184b539a8a..bba5e90ed8 100644 --- a/codec/yaml.go +++ b/codec/yaml.go @@ -7,20 +7,19 @@ import ( "gopkg.in/yaml.v2" ) -// MarshalYAML marshals the provided toPrint content with the provided JSON marshaler -// by encoding JSON, decoding JSON, and then encoding YAML. +// MarshalYAML marshals toPrint using jsonMarshaler to leverage specialized MarshalJSON methods +// (usually related to serialize data with protobuf or amin depending on a configuration). +// This involves additional roundtrip through JSON. func MarshalYAML(jsonMarshaler JSONMarshaler, toPrint proto.Message) ([]byte, error) { - // only the JSONMarshaler has full context as to how the JSON - // mashalling should look (which may be different for amino & proto codecs) - // so we need to use it to marshal toPrint first + // We are OK with the performance hit of the additional JSON roundtip. MarshalYAML is not + // used in any critical parts of the system. bz, err := jsonMarshaler.MarshalJSON(toPrint) if err != nil { return nil, err } - // generate YAML by decoding and re-encoding JSON as YAML + // generate YAML by decoding JSON and re-encoding to YAML var j interface{} - err = json.Unmarshal(bz, &j) if err != nil { return nil, err From 90579c0a99de4c17b108289b24913cb271c65c7f Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Fri, 9 Oct 2020 11:09:17 -0400 Subject: [PATCH 02/84] ADR 029: Fee Grant Module (#7106) * Add ADR 029 stub * ADR 029 first draft * Cleanup * Updates from code review * Updates from review Co-authored-by: Alessio Treglia --- docs/architecture/README.md | 1 + docs/architecture/adr-029-fee-grant-module.md | 162 ++++++++++++++++++ 2 files changed, 163 insertions(+) create mode 100644 docs/architecture/adr-029-fee-grant-module.md diff --git a/docs/architecture/README.md b/docs/architecture/README.md index b60a1b38a5..2e17fb394e 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -54,3 +54,4 @@ Please add a entry below in your Pull Request for an ADR. - [ADR 025: IBC Passive Channels](./adr-025-ibc-passive-channels.md) - [ADR 026: IBC Client Recovery Mechanisms](./adr-026-ibc-client-recovery-mechanisms.md) - [ADR 027: Deterministic Protobuf Serialization](./adr-027-deterministic-protobuf-serialization.md) +- [ADR 029: Fee Grant Module](./adr-029-fee-grant-module.md) \ No newline at end of file diff --git a/docs/architecture/adr-029-fee-grant-module.md b/docs/architecture/adr-029-fee-grant-module.md new file mode 100644 index 0000000000..8ef0f722fa --- /dev/null +++ b/docs/architecture/adr-029-fee-grant-module.md @@ -0,0 +1,162 @@ +# ADR 029: Fee Grant Module + +## Changelog + +- 2020/08/18: Initial Draft + +## Status + +Accepted + +## Context + +In order to make blockchain transactions, the signing account must possess a sufficient balance of the right denomination +in order to pay fees. There are classes of transactions where needing to maintain a wallet with sufficient fees is a +barrier to adoption. + +For instance, when proper permissions are setup, someone may temporarily delegate the ability to vote on proposals to +a "burner" account that is stored on a mobile phone with only minimal security. + +Other use cases include workers tracking items in a supply chain or farmers submitting field data for analytics +or compliance purposes. + +For all of these use cases, UX would be significantly enhanced by obviating the need for these accounts to always +maintain the appropriate fee balance. This is especially true if we wanted to achieve enterprise adoption for something +like supply chain tracking. + +While one solution would be to have a service that fills up these accounts automatically with the appropriate fees, a better UX +would be provided by allowing these accounts to pull from a common fee pool account with proper spending limits. +A single pool would reduce the churn of making lots of small "fill up" transactions and also more effectively leverages +the resources of the organization setting up the pool. + +## Decision + +As a solution we propose a module, `x/feegrant` which allows one account, the "granter" to grant another account, the "grantee" +an allowance to spend the granter's account balance for fees within certain well-defined limits. + +Fee allowances are defined by the extensible `FeeAllowanceI` interface: + +```go +type FeeAllowanceI { + // Accept can use fee payment requested as well as timestamp/height of the current block + // to determine whether or not to process this. This is checked in + // Keeper.UseGrantedFees and the return values should match how it is handled there. + // + // If it returns an error, the fee payment is rejected, otherwise it is accepted. + // The FeeAllowance implementation is expected to update it's internal state + // and will be saved again after an acceptance. + // + // If remove is true (regardless of the error), the FeeAllowance will be deleted from storage + // (eg. when it is used up). (See call to RevokeFeeAllowance in Keeper.UseGrantedFees) + Accept(fee sdk.Coins, blockTime time.Time, blockHeight int64) (remove bool, err error) +} +``` + +Two basic fee allowance types, `BasicFeeAllowance` and `PeriodicFeeAllowance` are defined to support known use cases: + +```proto +// BasicFeeAllowance implements FeeAllowance with a one-time grant of tokens +// that optionally expires. The delegatee can use up to SpendLimit to cover fees. +message BasicFeeAllowance { + // spend_limit specifies the maximum amount of tokens that can be spent + // by this allowance and will be updated as tokens are spent. If it is + // empty, there is no spend limit and any amount of coins can be spent. + repeated cosmos_sdk.v1.Coin spend_limit = 1; + + // expires_at specifies an optional time when this allowance expires + ExpiresAt expiration = 2; +} + +// PeriodicFeeAllowance extends FeeAllowance to allow for both a maximum cap, +// as well as a limit per time period. +message PeriodicFeeAllowance { + BasicFeeAllowance basic = 1; + + // period specifies the time duration in which period_spend_limit coins can + // be spent before that allowance is reset + Duration period = 2; + + // period_spend_limit specifies the maximum number of coins that can be spent + // in the period + repeated cosmos_sdk.v1.Coin period_spend_limit = 3; + + // period_can_spend is the number of coins left to be spent before the period_reset time + repeated cosmos_sdk.v1.Coin period_can_spend = 4; + + // 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 + ExpiresAt period_reset = 5; +} + +// ExpiresAt is a point in time where something expires. +// It may be *either* block time or block height +message ExpiresAt { + oneof sum { + google.protobuf.Timestamp time = 1; + uint64 height = 2; + } + } + +// Duration is a repeating unit of either clock time or number of blocks. +message Duration { + oneof sum { + google.protobuf.Duration duration = 1; + uint64 blocks = 2; + } +} + +``` + +Allowances can be granted and revoked using `MsgGrantFeeAllowance` and `MsgRevokeFeeAllowance`: + +```proto +message MsgGrantFeeAllowance { + string granter = 1; + string grantee = 2; + google.protobuf.Any allowance = 3; + } + + // MsgRevokeFeeAllowance removes any existing FeeAllowance from Granter to Grantee. + message MsgRevokeFeeAllowance { + string granter = 1; + string grantee = 2; + } +``` + +In order to use allowances in transactions, we add a new field `granter` to the transaction `Fee` type: +```proto +package cosmos.tx.v1beta1; + +message Fee { + repeated cosmos.base.v1beta1.Coin amount = 1; + uint64 gas_limit = 2; + string payer = 3; + string granter = 4; +} +``` + +`granter` must either be left empty or must correspond to an account which has granted +a fee allowance to fee payer (either the first signer or the value of the `payer` field). + +A new `AnteDecorator` named `DeductGrantedFeeDecorator` will be created in order to process transactions with `fee_payer` +set and correctly deduct fees based on fee allowances. + +## Consequences + +### Positive + +- improved UX for use cases where it is cumbersome to maintain an account balance just for fees + +### Negative + +### Neutral + +- a new field must be added to the transaction `Fee` message and a new `AnteDecorator` must be +created to use it + +## References + +- Blog article describing initial work: https://medium.com/regen-network/hacking-the-cosmos-cosmwasm-and-key-management-a08b9f561d1b +- Initial public specification: https://gist.github.com/aaronc/b60628017352df5983791cad30babe56 +- Original subkeys proposal from B-harvest which influenced this design: https://github.com/cosmos/cosmos-sdk/issues/4480 From 278eaa70f8ab36c76f3eb2881afb946027cc3538 Mon Sep 17 00:00:00 2001 From: wimel Date: Fri, 9 Oct 2020 18:28:58 +0200 Subject: [PATCH 03/84] Fix on gov module (#7493) * Fix ISSUE #64 on cosmosdevs/stargate * Fix ISSUE #64 on cosmosdevs/stargate * Update x/upgrade/client/cli/tx.go Co-authored-by: Aleksandr Bezobchuk --- x/upgrade/client/cli/tx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/upgrade/client/cli/tx.go b/x/upgrade/client/cli/tx.go index cbc4597692..9d8609d232 100644 --- a/x/upgrade/client/cli/tx.go +++ b/x/upgrade/client/cli/tx.go @@ -94,7 +94,7 @@ func NewCmdSubmitCancelUpgradeProposal() *cobra.Command { cmd := &cobra.Command{ Use: "cancel-software-upgrade [flags]", Args: cobra.ExactArgs(0), - Short: "Submit a software upgrade proposal", + Short: "Cancel the current software upgrade proposal", Long: "Cancel a software upgrade along with an initial deposit.", RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) From f8e3fcb524745d4fc9cd9ef5db8c48de77e424b7 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Fri, 9 Oct 2020 17:49:57 +0100 Subject: [PATCH 04/84] types: tests -> test suites migration (#7494) --- types/query/filtered_pagination_test.go | 71 +++++++-------- types/query/pagination_test.go | 113 +++++++++++++----------- 2 files changed, 95 insertions(+), 89 deletions(-) diff --git a/types/query/filtered_pagination_test.go b/types/query/filtered_pagination_test.go index 8dc744b08e..dbd2057da4 100644 --- a/types/query/filtered_pagination_test.go +++ b/types/query/filtered_pagination_test.go @@ -2,9 +2,6 @@ package query_test import ( "fmt" - "testing" - - "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" @@ -16,7 +13,7 @@ import ( var addr1 = sdk.AccAddress([]byte("addr1")) -func TestFilteredPaginations(t *testing.T) { +func (s *paginationTestSuite) TestFilteredPaginations() { app, ctx, appCodec := setupTest() var balances sdk.Coins @@ -33,61 +30,61 @@ func TestFilteredPaginations(t *testing.T) { addr1 := sdk.AccAddress([]byte("addr1")) acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1) app.AccountKeeper.SetAccount(ctx, acc1) - require.NoError(t, app.BankKeeper.SetBalances(ctx, addr1, balances)) + s.Require().NoError(app.BankKeeper.SetBalances(ctx, addr1, balances)) store := ctx.KVStore(app.GetKey(authtypes.StoreKey)) // verify pagination with limit > total values pageReq := &query.PageRequest{Key: nil, Limit: 5, CountTotal: true} balances, res, err := execFilterPaginate(store, pageReq, appCodec) - require.NoError(t, err) - require.NotNil(t, res) - require.Equal(t, 4, len(balances)) + s.Require().NoError(err) + s.Require().NotNil(res) + s.Require().Equal(4, len(balances)) - t.Log("verify empty request") + s.T().Log("verify empty request") balances, res, err = execFilterPaginate(store, nil, appCodec) - require.NoError(t, err) - require.NotNil(t, res) - require.Equal(t, 4, len(balances)) - require.Equal(t, uint64(4), res.Total) - require.Nil(t, res.NextKey) + s.Require().NoError(err) + s.Require().NotNil(res) + s.Require().Equal(4, len(balances)) + s.Require().Equal(uint64(4), res.Total) + s.Require().Nil(res.NextKey) - t.Log("verify nextKey is returned if there are more results") + s.T().Log("verify nextKey is returned if there are more results") pageReq = &query.PageRequest{Key: nil, Limit: 2, CountTotal: true} balances, res, err = execFilterPaginate(store, pageReq, appCodec) - require.NoError(t, err) - require.NotNil(t, res) - require.Equal(t, 2, len(balances)) - require.NotNil(t, res.NextKey) - require.Equal(t, string(res.NextKey), fmt.Sprintf("test2denom")) - require.Equal(t, uint64(4), res.Total) + s.Require().NoError(err) + s.Require().NotNil(res) + s.Require().Equal(2, len(balances)) + s.Require().NotNil(res.NextKey) + s.Require().Equal(string(res.NextKey), fmt.Sprintf("test2denom")) + s.Require().Equal(uint64(4), res.Total) - t.Log("verify both key and offset can't be given") + s.T().Log("verify both key and offset can't be given") pageReq = &query.PageRequest{Key: res.NextKey, Limit: 1, Offset: 2, CountTotal: true} _, _, err = execFilterPaginate(store, pageReq, appCodec) - require.Error(t, err) + s.Require().Error(err) - t.Log("use nextKey for query") + s.T().Log("use nextKey for query") pageReq = &query.PageRequest{Key: res.NextKey, Limit: 2, CountTotal: true} balances, res, err = execFilterPaginate(store, pageReq, appCodec) - require.NoError(t, err) - require.NotNil(t, res) - require.Equal(t, 2, len(balances)) - require.Nil(t, res.NextKey) + s.Require().NoError(err) + s.Require().NotNil(res) + s.Require().Equal(2, len(balances)) + s.Require().Nil(res.NextKey) - t.Log("verify default limit") + s.T().Log("verify default limit") pageReq = &query.PageRequest{Key: nil, Limit: 0} balances, res, err = execFilterPaginate(store, pageReq, appCodec) - require.NoError(t, err) - require.NotNil(t, res) - require.Equal(t, 4, len(balances)) - require.Equal(t, uint64(4), res.Total) + s.Require().NoError(err) + s.Require().NotNil(res) + s.Require().Equal(4, len(balances)) + s.Require().Equal(uint64(4), res.Total) - t.Log("verify with offset") + s.T().Log("verify with offset") pageReq = &query.PageRequest{Offset: 2, Limit: 2} balances, res, err = execFilterPaginate(store, pageReq, appCodec) - require.NoError(t, err) - require.NotNil(t, res) - require.LessOrEqual(t, len(balances), 2) + s.Require().NoError(err) + s.Require().NotNil(res) + s.Require().LessOrEqual(len(balances), 2) } func ExampleFilteredPaginate() { diff --git a/types/query/pagination_test.go b/types/query/pagination_test.go index 9927adce6c..0961bcbd61 100644 --- a/types/query/pagination_test.go +++ b/types/query/pagination_test.go @@ -5,7 +5,8 @@ import ( "fmt" "testing" - "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" @@ -34,7 +35,15 @@ const ( lastPageRecords = 35 ) -func TestPagination(t *testing.T) { +type paginationTestSuite struct { + suite.Suite +} + +func TestPaginationTestSuite(t *testing.T) { + suite.Run(t, new(paginationTestSuite)) +} + +func (s *paginationTestSuite) TestPagination() { app, ctx, _ := setupTest() queryHelper := baseapp.NewQueryServerTestHelper(ctx, app.InterfaceRegistry()) types.RegisterQueryServer(queryHelper, app.BankKeeper) @@ -50,96 +59,96 @@ func TestPagination(t *testing.T) { addr1 := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1) app.AccountKeeper.SetAccount(ctx, acc1) - require.NoError(t, app.BankKeeper.SetBalances(ctx, addr1, balances)) + s.Require().NoError(app.BankKeeper.SetBalances(ctx, addr1, balances)) - t.Log("verify empty page request results a max of defaultLimit records and counts total records") + s.T().Log("verify empty page request results a max of defaultLimit records and counts total records") pageReq := &query.PageRequest{} request := types.NewQueryAllBalancesRequest(addr1, pageReq) res, err := queryClient.AllBalances(gocontext.Background(), request) - require.NoError(t, err) - require.Equal(t, res.Pagination.Total, uint64(numBalances)) - require.NotNil(t, res.Pagination.NextKey) - require.LessOrEqual(t, res.Balances.Len(), defaultLimit) + s.Require().NoError(err) + s.Require().Equal(res.Pagination.Total, uint64(numBalances)) + s.Require().NotNil(res.Pagination.NextKey) + s.Require().LessOrEqual(res.Balances.Len(), defaultLimit) - t.Log("verify page request with limit > defaultLimit, returns less or equal to `limit` records") + s.T().Log("verify page request with limit > defaultLimit, returns less or equal to `limit` records") pageReq = &query.PageRequest{Limit: overLimit} request = types.NewQueryAllBalancesRequest(addr1, pageReq) res, err = queryClient.AllBalances(gocontext.Background(), request) - require.NoError(t, err) - require.Equal(t, res.Pagination.Total, uint64(0)) - require.NotNil(t, res.Pagination.NextKey) - require.LessOrEqual(t, res.Balances.Len(), overLimit) + s.Require().NoError(err) + s.Require().Equal(res.Pagination.Total, uint64(0)) + s.Require().NotNil(res.Pagination.NextKey) + s.Require().LessOrEqual(res.Balances.Len(), overLimit) - t.Log("verify paginate with custom limit and countTotal true") + s.T().Log("verify paginate with custom limit and countTotal true") pageReq = &query.PageRequest{Limit: underLimit, CountTotal: true} request = types.NewQueryAllBalancesRequest(addr1, pageReq) res, err = queryClient.AllBalances(gocontext.Background(), request) - require.NoError(t, err) - require.Equal(t, res.Balances.Len(), underLimit) - require.NotNil(t, res.Pagination.NextKey) - require.Equal(t, res.Pagination.Total, uint64(numBalances)) + s.Require().NoError(err) + s.Require().Equal(res.Balances.Len(), underLimit) + s.Require().NotNil(res.Pagination.NextKey) + s.Require().Equal(res.Pagination.Total, uint64(numBalances)) - t.Log("verify paginate with custom limit and countTotal false") + s.T().Log("verify paginate with custom limit and countTotal false") pageReq = &query.PageRequest{Limit: defaultLimit, CountTotal: false} request = types.NewQueryAllBalancesRequest(addr1, pageReq) res, err = queryClient.AllBalances(gocontext.Background(), request) - require.NoError(t, err) - require.Equal(t, res.Balances.Len(), defaultLimit) - require.NotNil(t, res.Pagination.NextKey) - require.Equal(t, res.Pagination.Total, uint64(0)) + s.Require().NoError(err) + s.Require().Equal(res.Balances.Len(), defaultLimit) + s.Require().NotNil(res.Pagination.NextKey) + s.Require().Equal(res.Pagination.Total, uint64(0)) - t.Log("verify paginate with custom limit, key and countTotal false") + s.T().Log("verify paginate with custom limit, key and countTotal false") pageReq = &query.PageRequest{Key: res.Pagination.NextKey, Limit: defaultLimit, CountTotal: false} request = types.NewQueryAllBalancesRequest(addr1, pageReq) res, err = queryClient.AllBalances(gocontext.Background(), request) - require.NoError(t, err) - require.Equal(t, res.Balances.Len(), defaultLimit) - require.NotNil(t, res.Pagination.NextKey) - require.Equal(t, res.Pagination.Total, uint64(0)) + s.Require().NoError(err) + s.Require().Equal(res.Balances.Len(), defaultLimit) + s.Require().NotNil(res.Pagination.NextKey) + s.Require().Equal(res.Pagination.Total, uint64(0)) - t.Log("verify paginate for last page, results in records less than max limit") + s.T().Log("verify paginate for last page, results in records less than max limit") pageReq = &query.PageRequest{Key: res.Pagination.NextKey, Limit: defaultLimit, CountTotal: false} request = types.NewQueryAllBalancesRequest(addr1, pageReq) res, err = queryClient.AllBalances(gocontext.Background(), request) - require.NoError(t, err) - require.LessOrEqual(t, res.Balances.Len(), defaultLimit) - require.Equal(t, res.Balances.Len(), lastPageRecords) - require.Nil(t, res.Pagination.NextKey) - require.Equal(t, res.Pagination.Total, uint64(0)) + s.Require().NoError(err) + s.Require().LessOrEqual(res.Balances.Len(), defaultLimit) + s.Require().Equal(res.Balances.Len(), lastPageRecords) + s.Require().Nil(res.Pagination.NextKey) + s.Require().Equal(res.Pagination.Total, uint64(0)) - t.Log("verify paginate with offset and limit") + s.T().Log("verify paginate with offset and limit") pageReq = &query.PageRequest{Offset: 200, Limit: defaultLimit, CountTotal: false} request = types.NewQueryAllBalancesRequest(addr1, pageReq) res, err = queryClient.AllBalances(gocontext.Background(), request) - require.NoError(t, err) - require.LessOrEqual(t, res.Balances.Len(), defaultLimit) - require.Equal(t, res.Balances.Len(), lastPageRecords) - require.Nil(t, res.Pagination.NextKey) - require.Equal(t, res.Pagination.Total, uint64(0)) + s.Require().NoError(err) + s.Require().LessOrEqual(res.Balances.Len(), defaultLimit) + s.Require().Equal(res.Balances.Len(), lastPageRecords) + s.Require().Nil(res.Pagination.NextKey) + s.Require().Equal(res.Pagination.Total, uint64(0)) - t.Log("verify paginate with offset and limit") + s.T().Log("verify paginate with offset and limit") pageReq = &query.PageRequest{Offset: 100, Limit: defaultLimit, CountTotal: false} request = types.NewQueryAllBalancesRequest(addr1, pageReq) res, err = queryClient.AllBalances(gocontext.Background(), request) - require.NoError(t, err) - require.LessOrEqual(t, res.Balances.Len(), defaultLimit) - require.NotNil(t, res.Pagination.NextKey) - require.Equal(t, res.Pagination.Total, uint64(0)) + s.Require().NoError(err) + s.Require().LessOrEqual(res.Balances.Len(), defaultLimit) + s.Require().NotNil(res.Pagination.NextKey) + s.Require().Equal(res.Pagination.Total, uint64(0)) - t.Log("verify paginate with offset and key - error") + s.T().Log("verify paginate with offset and key - error") pageReq = &query.PageRequest{Key: res.Pagination.NextKey, Offset: 100, Limit: defaultLimit, CountTotal: false} request = types.NewQueryAllBalancesRequest(addr1, pageReq) res, err = queryClient.AllBalances(gocontext.Background(), request) - require.Error(t, err) - require.Equal(t, err.Error(), "invalid request, either offset or key is expected, got both") + s.Require().Error(err) + s.Require().Equal(err.Error(), "invalid request, either offset or key is expected, got both") - t.Log("verify paginate with offset greater than total results") + s.T().Log("verify paginate with offset greater than total results") pageReq = &query.PageRequest{Offset: 300, Limit: defaultLimit, CountTotal: false} request = types.NewQueryAllBalancesRequest(addr1, pageReq) res, err = queryClient.AllBalances(gocontext.Background(), request) - require.NoError(t, err) - require.LessOrEqual(t, res.Balances.Len(), 0) - require.Nil(t, res.Pagination.NextKey) + s.Require().NoError(err) + s.Require().LessOrEqual(res.Balances.Len(), 0) + s.Require().Nil(res.Pagination.NextKey) } func ExamplePaginate() { From c14a3a7cb2970766be574f2f26639420fa242b4b Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Fri, 9 Oct 2020 21:09:43 +0200 Subject: [PATCH 05/84] CLI `migrate` command follow-up: decode & re-encode (#7464) * Migrate staking module * Add gov legacy * Add comments * Add x/distrib * x/crisis * x/mint * Fix test * migrate x/genutil * Fix lint * Fix staking constants * Fix test * Update x/genutil/legacy/v040/migrate.go Co-authored-by: Marie Gauthier * Add migrate script instead of change BondStatus constants * Fix test * Fix another test Co-authored-by: Marie Gauthier Co-authored-by: Cory --- x/auth/legacy/v040/migrate.go | 1 + x/bank/legacy/v040/migrate.go | 1 + x/crisis/legacy/v039/types.go | 13 +++ x/crisis/legacy/v040/migrate.go | 16 +++ x/crisis/legacy/v040/types.go | 5 + x/distribution/legacy/v040/migrate.go | 108 +++++++++++++++++++ x/distribution/legacy/v040/types.go | 6 ++ x/evidence/legacy/v040/migrate.go | 58 +++++----- x/evidence/legacy/v040/migrate_test.go | 2 +- x/genaccounts/legacy/v036/migrate.go | 4 +- x/genutil/legacy/v039/types.go | 12 +++ x/genutil/legacy/v040/migrate.go | 105 +++++++++++++++++- x/genutil/legacy/v040/types.go | 5 + x/gov/legacy/v040/migrate.go | 141 +++++++++++++++++++++++++ x/gov/legacy/v040/types.go | 6 ++ x/mint/legacy/v039/types.go | 31 ++++++ x/mint/legacy/v040/migrate.go | 27 +++++ x/mint/legacy/v040/types.go | 5 + x/slashing/legacy/v040/migrate.go | 2 + x/staking/legacy/v034/types.go | 18 +++- x/staking/legacy/v036/types.go | 4 +- x/staking/legacy/v038/types.go | 22 +++- x/staking/legacy/v040/migrate.go | 137 ++++++++++++++++++++++++ x/staking/legacy/v040/migrate_test.go | 93 ++++++++++++++++ x/staking/legacy/v040/types.go | 5 + 25 files changed, 786 insertions(+), 41 deletions(-) create mode 100644 x/crisis/legacy/v039/types.go create mode 100644 x/crisis/legacy/v040/migrate.go create mode 100644 x/crisis/legacy/v040/types.go create mode 100644 x/distribution/legacy/v040/migrate.go create mode 100644 x/distribution/legacy/v040/types.go create mode 100644 x/genutil/legacy/v039/types.go create mode 100644 x/genutil/legacy/v040/types.go create mode 100644 x/gov/legacy/v040/migrate.go create mode 100644 x/gov/legacy/v040/types.go create mode 100644 x/mint/legacy/v039/types.go create mode 100644 x/mint/legacy/v040/migrate.go create mode 100644 x/mint/legacy/v040/types.go create mode 100644 x/staking/legacy/v040/migrate.go create mode 100644 x/staking/legacy/v040/migrate_test.go create mode 100644 x/staking/legacy/v040/types.go diff --git a/x/auth/legacy/v040/migrate.go b/x/auth/legacy/v040/migrate.go index 4fe663a48d..3d335804a5 100644 --- a/x/auth/legacy/v040/migrate.go +++ b/x/auth/legacy/v040/migrate.go @@ -47,6 +47,7 @@ func convertBaseVestingAccount(old *v039auth.BaseVestingAccount) *v040vesting.Ba // it to v0.40 x/auth genesis state. The migration includes: // // - Removing coins from account encoding. +// - Re-encode in v0.40 GenesisState. func Migrate(authGenState v039auth.GenesisState) *v040auth.GenesisState { // Convert v0.39 accounts to v0.40 ones. var v040Accounts = make([]v040auth.GenesisAccount, len(authGenState.Accounts)) diff --git a/x/bank/legacy/v040/migrate.go b/x/bank/legacy/v040/migrate.go index ba61742764..ab2e596f57 100644 --- a/x/bank/legacy/v040/migrate.go +++ b/x/bank/legacy/v040/migrate.go @@ -12,6 +12,7 @@ import ( // // - Moving balances from x/auth to x/bank genesis state. // - Moving supply from x/supply to x/bank genesis state. +// - Re-encode in v0.40 GenesisState. func Migrate( bankGenState v038bank.GenesisState, authGenState v039auth.GenesisState, diff --git a/x/crisis/legacy/v039/types.go b/x/crisis/legacy/v039/types.go new file mode 100644 index 0000000000..44903e3491 --- /dev/null +++ b/x/crisis/legacy/v039/types.go @@ -0,0 +1,13 @@ +package v039 + +import sdk "github.com/cosmos/cosmos-sdk/types" + +const ( + ModuleName = "crisis" +) + +type ( + GenesisState struct { + ConstantFee sdk.Coin `json:"constant_fee" yaml:"constant_fee"` + } +) diff --git a/x/crisis/legacy/v040/migrate.go b/x/crisis/legacy/v040/migrate.go new file mode 100644 index 0000000000..eb97ba9ee6 --- /dev/null +++ b/x/crisis/legacy/v040/migrate.go @@ -0,0 +1,16 @@ +package v040 + +import ( + v039crisis "github.com/cosmos/cosmos-sdk/x/crisis/legacy/v039" + v040crisis "github.com/cosmos/cosmos-sdk/x/crisis/types" +) + +// Migrate accepts exported v0.39 x/crisis genesis state and +// migrates it to v0.40 x/crisis genesis state. The migration includes: +// +// - Re-encode in v0.40 GenesisState. +func Migrate(crisisGenState v039crisis.GenesisState) *v040crisis.GenesisState { + return &v040crisis.GenesisState{ + ConstantFee: crisisGenState.ConstantFee, + } +} diff --git a/x/crisis/legacy/v040/types.go b/x/crisis/legacy/v040/types.go new file mode 100644 index 0000000000..68c25e93ee --- /dev/null +++ b/x/crisis/legacy/v040/types.go @@ -0,0 +1,5 @@ +package v040 + +const ( + ModuleName = "crisis" +) diff --git a/x/distribution/legacy/v040/migrate.go b/x/distribution/legacy/v040/migrate.go new file mode 100644 index 0000000000..b0ba30bba8 --- /dev/null +++ b/x/distribution/legacy/v040/migrate.go @@ -0,0 +1,108 @@ +package v040 + +import ( + v038distribution "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v038" + v040distribution "github.com/cosmos/cosmos-sdk/x/distribution/types" +) + +// Migrate accepts exported x/distribution genesis state from v0.38 and migrates it +// to v0.40 x/distribution genesis state. The migration includes: +// +// - Convert addresses from bytes to bech32 strings. +// - Re-encode in v0.40 GenesisState. +func Migrate(oldDistributionState v038distribution.GenesisState) *v040distribution.GenesisState { + newDelegatorWithdrawInfos := make([]v040distribution.DelegatorWithdrawInfo, len(oldDistributionState.DelegatorWithdrawInfos)) + for i, oldDelegatorWithdrawInfo := range oldDistributionState.DelegatorWithdrawInfos { + newDelegatorWithdrawInfos[i] = v040distribution.DelegatorWithdrawInfo{ + DelegatorAddress: oldDelegatorWithdrawInfo.DelegatorAddress.String(), + WithdrawAddress: oldDelegatorWithdrawInfo.WithdrawAddress.String(), + } + } + + newValidatorOutstandingRewards := make([]v040distribution.ValidatorOutstandingRewardsRecord, len(oldDistributionState.OutstandingRewards)) + for i, oldValidatorOutstandingReward := range oldDistributionState.OutstandingRewards { + newValidatorOutstandingRewards[i] = v040distribution.ValidatorOutstandingRewardsRecord{ + ValidatorAddress: oldValidatorOutstandingReward.ValidatorAddress.String(), + OutstandingRewards: oldValidatorOutstandingReward.OutstandingRewards, + } + } + + newValidatorAccumulatedCommissions := make([]v040distribution.ValidatorAccumulatedCommissionRecord, len(oldDistributionState.ValidatorAccumulatedCommissions)) + for i, oldValidatorAccumulatedCommission := range oldDistributionState.ValidatorAccumulatedCommissions { + newValidatorAccumulatedCommissions[i] = v040distribution.ValidatorAccumulatedCommissionRecord{ + ValidatorAddress: oldValidatorAccumulatedCommission.ValidatorAddress.String(), + Accumulated: v040distribution.ValidatorAccumulatedCommission{ + Commission: oldValidatorAccumulatedCommission.Accumulated, + }, + } + } + + newValidatorHistoricalRewards := make([]v040distribution.ValidatorHistoricalRewardsRecord, len(oldDistributionState.ValidatorHistoricalRewards)) + for i, oldValidatorHistoricalReward := range oldDistributionState.ValidatorHistoricalRewards { + newValidatorHistoricalRewards[i] = v040distribution.ValidatorHistoricalRewardsRecord{ + ValidatorAddress: oldValidatorHistoricalReward.ValidatorAddress.String(), + Period: oldValidatorHistoricalReward.Period, + Rewards: v040distribution.ValidatorHistoricalRewards{ + CumulativeRewardRatio: oldValidatorHistoricalReward.Rewards.CumulativeRewardRatio, + ReferenceCount: uint32(oldValidatorHistoricalReward.Rewards.ReferenceCount), + }, + } + } + + newValidatorCurrentRewards := make([]v040distribution.ValidatorCurrentRewardsRecord, len(oldDistributionState.ValidatorCurrentRewards)) + for i, oldValidatorCurrentReward := range oldDistributionState.ValidatorCurrentRewards { + newValidatorCurrentRewards[i] = v040distribution.ValidatorCurrentRewardsRecord{ + ValidatorAddress: oldValidatorCurrentReward.ValidatorAddress.String(), + Rewards: v040distribution.ValidatorCurrentRewards{ + Rewards: oldValidatorCurrentReward.Rewards.Rewards, + Period: oldValidatorCurrentReward.Rewards.Period, + }, + } + } + + newDelegatorStartingInfos := make([]v040distribution.DelegatorStartingInfoRecord, len(oldDistributionState.DelegatorStartingInfos)) + for i, oldDelegatorStartingInfo := range oldDistributionState.DelegatorStartingInfos { + newDelegatorStartingInfos[i] = v040distribution.DelegatorStartingInfoRecord{ + DelegatorAddress: oldDelegatorStartingInfo.DelegatorAddress.String(), + ValidatorAddress: oldDelegatorStartingInfo.ValidatorAddress.String(), + StartingInfo: v040distribution.DelegatorStartingInfo{ + PreviousPeriod: oldDelegatorStartingInfo.StartingInfo.PreviousPeriod, + Stake: oldDelegatorStartingInfo.StartingInfo.Stake, + Height: oldDelegatorStartingInfo.StartingInfo.Height, + }, + } + } + + newValidatorSlashEvents := make([]v040distribution.ValidatorSlashEventRecord, len(oldDistributionState.ValidatorSlashEvents)) + for i, oldValidatorSlashEvent := range oldDistributionState.ValidatorSlashEvents { + newValidatorSlashEvents[i] = v040distribution.ValidatorSlashEventRecord{ + ValidatorAddress: oldValidatorSlashEvent.ValidatorAddress.String(), + Height: oldValidatorSlashEvent.Height, + Period: oldValidatorSlashEvent.Period, + ValidatorSlashEvent: v040distribution.ValidatorSlashEvent{ + ValidatorPeriod: oldValidatorSlashEvent.Event.ValidatorPeriod, + Fraction: oldValidatorSlashEvent.Event.Fraction, + }, + } + } + + return &v040distribution.GenesisState{ + Params: v040distribution.Params{ + CommunityTax: oldDistributionState.Params.CommunityTax, + BaseProposerReward: oldDistributionState.Params.BaseProposerReward, + BonusProposerReward: oldDistributionState.Params.BonusProposerReward, + WithdrawAddrEnabled: oldDistributionState.Params.WithdrawAddrEnabled, + }, + FeePool: v040distribution.FeePool{ + CommunityPool: oldDistributionState.FeePool.CommunityPool, + }, + DelegatorWithdrawInfos: newDelegatorWithdrawInfos, + PreviousProposer: oldDistributionState.PreviousProposer.String(), + OutstandingRewards: newValidatorOutstandingRewards, + ValidatorAccumulatedCommissions: newValidatorAccumulatedCommissions, + ValidatorHistoricalRewards: newValidatorHistoricalRewards, + ValidatorCurrentRewards: newValidatorCurrentRewards, + DelegatorStartingInfos: newDelegatorStartingInfos, + ValidatorSlashEvents: newValidatorSlashEvents, + } +} diff --git a/x/distribution/legacy/v040/types.go b/x/distribution/legacy/v040/types.go new file mode 100644 index 0000000000..aa50230380 --- /dev/null +++ b/x/distribution/legacy/v040/types.go @@ -0,0 +1,6 @@ +package v040 + +// Default parameter values +const ( + ModuleName = "distribution" +) diff --git a/x/evidence/legacy/v040/migrate.go b/x/evidence/legacy/v040/migrate.go index 7785cd12e7..f848130f34 100644 --- a/x/evidence/legacy/v040/migrate.go +++ b/x/evidence/legacy/v040/migrate.go @@ -1,46 +1,48 @@ package v040 import ( - "github.com/cosmos/cosmos-sdk/client" + "fmt" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" v038evidence "github.com/cosmos/cosmos-sdk/x/evidence/legacy/v038" v040evidence "github.com/cosmos/cosmos-sdk/x/evidence/types" ) +func migrateEvidence(oldEvidence v038evidence.Evidence) *codectypes.Any { + switch oldEvidence := oldEvidence.(type) { + case v038evidence.Equivocation: + { + newEquivocation := &v040evidence.Equivocation{ + Height: oldEvidence.Height, + Time: oldEvidence.Time, + Power: oldEvidence.Power, + ConsensusAddress: oldEvidence.ConsensusAddress.String(), + } + any, err := codectypes.NewAnyWithValue(newEquivocation) + if err != nil { + panic(err) + } + + return any + } + default: + panic(fmt.Errorf("'%T' is not a valid evidence type", oldEvidence)) + } +} + // Migrate accepts exported v0.38 x/evidence genesis state and migrates it to // v0.40 x/evidence genesis state. The migration includes: // // - Removing the `Params` field. // - Converting Equivocations into Anys. -func Migrate(evidenceState v038evidence.GenesisState, _ client.Context) *v040evidence.GenesisState { - var newEquivocations = make([]v040evidence.Equivocation, len(evidenceState.Evidence)) - for i, evidence := range evidenceState.Evidence { - equivocation, ok := evidence.(v038evidence.Equivocation) - if !ok { - // There's only equivocation in 0.38. - continue - } - - newEquivocations[i] = v040evidence.Equivocation{ - Height: equivocation.Height, - Time: equivocation.Time, - Power: equivocation.Power, - ConsensusAddress: equivocation.ConsensusAddress.String(), - } - } - - // Then convert the equivocations into Any. - newEvidence := make([]*codectypes.Any, len(newEquivocations)) - for i := range newEquivocations { - any, err := codectypes.NewAnyWithValue(&newEquivocations[i]) - if err != nil { - panic(err) - } - - newEvidence[i] = any +// - Re-encode in v0.40 GenesisState. +func Migrate(evidenceState v038evidence.GenesisState) *v040evidence.GenesisState { + var newEvidences = make([]*codectypes.Any, len(evidenceState.Evidence)) + for i, oldEvidence := range evidenceState.Evidence { + newEvidences[i] = migrateEvidence(oldEvidence) } return &v040evidence.GenesisState{ - Evidence: newEvidence, + Evidence: newEvidences, } } diff --git a/x/evidence/legacy/v040/migrate_test.go b/x/evidence/legacy/v040/migrate_test.go index dcbe77e487..a9c23093f4 100644 --- a/x/evidence/legacy/v040/migrate_test.go +++ b/x/evidence/legacy/v040/migrate_test.go @@ -31,7 +31,7 @@ func TestMigrate(t *testing.T) { }}, } - migrated := v040evidence.Migrate(evidenceGenState, clientCtx) + migrated := v040evidence.Migrate(evidenceGenState) expected := `{"evidence":[{"@type":"/cosmos.evidence.v1beta1.Equivocation","height":"20","time":"0001-01-01T00:00:00Z","power":"100","consensus_address":"cosmosvalcons1xxkueklal9vejv9unqu80w9vptyepfa99x2a3w"}]}` bz, err := clientCtx.JSONMarshaler.MarshalJSON(migrated) diff --git a/x/genaccounts/legacy/v036/migrate.go b/x/genaccounts/legacy/v036/migrate.go index 8dff3e4547..4da938aeaf 100644 --- a/x/genaccounts/legacy/v036/migrate.go +++ b/x/genaccounts/legacy/v036/migrate.go @@ -90,10 +90,10 @@ func Migrate( // get staking module accounts coins for _, validator := range vals { switch validator.Status { - case sdk.Bonded: + case v034staking.Bonded: bondedAmt = bondedAmt.Add(validator.Tokens) - case sdk.Unbonding, sdk.Unbonded: + case v034staking.Unbonding, v034staking.Unbonded: notBondedAmt = notBondedAmt.Add(validator.Tokens) default: diff --git a/x/genutil/legacy/v039/types.go b/x/genutil/legacy/v039/types.go new file mode 100644 index 0000000000..12d082d1bc --- /dev/null +++ b/x/genutil/legacy/v039/types.go @@ -0,0 +1,12 @@ +package v039 + +import "encoding/json" + +const ( + ModuleName = "genutil" +) + +// GenesisState defines the raw genesis transaction in JSON +type GenesisState struct { + GenTxs []json.RawMessage `json:"gentxs" yaml:"gentxs"` +} diff --git a/x/genutil/legacy/v040/migrate.go b/x/genutil/legacy/v040/migrate.go index 121c24b0c1..c07bcdb742 100644 --- a/x/genutil/legacy/v040/migrate.go +++ b/x/genutil/legacy/v040/migrate.go @@ -9,13 +9,30 @@ import ( v036supply "github.com/cosmos/cosmos-sdk/x/bank/legacy/v036" v038bank "github.com/cosmos/cosmos-sdk/x/bank/legacy/v038" v040bank "github.com/cosmos/cosmos-sdk/x/bank/legacy/v040" + v039crisis "github.com/cosmos/cosmos-sdk/x/crisis/legacy/v039" + v040crisis "github.com/cosmos/cosmos-sdk/x/crisis/legacy/v040" + v038distribution "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v038" + v040distribution "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v040" v038evidence "github.com/cosmos/cosmos-sdk/x/evidence/legacy/v038" v040evidence "github.com/cosmos/cosmos-sdk/x/evidence/legacy/v040" + v039genutil "github.com/cosmos/cosmos-sdk/x/genutil/legacy/v039" "github.com/cosmos/cosmos-sdk/x/genutil/types" + v036gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v036" + v040gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v040" + v039mint "github.com/cosmos/cosmos-sdk/x/mint/legacy/v039" + v040mint "github.com/cosmos/cosmos-sdk/x/mint/legacy/v040" v039slashing "github.com/cosmos/cosmos-sdk/x/slashing/legacy/v039" v040slashing "github.com/cosmos/cosmos-sdk/x/slashing/legacy/v040" + v038staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v038" + v040staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v040" ) +func migrateGenutil(oldGenState v039genutil.GenesisState) *types.GenesisState { + return &types.GenesisState{ + GenTxs: oldGenState.GenTxs, + } +} + // Migrate migrates exported state from v0.39 to a v0.40 genesis state. func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { v039Codec := codec.NewLegacyAmino() @@ -62,6 +79,34 @@ func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { appState[v040auth.ModuleName] = v040Codec.MustMarshalJSON(v040auth.Migrate(authGenState)) } + // Migrate x/crisis. + if appState[v039crisis.ModuleName] != nil { + // unmarshal relative source genesis application state + var crisisGenState v039crisis.GenesisState + v039Codec.MustUnmarshalJSON(appState[v039crisis.ModuleName], &crisisGenState) + + // delete deprecated x/crisis genesis state + delete(appState, v039crisis.ModuleName) + + // Migrate relative source genesis application state and marshal it into + // the respective key. + appState[v040crisis.ModuleName] = v040Codec.MustMarshalJSON(v040crisis.Migrate(crisisGenState)) + } + + // Migrate x/distribution. + if appState[v038distribution.ModuleName] != nil { + // unmarshal relative source genesis application state + var distributionGenState v038distribution.GenesisState + v039Codec.MustUnmarshalJSON(appState[v038distribution.ModuleName], &distributionGenState) + + // delete deprecated x/distribution genesis state + delete(appState, v038distribution.ModuleName) + + // Migrate relative source genesis application state and marshal it into + // the respective key. + appState[v040distribution.ModuleName] = v040Codec.MustMarshalJSON(v040distribution.Migrate(distributionGenState)) + } + // Migrate x/evidence. if appState[v038evidence.ModuleName] != nil { // unmarshal relative source genesis application state @@ -73,7 +118,35 @@ func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { // Migrate relative source genesis application state and marshal it into // the respective key. - appState[v040evidence.ModuleName] = v040Codec.MustMarshalJSON(v040evidence.Migrate(evidenceGenState, clientCtx)) + appState[v040evidence.ModuleName] = v040Codec.MustMarshalJSON(v040evidence.Migrate(evidenceGenState)) + } + + // Migrate x/gov. + if appState[v036gov.ModuleName] != nil { + // unmarshal relative source genesis application state + var govGenState v036gov.GenesisState + v039Codec.MustUnmarshalJSON(appState[v036gov.ModuleName], &govGenState) + + // delete deprecated x/gov genesis state + delete(appState, v036gov.ModuleName) + + // Migrate relative source genesis application state and marshal it into + // the respective key. + appState[v040gov.ModuleName] = v040Codec.MustMarshalJSON(v040gov.Migrate(govGenState)) + } + + // Migrate x/mint. + if appState[v039mint.ModuleName] != nil { + // unmarshal relative source genesis application state + var mintGenState v039mint.GenesisState + v039Codec.MustUnmarshalJSON(appState[v039mint.ModuleName], &mintGenState) + + // delete deprecated x/mint genesis state + delete(appState, v039mint.ModuleName) + + // Migrate relative source genesis application state and marshal it into + // the respective key. + appState[v040mint.ModuleName] = v040Codec.MustMarshalJSON(v040mint.Migrate(mintGenState)) } // Migrate x/slashing. @@ -82,7 +155,7 @@ func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { var slashingGenState v039slashing.GenesisState v039Codec.MustUnmarshalJSON(appState[v039slashing.ModuleName], &slashingGenState) - // delete deprecated x/evidence genesis state + // delete deprecated x/slashing genesis state delete(appState, v039slashing.ModuleName) // Migrate relative source genesis application state and marshal it into @@ -90,5 +163,33 @@ func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { appState[v040slashing.ModuleName] = v040Codec.MustMarshalJSON(v040slashing.Migrate(slashingGenState)) } + // Migrate x/staking. + if appState[v038staking.ModuleName] != nil { + // unmarshal relative source genesis application state + var stakingGenState v038staking.GenesisState + v039Codec.MustUnmarshalJSON(appState[v038staking.ModuleName], &stakingGenState) + + // delete deprecated x/staking genesis state + delete(appState, v038staking.ModuleName) + + // Migrate relative source genesis application state and marshal it into + // the respective key. + appState[v040staking.ModuleName] = v040Codec.MustMarshalJSON(v040staking.Migrate(stakingGenState)) + } + + // Migrate x/genutil + if appState[v039genutil.ModuleName] != nil { + // unmarshal relative source genesis application state + var genutilGenState v039genutil.GenesisState + v039Codec.MustUnmarshalJSON(appState[v039genutil.ModuleName], &genutilGenState) + + // delete deprecated x/staking genesis state + delete(appState, v039genutil.ModuleName) + + // Migrate relative source genesis application state and marshal it into + // the respective key. + appState[ModuleName] = v040Codec.MustMarshalJSON(migrateGenutil(genutilGenState)) + } + return appState } diff --git a/x/genutil/legacy/v040/types.go b/x/genutil/legacy/v040/types.go new file mode 100644 index 0000000000..f641dbff51 --- /dev/null +++ b/x/genutil/legacy/v040/types.go @@ -0,0 +1,5 @@ +package v040 + +const ( + ModuleName = "genutil" +) diff --git a/x/gov/legacy/v040/migrate.go b/x/gov/legacy/v040/migrate.go new file mode 100644 index 0000000000..73ee066dd6 --- /dev/null +++ b/x/gov/legacy/v040/migrate.go @@ -0,0 +1,141 @@ +package v040 + +import ( + "fmt" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + v034gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v034" + v036gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v036" + v040gov "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +func migrateVoteOption(oldVoteOption v034gov.VoteOption) v040gov.VoteOption { + switch oldVoteOption { + case v034gov.OptionEmpty: + return v040gov.OptionEmpty + + case v034gov.OptionYes: + return v040gov.OptionYes + + case v034gov.OptionAbstain: + return v040gov.OptionAbstain + + case v034gov.OptionNo: + return v040gov.OptionNo + + case v034gov.OptionNoWithVeto: + return v040gov.OptionNoWithVeto + + default: + panic(fmt.Errorf("'%s' is not a valid vote option", oldVoteOption)) + } +} + +func migrateProposalStatus(oldProposalStatus v034gov.ProposalStatus) v040gov.ProposalStatus { + switch oldProposalStatus { + + case v034gov.StatusNil: + return v040gov.StatusNil + + case v034gov.StatusDepositPeriod: + return v040gov.StatusDepositPeriod + + case v034gov.StatusVotingPeriod: + return v040gov.StatusVotingPeriod + + case v034gov.StatusPassed: + return v040gov.StatusPassed + + case v034gov.StatusRejected: + return v040gov.StatusRejected + + case v034gov.StatusFailed: + return v040gov.StatusFailed + + default: + panic(fmt.Errorf("'%s' is not a valid proposal status", oldProposalStatus)) + } +} + +func migrateContent(oldContent v036gov.Content) *codectypes.Any { + switch oldContent := oldContent.(type) { + case *v040gov.TextProposal: + { + // Convert the content into Any. + contentAny, err := codectypes.NewAnyWithValue(oldContent) + if err != nil { + panic(err) + } + + return contentAny + } + default: + panic(fmt.Errorf("'%T' is not a valid proposal content type", oldContent)) + } +} + +// Migrate accepts exported v0.36 x/gov genesis state and migrates it to +// v0.40 x/gov genesis state. The migration includes: +// +// - Convert vote option & proposal status from byte to enum. +// - Migrate proposal content to Any. +// - Convert addresses from bytes to bech32 strings. +// - Re-encode in v0.40 GenesisState. +func Migrate(oldGovState v036gov.GenesisState) *v040gov.GenesisState { + newDeposits := make([]v040gov.Deposit, len(oldGovState.Deposits)) + for i, oldDeposit := range oldGovState.Deposits { + newDeposits[i] = v040gov.Deposit{ + ProposalId: oldDeposit.ProposalID, + Depositor: oldDeposit.Depositor.String(), + Amount: oldDeposit.Amount, + } + } + + newVotes := make([]v040gov.Vote, len(oldGovState.Votes)) + for i, oldVote := range oldGovState.Votes { + newVotes[i] = v040gov.Vote{ + ProposalId: oldVote.ProposalID, + Voter: oldVote.Voter.String(), + Option: migrateVoteOption(oldVote.Option), + } + } + + newProposals := make([]v040gov.Proposal, len(oldGovState.Proposals)) + for i, oldProposal := range oldGovState.Proposals { + newProposals[i] = v040gov.Proposal{ + ProposalId: oldProposal.ProposalID, + Content: migrateContent(oldProposal.Content), + Status: migrateProposalStatus(oldProposal.Status), + FinalTallyResult: v040gov.TallyResult{ + Yes: oldProposal.FinalTallyResult.Yes, + Abstain: oldProposal.FinalTallyResult.Abstain, + No: oldProposal.FinalTallyResult.No, + NoWithVeto: oldProposal.FinalTallyResult.NoWithVeto, + }, + SubmitTime: oldProposal.SubmitTime, + DepositEndTime: oldProposal.DepositEndTime, + TotalDeposit: oldProposal.TotalDeposit, + VotingStartTime: oldProposal.VotingStartTime, + VotingEndTime: oldProposal.VotingEndTime, + } + } + + return &v040gov.GenesisState{ + StartingProposalId: oldGovState.StartingProposalID, + Deposits: newDeposits, + Votes: newVotes, + Proposals: newProposals, + DepositParams: v040gov.DepositParams{ + MinDeposit: oldGovState.DepositParams.MinDeposit, + MaxDepositPeriod: oldGovState.DepositParams.MaxDepositPeriod, + }, + VotingParams: v040gov.VotingParams{ + VotingPeriod: oldGovState.VotingParams.VotingPeriod, + }, + TallyParams: v040gov.TallyParams{ + Quorum: oldGovState.TallyParams.Quorum, + Threshold: oldGovState.TallyParams.Threshold, + VetoThreshold: oldGovState.TallyParams.Veto, + }, + } +} diff --git a/x/gov/legacy/v040/types.go b/x/gov/legacy/v040/types.go new file mode 100644 index 0000000000..27f668b2e1 --- /dev/null +++ b/x/gov/legacy/v040/types.go @@ -0,0 +1,6 @@ +package v040 + +// Default parameter values +const ( + ModuleName = "gov" +) diff --git a/x/mint/legacy/v039/types.go b/x/mint/legacy/v039/types.go new file mode 100644 index 0000000000..10b351b7fb --- /dev/null +++ b/x/mint/legacy/v039/types.go @@ -0,0 +1,31 @@ +package v039 + +import sdk "github.com/cosmos/cosmos-sdk/types" + +const ( + ModuleName = "mint" +) + +type ( + // Minter represents the minting state. + Minter struct { + Inflation sdk.Dec `json:"inflation" yaml:"inflation"` // current annual inflation rate + AnnualProvisions sdk.Dec `json:"annual_provisions" yaml:"annual_provisions"` // current annual expected provisions + } + + // mint parameters + Params struct { + MintDenom string `json:"mint_denom" yaml:"mint_denom"` // type of coin to mint + InflationRateChange sdk.Dec `json:"inflation_rate_change" yaml:"inflation_rate_change"` // maximum annual change in inflation rate + InflationMax sdk.Dec `json:"inflation_max" yaml:"inflation_max"` // maximum inflation rate + InflationMin sdk.Dec `json:"inflation_min" yaml:"inflation_min"` // minimum inflation rate + GoalBonded sdk.Dec `json:"goal_bonded" yaml:"goal_bonded"` // goal of percent bonded atoms + BlocksPerYear uint64 `json:"blocks_per_year" yaml:"blocks_per_year"` // expected blocks per year + } + + // GenesisState - minter state + GenesisState struct { + Minter Minter `json:"minter" yaml:"minter"` // minter object + Params Params `json:"params" yaml:"params"` // inflation params + } +) diff --git a/x/mint/legacy/v040/migrate.go b/x/mint/legacy/v040/migrate.go new file mode 100644 index 0000000000..b417c68289 --- /dev/null +++ b/x/mint/legacy/v040/migrate.go @@ -0,0 +1,27 @@ +package v040 + +import ( + v039mint "github.com/cosmos/cosmos-sdk/x/mint/legacy/v039" + v040mint "github.com/cosmos/cosmos-sdk/x/mint/types" +) + +// Migrate accepts exported v0.39 x/mint genesis state and +// migrates it to v0.40 x/mint genesis state. The migration includes: +// +// - Re-encode in v0.40 GenesisState. +func Migrate(mintGenState v039mint.GenesisState) *v040mint.GenesisState { + return &v040mint.GenesisState{ + Minter: v040mint.Minter{ + Inflation: mintGenState.Minter.Inflation, + AnnualProvisions: mintGenState.Minter.AnnualProvisions, + }, + Params: v040mint.Params{ + MintDenom: mintGenState.Params.MintDenom, + InflationRateChange: mintGenState.Params.InflationRateChange, + InflationMax: mintGenState.Params.InflationMax, + InflationMin: mintGenState.Params.InflationMin, + GoalBonded: mintGenState.Params.GoalBonded, + BlocksPerYear: mintGenState.Params.BlocksPerYear, + }, + } +} diff --git a/x/mint/legacy/v040/types.go b/x/mint/legacy/v040/types.go new file mode 100644 index 0000000000..d725b48c34 --- /dev/null +++ b/x/mint/legacy/v040/types.go @@ -0,0 +1,5 @@ +package v040 + +const ( + ModuleName = "mint" +) diff --git a/x/slashing/legacy/v040/migrate.go b/x/slashing/legacy/v040/migrate.go index 4f99af1446..ba494dcad1 100644 --- a/x/slashing/legacy/v040/migrate.go +++ b/x/slashing/legacy/v040/migrate.go @@ -11,6 +11,8 @@ import ( // to v0.40 x/slashing genesis state. The migration includes: // // - Chaning SigningInfos and MissedBlocks from map to array. +// - Convert addresses from bytes to bech32 strings. +// - Re-encode in v0.40 GenesisState. func Migrate(oldGenState v039slashing.GenesisState) *v040slashing.GenesisState { // Note that the two following `for` loop over a map's keys, so are not // deterministic. diff --git a/x/staking/legacy/v034/types.go b/x/staking/legacy/v034/types.go index f062ef2fa1..6e93b7986a 100644 --- a/x/staking/legacy/v034/types.go +++ b/x/staking/legacy/v034/types.go @@ -15,7 +15,21 @@ const ( ModuleName = "staking" ) +// staking constants +const ( + Unbonded BondStatus = 0x00 + Unbonding BondStatus = 0x01 + Bonded BondStatus = 0x02 + + BondStatusUnbonded = "Unbonded" + BondStatusUnbonding = "Unbonding" + BondStatusBonded = "Bonded" +) + type ( + // BondStatus is the status of a validator + BondStatus byte + Pool struct { NotBondedTokens sdk.Int `json:"not_bonded_tokens"` BondedTokens sdk.Int `json:"bonded_tokens"` @@ -51,7 +65,7 @@ type ( OperatorAddress sdk.ValAddress `json:"operator_address"` // the bech32 address of the validator's operator ConsPubKey string `json:"consensus_pubkey"` // the bech32 consensus public key of the validator Jailed bool `json:"jailed"` // has the validator been jailed from bonded status? - Status sdk.BondStatus `json:"status"` // validator status (bonded/unbonding/unbonded) + Status BondStatus `json:"status"` // validator status (bonded/unbonding/unbonded) Tokens sdk.Int `json:"tokens"` // delegated tokens (incl. self-delegation) DelegatorShares sdk.Dec `json:"delegator_shares"` // total shares issued to a validator's delegators Description Description `json:"description"` // description terms for the validator @@ -65,7 +79,7 @@ type ( OperatorAddress sdk.ValAddress `json:"operator_address"` ConsPubKey crypto.PubKey `json:"consensus_pubkey"` Jailed bool `json:"jailed"` - Status sdk.BondStatus `json:"status"` + Status BondStatus `json:"status"` Tokens sdk.Int `json:"tokens"` DelegatorShares sdk.Dec `json:"delegator_shares"` Description Description `json:"description"` diff --git a/x/staking/legacy/v036/types.go b/x/staking/legacy/v036/types.go index 7adc446eb0..6c110bbe57 100644 --- a/x/staking/legacy/v036/types.go +++ b/x/staking/legacy/v036/types.go @@ -32,7 +32,7 @@ type ( OperatorAddress sdk.ValAddress `json:"operator_address" yaml:"operator_address"` ConsPubKey crypto.PubKey `json:"consensus_pubkey" yaml:"consensus_pubkey"` Jailed bool `json:"jailed" yaml:"jailed"` - Status sdk.BondStatus `json:"status" yaml:"status"` + Status v034staking.BondStatus `json:"status" yaml:"status"` Tokens sdk.Int `json:"tokens" yaml:"tokens"` DelegatorShares sdk.Dec `json:"delegator_shares" yaml:"delegator_shares"` Description v034staking.Description `json:"description" yaml:"description"` @@ -46,7 +46,7 @@ type ( OperatorAddress sdk.ValAddress `json:"operator_address" yaml:"operator_address"` ConsPubKey string `json:"consensus_pubkey" yaml:"consensus_pubkey"` Jailed bool `json:"jailed" yaml:"jailed"` - Status sdk.BondStatus `json:"status" yaml:"status"` + Status v034staking.BondStatus `json:"status" yaml:"status"` Tokens sdk.Int `json:"tokens" yaml:"tokens"` DelegatorShares sdk.Dec `json:"delegator_shares" yaml:"delegator_shares"` Description v034staking.Description `json:"description" yaml:"description"` diff --git a/x/staking/legacy/v038/types.go b/x/staking/legacy/v038/types.go index def28b31cb..aff9a559d4 100644 --- a/x/staking/legacy/v038/types.go +++ b/x/staking/legacy/v038/types.go @@ -30,7 +30,7 @@ type ( OperatorAddress sdk.ValAddress `json:"operator_address" yaml:"operator_address"` ConsPubKey crypto.PubKey `json:"consensus_pubkey" yaml:"consensus_pubkey"` Jailed bool `json:"jailed" yaml:"jailed"` - Status sdk.BondStatus `json:"status" yaml:"status"` + Status v034staking.BondStatus `json:"status" yaml:"status"` Tokens sdk.Int `json:"tokens" yaml:"tokens"` DelegatorShares sdk.Dec `json:"delegator_shares" yaml:"delegator_shares"` Description Description `json:"description" yaml:"description"` @@ -44,7 +44,7 @@ type ( OperatorAddress sdk.ValAddress `json:"operator_address" yaml:"operator_address"` ConsPubKey string `json:"consensus_pubkey" yaml:"consensus_pubkey"` Jailed bool `json:"jailed" yaml:"jailed"` - Status sdk.BondStatus `json:"status" yaml:"status"` + Status v034staking.BondStatus `json:"status" yaml:"status"` Tokens sdk.Int `json:"tokens" yaml:"tokens"` DelegatorShares sdk.Dec `json:"delegator_shares" yaml:"delegator_shares"` Description Description `json:"description" yaml:"description"` @@ -56,8 +56,16 @@ type ( Validators []Validator + Params struct { + UnbondingTime time.Duration `json:"unbonding_time" yaml:"unbonding_time"` // time duration of unbonding + MaxValidators uint16 `json:"max_validators" yaml:"max_validators"` // maximum number of validators (max uint16 = 65535) + MaxEntries uint16 `json:"max_entries" yaml:"max_entries"` // max entries for either unbonding delegation or redelegation (per pair/trio) + HistoricalEntries uint16 `json:"historical_entries" yaml:"historical_entries"` // number of historical entries to persist + BondDenom string `json:"bond_denom" yaml:"bond_denom"` // bondable coin denomination + } + GenesisState struct { - Params v034staking.Params `json:"params"` + Params Params `json:"params"` LastTotalPower sdk.Int `json:"last_total_power"` LastValidatorPowers []v034staking.LastValidatorPower `json:"last_validator_powers"` Validators Validators `json:"validators"` @@ -87,7 +95,13 @@ func NewGenesisState( ) GenesisState { return GenesisState{ - Params: params, + Params: Params{ + UnbondingTime: params.UnbondingTime, + MaxValidators: params.MaxValidators, + MaxEntries: params.MaxEntries, + BondDenom: params.BondDenom, + HistoricalEntries: 0, + }, LastTotalPower: lastTotalPower, LastValidatorPowers: lastValPowers, Validators: validators, diff --git a/x/staking/legacy/v040/migrate.go b/x/staking/legacy/v040/migrate.go new file mode 100644 index 0000000000..4cd55afa50 --- /dev/null +++ b/x/staking/legacy/v040/migrate.go @@ -0,0 +1,137 @@ +package v040 + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + v034staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v034" + v038staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v038" + v040staking "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +func migrateBondStatus(oldStatus v034staking.BondStatus) sdk.BondStatus { + switch oldStatus { + case v034staking.Unbonded: + return sdk.Unbonded + + case v034staking.Unbonding: + return sdk.Unbonding + + case v034staking.Bonded: + return sdk.Bonded + + default: + panic(fmt.Errorf("invalid bond status %d", oldStatus)) + } +} + +// Migrate accepts exported v0.38 x/staking genesis state and migrates it to +// v0.40 x/staking genesis state. The migration includes: +// +// - Convert addresses from bytes to bech32 strings. +// - Update BondStatus staking constants. +// - Re-encode in v0.40 GenesisState. +func Migrate(stakingState v038staking.GenesisState) *v040staking.GenesisState { + newLastValidatorPowers := make([]v040staking.LastValidatorPower, len(stakingState.LastValidatorPowers)) + for i, oldLastValidatorPower := range stakingState.LastValidatorPowers { + newLastValidatorPowers[i] = v040staking.LastValidatorPower{ + Address: oldLastValidatorPower.Address.String(), + Power: oldLastValidatorPower.Power, + } + } + + newValidators := make([]v040staking.Validator, len(stakingState.Validators)) + for i, oldValidator := range stakingState.Validators { + newValidators[i] = v040staking.Validator{ + OperatorAddress: oldValidator.OperatorAddress.String(), + ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, oldValidator.ConsPubKey), + Jailed: oldValidator.Jailed, + Status: migrateBondStatus(oldValidator.Status), + Tokens: oldValidator.Tokens, + DelegatorShares: oldValidator.DelegatorShares, + Description: v040staking.Description{ + Moniker: oldValidator.Description.Moniker, + Identity: oldValidator.Description.Identity, + Website: oldValidator.Description.Website, + SecurityContact: oldValidator.Description.SecurityContact, + Details: oldValidator.Description.Details, + }, + UnbondingHeight: oldValidator.UnbondingHeight, + UnbondingTime: oldValidator.UnbondingCompletionTime, + Commission: v040staking.Commission{ + CommissionRates: v040staking.CommissionRates{ + Rate: oldValidator.Commission.Rate, + MaxRate: oldValidator.Commission.MaxRate, + MaxChangeRate: oldValidator.Commission.MaxChangeRate, + }, + UpdateTime: oldValidator.Commission.UpdateTime, + }, + MinSelfDelegation: oldValidator.MinSelfDelegation, + } + } + + newDelegations := make([]v040staking.Delegation, len(stakingState.Delegations)) + for i, oldDelegation := range stakingState.Delegations { + newDelegations[i] = v040staking.Delegation{ + DelegatorAddress: oldDelegation.DelegatorAddress.String(), + ValidatorAddress: oldDelegation.ValidatorAddress.String(), + Shares: oldDelegation.Shares, + } + } + + newUnbondingDelegations := make([]v040staking.UnbondingDelegation, len(stakingState.UnbondingDelegations)) + for i, oldUnbondingDelegation := range stakingState.UnbondingDelegations { + newEntries := make([]v040staking.UnbondingDelegationEntry, len(oldUnbondingDelegation.Entries)) + for j, oldEntry := range oldUnbondingDelegation.Entries { + newEntries[j] = v040staking.UnbondingDelegationEntry{ + CreationHeight: oldEntry.CreationHeight, + CompletionTime: oldEntry.CompletionTime, + InitialBalance: oldEntry.InitialBalance, + Balance: oldEntry.Balance, + } + } + + newUnbondingDelegations[i] = v040staking.UnbondingDelegation{ + DelegatorAddress: oldUnbondingDelegation.DelegatorAddress.String(), + ValidatorAddress: oldUnbondingDelegation.ValidatorAddress.String(), + Entries: newEntries, + } + } + + newRedelegations := make([]v040staking.Redelegation, len(stakingState.Redelegations)) + for i, oldRedelegation := range stakingState.Redelegations { + newEntries := make([]v040staking.RedelegationEntry, len(oldRedelegation.Entries)) + for j, oldEntry := range oldRedelegation.Entries { + newEntries[j] = v040staking.RedelegationEntry{ + CreationHeight: oldEntry.CreationHeight, + CompletionTime: oldEntry.CompletionTime, + InitialBalance: oldEntry.InitialBalance, + SharesDst: oldEntry.SharesDst, + } + } + + newRedelegations[i] = v040staking.Redelegation{ + DelegatorAddress: oldRedelegation.DelegatorAddress.String(), + ValidatorSrcAddress: oldRedelegation.ValidatorSrcAddress.String(), + ValidatorDstAddress: oldRedelegation.ValidatorDstAddress.String(), + Entries: newEntries, + } + } + + return &v040staking.GenesisState{ + Params: v040staking.Params{ + UnbondingTime: stakingState.Params.UnbondingTime, + MaxValidators: uint32(stakingState.Params.MaxValidators), + MaxEntries: uint32(stakingState.Params.MaxEntries), + HistoricalEntries: uint32(stakingState.Params.HistoricalEntries), + BondDenom: stakingState.Params.BondDenom, + }, + LastTotalPower: stakingState.LastTotalPower, + LastValidatorPowers: newLastValidatorPowers, + Validators: newValidators, + Delegations: newDelegations, + UnbondingDelegations: newUnbondingDelegations, + Redelegations: newRedelegations, + Exported: stakingState.Exported, + } +} diff --git a/x/staking/legacy/v040/migrate_test.go b/x/staking/legacy/v040/migrate_test.go new file mode 100644 index 0000000000..1d593a6fc9 --- /dev/null +++ b/x/staking/legacy/v040/migrate_test.go @@ -0,0 +1,93 @@ +package v040_test + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + "github.com/cosmos/cosmos-sdk/simapp" + v034staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v034" + v038staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v038" + v040staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v040" +) + +func TestMigrate(t *testing.T) { + encodingConfig := simapp.MakeEncodingConfig() + clientCtx := client.Context{}. + WithInterfaceRegistry(encodingConfig.InterfaceRegistry). + WithTxConfig(encodingConfig.TxConfig). + WithLegacyAmino(encodingConfig.Amino). + WithJSONMarshaler(encodingConfig.Marshaler) + + consPubKey := ed25519.GenPrivKeyFromSecret([]byte("val0")).PubKey() + stakingGenState := v038staking.GenesisState{ + Validators: v038staking.Validators{v038staking.Validator{ + ConsPubKey: consPubKey, + Status: v034staking.Unbonded, + }}, + } + + migrated := v040staking.Migrate(stakingGenState) + + bz, err := clientCtx.JSONMarshaler.MarshalJSON(migrated) + require.NoError(t, err) + + // Indent the JSON bz correctly. + var jsonObj map[string]interface{} + err = json.Unmarshal(bz, &jsonObj) + require.NoError(t, err) + indentedBz, err := json.MarshalIndent(jsonObj, "", " ") + require.NoError(t, err) + + // Make sure about: + // - consensus_pubkey: should be bech32 pubkey + // - validator's status should be 1 (new unbonded) + expected := `{ + "delegations": [], + "exported": false, + "last_total_power": "0", + "last_validator_powers": [], + "params": { + "bond_denom": "", + "historical_entries": 0, + "max_entries": 0, + "max_validators": 0, + "unbonding_time": "0s" + }, + "redelegations": [], + "unbonding_delegations": [], + "validators": [ + { + "commission": { + "commission_rates": { + "max_change_rate": "0", + "max_rate": "0", + "rate": "0" + }, + "update_time": "0001-01-01T00:00:00Z" + }, + "consensus_pubkey": "cosmosvalconspub1zcjduepq9ymett3nlv6fytn7lqxzd3q3ckvd79eqlcf3wkhgamcl4rzghesq83ecpx", + "delegator_shares": "0", + "description": { + "details": "", + "identity": "", + "moniker": "", + "security_contact": "", + "website": "" + }, + "jailed": false, + "min_self_delegation": "0", + "operator_address": "", + "status": 1, + "tokens": "0", + "unbonding_height": "0", + "unbonding_time": "0001-01-01T00:00:00Z" + } + ] +}` + + require.Equal(t, expected, string(indentedBz)) +} diff --git a/x/staking/legacy/v040/types.go b/x/staking/legacy/v040/types.go new file mode 100644 index 0000000000..6ad280e277 --- /dev/null +++ b/x/staking/legacy/v040/types.go @@ -0,0 +1,5 @@ +package v040 + +const ( + ModuleName = "staking" +) From c7d926da2dd7529582c483022039eac107090a88 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Fri, 9 Oct 2020 15:13:30 -0400 Subject: [PATCH 06/84] ADR 031: Protobuf Msg Services (#7458) * Ideas * WIP * Add ADR 031 * WIP * WIP * Revert changes * Revert changes * Revert changes * Updates * Updates * Apply suggestions from code review Co-authored-by: Amaury Martiny Co-authored-by: Anil Kumar Kammari * Add package names * Adding clarifications + Adding an abstract + Updating the first paragraph of decision * Update Context and wording * Update wording * Address proto naming Co-authored-by: Amaury Martiny Co-authored-by: Anil Kumar Kammari Co-authored-by: Robert Zaremba Co-authored-by: Cory --- docs/architecture/README.md | 3 +- .../adr-021-protobuf-query-encoding.md | 4 +- docs/architecture/adr-031-msg-service.md | 238 ++++++++++++++++++ 3 files changed, 242 insertions(+), 3 deletions(-) create mode 100644 docs/architecture/adr-031-msg-service.md diff --git a/docs/architecture/README.md b/docs/architecture/README.md index 2e17fb394e..a2bce8f771 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -54,4 +54,5 @@ Please add a entry below in your Pull Request for an ADR. - [ADR 025: IBC Passive Channels](./adr-025-ibc-passive-channels.md) - [ADR 026: IBC Client Recovery Mechanisms](./adr-026-ibc-client-recovery-mechanisms.md) - [ADR 027: Deterministic Protobuf Serialization](./adr-027-deterministic-protobuf-serialization.md) -- [ADR 029: Fee Grant Module](./adr-029-fee-grant-module.md) \ No newline at end of file +- [ADR 029: Fee Grant Module](./adr-029-fee-grant-module.md) +- [ADR 031: Protobuf Msg Services](./adr-031-msg-service.md) diff --git a/docs/architecture/adr-021-protobuf-query-encoding.md b/docs/architecture/adr-021-protobuf-query-encoding.md index 178c582df7..ba0b35cd96 100644 --- a/docs/architecture/adr-021-protobuf-query-encoding.md +++ b/docs/architecture/adr-021-protobuf-query-encoding.md @@ -109,12 +109,12 @@ func (q Querier) QueryBalance(ctx context.Context, params *types.QueryBalancePar ### Custom Query Registration and Routing Query server implementations as above would be registered with `AppModule`s using -a new method `RegisterQueryServer(grpc.Server)` which could be implemented simply +a new method `RegisterQueryService(grpc.Server)` which could be implemented simply as below: ```go // x/bank/module.go -func (am AppModule) RegisterQueryServer(server grpc.Server) { +func (am AppModule) RegisterQueryService(server grpc.Server) { types.RegisterQueryServer(server, keeper.Querier{am.keeper}) } ``` diff --git a/docs/architecture/adr-031-msg-service.md b/docs/architecture/adr-031-msg-service.md new file mode 100644 index 0000000000..bd67d090d8 --- /dev/null +++ b/docs/architecture/adr-031-msg-service.md @@ -0,0 +1,238 @@ +# ADR 031: Protobuf Msg Services + +## Changelog + +- 2020-10-05: Initial Draft + +## Status + +Proposed + +## Abstract + +We want to leverage protobuf `service` definitions for defining `Msg`s which will give us significant developer UX +improvements in terms of the code that is generated and the fact that return types will now be well defined. + +## Context + +Currently `Msg` handlers in the Cosmos SDK do have return values that are placed in the `data` field of the response. +These return values, however, are not specified anywhere except in the golang handler code. + +In early conversations [it was proposed](https://docs.google.com/document/d/1eEgYgvgZqLE45vETjhwIw4VOqK-5hwQtZtjVbiXnIGc/edit) +that `Msg` return types be captured using a protobuf extension field, ex: + +```protobuf +package cosmos.gov; + +message MsgSubmitProposal + option (cosmos_proto.msg_return) = “uint64”; + string delegator_address = 1; + string validator_address = 2; + repeated sdk.Coin amount = 3; +} +``` + +This was never adopted, however. + +Having a well-specified return value for `Msg`s would improve client UX. For instance, +in `x/gov`, `MsgSubmitProposal` returns the proposal ID as a big-endian `uint64`. +This isn’t really documented anywhere and clients would need to know the internals +of the SDK to parse that value and return it to users. + +Also, there may be cases where we want to use these return values programatically. +For instance, https://github.com/cosmos/cosmos-sdk/issues/7093 proposes a method for +doing inter-module Ocaps using the `Msg` router. A well-defined return type would +improve the developer UX for this approach. + +In addition, handler registration of `Msg` types tends to add a bit of +boilerplate on top of keepers and is usually done through manual type switches. +This isn't necessarily bad, but it does add overhead to creating modules. + +## Decision + +We decide to use protobuf `service` definitions for defining `Msg`s as well as +the code generated by them as a replacement for `Msg` handlers. + +Below we define how this will look for the `SubmitProposal` message from `x/gov` module. +We start with a `Msg` `service` definition: + +```proto +package cosmos.gov; + +service Msg { + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); +} + +// Note that for backwards compatibility this uses MsgSubmitProposal as the request +// type instead of the more canonical MsgSubmitProposalRequest +message MsgSubmitProposal { + google.protobuf.Any content = 1; + string proposer = 2; +} + +message MsgSubmitProposalResponse { + uint64 proposal_id; +} +``` + +While this is most commonly used for gRPC, overloading protobuf `service` definitions like this does not violate +the intent of the [protobuf spec](https://developers.google.com/protocol-buffers/docs/proto3#services) which says: +> If you don’t want to use gRPC, it’s also possible to use protocol buffers with your own RPC implementation. +With this approach, we would get an auto-generated `MsgServer` interface: + +In addition to clearly specifying return types, this has the benefit of generating client and server code. On the server +side, this is almost like an automatically generated keeper method and could maybe be used intead of keepers eventually +(see [\#7093](https://github.com/cosmos/cosmos-sdk/issues/7093)): + +```go +package gov + +type MsgServer interface { + SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) +} +``` + +On the client side, developers could take advantage of this by creating RPC implementations that encapsulate transaction +logic. Protobuf libraries that use asynchronous callbacks, like [protobuf.js](https://github.com/protobufjs/protobuf.js#using-services) +could use this to register callbacks for specific messages even for transactions that include multiple `Msg`s. + +For backwards compatibility, existing `Msg` types should be used as the request parameter +for `service` definitions. Newer `Msg` types which only support `service` definitions +should use the more canonical `Msg...Request` names. + +### Encoding + +Currently, we are encoding `Msg`s as `Any` in `Tx`s which involves packing the +binary-encoded `Msg` with its type URL. + +The type URL for `MsgSubmitProposal` based on the proto3 spec is `/cosmos.gov.MsgSubmitProposal`. + +The fully-qualified name for the `SubmitProposal` service method above (also +based on the proto3 and gRPC specs) is `/cosmos.gov.Msg/SubmitProposal` which varies +by a single `/` character. The generated `.pb.go` files for protobuf `service`s +include names of this form and any compliant protobuf/gRPC code generator will +generate the same name. + +In order to encode service methods in transactions, we encode them as `Any`s in +the same `TxBody.messages` field as other `Msg`s. We simply set `Any.type_url` +to the full-qualified method name (ex. `/cosmos.gov.Msg/SubmitProposal`) and +set `Any.value` to the protobuf encoding of the request message +(`MsgSubmitProposal` in this case). + +### Decoding + +When decoding, `TxBody.UnpackInterfaces` will need a special case +to detect if `Any` type URLs match the service method format (ex. `/cosmos.gov.Msg/SubmitProposal`) +by checking for two `/` characters. Messages that are method names plus request parameters +instead of a normal `Any` messages will get unpacked into the `ServiceMsg` struct: + +```go +type ServiceMsg struct { + // MethodName is the fully-qualified service name + MethodName string + // Request is the request payload + Request MsgRequest +} +``` + +### Routing + +In the future, `service` definitions may become the primary method for defining +`Msg`s. As a starting point, we need to integrate with the SDK's existing routing +and `Msg` interface. + +To do this, `ServiceMsg` implements the `sdk.Msg` interface and its handler does the +actual method routing, allowing this feature to be added incrementally on top of +existing functionality. + +### `MsgRequest` interface + +All request messages will need to implement the `MsgRequest` interface which is a +simplified version of `Msg`, without `Route()`, `Type()` and `GetSignBytes()` which +are no longer needed: + +```go +type MsgRequest interface { + proto.Message + ValidateBasic() error + GetSigners() []AccAddress +} +``` + +`ServiceMsg` will forward its `ValidateBasic` and `GetSigners` methods to the `MsgRequest` +methods. + +### Module Configuration + +In [ADR 021](./adr-021-protobuf-query-encoding.md), we introduced a method `RegisterQueryService` +to `AppModule` which allows for modules to register gRPC queriers. + +To register `Msg` services, we attempt a more extensible approach by converting `RegisterQueryService` +to a more generic `RegisterServices` method: + +```go +type AppModule interface { + RegisterServices(Configurator) + ... +} + +type Configurator interface { + QueryServer() grpc.Server + MsgServer() grpc.Server +} + +// example module: +func (am AppModule) RegisterServices(cfg Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), keeper) + types.RegisterMsgServer(cfg.MsgServer(), keeper) +} +``` + +The `RegisterServices` method and the `Configurator` interface are intended to +evolve to satisfy the use cases discussed in [\#7093](https://github.com/cosmos/cosmos-sdk/issues/7093) +and [\#7122](https://github.com/cosmos/cosmos-sdk/issues/7421). + +When `Msg` services are registered, the framework _should_ verify that all `Msg...Request` types +implement the `MsgRequest` interface described above and throw an error during initialization rather +than later when transactions are processed. + +### `Msg` Service Implementation + +Just like query services, `Msg` service methods can retrieve the `sdk.Context` +from the `context.Context` parameter method using the `sdk.UnwrapSDKContext` +method: + +```go +package gov + +func (k Keeper) SubmitProposal(goCtx context.Context, params *types.MsgSubmitProposal) (*MsgSubmitProposalResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + ... +} +``` + +The `sdk.Context` should have an `EventManager` already attached by the `ServiceMsg` +router. + +Separate handler definition is no longer needed with this approach. + +## Consequences + +### Pros +- communicates return type clearly +- manual handler registration and return type marshaling is no longer needed, just implement the interface and register it +- some keeper code could be automatically generate, this would improve the UX of [\#7093](https://github.com/cosmos/cosmos-sdk/issues/7093) approach (1) if we chose to adopt that +- generated client code could be useful for clients + +### Cons +- supporting both this and the current concrete `Msg` type approach simultaneously could be confusing +(we could choose to deprecate the current approach) +- using `service` definitions outside the context of gRPC could be confusing (but doesn’t violate the proto3 spec) + +## References + +- [Initial Github Issue \#7122](https://github.com/cosmos/cosmos-sdk/issues/7122) +- [proto 3 Language Guide: Defining Services](https://developers.google.com/protocol-buffers/docs/proto3#services) +- [Initial pre-`Any` `Msg` designs](https://docs.google.com/document/d/1eEgYgvgZqLE45vETjhwIw4VOqK-5hwQtZtjVbiXnIGc) +- [ADR 020](./adr-020-protobuf-transaction-encoding.md) +- [ADR 021](./adr-021-protobuf-query-encoding.md) From 61d58447055865fd181ca49d99c4c069c817b704 Mon Sep 17 00:00:00 2001 From: Neeraj Murarka Date: Sat, 10 Oct 2020 04:02:12 -0700 Subject: [PATCH 07/84] Corrected 'unsafe-reset-all' help text (#7504) --- server/tm_cmds.go | 2 +- x/ibc/applications/transfer/keeper/relay.go | 1 + x/ibc/core/handler.go | 1 + x/ibc/light-clients/07-tendermint/types/upgrade_test.go | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/tm_cmds.go b/server/tm_cmds.go index 95b1c6fa42..d6c8b665f9 100644 --- a/server/tm_cmds.go +++ b/server/tm_cmds.go @@ -146,7 +146,7 @@ func printlnJSON(v interface{}) error { func UnsafeResetAllCmd() *cobra.Command { return &cobra.Command{ Use: "unsafe-reset-all", - Short: "Resets the blockchain database, removes address book files, and resets priv_validator.json to the genesis state", + Short: "Resets the blockchain database, removes address book files, and resets data/priv_validator_state.json to the genesis state", RunE: func(cmd *cobra.Command, args []string) error { serverCtx := GetServerContextFromCmd(cmd) cfg := serverCtx.Config diff --git a/x/ibc/applications/transfer/keeper/relay.go b/x/ibc/applications/transfer/keeper/relay.go index 45a51a9a2e..c9bc4470d3 100644 --- a/x/ibc/applications/transfer/keeper/relay.go +++ b/x/ibc/applications/transfer/keeper/relay.go @@ -4,6 +4,7 @@ import ( "strings" "github.com/armon/go-metrics" + "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" diff --git a/x/ibc/core/handler.go b/x/ibc/core/handler.go index 3d3ea6280f..684a7c6a1c 100644 --- a/x/ibc/core/handler.go +++ b/x/ibc/core/handler.go @@ -2,6 +2,7 @@ package ibc import ( "github.com/armon/go-metrics" + "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" diff --git a/x/ibc/light-clients/07-tendermint/types/upgrade_test.go b/x/ibc/light-clients/07-tendermint/types/upgrade_test.go index bad73aaba4..f5debb01a6 100644 --- a/x/ibc/light-clients/07-tendermint/types/upgrade_test.go +++ b/x/ibc/light-clients/07-tendermint/types/upgrade_test.go @@ -104,7 +104,7 @@ func (suite *TendermintTestSuite) TestVerifyUpgrade() { expPass: false, }, { - name: "unsuccessful upgrade: chain-specified paramaters do not match committed client", + name: "unsuccessful upgrade: chain-specified parameters do not match committed client", setup: func() { upgradedClient = types.NewClientState("newChainId", types.DefaultTrustLevel, trustingPeriod, ubdPeriod+trustingPeriod, maxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) From 65277176648f1e1d75694af8edf1a7f9bc387bca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Oct 2020 03:59:52 -0300 Subject: [PATCH 08/84] Bump actions/cache from v2.1.1 to v2.1.2 (#7509) Bumps [actions/cache](https://github.com/actions/cache) from v2.1.1 to v2.1.2. - [Release notes](https://github.com/actions/cache/releases) - [Commits](https://github.com/actions/cache/compare/v2.1.1...d1255ad9362389eac595a9ae406b8e8cb3331f16) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-sims.yml | 4 ++-- .github/workflows/sims.yml | 10 +++++----- .github/workflows/test.yml | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-sims.yml b/.github/workflows/release-sims.yml index 6809307d72..4f1dae7a97 100644 --- a/.github/workflows/release-sims.yml +++ b/.github/workflows/release-sims.yml @@ -30,7 +30,7 @@ jobs: - name: install runsim run: | export GO111MODULE="on" && go get github.com/cosmos/tools/cmd/runsim@v1.0.0 - - uses: actions/cache@v2.1.1 + - uses: actions/cache@v2.1.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary @@ -40,7 +40,7 @@ jobs: needs: [build, install-runsim] steps: - uses: actions/checkout@v2 - - uses: actions/cache@v2.1.1 + - uses: actions/cache@v2.1.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index a31cab7e49..833828bfac 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -39,7 +39,7 @@ jobs: run: go version - name: Install runsim run: export GO111MODULE="on" && go get github.com/cosmos/tools/cmd/runsim@v1.0.0 - - uses: actions/cache@v2.1.1 + - uses: actions/cache@v2.1.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary @@ -62,7 +62,7 @@ jobs: .sum SET_ENV_NAME_INSERTIONS: 1 SET_ENV_NAME_LINES: 1 - - uses: actions/cache@v2.1.1 + - uses: actions/cache@v2.1.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary @@ -90,7 +90,7 @@ jobs: .sum SET_ENV_NAME_INSERTIONS: 1 SET_ENV_NAME_LINES: 1 - - uses: actions/cache@v2.1.1 + - uses: actions/cache@v2.1.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary @@ -118,7 +118,7 @@ jobs: .sum SET_ENV_NAME_INSERTIONS: 1 SET_ENV_NAME_LINES: 1 - - uses: actions/cache@v2.1.1 + - uses: actions/cache@v2.1.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary @@ -146,7 +146,7 @@ jobs: .sum SET_ENV_NAME_INSERTIONS: 1 SET_ENV_NAME_LINES: 1 - - uses: actions/cache@v2.1.1 + - uses: actions/cache@v2.1.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 58716fb982..43fd297daf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: - name: install tparse run: | export GO111MODULE="on" && go get github.com/mfridman/tparse@v0.8.3 - - uses: actions/cache@v2.1.1 + - uses: actions/cache@v2.1.2 with: path: ~/go/bin key: ${{ runner.os }}-go-tparse-binary @@ -401,7 +401,7 @@ jobs: with: name: "${{ github.sha }}-ad-race-output" if: "env.GIT_DIFF != ''" - - uses: actions/cache@v2.1.1 + - uses: actions/cache@v2.1.2 with: path: ~/go/bin key: ${{ runner.os }}-go-tparse-binary From 0f70b88ecf51c83b3431ddd569f6cd161818532b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Oct 2020 09:04:09 +0000 Subject: [PATCH 09/84] Bump github.com/grpc-ecosystem/grpc-gateway from 1.15.0 to 1.15.2 (#7511) Bumps [github.com/grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) from 1.15.0 to 1.15.2. - [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases) - [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/CHANGELOG.md) - [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v1.15.0...v1.15.2) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7504e763d1..ae408db2f2 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/golang/protobuf v1.4.2 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 - github.com/grpc-ecosystem/grpc-gateway v1.15.0 + github.com/grpc-ecosystem/grpc-gateway v1.15.2 github.com/hashicorp/golang-lru v0.5.4 github.com/magiconair/properties v1.8.4 github.com/mattn/go-isatty v0.0.12 diff --git a/go.sum b/go.sum index b395dd5f66..989f37edf0 100644 --- a/go.sum +++ b/go.sum @@ -273,8 +273,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1 github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.14.7 h1:Nk5kuHrnWUTf/0GL1a/vchH/om9Ap2/HnVna+jYZgTY= github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= -github.com/grpc-ecosystem/grpc-gateway v1.15.0 h1:ntPNC9TD/6l2XDenJZe6T5lSMg95thpV9sGAqHX4WU8= -github.com/grpc-ecosystem/grpc-gateway v1.15.0/go.mod h1:vO11I9oWA+KsxmfFQPhLnnIb1VDE24M+pdxZFiuZcA8= +github.com/grpc-ecosystem/grpc-gateway v1.15.2 h1:HC+hWRWf+v5zTMPyoaYTKIJih+4sd4XRWmj0qlG87Co= +github.com/grpc-ecosystem/grpc-gateway v1.15.2/go.mod h1:vO11I9oWA+KsxmfFQPhLnnIb1VDE24M+pdxZFiuZcA8= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= From d7ad658e551288ed882370bd3ea18a639ab7c12c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Oct 2020 13:19:05 +0200 Subject: [PATCH 10/84] Update technote-space/get-diff-action requirement to v4 (#7510) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alessio Treglia Co-authored-by: Marko Baricevic --- .github/workflows/lint.yml | 12 +-- .github/workflows/sims.yml | 52 ++++++----- .github/workflows/test.yml | 176 ++++++++++++++++++------------------- 3 files changed, 119 insertions(+), 121 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 908542f514..157f0d2178 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,16 +14,16 @@ jobs: timeout-minutes: 6 steps: - uses: actions/checkout@v2 - - uses: technote-space/get-diff-action@v3 + - uses: technote-space/get-diff-action@v4 with: - SUFFIX_FILTER: | - .go - .mod - .sum + PATTERNS: | + **/**.go + go.mod + go.sum - uses: golangci/golangci-lint-action@master with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. version: v1.28 args: --timeout 10m github-token: ${{ secrets.github_token }} - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index 833828bfac..de2e9bb102 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -54,23 +54,21 @@ jobs: go-version: 1.15 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v3 + - uses: technote-space/get-diff-action@v4 with: - SUFFIX_FILTER: | - .go - .mod - .sum - SET_ENV_NAME_INSERTIONS: 1 - SET_ENV_NAME_LINES: 1 + PATTERNS: | + **/**.go + go.mod + go.sum - uses: actions/cache@v2.1.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: test-sim-nondeterminism run: | make test-sim-nondeterminism - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF test-sim-import-export: runs-on: ubuntu-latest @@ -82,23 +80,23 @@ jobs: go-version: 1.15 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v3 + - uses: technote-space/get-diff-action@v4 with: SUFFIX_FILTER: | - .go - .mod - .sum + **/**.go + go.mod + go.sum SET_ENV_NAME_INSERTIONS: 1 SET_ENV_NAME_LINES: 1 - uses: actions/cache@v2.1.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: test-sim-import-export run: | make test-sim-import-export - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF test-sim-after-import: runs-on: ubuntu-latest @@ -110,23 +108,23 @@ jobs: go-version: 1.15 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v3 + - uses: technote-space/get-diff-action@v4 with: SUFFIX_FILTER: | - .go - .mod - .sum + **/**.go + go.mod + go.sum SET_ENV_NAME_INSERTIONS: 1 SET_ENV_NAME_LINES: 1 - uses: actions/cache@v2.1.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: test-sim-after-import run: | make test-sim-after-import - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF test-sim-multi-seed-short: runs-on: ubuntu-latest @@ -138,20 +136,20 @@ jobs: go-version: 1.15 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v3 + - uses: technote-space/get-diff-action@v4 with: SUFFIX_FILTER: | - .go - .mod - .sum + **/**.go + go.mod + go.sum SET_ENV_NAME_INSERTIONS: 1 SET_ENV_NAME_LINES: 1 - uses: actions/cache@v2.1.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: test-sim-multi-seed-short run: | make test-sim-multi-seed-short - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 43fd297daf..822b509137 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,18 +40,18 @@ jobs: go-version: 1.15 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v1 + - uses: technote-space/get-diff-action@v4 id: git_diff with: PREFIX_FILTER: | cosmovisor - SUFFIX_FILTER: | - .go - .mod - .sum + PATTERNS: | + **/**.go + go.mod + go.sum - name: Run cosmovisor tests run: cd cosmovisor; make - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF split-test-files: runs-on: ubuntu-latest @@ -95,21 +95,21 @@ jobs: go-version: 1.15 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v3 + - uses: technote-space/get-diff-action@v4 id: git_diff with: - SUFFIX_FILTER: | - .go - .mod - .sum + PATTERNS: | + **/**.go + go.mod + go.sum - uses: actions/download-artifact@v2 with: name: "${{ github.sha }}-aa" - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: test & coverage report creation run: | cat xaa.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='norace ledger test_ledger_mock' - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: filter out DONTCOVER run: | excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')" @@ -120,11 +120,11 @@ jobs: echo "Excluding ${filename} from coverage report..." sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt done - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - uses: codecov/codecov-action@v1.0.13 with: file: ./coverage.txt - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF test-coverage-run-2: runs-on: ubuntu-latest @@ -137,21 +137,21 @@ jobs: go-version: 1.15 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v3 + - uses: technote-space/get-diff-action@v4 id: git_diff with: - SUFFIX_FILTER: | - .go - .mod - .sum + PATTERNS: | + **/**.go + go.mod + go.sum - uses: actions/download-artifact@v2 with: name: "${{ github.sha }}-ab" - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: test & coverage report creation run: | cat xab.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='norace ledger test_ledger_mock' - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: filter out DONTCOVER run: | excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')" @@ -162,11 +162,11 @@ jobs: echo "Excluding ${filename} from coverage report..." sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt done - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - uses: codecov/codecov-action@v1.0.13 with: file: ./coverage.txt - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF test-coverage-run-3: runs-on: ubuntu-latest @@ -179,21 +179,21 @@ jobs: go-version: 1.15 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v3 + - uses: technote-space/get-diff-action@v4 id: git_diff with: - SUFFIX_FILTER: | - .go - .mod - .sum + PATTERNS: | + **/**.go + go.mod + go.sum - uses: actions/download-artifact@v2 with: name: "${{ github.sha }}-ac" - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: test & coverage report creation run: | cat xac.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='norace ledger test_ledger_mock' - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: filter out DONTCOVER run: | excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')" @@ -204,11 +204,11 @@ jobs: echo "Excluding ${filename} from coverage report..." sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt done - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - uses: codecov/codecov-action@v1.0.13 with: file: ./coverage.txt - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF test-coverage-run-4: runs-on: ubuntu-latest @@ -221,21 +221,21 @@ jobs: go-version: 1.15 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v3 + - uses: technote-space/get-diff-action@v4 id: git_diff with: - SUFFIX_FILTER: | - .go - .mod - .sum + PATTERNS: | + **/**.go + go.mod + go.sum - uses: actions/download-artifact@v2 with: name: "${{ github.sha }}-ad" - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: test & coverage report creation run: | cat xad.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='norace ledger test_ledger_mock' - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: filter out DONTCOVER run: | excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')" @@ -246,11 +246,11 @@ jobs: echo "Excluding ${filename} from coverage report..." sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt done - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - uses: codecov/codecov-action@v1.0.13 with: file: ./coverage.txt - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF test-race-1: runs-on: ubuntu-latest @@ -263,20 +263,20 @@ jobs: go-version: 1.15 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v3 + - uses: technote-space/get-diff-action@v4 id: git_diff with: - SUFFIX_FILTER: | - .go - .mod - .sum + PATTERNS: | + **/**.go + go.mod + go.sum - uses: actions/download-artifact@v2 with: name: "${{ github.sha }}-aa" - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: Run tests with race detector run: cat xaa.txt | xargs go test -mod=readonly -json -timeout 30m -race -tags='cgo ledger test_ledger_mock' > xaa-race-output.txt - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - uses: actions/upload-artifact@v2 with: name: "${{ github.sha }}-aa-race-output" @@ -293,20 +293,20 @@ jobs: go-version: 1.15 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v3 + - uses: technote-space/get-diff-action@v4 id: git_diff with: - SUFFIX_FILTER: | - .go - .mod - .sum + PATTERNS: | + **/**.go + go.mod + go.sum - uses: actions/download-artifact@v2 with: name: "${{ github.sha }}-ab" - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: Run tests with race detector run: cat xab.txt | xargs go test -mod=readonly -json -timeout 30m -race -tags='cgo ledger test_ledger_mock' > xab-race-output.txt - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - uses: actions/upload-artifact@v2 with: name: "${{ github.sha }}-ab-race-output" @@ -323,20 +323,20 @@ jobs: go-version: 1.15 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v3 + - uses: technote-space/get-diff-action@v4 id: git_diff with: - SUFFIX_FILTER: | - .go - .mod - .sum + PATTERNS: | + **/**.go + go.mod + go.sum - uses: actions/download-artifact@v2 with: name: "${{ github.sha }}-ac" - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: Run tests with race detector run: cat xac.txt | xargs go test -mod=readonly -json -timeout 30m -race -tags='cgo ledger test_ledger_mock' > xac-race-output.txt - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - uses: actions/upload-artifact@v2 with: name: "${{ github.sha }}-ac-race-output" @@ -353,20 +353,20 @@ jobs: go-version: 1.15 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v3 + - uses: technote-space/get-diff-action@v4 id: git_diff with: - SUFFIX_FILTER: | - .go - .mod - .sum + PATTERNS: | + **/**.go + go.mod + go.sum - uses: actions/download-artifact@v2 with: name: "${{ github.sha }}-ad" - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: Run tests with race detector run: cat xad.txt | xargs go test -mod=readonly -json -timeout 30m -race -tags='cgo ledger test_ledger_mock' > xad-race-output.txt - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - uses: actions/upload-artifact@v2 with: name: "${{ github.sha }}-ad-race-output" @@ -378,58 +378,58 @@ jobs: timeout-minutes: 5 steps: - uses: actions/checkout@v2 - - uses: technote-space/get-diff-action@v3 + - uses: technote-space/get-diff-action@v4 id: git_diff with: - SUFFIX_FILTER: | - .go - .mod - .sum + PATTERNS: | + **/**.go + go.mod + go.sum - uses: actions/download-artifact@v2 with: name: "${{ github.sha }}-aa-race-output" - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - uses: actions/download-artifact@v2 with: name: "${{ github.sha }}-ab-race-output" - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - uses: actions/download-artifact@v2 with: name: "${{ github.sha }}-ac-race-output" - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - uses: actions/download-artifact@v2 with: name: "${{ github.sha }}-ad-race-output" - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - uses: actions/cache@v2.1.2 with: path: ~/go/bin key: ${{ runner.os }}-go-tparse-binary - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: Generate test report (go test -race) run: cat xa*-race-output.txt | ~/go/bin/tparse - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF liveness-test: runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v2 - - uses: technote-space/get-diff-action@v1 + - uses: technote-space/get-diff-action@v4 id: git_diff with: - SUFFIX_FILTER: | - .go - .mod - .sum + PATTERNS: | + **/**.go + go.mod + go.sum - name: start localnet run: | make clean build-simd-linux localnet-start - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF - name: test liveness run: | ./contrib/localnet_liveness.sh 100 5 50 localhost - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF docker-build: runs-on: ubuntu-latest From 7474a19bb9a11539a5068bf975da3feceba0db10 Mon Sep 17 00:00:00 2001 From: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Date: Mon, 12 Oct 2020 15:13:17 +0200 Subject: [PATCH 11/84] simapp: use tmjson on InitChainer (#7514) Co-authored-by: Alessio Treglia --- simapp/app.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/simapp/app.go b/simapp/app.go index 9ba94183cd..91a107bee6 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -9,6 +9,7 @@ import ( "github.com/gorilla/mux" "github.com/rakyll/statik/fs" abci "github.com/tendermint/tendermint/abci/types" + tmjson "github.com/tendermint/tendermint/libs/json" "github.com/tendermint/tendermint/libs/log" tmos "github.com/tendermint/tendermint/libs/os" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -450,7 +451,9 @@ func (app *SimApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.Re // InitChainer application update at chain initialization func (app *SimApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { var genesisState GenesisState - app.cdc.MustUnmarshalJSON(req.AppStateBytes, &genesisState) + if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { + panic(err) + } return app.mm.InitGenesis(ctx, app.appCodec, genesisState) } From 33e7297c791980428d0c698989ffa760284258f2 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 12 Oct 2020 15:56:02 +0200 Subject: [PATCH 12/84] Use enum instead of int32 for BondStatus (#7499) * Migrate staking module * Add gov legacy * Add comments * Add x/distrib * x/crisis * x/mint * Fix test * migrate x/genutil * Fix lint * Fix staking constants * Fix test * Update x/genutil/legacy/v040/migrate.go Co-authored-by: Marie Gauthier * Add migrate script instead of change BondStatus constants * Change staking bondStatus to enum * Fix test * Fix another test * Remove staking exported * fix references * Better constants * Fix build * Fix lint * Remove buf version * Fix tests * Fix test Co-authored-by: Marie Gauthier Co-authored-by: Aleksandr Bezobchuk --- CHANGELOG.md | 1 + proto/cosmos/staking/v1beta1/staking.proto | 16 +- simapp/export.go | 5 +- simapp/test_helpers.go | 2 +- types/staking.go | 36 - types/staking_test.go | 10 - x/distribution/keeper/allocation.go | 4 +- x/distribution/keeper/delegation.go | 8 +- x/distribution/keeper/grpc_query.go | 6 +- x/distribution/keeper/invariants.go | 6 +- x/distribution/keeper/querier.go | 6 +- x/distribution/keeper/validator.go | 6 +- x/distribution/types/expected_keepers.go | 15 +- x/evidence/types/expected_keepers.go | 4 +- x/gov/keeper/common_test.go | 6 +- x/gov/keeper/tally.go | 6 +- x/gov/keeper/tally_test.go | 19 +- x/gov/types/expected_keepers.go | 6 +- x/ibc/core/02-client/keeper/keeper_test.go | 2 +- x/slashing/abci_test.go | 3 +- x/slashing/app_test.go | 2 +- x/slashing/genesis.go | 4 +- x/slashing/handler_test.go | 10 +- x/slashing/keeper/keeper_test.go | 19 +- x/slashing/types/expected_keepers.go | 10 +- x/staking/app_test.go | 2 +- x/staking/client/rest/grpc_query_test.go | 2 +- x/staking/client/rest/query.go | 2 +- x/staking/exported/exported.go | 37 - x/staking/genesis.go | 7 +- x/staking/genesis_test.go | 12 +- x/staking/handler.go | 4 +- x/staking/handler_test.go | 14 +- x/staking/keeper/alias_functions.go | 15 +- x/staking/keeper/delegation.go | 12 +- x/staking/keeper/delegation_test.go | 14 +- x/staking/keeper/grpc_query.go | 2 +- x/staking/keeper/grpc_query_test.go | 10 +- x/staking/keeper/invariants.go | 7 +- x/staking/keeper/querier_test.go | 10 +- x/staking/keeper/slash.go | 4 +- x/staking/keeper/slash_test.go | 8 +- x/staking/keeper/val_state_change.go | 8 +- x/staking/keeper/validator_test.go | 50 +- x/staking/legacy/v040/migrate.go | 8 +- x/staking/legacy/v040/migrate_test.go | 2 +- x/staking/simulation/genesis_test.go | 2 +- x/staking/spec/05_end_block.md | 8 +- x/staking/types/delegation.go | 3 +- x/staking/types/expected_keepers.go | 19 +- x/staking/types/exported.go | 37 + x/staking/types/staking.pb.go | 1438 ++++++++++---------- x/staking/types/validator.go | 30 +- x/staking/types/validator_test.go | 51 +- 54 files changed, 1030 insertions(+), 1000 deletions(-) create mode 100644 x/staking/types/exported.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 094ffc042e..bd0e455be2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ older clients. * (server) [\#5982](https://github.com/cosmos/cosmos-sdk/pull/5982) `--pruning` now must be set to `custom` if you want to customise the granular options. * (x/gov) [\#7000](https://github.com/cosmos/cosmos-sdk/pull/7000) [\#6859](https://github.com/cosmos/cosmos-sdk/pull/6859) `ProposalStatus` and `VoteOption` are now JSON serialized using its protobuf name, so expect names like `PROPOSAL_STATUS_DEPOSIT_PERIOD` as opposed to `DepositPeriod`. * (x/auth/vesting) [\#6859](https://github.com/cosmos/cosmos-sdk/pull/6859) Custom JSON marshaling of vesting accounts was removed. Vesting accounts are now marshaled using their default proto or amino JSON representation. +* (x/staking) [\#7499](https://github.com/cosmos/cosmos-sdk/pull/7499) `BondStatus` is now a protobuf `enum` instead of an `int32`, and JSON serialized using its protobuf name, so expect names like `BOND_STATUS_UNBONDING` as opposed to `Unbonding`. ### API Breaking Changes diff --git a/proto/cosmos/staking/v1beta1/staking.proto b/proto/cosmos/staking/v1beta1/staking.proto index aee82dcb42..7201b7fa01 100644 --- a/proto/cosmos/staking/v1beta1/staking.proto +++ b/proto/cosmos/staking/v1beta1/staking.proto @@ -75,7 +75,7 @@ message Validator { string operator_address = 1 [(gogoproto.moretags) = "yaml:\"operator_address\""]; string consensus_pubkey = 2 [(gogoproto.moretags) = "yaml:\"consensus_pubkey\""]; bool jailed = 3; - int32 status = 4 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.BondStatus"]; + BondStatus status = 4; string tokens = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; string delegator_shares = 6 [ (gogoproto.moretags) = "yaml:\"delegator_shares\"", @@ -94,6 +94,20 @@ message Validator { ]; } +// BondStatus is the status of a validator. +enum BondStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // UNSPECIFIED defines an invalid validator status. + BOND_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"]; + // UNBONDED defines a validator that is not bonded. + BOND_STATUS_UNBONDED = 1 [(gogoproto.enumvalue_customname) = "Unbonded"]; + // UNBONDING defines a validator that is unbonding. + BOND_STATUS_UNBONDING = 2 [(gogoproto.enumvalue_customname) = "Unbonding"]; + // BONDED defines a validator that is bonded. + BOND_STATUS_BONDED = 3 [(gogoproto.enumvalue_customname) = "Bonded"]; +} + // ValAddresses defines a repeated set of validator addresses. message ValAddresses { option (gogoproto.goproto_stringer) = false; diff --git a/simapp/export.go b/simapp/export.go index 7586a90ae7..7105eca7fc 100644 --- a/simapp/export.go +++ b/simapp/export.go @@ -10,7 +10,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" - "github.com/cosmos/cosmos-sdk/x/staking/exported" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -72,7 +71,7 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] /* Handle fee distribution state. */ // withdraw all validator commission - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val exported.ValidatorI) (stop bool) { + app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) return false }) @@ -103,7 +102,7 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] ctx = ctx.WithBlockHeight(0) // reinitialize all validators - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val exported.ValidatorI) (stop bool) { + app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { // donate any unwithdrawn outstanding reward fraction tokens to the community pool scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) feePool := app.DistrKeeper.GetFeePool(ctx) diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index 136fde760e..8be599139b 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -96,7 +96,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs OperatorAddress: sdk.ValAddress(val.Address).String(), ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, val.PubKey), Jailed: false, - Status: sdk.Bonded, + Status: stakingtypes.Bonded, Tokens: bondAmt, DelegatorShares: sdk.OneDec(), Description: stakingtypes.Description{}, diff --git a/types/staking.go b/types/staking.go index 91c7601386..0753d808b2 100644 --- a/types/staking.go +++ b/types/staking.go @@ -34,39 +34,3 @@ func TokensToConsensusPower(tokens Int) int64 { func TokensFromConsensusPower(power int64) Int { return NewInt(power).Mul(PowerReduction) } - -// BondStatus is the status of a validator -type BondStatus int32 - -// staking constants -const ( - Unbonded BondStatus = 1 - Unbonding BondStatus = 2 - Bonded BondStatus = 3 - - BondStatusUnbonded = "Unbonded" - BondStatusUnbonding = "Unbonding" - BondStatusBonded = "Bonded" -) - -// Equal compares two BondStatus instances -func (b BondStatus) Equal(b2 BondStatus) bool { - return byte(b) == byte(b2) -} - -// String implements the Stringer interface for BondStatus. -func (b BondStatus) String() string { - switch b { - case Unbonded: - return BondStatusUnbonded - - case Unbonding: - return BondStatusUnbonding - - case Bonded: - return BondStatusBonded - - default: - panic("invalid bond status") - } -} diff --git a/types/staking_test.go b/types/staking_test.go index 4ad06cc18b..e307230cd9 100644 --- a/types/staking_test.go +++ b/types/staking_test.go @@ -20,16 +20,6 @@ func (s *stakingTestSuite) SetupSuite() { s.T().Parallel() } -func (s *stakingTestSuite) TestBondStatus() { - s.Require().False(sdk.Unbonded.Equal(sdk.Bonded)) - s.Require().False(sdk.Unbonded.Equal(sdk.Unbonding)) - s.Require().False(sdk.Bonded.Equal(sdk.Unbonding)) - s.Require().Panicsf(func() { sdk.BondStatus(0).String() }, "invalid bond status") // nolint:govet - s.Require().Equal(sdk.BondStatusUnbonded, sdk.Unbonded.String()) - s.Require().Equal(sdk.BondStatusBonded, sdk.Bonded.String()) - s.Require().Equal(sdk.BondStatusUnbonding, sdk.Unbonding.String()) -} - func (s *stakingTestSuite) TestTokensToConsensusPower() { s.Require().Equal(int64(0), sdk.TokensToConsensusPower(sdk.NewInt(999_999))) s.Require().Equal(int64(1), sdk.TokensToConsensusPower(sdk.NewInt(1_000_000))) diff --git a/x/distribution/keeper/allocation.go b/x/distribution/keeper/allocation.go index 593d02d04d..9436bada9d 100644 --- a/x/distribution/keeper/allocation.go +++ b/x/distribution/keeper/allocation.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/staking/exported" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // AllocateTokens handles distribution of the collected fees @@ -100,7 +100,7 @@ func (k Keeper) AllocateTokens( } // AllocateTokensToValidator allocate tokens to a particular validator, splitting according to commission -func (k Keeper) AllocateTokensToValidator(ctx sdk.Context, val exported.ValidatorI, tokens sdk.DecCoins) { +func (k Keeper) AllocateTokensToValidator(ctx sdk.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins) { // split tokens between validator and delegators according to commission commission := tokens.MulDec(val.GetCommission()) shared := tokens.Sub(commission) diff --git a/x/distribution/keeper/delegation.go b/x/distribution/keeper/delegation.go index 3febc98614..7d1e66611b 100644 --- a/x/distribution/keeper/delegation.go +++ b/x/distribution/keeper/delegation.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/staking/exported" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // initialize starting info for a new delegation @@ -28,7 +28,7 @@ func (k Keeper) initializeDelegation(ctx sdk.Context, val sdk.ValAddress, del sd } // calculate the rewards accrued by a delegation between two periods -func (k Keeper) calculateDelegationRewardsBetween(ctx sdk.Context, val exported.ValidatorI, +func (k Keeper) calculateDelegationRewardsBetween(ctx sdk.Context, val stakingtypes.ValidatorI, startingPeriod, endingPeriod uint64, stake sdk.Dec) (rewards sdk.DecCoins) { // sanity check if startingPeriod > endingPeriod { @@ -53,7 +53,7 @@ func (k Keeper) calculateDelegationRewardsBetween(ctx sdk.Context, val exported. } // calculate the total rewards accrued by a delegation -func (k Keeper) CalculateDelegationRewards(ctx sdk.Context, val exported.ValidatorI, del exported.DelegationI, endingPeriod uint64) (rewards sdk.DecCoins) { +func (k Keeper) CalculateDelegationRewards(ctx sdk.Context, val stakingtypes.ValidatorI, del stakingtypes.DelegationI, endingPeriod uint64) (rewards sdk.DecCoins) { // fetch starting info for delegation startingInfo := k.GetDelegatorStartingInfo(ctx, del.GetValidatorAddr(), del.GetDelegatorAddr()) @@ -136,7 +136,7 @@ func (k Keeper) CalculateDelegationRewards(ctx sdk.Context, val exported.Validat return rewards } -func (k Keeper) withdrawDelegationRewards(ctx sdk.Context, val exported.ValidatorI, del exported.DelegationI) (sdk.Coins, error) { +func (k Keeper) withdrawDelegationRewards(ctx sdk.Context, val stakingtypes.ValidatorI, del stakingtypes.DelegationI) (sdk.Coins, error) { // check existence of delegator starting info if !k.HasDelegatorStartingInfo(ctx, del.GetValidatorAddr(), del.GetDelegatorAddr()) { return nil, types.ErrEmptyDelegationDistInfo diff --git a/x/distribution/keeper/grpc_query.go b/x/distribution/keeper/grpc_query.go index 01817535e8..7991634fc4 100644 --- a/x/distribution/keeper/grpc_query.go +++ b/x/distribution/keeper/grpc_query.go @@ -11,7 +11,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/staking/exported" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) var _ types.QueryServer = Keeper{} @@ -178,7 +178,7 @@ func (k Keeper) DelegationTotalRewards(c context.Context, req *types.QueryDelega k.stakingKeeper.IterateDelegations( ctx, delAdr, - func(_ int64, del exported.DelegationI) (stop bool) { + func(_ int64, del stakingtypes.DelegationI) (stop bool) { valAddr := del.GetValidatorAddr() val := k.stakingKeeper.Validator(ctx, valAddr) endingPeriod := k.IncrementValidatorPeriod(ctx, val) @@ -212,7 +212,7 @@ func (k Keeper) DelegatorValidators(c context.Context, req *types.QueryDelegator k.stakingKeeper.IterateDelegations( ctx, delAdr, - func(_ int64, del exported.DelegationI) (stop bool) { + func(_ int64, del stakingtypes.DelegationI) (stop bool) { validators = append(validators, del.GetValidatorAddr().String()) return false }, diff --git a/x/distribution/keeper/invariants.go b/x/distribution/keeper/invariants.go index 45534b622e..0a23d36be8 100644 --- a/x/distribution/keeper/invariants.go +++ b/x/distribution/keeper/invariants.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/staking/exported" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // register all distribution invariants @@ -77,7 +77,7 @@ func CanWithdrawInvariant(k Keeper) sdk.Invariant { } // iterate over all validators - k.stakingKeeper.IterateValidators(ctx, func(_ int64, val exported.ValidatorI) (stop bool) { + k.stakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { _, _ = k.WithdrawValidatorCommission(ctx, val.GetOperator()) delegationAddrs, ok := valDelegationAddrs[val.GetOperator().String()] @@ -108,7 +108,7 @@ func ReferenceCountInvariant(k Keeper) sdk.Invariant { return func(ctx sdk.Context) (string, bool) { valCount := uint64(0) - k.stakingKeeper.IterateValidators(ctx, func(_ int64, val exported.ValidatorI) (stop bool) { + k.stakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { valCount++ return false }) diff --git a/x/distribution/keeper/querier.go b/x/distribution/keeper/querier.go index e2621eec2a..3d4c257b00 100644 --- a/x/distribution/keeper/querier.go +++ b/x/distribution/keeper/querier.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/staking/exported" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { @@ -172,7 +172,7 @@ func queryDelegatorTotalRewards(ctx sdk.Context, _ []string, req abci.RequestQue k.stakingKeeper.IterateDelegations( ctx, params.DelegatorAddress, - func(_ int64, del exported.DelegationI) (stop bool) { + func(_ int64, del stakingtypes.DelegationI) (stop bool) { valAddr := del.GetValidatorAddr() val := k.stakingKeeper.Validator(ctx, valAddr) endingPeriod := k.IncrementValidatorPeriod(ctx, val) @@ -208,7 +208,7 @@ func queryDelegatorValidators(ctx sdk.Context, _ []string, req abci.RequestQuery k.stakingKeeper.IterateDelegations( ctx, params.DelegatorAddress, - func(_ int64, del exported.DelegationI) (stop bool) { + func(_ int64, del stakingtypes.DelegationI) (stop bool) { validators = append(validators, del.GetValidatorAddr()) return false }, diff --git a/x/distribution/keeper/validator.go b/x/distribution/keeper/validator.go index 3ebd6c8c6c..3d1953c3b5 100644 --- a/x/distribution/keeper/validator.go +++ b/x/distribution/keeper/validator.go @@ -6,11 +6,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/staking/exported" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // initialize rewards for a new validator -func (k Keeper) initializeValidator(ctx sdk.Context, val exported.ValidatorI) { +func (k Keeper) initializeValidator(ctx sdk.Context, val stakingtypes.ValidatorI) { // set initial historical rewards (period 0) with reference count of 1 k.SetValidatorHistoricalRewards(ctx, val.GetOperator(), 0, types.NewValidatorHistoricalRewards(sdk.DecCoins{}, 1)) @@ -25,7 +25,7 @@ func (k Keeper) initializeValidator(ctx sdk.Context, val exported.ValidatorI) { } // increment validator period, returning the period just ended -func (k Keeper) IncrementValidatorPeriod(ctx sdk.Context, val exported.ValidatorI) uint64 { +func (k Keeper) IncrementValidatorPeriod(ctx sdk.Context, val stakingtypes.ValidatorI) uint64 { // fetch current rewards rewards := k.GetValidatorCurrentRewards(ctx, val.GetOperator()) diff --git a/x/distribution/types/expected_keepers.go b/x/distribution/types/expected_keepers.go index c83464dea7..29346d3908 100644 --- a/x/distribution/types/expected_keepers.go +++ b/x/distribution/types/expected_keepers.go @@ -3,7 +3,6 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" - stakingexported "github.com/cosmos/cosmos-sdk/x/staking/exported" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -35,18 +34,18 @@ type BankKeeper interface { type StakingKeeper interface { // iterate through validators by operator address, execute func for each validator IterateValidators(sdk.Context, - func(index int64, validator stakingexported.ValidatorI) (stop bool)) + func(index int64, validator stakingtypes.ValidatorI) (stop bool)) // iterate through bonded validators by operator address, execute func for each validator IterateBondedValidatorsByPower(sdk.Context, - func(index int64, validator stakingexported.ValidatorI) (stop bool)) + func(index int64, validator stakingtypes.ValidatorI) (stop bool)) // iterate through the consensus validator set of the last block by operator address, execute func for each validator IterateLastValidators(sdk.Context, - func(index int64, validator stakingexported.ValidatorI) (stop bool)) + func(index int64, validator stakingtypes.ValidatorI) (stop bool)) - Validator(sdk.Context, sdk.ValAddress) stakingexported.ValidatorI // get a particular validator by operator address - ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingexported.ValidatorI // get a particular validator by consensus address + Validator(sdk.Context, sdk.ValAddress) stakingtypes.ValidatorI // get a particular validator by operator address + ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI // get a particular validator by consensus address // slash the validator and delegators of the validator, specifying offence height, offence power, and slash fraction Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) @@ -55,13 +54,13 @@ type StakingKeeper interface { // Delegation allows for getting a particular delegation for a given validator // and delegator outside the scope of the staking module. - Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingexported.DelegationI + Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingtypes.DelegationI // MaxValidators returns the maximum amount of bonded validators MaxValidators(sdk.Context) uint32 IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, - fn func(index int64, delegation stakingexported.DelegationI) (stop bool)) + fn func(index int64, delegation stakingtypes.DelegationI) (stop bool)) GetLastTotalPower(ctx sdk.Context) sdk.Int GetLastValidatorPower(ctx sdk.Context, valAddr sdk.ValAddress) int64 diff --git a/x/evidence/types/expected_keepers.go b/x/evidence/types/expected_keepers.go index 501371ce9a..23c9b40bdc 100644 --- a/x/evidence/types/expected_keepers.go +++ b/x/evidence/types/expected_keepers.go @@ -6,14 +6,14 @@ import ( "github.com/tendermint/tendermint/crypto" sdk "github.com/cosmos/cosmos-sdk/types" - stakingexported "github.com/cosmos/cosmos-sdk/x/staking/exported" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) type ( // StakingKeeper defines the staking module interface contract needed by the // evidence module. StakingKeeper interface { - ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingexported.ValidatorI + ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI } // SlashingKeeper defines the slashing module interface contract needed by the diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index 461e4fe0be..b9b8e2ba35 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -41,9 +41,9 @@ func createValidators(ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sd app.StakingKeeper.SetNewValidatorByPowerIndex(ctx, val2) app.StakingKeeper.SetNewValidatorByPowerIndex(ctx, val3) - _, _ = app.StakingKeeper.Delegate(ctx, addrs[0], sdk.TokensFromConsensusPower(powers[0]), sdk.Unbonded, val1, true) - _, _ = app.StakingKeeper.Delegate(ctx, addrs[1], sdk.TokensFromConsensusPower(powers[1]), sdk.Unbonded, val2, true) - _, _ = app.StakingKeeper.Delegate(ctx, addrs[2], sdk.TokensFromConsensusPower(powers[2]), sdk.Unbonded, val3, true) + _, _ = app.StakingKeeper.Delegate(ctx, addrs[0], sdk.TokensFromConsensusPower(powers[0]), stakingtypes.Unbonded, val1, true) + _, _ = app.StakingKeeper.Delegate(ctx, addrs[1], sdk.TokensFromConsensusPower(powers[1]), stakingtypes.Unbonded, val2, true) + _, _ = app.StakingKeeper.Delegate(ctx, addrs[2], sdk.TokensFromConsensusPower(powers[2]), stakingtypes.Unbonded, val3, true) _ = staking.EndBlocker(ctx, app.StakingKeeper) diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 20fe742b24..796609db5a 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/staking/exported" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // TODO: Break into several smaller functions for clarity @@ -21,7 +21,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal types.Proposal) (passes boo currValidators := make(map[string]types.ValidatorGovInfo) // fetch all the bonded validators, insert them into currValidators - keeper.sk.IterateBondedValidatorsByPower(ctx, func(index int64, validator exported.ValidatorI) (stop bool) { + keeper.sk.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingtypes.ValidatorI) (stop bool) { currValidators[validator.GetOperator().String()] = types.NewValidatorGovInfo( validator.GetOperator(), validator.GetBondedTokens(), @@ -48,7 +48,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal types.Proposal) (passes boo } // iterate over all delegations from voter, deduct from any delegated-to validators - keeper.sk.IterateDelegations(ctx, voter, func(index int64, delegation exported.DelegationI) (stop bool) { + keeper.sk.IterateDelegations(ctx, voter, func(index int64, delegation stakingtypes.DelegationI) (stop bool) { valAddrStr := delegation.GetValidatorAddr().String() if val, ok := currValidators[valAddrStr]; ok { diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 0589b59bb2..e4f6547e90 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -10,6 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/staking" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) func TestTallyNoOneVotes(t *testing.T) { @@ -248,7 +249,7 @@ func TestTallyDelgatorOverride(t *testing.T) { val1, found := app.StakingKeeper.GetValidator(ctx, valAddrs[0]) require.True(t, found) - _, err := app.StakingKeeper.Delegate(ctx, addrs[4], delTokens, sdk.Unbonded, val1, true) + _, err := app.StakingKeeper.Delegate(ctx, addrs[4], delTokens, stakingtypes.Unbonded, val1, true) require.NoError(t, err) _ = staking.EndBlocker(ctx, app.StakingKeeper) @@ -284,7 +285,7 @@ func TestTallyDelgatorInherit(t *testing.T) { val3, found := app.StakingKeeper.GetValidator(ctx, vals[2]) require.True(t, found) - _, err := app.StakingKeeper.Delegate(ctx, addrs[3], delTokens, sdk.Unbonded, val3, true) + _, err := app.StakingKeeper.Delegate(ctx, addrs[3], delTokens, stakingtypes.Unbonded, val3, true) require.NoError(t, err) _ = staking.EndBlocker(ctx, app.StakingKeeper) @@ -321,9 +322,9 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) { val2, found := app.StakingKeeper.GetValidator(ctx, vals[1]) require.True(t, found) - _, err := app.StakingKeeper.Delegate(ctx, addrs[3], delTokens, sdk.Unbonded, val1, true) + _, err := app.StakingKeeper.Delegate(ctx, addrs[3], delTokens, stakingtypes.Unbonded, val1, true) require.NoError(t, err) - _, err = app.StakingKeeper.Delegate(ctx, addrs[3], delTokens, sdk.Unbonded, val2, true) + _, err = app.StakingKeeper.Delegate(ctx, addrs[3], delTokens, stakingtypes.Unbonded, val2, true) require.NoError(t, err) _ = staking.EndBlocker(ctx, app.StakingKeeper) @@ -363,9 +364,9 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) { val3, found := app.StakingKeeper.GetValidator(ctx, vals[2]) require.True(t, found) - _, err := app.StakingKeeper.Delegate(ctx, addrs[3], delTokens, sdk.Unbonded, val2, true) + _, err := app.StakingKeeper.Delegate(ctx, addrs[3], delTokens, stakingtypes.Unbonded, val2, true) require.NoError(t, err) - _, err = app.StakingKeeper.Delegate(ctx, addrs[3], delTokens, sdk.Unbonded, val3, true) + _, err = app.StakingKeeper.Delegate(ctx, addrs[3], delTokens, stakingtypes.Unbonded, val3, true) require.NoError(t, err) _ = staking.EndBlocker(ctx, app.StakingKeeper) @@ -402,9 +403,9 @@ func TestTallyJailedValidator(t *testing.T) { val3, found := app.StakingKeeper.GetValidator(ctx, valAddrs[2]) require.True(t, found) - _, err := app.StakingKeeper.Delegate(ctx, addrs[3], delTokens, sdk.Unbonded, val2, true) + _, err := app.StakingKeeper.Delegate(ctx, addrs[3], delTokens, stakingtypes.Unbonded, val2, true) require.NoError(t, err) - _, err = app.StakingKeeper.Delegate(ctx, addrs[3], delTokens, sdk.Unbonded, val3, true) + _, err = app.StakingKeeper.Delegate(ctx, addrs[3], delTokens, stakingtypes.Unbonded, val3, true) require.NoError(t, err) _ = staking.EndBlocker(ctx, app.StakingKeeper) @@ -441,7 +442,7 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) { val2, found := app.StakingKeeper.GetValidator(ctx, valAddrs[1]) require.True(t, found) - _, err := app.StakingKeeper.Delegate(ctx, addrs[0], delTokens, sdk.Unbonded, val2, true) + _, err := app.StakingKeeper.Delegate(ctx, addrs[0], delTokens, stakingtypes.Unbonded, val2, true) require.NoError(t, err) tp := TestProposal diff --git a/x/gov/types/expected_keepers.go b/x/gov/types/expected_keepers.go index fcaa095369..f862a9bce5 100644 --- a/x/gov/types/expected_keepers.go +++ b/x/gov/types/expected_keepers.go @@ -3,7 +3,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" - stakingexported "github.com/cosmos/cosmos-sdk/x/staking/exported" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // ParamSubspace defines the expected Subspace interface for parameters (noalias) @@ -16,13 +16,13 @@ type ParamSubspace interface { type StakingKeeper interface { // iterate through bonded validators by operator address, execute func for each validator IterateBondedValidatorsByPower( - sdk.Context, func(index int64, validator stakingexported.ValidatorI) (stop bool), + sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool), ) TotalBondedTokens(sdk.Context) sdk.Int // total bonded tokens within the validator set IterateDelegations( ctx sdk.Context, delegator sdk.AccAddress, - fn func(index int64, delegation stakingexported.DelegationI) (stop bool), + fn func(index int64, delegation stakingtypes.DelegationI) (stop bool), ) } diff --git a/x/ibc/core/02-client/keeper/keeper_test.go b/x/ibc/core/02-client/keeper/keeper_test.go index 21da1ad63a..8db04b6432 100644 --- a/x/ibc/core/02-client/keeper/keeper_test.go +++ b/x/ibc/core/02-client/keeper/keeper_test.go @@ -103,7 +103,7 @@ func (suite *KeeperTestSuite) SetupTest() { pk, err := privVal.GetPubKey() suite.Require().NoError(err) val := stakingtypes.NewValidator(sdk.ValAddress(pk.Address()), pk, stakingtypes.Description{}) - val.Status = sdk.Bonded + val.Status = stakingtypes.Bonded val.Tokens = sdk.NewInt(rand.Int63()) validators = append(validators, val) diff --git a/x/slashing/abci_test.go b/x/slashing/abci_test.go index 0b6026bcde..484870719b 100644 --- a/x/slashing/abci_test.go +++ b/x/slashing/abci_test.go @@ -13,6 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/slashing" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" "github.com/cosmos/cosmos-sdk/x/staking" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) func TestBeginBlocker(t *testing.T) { @@ -100,5 +101,5 @@ func TestBeginBlocker(t *testing.T) { // validator should be jailed validator, found := app.StakingKeeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pk)) require.True(t, found) - require.Equal(t, sdk.Unbonding, validator.GetStatus()) + require.Equal(t, stakingtypes.Unbonding, validator.GetStatus()) } diff --git a/x/slashing/app_test.go b/x/slashing/app_test.go index 72330875b2..3e4735e43a 100644 --- a/x/slashing/app_test.go +++ b/x/slashing/app_test.go @@ -78,7 +78,7 @@ func TestSlashingMsgs(t *testing.T) { validator := checkValidator(t, app, addr1, true) require.Equal(t, sdk.ValAddress(addr1).String(), validator.OperatorAddress) - require.Equal(t, sdk.Bonded, validator.Status) + require.Equal(t, stakingtypes.Bonded, validator.Status) require.True(sdk.IntEq(t, bondTokens, validator.BondedTokens())) unjailMsg := &types.MsgUnjail{ValidatorAddr: sdk.ValAddress(addr1).String()} diff --git a/x/slashing/genesis.go b/x/slashing/genesis.go index 3c38fa431c..87fa12237c 100644 --- a/x/slashing/genesis.go +++ b/x/slashing/genesis.go @@ -4,14 +4,14 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/keeper" "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/staking/exported" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // InitGenesis initialize default parameters // and the keeper's address to pubkey map func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, stakingKeeper types.StakingKeeper, data *types.GenesisState) { stakingKeeper.IterateValidators(ctx, - func(index int64, validator exported.ValidatorI) bool { + func(index int64, validator stakingtypes.ValidatorI) bool { keeper.AddPubkey(ctx, validator.GetConsPubKey()) return false }, diff --git a/x/slashing/handler_test.go b/x/slashing/handler_test.go index 9e944fa2d0..3e5bba742c 100644 --- a/x/slashing/handler_test.go +++ b/x/slashing/handler_test.go @@ -231,7 +231,7 @@ func TestHandleAbsentValidator(t *testing.T) { // validator should be bonded still validator, _ := app.StakingKeeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(val)) - require.Equal(t, sdk.Bonded, validator.GetStatus()) + require.Equal(t, stakingtypes.Bonded, validator.GetStatus()) bondPool := app.StakingKeeper.GetBondedPool(ctx) require.True(sdk.IntEq(t, amt, app.BankKeeper.GetBalance(ctx, bondPool.GetAddress(), app.StakingKeeper.BondDenom(ctx)).Amount)) @@ -250,7 +250,7 @@ func TestHandleAbsentValidator(t *testing.T) { // validator should have been jailed validator, _ = app.StakingKeeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(val)) - require.Equal(t, sdk.Unbonding, validator.GetStatus()) + require.Equal(t, stakingtypes.Unbonding, validator.GetStatus()) slashAmt := amt.ToDec().Mul(app.SlashingKeeper.SlashFractionDowntime(ctx)).RoundInt64() @@ -289,7 +289,7 @@ func TestHandleAbsentValidator(t *testing.T) { // validator should be rebonded now validator, _ = app.StakingKeeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(val)) - require.Equal(t, sdk.Bonded, validator.GetStatus()) + require.Equal(t, stakingtypes.Bonded, validator.GetStatus()) // validator should have been slashed require.Equal(t, amt.Int64()-slashAmt, app.BankKeeper.GetBalance(ctx, bondPool.GetAddress(), app.StakingKeeper.BondDenom(ctx)).Amount.Int64()) @@ -306,7 +306,7 @@ func TestHandleAbsentValidator(t *testing.T) { ctx = ctx.WithBlockHeight(height) app.SlashingKeeper.HandleValidatorSignature(ctx, val.Address(), power, false) validator, _ = app.StakingKeeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(val)) - require.Equal(t, sdk.Bonded, validator.GetStatus()) + require.Equal(t, stakingtypes.Bonded, validator.GetStatus()) // 500 signed blocks nextHeight := height + app.SlashingKeeper.MinSignedPerWindow(ctx) + 1 @@ -329,5 +329,5 @@ func TestHandleAbsentValidator(t *testing.T) { staking.EndBlocker(ctx, app.StakingKeeper) validator, _ = app.StakingKeeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(val)) - require.Equal(t, sdk.Unbonding, validator.GetStatus()) + require.Equal(t, stakingtypes.Unbonding, validator.GetStatus()) } diff --git a/x/slashing/keeper/keeper_test.go b/x/slashing/keeper/keeper_test.go index 5231edc79a..d8e49a11c5 100644 --- a/x/slashing/keeper/keeper_test.go +++ b/x/slashing/keeper/keeper_test.go @@ -54,7 +54,7 @@ func TestUnJailNotBonded(t *testing.T) { validator, ok := app.StakingKeeper.GetValidator(ctx, addr) require.True(t, ok) require.False(t, validator.Jailed) - require.Equal(t, sdk.BondStatusUnbonded, validator.GetStatus().String()) + require.Equal(t, stakingtypes.BondStatusUnbonded, validator.GetStatus().String()) // unbond below minimum self-delegation msgUnbond := stakingtypes.NewMsgUndelegate(sdk.AccAddress(addr), addr, sdk.NewCoin(p.BondDenom, sdk.TokensFromConsensusPower(1))) @@ -137,7 +137,7 @@ func TestHandleNewValidator(t *testing.T) { // validator should be bonded still, should not have been jailed or slashed validator, _ := app.StakingKeeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(val)) - require.Equal(t, sdk.Bonded, validator.GetStatus()) + require.Equal(t, stakingtypes.Bonded, validator.GetStatus()) bondPool := app.StakingKeeper.GetBondedPool(ctx) expTokens := sdk.TokensFromConsensusPower(100) require.Equal(t, expTokens.Int64(), app.BankKeeper.GetBalance(ctx, bondPool.GetAddress(), app.StakingKeeper.BondDenom(ctx)).Amount.Int64()) @@ -182,7 +182,7 @@ func TestHandleAlreadyJailed(t *testing.T) { // validator should have been jailed and slashed validator, _ := app.StakingKeeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(val)) - require.Equal(t, sdk.Unbonding, validator.GetStatus()) + require.Equal(t, stakingtypes.Unbonding, validator.GetStatus()) // validator should have been slashed resultingTokens := amt.Sub(sdk.TokensFromConsensusPower(1)) @@ -242,7 +242,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { validatorUpdates := staking.EndBlocker(ctx, app.StakingKeeper) require.Equal(t, 2, len(validatorUpdates)) validator, _ := app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addr)) - require.Equal(t, sdk.Unbonding, validator.Status) + require.Equal(t, stakingtypes.Unbonding, validator.Status) // 600 more blocks happened height = int64(700) @@ -257,7 +257,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { validatorUpdates = staking.EndBlocker(ctx, app.StakingKeeper) require.Equal(t, 2, len(validatorUpdates)) validator, _ = app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addr)) - require.Equal(t, sdk.Bonded, validator.Status) + require.Equal(t, stakingtypes.Bonded, validator.Status) newPower := int64(150) // validator misses a block @@ -266,7 +266,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { // shouldn't be jailed/kicked yet validator, _ = app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addr)) - require.Equal(t, sdk.Bonded, validator.Status) + require.Equal(t, stakingtypes.Bonded, validator.Status) // validator misses 500 more blocks, 501 total latest := height @@ -278,7 +278,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { // should now be jailed & kicked staking.EndBlocker(ctx, app.StakingKeeper) validator, _ = app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addr)) - require.Equal(t, sdk.Unbonding, validator.Status) + require.Equal(t, stakingtypes.Unbonding, validator.Status) // check all the signing information signInfo, found := app.SlashingKeeper.GetValidatorSigningInfo(ctx, consAddr) @@ -303,7 +303,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { // validator should not be kicked since we reset counter/array when it was jailed staking.EndBlocker(ctx, app.StakingKeeper) validator, _ = app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addr)) - require.Equal(t, sdk.Bonded, validator.Status) + require.Equal(t, stakingtypes.Bonded, validator.Status) // validator misses 501 blocks latest = height @@ -315,6 +315,5 @@ func TestValidatorDippingInAndOut(t *testing.T) { // validator should now be jailed & kicked staking.EndBlocker(ctx, app.StakingKeeper) validator, _ = app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addr)) - require.Equal(t, sdk.Unbonding, validator.Status) - + require.Equal(t, stakingtypes.Unbonding, validator.Status) } diff --git a/x/slashing/types/expected_keepers.go b/x/slashing/types/expected_keepers.go index 4a09ca7298..538a030baa 100644 --- a/x/slashing/types/expected_keepers.go +++ b/x/slashing/types/expected_keepers.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" auth "github.com/cosmos/cosmos-sdk/x/auth/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - stakingexported "github.com/cosmos/cosmos-sdk/x/staking/exported" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // AccountKeeper expected account keeper @@ -37,10 +37,10 @@ type ParamSubspace interface { type StakingKeeper interface { // iterate through validators by operator address, execute func for each validator IterateValidators(sdk.Context, - func(index int64, validator stakingexported.ValidatorI) (stop bool)) + func(index int64, validator stakingtypes.ValidatorI) (stop bool)) - Validator(sdk.Context, sdk.ValAddress) stakingexported.ValidatorI // get a particular validator by operator address - ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingexported.ValidatorI // get a particular validator by consensus address + Validator(sdk.Context, sdk.ValAddress) stakingtypes.ValidatorI // get a particular validator by operator address + ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI // get a particular validator by consensus address // slash the validator and delegators of the validator, specifying offence height, offence power, and slash fraction Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) @@ -49,7 +49,7 @@ type StakingKeeper interface { // Delegation allows for getting a particular delegation for a given validator // and delegator outside the scope of the staking module. - Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingexported.DelegationI + Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingtypes.DelegationI // MaxValidators returns the maximum amount of bonded validators MaxValidators(sdk.Context) uint32 diff --git a/x/staking/app_test.go b/x/staking/app_test.go index 7e74d51b66..2f33961021 100644 --- a/x/staking/app_test.go +++ b/x/staking/app_test.go @@ -80,7 +80,7 @@ func TestStakingMsgs(t *testing.T) { validator := checkValidator(t, app, sdk.ValAddress(addr1), true) require.Equal(t, sdk.ValAddress(addr1).String(), validator.OperatorAddress) - require.Equal(t, sdk.Bonded, validator.Status) + require.Equal(t, types.Bonded, validator.Status) require.True(sdk.IntEq(t, bondTokens, validator.BondedTokens())) header = tmproto.Header{Height: app.LastBlockHeight() + 1} diff --git a/x/staking/client/rest/grpc_query_test.go b/x/staking/client/rest/grpc_query_test.go index 73386fb62a..8383537055 100644 --- a/x/staking/client/rest/grpc_query_test.go +++ b/x/staking/client/rest/grpc_query_test.go @@ -83,7 +83,7 @@ func (s *IntegrationTestSuite) TestQueryValidatorsGRPCHandler() { }, { "test query validators gRPC route with valid status", - fmt.Sprintf("%s/cosmos/staking/v1beta1/validators?status=%s", baseURL, sdk.Bonded.String()), + fmt.Sprintf("%s/cosmos/staking/v1beta1/validators?status=%s", baseURL, types.Bonded.String()), false, }, } diff --git a/x/staking/client/rest/query.go b/x/staking/client/rest/query.go index 8a326c93bc..cbe0813c32 100644 --- a/x/staking/client/rest/query.go +++ b/x/staking/client/rest/query.go @@ -279,7 +279,7 @@ func validatorsHandlerFn(clientCtx client.Context) http.HandlerFunc { status := r.FormValue("status") if status == "" { - status = sdk.BondStatusBonded + status = types.BondStatusBonded } params := types.NewQueryValidatorsParams(page, limit, status) diff --git a/x/staking/exported/exported.go b/x/staking/exported/exported.go index 7c8a257cd3..eabd8aa3dd 100644 --- a/x/staking/exported/exported.go +++ b/x/staking/exported/exported.go @@ -1,38 +1 @@ package exported - -import ( - "github.com/tendermint/tendermint/crypto" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// DelegationI delegation bond for a delegated proof of stake system -type DelegationI interface { - GetDelegatorAddr() sdk.AccAddress // delegator sdk.AccAddress for the bond - GetValidatorAddr() sdk.ValAddress // validator operator address - GetShares() sdk.Dec // amount of validator's shares held in this delegation -} - -// ValidatorI expected validator functions -type ValidatorI interface { - IsJailed() bool // whether the validator is jailed - GetMoniker() string // moniker of the validator - GetStatus() sdk.BondStatus // status of the validator - IsBonded() bool // check if has a bonded status - IsUnbonded() bool // check if has status unbonded - IsUnbonding() bool // check if has status unbonding - GetOperator() sdk.ValAddress // operator address to receive/return validators coins - GetConsPubKey() crypto.PubKey // validation consensus pubkey - GetConsAddr() sdk.ConsAddress // validation consensus address - GetTokens() sdk.Int // validation tokens - GetBondedTokens() sdk.Int // validator bonded tokens - GetConsensusPower() int64 // validation power in tendermint - GetCommission() sdk.Dec // validator commission rate - GetMinSelfDelegation() sdk.Int // validator minimum self delegation - GetDelegatorShares() sdk.Dec // total outstanding delegator shares - TokensFromShares(sdk.Dec) sdk.Dec // token worth of provided delegator shares - TokensFromSharesTruncated(sdk.Dec) sdk.Dec // token worth of provided delegator shares, truncated - TokensFromSharesRoundUp(sdk.Dec) sdk.Dec // token worth of provided delegator shares, rounded up - SharesFromTokens(amt sdk.Int) (sdk.Dec, error) // shares worth of delegator's bond - SharesFromTokensTruncated(amt sdk.Int) (sdk.Dec, error) // truncated shares worth of delegator's bond -} diff --git a/x/staking/genesis.go b/x/staking/genesis.go index c339707e53..e55c32e551 100644 --- a/x/staking/genesis.go +++ b/x/staking/genesis.go @@ -7,7 +7,6 @@ import ( tmtypes "github.com/tendermint/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/staking/exported" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -52,9 +51,9 @@ func InitGenesis( } switch validator.GetStatus() { - case sdk.Bonded: + case types.Bonded: bondedTokens = bondedTokens.Add(validator.GetTokens()) - case sdk.Unbonding, sdk.Unbonded: + case types.Unbonding, types.Unbonded: notBondedTokens = notBondedTokens.Add(validator.GetTokens()) default: panic("invalid validator status") @@ -192,7 +191,7 @@ func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) *types.GenesisState { // WriteValidators returns a slice of bonded genesis validators. func WriteValidators(ctx sdk.Context, keeper keeper.Keeper) (vals []tmtypes.GenesisValidator) { - keeper.IterateLastValidators(ctx, func(_ int64, validator exported.ValidatorI) (stop bool) { + keeper.IterateLastValidators(ctx, func(_ int64, validator types.ValidatorI) (stop bool) { vals = append(vals, tmtypes.GenesisValidator{ Address: validator.GetConsAddr().Bytes(), PubKey: validator.GetConsPubKey(), diff --git a/x/staking/genesis_test.go b/x/staking/genesis_test.go index 6ee682b563..d9a08e219c 100644 --- a/x/staking/genesis_test.go +++ b/x/staking/genesis_test.go @@ -53,13 +53,13 @@ func TestInitGenesis(t *testing.T) { validators[0].OperatorAddress = sdk.ValAddress(addrs[0]).String() validators[0].ConsensusPubkey = pk0 validators[0].Description = types.NewDescription("hoop", "", "", "", "") - validators[0].Status = sdk.Bonded + validators[0].Status = types.Bonded validators[0].Tokens = valTokens validators[0].DelegatorShares = valTokens.ToDec() validators[1].OperatorAddress = sdk.ValAddress(addrs[1]).String() validators[1].ConsensusPubkey = pk1 validators[1].Description = types.NewDescription("bloop", "", "", "", "") - validators[1].Status = sdk.Bonded + validators[1].Status = types.Bonded validators[1].Tokens = valTokens validators[1].DelegatorShares = valTokens.ToDec() @@ -79,11 +79,11 @@ func TestInitGenesis(t *testing.T) { // now make sure the validators are bonded and intra-tx counters are correct resVal, found := app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addrs[0])) require.True(t, found) - require.Equal(t, sdk.Bonded, resVal.Status) + require.Equal(t, types.Bonded, resVal.Status) resVal, found = app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addrs[1])) require.True(t, found) - require.Equal(t, sdk.Bonded, resVal.Status) + require.Equal(t, types.Bonded, resVal.Status) abcivals := make([]abci.ValidatorUpdate, len(vals)) for i, val := range validators { @@ -107,7 +107,7 @@ func TestInitGenesisLargeValidatorSet(t *testing.T) { validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.NewDescription(fmt.Sprintf("#%d", i), "", "", "", "")) - validators[i].Status = sdk.Bonded + validators[i].Status = types.Bonded tokens := sdk.TokensFromConsensusPower(1) if i < 100 { @@ -153,7 +153,7 @@ func TestValidateGenesis(t *testing.T) { {"jailed and bonded validator", func(data *types.GenesisState) { data.Validators = genValidators1 data.Validators[0].Jailed = true - data.Validators[0].Status = sdk.Bonded + data.Validators[0].Status = types.Bonded }, true}, } diff --git a/x/staking/handler.go b/x/staking/handler.go index 6c647f9343..4da6b05a66 100644 --- a/x/staking/handler.go +++ b/x/staking/handler.go @@ -111,7 +111,7 @@ func handleMsgCreateValidator(ctx sdk.Context, msg *types.MsgCreateValidator, k // move coins from the msg.Address account to a (self-delegation) delegator account // the validator account and global shares are updated within here // NOTE source will always be from a wallet which are unbonded - _, err = k.Delegate(ctx, delegatorAddress, msg.Value.Amount, sdk.Unbonded, validator, true) + _, err = k.Delegate(ctx, delegatorAddress, msg.Value.Amount, types.Unbonded, validator, true) if err != nil { return nil, err } @@ -215,7 +215,7 @@ func handleMsgDelegate(ctx sdk.Context, msg *types.MsgDelegate, k keeper.Keeper) } // NOTE: source funds are always unbonded - _, err = k.Delegate(ctx, delegatorAddress, msg.Amount.Amount, sdk.Unbonded, validator, true) + _, err = k.Delegate(ctx, delegatorAddress, msg.Amount.Amount, types.Unbonded, validator, true) if err != nil { return nil, err } diff --git a/x/staking/handler_test.go b/x/staking/handler_test.go index f4cf4c72f1..8114355d90 100644 --- a/x/staking/handler_test.go +++ b/x/staking/handler_test.go @@ -91,7 +91,7 @@ func TestValidatorByPowerIndex(t *testing.T) { validator, found = app.StakingKeeper.GetValidator(ctx, validatorAddr) require.True(t, found) - require.Equal(t, sdk.Unbonding, validator.Status) // ensure is unbonding + require.Equal(t, types.Unbonding, validator.Status) // ensure is unbonding require.Equal(t, initBond.QuoRaw(2), validator.Tokens) // ensure tokens slashed app.StakingKeeper.Unjail(ctx, consAddr0) @@ -152,7 +152,7 @@ func TestDuplicatesMsgCreateValidator(t *testing.T) { validator, found := app.StakingKeeper.GetValidator(ctx, addr1) require.True(t, found) - assert.Equal(t, sdk.Bonded, validator.Status) + assert.Equal(t, types.Bonded, validator.Status) assert.Equal(t, addr1.String(), validator.OperatorAddress) assert.Equal(t, pk1.(cryptotypes.IntoTmPubKey).AsTmPubKey(), validator.GetConsPubKey()) assert.Equal(t, valTokens, validator.BondedTokens()) @@ -184,7 +184,7 @@ func TestDuplicatesMsgCreateValidator(t *testing.T) { validator, found = app.StakingKeeper.GetValidator(ctx, addr2) require.True(t, found) - assert.Equal(t, sdk.Bonded, validator.Status) + assert.Equal(t, types.Bonded, validator.Status) assert.Equal(t, addr2.String(), validator.OperatorAddress) assert.Equal(t, pk2.(cryptotypes.IntoTmPubKey).AsTmPubKey(), validator.GetConsPubKey()) assert.True(sdk.IntEq(t, valTokens, validator.Tokens)) @@ -231,7 +231,7 @@ func TestLegacyValidatorDelegations(t *testing.T) { // verify the validator exists and has the correct attributes validator, found := app.StakingKeeper.GetValidator(ctx, valAddr) require.True(t, found) - require.Equal(t, sdk.Bonded, validator.Status) + require.Equal(t, types.Bonded, validator.Status) require.Equal(t, bondAmount, validator.DelegatorShares.RoundInt()) require.Equal(t, bondAmount, validator.BondedTokens()) @@ -332,7 +332,7 @@ func TestIncrementsMsgDelegate(t *testing.T) { validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddr) require.True(t, found) - require.Equal(t, sdk.Bonded, validator.Status) + require.Equal(t, types.Bonded, validator.Status) require.Equal(t, bondAmount, validator.DelegatorShares.RoundInt()) require.Equal(t, bondAmount, validator.BondedTokens(), "validator: %v", validator) @@ -1318,7 +1318,7 @@ func TestUnbondingWhenExcessValidators(t *testing.T) { require.Equal(t, 2, len(vals), "vals %v", vals) val1, found := app.StakingKeeper.GetValidator(ctx, validatorAddr1) require.True(t, found) - require.Equal(t, sdk.Bonded, val1.Status, "%v", val1) + require.Equal(t, types.Bonded, val1.Status, "%v", val1) } func TestBondUnbondRedelegateSlashTwice(t *testing.T) { @@ -1426,7 +1426,7 @@ func TestBondUnbondRedelegateSlashTwice(t *testing.T) { // validator power should have been reduced to zero // validator should be in unbonding state validator, _ = app.StakingKeeper.GetValidator(ctx, valA) - require.Equal(t, validator.GetStatus(), sdk.Unbonding) + require.Equal(t, validator.GetStatus(), types.Unbonding) } func TestInvalidMsg(t *testing.T) { diff --git a/x/staking/keeper/alias_functions.go b/x/staking/keeper/alias_functions.go index 6722133e7f..1d563c6907 100644 --- a/x/staking/keeper/alias_functions.go +++ b/x/staking/keeper/alias_functions.go @@ -4,7 +4,6 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/staking/exported" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -12,7 +11,7 @@ import ( // Validator Set // iterate through the validator set and perform the provided function -func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator exported.ValidatorI) (stop bool)) { +func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.ValidatorsKey) @@ -32,7 +31,7 @@ func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validato } // iterate through the bonded validator set and perform the provided function -func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index int64, validator exported.ValidatorI) (stop bool)) { +func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) { store := ctx.KVStore(k.storeKey) maxValidators := k.MaxValidators(ctx) @@ -55,7 +54,7 @@ func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index in } // iterate through the active validator set and perform the provided function -func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, validator exported.ValidatorI) (stop bool)) { +func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) { iterator := k.LastValidatorsIterator(ctx) defer iterator.Close() @@ -78,7 +77,7 @@ func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, vali } // Validator gets the Validator interface for a particular address -func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) exported.ValidatorI { +func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) types.ValidatorI { val, found := k.GetValidator(ctx, address) if !found { return nil @@ -88,7 +87,7 @@ func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) exported.Vali } // ValidatorByConsAddr gets the validator interface for a particular pubkey -func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) exported.ValidatorI { +func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) types.ValidatorI { val, found := k.GetValidatorByConsAddr(ctx, addr) if !found { return nil @@ -106,7 +105,7 @@ func (k Keeper) GetValidatorSet() types.ValidatorSet { } // Delegation get the delegation interface for a particular set of delegator and validator addresses -func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) exported.DelegationI { +func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) types.DelegationI { bond, ok := k.GetDelegation(ctx, addrDel, addrVal) if !ok { return nil @@ -117,7 +116,7 @@ func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk. // iterate through all of the delegations from a delegator func (k Keeper) IterateDelegations(ctx sdk.Context, delAddr sdk.AccAddress, - fn func(index int64, del exported.DelegationI) (stop bool)) { + fn func(index int64, del types.DelegationI) (stop bool)) { store := ctx.KVStore(k.storeKey) delegatorPrefixKey := types.GetDelegationsKey(delAddr) diff --git a/x/staking/keeper/delegation.go b/x/staking/keeper/delegation.go index e2a4f64f11..283b308e76 100644 --- a/x/staking/keeper/delegation.go +++ b/x/staking/keeper/delegation.go @@ -545,7 +545,7 @@ func (k Keeper) DequeueAllMatureRedelegationQueue(ctx sdk.Context, currTime time // Delegate performs a delegation, set/update everything necessary within the store. // tokenSrc indicates the bond status of the incoming funds. func (k Keeper) Delegate( - ctx sdk.Context, delAddr sdk.AccAddress, bondAmt sdk.Int, tokenSrc sdk.BondStatus, + ctx sdk.Context, delAddr sdk.AccAddress, bondAmt sdk.Int, tokenSrc types.BondStatus, validator types.Validator, subtractAccount bool, ) (newShares sdk.Dec, err error) { // In some situations, the exchange rate becomes invalid, e.g. if @@ -577,7 +577,7 @@ func (k Keeper) Delegate( // performing a delegation and not a redelegation, thus the source tokens are // all non bonded if subtractAccount { - if tokenSrc == sdk.Bonded { + if tokenSrc == types.Bonded { panic("delegation token source cannot be bonded") } @@ -599,14 +599,14 @@ func (k Keeper) Delegate( } else { // potentially transfer tokens between pools, if switch { - case tokenSrc == sdk.Bonded && validator.IsBonded(): + case tokenSrc == types.Bonded && validator.IsBonded(): // do nothing - case (tokenSrc == sdk.Unbonded || tokenSrc == sdk.Unbonding) && !validator.IsBonded(): + case (tokenSrc == types.Unbonded || tokenSrc == types.Unbonding) && !validator.IsBonded(): // do nothing - case (tokenSrc == sdk.Unbonded || tokenSrc == sdk.Unbonding) && validator.IsBonded(): + case (tokenSrc == types.Unbonded || tokenSrc == types.Unbonding) && validator.IsBonded(): // transfer pools k.notBondedTokensToBonded(ctx, bondAmt) - case tokenSrc == sdk.Bonded && !validator.IsBonded(): + case tokenSrc == types.Bonded && !validator.IsBonded(): // transfer pools k.bondedTokensToNotBonded(ctx, bondAmt) default: diff --git a/x/staking/keeper/delegation_test.go b/x/staking/keeper/delegation_test.go index 64906bb65f..03450614f1 100644 --- a/x/staking/keeper/delegation_test.go +++ b/x/staking/keeper/delegation_test.go @@ -367,7 +367,7 @@ func TestUndelegateSelfDelegationBelowMinSelfDelegation(t *testing.T) { validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) require.True(t, found) require.Equal(t, sdk.TokensFromConsensusPower(14), validator.Tokens) - require.Equal(t, sdk.Unbonding, validator.Status) + require.Equal(t, types.Unbonding, validator.Status) require.True(t, validator.Jailed) } @@ -533,7 +533,7 @@ func TestUndelegateFromUnbondedValidator(t *testing.T) { // Make sure validator is still in state because there is still an outstanding delegation validator, found = app.StakingKeeper.GetValidator(ctx, addrVals[0]) require.True(t, found) - require.Equal(t, validator.Status, sdk.Unbonded) + require.Equal(t, validator.Status, types.Unbonded) // unbond some of the other delegation's shares unbondTokens := sdk.TokensFromConsensusPower(6) @@ -615,7 +615,7 @@ func TestUnbondingAllDelegationFromValidator(t *testing.T) { // validator should still be in state and still be in unbonding state validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) require.True(t, found) - require.Equal(t, validator.Status, sdk.Unbonding) + require.Equal(t, validator.Status, types.Unbonding) // unbond the validator ctx = ctx.WithBlockTime(validator.UnbondingTime) @@ -780,7 +780,7 @@ func TestRedelegationMaxEntries(t *testing.T) { require.Equal(t, valTokens, issuedShares.RoundInt()) validator2 = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator2, true) - require.Equal(t, sdk.Bonded, validator2.Status) + require.Equal(t, types.Bonded, validator2.Status) maxEntries := app.StakingKeeper.MaxEntries(ctx) @@ -841,7 +841,7 @@ func TestRedelegateSelfDelegation(t *testing.T) { validator2, issuedShares = validator2.AddTokensFromDel(valTokens) require.Equal(t, valTokens, issuedShares.RoundInt()) validator2 = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator2, true) - require.Equal(t, sdk.Bonded, validator2.Status) + require.Equal(t, types.Bonded, validator2.Status) // create a second delegation to validator 1 delTokens := sdk.TokensFromConsensusPower(10) @@ -862,7 +862,7 @@ func TestRedelegateSelfDelegation(t *testing.T) { validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) require.True(t, found) require.Equal(t, valTokens, validator.Tokens) - require.Equal(t, sdk.Unbonding, validator.Status) + require.Equal(t, types.Unbonding, validator.Status) } func TestRedelegateFromUnbondingValidator(t *testing.T) { @@ -992,7 +992,7 @@ func TestRedelegateFromUnbondedValidator(t *testing.T) { validator2, issuedShares = validator2.AddTokensFromDel(valTokens) require.Equal(t, valTokens, issuedShares.RoundInt()) validator2 = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator2, true) - require.Equal(t, sdk.Bonded, validator2.Status) + require.Equal(t, types.Bonded, validator2.Status) ctx = ctx.WithBlockHeight(10) ctx = ctx.WithBlockTime(time.Unix(333, 0)) diff --git a/x/staking/keeper/grpc_query.go b/x/staking/keeper/grpc_query.go index e553b2c72c..49d9b92ce2 100644 --- a/x/staking/keeper/grpc_query.go +++ b/x/staking/keeper/grpc_query.go @@ -27,7 +27,7 @@ func (k Querier) Validators(c context.Context, req *types.QueryValidatorsRequest } // validate the provided status, return all the validators if the status is empty - if req.Status != "" && !(req.Status == sdk.Bonded.String() || req.Status == sdk.Unbonded.String() || req.Status == sdk.Unbonding.String()) { + if req.Status != "" && !(req.Status == types.Bonded.String() || req.Status == types.Unbonded.String() || req.Status == types.Unbonding.String()) { return nil, status.Errorf(codes.InvalidArgument, "invalid validator status %s", req.Status) } diff --git a/x/staking/keeper/grpc_query_test.go b/x/staking/keeper/grpc_query_test.go index 8c8f979df9..fefa487749 100644 --- a/x/staking/keeper/grpc_query_test.go +++ b/x/staking/keeper/grpc_query_test.go @@ -50,7 +50,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryValidators() { }, {"valid request", func() { - req = &types.QueryValidatorsRequest{Status: sdk.Bonded.String(), + req = &types.QueryValidatorsRequest{Status: types.Bonded.String(), Pagination: &query.PageRequest{Limit: 1, CountTotal: true}} }, true, @@ -589,7 +589,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryRedelegation() { valAddrs := simapp.ConvertAddrsToValAddrs(addrs) val1, val2, val3, val4 := vals[0], vals[1], valAddrs[3], valAddrs[4] delAmount := sdk.TokensFromConsensusPower(1) - _, err := app.StakingKeeper.Delegate(ctx, addrAcc1, delAmount, sdk.Unbonded, val1, true) + _, err := app.StakingKeeper.Delegate(ctx, addrAcc1, delAmount, types.Unbonded, val1, true) suite.NoError(err) _ = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) @@ -749,9 +749,9 @@ func createValidators(ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sd app.StakingKeeper.SetNewValidatorByPowerIndex(ctx, val1) app.StakingKeeper.SetNewValidatorByPowerIndex(ctx, val2) - _, _ = app.StakingKeeper.Delegate(ctx, addrs[0], sdk.TokensFromConsensusPower(powers[0]), sdk.Unbonded, val1, true) - _, _ = app.StakingKeeper.Delegate(ctx, addrs[1], sdk.TokensFromConsensusPower(powers[1]), sdk.Unbonded, val2, true) - _, _ = app.StakingKeeper.Delegate(ctx, addrs[0], sdk.TokensFromConsensusPower(powers[2]), sdk.Unbonded, val2, true) + _, _ = app.StakingKeeper.Delegate(ctx, addrs[0], sdk.TokensFromConsensusPower(powers[0]), types.Unbonded, val1, true) + _, _ = app.StakingKeeper.Delegate(ctx, addrs[1], sdk.TokensFromConsensusPower(powers[1]), types.Unbonded, val2, true) + _, _ = app.StakingKeeper.Delegate(ctx, addrs[0], sdk.TokensFromConsensusPower(powers[2]), types.Unbonded, val2, true) app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) return addrs, valAddrs, vals diff --git a/x/staking/keeper/invariants.go b/x/staking/keeper/invariants.go index 02287e91b0..e21de8f951 100644 --- a/x/staking/keeper/invariants.go +++ b/x/staking/keeper/invariants.go @@ -5,7 +5,6 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/staking/exported" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -53,11 +52,11 @@ func ModuleAccountInvariants(k Keeper) sdk.Invariant { notBondedPool := k.GetNotBondedPool(ctx) bondDenom := k.BondDenom(ctx) - k.IterateValidators(ctx, func(_ int64, validator exported.ValidatorI) bool { + k.IterateValidators(ctx, func(_ int64, validator types.ValidatorI) bool { switch validator.GetStatus() { - case sdk.Bonded: + case types.Bonded: bonded = bonded.Add(validator.GetTokens()) - case sdk.Unbonding, sdk.Unbonded: + case types.Unbonding, types.Unbonded: notBonded = notBonded.Add(validator.GetTokens()) default: panic("invalid validator status") diff --git a/x/staking/keeper/querier_test.go b/x/staking/keeper/querier_test.go index bdd796a1a7..4e7a94f06a 100644 --- a/x/staking/keeper/querier_test.go +++ b/x/staking/keeper/querier_test.go @@ -143,7 +143,7 @@ func TestQueryValidators(t *testing.T) { // Create Validators amts := []sdk.Int{sdk.NewInt(9), sdk.NewInt(8), sdk.NewInt(7)} - status := []sdk.BondStatus{sdk.Bonded, sdk.Unbonded, sdk.Unbonding} + status := []types.BondStatus{types.Bonded, types.Unbonded, types.Unbonding} var validators [3]types.Validator for i, amt := range amts { validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{}) @@ -224,7 +224,7 @@ func TestQueryDelegation(t *testing.T) { app.StakingKeeper.SetValidatorByPowerIndex(ctx, val2) delTokens := sdk.TokensFromConsensusPower(20) - _, err := app.StakingKeeper.Delegate(ctx, addrAcc2, delTokens, sdk.Unbonded, val1, true) + _, err := app.StakingKeeper.Delegate(ctx, addrAcc2, delTokens, types.Unbonded, val1, true) require.NoError(t, err) // apply TM updates @@ -473,7 +473,7 @@ func TestQueryValidatorDelegations_Pagination(t *testing.T) { } delTokens := sdk.TokensFromConsensusPower(20) - _, err := app.StakingKeeper.Delegate(ctx, addr, delTokens, sdk.Unbonded, validator, true) + _, err := app.StakingKeeper.Delegate(ctx, addr, delTokens, types.Unbonded, validator, true) require.NoError(t, err) } @@ -552,7 +552,7 @@ func TestQueryRedelegations(t *testing.T) { app.StakingKeeper.SetValidator(ctx, val2) delAmount := sdk.TokensFromConsensusPower(100) - _, err := app.StakingKeeper.Delegate(ctx, addrAcc2, delAmount, sdk.Unbonded, val1, true) + _, err := app.StakingKeeper.Delegate(ctx, addrAcc2, delAmount, types.Unbonded, val1, true) require.NoError(t, err) _ = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) @@ -623,7 +623,7 @@ func TestQueryUnbondingDelegation(t *testing.T) { // delegate delAmount := sdk.TokensFromConsensusPower(100) - _, err := app.StakingKeeper.Delegate(ctx, addrAcc1, delAmount, sdk.Unbonded, val1, true) + _, err := app.StakingKeeper.Delegate(ctx, addrAcc1, delAmount, types.Unbonded, val1, true) require.NoError(t, err) _ = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) diff --git a/x/staking/keeper/slash.go b/x/staking/keeper/slash.go index f35e84ef77..7bef3220f7 100644 --- a/x/staking/keeper/slash.go +++ b/x/staking/keeper/slash.go @@ -120,11 +120,11 @@ func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeigh validator = k.RemoveValidatorTokens(ctx, validator, tokensToBurn) switch validator.GetStatus() { - case sdk.Bonded: + case types.Bonded: if err := k.burnBondedTokens(ctx, tokensToBurn); err != nil { panic(err) } - case sdk.Unbonding, sdk.Unbonded: + case types.Unbonding, types.Unbonded: if err := k.burnNotBondedTokens(ctx, tokensToBurn); err != nil { panic(err) } diff --git a/x/staking/keeper/slash_test.go b/x/staking/keeper/slash_test.go index 954758b224..8aaba62a25 100644 --- a/x/staking/keeper/slash_test.go +++ b/x/staking/keeper/slash_test.go @@ -385,7 +385,7 @@ func TestSlashWithUnbondingDelegation(t *testing.T) { // power decreased by 1 again, validator is out of stake // validator should be in unbonding period validator, _ = app.StakingKeeper.GetValidatorByConsAddr(ctx, consAddr) - require.Equal(t, validator.GetStatus(), sdk.Unbonding) + require.Equal(t, validator.GetStatus(), types.Unbonding) } //_________________________________________________________________________________ @@ -515,14 +515,14 @@ func TestSlashWithRedelegation(t *testing.T) { // read updated validator // validator decreased to zero power, should be in unbonding period validator, _ = app.StakingKeeper.GetValidatorByConsAddr(ctx, consAddr) - require.Equal(t, validator.GetStatus(), sdk.Unbonding) + require.Equal(t, validator.GetStatus(), types.Unbonding) // slash the validator again, by 100% // no stake remains to be slashed ctx = ctx.WithBlockHeight(12) // validator still in unbonding period validator, _ = app.StakingKeeper.GetValidatorByConsAddr(ctx, consAddr) - require.Equal(t, validator.GetStatus(), sdk.Unbonding) + require.Equal(t, validator.GetStatus(), types.Unbonding) require.NotPanics(t, func() { app.StakingKeeper.Slash(ctx, consAddr, 10, 10, sdk.OneDec()) }) @@ -542,7 +542,7 @@ func TestSlashWithRedelegation(t *testing.T) { // read updated validator // power still zero, still in unbonding period validator, _ = app.StakingKeeper.GetValidatorByConsAddr(ctx, consAddr) - require.Equal(t, validator.GetStatus(), sdk.Unbonding) + require.Equal(t, validator.GetStatus(), types.Unbonding) } // tests Slash at a previous height with both an unbonding delegation and a redelegation diff --git a/x/staking/keeper/val_state_change.go b/x/staking/keeper/val_state_change.go index 52992abbbe..083efb6940 100644 --- a/x/staking/keeper/val_state_change.go +++ b/x/staking/keeper/val_state_change.go @@ -265,7 +265,7 @@ func (k Keeper) bondValidator(ctx sdk.Context, validator types.Validator) types. // delete the validator by power index, as the key will change k.DeleteValidatorByPowerIndex(ctx, validator) - validator = validator.UpdateStatus(sdk.Bonded) + validator = validator.UpdateStatus(types.Bonded) // save the now bonded validator record to the two referenced stores k.SetValidator(ctx, validator) @@ -288,11 +288,11 @@ func (k Keeper) beginUnbondingValidator(ctx sdk.Context, validator types.Validat k.DeleteValidatorByPowerIndex(ctx, validator) // sanity check - if validator.Status != sdk.Bonded { + if validator.Status != types.Bonded { panic(fmt.Sprintf("should not already be unbonded or unbonding, validator: %v\n", validator)) } - validator = validator.UpdateStatus(sdk.Unbonding) + validator = validator.UpdateStatus(types.Unbonding) // set the unbonding completion time and completion height appropriately validator.UnbondingTime = ctx.BlockHeader().Time.Add(params.UnbondingTime) @@ -313,7 +313,7 @@ func (k Keeper) beginUnbondingValidator(ctx sdk.Context, validator types.Validat // perform all the store operations for when a validator status becomes unbonded func (k Keeper) completeUnbondingValidator(ctx sdk.Context, validator types.Validator) types.Validator { - validator = validator.UpdateStatus(sdk.Unbonded) + validator = validator.UpdateStatus(types.Unbonded) k.SetValidator(ctx, validator) return validator diff --git a/x/staking/keeper/validator_test.go b/x/staking/keeper/validator_test.go index 9fd77add73..26e894e27c 100644 --- a/x/staking/keeper/validator_test.go +++ b/x/staking/keeper/validator_test.go @@ -44,7 +44,7 @@ func TestSetValidator(t *testing.T) { // test how the validator is set from a purely unbonbed pool validator := types.NewValidator(valAddr, valPubKey, types.Description{}) validator, _ = validator.AddTokensFromDel(valTokens) - require.Equal(t, sdk.Unbonded, validator.Status) + require.Equal(t, types.Unbonded, validator.Status) assert.Equal(t, valTokens, validator.Tokens) assert.Equal(t, valTokens, validator.DelegatorShares.RoundInt()) app.StakingKeeper.SetValidator(ctx, validator) @@ -58,7 +58,7 @@ func TestSetValidator(t *testing.T) { require.Equal(t, validator.ABCIValidatorUpdate(), updates[0]) // after the save the validator should be bonded - require.Equal(t, sdk.Bonded, validator.Status) + require.Equal(t, types.Bonded, validator.Status) assert.Equal(t, valTokens, validator.Tokens) assert.Equal(t, valTokens, validator.DelegatorShares.RoundInt()) @@ -106,7 +106,7 @@ func TestUpdateValidatorByPowerIndex(t *testing.T) { // add a validator validator := types.NewValidator(addrVals[0], PKs[0], types.Description{}) validator, delSharesCreated := validator.AddTokensFromDel(sdk.TokensFromConsensusPower(100)) - require.Equal(t, sdk.Unbonded, validator.Status) + require.Equal(t, types.Unbonded, validator.Status) require.Equal(t, sdk.TokensFromConsensusPower(100), validator.Tokens) keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) @@ -175,9 +175,9 @@ func TestUpdateBondedValidatorsDecreaseCliff(t *testing.T) { nextCliffVal, _ = nextCliffVal.RemoveDelShares(shares.ToDec()) nextCliffVal = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, nextCliffVal, true) - expectedValStatus := map[int]sdk.BondStatus{ - 9: sdk.Bonded, 8: sdk.Bonded, 7: sdk.Bonded, 5: sdk.Bonded, 4: sdk.Bonded, - 0: sdk.Unbonding, 1: sdk.Unbonding, 2: sdk.Unbonding, 3: sdk.Unbonding, 6: sdk.Unbonding, + expectedValStatus := map[int]types.BondStatus{ + 9: types.Bonded, 8: types.Bonded, 7: types.Bonded, 5: types.Bonded, 4: types.Bonded, + 0: types.Unbonding, 1: types.Unbonding, 2: types.Unbonding, 3: types.Unbonding, 6: types.Unbonding, } // require all the validators have their respective statuses @@ -210,7 +210,7 @@ func TestSlashToZeroPowerRemoved(t *testing.T) { app.AccountKeeper.SetModuleAccount(ctx, bondedPool) validator, _ = validator.AddTokensFromDel(valTokens) - require.Equal(t, sdk.Unbonded, validator.Status) + require.Equal(t, types.Unbonded, validator.Status) require.Equal(t, valTokens, validator.Tokens) app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) @@ -222,7 +222,7 @@ func TestSlashToZeroPowerRemoved(t *testing.T) { app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) // validator should be unbonding validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) - require.Equal(t, validator.GetStatus(), sdk.Unbonding) + require.Equal(t, validator.GetStatus(), types.Unbonding) } // This function tests UpdateValidator, GetValidator, GetLastValidators, RemoveValidator @@ -234,7 +234,7 @@ func TestValidatorBasics(t *testing.T) { powers := []int64{9, 8, 7} for i, power := range powers { validators[i] = types.NewValidator(addrVals[i], PKs[i], types.Description{}) - validators[i].Status = sdk.Unbonded + validators[i].Status = types.Unbonded validators[i].Tokens = sdk.ZeroInt() tokens := sdk.TokensFromConsensusPower(power) @@ -271,11 +271,11 @@ func TestValidatorBasics(t *testing.T) { resVals = app.StakingKeeper.GetLastValidators(ctx) require.Equal(t, 1, len(resVals)) assert.True(ValEq(t, validators[0], resVals[0])) - assert.Equal(t, sdk.Bonded, validators[0].Status) + assert.Equal(t, types.Bonded, validators[0].Status) assert.True(sdk.IntEq(t, sdk.TokensFromConsensusPower(9), validators[0].BondedTokens())) // modify a records, save, and retrieve - validators[0].Status = sdk.Bonded + validators[0].Status = types.Bonded validators[0].Tokens = sdk.TokensFromConsensusPower(10) validators[0].DelegatorShares = validators[0].Tokens.ToDec() validators[0] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[0], true) @@ -311,7 +311,7 @@ func TestValidatorBasics(t *testing.T) { func() { app.StakingKeeper.RemoveValidator(ctx, validators[1].GetOperator()) }) // shouldn't be able to remove if there are still tokens left - validators[1].Status = sdk.Unbonded + validators[1].Status = types.Unbonded app.StakingKeeper.SetValidator(ctx, validators[1]) assert.PanicsWithValue(t, "attempting to remove a validator which still contains tokens", @@ -339,7 +339,7 @@ func TestGetValidatorSortingUnmixed(t *testing.T) { var validators [5]types.Validator for i, amt := range amts { validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{}) - validators[i].Status = sdk.Bonded + validators[i].Status = types.Bonded validators[i].Tokens = sdk.NewInt(amt) validators[i].DelegatorShares = sdk.NewDec(amt) keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[i], true) @@ -436,7 +436,7 @@ func TestGetValidatorSortingMixed(t *testing.T) { for i, amt := range amts { validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{}) validators[i].DelegatorShares = sdk.NewDec(amt) - validators[i].Status = sdk.Bonded + validators[i].Status = types.Bonded validators[i].Tokens = sdk.NewInt(amt) keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[i], true) } @@ -451,11 +451,11 @@ func TestGetValidatorSortingMixed(t *testing.T) { require.True(t, found) val4, found := app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addrs[4])) require.True(t, found) - require.Equal(t, sdk.Bonded, val0.Status) - require.Equal(t, sdk.Unbonding, val1.Status) - require.Equal(t, sdk.Unbonding, val2.Status) - require.Equal(t, sdk.Bonded, val3.Status) - require.Equal(t, sdk.Bonded, val4.Status) + require.Equal(t, types.Bonded, val0.Status) + require.Equal(t, types.Unbonding, val1.Status) + require.Equal(t, types.Unbonding, val2.Status) + require.Equal(t, types.Bonded, val3.Status) + require.Equal(t, types.Bonded, val4.Status) // first make sure everything made it in to the gotValidator group resValidators := app.StakingKeeper.GetBondedValidatorsByPower(ctx) @@ -654,11 +654,11 @@ func TestFullValidatorSetPowerChange(t *testing.T) { validators[i], found = app.StakingKeeper.GetValidator(ctx, validators[i].GetOperator()) require.True(t, found) } - assert.Equal(t, sdk.Unbonded, validators[0].Status) - assert.Equal(t, sdk.Unbonding, validators[1].Status) - assert.Equal(t, sdk.Bonded, validators[2].Status) - assert.Equal(t, sdk.Bonded, validators[3].Status) - assert.Equal(t, sdk.Unbonded, validators[4].Status) + assert.Equal(t, types.Unbonded, validators[0].Status) + assert.Equal(t, types.Unbonding, validators[1].Status) + assert.Equal(t, types.Bonded, validators[2].Status) + assert.Equal(t, types.Bonded, validators[3].Status) + assert.Equal(t, types.Unbonded, validators[4].Status) resValidators := app.StakingKeeper.GetBondedValidatorsByPower(ctx) assert.Equal(t, max, len(resValidators)) assert.True(ValEq(t, validators[2], resValidators[0])) // in the order of txs @@ -747,7 +747,7 @@ func TestApplyAndReturnValidatorSetUpdatesSingleValueChange(t *testing.T) { // test single value change // tendermintUpdate set: {} -> {c1'} - validators[0].Status = sdk.Bonded + validators[0].Status = types.Bonded validators[0].Tokens = sdk.TokensFromConsensusPower(600) validators[0] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[0], false) diff --git a/x/staking/legacy/v040/migrate.go b/x/staking/legacy/v040/migrate.go index 4cd55afa50..2749c99d9c 100644 --- a/x/staking/legacy/v040/migrate.go +++ b/x/staking/legacy/v040/migrate.go @@ -9,16 +9,16 @@ import ( v040staking "github.com/cosmos/cosmos-sdk/x/staking/types" ) -func migrateBondStatus(oldStatus v034staking.BondStatus) sdk.BondStatus { +func migrateBondStatus(oldStatus v034staking.BondStatus) v040staking.BondStatus { switch oldStatus { case v034staking.Unbonded: - return sdk.Unbonded + return v040staking.Unbonded case v034staking.Unbonding: - return sdk.Unbonding + return v040staking.Unbonding case v034staking.Bonded: - return sdk.Bonded + return v040staking.Bonded default: panic(fmt.Errorf("invalid bond status %d", oldStatus)) diff --git a/x/staking/legacy/v040/migrate_test.go b/x/staking/legacy/v040/migrate_test.go index 1d593a6fc9..626864a8ec 100644 --- a/x/staking/legacy/v040/migrate_test.go +++ b/x/staking/legacy/v040/migrate_test.go @@ -81,7 +81,7 @@ func TestMigrate(t *testing.T) { "jailed": false, "min_self_delegation": "0", "operator_address": "", - "status": 1, + "status": "BOND_STATUS_UNBONDED", "tokens": "0", "unbonding_height": "0", "unbonding_time": "0001-01-01T00:00:00Z" diff --git a/x/staking/simulation/genesis_test.go b/x/staking/simulation/genesis_test.go index 171c68819e..ace2f0acb5 100644 --- a/x/staking/simulation/genesis_test.go +++ b/x/staking/simulation/genesis_test.go @@ -55,7 +55,7 @@ func TestRandomizedGenState(t *testing.T) { require.Equal(t, "cosmosvaloper1ghekyjucln7y67ntx7cf27m9dpuxxemnsvnaes", stakingGenesis.Validators[2].GetOperator().String()) require.Equal(t, "cosmosvalconspub1zcjduepq280tm686ma80cva9z620dmknd9a858pd2zmq9ackfenfllecjxds0hg9n7", stakingGenesis.Validators[2].ConsensusPubkey) require.Equal(t, false, stakingGenesis.Validators[2].Jailed) - require.Equal(t, "Unbonded", stakingGenesis.Validators[2].Status.String()) + require.Equal(t, "BOND_STATUS_UNBONDED", stakingGenesis.Validators[2].Status.String()) require.Equal(t, "1000", stakingGenesis.Validators[2].Tokens.String()) require.Equal(t, "1000.000000000000000000", stakingGenesis.Validators[2].DelegatorShares.String()) require.Equal(t, "0.292059246265731326", stakingGenesis.Validators[2].Commission.CommissionRates.Rate.String()) diff --git a/x/staking/spec/05_end_block.md b/x/staking/spec/05_end_block.md index 3207c078cd..c0777896fb 100644 --- a/x/staking/spec/05_end_block.md +++ b/x/staking/spec/05_end_block.md @@ -19,9 +19,9 @@ consensus layer. Operations are as following: validators retrieved from the ValidatorsByPower index - the previous validator set is compared with the new validator set: - missing validators begin unbonding and their `Tokens` are transferred from the - `BondedPool` to the `NotBondedPool` `ModuleAccount` + `BondedPool` to the `NotBondedPool` `ModuleAccount` - new validators are instantly bonded and their `Tokens` are transferred from the - `NotBondedPool` to the `BondedPool` `ModuleAccount` + `NotBondedPool` to the `BondedPool` `ModuleAccount` In all cases, any validators leaving or entering the bonded validator set or changing balances and staying within the bonded validator set incur an update @@ -48,8 +48,8 @@ Each block the validator queue is to be checked for mature unbonding validators (namely with a completion time <= current time). At this point any mature validators which do not have any delegations remaining are deleted from state. For all other mature unbonding validators that still have remaining -delegations, the `validator.Status` is switched from `sdk.Unbonding` to -`sdk.Unbonded`. +delegations, the `validator.Status` is switched from `types.Unbonding` to +`types.Unbonded`. ### Unbonding Delegations diff --git a/x/staking/types/delegation.go b/x/staking/types/delegation.go index b3cb79bd33..a833215972 100644 --- a/x/staking/types/delegation.go +++ b/x/staking/types/delegation.go @@ -10,11 +10,10 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/staking/exported" ) // Implements Delegation interface -var _ exported.DelegationI = Delegation{} +var _ DelegationI = Delegation{} // String implements the Stringer interface for a DVPair object. func (dv DVPair) String() string { diff --git a/x/staking/types/expected_keepers.go b/x/staking/types/expected_keepers.go index 9dd80419a4..1c1d7f7de9 100644 --- a/x/staking/types/expected_keepers.go +++ b/x/staking/types/expected_keepers.go @@ -4,7 +4,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" bankexported "github.com/cosmos/cosmos-sdk/x/bank/exported" - stakingexported "github.com/cosmos/cosmos-sdk/x/staking/exported" ) // DistributionKeeper expected distribution keeper (noalias) @@ -46,20 +45,20 @@ type BankKeeper interface { type ValidatorSet interface { // iterate through validators by operator address, execute func for each validator IterateValidators(sdk.Context, - func(index int64, validator stakingexported.ValidatorI) (stop bool)) + func(index int64, validator ValidatorI) (stop bool)) // iterate through bonded validators by operator address, execute func for each validator IterateBondedValidatorsByPower(sdk.Context, - func(index int64, validator stakingexported.ValidatorI) (stop bool)) + func(index int64, validator ValidatorI) (stop bool)) // iterate through the consensus validator set of the last block by operator address, execute func for each validator IterateLastValidators(sdk.Context, - func(index int64, validator stakingexported.ValidatorI) (stop bool)) + func(index int64, validator ValidatorI) (stop bool)) - Validator(sdk.Context, sdk.ValAddress) stakingexported.ValidatorI // get a particular validator by operator address - ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingexported.ValidatorI // get a particular validator by consensus address - TotalBondedTokens(sdk.Context) sdk.Int // total bonded tokens within the validator set - StakingTokenSupply(sdk.Context) sdk.Int // total staking token supply + Validator(sdk.Context, sdk.ValAddress) ValidatorI // get a particular validator by operator address + ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) ValidatorI // get a particular validator by consensus address + TotalBondedTokens(sdk.Context) sdk.Int // total bonded tokens within the validator set + StakingTokenSupply(sdk.Context) sdk.Int // total staking token supply // slash the validator and delegators of the validator, specifying offence height, offence power, and slash fraction Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) @@ -68,7 +67,7 @@ type ValidatorSet interface { // Delegation allows for getting a particular delegation for a given validator // and delegator outside the scope of the staking module. - Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingexported.DelegationI + Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) DelegationI // MaxValidators returns the maximum amount of bonded validators MaxValidators(sdk.Context) uint32 @@ -81,7 +80,7 @@ type DelegationSet interface { // iterate through all delegations from one delegator by validator-AccAddress, // execute func for each validator IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, - fn func(index int64, delegation stakingexported.DelegationI) (stop bool)) + fn func(index int64, delegation DelegationI) (stop bool)) } //_______________________________________________________________________________ diff --git a/x/staking/types/exported.go b/x/staking/types/exported.go new file mode 100644 index 0000000000..02f97dccea --- /dev/null +++ b/x/staking/types/exported.go @@ -0,0 +1,37 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/tendermint/tendermint/crypto" +) + +// DelegationI delegation bond for a delegated proof of stake system +type DelegationI interface { + GetDelegatorAddr() sdk.AccAddress // delegator sdk.AccAddress for the bond + GetValidatorAddr() sdk.ValAddress // validator operator address + GetShares() sdk.Dec // amount of validator's shares held in this delegation +} + +// ValidatorI expected validator functions +type ValidatorI interface { + IsJailed() bool // whether the validator is jailed + GetMoniker() string // moniker of the validator + GetStatus() BondStatus // status of the validator + IsBonded() bool // check if has a bonded status + IsUnbonded() bool // check if has status unbonded + IsUnbonding() bool // check if has status unbonding + GetOperator() sdk.ValAddress // operator address to receive/return validators coins + GetConsPubKey() crypto.PubKey // validation consensus pubkey + GetConsAddr() sdk.ConsAddress // validation consensus address + GetTokens() sdk.Int // validation tokens + GetBondedTokens() sdk.Int // validator bonded tokens + GetConsensusPower() int64 // validation power in tendermint + GetCommission() sdk.Dec // validator commission rate + GetMinSelfDelegation() sdk.Int // validator minimum self delegation + GetDelegatorShares() sdk.Dec // total outstanding delegator shares + TokensFromShares(sdk.Dec) sdk.Dec // token worth of provided delegator shares + TokensFromSharesTruncated(sdk.Dec) sdk.Dec // token worth of provided delegator shares, truncated + TokensFromSharesRoundUp(sdk.Dec) sdk.Dec // token worth of provided delegator shares, rounded up + SharesFromTokens(amt sdk.Int) (sdk.Dec, error) // shares worth of delegator's bond + SharesFromTokensTruncated(amt sdk.Int) (sdk.Dec, error) // truncated shares worth of delegator's bond +} diff --git a/x/staking/types/staking.pb.go b/x/staking/types/staking.pb.go index 9951a81740..08d6ccc761 100644 --- a/x/staking/types/staking.pb.go +++ b/x/staking/types/staking.pb.go @@ -38,6 +38,42 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// BondStatus is the status of a validator. +type BondStatus int32 + +const ( + // UNSPECIFIED defines an invalid validator status. + Unspecified BondStatus = 0 + // UNBONDED defines a validator that is not bonded. + Unbonded BondStatus = 1 + // UNBONDING defines a validator that is unbonding. + Unbonding BondStatus = 2 + // BONDED defines a validator that is bonded. + Bonded BondStatus = 3 +) + +var BondStatus_name = map[int32]string{ + 0: "BOND_STATUS_UNSPECIFIED", + 1: "BOND_STATUS_UNBONDED", + 2: "BOND_STATUS_UNBONDING", + 3: "BOND_STATUS_BONDED", +} + +var BondStatus_value = map[string]int32{ + "BOND_STATUS_UNSPECIFIED": 0, + "BOND_STATUS_UNBONDED": 1, + "BOND_STATUS_UNBONDING": 2, + "BOND_STATUS_BONDED": 3, +} + +func (x BondStatus) String() string { + return proto.EnumName(BondStatus_name, int32(x)) +} + +func (BondStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_64c30c6cf92913c9, []int{0} +} + // HistoricalInfo contains header and validator information for a given block. // It is stored as part of staking module's state, which persists the `n` most // recent HistoricalInfo @@ -264,17 +300,17 @@ func (m *Description) GetDetails() string { // exchange rate. Voting power can be calculated as total bonded shares // multiplied by exchange rate. type Validator struct { - OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty" yaml:"operator_address"` - ConsensusPubkey string `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty" yaml:"consensus_pubkey"` - Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` - Status github_com_cosmos_cosmos_sdk_types.BondStatus `protobuf:"varint,4,opt,name=status,proto3,casttype=github.com/cosmos/cosmos-sdk/types.BondStatus" json:"status,omitempty"` - Tokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokens"` - DelegatorShares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=delegator_shares,json=delegatorShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"delegator_shares" yaml:"delegator_shares"` - Description Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"` - UnbondingHeight int64 `protobuf:"varint,8,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty" yaml:"unbonding_height"` - UnbondingTime time.Time `protobuf:"bytes,9,opt,name=unbonding_time,json=unbondingTime,proto3,stdtime" json:"unbonding_time" yaml:"unbonding_time"` - Commission Commission `protobuf:"bytes,10,opt,name=commission,proto3" json:"commission"` - MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation" yaml:"min_self_delegation"` + OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty" yaml:"operator_address"` + ConsensusPubkey string `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty" yaml:"consensus_pubkey"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` + Status BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"` + Tokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokens"` + DelegatorShares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=delegator_shares,json=delegatorShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"delegator_shares" yaml:"delegator_shares"` + Description Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"` + UnbondingHeight int64 `protobuf:"varint,8,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty" yaml:"unbonding_height"` + UnbondingTime time.Time `protobuf:"bytes,9,opt,name=unbonding_time,json=unbondingTime,proto3,stdtime" json:"unbonding_time" yaml:"unbonding_time"` + Commission Commission `protobuf:"bytes,10,opt,name=commission,proto3" json:"commission"` + MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation" yaml:"min_self_delegation"` } func (m *Validator) Reset() { *m = Validator{} } @@ -1028,6 +1064,7 @@ func (m *Pool) XXX_DiscardUnknown() { var xxx_messageInfo_Pool proto.InternalMessageInfo func init() { + proto.RegisterEnum("cosmos.staking.v1beta1.BondStatus", BondStatus_name, BondStatus_value) proto.RegisterType((*HistoricalInfo)(nil), "cosmos.staking.v1beta1.HistoricalInfo") proto.RegisterType((*CommissionRates)(nil), "cosmos.staking.v1beta1.CommissionRates") proto.RegisterType((*Commission)(nil), "cosmos.staking.v1beta1.Commission") @@ -1055,110 +1092,117 @@ func init() { } var fileDescriptor_64c30c6cf92913c9 = []byte{ - // 1641 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcd, 0x6f, 0x1b, 0x5b, - 0x15, 0xf7, 0xd8, 0xae, 0x63, 0x1f, 0x27, 0x71, 0x7c, 0xdb, 0x06, 0x27, 0x04, 0x4f, 0x3a, 0x54, - 0x10, 0x24, 0xea, 0x90, 0x80, 0x8a, 0xc8, 0x06, 0xea, 0xb8, 0x55, 0x22, 0x0a, 0x0a, 0x93, 0x10, - 0x24, 0xa8, 0xb0, 0xae, 0x67, 0x6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x9f, 0xdb, 0xd8, 0xb6, 0x03, - 0x42, 0xa9, 0xaa, 0xeb, 0x84, 0xe6, 0x34, 0x87, 0x61, 0x56, 0x42, 0xd2, 0x03, 0x49, 0xe1, 0x38, - 0x96, 0xef, 0x51, 0xe2, 0xd1, 0x01, 0x6d, 0xf7, 0x07, 0x9d, 0x13, 0xa2, 0xfc, 0x4f, 0xe2, 0xa4, - 0x39, 0x0c, 0x9e, 0x50, 0x45, 0xda, 0x13, 0x14, 0xb4, 0x08, 0x85, 0x9f, 0x60, 0xa7, 0x47, 0x6c, - 0x11, 0xa2, 0xa2, 0xa9, 0x4e, 0x68, 0x17, 0x0a, 0x94, 0x61, 0x36, 0xa0, 0x22, 0x2e, 0x37, 0x9a, - 0x1b, 0xff, 0x1f, 0xea, 0xf7, 0xae, 0x50, 0xc4, 0x4d, 0xdf, 0xb3, 0xf7, 0x85, 0xa0, 0xa9, 0x00, - 0xd0, 0x23, 0x28, 0x30, 0xff, 0x84, 0x78, 0x2a, 0x46, 0x53, 0x35, 0xf0, 0xae, 0xc7, 0x4c, 0x25, - 0x8d, 0x18, 0x2c, 0xd8, 0xa4, 0x47, 0xba, 0x22, 0x32, 0xf4, 0x18, 0x07, 0x84, 0xd6, 0x0a, 0x02, - 0x71, 0x77, 0xea, 0x2e, 0x53, 0x01, 0x4a, 0xe3, 0x19, 0x66, 0x25, 0x22, 0xed, 0x0b, 0x0a, 0xfa, - 0x36, 0x94, 0xed, 0xb8, 0x12, 0x6b, 0x33, 0xa2, 0xe2, 0x3f, 0x3f, 0xa9, 0x95, 0x12, 0x45, 0xab, - 0x06, 0x5b, 0x52, 0x9a, 0x67, 0x6d, 0xe0, 0x75, 0x7c, 0xcf, 0x76, 0xbc, 0x6e, 0xfb, 0x98, 0x38, - 0xdd, 0x63, 0x56, 0x2b, 0xae, 0x6a, 0x6b, 0xb9, 0x64, 0xd6, 0xd2, 0x1c, 0x86, 0x59, 0x89, 0x48, - 0x3b, 0x82, 0x82, 0x6c, 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c5, 0x2b, 0xf8, 0x55, 0xfa, 0xa4, - 0x88, 0xf1, 0xdb, 0x2c, 0x40, 0xeb, 0xf0, 0xf0, 0x20, 0x70, 0xfa, 0x3d, 0xc2, 0xde, 0xa7, 0xe7, - 0x07, 0x70, 0x3b, 0x76, 0x8b, 0x06, 0x56, 0xca, 0xfb, 0xd5, 0xd1, 0x50, 0x5f, 0x49, 0x7b, 0x9f, - 0x60, 0x33, 0xcc, 0x9b, 0x11, 0x7d, 0x3f, 0xb0, 0x2e, 0x45, 0xb5, 0x29, 0x8b, 0x50, 0x73, 0x93, - 0x51, 0x13, 0x6c, 0x49, 0xd4, 0x16, 0x65, 0x97, 0x87, 0x76, 0x1f, 0xca, 0x71, 0x48, 0x28, 0x6a, - 0x41, 0x91, 0xa9, 0x67, 0x15, 0x61, 0x63, 0x72, 0x84, 0x43, 0x31, 0x15, 0xe5, 0x48, 0xd2, 0xf8, - 0x9f, 0x06, 0x10, 0xd7, 0xec, 0x87, 0x59, 0x62, 0x7c, 0x94, 0xab, 0xc1, 0x9b, 0xbb, 0xd6, 0x2e, - 0xa6, 0xa4, 0x53, 0xf1, 0xfc, 0x55, 0x16, 0x6e, 0x7e, 0x3f, 0x9c, 0x3c, 0x1f, 0x7c, 0x0c, 0xf6, - 0x60, 0x86, 0x78, 0x2c, 0x70, 0x44, 0x10, 0x78, 0xb6, 0xbf, 0x32, 0x29, 0xdb, 0x97, 0xf8, 0xf4, - 0xd0, 0x63, 0xc1, 0x99, 0xca, 0x7d, 0x08, 0x93, 0x8a, 0xc6, 0x6f, 0x72, 0x50, 0x9b, 0x24, 0x89, - 0xb6, 0xa1, 0x62, 0x05, 0x44, 0x10, 0xc2, 0xef, 0x87, 0x26, 0xbe, 0x1f, 0xcb, 0xf1, 0xea, 0x98, - 0x62, 0x30, 0xcc, 0xf9, 0x90, 0xa2, 0xbe, 0x1e, 0x5d, 0xe0, 0x7b, 0x1d, 0x2f, 0x3b, 0xce, 0x75, - 0xc5, 0x45, 0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x7c, 0xd6, 0xe6, 0x95, 0x45, 0xec, 0xb6, 0xba, 0x74, 0xcb, 0x39, 0xb8, 0x3d, 0x5d, 0x90, - 0xfe, 0x3d, 0xd4, 0xc7, 0xa1, 0xcc, 0x8a, 0xe7, 0xb3, 0xa6, 0xa0, 0x1c, 0xc8, 0x2b, 0xf9, 0x33, - 0x98, 0xbb, 0xa8, 0x4c, 0x4e, 0xc9, 0x1f, 0x4c, 0xad, 0xec, 0x22, 0xcc, 0x68, 0xa8, 0xdf, 0x8a, - 0x3b, 0x26, 0x22, 0x1b, 0xe6, 0x6c, 0x27, 0xa1, 0x7d, 0xab, 0xc8, 0xf3, 0xf7, 0x9f, 0x73, 0x5d, - 0x6b, 0x3e, 0x7a, 0xf9, 0xba, 0xae, 0xbd, 0x7a, 0x5d, 0xd7, 0xfe, 0xf9, 0xba, 0xae, 0x3d, 0x7f, - 0x53, 0xcf, 0xbc, 0x7a, 0x53, 0xcf, 0xfc, 0xf5, 0x4d, 0x3d, 0xf3, 0xc3, 0x2f, 0xbf, 0xd5, 0x84, - 0xd3, 0xe8, 0x67, 0x5c, 0x61, 0x4c, 0xa7, 0x20, 0xa6, 0xd9, 0x57, 0x3f, 0x0e, 0x00, 0x00, 0xff, - 0xff, 0x24, 0x46, 0xec, 0x34, 0xe5, 0x15, 0x00, 0x00, + // 1754 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4d, 0x6c, 0x23, 0x49, + 0x15, 0x76, 0xdb, 0x5e, 0xc7, 0x7e, 0x4e, 0xe2, 0xb8, 0xe6, 0x67, 0x3d, 0x66, 0x70, 0x7b, 0x9b, + 0xd5, 0x12, 0xd0, 0xe2, 0x30, 0x01, 0x2d, 0x22, 0x17, 0x18, 0xc7, 0x19, 0x62, 0xb1, 0x0c, 0xa1, + 0x9d, 0x09, 0x12, 0xac, 0xb0, 0xca, 0xdd, 0x15, 0xa7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x91, + 0x69, 0xdf, 0xf9, 0xe8, 0x49, 0x43, 0x7b, 0xfc, 0xa4, 0xa1, 0xfd, 0xf5, 0x49, 0x43, 0x7b, 0xff, + 0x69, 0x23, 0xf3, 0xf8, 0x69, 0x23, 0xf3, 0xc7, 0xa7, 0x8d, 0xcc, 0xf7, 0xde, 0x7c, 0xa6, 0xef, + 0xce, 0xa2, 0x0f, 0xce, 0xc2, 0x8b, 0x83, 0x82, 0x68, 0xc3, 0x5f, 0xfa, 0x6f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x27, 0x47, 0x69, 0xe7, 0x8f, 0x16, 0x00, 0x00, } func (this *Pool) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) { @@ -1167,584 +1211,590 @@ func (this *Pool) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_ func StakingDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) { d := &github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet{} var gzipped = []byte{ - // 9223 bytes of a gzipped FileDescriptorSet - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x7d, 0x6d, 0x74, 0x1c, 0xd7, - 0x75, 0x18, 0x67, 0x3f, 0x80, 0xdd, 0xbb, 0xf8, 0x58, 0x3c, 0x80, 0xd0, 0x72, 0x49, 0x02, 0xd0, - 0x48, 0x96, 0x28, 0x4a, 0x5a, 0x48, 0x14, 0x49, 0x91, 0xcb, 0x58, 0x32, 0x16, 0x58, 0x82, 0x20, - 0xf1, 0xa5, 0x01, 0x48, 0xf9, 0x23, 0xe9, 0x9e, 0xc1, 0xee, 0xc3, 0x62, 0xc4, 0xdd, 0x99, 0xf1, - 0xcc, 0x2c, 0x09, 0xc8, 0xf6, 0x39, 0x4a, 0xec, 0xba, 0xb6, 0xd2, 0xd4, 0x76, 0x9d, 0x93, 0xda, - 0x8e, 0xe5,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89, 0xb4, 0xe2, 0x83, 0xa0, 0x87, 0x61, 0xcc, - 0x6c, 0x6d, 0x35, 0xb4, 0x6a, 0xc5, 0x87, 0x06, 0x33, 0xf1, 0x13, 0x49, 0x25, 0xcb, 0x3a, 0x16, - 0x3c, 0xe4, 0x07, 0x61, 0xf4, 0x26, 0x56, 0xaf, 0xfb, 0x51, 0x33, 0x14, 0x75, 0x84, 0x80, 0x7d, - 0x88, 0xf3, 0x30, 0xd4, 0xc4, 0xb6, 0xad, 0xd6, 0x71, 0xc5, 0xd9, 0x33, 0x71, 0x2e, 0x41, 0xb5, - 0x9f, 0x69, 0xd3, 0x3e, 0xac, 0x79, 0x86, 0x53, 0x6d, 0xee, 0x99, 0x18, 0xcd, 0x41, 0x1a, 0xeb, - 0xad, 0x26, 0xe3, 0x90, 0xec, 0x62, 0xbf, 0xb2, 0xde, 0x6a, 0x86, 0xb9, 0xa4, 0x08, 0x19, 0x67, - 0x31, 0x68, 0x63, 0xeb, 0x86, 0x56, 0xc5, 0xb9, 0x01, 0xca, 0xe0, 0xc1, 0x36, 0x06, 0x1b, 0xac, - 0x3f, 0xcc, 0x43, 0xd0, 0xa1, 0x79, 0x48, 0xe3, 0x5d, 0x07, 0xeb, 0xb6, 0x66, 0xe8, 0xb9, 0x41, - 0xca, 0xe4, 0x5d, 0x1d, 0x66, 0x11, 0x37, 0x6a, 0x61, 0x16, 0x1e, 0x1d, 0x3a, 0x0b, 0x83, 0x86, - 0xe9, 0x68, 0x86, 0x6e, 0xe7, 0x52, 0x33, 0xd2, 0x89, 0xcc, 0xa9, 0x63, 0x1d, 0x1d, 0x61, 0x8d, - 0xe1, 0x28, 0x02, 0x19, 0x2d, 0x41, 0xd6, 0x36, 0x5a, 0x56, 0x15, 0x57, 0xaa, 0x46, 0x0d, 0x57, - 0x34, 0x7d, 0xdb, 0xc8, 0xa5, 0x29, 0x83, 0xe9, 0x76, 0x45, 0x28, 0xe2, 0xbc, 0x51, 0xc3, 0x4b, - 0xfa, 0xb6, 0xa1, 0x8c, 0xd8, 0x81, 0x36, 0x9a, 0x84, 0x01, 0x7b, 0x4f, 0x77, 0xd4, 0xdd, 0xdc, - 0x10, 0xf5, 0x10, 0xde, 0x92, 0x7f, 0x7d, 0x00, 0x46, 0x7b, 0x71, 0xb1, 0x0b, 0x90, 0xdc, 0x26, - 0x5a, 0xe6, 0x62, 0xfd, 0xd8, 0x80, 0xd1, 0x04, 0x8d, 0x38, 0x70, 0x40, 0x23, 0xce, 0x41, 0x46, - 0xc7, 0xb6, 0x83, 0x6b, 0xcc, 0x23, 0xe2, 0x3d, 0xfa, 0x14, 0x30, 0xa2, 0x76, 0x97, 0x4a, 0x1c, - 0xc8, 0xa5, 0xde, 0x0b, 0xa3, 0xae, 0x48, 0x15, 0x4b, 0xd5, 0xeb, 0xc2, 0x37, 0x67, 0xa3, 0x24, - 0x29, 0x94, 0x05, 0x9d, 0x42, 0xc8, 0x94, 0x11, 0x1c, 0x68, 0xa3, 0x05, 0x00, 0x43, 0xc7, 0xc6, - 0x76, 0xa5, 0x86, 0xab, 0x8d, 0x5c, 0xaa, 0x8b, 0x95, 0xd6, 0x08, 0x4a, 0x9b, 0x95, 0x0c, 0x06, - 0xad, 0x36, 0xd0, 0x79, 0xcf, 0xd5, 0x06, 0xbb, 0x78, 0xca, 0x0a, 0x0b, 0xb2, 0x36, 0x6f, 0xbb, - 0x0a, 0x23, 0x16, 0x26, 0x7e, 0x8f, 0x6b, 0x5c, 0xb3, 0x34, 0x15, 0xa2, 0x10, 0xa9, 0x99, 0xc2, - 0xc9, 0x98, 0x62, 0xc3, 0x96, 0xbf, 0x89, 0xee, 0x03, 0x17, 0x50, 0xa1, 0x6e, 0x05, 0x34, 0x0b, - 0x0d, 0x09, 0xe0, 0xaa, 0xda, 0xc4, 0xf9, 0xe7, 0x61, 0x24, 0x68, 0x1e, 0x34, 0x01, 0x49, 0xdb, - 0x51, 0x2d, 0x87, 0x7a, 0x61, 0x52, 0x61, 0x0d, 0x94, 0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, 0xe0, 0x3e, 0x6e, 0xa3, 0xf3, - 0x70, 0xd8, 0x33, 0x96, 0x9f, 0x70, 0xac, 0x4d, 0xcb, 0x30, 0xe9, 0x19, 0x18, 0x37, 0xf7, 0xda, - 0x09, 0x51, 0x60, 0x44, 0x73, 0x2f, 0x4c, 0xf6, 0x24, 0x4c, 0x98, 0x3b, 0x66, 0x3b, 0xdd, 0x49, - 0x3f, 0x1d, 0x32, 0x77, 0xcc, 0x30, 0xe1, 0xbb, 0xe8, 0xce, 0xdc, 0xc2, 0x55, 0xd5, 0xc1, 0xb5, - 0xdc, 0x3d, 0x7e, 0x74, 0x5f, 0x07, 0x2a, 0x40, 0xb6, 0x5a, 0xad, 0x60, 0x5d, 0xdd, 0x6a, 0xe0, - 0x8a, 0x6a, 0x61, 0x5d, 0xb5, 0x73, 0xd3, 0x14, 0x39, 0xe1, 0x58, 0x2d, 0xac, 0x8c, 0x54, 0xab, - 0x65, 0xda, 0x39, 0x47, 0xfb, 0xd0, 0x49, 0x18, 0x33, 0xb6, 0x9e, 0xab, 0x32, 0x8f, 0xac, 0x98, - 0x16, 0xde, 0xd6, 0x76, 0x73, 0xf7, 0x53, 0xf3, 0x8e, 0x92, 0x0e, 0xea, 0x8f, 0xeb, 0x14, 0x8c, - 0x1e, 0x82, 0x6c, 0xd5, 0xde, 0x51, 0x2d, 0x93, 0xa6, 0x64, 0xdb, 0x54, 0xab, 0x38, 0xf7, 0x2e, - 0x86, 0xca, 0xe0, 0xab, 0x02, 0x4c, 0x22, 0xc2, 0xbe, 0xa9, 0x6d, 0x3b, 0x82, 0xe3, 0x83, 0x2c, - 0x22, 0x28, 0x8c, 0x73, 0x3b, 0x01, 0x59, 0x62, 0x89, 0xc0, 0xc0, 0x27, 0x28, 0xda, 0x88, 0xb9, - 0x63, 0xfa, 0xc7, 0xbd, 0x0f, 0x86, 0x09, 0xa6, 0x37, 0xe8, 0x43, 0xac, 0x70, 0x33, 0x77, 0x7c, - 0x23, 0x9e, 0x86,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, 0x59, 0x26, 0xed, 0xb7, 0x65, 0x9b, 0x74, - 0x39, 0x91, 0x4a, 0x65, 0xd3, 0x97, 0x13, 0xa9, 0x74, 0x16, 0xe4, 0xd7, 0xe2, 0x30, 0xe4, 0xaf, - 0xd7, 0xc9, 0xf6, 0xa7, 0x4a, 0x57, 0x2c, 0x89, 0xe6, 0xb4, 0xfb, 0xf6, 0xad, 0xee, 0x0b, 0xf3, - 0x64, 0x29, 0x2b, 0x0e, 0xb0, 0xe2, 0x58, 0x61, 0x94, 0xa4, 0x8c, 0x20, 0xce, 0x86, 0x59, 0x31, - 0x92, 0x52, 0x78, 0x0b, 0x2d, 0xc2, 0xc0, 0x73, 0x36, 0xe5, 0x3d, 0x40, 0x79, 0xdf, 0xbf, 0x3f, - 0xef, 0xcb, 0x1b, 0x94, 0x79, 0xfa, 0xf2, 0x46, 0x65, 0x75, 0x4d, 0x59, 0x99, 0x5b, 0x56, 0x38, - 0x39, 0x3a, 0x02, 0x89, 0x86, 0xfa, 0xfc, 0x5e, 0x70, 0xd1, 0xa3, 0xa0, 0x5e, 0x27, 0xe1, 0x08, - 0x24, 0x6e, 0x62, 0xf5, 0x7a, 0x70, 0xa9, 0xa1, 0xa0, 0xbb, 0x18, 0x0c, 0xb3, 0x90, 0xa4, 0xf6, - 0x42, 0x00, 0xdc, 0x62, 0xd9, 0x43, 0x28, 0x05, 0x89, 0xf9, 0x35, 0x85, 0x04, 0x44, 0x16, 0x86, - 0x18, 0xb4, 0xb2, 0xbe, 0x54, 0x9e, 0x2f, 0x67, 0x63, 0xf2, 0x19, 0x18, 0x60, 0x46, 0x20, 0xc1, - 0xe2, 0x9a, 0x21, 0x7b, 0x88, 0x37, 0x39, 0x0f, 0x49, 0xf4, 0x5e, 0x5d, 0x29, 0x95, 0x95, 0x6c, - 0x2c, 0x38, 0xd5, 0x89, 0x6c, 0x52, 0xb6, 0x61, 0xc8, 0x5f, 0x87, 0xbf, 0x3d, 0x9b, 0xf1, 0x6f, - 0x48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 0x5d, 0xb5, 0x1c, 0xbe, 0xc1, 0x79, 0x08, 0x88, - 0x95, 0x74, 0x47, 0xdb, 0xd6, 0xb0, 0xc5, 0xcf, 0x93, 0xd8, 0x36, 0x66, 0xd4, 0x83, 0xb3, 0x23, - 0xa5, 0x47, 0x00, 0x99, 0x86, 0xad, 0x39, 0xda, 0x0d, 0x5c, 0xd1, 0x74, 0x71, 0xf8, 0x44, 0xb6, - 0x35, 0x09, 0x25, 0x2b, 0x7a, 0x96, 0x74, 0xc7, 0xc5, 0xd6, 0x71, 0x5d, 0x0d, 0x61, 0x93, 0x64, - 0x1e, 0x57, 0xb2, 0xa2, 0xc7, 0xc5, 0xbe, 0x17, 0x86, 0x6a, 0x46, 0x8b, 0xd4, 0x7a, 0x0c, 0x8f, - 0xac, 0x1d, 0x92, 0x92, 0x61, 0x30, 0x17, 0x85, 0x57, 0xf1, 0xde, 0xa9, 0xd7, 0x90, 0x92, 0x61, - 0x30, 0x86, 0xf2, 0x20, 0x8c, 0xaa, 0xf5, 0xba, 0x45, 0x98, 0x0b, 0x46, 0x6c, 0x5f, 0x32, 0xe2, - 0x82, 0x29, 0x62, 0xfe, 0x32, 0xa4, 0x84, 0x1d, 0xc8, 0x52, 0x4d, 0x2c, 0x51, 0x31, 0xd9, 0x66, - 0x3b, 0x76, 0x22, 0xad, 0xa4, 0x74, 0xd1, 0x79, 0x2f, 0x0c, 0x69, 0x76, 0xc5, 0x3b, 0xc4, 0x8f, - 0xcd, 0xc4, 0x4e, 0xa4, 0x94, 0x8c, 0x66, 0xbb, 0x07, 0xa0, 0xf2, 0x57, 0x63, 0x30, 0x12, 0x7c, - 0x08, 0x81, 0x16, 0x20, 0xd5, 0x30, 0xaa, 0x2a, 0x75, 0x2d, 0xf6, 0x04, 0xec, 0x44, 0xc4, 0x73, - 0x8b, 0xc2, 0x32, 0xc7, 0x57, 0x5c, 0xca, 0xfc, 0x6f, 0x4b, 0x90, 0x12, 0x60, 0x34, 0x09, 0x09, - 0x53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, 0xd4, 0xf2, 0xaf, 0xdd, 0x9a, 0x1e, 0x9c, 0x27, 0xb0, 0xa5, 0x05, 0x65, - 0x90, 0x76, 0x2e, 0xd5, 0x48, 0x2d, 0xb0, 0x83, 0xb5, 0xfa, 0x8e, 0xc3, 0x63, 0x90, 0xb7, 0xd0, - 0x39, 0x48, 0x10, 0x97, 0xe1, 0xaf, 0xc7, 0xe4, 0xdb, 0xf6, 0x58, 0x6e, 0xdd, 0x5a, 0x4a, 0x91, - 0x81, 0x3f, 0xfd, 0x07, 0xd3, 0x92, 0x42, 0x29, 0xd0, 0x3c, 0x0c, 0x37, 0x54, 0xdb, 0xa9, 0xd0, - 0x35, 0x8c, 0x0c, 0x9f, 0xa4, 0x2c, 0x8e, 0xb4, 0x1b, 0x84, 0x1b, 0x96, 0x8b, 0x9e, 0x21, 0x54, - 0x0c, 0x54, 0x43, 0x27, 0x20, 0x4b, 0x99, 0x54, 0x8d, 0x66, 0x53, 0x73, 0x58, 0x75, 0x35, 0x40, - 0xed, 0x3e, 0x42, 0xe0, 0xf3, 0x14, 0x4c, 0x6b, 0xac, 0xa3, 0x90, 0xa6, 0x17, 0xf2, 0x29, 0x0a, - 0xbb, 0x7c, 0x96, 0x22, 0x00, 0xda, 0xf9, 0x20, 0x8c, 0x7a, 0x19, 0x94, 0xa1, 0xa4, 0x18, 0x17, - 0x0f, 0x4c, 0x11, 0x1f, 0x83, 0x09, 0x1d, 0xef, 0xd2, 0xeb, 0x70, 0x01, 0xec, 0x34, 0xc5, 0x46, - 0xa4, 0xef, 0x5a, 0x90, 0xe2, 0x5d, 0x30, 0x52, 0x15, 0xc6, 0x67, 0xb8, 0x40, 0x71, 0x87, 0x5d, - 0x28, 0x45, 0x3b, 0x02, 0x29, 0xd5, 0x34, 0x19, 0x42, 0x86, 0x67, 0x50, 0xd3, 0xa4, 0x5d, 0x27, - 0x61, 0x8c, 0xea, 0x68, 0x61, 0xbb, 0xd5, 0x70, 0x38, 0x93, 0x21, 0x8a, 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 0x28, 0xa6, 0xbd, 0xaf, 0x28, 0x4e, 0x40, 0xd2, - 0xff, 0x9d, 0x41, 0xd6, 0xb8, 0x7b, 0xb7, 0x85, 0xfe, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x99, - 0x63, 0xc7, 0x34, 0x4c, 0x8e, 0x00, 0x00, + // 9322 bytes of a gzipped FileDescriptorSet + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x7d, 0x6d, 0x70, 0x5c, 0xd7, + 0x75, 0x18, 0xdf, 0x7e, 0x00, 0xbb, 0x67, 0x17, 0xc0, 0xe2, 0x02, 0x04, 0x97, 0x4b, 0x12, 0x80, + 0x9e, 0x64, 0x89, 0xa2, 0x28, 0x40, 0xa2, 0x48, 0x8a, 0x5c, 0xda, 0x92, 0xb1, 0xd8, 0x25, 0x08, + 0x12, 0x5f, 0x7a, 0x00, 0x28, 0xc9, 0x4e, 0xba, 0xf3, 0xb0, 0x7b, 0xb1, 0x78, 0xe2, 0xee, 0x7b, + 0x4f, 0xef, 0xbd, 0x25, 0x01, 0xd9, 0x9e, 0x51, 0x62, 0xd7, 0xb5, 0x95, 0xa6, 0xb6, 0xea, 0x4c, + 0x6a, 0x2b, 0xa6, 0x2b, 0xc7, 0x69, 0x9d, 0x3a, 0x69, 0xf3, 0xe1, 0xd4, 0x6d, 0xda, 0xce, 0xd4, + 0x6e, 0x9b, 0xc6, 0x69, 0xa7, 0x19, 0x69, 0x9a, 0x99, 0xa6, 0x99, 0x86, 0x49, 0x65, 0x4d, 0xaa, + 0xba, 0x6e, 0xeb, 0xb0, 0x6a, 0x9a, 0x8e, 0x67, 0xda, 0xce, 0xfd, 0x7a, 0x5f, 0xbb, 0x8b, 0x5d, + 0x40, 0xa4, 0xe4, 0x34, 0xf9, 0x85, 0xbd, 0xe7, 0x9e, 0x73, 0xee, 0x39, 0xe7, 0x9e, 0x73, 0xee, + 0xb9, 0xf7, 0xdd, 0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+ 0xc0, 0xcb, 0x1c, 0x2a, 0x7f, 0x23, 0x02, 0x31, 0x9a, 0x58, 0x86, 0x20, 0xb5, 0xf6, 0xec, 0x4a, + 0xa9, 0x5c, 0x5c, 0x5e, 0x2f, 0x2c, 0x94, 0x32, 0x12, 0x1a, 0x04, 0xa0, 0x80, 0x8b, 0x0b, 0xcb, + 0x33, 0x6b, 0x99, 0x88, 0xdb, 0x9e, 0x5f, 0x5a, 0x3b, 0x7b, 0x3a, 0x13, 0x75, 0x09, 0xd6, 0x19, + 0x20, 0xe6, 0x47, 0x78, 0xec, 0x54, 0x26, 0x8e, 0x32, 0x90, 0x66, 0x0c, 0xe6, 0x9f, 0x29, 0x15, + 0xcf, 0x9e, 0xce, 0xf4, 0x05, 0x21, 0x8f, 0x9d, 0xca, 0xf4, 0xa3, 0x01, 0x48, 0x52, 0x48, 0x61, + 0x79, 0x79, 0x21, 0x93, 0x70, 0x79, 0xae, 0xae, 0x29, 0xf3, 0x4b, 0x73, 0x99, 0xa4, 0xcb, 0x73, + 0x4e, 0x59, 0x5e, 0x5f, 0xc9, 0x80, 0xcb, 0x61, 0xb1, 0xb4, 0xba, 0x3a, 0x33, 0x57, 0xca, 0xa4, + 0x5c, 0x8c, 0xc2, 0xb3, 0x6b, 0xa5, 0xd5, 0x4c, 0x3a, 0x20, 0xd6, 0x63, 0xa7, 0x32, 0x03, 0xee, + 0x10, 0xa5, 0xa5, 0xf5, 0xc5, 0xcc, 0x20, 0x1a, 0x86, 0x01, 0x36, 0x84, 0x10, 0x62, 0x28, 0x04, + 0x3a, 0x7b, 0x3a, 0x93, 0xf1, 0x04, 0x61, 0x5c, 0x86, 0x03, 0x80, 0xb3, 0xa7, 0x33, 0x48, 0x9e, + 0x85, 0x38, 0x75, 0x43, 0x84, 0x60, 0x70, 0x61, 0xa6, 0x50, 0x5a, 0x28, 0x2f, 0xaf, 0xac, 0xcd, + 0x2f, 0x2f, 0xcd, 0x2c, 0x64, 0x24, 0x0f, 0xa6, 0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0x6a, 0x34, 0x49, 0xad, 0xc7, 0xf0, 0xc8, 0xda, 0x21, 0x29, + 0x29, 0x06, 0x73, 0x51, 0x78, 0x15, 0xef, 0x9d, 0x7a, 0xa5, 0x95, 0x14, 0x83, 0x31, 0x94, 0x07, + 0x60, 0x48, 0xad, 0xd5, 0x2c, 0xc2, 0x5c, 0x30, 0x62, 0xfb, 0x92, 0x41, 0x17, 0x4c, 0x11, 0x73, + 0x97, 0x21, 0x21, 0xec, 0x40, 0x96, 0x6a, 0x62, 0x89, 0xb2, 0xc9, 0x36, 0xdb, 0x91, 0xe3, 0x49, + 0x25, 0xa1, 0x8b, 0xce, 0x7b, 0x20, 0xad, 0xd9, 0x65, 0xef, 0x10, 0x3f, 0x32, 0x19, 0x39, 0x9e, + 0x50, 0x52, 0x9a, 0xed, 0x1e, 0x80, 0xca, 0x5f, 0x8d, 0xc0, 0x60, 0xf0, 0x21, 0x04, 0x2a, 0x42, + 0xa2, 0x6e, 0x54, 0x54, 0xea, 0x5a, 0xec, 0x09, 0xd8, 0xf1, 0x2e, 0xcf, 0x2d, 0xa6, 0x16, 0x38, + 0xbe, 0xe2, 0x52, 0xe6, 0x7e, 0x5b, 0x82, 0x84, 0x00, 0xa3, 0x31, 0x88, 0x99, 0xaa, 0xb3, 0x45, + 0xd9, 0xc5, 0x0b, 0x91, 0x8c, 0xa4, 0xd0, 0x36, 0x81, 0xdb, 0xa6, 0xaa, 0x53, 0x17, 0xe0, 0x70, + 0xd2, 0x26, 0xf3, 0x5a, 0xc7, 0x6a, 0x95, 0x6e, 0x7a, 0x8c, 0x46, 0x03, 0xeb, 0x8e, 0x2d, 0xe6, + 0x95, 0xc3, 0x67, 0x39, 0x18, 0x3d, 0x04, 0xc3, 0x8e, 0xa5, 0x6a, 0xf5, 0x00, 0x6e, 0x8c, 0xe2, + 0x66, 0x44, 0x87, 0x8b, 0x9c, 0x87, 0xc3, 0x82, 0x6f, 0x15, 0x3b, 0x6a, 0x65, 0x0b, 0x57, 0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xa7, + 0x4c, 0xd7, 0x30, 0x32, 0x7c, 0x9c, 0xb2, 0x38, 0xdc, 0x6a, 0x10, 0x6e, 0x58, 0x2e, 0x7a, 0x8a, + 0x50, 0x31, 0x50, 0x15, 0x1d, 0x87, 0x0c, 0x65, 0x52, 0x31, 0x1a, 0x0d, 0xcd, 0x61, 0xd5, 0x55, + 0x1f, 0xb5, 0xfb, 0x20, 0x81, 0xcf, 0x52, 0x30, 0xad, 0xb1, 0x8e, 0x40, 0x92, 0x5e, 0xc8, 0xa7, + 0x28, 0xec, 0xf2, 0x59, 0x82, 0x00, 0x68, 0xe7, 0x03, 0x30, 0xe4, 0x65, 0x50, 0x86, 0x92, 0x60, + 0x5c, 0x3c, 0x30, 0x45, 0x7c, 0x04, 0x46, 0x75, 0xbc, 0x4d, 0xaf, 0xc3, 0x05, 0xb0, 0x93, 0x14, + 0x1b, 0x91, 0xbe, 0xab, 0x41, 0x8a, 0xf7, 0xc1, 0x60, 0x45, 0x18, 0x9f, 0xe1, 0x02, 0xc5, 0x1d, + 0x70, 0xa1, 0x14, 0xed, 0x30, 0x24, 0x54, 0xd3, 0x64, 0x08, 0x29, 0x9e, 0x41, 0x4d, 0x93, 0x76, + 0x9d, 0x80, 0x61, 0xaa, 0xa3, 0x85, 0xed, 0x66, 0xdd, 0xe1, 0x4c, 0xd2, 0x14, 0x67, 0x88, 0x74, + 0x28, 0x0c, 0x4e, 0x71, 0xef, 0x85, 0x01, 0x7c, 0x5d, 0xab, 0x62, 0xbd, 0x82, 0x19, 0xde, 0x00, + 0xc5, 0x4b, 0x0b, 0x20, 0x45, 0x7a, 0x10, 0xdc, 0xcc, 0x58, 0x16, 0x59, 0x7b, 0x90, 0xf1, 0x13, + 0xf0, 0x19, 0x06, 0x96, 0x4f, 0x42, 0xac, 0xa8, 0x3a, 0x2a, 0x29, 0x31, 0x9c, 0x6d, 0xb6, 0x14, + 0xa5, 0x15, 0xf2, 0xb3, 0x6d, 0xb8, 0xbd, 0x15, 0x81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56, 0x4d, 0xb5, 0xa6, 0xe9, 0xfe, 0xe7, 0xed, 0x87, 0xfd, 0x02, 0x53, 0x5c, 0x21, 0xb6, 0xac, + 0x43, 0x6a, 0x45, 0xad, 0x61, 0x05, 0x3f, 0xdf, 0xc4, 0xb6, 0xd3, 0xe6, 0x2d, 0x9a, 0x31, 0xe8, + 0x33, 0x36, 0x37, 0xc5, 0x65, 0x9a, 0x98, 0xc2, 0x5b, 0x68, 0x14, 0xe2, 0x75, 0xad, 0xa1, 0x31, + 0xa3, 0xc4, 0x14, 0xd6, 0x40, 0x13, 0x90, 0xaa, 0x10, 0xdd, 0xcb, 0xec, 0xf6, 0x71, 0x4c, 0x7c, + 0x25, 0xa4, 0xa9, 0x3b, 0x6b, 0x04, 0x22, 0x3f, 0x09, 0x69, 0x36, 0x1e, 0x2f, 0xa0, 0x0f, 0x43, + 0x82, 0xde, 0x16, 0xf5, 0x46, 0xed, 0x27, 0xed, 0x2b, 0xec, 0x8d, 0x1b, 0xc6, 0x85, 0x0d, 0xcc, + 0x1a, 0x85, 0x42, 0x47, 0x53, 0x1e, 0xef, 0x9e, 0xec, 0x98, 0xa1, 0x5c, 0x33, 0xfe, 0x46, 0x1c, + 0x0e, 0xf2, 0x07, 0xe1, 0xaa, 0xa9, 0x4d, 0x6f, 0x39, 0x8e, 0x78, 0x95, 0x0d, 0xf8, 0xce, 0x55, + 0x35, 0x35, 0x79, 0x07, 0x62, 0x97, 0x1c, 0xc7, 0x44, 0x27, 0x20, 0x6e, 0x35, 0xeb, 0x58, 0x1c, + 0xe0, 0x8e, 0x4e, 0x79, 0x38, 0x53, 0x04, 0x41, 0x69, 0xd6, 0xb1, 0xc2, 0x50, 0x50, 0x09, 0x26, + 0x36, 0x9b, 0xf5, 0xfa, 0x4e, 0xb9, 0x8a, 0xe9, 0x3f, 0x78, 0x72, 0xff, 0x45, 0x02, 0xde, 0x36, + 0x55, 0xdd, 0x2d, 0x3e, 0x12, 0xca, 0x51, 0x8a, 0x56, 0xa4, 0x58, 0xe2, 0xdf, 0x23, 0x94, 0x04, + 0x8e, 0xfc, 0x7b, 0x11, 0x48, 0x08, 0xd6, 0xf4, 0x15, 0x18, 0x5c, 0xc7, 0x15, 0xc7, 0x10, 0x8f, + 0x34, 0xdd, 0x36, 0x42, 0x10, 0xad, 0xf1, 0x29, 0x4a, 0x5e, 0x3a, 0xa0, 0x90, 0x06, 0x81, 0xb9, + 0x2f, 0x26, 0x11, 0x98, 0xd9, 0x24, 0xb3, 0x16, 0x33, 0x0d, 0x71, 0xd2, 0x72, 0xe9, 0x80, 0x42, + 0x5b, 0x28, 0x0b, 0x7d, 0x24, 0x80, 0x1c, 0xf6, 0xf5, 0x4a, 0x02, 0xe7, 0x6d, 0x34, 0x06, 0x71, + 0x53, 0x75, 0x2a, 0xec, 0xc6, 0x30, 0xe9, 0x60, 0x4d, 0x12, 0x13, 0xec, 0xad, 0xe1, 0xf0, 0x7f, + 0x4f, 0x21, 0xc6, 0x60, 0x9f, 0x67, 0x23, 0x72, 0xaf, 0xa8, 0x8e, 0x83, 0x2d, 0x9d, 0x30, 0x64, + 0xe8, 0xf4, 0x6d, 0x37, 0xa3, 0xba, 0xc3, 0xff, 0xa3, 0x0b, 0xfd, 0xcd, 0xff, 0x85, 0x04, 0xf5, + 0x87, 0x32, 0xed, 0x64, 0xff, 0xc8, 0x2a, 0x2d, 0x80, 0x05, 0x82, 0x54, 0x82, 0x11, 0xb5, 0x5a, + 0xd5, 0xd8, 0x3f, 0x57, 0x29, 0x6f, 0x68, 0xb4, 0x8a, 0xb6, 0xe9, 0xbf, 0x29, 0xeb, 0x34, 0x17, + 0xc8, 0x23, 0x28, 0x70, 0xfc, 0x42, 0x12, 0xfa, 0x4d, 0x26, 0x94, 0x7c, 0x01, 0x86, 0x5b, 0x24, + 0x25, 0xf2, 0x5d, 0xd3, 0xf4, 0xaa, 0x78, 0x5b, 0x8b, 0xfc, 0x26, 0x30, 0xfa, 0x89, 0x45, 0xf6, + 0xb0, 0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xaa, 0x89, 0x15, 0x18, 0x08, 0x2c, 0x60, 0x59, 0xf1, 0xdf, 0x4f, + 0x7b, 0xbf, 0x97, 0x1d, 0x64, 0x80, 0x72, 0x90, 0xc0, 0xdb, 0xa6, 0x61, 0x39, 0xb8, 0x4a, 0xaf, + 0x3c, 0x24, 0x14, 0xb7, 0x2d, 0x2f, 0x01, 0x6a, 0x9d, 0xdc, 0xf0, 0xf7, 0x1e, 0x93, 0xde, 0xf7, + 0x1e, 0x47, 0x21, 0xee, 0xff, 0x22, 0x22, 0x6b, 0xdc, 0xbd, 0xdb, 0x42, 0xff, 0x2f, 0x00, 0x00, + 0xff, 0xff, 0x2d, 0x40, 0x2b, 0xb4, 0xf6, 0x8e, 0x00, 0x00, } r := bytes.NewReader(gzipped) gzipr, err := compress_gzip.NewReader(r) @@ -4156,7 +4206,7 @@ func (m *Validator) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= github_com_cosmos_cosmos_sdk_types.BondStatus(b&0x7F) << shift + m.Status |= BondStatus(b&0x7F) << shift if b < 0x80 { break } diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index aa042c307e..3bac25fe79 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -17,7 +17,6 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/staking/exported" ) const ( @@ -29,7 +28,14 @@ const ( MaxDetailsLength = 280 ) -var _ exported.ValidatorI = Validator{} +var ( + BondStatusUnspecified = BondStatus_name[int32(Unspecified)] + BondStatusUnbonded = BondStatus_name[int32(Unbonded)] + BondStatusUnbonding = BondStatus_name[int32(Unbonding)] + BondStatusBonded = BondStatus_name[int32(Bonded)] +) + +var _ ValidatorI = Validator{} // NewValidator constructs a new Validator //nolint:interfacer @@ -43,7 +49,7 @@ func NewValidator(operator sdk.ValAddress, pubKey crypto.PubKey, description Des OperatorAddress: operator.String(), ConsensusPubkey: pkStr, Jailed: false, - Status: sdk.Unbonded, + Status: Unbonded, Tokens: sdk.ZeroInt(), DelegatorShares: sdk.ZeroDec(), Description: description, @@ -72,7 +78,7 @@ func (v Validators) String() (out string) { } // ToSDKValidators - convenience function convert []Validators to []sdk.Validators -func (v Validators) ToSDKValidators() (validators []exported.ValidatorI) { +func (v Validators) ToSDKValidators() (validators []ValidatorI) { for _, val := range v { validators = append(validators, val) } @@ -135,17 +141,17 @@ func UnmarshalValidator(cdc codec.BinaryMarshaler, value []byte) (v Validator, e // IsBonded checks if the validator status equals Bonded func (v Validator) IsBonded() bool { - return v.GetStatus().Equal(sdk.Bonded) + return v.GetStatus() == Bonded } // IsUnbonded checks if the validator status equals Unbonded func (v Validator) IsUnbonded() bool { - return v.GetStatus().Equal(sdk.Unbonded) + return v.GetStatus() == Unbonded } // IsUnbonding checks if the validator status equals Unbonding func (v Validator) IsUnbonding() bool { - return v.GetStatus().Equal(sdk.Unbonding) + return v.GetStatus() == Unbonding } // constant used in flags to indicate that description field should not be updated @@ -338,7 +344,7 @@ func (v Validator) PotentialConsensusPower() int64 { // UpdateStatus updates the location of the shares within a validator // to reflect the new status -func (v Validator) UpdateStatus(newStatus sdk.BondStatus) Validator { +func (v Validator) UpdateStatus(newStatus BondStatus) Validator { v.Status = newStatus return v } @@ -412,16 +418,16 @@ func (v Validator) RemoveDelShares(delShares sdk.Dec) (Validator, sdk.Int) { func (v Validator) MinEqual(other Validator) bool { return v.ConsensusPubkey == other.ConsensusPubkey && (v.OperatorAddress == other.OperatorAddress) && - v.Status.Equal(other.Status) && + v.Status == other.Status && v.Tokens.Equal(other.Tokens) && v.DelegatorShares.Equal(other.DelegatorShares) && v.Description == other.Description && v.Commission.Equal(other.Commission) } -func (v Validator) IsJailed() bool { return v.Jailed } -func (v Validator) GetMoniker() string { return v.Description.Moniker } -func (v Validator) GetStatus() sdk.BondStatus { return v.Status } +func (v Validator) IsJailed() bool { return v.Jailed } +func (v Validator) GetMoniker() string { return v.Description.Moniker } +func (v Validator) GetStatus() BondStatus { return v.Status } func (v Validator) GetOperator() sdk.ValAddress { if v.OperatorAddress == "" { return nil diff --git a/x/staking/types/validator_test.go b/x/staking/types/validator_test.go index 5ea04c2034..00ad07ba58 100644 --- a/x/staking/types/validator_test.go +++ b/x/staking/types/validator_test.go @@ -83,7 +83,7 @@ func TestShareTokens(t *testing.T) { validator := Validator{ OperatorAddress: valAddr1.String(), ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, pk1), - Status: sdk.Bonded, + Status: Bonded, Tokens: sdk.NewInt(100), DelegatorShares: sdk.NewDec(100), } @@ -101,7 +101,7 @@ func TestRemoveTokens(t *testing.T) { validator := Validator{ OperatorAddress: valAddr.String(), ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, valPubKey), - Status: sdk.Bonded, + Status: Bonded, Tokens: sdk.NewInt(100), DelegatorShares: sdk.NewDec(100), } @@ -111,8 +111,8 @@ func TestRemoveTokens(t *testing.T) { require.Equal(t, int64(90), validator.Tokens.Int64()) // update validator to from bonded -> unbonded - validator = validator.UpdateStatus(sdk.Unbonded) - require.Equal(t, sdk.Unbonded, validator.Status) + validator = validator.UpdateStatus(Unbonded) + require.Equal(t, Unbonded, validator.Status) validator = validator.RemoveTokens(sdk.NewInt(10)) require.Panics(t, func() { validator.RemoveTokens(sdk.NewInt(-1)) }) @@ -121,7 +121,7 @@ func TestRemoveTokens(t *testing.T) { func TestAddTokensValidatorBonded(t *testing.T) { validator := NewValidator(sdk.ValAddress(pk1.Address().Bytes()), pk1, Description{}) - validator = validator.UpdateStatus(sdk.Bonded) + validator = validator.UpdateStatus(Bonded) validator, delShares := validator.AddTokensFromDel(sdk.NewInt(10)) assert.True(sdk.DecEq(t, sdk.NewDec(10), delShares)) @@ -131,11 +131,11 @@ func TestAddTokensValidatorBonded(t *testing.T) { func TestAddTokensValidatorUnbonding(t *testing.T) { validator := NewValidator(sdk.ValAddress(pk1.Address().Bytes()), pk1, Description{}) - validator = validator.UpdateStatus(sdk.Unbonding) + validator = validator.UpdateStatus(Unbonding) validator, delShares := validator.AddTokensFromDel(sdk.NewInt(10)) assert.True(sdk.DecEq(t, sdk.NewDec(10), delShares)) - assert.Equal(t, sdk.Unbonding, validator.Status) + assert.Equal(t, Unbonding, validator.Status) assert.True(sdk.IntEq(t, sdk.NewInt(10), validator.Tokens)) assert.True(sdk.DecEq(t, sdk.NewDec(10), validator.DelegatorShares)) } @@ -143,11 +143,11 @@ func TestAddTokensValidatorUnbonding(t *testing.T) { func TestAddTokensValidatorUnbonded(t *testing.T) { validator := NewValidator(sdk.ValAddress(pk1.Address().Bytes()), pk1, Description{}) - validator = validator.UpdateStatus(sdk.Unbonded) + validator = validator.UpdateStatus(Unbonded) validator, delShares := validator.AddTokensFromDel(sdk.NewInt(10)) assert.True(sdk.DecEq(t, sdk.NewDec(10), delShares)) - assert.Equal(t, sdk.Unbonded, validator.Status) + assert.Equal(t, Unbonded, validator.Status) assert.True(sdk.IntEq(t, sdk.NewInt(10), validator.Tokens)) assert.True(sdk.DecEq(t, sdk.NewDec(10), validator.DelegatorShares)) } @@ -157,7 +157,7 @@ func TestRemoveDelShares(t *testing.T) { valA := Validator{ OperatorAddress: sdk.ValAddress(pk1.Address().Bytes()).String(), ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, pk1), - Status: sdk.Bonded, + Status: Bonded, Tokens: sdk.NewInt(100), DelegatorShares: sdk.NewDec(100), } @@ -174,7 +174,7 @@ func TestRemoveDelShares(t *testing.T) { validator := Validator{ OperatorAddress: sdk.ValAddress(pk1.Address().Bytes()).String(), ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, pk1), - Status: sdk.Bonded, + Status: Bonded, Tokens: poolTokens, DelegatorShares: delShares, } @@ -202,20 +202,20 @@ func TestAddTokensFromDel(t *testing.T) { func TestUpdateStatus(t *testing.T) { validator := NewValidator(sdk.ValAddress(pk1.Address().Bytes()), pk1, Description{}) validator, _ = validator.AddTokensFromDel(sdk.NewInt(100)) - require.Equal(t, sdk.Unbonded, validator.Status) + require.Equal(t, Unbonded, validator.Status) require.Equal(t, int64(100), validator.Tokens.Int64()) // Unbonded to Bonded - validator = validator.UpdateStatus(sdk.Bonded) - require.Equal(t, sdk.Bonded, validator.Status) + validator = validator.UpdateStatus(Bonded) + require.Equal(t, Bonded, validator.Status) // Bonded to Unbonding - validator = validator.UpdateStatus(sdk.Unbonding) - require.Equal(t, sdk.Unbonding, validator.Status) + validator = validator.UpdateStatus(Unbonding) + require.Equal(t, Unbonding, validator.Status) // Unbonding to Bonded - validator = validator.UpdateStatus(sdk.Bonded) - require.Equal(t, sdk.Bonded, validator.Status) + validator = validator.UpdateStatus(Bonded) + require.Equal(t, Bonded, validator.Status) } func TestPossibleOverflow(t *testing.T) { @@ -223,7 +223,7 @@ func TestPossibleOverflow(t *testing.T) { validator := Validator{ OperatorAddress: sdk.ValAddress(pk1.Address().Bytes()).String(), ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, pk1), - Status: sdk.Bonded, + Status: Bonded, Tokens: sdk.NewInt(2159), DelegatorShares: delShares, } @@ -315,7 +315,7 @@ func TestValidatorToTm(t *testing.T) { for i := range vals { pk := ed25519.GenPrivKey().PubKey() val := NewValidator(sdk.ValAddress(pk.Address()), pk, Description{}) - val.Status = sdk.Bonded + val.Status = Bonded val.Tokens = sdk.NewInt(rand.Int63()) vals[i] = val expected[i] = tmtypes.NewValidator(pk.(cryptotypes.IntoTmPubKey).AsTmPubKey(), val.ConsensusPower()) @@ -323,3 +323,14 @@ func TestValidatorToTm(t *testing.T) { require.Equal(t, expected, vals.ToTmValidators()) } + +func TestBondStatus(t *testing.T) { + require.False(t, Unbonded == Bonded) + require.False(t, Unbonded == Unbonding) + require.False(t, Bonded == Unbonding) + require.Equal(t, BondStatus(4).String(), "4") + require.Equal(t, BondStatusUnspecified, Unspecified.String()) + require.Equal(t, BondStatusUnbonded, Unbonded.String()) + require.Equal(t, BondStatusBonded, Bonded.String()) + require.Equal(t, BondStatusUnbonding, Unbonding.String()) +} From 647ad0dd3cc9c531ca6386d42650bccb719a571f Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 12 Oct 2020 17:31:25 +0200 Subject: [PATCH 13/84] docs: Update "Basics" section (#7416) * Prettier * docs: Update "Basics" section * appcli -> appd * Better wording * Fix to appCodec * Add gRPC mention * Add grpc * Reference simapp code * Update docs/basics/accounts.md Co-authored-by: Marie Gauthier * Add section about gRPC query services * Optional LegacyQuerierHandler * Clearer docs * Update docs/basics/app-anatomy.md Co-authored-by: Marie Gauthier * Update docs/basics/app-anatomy.md Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Address comments * Address comments * Update docs/basics/accounts.md Co-authored-by: Marie Gauthier Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> --- docs/basics/README.md | 4 +- docs/basics/accounts.md | 72 +++++++------- docs/basics/app-anatomy.md | 172 ++++++++++++++++++++------------- docs/basics/tx-lifecycle.md | 108 ++++++++++----------- simapp/app.go | 10 +- x/auth/client/cli/broadcast.go | 2 +- x/auth/client/cli/query.go | 2 +- x/slashing/client/cli/query.go | 6 +- x/slashing/client/cli/tx.go | 2 +- 9 files changed, 209 insertions(+), 169 deletions(-) diff --git a/docs/basics/README.md b/docs/basics/README.md index 131ee1ba45..ad54c6bee7 100644 --- a/docs/basics/README.md +++ b/docs/basics/README.md @@ -6,11 +6,11 @@ parent: # Basics -This repository contains reference documentation on the basic concepts of the Cosmos SDK. +This repository contains reference documentation on the basic concepts of the Cosmos SDK. 1. [Anatomy of an SDK Application](./app-anatomy.md) 2. [Lifecycle of a transaction](./tx-lifecycle.md) 3. [Accounts](./accounts.md) 4. [Gas and Fees](./gas-fees.md) -After reading the basics, head on to the [Core Reference](../core/README.md) for more advanced material. \ No newline at end of file +After reading the basics, head on to the [Core Reference](../core/README.md) for more advanced material. diff --git a/docs/basics/accounts.md b/docs/basics/accounts.md index 7b32a1f55a..411aa201a8 100644 --- a/docs/basics/accounts.md +++ b/docs/basics/accounts.md @@ -2,7 +2,7 @@ order: 3 --> -# Accounts +# Accounts This document describes the in-built accounts system of the Cosmos SDK. {synopsis} @@ -12,9 +12,9 @@ This document describes the in-built accounts system of the Cosmos SDK. {synopsi ## Account Definition -In the Cosmos SDK, an *account* designates a pair of *public key* `PubKey` and *private key* `PrivKey`. The `PubKey` can be derived to generate various `Addresses`, which are used to identify users (among other parties) in the application. `Addresses` are also associated with [`message`s](../building-modules/messages-and-queries.md#messages) to identify the sender of the `message`. The `PrivKey` is used to generate [digital signatures](#signatures) to prove that an `Address` associated with the `PrivKey` approved of a given `message`. +In the Cosmos SDK, an _account_ designates a pair of _public key_ `PubKey` and _private key_ `PrivKey`. The `PubKey` can be derived to generate various `Addresses`, which are used to identify users (among other parties) in the application. `Addresses` are also associated with [`message`s](../building-modules/messages-and-queries.md#messages) to identify the sender of the `message`. The `PrivKey` is used to generate [digital signatures](#signatures) to prove that an `Address` associated with the `PrivKey` approved of a given `message`. -To derive `PubKey`s and `PrivKey`s, the Cosmos SDK uses a standard called [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki). This standard defines how to build an HD wallet, where a wallet is a set of accounts. At the core of every account, there is a seed, which takes the form of a 12 or 24-words mnemonic. From this mnemonic, it is possible to derive any number of `PrivKey`s using one-way cryptographic function. Then, a `PubKey` can be derived from the `PrivKey`. Naturally, the mnemonic is the most sensitive information, as private keys can always be re-generated if the mnemonic is preserved. +To derive `PubKey`s and `PrivKey`s, the Cosmos SDK uses a standard called [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki). This standard defines how to build an HD wallet, where a wallet is a set of accounts. At the core of every account, there is a seed, which takes the form of a 12 or 24-words mnemonic. From this mnemonic, it is possible to derive any number of `PrivKey`s using one-way cryptographic function. Then, a `PubKey` can be derived from the `PrivKey`. Naturally, the mnemonic is the most sensitive information, as private keys can always be re-generated if the mnemonic is preserved. ``` Account 0 Account 1 Account 2 @@ -56,65 +56,65 @@ To derive `PubKey`s and `PrivKey`s, the Cosmos SDK uses a standard called [BIP32 +-------------------+ ``` -In the Cosmos SDK, accounts are stored and managed via an object called a [`Keybase`](#keybase). +In the Cosmos SDK, accounts are stored and managed via an object called a [`Keyring`](#keyring). -## Keybase +## Keyring -A `Keybase` is an object that stores and manages accounts. In the Cosmos SDK, a `Keybase` implementation follows the `Keybase` interface: +A `Keyring` is an object that stores and manages accounts. In the Cosmos SDK, a `Keyring` implementation follows the `Keyring` interface: -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/crypto/keys/types.go#L13-L86 ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/crypto/keyring/keyring.go#L50-L88 -The default implementation of `Keybase` of the Cosmos SDK is `dbKeybase`. +The default implementation of `Keyring` comes from the third-party [`99designs/keyring`](https://github.com/99designs/keyring) library. -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/crypto/keys/keybase.go +A few notes on the `Keyring` methods: -A few notes on the `Keybase` methods as implemented in `dbKeybase`: +- `Sign(uid string, msg []byte) ([]byte, tmcrypto.PubKey, error)` strictly deals with the signature of the `message` bytes. Some preliminary work should be done beforehand to prepare and encode the `message` into a canonical `[]byte` form, and this is done in the `GetSignBytes` method. See an example of `message` preparation from the `x/bank` module. Note that signature verification is not implemented in the SDK by default. It is deferred to the [`anteHandler`](#antehandler). + +++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/x/bank/types/msgs.go#L51-L54 +- `NewAccount(uid, mnemonic, bip39Passwd, hdPath string, algo SignatureAlgo) (Info, error)` creates a new account based on the [`bip44 path`](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) and persists it on disk (note that the `PrivKey` is [encrypted with a passphrase before being persisted](https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/crypto/keys/mintkey/mintkey.go), it is **never stored unencrypted**). In the context of this method, the `account` and `address` parameters refer to the segment of the BIP44 derivation path (e.g. `0`, `1`, `2`, ...) used to derive the `PrivKey` and `PubKey` from the mnemonic (note that given the same mnemonic and `account`, the same `PrivKey` will be generated, and given the same `account` and `address`, the same `PubKey` and `Address` will be generated). Finally, note that the `NewAccount` method derives keys and addresses using the algorithm specified in the last argument `algo`. Currently, the SDK supports two public key algorithms: + - `secp256k1`, as implemented in the [SDK's `crypto/keys/secp256k1` package](https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/crypto/keys/secp256k1/secp256k1.go), + - `ed25519`, as implemented in the [SDK's `crypto/keys/ed25519` package](https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/crypto/keys/ed25519/ed25519.go). +- `ExportPrivKeyArmor(uid, encryptPassphrase string) (armor string, err error)` exports a private key in ASCII-armored encrypted format, using the given passphrase. You can then either import it again into the keyring using the `ImportPrivKey(uid, armor, passphrase string)` function, or decrypt it into a raw private key using the `UnarmorDecryptPrivKey(armorStr string, passphrase string)` function. -- `Sign(name, passphrase string, msg []byte) ([]byte, crypto.PubKey, error)` strictly deals with the signature of the `message` bytes. Some preliminary work should be done beforehand to prepare and encode the `message` into a canonical `[]byte` form. See an example of `message` preparation from the `auth` module. Note that signature verification is not implemented in the SDK by default. It is deferred to the [`anteHandler`](#antehandler). - +++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/x/auth/types/txbuilder.go#L176-L209 -- `CreateMnemonic(name string, language Language, passwd string, algo SigningAlgo) (info Info, seed string, err error)` creates a new mnemonic and prints it in the logs, but it **does not persist it on disk**. -- `CreateAccount(name, mnemonic, bip39Passwd, encryptPasswd string, account uint32, index uint32) (Info, error)` creates a new account based on the [`bip44 path`](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) and persists it on disk (note that the `PrivKey` is [encrypted with a passphrase before being persisted](https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/crypto/keys/mintkey/mintkey.go), it is **never stored unencrypted**). In the context of this method, the `account` and `address` parameters refer to the segment of the BIP44 derivation path (e.g. `0`, `1`, `2`, ...) used to derive the `PrivKey` and `PubKey` from the mnemonic (note that given the same mnemonic and `account`, the same `PrivKey` will be generated, and given the same `account` and `address`, the same `PubKey` and `Address` will be generated). Finally, note that the `CreateAccount` method derives keys and addresses using `secp256k1` as implemented in the [Tendermint library](https://github.com/tendermint/tendermint/tree/bc572217c07b90ad9cee851f193aaa8e9557cbc7/crypto/secp256k1). As a result, it only works for creating account keys and addresses, not consensus keys. See [`Addresses`](#addresses) for more. - -The current implementation of `dbKeybase` is basic and does not offer on-demand locking. If an instance of `dbKeybase` is created, the underlying `db` is locked meaning no other process can access it besides the one in which it was instantiated. This is the reason why the default SDK client uses another implementation of the `Keybase` interface called `lazyKeybase`: - - -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/crypto/keys/lazy_keybase.go - -`lazyKeybase` is simple wrapper around `dbKeybase` which locks the database only when operations are to be performed and unlocks it immediately after. With the `lazyKeybase`, it is possible for the [command-line interface](../interfaces/cli.md) to create a new account while the [rest server](../interfaces/rest.md) is running. It is also possible to pipe multiple CLI commands. +Also see the [`Addresses`](#addresses) section for more information. ## Addresses and PubKeys `Addresses` and `PubKey`s are both public information that identify actors in the application. There are 3 main types of `Addresses`/`PubKeys` available by default in the Cosmos SDK: -- Addresses and Keys for **accounts**, which identify users (e.g. the sender of a `message`). They are derived using the **`secp256k1`** curve. -- Addresses and Keys for **validator operators**, which identify the operators of validators. They are derived using the **`secp256k1`** curve. +- Addresses and Keys for **accounts**, which identify users (e.g. the sender of a `message`). They are derived using the **`secp256k1`** curve. +- Addresses and Keys for **validator operators**, which identify the operators of validators. They are derived using the **`secp256k1`** curve. - Addresses and Keys for **consensus nodes**, which identify the validator nodes participating in consensus. They are derived using the **`ed25519`** curve. | | Address bech32 Prefix | Pubkey bech32 Prefix | Curve | Address byte length | Pubkey byte length | -|--------------------|-----------------------|----------------------|-------------|---------------------|--------------------| +| ------------------ | --------------------- | -------------------- | ----------- | ------------------- | ------------------ | | Accounts | cosmos | cosmospub | `secp256k1` | `20` | `33` | | Validator Operator | cosmosvaloper | cosmosvaloperpub | `secp256k1` | `20` | `33` | -| Consensus Nodes | cosmosvalcons | cosmosvalconspub | `ed25519` | `20` | `32` | +| Consensus Nodes | cosmosvalcons | cosmosvalconspub | `ed25519` | `20` | `32` | ### PubKeys -`PubKey`s used in the Cosmos SDK follow the `Pubkey` interface defined in tendermint's `crypto` package: +`PubKey`s used in the Cosmos SDK are Protobuf messages and extend the `Pubkey` interface defined in tendermint's `crypto` package: -+++ https://github.com/tendermint/tendermint/blob/bc572217c07b90ad9cee851f193aaa8e9557cbc7/crypto/crypto.go#L22-L27 ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/crypto/types/types.go#L8-L13 -For `secp256k1` keys, the actual implementation can be found [here](https://github.com/tendermint/tendermint/blob/bc572217c07b90ad9cee851f193aaa8e9557cbc7/crypto/secp256k1/secp256k1.go#L140). For `ed25519` keys, it can be found [here](https://github.com/tendermint/tendermint/blob/bc572217c07b90ad9cee851f193aaa8e9557cbc7/crypto/ed25519/ed25519.go#L135). ++++ https://github.com/tendermint/tendermint/blob/01c32c62e8840d812359c9e87e9c575aa67acb09/crypto/crypto.go#L22-L28 -Note that in the Cosmos SDK, `Pubkeys` are not manipulated in their raw form. Instead, they are double encoded using [`Amino`](../core/encoding.md#amino) and [`bech32`](https://en.bitcoin.it/wiki/Bech32). In the SDK is done by first calling the `Bytes()` method on the raw `Pubkey` (which applies amino encoding), and then the `ConvertAndEncode` method of `bech32`. +- For `secp256k1` keys, the actual implementation can be found [here](https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/crypto/keys/secp256k1/secp256k1.go). +- For `ed25519` keys, it can be found [here](https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/crypto/keys/ed25519/ed25519.go). -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/types/address.go#L579-L729 +In both case, the actual key (as raw bytes) is the compressed form of the pubkey. The first byte is a `0x02` byte if the `y`-coordinate is the lexicographically largest of the two associated with the `x`-coordinate. Otherwise the first byte is a `0x03`. This prefix is followed with the `x`-coordinate. + +Note that in the Cosmos SDK, `Pubkeys` are not manipulated in their raw bytes form. Instead, they are encoded to string using [`Amino`](../core/encoding.md#amino) and [`bech32`](https://en.bitcoin.it/wiki/Bech32). In the SDK, it is done by first calling the `Bytes()` method on the raw `Pubkey` (which applies amino encoding), and then the `ConvertAndEncode` method of `bech32`. + ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/types/address.go#L579-L729 ### Addresses The Cosmos SDK comes by default with 3 types of addresses: - `AccAddress` for accounts. -- `ValAddress` for validator operators. -- `ConsAddress` for validator nodes. +- `ValAddress` for validator operators. +- `ConsAddress` for validator nodes. Each of these address types are an alias for an hex-encoded `[]byte` array of length 20. Here is the standard way to obtain an address `aa` from a `Pubkey pub`: @@ -124,12 +124,12 @@ aa := sdk.AccAddress(pub.Address().Bytes()) These addresses implement the `Address` interface: -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/types/address.go#L71-L80 ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/types/address.go#L73-L82 -Of note, the `Marhsal()` and `Bytes()` method both return the same raw `[]byte` form of the address, the former being needed for Protobuff compatibility. Also, the `String()` method is used to return the `bech32` encoded form of the address, which should be the only address format with which end-user interract. Next is an example: +Of note, the `Marshal()` and `Bytes()` method both return the same raw `[]byte` form of the address, the former being needed for Protobuf compatibility. Also, the `String()` method is used to return the `bech32` encoded form of the address, which should be the only address format with which end-user interract. Here is an example: -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/types/address.go#L229-L243 ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/types/address.go#L232-L246 ## Next {hide} -Learn about [gas and fees](./gas-fees.md) {hide} \ No newline at end of file +Learn about [gas and fees](./gas-fees.md) {hide} diff --git a/docs/basics/app-anatomy.md b/docs/basics/app-anatomy.md index fc64b77242..5556b0c6a7 100644 --- a/docs/basics/app-anatomy.md +++ b/docs/basics/app-anatomy.md @@ -2,7 +2,7 @@ order: 1 --> -# Anatomy of an SDK Application +# Anatomy of an SDK Application This document describes the core parts of a Cosmos SDK application. Throughout the document, a placeholder application named `app` will be used. {synopsis} @@ -44,53 +44,54 @@ In general, the core of the state-machine is defined in a file called `app.go`. The first thing defined in `app.go` is the `type` of the application. It is generally comprised of the following parts: -- **A reference to [`baseapp`](../core/baseapp.md).** The custom application defined in `app.go` is an extension of `baseapp`. When a transaction is relayed by Tendermint to the application, `app` uses `baseapp`'s methods to route them to the appropriate module. `baseapp` implements most of the core logic for the application, including all the [ABCI methods](https://tendermint.com/docs/spec/abci/abci.html#overview) and the [routing logic](../core/baseapp.md#routing). -- **A list of store keys**. The [store](../core/store.md), which contains the entire state, is implemented as a [`multistore`](../core/store.md#multistore) (i.e. a store of stores) in the Cosmos SDK. Each module uses one or multiple stores in the multistore to persist their part of the state. These stores can be accessed with specific keys that are declared in the `app` type. These keys, along with the `keepers`, are at the heart of the [object-capabilities model](../core/ocap.md) of the Cosmos SDK. -- **A list of module's `keeper`s.** Each module defines an abstraction called [`keeper`](../building-modules/keeper.md), which handles reads and writes for this module's store(s). The `keeper`'s methods of one module can be called from other modules (if authorized), which is why they are declared in the application's type and exported as interfaces to other modules so that the latter can only access the authorized functions. -- **A reference to a [`codec`](../core/encoding.md).** The application's `codec` is used to serialize and deserialize data structures in order to store them, as stores can only persist `[]bytes`. The `codec` must be deterministic. The default codec is [amino](../core/encoding.md). -- **A reference to a [module manager](../building-modules/module-manager.md#manager)** and a [basic module manager](../building-modules/module-manager.md#basicmanager). The module manager is an object that contains a list of the application's module. It facilitates operations related to these modules, like registering [`routes`](../core/baseapp.md#routing), [query routes](../core/baseapp.md#query-routing) or setting the order of execution between modules for various functions like [`InitChainer`](#initchainer), [`BeginBlocker` and `EndBlocker`](#beginblocker-and-endblocker). +- **A reference to [`baseapp`](../core/baseapp.md).** The custom application defined in `app.go` is an extension of `baseapp`. When a transaction is relayed by Tendermint to the application, `app` uses `baseapp`'s methods to route them to the appropriate module. `baseapp` implements most of the core logic for the application, including all the [ABCI methods](https://tendermint.com/docs/spec/abci/abci.html#overview) and the [routing logic](../core/baseapp.md#routing). +- **A list of store keys**. The [store](../core/store.md), which contains the entire state, is implemented as a [`multistore`](../core/store.md#multistore) (i.e. a store of stores) in the Cosmos SDK. Each module uses one or multiple stores in the multistore to persist their part of the state. These stores can be accessed with specific keys that are declared in the `app` type. These keys, along with the `keepers`, are at the heart of the [object-capabilities model](../core/ocap.md) of the Cosmos SDK. +- **A list of module's `keeper`s.** Each module defines an abstraction called [`keeper`](../building-modules/keeper.md), which handles reads and writes for this module's store(s). The `keeper`'s methods of one module can be called from other modules (if authorized), which is why they are declared in the application's type and exported as interfaces to other modules so that the latter can only access the authorized functions. +- **A reference to an [`appCodec`](../core/encoding.md).** The application's `appCodec` is used to serialize and deserialize data structures in order to store them, as stores can only persist `[]bytes`. The default codec is [Protocol Buffers](../core/encoding.md). +- **A reference to a [`legacyAmino`](../core/encoding.md) codec.** Some parts of the SDK have not been migrated to use the `appCodec` above, and are still hardcoded to use Amino. Other parts explicity use Amino for backwards compatibility. For these reasons, the application still holds a reference to the legacy Amino codec. Please note that the Amino codec will be removed from the SDK in the upcoming releases. +- **A reference to a [module manager](../building-modules/module-manager.md#manager)** and a [basic module manager](../building-modules/module-manager.md#basicmanager). The module manager is an object that contains a list of the application's module. It facilitates operations related to these modules, like registering [`routes`](../core/baseapp.md#routing), [gRPC query services](../core/baseapp.md#grpc-query-services) and [legacy Tendermint query routes](../core/baseapp.md#legacy-query-routing) or setting the order of execution between modules for various functions like [`InitChainer`](#initchainer), [`BeginBlocker` and `EndBlocker`](#beginblocker-and-endblocker). -See an example of application type definition from [`gaia`](https://github.com/cosmos/gaia) +See an example of application type definition from `simapp`, the SDK's own app used for demo and testing purposes: -+++ https://github.com/cosmos/gaia/blob/5bc422e6868d04747e50b467e8eeb31ae2fe98a3/app/app.go#L87-L115 ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/simapp/app.go#L140-L179 ### Constructor Function -This function constructs a new application of the type defined in the section above. It must fulfill the `AppCreator` signature in order to be used in the [`start` command](../core/node.md#start-command) of the application's daemon command. +This function constructs a new application of the type defined in the section above. It must fulfill the `AppCreator` signature in order to be used in the [`start` command](../core/node.md#start-command) of the application's daemon command. -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/server/constructors.go#L20 ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/server/types/app.go#L42-L44 Here are the main actions performed by this function: - Instantiate a new [`codec`](../core/encoding.md) and initialize the `codec` of each of the application's module using the [basic manager](../building-modules/module-manager.md#basicmanager) - Instantiate a new application with a reference to a `baseapp` instance, a codec and all the appropriate store keys. -- Instantiate all the [`keeper`s](#keeper) defined in the application's `type` using the `NewKeeper` function of each of the application's modules. Note that `keepers` must be instantiated in the correct order, as the `NewKeeper` of one module might require a reference to another module's `keeper`. -- Instantiate the application's [module manager](../building-modules/module-manager.md#manager) with the [`AppModule`](#application-module-interface) object of each of the application's modules. -- With the module manager, initialize the application's [`routes`](../core/baseapp.md#routing) and [query routes](../core/baseapp.md#query-routing). When a transaction is relayed to the application by Tendermint via the ABCI, it is routed to the appropriate module's [`handler`](#handler) using the routes defined here. Likewise, when a query is received by the application, it is routed to the appropriate module's [`querier`](#querier) using the query routes defined here. -- With the module manager, register the [application's modules' invariants](../building-modules/invariants.md). Invariants are variables (e.g. total supply of a token) that are evaluated at the end of each block. The process of checking invariants is done via a special module called the [`InvariantsRegistry`](../building-modules/invariants.md#invariant-registry). The value of the invariant should be equal to a predicted value defined in the module. Should the value be different than the predicted one, special logic defined in the invariant registry will be triggered (usually the chain is halted). This is useful to make sure no critical bug goes unnoticed and produces long-lasting effects that would be hard to fix. -- With the module manager, set the order of execution between the `InitGenesis`, `BegingBlocker` and `EndBlocker` functions of each of the [application's modules](#application-module-interface). Note that not all modules implement these functions. +- Instantiate all the [`keeper`s](#keeper) defined in the application's `type` using the `NewKeeper` function of each of the application's modules. Note that `keepers` must be instantiated in the correct order, as the `NewKeeper` of one module might require a reference to another module's `keeper`. +- Instantiate the application's [module manager](../building-modules/module-manager.md#manager) with the [`AppModule`](#application-module-interface) object of each of the application's modules. +- With the module manager, initialize the application's [`routes`](../core/baseapp.md#routing), [`gRPC query services`](../core/baseapp.md#grpc-query-services) and [`legacy query routes`](../core/baseapp.md#query-routing). When a transaction is relayed to the application by Tendermint via the ABCI, it is routed to the appropriate module's [`handler`](#handler) using the `routes` defined here. Likewise, when a gRPC request is received by the application, it is routed to the appropriate module's [`gRPC query service`](#grpc-query-services) using the gRPC routes defined here. The SDK still supports legacy Tendermint queries, and these queries are routes using the `legacy query routes`. +- With the module manager, register the [application's modules' invariants](../building-modules/invariants.md). Invariants are variables (e.g. total supply of a token) that are evaluated at the end of each block. The process of checking invariants is done via a special module called the [`InvariantsRegistry`](../building-modules/invariants.md#invariant-registry). The value of the invariant should be equal to a predicted value defined in the module. Should the value be different than the predicted one, special logic defined in the invariant registry will be triggered (usually the chain is halted). This is useful to make sure no critical bug goes unnoticed and produces long-lasting effects that would be hard to fix. +- With the module manager, set the order of execution between the `InitGenesis`, `BegingBlocker` and `EndBlocker` functions of each of the [application's modules](#application-module-interface). Note that not all modules implement these functions. - Set the remainer of application's parameters: - + [`InitChainer`](#initchainer): used to initialize the application when it is first started. - + [`BeginBlocker`, `EndBlocker`](#beginblocker-and-endlbocker): called at the beginning and the end of every block). - + [`anteHandler`](../core/baseapp.md#antehandler): used to handle fees and signature verification. -- Mount the stores. -- Return the application. + - [`InitChainer`](#initchainer): used to initialize the application when it is first started. + - [`BeginBlocker`, `EndBlocker`](#beginblocker-and-endlbocker): called at the beginning and the end of every block). + - [`anteHandler`](../core/baseapp.md#antehandler): used to handle fees and signature verification. +- Mount the stores. +- Return the application. Note that this function only creates an instance of the app, while the actual state is either carried over from the `~/.appd/data` folder if the node is restarted, or generated from the genesis file if the node is started for the first time. -See an example of application constructor from [`gaia`](https://github.com/cosmos/gaia): +See an example of application constructor from `simapp`: -+++ https://github.com/cosmos/gaia/blob/f41a660cdd5bea173139965ade55bd25d1ee3429/app/app.go#L110-L222 ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/simapp/app.go#L190-L427 ### InitChainer -The `InitChainer` is a function that initializes the state of the application from a genesis file (i.e. token balances of genesis accounts). It is called when the application receives the `InitChain` message from the Tendermint engine, which happens when the node is started at `appBlockHeight == 0` (i.e. on genesis). The application must set the `InitChainer` in its [constructor](#constructor-function) via the [`SetInitChainer`](https://godoc.org/github.com/cosmos/cosmos-sdk/baseapp#BaseApp.SetInitChainer) method. +The `InitChainer` is a function that initializes the state of the application from a genesis file (i.e. token balances of genesis accounts). It is called when the application receives the `InitChain` message from the Tendermint engine, which happens when the node is started at `appBlockHeight == 0` (i.e. on genesis). The application must set the `InitChainer` in its [constructor](#constructor-function) via the [`SetInitChainer`](https://godoc.org/github.com/cosmos/cosmos-sdk/baseapp#BaseApp.SetInitChainer) method. In general, the `InitChainer` is mostly composed of the [`InitGenesis`](../building-modules/genesis.md#initgenesis) function of each of the application's modules. This is done by calling the `InitGenesis` function of the module manager, which in turn will call the `InitGenesis` function of each of the modules it contains. Note that the order in which the modules' `InitGenesis` functions must be called has to be set in the module manager using the [module manager's](../building-modules/module-manager.md) `SetOrderInitGenesis` method. This is done in the [application's constructor](#application-constructor), and the `SetOrderInitGenesis` has to be called before the `SetInitChainer`. -See an example of an `InitChainer` from [`gaia`](https://github.com/cosmos/gaia): - -+++ https://github.com/cosmos/gaia/blob/f41a660cdd5bea173139965ade55bd25d1ee3429/app/app.go#L235-L239 +See an example of an `InitChainer` from `simapp`: + ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/simapp/app.go#L450-L455 ### BeginBlocker and EndBlocker @@ -98,48 +99,58 @@ The SDK offers developers the possibility to implement automatic execution of co In general, the `BeginBlocker` and `EndBlocker` functions are mostly composed of the [`BeginBlock` and `EndBlock`](../building-modules/beginblock-endblock.md) functions of each of the application's modules. This is done by calling the `BeginBlock` and `EndBlock` functions of the module manager, which in turn will call the `BeginBLock` and `EndBlock` functions of each of the modules it contains. Note that the order in which the modules' `BegingBlock` and `EndBlock` functions must be called has to be set in the module manager using the `SetOrderBeginBlock` and `SetOrderEndBlock` methods respectively. This is done via the [module manager](../building-modules/module-manager.md) in the [application's constructor](#application-constructor), and the `SetOrderBeginBlock` and `SetOrderEndBlock` methods have to be called before the `SetBeginBlocker` and `SetEndBlocker` functions. -As a sidenote, it is important to remember that application-specific blockchains are deterministic. Developers must be careful not to introduce non-determinism in `BeginBlocker` or `EndBlocker`, and must also be careful not to make them too computationally expensive, as [gas](./gas-fees.md) does not constrain the cost of `BeginBlocker` and `EndBlocker` execution. +As a sidenote, it is important to remember that application-specific blockchains are deterministic. Developers must be careful not to introduce non-determinism in `BeginBlocker` or `EndBlocker`, and must also be careful not to make them too computationally expensive, as [gas](./gas-fees.md) does not constrain the cost of `BeginBlocker` and `EndBlocker` execution. -See an example of `BeginBlocker` and `EndBlocker` functions from [`gaia`](https://github.com/cosmos/gaia) +See an example of `BeginBlocker` and `EndBlocker` functions from `simapp` -+++ https://github.com/cosmos/gaia/blob/f41a660cdd5bea173139965ade55bd25d1ee3429/app/app.go#L224-L232 ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/simapp/app.go#L440-L448 ### Register Codec -The `MakeCodec` function is the last important function of the `app.go` file. The goal of this function is to instantiate a [codec `cdc`](../core/encoding.md) (e.g. amino) initialize the codec of the SDK and each of the application's modules using the `RegisterLegacyAminoCodec` function. +The `EncodingConfig` structure is the last important part of the `app.go` file. The goal of this structure is to define the codecs that will be used throughout the app. -To register the application's modules, the `MakeCodec` function calls `RegisterLegacyAminoCodec` on `ModuleBasics`. `ModuleBasics` is a [basic manager](../building-modules/module-manager.md#basicmanager) which lists all of the application's modules. It is instanciated in the `init()` function, and only serves to easily register non-dependant elements of application's modules (such as codec). To learn more about the basic module manager, click [here](../building-modules/module-manager.md#basicmanager). ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/simapp/params/encoding.go#L9-L16 -See an example of a `MakeCodec` from [`gaia`](https://github.com/cosmos/gaia): - -+++ https://github.com/cosmos/gaia/blob/f41a660cdd5bea173139965ade55bd25d1ee3429/app/app.go#L64-L70 +Here are descriptions of what each of the four fields means: + +- `InterfaceRegistry`: The `InterfaceRegistry` is used by the Protobuf codec to handle interfaces, which are encoded and decoded (we also say "unpacked") using [`google.protobuf.Any`](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). `Any` could be thought as a struct which contains a `type_url` (the concrete type of the interface) and a `value` (its encoded bytes). `InterfaceRegistry` provides a mechanism for registering interfaces and implementations that can be safely unpacked from `Any`. Each of the application's modules implements the `RegisterInterfaces` method, which can be used to register the module's own interfaces and implementations. + - To go more into details, the SDK uses an implementation of the Protobuf specification called [`gogoprotobuf`](https://github.com/gogo/protobuf). By default, the [gogo protobuf implementation of `Any`](https://godoc.org/github.com/gogo/protobuf/types) uses [global type registration](https://github.com/gogo/protobuf/blob/master/proto/properties.go#L540) to decode values packed in `Any` into concrete Go types. This introduces a vulnerability where any malicious module in the dependency tree could registry a type with the global protobuf registry and cause it to be loaded and unmarshaled by a transaction that referenced it in the `type_url` field. For more information, please refer to [ADR-019](../architecture/adr-019-protobuf-state-encoding.md). +- `Marshaler`: The `Marshaler` is the default codec used throughout the SDK. It is composed of a `BinaryMarshaler` used to encode and decode state, and a `JSONMarshaler` used to output data to the users (for example in the [CLI](#cli)). By default, the SDK uses Protobuf as `Marshaler`. +- `TxConfig`: `TxConfig` defines an interface a client can utilize to generate an application-defined concrete transaction type. Currently, the SDK handles two transaction types: `SIGN_MODE_DIRECT` (which uses Protobuf binary as over-the-wire encoding) and `SIGN_MODE_LEGACY_AMINO_JSON` (which depends on Amino). Read more about transactions [here](../core/transactions.md). +- `Amino`: Some legacy parts of the SDK still use Amino for backwards-compatibility. Each module exposes a `RegisterLegacyAmino` method to register the module's specific types within Amino. This `Amino` codec should not be used by app developers anymore, and will be removed in future releases. + +The SDK exposes a `MakeCodecs` function used to create a `EncodingConfig`. It uses Protobuf as default `Marshaler`, and passes it down to the app's `appCodec` field. It also instantiates a legacy `Amino` codec inside the app's `legacyAmino` field. + +See an example of a `MakeCodecs` from `simapp`: + ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/simapp/app.go#L429-L435 ## Modules -[Modules](../building-modules/intro.md) are the heart and soul of SDK applications. They can be considered as state-machines within the state-machine. When a transaction is relayed from the underlying Tendermint engine via the ABCI to the application, it is routed by [`baseapp`](../core/baseapp.md) to the appropriate module in order to be processed. This paradigm enables developers to easily build complex state-machines, as most of the modules they need often already exist. For developers, most of the work involved in building an SDK application revolves around building custom modules required by their application that do not exist yet, and integrating them with modules that do already exist into one coherent application. In the application directory, the standard practice is to store modules in the `x/` folder (not to be confused with the SDK's `x/` folder, which contains already-built modules). +[Modules](../building-modules/intro.md) are the heart and soul of SDK applications. They can be considered as state-machines within the state-machine. When a transaction is relayed from the underlying Tendermint engine via the ABCI to the application, it is routed by [`baseapp`](../core/baseapp.md) to the appropriate module in order to be processed. This paradigm enables developers to easily build complex state-machines, as most of the modules they need often already exist. For developers, most of the work involved in building an SDK application revolves around building custom modules required by their application that do not exist yet, and integrating them with modules that do already exist into one coherent application. In the application directory, the standard practice is to store modules in the `x/` folder (not to be confused with the SDK's `x/` folder, which contains already-built modules). ### Application Module Interface -Modules must implement [interfaces](../building-modules/module-manager.md#application-module-interfaces) defined in the Cosmos SDK, [`AppModuleBasic`](../building-modules/module-manager.md#appmodulebasic) and [`AppModule`](../building-modules/module-manager.md#appmodule). The former implements basic non-dependant elements of the module, such as the `codec`, while the latter handles the bulk of the module methods (including methods that require references to other modules' `keeper`s). Both the `AppModule` and `AppModuleBasic` types are defined in a file called `./module.go`. +Modules must implement [interfaces](../building-modules/module-manager.md#application-module-interfaces) defined in the Cosmos SDK, [`AppModuleBasic`](../building-modules/module-manager.md#appmodulebasic) and [`AppModule`](../building-modules/module-manager.md#appmodule). The former implements basic non-dependant elements of the module, such as the `codec`, while the latter handles the bulk of the module methods (including methods that require references to other modules' `keeper`s). Both the `AppModule` and `AppModuleBasic` types are defined in a file called `./module.go`. -`AppModule` exposes a collection of useful methods on the module that facilitates the composition of modules into a coherent application. These methods are are called from the `module manager`(../building-modules/module-manager.md#manager), which manages the application's collection of modules. +`AppModule` exposes a collection of useful methods on the module that facilitates the composition of modules into a coherent application. These methods are are called from the `module manager`(../building-modules/module-manager.md#manager), which manages the application's collection of modules. ### Message Types -[`Message`s](../building-modules/messages-and-queries.md#messages) are objects defined by each module that implement the [`message`](../building-modules/messages-and-queries.md#messages) interface. Each [`transaction`](../core/transactions.md) contains one or multiple `messages`. +[`Message`s](../building-modules/messages-and-queries.md#messages) are objects defined by each module that implement the [`message`](../building-modules/messages-and-queries.md#messages) interface. Each [`transaction`](../core/transactions.md) contains one or multiple `messages`. When a valid block of transactions is received by the full-node, Tendermint relays each one to the application via [`DeliverTx`](https://tendermint.com/docs/app-dev/abci-spec.html#delivertx). Then, the application handles the transaction: 1. Upon receiving the transaction, the application first unmarshalls it from `[]bytes`. -2. Then, it verifies a few things about the transaction like [fee payment and signatures](#gas-fees.md#antehandler) before extracting the message(s) contained in the transaction. -3. With the `Type()` method of the `message`, `baseapp` is able to route it to the appropriate module's [`handler`](#handler) in order for it to be processed. -4. If the message is successfully processed, the state is updated. +2. Then, it verifies a few things about the transaction like [fee payment and signatures](#gas-fees.md#antehandler) before extracting the message(s) contained in the transaction. +3. With the `Type()` method of the `message`, `baseapp` is able to route it to the appropriate module's [`handler`](#handler) in order for it to be processed. +4. If the message is successfully processed, the state is updated. For a more detailed look at a transaction lifecycle, click [here](./tx-lifecycle.md). Module developers create custom message types when they build their own module. The general practice is to prefix the type declaration of the message with `Msg`. For example, the message type `MsgSend` allows users to transfer tokens: -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/x/bank/internal/types/msgs.go#L10-L15 ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/proto/cosmos/bank/v1beta1/tx.proto#L10-L19 It is processed by the `handler` of the `bank` module, which ultimately calls the `keeper` of the `auth` module in order to update the state. @@ -150,25 +161,36 @@ The [`handler`](../building-modules/handler.md) refers to the part of the module The `handler` of a module is generally defined in a file called `handler.go` and consists of: - A **switch function** `NewHandler` to route the message to the appropriate `handler` function. This function returns a `handler` function, and is registered in the [`AppModule`](#application-module-interface) to be used in the application's module manager to initialize the [application's router](../core/baseapp.md#routing). Next is an example of such a switch from the [nameservice tutorial](https://github.com/cosmos/sdk-tutorials/tree/master/nameservice) - +++ https://github.com/cosmos/sdk-tutorials/blob/master/nameservice/x/nameservice/handler.go#L12-L26 -- **One handler function for each message type defined by the module**. Developers write the message processing logic in these functions. This generally involves doing stateful checks to ensure the message is valid and calling [`keeper`](#keeper)'s methods to update the state. + +++ https://github.com/cosmos/sdk-tutorials/blob/master/nameservice/x/nameservice/handler.go#L12-L26 +- **One handler function for each message type defined by the module**. Developers write the message processing logic in these functions. This generally involves doing stateful checks to ensure the message is valid and calling [`keeper`](#keeper)'s methods to update the state. Handler functions return a result of type `sdk.Result`, which informs the application on whether the message was successfully processed: -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/types/result.go#L15-L40 ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/types/result.go#L15-L40 -### Querier +### gRPC Query Services -[`Queriers`](../building-modules/querier.md) are very similar to `handlers`, except they serve user queries to the state as opposed to processing transactions. A [query](../building-modules/messages-and-queries.md#queries) is initiated from an [interface](#interfaces) by an end-user who provides a `queryRoute` and some `data`. The query is then routed to the correct application's `querier` by `baseapp`'s `handleQueryCustom` method using `queryRoute`: +gRPC query services are introduced in the v0.40 Stargate release. They allow users to query the state using [gRPC](https://grpc.io). They are enabled by default, and can be configued under the `grpc.enable` and `grpc.address` fields inside `app.toml`. -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/baseapp/abci.go#L395-L453 +gRPC query services are defined in the module's Protobuf definition, specifically inside `query.proto`. The `query.proto` definition file exposes a single `Query` [Protobuf service](https://developers.google.com/protocol-buffers/docs/proto#services). Each gRPC query endpoint corresponds to a service method, starting with the `rpc` keyword, inside the `Query` service. -The `Querier` of a module is defined in a file called `querier.go`, and consists of: +Protobuf generates a `QueryServer` interface for each module, containing all the service methods. A module's [`keeper`](#keeper) then needs to implement this `QueryServer` interface, by providing the concrete implementation of each service method. This concrete implementation is the handler of the corresponding gRPC query endpoint. + +Finally, each module should also implement the `RegisterQueryService` method as part of the [`AppModule` interface](#application-module-interface). This method should call the `RegisterQueryServer` function provided by the generated Protobuf code. + +### Legacy Querier + +Legacy queriers were queriers used before the introduction of Protobuf and gRPC in the SDK. They are present for existing modules, but will be deprecated in a future release of the SDK. If you are developing new modules, gRPC query services should be preferred, and you only need to implement the `LegacyQuerierHandler` interface if you wish to use legacy queriers. + +[`Queriers`](../building-modules/querier.md) are very similar to `handlers`, except they serve user queries to the state as opposed to processing transactions. A [query](../building-modules/messages-and-queries.md#queries) is initiated from an [interface](#application-interface) by an end-user who provides a `queryRoute` and some `data`. The query is then routed to the correct application's `querier` by `baseapp`'s `handleQueryCustom` method using `queryRoute`: + ++++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/baseapp/abci.go#L388-L418 + +The `Querier` of a module is defined in a file called `keeper/querier.go`, and consists of: - A **switch function** `NewQuerier` to route the query to the appropriate `querier` function. This function returns a `querier` function, and is is registered in the [`AppModule`](#application-module-interface) to be used in the application's module manager to initialize the [application's query router](../core/baseapp.md#query-routing). See an example of such a switch from the [nameservice tutorial](https://github.com/cosmos/sdk-tutorials/tree/master/nameservice): - +++ https://github.com/cosmos/sdk-tutorials/blob/86a27321cf89cc637581762e953d0c07f8c78ece/nameservice/x/nameservice/internal/keeper/querier.go#L19-L32 -- **One querier function for each data type defined by the module that needs to be queryable**. Developers write the query processing logic in these functions. This generally involves calling [`keeper`](#keeper)'s methods to query the state and marshalling it to JSON. - + +++ https://github.com/cosmos/sdk-tutorials/blob/86a27321cf89cc637581762e953d0c07f8c78ece/nameservice/x/nameservice/internal/keeper/querier.go#L19-L32 +- **One querier function for each data type defined by the module that needs to be queryable**. Developers write the query processing logic in these functions. This generally involves calling [`keeper`](#keeper)'s methods to query the state and marshalling it to JSON. ### Keeper @@ -184,36 +206,54 @@ The `keeper` type definition generally consists of: Along with the type definition, the next important component of the `keeper.go` file is the `keeper`'s constructor function, `NewKeeper`. This function instantiates a new `keeper` of the type defined above, with a `codec`, store `keys` and potentially references to other modules' `keeper`s as parameters. The `NewKeeper` function is called from the [application's constructor](#constructor-function). The rest of the file defines the `keeper`'s methods, primarily getters and setters. -### Command-Line and REST Interfaces +### Command-Line, gRPC Services and REST Interfaces -Each module defines command-line commands and REST routes to be exposed to end-user via the [application's interfaces](#application-interfaces). This enables end-users to create messages of the types defined in the module, or to query the subset of the state managed by the module. +Each module defines command-line commands, gRPC services and REST routes to be exposed to end-user via the [application's interfaces](#application-interfaces). This enables end-users to create messages of the types defined in the module, or to query the subset of the state managed by the module. #### CLI Generally, the [commands related to a module](../building-modules/module-interfaces.md#cli) are defined in a folder called `client/cli` in the module's folder. The CLI divides commands in two category, transactions and queries, defined in `client/cli/tx.go` and `client/cli/query.go` respectively. Both commands are built on top of the [Cobra Library](https://github.com/spf13/cobra): -- Transactions commands let users generate new transactions so that they can be included in a block and eventually update the state. One command should be created for each [message type](#message-types) defined in the module. The command calls the constructor of the message with the parameters provided by the end-user, and wraps it into a transaction. The SDK handles signing and the addition of other transaction metadata. -- Queries let users query the subset of the state defined by the module. Query commands forward queries to the [application's query router](../core/baseapp.md#query-routing), which routes them to the appropriate [querier](#querier) the `queryRoute` parameter supplied. +- Transactions commands let users generate new transactions so that they can be included in a block and eventually update the state. One command should be created for each [message type](#message-types) defined in the module. The command calls the constructor of the message with the parameters provided by the end-user, and wraps it into a transaction. The SDK handles signing and the addition of other transaction metadata. +- Queries let users query the subset of the state defined by the module. Query commands forward queries to the [application's query router](../core/baseapp.md#query-routing), which routes them to the appropriate [querier](#querier) the `queryRoute` parameter supplied. -#### REST +#### gRPC -The [module's REST interface](../building-modules/module-interfaces.md#rest) lets users generate transactions and query the state through REST calls to the application's [light client daemon](../core/node.md#lcd) (LCD). REST routes are defined in a file `client/rest/rest.go`, which is composed of: +[gRPC](https://grpc.io) is a modern open source high performance RPC framework that has support in multiple languages. It is the recommended way for external clients (such as wallets, browsers and other backend services) to interact with a node. + +Each module can expose gRPC endpoints, called [service methods](https://grpc.io/docs/what-is-grpc/core-concepts/#service-definition) and are defined in the [module's Protobuf `query.proto` file](#grpc-query-services). A service method is defined by its name, input arguments and output response. The module then needs to: + +- define a `RegisterGRPCRoutes` method on `AppModuleBasic` to wire the client gRPC requests to the correct handler inside the module. +- for each service method, define a corresponding handler. The handler implements the core logic necessary to serve the gRPC request, and is located in the `keeper/grpc_query.go` file. + +#### gRPC-gateway REST Endpoints + +Some external clients may not wish to use gRPC. The SDK provides in this case a gRPC gateway service, which exposes each gRPC service as a correspoding REST endpoint. Please refer to the [grpc-gateway](https://grpc-ecosystem.github.io/grpc-gateway/) documentation to learn more. + +The REST endpoints are defined in the Protobuf files, along with the gRPC services, using Protobuf annotations. Modules that want to expose REST queries should add `google.api.http` annotations to their `rpc` methods. By default, all REST endpoints defined in the SDK have an URL starting with the `/cosmos/` prefix. + +The SDK also provides a development endpoint to generate [Swagger](https://swagger.io/) definition files for these REST endpoints. This endpoint can be enabled inside the `app.toml` config file, under the `api.swagger` key. + +#### Legacy API REST Endpoints + +The [module's Legacy REST interface](../building-modules/module-interfaces.md#rest) lets users generate transactions and query the state through REST calls to the application's Legacy API Service. REST routes are defined in a file `client/rest/rest.go`, which is composed of: - A `RegisterRoutes` function, which registers each route defined in the file. This function is called from the [main application's interface](#application-interfaces) for each module used within the application. The router used in the SDK is [Gorilla's mux](https://github.com/gorilla/mux). - Custom request type definitions for each query or transaction creation function that needs to be exposed. These custom request types build on the base `request` type of the Cosmos SDK: - +++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/types/rest/rest.go#L47-L60 + +++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/types/rest/rest.go#L62-L76 - One handler function for each request that can be routed to the given module. These functions implement the core logic necessary to serve the request. +These Legacy API endpoints are present in the SDK for backward compatibility purposes and will be removed in the next release. + ## Application Interface [Interfaces](../interfaces/interfaces-intro.md) let end-users interact with full-node clients. This means querying data from the full-node or creating and sending new transactions to be relayed by the full-node and eventually included in a block. -The main interface is the [Command-Line Interface](../interfaces/cli.md). The CLI of an SDK application is built by aggregating [CLI commands](#cli) defined in each of the modules used by the application. The CLI of an application generally has the `-cli` suffix (e.g. `appcli`), and defined in a file called `cmd/appcli/main.go`. The file contains: +The main interface is the [Command-Line Interface](../interfaces/cli.md). The CLI of an SDK application is built by aggregating [CLI commands](#cli) defined in each of the modules used by the application. The CLI of an application is the same as the daemon (e.g. `appd`), and defined in a file called `appd/main.go`. The file contains: -- **A `main()` function**, which is executed to build the `appcli` interface client. This function prepares each command and adds them to the `rootCmd` before building them. At the root of `appCli`, the function adds generic commands like `status`, `keys` and `config`, query commands, tx commands and `rest-server`. -- **Query commands** are added by calling the `queryCmd` function, also defined in `appcli/main.go`. This function returns a Cobra command that contains the query commands defined in each of the application's modules (passed as an array of `sdk.ModuleClients` from the `main()` function), as well as some other lower level query commands such as block or validator queries. Query command are called by using the command `appcli query [query]` of the CLI. -- **Transaction commands** are added by calling the `txCmd` function. Similar to `queryCmd`, the function returns a Cobra command that contains the tx commands defined in each of the application's modules, as well as lower level tx commands like transaction signing or broadcasting. Tx commands are called by using the command `appcli tx [tx]` of the CLI. -- **A `registerRoutes` function**, which is called from the `main()` function when initializing the [application's light-client daemon (LCD)](../core/node.md#lcd) (i.e. `rest-server`). `registerRoutes` calls the `RegisterRoutes` function of each of the application's module, thereby registering the routes of the module to the lcd's router. The LCD can be started by running the following command `appcli rest-server`. +- **A `main()` function**, which is executed to build the `appd` interface client. This function prepares each command and adds them to the `rootCmd` before building them. At the root of `appd`, the function adds generic commands like `status`, `keys` and `config`, query commands, tx commands and `rest-server`. +- **Query commands** are added by calling the `queryCmd` function. This function returns a Cobra command that contains the query commands defined in each of the application's modules (passed as an array of `sdk.ModuleClients` from the `main()` function), as well as some other lower level query commands such as block or validator queries. Query command are called by using the command `appd query [query]` of the CLI. +- **Transaction commands** are added by calling the `txCmd` function. Similar to `queryCmd`, the function returns a Cobra command that contains the tx commands defined in each of the application's modules, as well as lower level tx commands like transaction signing or broadcasting. Tx commands are called by using the command `appd tx [tx]` of the CLI. See an example of an application's main command-line file from the [nameservice tutorial](https://github.com/cosmos/sdk-tutorials/tree/master/nameservice) @@ -221,11 +261,11 @@ See an example of an application's main command-line file from the [nameservice ## Dependencies and Makefile -This section is optional, as developers are free to choose their dependency manager and project building method. That said, the current most used framework for versioning control is [`go.mod`](https://github.com/golang/go/wiki/Modules). It ensures each of the libraries used throughout the application are imported with the correct version. See an example from the [nameservice tutorial](https://github.com/cosmos/sdk-tutorials/tree/master/nameservice): +This section is optional, as developers are free to choose their dependency manager and project building method. That said, the current most used framework for versioning control is [`go.mod`](https://github.com/golang/go/wiki/Modules). It ensures each of the libraries used throughout the application are imported with the correct version. See an example from the [nameservice tutorial](https://github.com/cosmos/sdk-tutorials/tree/master/nameservice): +++ https://github.com/cosmos/sdk-tutorials/blob/c6754a1e313eb1ed973c5c91dcc606f2fd288811/go.mod#L1-L18 -For building the application, a [Makefile](https://en.wikipedia.org/wiki/Makefile) is generally used. The Makefile primarily ensures that the `go.mod` is run before building the two entrypoints to the application, [`appd`](#node-client) and [`appcli`](#application-interface). See an example of Makefile from the [nameservice tutorial]() +For building the application, a [Makefile](https://en.wikipedia.org/wiki/Makefile) is generally used. The Makefile primarily ensures that the `go.mod` is run before building the two entrypoints to the application, [`appd`](#node-client) and [`appd`](#application-interface). See an example of Makefile from the [nameservice tutorial]() +++ https://github.com/cosmos/sdk-tutorials/blob/86a27321cf89cc637581762e953d0c07f8c78ece/nameservice/Makefile diff --git a/docs/basics/tx-lifecycle.md b/docs/basics/tx-lifecycle.md index 2272570226..7e375fc4db 100644 --- a/docs/basics/tx-lifecycle.md +++ b/docs/basics/tx-lifecycle.md @@ -28,10 +28,11 @@ There are several required and optional flags for transaction creation. The `--f Additionally, there are several [flags](../interfaces/cli.md) users can use to indicate how much they are willing to pay in [fees](./gas-fees.md): -* `--gas` refers to how much [gas](./gas-fees.md), which represents computational resources, `Tx` consumes. Gas is dependent on the transaction and is not precisely calculated until execution, but can be estimated by providing `auto` as the value for `--gas`. -* `--gas-adjustment` (optional) can be used to scale `gas` up in order to avoid underestimating. For example, users can specify their gas adjustment as 1.5 to use 1.5 times the estimated gas. -* `--gas-prices` specifies how much the user is willing pay per unit of gas, which can be one or multiple denominations of tokens. For example, `--gas-prices=0.025uatom, 0.025upho` means the user is willing to pay 0.025uatom AND 0.025upho per unit of gas. -* `--fees` specifies how much in fees the user is willing to pay in total. +- `--gas` refers to how much [gas](./gas-fees.md), which represents computational resources, `Tx` consumes. Gas is dependent on the transaction and is not precisely calculated until execution, but can be estimated by providing `auto` as the value for `--gas`. +- `--gas-adjustment` (optional) can be used to scale `gas` up in order to avoid underestimating. For example, users can specify their gas adjustment as 1.5 to use 1.5 times the estimated gas. +- `--gas-prices` specifies how much the user is willing pay per unit of gas, which can be one or multiple denominations of tokens. For example, `--gas-prices=0.025uatom, 0.025upho` means the user is willing to pay 0.025uatom AND 0.025upho per unit of gas. +- `--fees` specifies how much in fees the user is willing to pay in total. +- `--timeout-height` specifies a block timeout height to prevent the tx from being committed past a certain height. The ultimate value of the fees paid is equal to the gas multiplied by the gas prices. In other words, `fees = ceil(gas * gasPrices)`. Thus, since fees can be calculated using gas prices and vice versa, the users specify only one of the two. @@ -42,7 +43,7 @@ Later, validators decide whether or not to include the transaction in their bloc Users of application `app` can enter the following command into their CLI to generate a transaction to send 1000uatom from a `senderAddress` to a `recipientAddress`. It specifies how much gas they are willing to pay: an automatic estimate scaled up by 1.5 times, with a gas price of 0.025uatom per unit gas. ```bash -appcli tx send 1000uatom --from --gas auto --gas-adjustment 1.5 --gas-prices 0.025uatom +appd tx send 1000uatom --from --gas auto --gas-adjustment 1.5 --gas-prices 0.025uatom ``` #### Other Transaction Creation Methods @@ -60,11 +61,11 @@ Each full-node (running Tendermint) that receives a `Tx` sends an [ABCI message] The full-nodes perform stateless, then stateful checks on `Tx` during `CheckTx`, with the goal to identify and reject an invalid transaction as early on as possible to avoid wasted computation. -***Stateless*** checks do not require nodes to access state - light clients or offline nodes can do +**_Stateless_** checks do not require nodes to access state - light clients or offline nodes can do them - and are thus less computationally expensive. Stateless checks include making sure addresses are not empty, enforcing nonnegative numbers, and other logic specified in the definitions. -***Stateful*** checks validate transactions and messages based on a committed state. Examples +**_Stateful_** checks validate transactions and messages based on a committed state. Examples include checking that the relevant values exist and are able to be transacted with, the address has sufficient funds, and the sender is authorized or has the correct ownership to transact. At any given moment, full-nodes typically have [multiple versions](../core/baseapp.md#volatile-states) @@ -140,39 +141,39 @@ locally, this process yields a single, unambiguous result, since the messages' s explicitly ordered in the block proposal. ``` - ----------------------- + ----------------------- |Receive Block Proposal| - ----------------------- - | + ----------------------- + | v - ----------------------- - | BeginBlock | - ----------------------- - | - v - ----------------------- - | DeliverTx(tx0) | - | DeliverTx(tx1) | - | DeliverTx(tx2) | - | DeliverTx(tx3) | - | . | + ----------------------- + | BeginBlock | + ----------------------- + | + v + ----------------------- + | DeliverTx(tx0) | + | DeliverTx(tx1) | + | DeliverTx(tx2) | + | DeliverTx(tx3) | + | . | | . | | . | - ----------------------- - | - v ----------------------- - | EndBlock | + | + v ----------------------- - | - v + | EndBlock | ----------------------- - | Consensus | + | + v ----------------------- - | - v + | Consensus | ----------------------- - | Commit | + | + v + ----------------------- + | Commit | ----------------------- ``` @@ -184,30 +185,29 @@ to during consensus. Under the hood, `DeliverTx` is almost identical to `CheckTx [`runTx`](../core/baseapp.md#runtx) function in deliver mode instead of check mode. Instead of using their `checkState`, full-nodes use `deliverState`: -* **Decoding:** Since `DeliverTx` is an ABCI call, `Tx` is received in the encoded `[]byte` form. -Nodes first unmarshal the transaction, then call `runTx` in `runTxModeDeliver`, which is very -similar to `CheckTx` but also executes and writes state changes. +- **Decoding:** Since `DeliverTx` is an ABCI call, `Tx` is received in the encoded `[]byte` form. + Nodes first unmarshal the transaction, using the [`TxConfig`](./app-anatomy#register-codec) defined in the app, then call `runTx` in `runTxModeDeliver`, which is very similar to `CheckTx` but also executes and writes state changes. -* **Checks:** Full-nodes call `validateBasicMsgs` and the `AnteHandler` again. This second check -happens because they may not have seen the same transactions during the addition to Mempool stage\ -and a malicious proposer may have included invalid ones. One difference here is that the -`AnteHandler` will not compare `gas-prices` to the node's `min-gas-prices` since that value is local -to each node - differing values across nodes would yield nondeterministic results. +- **Checks:** Full-nodes call `validateBasicMsgs` and the `AnteHandler` again. This second check + happens because they may not have seen the same transactions during the addition to Mempool stage\ + and a malicious proposer may have included invalid ones. One difference here is that the + `AnteHandler` will not compare `gas-prices` to the node's `min-gas-prices` since that value is local + to each node - differing values across nodes would yield nondeterministic results. -* **Route and Handler:** While `CheckTx` would have exited, `DeliverTx` continues to run -[`runMsgs`](../core/baseapp.md#runtx-and-runmsgs) to fully execute each `Msg` within the transaction. -Since the transaction may have messages from different modules, `baseapp` needs to know which module -to find the appropriate Handler. Thus, the `route` function is called via the [module manager](../building-modules/module-manager.md) to -retrieve the route name and find the [`Handler`](../building-modules/handler.md) within the module. +- **Route and Handler:** While `CheckTx` would have exited, `DeliverTx` continues to run + [`runMsgs`](../core/baseapp.md#runtx-and-runmsgs) to fully execute each `Msg` within the transaction. + Since the transaction may have messages from different modules, `baseapp` needs to know which module + to find the appropriate Handler. Thus, the `route` function is called via the [module manager](../building-modules/module-manager.md) to + retrieve the route name and find the [`Handler`](../building-modules/handler.md) within the module. -* **Handler:** The `handler`, a step up from `AnteHandler`, is responsible for executing each -message in the `Tx` and causes state transitions to persist in `deliverTxState`. It is defined -within a `Msg`'s module and writes to the appropriate stores within the module. +- **Handler:** The `handler`, a step up from `AnteHandler`, is responsible for executing each + message in the `Tx` and causes state transitions to persist in `deliverTxState`. It is defined + within a `Msg`'s module and writes to the appropriate stores within the module. -* **Gas:** While a `Tx` is being delivered, a `GasMeter` is used to keep track of how much -gas is being used; if execution completes, `GasUsed` is set and returned in the -`abci.ResponseDeliverTx`. If execution halts because `BlockGasMeter` or `GasMeter` has run out or something else goes -wrong, a deferred function at the end appropriately errors or panics. +- **Gas:** While a `Tx` is being delivered, a `GasMeter` is used to keep track of how much + gas is being used; if execution completes, `GasUsed` is set and returned in the + `abci.ResponseDeliverTx`. If execution halts because `BlockGasMeter` or `GasMeter` has run out or something else goes + wrong, a deferred function at the end appropriately errors or panics. If there are any failed state changes resulting from a `Tx` being invalid or `GasMeter` running out, the transaction processing terminates and any state changes are reverted. Invalid transactions in a @@ -219,14 +219,14 @@ The final step is for nodes to commit the block and state changes. Validator nod perform the previous step of executing state transitions in order to validate the transactions, then sign the block to confirm it. Full nodes that are not validators do not participate in consensus - i.e. they cannot vote - but listen for votes to understand whether or -not they should commit the state changes. +not they should commit the state changes. -When they receive enough validator votes (2/3+ *precommits* weighted by voting power), full nodes commit to a new block to be added to the blockchain and +When they receive enough validator votes (2/3+ _precommits_ weighted by voting power), full nodes commit to a new block to be added to the blockchain and finalize the state transitions in the application layer. A new state root is generated to serve as a merkle proof for the state transitions. Applications use the [`Commit`](../core/baseapp.md#commit) ABCI method inherited from [Baseapp](../core/baseapp.md); it syncs all the state transitions by writing the `deliverState` into the application's internal state. As soon as the state changes are -committed, `checkState` start afresh from the most recently committed state and `deliverState` +committed, `checkState` start afresh from the most recently committed state and `deliverState` resets to `nil` in order to be consistent and reflect the changes. Note that not all blocks have the same number of transactions and it is possible for consensus to diff --git a/simapp/app.go b/simapp/app.go index 91a107bee6..c4ea3d070a 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -140,7 +140,7 @@ var _ App = (*SimApp)(nil) // capabilities aren't needed for testing. type SimApp struct { *baseapp.BaseApp - cdc *codec.LegacyAmino + legacyAmino *codec.LegacyAmino appCodec codec.Marshaler interfaceRegistry types.InterfaceRegistry @@ -196,7 +196,7 @@ func NewSimApp( // TODO: Remove cdc in favor of appCodec once all modules are migrated. appCodec := encodingConfig.Marshaler - cdc := encodingConfig.Amino + legacyAmino := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry bApp := baseapp.NewBaseApp(appName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) @@ -216,7 +216,7 @@ func NewSimApp( app := &SimApp{ BaseApp: bApp, - cdc: cdc, + legacyAmino: legacyAmino, appCodec: appCodec, interfaceRegistry: interfaceRegistry, invCheckPeriod: invCheckPeriod, @@ -225,7 +225,7 @@ func NewSimApp( memKeys: memKeys, } - app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) + app.ParamsKeeper = initParamsKeeper(appCodec, legacyAmino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) // set the BaseApp's parameter store bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable())) @@ -488,7 +488,7 @@ func (app *SimApp) BlockedAddrs() map[string]bool { // NOTE: This is solely to be used for testing purposes as it may be desirable // for modules to register their own custom testing types. func (app *SimApp) LegacyAmino() *codec.LegacyAmino { - return app.cdc + return app.legacyAmino } // AppCodec returns SimApp's app codec. diff --git a/x/auth/client/cli/broadcast.go b/x/auth/client/cli/broadcast.go index 5f09d4ca7c..64df000dc1 100644 --- a/x/auth/client/cli/broadcast.go +++ b/x/auth/client/cli/broadcast.go @@ -21,7 +21,7 @@ flag and signed with the sign command. Read a transaction from [file_path] and broadcast it to a node. If you supply a dash (-) argument in place of an input filename, the command reads from standard input. -$ tx broadcast ./mytxn.json +$ tx broadcast ./mytxn.json `), Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index df0dce31fc..c6fb14054f 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -49,7 +49,7 @@ func QueryParamsCmd() *cobra.Command { Args: cobra.NoArgs, Long: strings.TrimSpace(`Query the current auth parameters: -$ query auth params +$ query auth params `), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) diff --git a/x/slashing/client/cli/query.go b/x/slashing/client/cli/query.go index 55009706ef..f74b0db965 100644 --- a/x/slashing/client/cli/query.go +++ b/x/slashing/client/cli/query.go @@ -41,7 +41,7 @@ func GetCmdQuerySigningInfo() *cobra.Command { Short: "Query a validator's signing information", Long: strings.TrimSpace(`Use a validators' consensus public key to find the signing-info for that validator: -$ query slashing signing-info cosmosvalconspub1zcjduepqfhvwcmt7p06fvdgexxhmz0l8c7sgswl7ulv7aulk364x4g5xsw7sr0k2g5 +$ query slashing signing-info cosmosvalconspub1zcjduepqfhvwcmt7p06fvdgexxhmz0l8c7sgswl7ulv7aulk364x4g5xsw7sr0k2g5 `), Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { @@ -81,7 +81,7 @@ func GetCmdQuerySigningInfos() *cobra.Command { Short: "Query signing information of all validators", Long: strings.TrimSpace(`signing infos of validators: -$ query slashing signing-infos +$ query slashing signing-infos `), Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { @@ -122,7 +122,7 @@ func GetCmdQueryParams() *cobra.Command { Args: cobra.NoArgs, Long: strings.TrimSpace(`Query genesis parameters for the slashing module: -$ query slashing params +$ query slashing params `), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) diff --git a/x/slashing/client/cli/tx.go b/x/slashing/client/cli/tx.go index 842c5a508a..298a44e140 100644 --- a/x/slashing/client/cli/tx.go +++ b/x/slashing/client/cli/tx.go @@ -31,7 +31,7 @@ func NewUnjailTxCmd() *cobra.Command { Short: "unjail validator previously jailed for downtime", Long: `unjail a jailed validator: -$ tx slashing unjail --from mykey +$ tx slashing unjail --from mykey `, RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) From 228728cce2af8d494c8b4e996d011492139b04ab Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Mon, 12 Oct 2020 12:31:51 -0400 Subject: [PATCH 14/84] Refactor RegisterQueryServices -> RegisterServices (#7518) * Refactor RegisterQueryServices -> RegisterServices * Fix tests --- simapp/app.go | 2 +- tests/mocks/types_module_module.go | 26 +++++++++++++------------- types/module/configurator.go | 27 +++++++++++++++++++++++++++ types/module/module.go | 15 +++++++-------- types/module/module_test.go | 11 ++++++----- x/auth/module.go | 5 ++--- x/auth/vesting/module.go | 3 +-- x/bank/module.go | 5 ++--- x/capability/module.go | 3 +-- x/crisis/module.go | 3 +-- x/distribution/module.go | 5 ++--- x/evidence/module.go | 5 ++--- x/gov/module.go | 5 ++--- x/ibc/applications/transfer/module.go | 5 ++--- x/ibc/core/module.go | 5 ++--- x/ibc/testing/mock/mock.go | 5 +++-- x/mint/module.go | 5 ++--- x/params/module.go | 5 ++--- x/slashing/module.go | 5 ++--- x/staking/module.go | 5 ++--- x/upgrade/module.go | 5 ++--- 21 files changed, 84 insertions(+), 71 deletions(-) create mode 100644 types/module/configurator.go diff --git a/simapp/app.go b/simapp/app.go index c4ea3d070a..d209aafb7b 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -359,7 +359,7 @@ func NewSimApp( app.mm.RegisterInvariants(&app.CrisisKeeper) app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) - app.mm.RegisterQueryServices(app.GRPCQueryRouter()) + app.mm.RegisterServices(module.NewConfigurator(app.GRPCQueryRouter())) // add test gRPC service for testing gRPC queries in isolation testdata.RegisterTestServiceServer(app.GRPCQueryRouter(), testdata.TestServiceImpl{}) diff --git a/tests/mocks/types_module_module.go b/tests/mocks/types_module_module.go index 816a486b2e..b03b358094 100644 --- a/tests/mocks/types_module_module.go +++ b/tests/mocks/types_module_module.go @@ -10,10 +10,10 @@ import ( codec "github.com/cosmos/cosmos-sdk/codec" types "github.com/cosmos/cosmos-sdk/codec/types" types0 "github.com/cosmos/cosmos-sdk/types" - grpc "github.com/gogo/protobuf/grpc" + module "github.com/cosmos/cosmos-sdk/types/module" gomock "github.com/golang/mock/gomock" mux "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" + runtime "github.com/grpc-ecosystem/grpc-gateway/runtime" cobra "github.com/spf13/cobra" types1 "github.com/tendermint/tendermint/abci/types" reflect "reflect" @@ -264,7 +264,7 @@ func (mr *MockAppModuleGenesisMockRecorder) RegisterRESTRoutes(arg0, arg1 interf // RegisterGRPCRoutes mocks base method func (m *MockAppModuleGenesis) RegisterGRPCRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterRESTRoutes", arg0, arg1) + m.ctrl.Call(m, "RegisterGRPCRoutes", arg0, arg1) } // RegisterGRPCRoutes indicates an expected call of RegisterGRPCRoutes @@ -539,29 +539,29 @@ func (mr *MockAppModuleMockRecorder) QuerierRoute() *gomock.Call { } // LegacyQuerierHandler mocks base method -func (m *MockAppModule) LegacyQuerierHandler(*codec.LegacyAmino) types0.Querier { +func (m *MockAppModule) LegacyQuerierHandler(arg0 *codec.LegacyAmino) types0.Querier { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LegacyQuerierHandler") + ret := m.ctrl.Call(m, "LegacyQuerierHandler", arg0) ret0, _ := ret[0].(types0.Querier) return ret0 } // LegacyQuerierHandler indicates an expected call of LegacyQuerierHandler -func (mr *MockAppModuleMockRecorder) NewQuerierHandler() *gomock.Call { +func (mr *MockAppModuleMockRecorder) LegacyQuerierHandler(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyQuerierHandler", reflect.TypeOf((*MockAppModule)(nil).LegacyQuerierHandler)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyQuerierHandler", reflect.TypeOf((*MockAppModule)(nil).LegacyQuerierHandler), arg0) } -// RegisterQueryService mocks base method -func (m *MockAppModule) RegisterQueryService(arg0 grpc.Server) { +// RegisterServices mocks base method +func (m *MockAppModule) RegisterServices(arg0 module.Configurator) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterQueryService", arg0) + m.ctrl.Call(m, "RegisterServices", arg0) } -// RegisterQueryService indicates an expected call of RegisterQueryService -func (mr *MockAppModuleMockRecorder) RegisterQueryService(arg0 interface{}) *gomock.Call { +// RegisterServices indicates an expected call of RegisterServices +func (mr *MockAppModuleMockRecorder) RegisterServices(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterQueryService", reflect.TypeOf((*MockAppModule)(nil).RegisterQueryService), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterServices", reflect.TypeOf((*MockAppModule)(nil).RegisterServices), arg0) } // BeginBlock mocks base method diff --git a/types/module/configurator.go b/types/module/configurator.go new file mode 100644 index 0000000000..efa83607de --- /dev/null +++ b/types/module/configurator.go @@ -0,0 +1,27 @@ +package module + +import "github.com/gogo/protobuf/grpc" + +// Configurator provides the hooks to allow modules to configure and register +// their services in the RegisterServices method. It is designed to eventually +// support module object capabilities isolation as described in +// https://github.com/cosmos/cosmos-sdk/issues/7093 +type Configurator interface { + QueryServer() grpc.Server +} + +type configurator struct { + queryServer grpc.Server +} + +// NewConfigurator returns a new Configurator instance +func NewConfigurator(queryServer grpc.Server) Configurator { + return configurator{queryServer: queryServer} +} + +var _ Configurator = configurator{} + +// QueryServer implements the Configurator.QueryServer method +func (c configurator) QueryServer() grpc.Server { + return c.queryServer +} diff --git a/types/module/module.go b/types/module/module.go index d02b9b2568..ec9c1c77b5 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -31,7 +31,6 @@ package module import ( "encoding/json" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -173,8 +172,8 @@ type AppModule interface { // Deprecated: use RegisterQueryService LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier - // RegisterQueryService allows a module to register a gRPC query service - RegisterQueryService(grpc.Server) + // RegisterServices allows a module to register services + RegisterServices(Configurator) // ABCI BeginBlock(sdk.Context, abci.RequestBeginBlock) @@ -207,8 +206,8 @@ func (GenesisOnlyAppModule) QuerierRoute() string { return "" } // LegacyQuerierHandler returns an empty module querier func (gam GenesisOnlyAppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil } -// RegisterQueryService registers all gRPC query services. -func (gam GenesisOnlyAppModule) RegisterQueryService(grpc.Server) {} +// RegisterServices registers all services. +func (gam GenesisOnlyAppModule) RegisterServices(Configurator) {} // BeginBlock returns an empty module begin-block func (gam GenesisOnlyAppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) {} @@ -288,10 +287,10 @@ func (m *Manager) RegisterRoutes(router sdk.Router, queryRouter sdk.QueryRouter, } } -// RegisterQueryServices registers all module query services -func (m *Manager) RegisterQueryServices(grpcRouter grpc.Server) { +// RegisterServices registers all module services +func (m *Manager) RegisterServices(cfg Configurator) { for _, module := range m.Modules { - module.RegisterQueryService(grpcRouter) + module.RegisterServices(cfg) } } diff --git a/types/module/module_test.go b/types/module/module_test.go index 6dc3665043..67eac16955 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -162,10 +162,10 @@ func TestManager_RegisterRoutes(t *testing.T) { mockAppModule1.EXPECT().QuerierRoute().Times(2).Return("querierRoute1") mockAppModule2.EXPECT().QuerierRoute().Times(1).Return("") handler3 := sdk.Querier(nil) - mockAppModule1.EXPECT().NewQuerierHandler().Times(1).Return(handler3) + amino := codec.NewLegacyAmino() + mockAppModule1.EXPECT().LegacyQuerierHandler(amino).Times(1).Return(handler3) queryRouter.EXPECT().AddRoute(gomock.Eq("querierRoute1"), gomock.Eq(handler3)).Times(1) - amino := codec.NewLegacyAmino() mm.RegisterRoutes(router, queryRouter, amino) } @@ -182,10 +182,11 @@ func TestManager_RegisterQueryServices(t *testing.T) { require.Equal(t, 2, len(mm.Modules)) queryRouter := mocks.NewMockServer(mockCtrl) - mockAppModule1.EXPECT().RegisterQueryService(queryRouter).Times(1) - mockAppModule2.EXPECT().RegisterQueryService(queryRouter).Times(1) + cfg := module.NewConfigurator(queryRouter) + mockAppModule1.EXPECT().RegisterServices(cfg).Times(1) + mockAppModule2.EXPECT().RegisterServices(cfg).Times(1) - mm.RegisterQueryServices(queryRouter) + mm.RegisterServices(cfg) } func TestManager_InitGenesis(t *testing.T) { diff --git a/x/auth/module.go b/x/auth/module.go index 80a738551b..21e43bef26 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -128,8 +127,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.accountKeeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.accountKeeper) } // InitGenesis performs genesis initialization for the auth module. It returns diff --git a/x/auth/vesting/module.go b/x/auth/vesting/module.go index 026b9858bb..b4997d60e4 100644 --- a/x/auth/vesting/module.go +++ b/x/auth/vesting/module.go @@ -3,7 +3,6 @@ package vesting import ( "encoding/json" - "github.com/gogo/protobuf/grpc" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -102,7 +101,7 @@ func (am AppModule) Route() sdk.Route { func (AppModule) QuerierRoute() string { return "" } // RegisterQueryService performs a no-op. -func (am AppModule) RegisterQueryService(_ grpc.Server) {} +func (am AppModule) RegisterServices(_ module.Configurator) {} // LegacyQuerierHandler performs a no-op. func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { diff --git a/x/bank/module.go b/x/bank/module.go index 6bbf0e7dc3..1b3d68f460 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -97,8 +96,8 @@ type AppModule struct { // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // NewAppModule creates a new AppModule object diff --git a/x/capability/module.go b/x/capability/module.go index 1f5e17df32..cc1d6272eb 100644 --- a/x/capability/module.go +++ b/x/capability/module.go @@ -5,7 +5,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -114,7 +113,7 @@ func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { retur // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(grpc.Server) {} +func (am AppModule) RegisterServices(module.Configurator) {} // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} diff --git a/x/crisis/module.go b/x/crisis/module.go index cc0beac063..fdc2ffb03d 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" - "github.com/gogo/protobuf/grpc" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -115,7 +114,7 @@ func (AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return n // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(grpc.Server) {} +func (am AppModule) RegisterServices(module.Configurator) {} // InitGenesis performs genesis initialization for the crisis module. It returns // no validator updates. diff --git a/x/distribution/module.go b/x/distribution/module.go index efd6bcc739..9c53d56191 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -142,8 +141,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // InitGenesis performs genesis initialization for the distribution module. It returns diff --git a/x/evidence/module.go b/x/evidence/module.go index 078cd6e2c9..1ac32c2148 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -151,8 +150,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // RegisterInvariants registers the evidence module's invariants. diff --git a/x/gov/module.go b/x/gov/module.go index 033bae0a3f..31c0e5c05d 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -8,7 +8,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -158,8 +157,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // InitGenesis performs genesis initialization for the gov module. It returns diff --git a/x/ibc/applications/transfer/module.go b/x/ibc/applications/transfer/module.go index 9e8830c1c7..4d73f693cd 100644 --- a/x/ibc/applications/transfer/module.go +++ b/x/ibc/applications/transfer/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -123,8 +122,8 @@ func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // InitGenesis performs genesis initialization for the ibc-transfer module. It returns diff --git a/x/ibc/core/module.go b/x/ibc/core/module.go index 3f82bfcd9d..35a734ccf9 100644 --- a/x/ibc/core/module.go +++ b/x/ibc/core/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -132,8 +131,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd } // RegisterQueryService registers the gRPC query service for the ibc module. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryService(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryService(cfg.QueryServer(), am.keeper) } // InitGenesis performs genesis initialization for the ibc module. It returns diff --git a/x/ibc/testing/mock/mock.go b/x/ibc/testing/mock/mock.go index 2761377361..89ed2a4dd4 100644 --- a/x/ibc/testing/mock/mock.go +++ b/x/ibc/testing/mock/mock.go @@ -3,7 +3,8 @@ package mock import ( "encoding/json" - "github.com/gogo/protobuf/grpc" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -102,7 +103,7 @@ func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { } // RegisterQueryService implements the AppModule interface. -func (am AppModule) RegisterQueryService(server grpc.Server) {} +func (am AppModule) RegisterServices(module.Configurator) {} // InitGenesis implements the AppModule interface. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate { diff --git a/x/mint/module.go b/x/mint/module.go index b483696b92..0a29598add 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -126,8 +125,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a gRPC query service to respond to the // module-specific gRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // InitGenesis performs genesis initialization for the mint module. It returns diff --git a/x/params/module.go b/x/params/module.go index 0c94793831..b95f76947d 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -5,7 +5,6 @@ import ( "encoding/json" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -112,8 +111,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a gRPC query service to respond to the // module-specific gRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - proposal.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + proposal.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // ProposalContents returns all the params content functions used to diff --git a/x/slashing/module.go b/x/slashing/module.go index 21fa5e3360..f74c4a84df 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -140,8 +139,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // InitGenesis performs genesis initialization for the slashing module. It returns diff --git a/x/staking/module.go b/x/staking/module.go index f91d0eee76..6a344265b7 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" - "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/gorilla/mux" @@ -136,9 +135,9 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { +func (am AppModule) RegisterServices(cfg module.Configurator) { querier := keeper.Querier{Keeper: am.keeper} - types.RegisterQueryServer(server, querier) + types.RegisterQueryServer(cfg.QueryServer(), querier) } // InitGenesis performs genesis initialization for the staking module. It returns diff --git a/x/upgrade/module.go b/x/upgrade/module.go index bc44a49742..df5e23a2f4 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" - "github.com/gogo/protobuf/grpc" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -97,8 +96,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterQueryService(server grpc.Server) { - types.RegisterQueryServer(server, am.keeper) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // InitGenesis is ignored, no sense in serializing future upgrades From 45f5df7ea5fe8f19d52685cf2f4a1c3e2a89a43e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Tue, 13 Oct 2020 10:36:23 +0200 Subject: [PATCH 15/84] update solo machine specs (#7512) * update solo machine specs * update concepts * self review fixes * Apply suggestions from code review * add note on upgarding solo machines Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> --- x/ibc/core/spec/README.md | 4 +- .../06-solomachine/spec/01_concepts.md | 105 ++++++++++++++++-- .../06-solomachine/spec/02_state.md | 12 ++ .../spec/03_state_transitions.md | 42 +++++++ .../06-solomachine/spec/04_messages.md | 8 ++ .../06-solomachine/spec/README.md | 12 +- .../06-solomachine/types/update.go | 2 +- 7 files changed, 171 insertions(+), 14 deletions(-) create mode 100644 x/ibc/light-clients/06-solomachine/spec/02_state.md create mode 100644 x/ibc/light-clients/06-solomachine/spec/03_state_transitions.md create mode 100644 x/ibc/light-clients/06-solomachine/spec/04_messages.md diff --git a/x/ibc/core/spec/README.md b/x/ibc/core/spec/README.md index f08cc44c4e..432aca93e1 100644 --- a/x/ibc/core/spec/README.md +++ b/x/ibc/core/spec/README.md @@ -28,8 +28,8 @@ For the general specification please refer to the [Interchain Standards](https:/ As stated above, the IBC implementation on the Cosmos SDK introduces some changes to the general specification, in order to avoid code duplication and to take -advantage of the SDK architectural components such as the `AnteHandler` and -transaction routing through `Handlers`. +advantage of the SDK architectural components such as the transaction routing +through `Handlers`. ### Interchain Standards reference diff --git a/x/ibc/light-clients/06-solomachine/spec/01_concepts.md b/x/ibc/light-clients/06-solomachine/spec/01_concepts.md index ae816baaeb..1723c8740e 100644 --- a/x/ibc/light-clients/06-solomachine/spec/01_concepts.md +++ b/x/ibc/light-clients/06-solomachine/spec/01_concepts.md @@ -4,13 +4,46 @@ order: 1 # Concepts +## Client State + +The `ClientState` for a solo machine light client stores the latest sequence, the frozen sequence, +the latest consensus state, and client flag indicating if the client should be allowed to be updated +after a governance proposal. + +If the client is not frozen then the frozen sequence is 0. + +## Consensus State + +The consensus states stores the public key, diversifier, and timestamp of the solo machine light client. + +The diversifier is used to prevent accidental misbehaviour if the same public key is used across +different chains with the same client identifier. It should be unique to the chain the light client +is used on. + +## Public Key + +The public key can be a single public key or a multi-signature public key. The public key type used +must fulfill the tendermint public key interface (this will become the SDK public key interface in the +near future). The public key must be registered on the application codec otherwise encoding/decoding +errors will arise. The public key stored in the consensus state is represented as a protobuf `Any`. +This allows for flexibility in what other public key types can be supported in the future. + +## Counterparty Verification + +The solo machine light client can verify counterparty client state, consensus state, connection state, +channel state, packet commitments, packet acknowledgements, packet receipt absence, +and the next sequence receive. At the end of each successful verification call the light +client sequence number will be incremented. + +Successful verification requires the current public key to sign over the proof. + ## Proofs A solo machine proof should verify that the solomachine public key signed over some specified data. The format for generating marshaled proofs for the SDK's implementation of solo machine is as follows: -Construct the data using the associated protobuf definition and marshal it. +1. Construct the data using the associated protobuf definition and marshal it. For example: @@ -23,7 +56,10 @@ data := &ClientStateData{ dataBz, err := cdc.MarshalBinaryBare(data) ``` -Construct the `SignBytes` and marshal it. +The helper functions `...DataBytes()` in [proofs.go](../types/proofs.go) handle this +functionality. + +2. Construct the `SignBytes` and marshal it. For example: @@ -39,12 +75,12 @@ signBytes := &SignBytes{ signBz, err := cdc.MarshalBinaryBare(signBytes) ``` -The helper functions in [proofs.go](../types/proofs.go) handle the above actions. -The `DataType` field is used to disambiguate what type of data was signed because -of potential proto encoding overlap. +The helper functions `...SignBytes()` in [proofs.go](../types/proofs.go) handle this functionality. +The `DataType` field is used to disambiguate what type of data was signed to prevent potential +proto encoding overlap. -Sign the sign bytes. Embed the signatures into either `SingleSignatureData` or -`MultiSignatureData`. Convert the `SignatureData` to proto and marshal it +3. Sign the sign bytes. Embed the signatures into either `SingleSignatureData` or `MultiSignatureData`. +Convert the `SignatureData` to proto and marshal it. For example: @@ -58,8 +94,8 @@ protoSigData := signing.SignatureDataToProto(sigData) bz, err := cdc.MarshalBinaryBare(protoSigData) ``` -Construct a `TimestampedSignatureData` and marshal it. The marshaled result can be -passed in as the proof parameter to the verification functions. +4. Construct a `TimestampedSignatureData` and marshal it. The marshaled result can be passed in +as the proof parameter to the verification functions. For example: @@ -71,3 +107,54 @@ timestampedSignatureData := &types.TimestampedSignatureData{ proof, err := cdc.MarshalBinaryBare(timestampedSignatureData) ``` + +## Updates By Header + +An update by a header will only succeed if: + +- the header provided is parseable to solo machine header +- the header sequence matches the current sequence +- the header timestamp is greater than or equal to the consensus state timestamp +- the currently registered public key generated the proof + +If the update is successful: + +- the public key is updated +- the diversifier is updated +- the timestamp is updated +- the sequence is incremented by 1 +- the new consensus state is set in the client state + +## Updates By Proposal + +An update by a governance proposal will only succeed if: + +- the header provided is parseable to solo machine header +- the `AllowUpdateAfterProposal` client parameter is set to `true` +- the new header public key does not equal the consensus state public key + +If the update is successful: + +- the public key is updated +- the diversifier is updated +- the timestamp is updated +- the sequence is updated +- the new consensus state is set in the client state +- the client is unfrozen (if it was previously frozen) + +## Misbehaviour + +Misbehaviour handling will only succeed if: + +- the misbehaviour provided is parseable to solo machine misbehaviour +- the client is not already frozen +- the current public key signed over two unique data messages at the same sequence and diversifier. + +If the misbehaviour is successfully processed: + +- the client is frozen by setting the frozen sequence to the misbehaviour sequence + +## Upgrades + +Upgrades to solo machine light clients are not supported since an entirely different type of +public key can be set using normal client updates. diff --git a/x/ibc/light-clients/06-solomachine/spec/02_state.md b/x/ibc/light-clients/06-solomachine/spec/02_state.md new file mode 100644 index 0000000000..a9ff4ea5b4 --- /dev/null +++ b/x/ibc/light-clients/06-solomachine/spec/02_state.md @@ -0,0 +1,12 @@ + + +# State + +The solo machine light client will only store consensus states for each update by a header +or a governance proposal. The latest client state is also maintained in the store. + +These values can be found under the light client paths defined in the IBC +[core store specs](../../../core/spec/02_state.md). + diff --git a/x/ibc/light-clients/06-solomachine/spec/03_state_transitions.md b/x/ibc/light-clients/06-solomachine/spec/03_state_transitions.md new file mode 100644 index 0000000000..3ca4b7017a --- /dev/null +++ b/x/ibc/light-clients/06-solomachine/spec/03_state_transitions.md @@ -0,0 +1,42 @@ + + +# State Transitions + +## Client State Verification Functions + +Successful state verification by a solo machine light client will result in: + +- the sequence being incremented by 1. + +## Update By Header + +A successful update of a solo machine light client by a header will result in: + +- the public key being updated to the new public key provided by the header. +- the diversifier being updated to the new diviersifier provided by the header. +- the timestamp being updated to the new timestamp provided by the header. +- the sequence being incremented by 1 +- the consensus state being updated (consensus state stores the public key, diversifier, and timestamp) + +## Update By Governance Proposal + +A successful update of a solo machine light client by a governance proposal will result in: + +- the public key being updated to the new public key provided by the header. +- the diversifier being updated to the new diviersifier provided by the header. +- the timestamp being updated to the new timestamp provided by the header. +- the sequence being set to the new sequence provided by the header. +- the consensus state being updated (consensus state stores the public key, diversifier, and timestamp) +- the frozen sequence being set to zero (client is unfrozen if it was previously frozen). + +## Upgrade + +Client udgrades are not supported for the solo machine light client. No state transition occurs. + +## Misbehaviour + +Successful misbehaviour processing of a solo machine light client will result in: + +- the frozen sequence being set to the sequence the misbehaviour occurred at diff --git a/x/ibc/light-clients/06-solomachine/spec/04_messages.md b/x/ibc/light-clients/06-solomachine/spec/04_messages.md new file mode 100644 index 0000000000..465ea6229a --- /dev/null +++ b/x/ibc/light-clients/06-solomachine/spec/04_messages.md @@ -0,0 +1,8 @@ + + +# Messages + +The messages used to initialize a solo machine light client are defined in the +core sub-module [02-client](../../../core/spec/04_messages.md). diff --git a/x/ibc/light-clients/06-solomachine/spec/README.md b/x/ibc/light-clients/06-solomachine/spec/README.md index 85dd17a304..77db1bfeee 100644 --- a/x/ibc/light-clients/06-solomachine/spec/README.md +++ b/x/ibc/light-clients/06-solomachine/spec/README.md @@ -9,10 +9,18 @@ parent: ## Abstract -This paper defines the implementation of the ICS06 protocol on the Cosmos SDK. +This paper defines the implementation of the ICS06 protocol on the Cosmos SDK. For the general +specification please refer to the [ICS06 Specification](https://github.com/cosmos/ics/tree/master/spec/ics-006-solo-machine-client). -For the general specification please refer to the [ICS06 Specification](https://github.com/cosmos/ics/tree/master/spec/ics-006-solo-machine-client). +This implementation of a solo machine light client supports single and multi-signature public +keys. The client is capable of handling public key updates by header and governance proposals. +The light client is capable of processing client misbehaviour. Proofs of the counterparty state +are generated by the solo machine client by signing over the desired state with a certain sequence, +diversifier, and timestamp. ## Contents 1. **[Concepts](01_concepts.md)** +2. **[State](02_state.md)** +3. **[State Transitions](03_state_transitions.md)** +4. **[Messages](04_messages.md)** diff --git a/x/ibc/light-clients/06-solomachine/types/update.go b/x/ibc/light-clients/06-solomachine/types/update.go index a7c288cfc8..4deb8833d5 100644 --- a/x/ibc/light-clients/06-solomachine/types/update.go +++ b/x/ibc/light-clients/06-solomachine/types/update.go @@ -10,7 +10,7 @@ import ( // CheckHeaderAndUpdateState checks if the provided header is valid and updates // the consensus state if appropriate. It returns an error if: -// - the client or header provided are not parseable to solo machine types +// - the header provided is not parseable to a solo machine header // - the header sequence does not match the current sequence // - the header timestamp is less than the consensus state timestamp // - the currently registered public key did not provide the update signature From 9be15a42b960bb63ddd8156ed6bcd0f07159074c Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 05:05:46 -0400 Subject: [PATCH 16/84] Refactor x/bank according to ADR 031 (#7520) * Refactor x/bank according to ADR 031 * Add comment * Update comment * Add comment * Add tests, address edge cases * Imports Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- buf.yaml | 1 + proto/cosmos/bank/v1beta1/tx.proto | 15 + types/result.go | 30 ++ types/result_test.go | 35 +++ x/bank/handler.go | 89 +----- x/bank/keeper/msg_server.go | 104 +++++++ x/bank/types/tx.pb.go | 421 +++++++++++++++++++++++++++-- 7 files changed, 586 insertions(+), 109 deletions(-) create mode 100644 x/bank/keeper/msg_server.go diff --git a/buf.yaml b/buf.yaml index adaef5ff18..33388763d7 100644 --- a/buf.yaml +++ b/buf.yaml @@ -14,6 +14,7 @@ lint: - COMMENT_FIELD - SERVICE_SUFFIX - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME ignore: - tendermint - gogoproto diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto index 449deba115..0216ad665e 100644 --- a/proto/cosmos/bank/v1beta1/tx.proto +++ b/proto/cosmos/bank/v1beta1/tx.proto @@ -7,6 +7,15 @@ import "cosmos/bank/v1beta1/bank.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; +// Msg defines the bank Msg service. +service Msg { + // 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); +} + // MsgSend represents a message to send coins from one account to another. message MsgSend { option (gogoproto.equal) = false; @@ -18,6 +27,9 @@ message MsgSend { [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } +// MsgSendResponse defines the Msg/Send response type. +message MsgSendResponse { } + // MsgMultiSend represents an arbitrary multi-in, multi-out send message. message MsgMultiSend { option (gogoproto.equal) = false; @@ -25,3 +37,6 @@ message MsgMultiSend { repeated Input inputs = 1 [(gogoproto.nullable) = false]; repeated Output outputs = 2 [(gogoproto.nullable) = false]; } + +// MsgMultiSendResponse defines the Msg/MultiSend response type. +message MsgMultiSendResponse { } diff --git a/types/result.go b/types/result.go index 02467e0a30..6a50ecffba 100644 --- a/types/result.go +++ b/types/result.go @@ -7,8 +7,11 @@ import ( "math" "strings" + "github.com/gogo/protobuf/proto" + yaml "gopkg.in/yaml.v2" + abci "github.com/tendermint/tendermint/abci/types" ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/cosmos/cosmos-sdk/codec" @@ -263,3 +266,30 @@ func (r TxResponse) GetTx() Tx { } return nil } + +// WrapServiceResult wraps a result from a protobuf RPC service method call in +// a Result object or error. This method takes care of marshaling the res param to +// protobuf and attaching any events on the ctx.EventManager() to the Result. +func WrapServiceResult(ctx Context, res proto.Message, err error) (*Result, error) { + if err != nil { + return nil, err + } + + var data []byte + if res != nil { + data, err = proto.Marshal(res) + if err != nil { + return nil, err + } + } + + var events []abci.Event + if evtMgr := ctx.EventManager(); evtMgr != nil { + events = evtMgr.ABCIEvents() + } + + return &Result{ + Data: data, + Events: events, + }, nil +} diff --git a/types/result_test.go b/types/result_test.go index 44d6602375..6ca9731f8c 100644 --- a/types/result_test.go +++ b/types/result_test.go @@ -2,9 +2,13 @@ package types_test import ( "encoding/hex" + "fmt" "strings" "testing" + "github.com/golang/protobuf/proto" + + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" abci "github.com/tendermint/tendermint/abci/types" @@ -12,6 +16,7 @@ import ( ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -180,3 +185,33 @@ func (s *resultTestSuite) TestResponseFormatBroadcastTxCommit() { s.Require().Equal(want, sdk.NewResponseFormatBroadcastTxCommit(checkTxResult)) s.Require().Equal(want, sdk.NewResponseFormatBroadcastTxCommit(deliverTxResult)) } + +func TestWrapServiceResult(t *testing.T) { + ctx := sdk.Context{} + + res, err := sdk.WrapServiceResult(ctx, nil, fmt.Errorf("test")) + require.Nil(t, res) + require.NotNil(t, err) + + res, err = sdk.WrapServiceResult(ctx, nil, nil) + require.NotNil(t, res) + require.Nil(t, err) + require.Empty(t, res.Events) + + ctx = ctx.WithEventManager(sdk.NewEventManager()) + ctx.EventManager().EmitEvent(sdk.NewEvent("test")) + res, err = sdk.WrapServiceResult(ctx, nil, nil) + require.NotNil(t, res) + require.Nil(t, err) + require.Len(t, res.Events, 1) + + spot := testdata.Dog{Name: "spot"} + res, err = sdk.WrapServiceResult(ctx, &spot, nil) + require.NotNil(t, res) + require.Nil(t, err) + require.Len(t, res.Events, 1) + var spot2 testdata.Dog + err = proto.Unmarshal(res.Data, &spot2) + require.NoError(t, err) + require.Equal(t, spot, spot2) +} diff --git a/x/bank/handler.go b/x/bank/handler.go index f2f710fa2f..d7c04897a5 100644 --- a/x/bank/handler.go +++ b/x/bank/handler.go @@ -1,9 +1,6 @@ package bank import ( - metrics "github.com/armon/go-metrics" - - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/bank/keeper" @@ -15,93 +12,19 @@ func NewHandler(k keeper.Keeper) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) + msgServer := keeper.NewMsgServerImpl(k) + switch msg := msg.(type) { case *types.MsgSend: - return handleMsgSend(ctx, k, msg) + res, err := msgServer.Send(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgMultiSend: - return handleMsgMultiSend(ctx, k, msg) + res, err := msgServer.MultiSend(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized bank message type: %T", msg) } } } - -// Handle MsgSend. -func handleMsgSend(ctx sdk.Context, k keeper.Keeper, msg *types.MsgSend) (*sdk.Result, error) { - if err := k.SendEnabledCoins(ctx, msg.Amount...); err != nil { - return nil, err - } - - from, err := sdk.AccAddressFromBech32(msg.FromAddress) - if err != nil { - return nil, err - } - to, err := sdk.AccAddressFromBech32(msg.ToAddress) - if err != nil { - return nil, err - } - - if k.BlockedAddr(to) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) - } - - err = k.SendCoins(ctx, from, to, msg.Amount) - if err != nil { - return nil, err - } - - defer func() { - for _, a := range msg.Amount { - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", "send"}, - float32(a.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, - ) - } - }() - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -// Handle MsgMultiSend. -func handleMsgMultiSend(ctx sdk.Context, k keeper.Keeper, msg *types.MsgMultiSend) (*sdk.Result, error) { - // NOTE: totalIn == totalOut should already have been checked - for _, in := range msg.Inputs { - if err := k.SendEnabledCoins(ctx, in.Coins...); err != nil { - return nil, err - } - } - - for _, out := range msg.Outputs { - accAddr, err := sdk.AccAddressFromBech32(out.Address) - if err != nil { - panic(err) - } - if k.BlockedAddr(accAddr) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive transactions", out.Address) - } - } - - err := k.InputOutputCoins(ctx, msg.Inputs, msg.Outputs) - if err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} diff --git a/x/bank/keeper/msg_server.go b/x/bank/keeper/msg_server.go new file mode 100644 index 0000000000..024d857dab --- /dev/null +++ b/x/bank/keeper/msg_server.go @@ -0,0 +1,104 @@ +package keeper + +import ( + "context" + + "github.com/armon/go-metrics" + + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the bank MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +func (k msgServer) Send(goCtx context.Context, msg *types.MsgSend) (*types.MsgSendResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if err := k.SendEnabledCoins(ctx, msg.Amount...); err != nil { + return nil, err + } + + from, err := sdk.AccAddressFromBech32(msg.FromAddress) + if err != nil { + return nil, err + } + to, err := sdk.AccAddressFromBech32(msg.ToAddress) + if err != nil { + return nil, err + } + + if k.BlockedAddr(to) { + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) + } + + err = k.SendCoins(ctx, from, to, msg.Amount) + if err != nil { + return nil, err + } + + defer func() { + for _, a := range msg.Amount { + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", "send"}, + float32(a.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, + ) + } + }() + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + ), + ) + + return &types.MsgSendResponse{}, nil +} + +func (k msgServer) MultiSend(goCtx context.Context, msg *types.MsgMultiSend) (*types.MsgMultiSendResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // NOTE: totalIn == totalOut should already have been checked + for _, in := range msg.Inputs { + if err := k.SendEnabledCoins(ctx, in.Coins...); err != nil { + return nil, err + } + } + + for _, out := range msg.Outputs { + accAddr, err := sdk.AccAddressFromBech32(out.Address) + if err != nil { + panic(err) + } + if k.BlockedAddr(accAddr) { + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive transactions", out.Address) + } + } + + err := k.InputOutputCoins(ctx, msg.Inputs, msg.Outputs) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + ), + ) + + return &types.MsgMultiSendResponse{}, nil +} diff --git a/x/bank/types/tx.pb.go b/x/bank/types/tx.pb.go index e91fe4547b..abc37dcf0a 100644 --- a/x/bank/types/tx.pb.go +++ b/x/bank/types/tx.pb.go @@ -4,11 +4,16 @@ package types import ( + context "context" 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" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -65,6 +70,42 @@ func (m *MsgSend) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSend proto.InternalMessageInfo +type MsgSendResponse struct { +} + +func (m *MsgSendResponse) Reset() { *m = MsgSendResponse{} } +func (m *MsgSendResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSendResponse) ProtoMessage() {} +func (*MsgSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{1} +} +func (m *MsgSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSendResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendResponse.Merge(m, src) +} +func (m *MsgSendResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSendResponse proto.InternalMessageInfo + // MsgMultiSend represents an arbitrary multi-in, multi-out send message. type MsgMultiSend struct { Inputs []Input `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs"` @@ -75,7 +116,7 @@ func (m *MsgMultiSend) Reset() { *m = MsgMultiSend{} } func (m *MsgMultiSend) String() string { return proto.CompactTextString(m) } func (*MsgMultiSend) ProtoMessage() {} func (*MsgMultiSend) Descriptor() ([]byte, []int) { - return fileDescriptor_1d8cb1613481f5b7, []int{1} + return fileDescriptor_1d8cb1613481f5b7, []int{2} } func (m *MsgMultiSend) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -118,39 +159,197 @@ func (m *MsgMultiSend) GetOutputs() []Output { return nil } +type MsgMultiSendResponse struct { +} + +func (m *MsgMultiSendResponse) Reset() { *m = MsgMultiSendResponse{} } +func (m *MsgMultiSendResponse) String() string { return proto.CompactTextString(m) } +func (*MsgMultiSendResponse) ProtoMessage() {} +func (*MsgMultiSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{3} +} +func (m *MsgMultiSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMultiSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMultiSendResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgMultiSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMultiSendResponse.Merge(m, src) +} +func (m *MsgMultiSendResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgMultiSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMultiSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMultiSendResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSend)(nil), "cosmos.bank.v1beta1.MsgSend") + proto.RegisterType((*MsgSendResponse)(nil), "cosmos.bank.v1beta1.MsgSendResponse") proto.RegisterType((*MsgMultiSend)(nil), "cosmos.bank.v1beta1.MsgMultiSend") + proto.RegisterType((*MsgMultiSendResponse)(nil), "cosmos.bank.v1beta1.MsgMultiSendResponse") } func init() { proto.RegisterFile("cosmos/bank/v1beta1/tx.proto", fileDescriptor_1d8cb1613481f5b7) } var fileDescriptor_1d8cb1613481f5b7 = []byte{ - // 374 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x4a, 0xcc, 0xcb, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, - 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0x81, 0x64, 0xf5, - 0xa0, 0xb2, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x79, 0x7d, 0x10, 0x0b, 0xa2, 0x54, 0x4a, - 0x0e, 0x6e, 0x50, 0x71, 0x2a, 0xdc, 0xa0, 0xe4, 0xfc, 0xcc, 0x3c, 0x0c, 0x79, 0x24, 0x8b, 0xc0, - 0xe6, 0x82, 0xe5, 0x95, 0x5e, 0x31, 0x72, 0xb1, 0xfb, 0x16, 0xa7, 0x07, 0xa7, 0xe6, 0xa5, 0x08, - 0x59, 0x71, 0xf1, 0xa4, 0x15, 0xe5, 0xe7, 0xc6, 0x27, 0xa6, 0xa4, 0x14, 0xa5, 0x16, 0x17, 0x4b, - 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x3a, 0x89, 0x7f, 0xba, 0x27, 0x2f, 0x5c, 0x99, 0x98, 0x9b, 0x63, - 0xa5, 0x84, 0x2c, 0xab, 0x14, 0xc4, 0x0d, 0xe2, 0x3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c, - 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, - 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x9a, 0x78, 0xfd, 0x58, 0x01, 0x89, - 0x4c, 0xb0, 0x57, 0x93, 0xd8, 0xc0, 0xd1, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xc3, 0x84, - 0x52, 0xaa, 0x51, 0x02, 0x00, 0x00, + // 436 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x3f, 0xef, 0xd2, 0x40, + 0x1c, 0xc6, 0x7b, 0x3f, 0x08, 0x3f, 0x39, 0x48, 0x0c, 0x05, 0x15, 0x2b, 0x69, 0xb1, 0x71, 0x80, + 0xc1, 0xab, 0xa0, 0x83, 0xa9, 0x93, 0x65, 0xd2, 0xa4, 0x31, 0xa9, 0x93, 0x2e, 0xa6, 0x7f, 0xce, + 0xda, 0x40, 0x7b, 0x0d, 0x77, 0x35, 0xf0, 0x0e, 0x4c, 0x5c, 0x7c, 0x09, 0xcc, 0xc6, 0x17, 0xc2, + 0xc8, 0xe8, 0x84, 0x06, 0x16, 0xe3, 0xc8, 0x2b, 0x30, 0xbd, 0xfe, 0x81, 0x44, 0xc4, 0xa9, 0xbd, + 0x3c, 0xdf, 0xcf, 0xd3, 0xe7, 0xe9, 0xf7, 0x60, 0xcf, 0x25, 0x34, 0x24, 0x54, 0x73, 0xec, 0x68, + 0xaa, 0x7d, 0x1c, 0x39, 0x98, 0xd9, 0x23, 0x8d, 0x2d, 0x50, 0x3c, 0x27, 0x8c, 0x88, 0xed, 0x4c, + 0x45, 0xa9, 0x8a, 0x72, 0x55, 0xea, 0xf8, 0xc4, 0x27, 0x5c, 0xd7, 0xd2, 0xb7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, 0x9d, 0x59, 0x06, 0x7a, 0x91, 0x8e, 0x18, 0xd5, 0x34, 0x93, 0x95, 0xcf, + 0x8b, 0xcf, 0xe0, 0x35, 0x49, 0x18, 0x47, 0xaf, 0x38, 0x7a, 0xef, 0x2c, 0xfa, 0x8a, 0xcf, 0xe4, + 0x6c, 0x41, 0xe8, 0x55, 0x1e, 0xf0, 0x36, 0xec, 0x9c, 0x86, 0x29, 0x52, 0x8e, 0xbf, 0x01, 0x58, + 0x31, 0xa9, 0x2f, 0xbe, 0x84, 0x55, 0x1e, 0xb2, 0x77, 0xd6, 0x39, 0xef, 0x26, 0x3d, 0xb8, 0xa4, + 0x16, 0x9e, 0xe2, 0x1b, 0x58, 0x3f, 0xb6, 0xbe, 0xff, 0x2f, 0xa4, 0x1c, 0x91, 0x86, 0xff, 0x1d, + 0x29, 0xac, 0x8d, 0xc9, 0x7a, 0x27, 0x83, 0xcd, 0x4e, 0x06, 0x3f, 0x77, 0x32, 0xf8, 0xb2, 0x97, + 0x85, 0xcd, 0x5e, 0x16, 0xbe, 0xef, 0x65, 0xe1, 0xed, 0xf0, 0xe2, 0xf6, 0x16, 0xd9, 0x35, 0xe5, + 0x4b, 0x74, 0x6a, 0xfc, 0x82, 0x3e, 0xfe, 0x13, 0x00, 0x00, 0xff, 0xff, 0x78, 0xdc, 0x7c, 0x0b, + 0x2b, 0x03, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) + MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) { + out := new(MsgSendResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/Send", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) { + out := new(MsgMultiSendResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/MultiSend", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + Send(context.Context, *MsgSend) (*MsgSendResponse, error) + MultiSend(context.Context, *MsgMultiSend) (*MsgMultiSendResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) Send(ctx context.Context, req *MsgSend) (*MsgSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") +} +func (*UnimplementedMsgServer) MultiSend(ctx context.Context, req *MsgMultiSend) (*MsgMultiSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MultiSend not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSend) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Send(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Msg/Send", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Send(ctx, req.(*MsgSend)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_MultiSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgMultiSend) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MultiSend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Msg/MultiSend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MultiSend(ctx, req.(*MsgMultiSend)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.bank.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Send", + Handler: _Msg_Send_Handler, + }, + { + MethodName: "MultiSend", + Handler: _Msg_MultiSend_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/bank/v1beta1/tx.proto", } func (m *MsgSend) Marshal() (dAtA []byte, err error) { @@ -204,6 +403,29 @@ func (m *MsgSend) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgSendResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSendResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgMultiSend) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -255,6 +477,29 @@ func (m *MsgMultiSend) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgMultiSendResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgMultiSendResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMultiSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -289,6 +534,15 @@ func (m *MsgSend) Size() (n int) { return n } +func (m *MsgSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgMultiSend) Size() (n int) { if m == nil { return 0 @@ -310,6 +564,15 @@ func (m *MsgMultiSend) Size() (n int) { return n } +func (m *MsgMultiSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -467,6 +730,59 @@ func (m *MsgSend) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSendResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgMultiSend) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -588,6 +904,59 @@ func (m *MsgMultiSend) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgMultiSendResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgMultiSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMultiSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 037a32bc9138fac0d47a1e2f9b4abbb088e9fa8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Tue, 13 Oct 2020 11:57:39 +0200 Subject: [PATCH 17/84] ibc: cleanup channel types test (#7521) --- x/ibc/core/04-channel/types/msgs_test.go | 533 ++++++++++------------- 1 file changed, 226 insertions(+), 307 deletions(-) diff --git a/x/ibc/core/04-channel/types/msgs_test.go b/x/ibc/core/04-channel/types/msgs_test.go index be7c71353c..3edebb031b 100644 --- a/x/ibc/core/04-channel/types/msgs_test.go +++ b/x/ibc/core/04-channel/types/msgs_test.go @@ -20,8 +20,16 @@ import ( "github.com/cosmos/cosmos-sdk/x/ibc/core/exported" ) -// define constants used for testing const ( + // valid constatns used for testing + portid = "testportid" + chanid = "testchannel" + cpportid = "testcpport" + cpchanid = "testcpchannel" + + version = "1.0" + + // invalid constants used for testing invalidPort = "(invalidport1)" invalidShortPort = "p" invalidLongPort = "invalidlongportinvalidlongportinvalidlongportidinvalidlongportidinvalid" @@ -51,20 +59,13 @@ var ( invalidProofs1 = exported.Proof(nil) invalidProofs2 = emptyProof - addr1 = sdk.AccAddress("testaddr111111111111") + addr = sdk.AccAddress("testaddr111111111111") emptyAddr sdk.AccAddress - portid = "testportid" - chanid = "testchannel" - cpportid = "testcpport" - cpchanid = "testcpchannel" - connHops = []string{"testconnection"} invalidConnHops = []string{"testconnection", "testconnection"} invalidShortConnHops = []string{invalidShortConnection} invalidLongConnHops = []string{invalidLongConnection} - - addr = sdk.AccAddress("testaddr") ) type TypesTestSuite struct { @@ -103,375 +104,297 @@ func TestTypesTestSuite(t *testing.T) { suite.Run(t, new(TypesTestSuite)) } -// TestMsgChannelOpenInit tests ValidateBasic for MsgChannelOpenInit -func (suite *TypesTestSuite) TestMsgChannelOpenInit() { - testMsgs := []*types.MsgChannelOpenInit{ - types.NewMsgChannelOpenInit("testportid", "testchannel", "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", addr), // valid msg - types.NewMsgChannelOpenInit(invalidShortPort, "testchannel", "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", addr), // too short port id - types.NewMsgChannelOpenInit(invalidLongPort, "testchannel", "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", addr), // too long port id - types.NewMsgChannelOpenInit(invalidPort, "testchannel", "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", addr), // port id contains non-alpha - types.NewMsgChannelOpenInit("testportid", invalidShortChannel, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", addr), // too short channel id - types.NewMsgChannelOpenInit("testportid", invalidLongChannel, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", addr), // too long channel id - types.NewMsgChannelOpenInit("testportid", invalidChannel, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", addr), // channel id contains non-alpha - types.NewMsgChannelOpenInit("testportid", "testchannel", "1.0", types.Order(3), connHops, "testcpport", "testcpchannel", addr), // invalid channel order - types.NewMsgChannelOpenInit("testportid", "testchannel", "1.0", types.ORDERED, invalidConnHops, "testcpport", "testcpchannel", addr), // connection hops more than 1 - types.NewMsgChannelOpenInit("testportid", "testchannel", "1.0", types.UNORDERED, invalidShortConnHops, "testcpport", "testcpchannel", addr), // too short connection id - types.NewMsgChannelOpenInit("testportid", "testchannel", "1.0", types.UNORDERED, invalidLongConnHops, "testcpport", "testcpchannel", addr), // too long connection id - types.NewMsgChannelOpenInit("testportid", "testchannel", "1.0", types.UNORDERED, []string{invalidConnection}, "testcpport", "testcpchannel", addr), // connection id contains non-alpha - types.NewMsgChannelOpenInit("testportid", "testchannel", "", types.UNORDERED, connHops, "testcpport", "testcpchannel", addr), // empty channel version - types.NewMsgChannelOpenInit("testportid", "testchannel", "1.0", types.UNORDERED, connHops, invalidPort, "testcpchannel", addr), // invalid counterparty port id - types.NewMsgChannelOpenInit("testportid", "testchannel", "1.0", types.UNORDERED, connHops, "testcpport", invalidChannel, addr), // invalid counterparty channel id - } - +func (suite *TypesTestSuite) TestMsgChannelOpenInitValidateBasic() { testCases := []struct { + name string msg *types.MsgChannelOpenInit expPass bool - errMsg string }{ - {testMsgs[0], true, ""}, - {testMsgs[1], false, "too short port id"}, - {testMsgs[2], false, "too long port id"}, - {testMsgs[3], false, "port id contains non-alpha"}, - {testMsgs[4], false, "too short channel id"}, - {testMsgs[5], false, "too long channel id"}, - {testMsgs[6], false, "channel id contains non-alpha"}, - {testMsgs[7], false, "invalid channel order"}, - {testMsgs[8], false, "connection hops more than 1 "}, - {testMsgs[9], false, "too short connection id"}, - {testMsgs[10], false, "too long connection id"}, - {testMsgs[11], false, "connection id contains non-alpha"}, - {testMsgs[12], true, ""}, - {testMsgs[13], false, "invalid counterparty port id"}, - {testMsgs[14], false, "invalid counterparty channel id"}, + {"", types.NewMsgChannelOpenInit(portid, chanid, version, types.ORDERED, connHops, cpportid, cpchanid, addr), true}, + {"too short port id", types.NewMsgChannelOpenInit(invalidShortPort, chanid, version, types.ORDERED, connHops, cpportid, cpchanid, addr), false}, + {"too long port id", types.NewMsgChannelOpenInit(invalidLongPort, chanid, version, types.ORDERED, connHops, cpportid, cpchanid, addr), false}, + {"port id contains non-alpha", types.NewMsgChannelOpenInit(invalidPort, chanid, version, types.ORDERED, connHops, cpportid, cpchanid, addr), false}, + {"too short channel id", types.NewMsgChannelOpenInit(portid, invalidShortChannel, version, types.ORDERED, connHops, cpportid, cpchanid, addr), false}, + {"too long channel id", types.NewMsgChannelOpenInit(portid, invalidLongChannel, version, types.ORDERED, connHops, cpportid, cpchanid, addr), false}, + {"channel id contains non-alpha", types.NewMsgChannelOpenInit(portid, invalidChannel, version, types.ORDERED, connHops, cpportid, cpchanid, addr), false}, + {"invalid channel order", types.NewMsgChannelOpenInit(portid, chanid, version, types.Order(3), connHops, cpportid, cpchanid, addr), false}, + {"connection hops more than 1 ", types.NewMsgChannelOpenInit(portid, chanid, version, types.ORDERED, invalidConnHops, cpportid, cpchanid, addr), false}, + {"too short connection id", types.NewMsgChannelOpenInit(portid, chanid, version, types.UNORDERED, invalidShortConnHops, cpportid, cpchanid, addr), false}, + {"too long connection id", types.NewMsgChannelOpenInit(portid, chanid, version, types.UNORDERED, invalidLongConnHops, cpportid, cpchanid, addr), false}, + {"connection id contains non-alpha", types.NewMsgChannelOpenInit(portid, chanid, version, types.UNORDERED, []string{invalidConnection}, cpportid, cpchanid, addr), false}, + {"", types.NewMsgChannelOpenInit(portid, chanid, "", types.UNORDERED, connHops, cpportid, cpchanid, addr), true}, + {"invalid counterparty port id", types.NewMsgChannelOpenInit(portid, chanid, version, types.UNORDERED, connHops, invalidPort, cpchanid, addr), false}, + {"invalid counterparty channel id", types.NewMsgChannelOpenInit(portid, chanid, version, types.UNORDERED, connHops, cpportid, invalidChannel, addr), false}, } - for i, tc := range testCases { - err := tc.msg.ValidateBasic() - if tc.expPass { - suite.Require().NoError(err, "Msg %d failed: %s", i, tc.errMsg) - } else { - suite.Require().Error(err, "Invalid Msg %d passed: %s", i, tc.errMsg) - } + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) } } -// TestMsgChannelOpenTry tests ValidateBasic for MsgChannelOpenTry -func (suite *TypesTestSuite) TestMsgChannelOpenTry() { - testMsgs := []*types.MsgChannelOpenTry{ - types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // valid msg - types.NewMsgChannelOpenTry(invalidShortPort, "testchannel", chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too short port id - types.NewMsgChannelOpenTry(invalidLongPort, "testchannel", chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too long port id - types.NewMsgChannelOpenTry(invalidPort, "testchannel", chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // port id contains non-alpha - types.NewMsgChannelOpenTry("testportid", invalidShortChannel, chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too short channel id - types.NewMsgChannelOpenTry("testportid", invalidLongChannel, chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too long channel id - types.NewMsgChannelOpenTry("testportid", invalidChannel, chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // channel id contains non-alpha - types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "", suite.proof, height, addr), // empty counterparty version - types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, clienttypes.ZeroHeight(), addr), // suite.proof height is zero - types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.Order(4), connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // invalid channel order - types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.UNORDERED, invalidConnHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // connection hops more than 1 - types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.UNORDERED, invalidShortConnHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too short connection id - types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.UNORDERED, invalidLongConnHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // too long connection id - types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.UNORDERED, []string{invalidConnection}, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // connection id contains non-alpha - types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "", types.UNORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // empty channel version - types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.UNORDERED, connHops, invalidPort, "testcpchannel", "1.0", suite.proof, height, addr), // invalid counterparty port id - types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.UNORDERED, connHops, "testcpport", invalidChannel, "1.0", suite.proof, height, addr), // invalid counterparty channel id - types.NewMsgChannelOpenTry("testportid", "testchannel", chanid, "1.0", types.UNORDERED, connHops, "testcpport", "testcpchannel", "1.0", emptyProof, height, addr), // empty proof - types.NewMsgChannelOpenTry("testportid", "testchannel", "", "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // valid proved channel id - types.NewMsgChannelOpenTry("testportid", "testchannel", "differentchannel", "1.0", types.ORDERED, connHops, "testcpport", "testcpchannel", "1.0", suite.proof, height, addr), // different channel id - } - +func (suite *TypesTestSuite) TestMsgChannelOpenTryValidateBasic() { testCases := []struct { + name string msg *types.MsgChannelOpenTry expPass bool - errMsg string }{ - {testMsgs[0], true, ""}, - {testMsgs[1], false, "too short port id"}, - {testMsgs[2], false, "too long port id"}, - {testMsgs[3], false, "port id contains non-alpha"}, - {testMsgs[4], false, "too short channel id"}, - {testMsgs[5], false, "too long channel id"}, - {testMsgs[6], false, "channel id contains non-alpha"}, - {testMsgs[7], true, ""}, - {testMsgs[8], false, "proof height is zero"}, - {testMsgs[9], false, "invalid channel order"}, - {testMsgs[10], false, "connection hops more than 1 "}, - {testMsgs[11], false, "too short connection id"}, - {testMsgs[12], false, "too long connection id"}, - {testMsgs[13], false, "connection id contains non-alpha"}, - {testMsgs[14], true, ""}, - {testMsgs[15], false, "invalid counterparty port id"}, - {testMsgs[16], false, "invalid counterparty channel id"}, - {testMsgs[17], false, "empty proof"}, - {testMsgs[18], true, "valid empty proved channel id"}, - {testMsgs[19], false, "invalid proved channel id, doesn't match channel id"}, + {"", types.NewMsgChannelOpenTry(portid, chanid, chanid, version, types.ORDERED, connHops, cpportid, cpchanid, version, suite.proof, height, addr), true}, + {"too short port id", types.NewMsgChannelOpenTry(invalidShortPort, chanid, chanid, version, types.ORDERED, connHops, cpportid, cpchanid, version, suite.proof, height, addr), false}, + {"too long port id", types.NewMsgChannelOpenTry(invalidLongPort, chanid, chanid, version, types.ORDERED, connHops, cpportid, cpchanid, version, suite.proof, height, addr), false}, + {"port id contains non-alpha", types.NewMsgChannelOpenTry(invalidPort, chanid, chanid, version, types.ORDERED, connHops, cpportid, cpchanid, version, suite.proof, height, addr), false}, + {"too short channel id", types.NewMsgChannelOpenTry(portid, invalidShortChannel, chanid, version, types.ORDERED, connHops, cpportid, cpchanid, version, suite.proof, height, addr), false}, + {"too long channel id", types.NewMsgChannelOpenTry(portid, invalidLongChannel, chanid, version, types.ORDERED, connHops, cpportid, cpchanid, version, suite.proof, height, addr), false}, + {"channel id contains non-alpha", types.NewMsgChannelOpenTry(portid, invalidChannel, chanid, version, types.ORDERED, connHops, cpportid, cpchanid, version, suite.proof, height, addr), false}, + {"", types.NewMsgChannelOpenTry(portid, chanid, chanid, version, types.ORDERED, connHops, cpportid, cpchanid, "", suite.proof, height, addr), true}, + {"proof height is zero", types.NewMsgChannelOpenTry(portid, chanid, chanid, version, types.ORDERED, connHops, cpportid, cpchanid, version, suite.proof, clienttypes.ZeroHeight(), addr), false}, + {"invalid channel order", types.NewMsgChannelOpenTry(portid, chanid, chanid, version, types.Order(4), connHops, cpportid, cpchanid, version, suite.proof, height, addr), false}, + {"connection hops more than 1 ", types.NewMsgChannelOpenTry(portid, chanid, chanid, version, types.UNORDERED, invalidConnHops, cpportid, cpchanid, version, suite.proof, height, addr), false}, + {"too short connection id", types.NewMsgChannelOpenTry(portid, chanid, chanid, version, types.UNORDERED, invalidShortConnHops, cpportid, cpchanid, version, suite.proof, height, addr), false}, + {"too long connection id", types.NewMsgChannelOpenTry(portid, chanid, chanid, version, types.UNORDERED, invalidLongConnHops, cpportid, cpchanid, version, suite.proof, height, addr), false}, + {"connection id contains non-alpha", types.NewMsgChannelOpenTry(portid, chanid, chanid, version, types.UNORDERED, []string{invalidConnection}, cpportid, cpchanid, version, suite.proof, height, addr), false}, + {"", types.NewMsgChannelOpenTry(portid, chanid, chanid, "", types.UNORDERED, connHops, cpportid, cpchanid, version, suite.proof, height, addr), true}, + {"invalid counterparty port id", types.NewMsgChannelOpenTry(portid, chanid, chanid, version, types.UNORDERED, connHops, invalidPort, cpchanid, version, suite.proof, height, addr), false}, + {"invalid counterparty channel id", types.NewMsgChannelOpenTry(portid, chanid, chanid, version, types.UNORDERED, connHops, cpportid, invalidChannel, version, suite.proof, height, addr), false}, + {"empty proof", types.NewMsgChannelOpenTry(portid, chanid, chanid, version, types.UNORDERED, connHops, cpportid, cpchanid, version, emptyProof, height, addr), false}, + {"valid empty proved channel id", types.NewMsgChannelOpenTry(portid, chanid, "", version, types.ORDERED, connHops, cpportid, cpchanid, version, suite.proof, height, addr), true}, + {"invalid proved channel id, doesn't match channel id", types.NewMsgChannelOpenTry(portid, chanid, "differentchannel", version, types.ORDERED, connHops, cpportid, cpchanid, version, suite.proof, height, addr), false}, } - for i, tc := range testCases { - err := tc.msg.ValidateBasic() - if tc.expPass { - suite.Require().NoError(err, "Msg %d failed: %s", i, tc.errMsg) - } else { - suite.Require().Error(err, "Invalid Msg %d passed: %s", i, tc.errMsg) - } + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) } } -// TestMsgChannelOpenAck tests ValidateBasic for MsgChannelOpenAck -func (suite *TypesTestSuite) TestMsgChannelOpenAck() { - testMsgs := []*types.MsgChannelOpenAck{ - types.NewMsgChannelOpenAck("testportid", "testchannel", chanid, "1.0", suite.proof, height, addr), // valid msg - types.NewMsgChannelOpenAck(invalidShortPort, "testchannel", chanid, "1.0", suite.proof, height, addr), // too short port id - types.NewMsgChannelOpenAck(invalidLongPort, "testchannel", chanid, "1.0", suite.proof, height, addr), // too long port id - types.NewMsgChannelOpenAck(invalidPort, "testchannel", chanid, "1.0", suite.proof, height, addr), // port id contains non-alpha - types.NewMsgChannelOpenAck("testportid", invalidShortChannel, chanid, "1.0", suite.proof, height, addr), // too short channel id - types.NewMsgChannelOpenAck("testportid", invalidLongChannel, chanid, "1.0", suite.proof, height, addr), // too long channel id - types.NewMsgChannelOpenAck("testportid", invalidChannel, chanid, "1.0", suite.proof, height, addr), // channel id contains non-alpha - types.NewMsgChannelOpenAck("testportid", "testchannel", chanid, "", suite.proof, height, addr), // empty counterparty version - types.NewMsgChannelOpenAck("testportid", "testchannel", chanid, "1.0", emptyProof, height, addr), // empty proof - types.NewMsgChannelOpenAck("testportid", "testchannel", chanid, "1.0", suite.proof, clienttypes.ZeroHeight(), addr), // proof height is zero - types.NewMsgChannelOpenAck("testportid", "testchannel", invalidShortChannel, "1.0", suite.proof, height, addr), // invalid counterparty channel id - } - +func (suite *TypesTestSuite) TestMsgChannelOpenAckValidateBasic() { testCases := []struct { + name string msg *types.MsgChannelOpenAck expPass bool - errMsg string }{ - {testMsgs[0], true, ""}, - {testMsgs[1], false, "too short port id"}, - {testMsgs[2], false, "too long port id"}, - {testMsgs[3], false, "port id contains non-alpha"}, - {testMsgs[4], false, "too short channel id"}, - {testMsgs[5], false, "too long channel id"}, - {testMsgs[6], false, "channel id contains non-alpha"}, - {testMsgs[7], true, ""}, - {testMsgs[8], false, "empty proof"}, - {testMsgs[9], false, "proof height is zero"}, - {testMsgs[10], false, "invalid counterparty channel id"}, + {"", types.NewMsgChannelOpenAck(portid, chanid, chanid, version, suite.proof, height, addr), true}, + {"too short port id", types.NewMsgChannelOpenAck(invalidShortPort, chanid, chanid, version, suite.proof, height, addr), false}, + {"too long port id", types.NewMsgChannelOpenAck(invalidLongPort, chanid, chanid, version, suite.proof, height, addr), false}, + {"port id contains non-alpha", types.NewMsgChannelOpenAck(invalidPort, chanid, chanid, version, suite.proof, height, addr), false}, + {"too short channel id", types.NewMsgChannelOpenAck(portid, invalidShortChannel, chanid, version, suite.proof, height, addr), false}, + {"too long channel id", types.NewMsgChannelOpenAck(portid, invalidLongChannel, chanid, version, suite.proof, height, addr), false}, + {"channel id contains non-alpha", types.NewMsgChannelOpenAck(portid, invalidChannel, chanid, version, suite.proof, height, addr), false}, + {"", types.NewMsgChannelOpenAck(portid, chanid, chanid, "", suite.proof, height, addr), true}, + {"empty proof", types.NewMsgChannelOpenAck(portid, chanid, chanid, version, emptyProof, height, addr), false}, + {"proof height is zero", types.NewMsgChannelOpenAck(portid, chanid, chanid, version, suite.proof, clienttypes.ZeroHeight(), addr), false}, + {"invalid counterparty channel id", types.NewMsgChannelOpenAck(portid, chanid, invalidShortChannel, version, suite.proof, height, addr), false}, } - for i, tc := range testCases { - err := tc.msg.ValidateBasic() - if tc.expPass { - suite.Require().NoError(err, "Msg %d failed: %s", i, tc.errMsg) - } else { - suite.Require().Error(err, "Invalid Msg %d passed: %s", i, tc.errMsg) - } + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) } } -// TestMsgChannelOpenConfirm tests ValidateBasic for MsgChannelOpenConfirm -func (suite *TypesTestSuite) TestMsgChannelOpenConfirm() { - testMsgs := []*types.MsgChannelOpenConfirm{ - types.NewMsgChannelOpenConfirm("testportid", "testchannel", suite.proof, height, addr), // valid msg - types.NewMsgChannelOpenConfirm(invalidShortPort, "testchannel", suite.proof, height, addr), // too short port id - types.NewMsgChannelOpenConfirm(invalidLongPort, "testchannel", suite.proof, height, addr), // too long port id - types.NewMsgChannelOpenConfirm(invalidPort, "testchannel", suite.proof, height, addr), // port id contains non-alpha - types.NewMsgChannelOpenConfirm("testportid", invalidShortChannel, suite.proof, height, addr), // too short channel id - types.NewMsgChannelOpenConfirm("testportid", invalidLongChannel, suite.proof, height, addr), // too long channel id - types.NewMsgChannelOpenConfirm("testportid", invalidChannel, suite.proof, height, addr), // channel id contains non-alpha - types.NewMsgChannelOpenConfirm("testportid", "testchannel", emptyProof, height, addr), // empty proof - types.NewMsgChannelOpenConfirm("testportid", "testchannel", suite.proof, clienttypes.ZeroHeight(), addr), // proof height is zero - } - +func (suite *TypesTestSuite) TestMsgChannelOpenConfirmValidateBasic() { testCases := []struct { + name string msg *types.MsgChannelOpenConfirm expPass bool - errMsg string }{ - {testMsgs[0], true, ""}, - {testMsgs[1], false, "too short port id"}, - {testMsgs[2], false, "too long port id"}, - {testMsgs[3], false, "port id contains non-alpha"}, - {testMsgs[4], false, "too short channel id"}, - {testMsgs[5], false, "too long channel id"}, - {testMsgs[6], false, "channel id contains non-alpha"}, - {testMsgs[7], false, "empty proof"}, - {testMsgs[8], false, "proof height is zero"}, + {"", types.NewMsgChannelOpenConfirm(portid, chanid, suite.proof, height, addr), true}, + {"too short port id", types.NewMsgChannelOpenConfirm(invalidShortPort, chanid, suite.proof, height, addr), false}, + {"too long port id", types.NewMsgChannelOpenConfirm(invalidLongPort, chanid, suite.proof, height, addr), false}, + {"port id contains non-alpha", types.NewMsgChannelOpenConfirm(invalidPort, chanid, suite.proof, height, addr), false}, + {"too short channel id", types.NewMsgChannelOpenConfirm(portid, invalidShortChannel, suite.proof, height, addr), false}, + {"too long channel id", types.NewMsgChannelOpenConfirm(portid, invalidLongChannel, suite.proof, height, addr), false}, + {"channel id contains non-alpha", types.NewMsgChannelOpenConfirm(portid, invalidChannel, suite.proof, height, addr), false}, + {"empty proof", types.NewMsgChannelOpenConfirm(portid, chanid, emptyProof, height, addr), false}, + {"proof height is zero", types.NewMsgChannelOpenConfirm(portid, chanid, suite.proof, clienttypes.ZeroHeight(), addr), false}, } - for i, tc := range testCases { - err := tc.msg.ValidateBasic() - if tc.expPass { - suite.Require().NoError(err, "Msg %d failed: %s", i, tc.errMsg) - } else { - suite.Require().Error(err, "Invalid Msg %d passed: %s", i, tc.errMsg) - } + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) } } -// TestMsgChannelCloseInit tests ValidateBasic for MsgChannelCloseInit -func (suite *TypesTestSuite) TestMsgChannelCloseInit() { - testMsgs := []*types.MsgChannelCloseInit{ - types.NewMsgChannelCloseInit("testportid", "testchannel", addr), // valid msg - types.NewMsgChannelCloseInit(invalidShortPort, "testchannel", addr), // too short port id - types.NewMsgChannelCloseInit(invalidLongPort, "testchannel", addr), // too long port id - types.NewMsgChannelCloseInit(invalidPort, "testchannel", addr), // port id contains non-alpha - types.NewMsgChannelCloseInit("testportid", invalidShortChannel, addr), // too short channel id - types.NewMsgChannelCloseInit("testportid", invalidLongChannel, addr), // too long channel id - types.NewMsgChannelCloseInit("testportid", invalidChannel, addr), // channel id contains non-alpha - } - +func (suite *TypesTestSuite) TestMsgChannelCloseInitValidateBasic() { testCases := []struct { + name string msg *types.MsgChannelCloseInit expPass bool - errMsg string }{ - {testMsgs[0], true, ""}, - {testMsgs[1], false, "too short port id"}, - {testMsgs[2], false, "too long port id"}, - {testMsgs[3], false, "port id contains non-alpha"}, - {testMsgs[4], false, "too short channel id"}, - {testMsgs[5], false, "too long channel id"}, - {testMsgs[6], false, "channel id contains non-alpha"}, + {"", types.NewMsgChannelCloseInit(portid, chanid, addr), true}, + {"too short port id", types.NewMsgChannelCloseInit(invalidShortPort, chanid, addr), false}, + {"too long port id", types.NewMsgChannelCloseInit(invalidLongPort, chanid, addr), false}, + {"port id contains non-alpha", types.NewMsgChannelCloseInit(invalidPort, chanid, addr), false}, + {"too short channel id", types.NewMsgChannelCloseInit(portid, invalidShortChannel, addr), false}, + {"too long channel id", types.NewMsgChannelCloseInit(portid, invalidLongChannel, addr), false}, + {"channel id contains non-alpha", types.NewMsgChannelCloseInit(portid, invalidChannel, addr), false}, } - for i, tc := range testCases { - err := tc.msg.ValidateBasic() - if tc.expPass { - suite.Require().NoError(err, "Msg %d failed: %s", i, tc.errMsg) - } else { - suite.Require().Error(err, "Invalid Msg %d passed: %s", i, tc.errMsg) - } + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) } } -// TestMsgChannelCloseConfirm tests ValidateBasic for MsgChannelCloseConfirm -func (suite *TypesTestSuite) TestMsgChannelCloseConfirm() { - testMsgs := []*types.MsgChannelCloseConfirm{ - types.NewMsgChannelCloseConfirm("testportid", "testchannel", suite.proof, height, addr), // valid msg - types.NewMsgChannelCloseConfirm(invalidShortPort, "testchannel", suite.proof, height, addr), // too short port id - types.NewMsgChannelCloseConfirm(invalidLongPort, "testchannel", suite.proof, height, addr), // too long port id - types.NewMsgChannelCloseConfirm(invalidPort, "testchannel", suite.proof, height, addr), // port id contains non-alpha - types.NewMsgChannelCloseConfirm("testportid", invalidShortChannel, suite.proof, height, addr), // too short channel id - types.NewMsgChannelCloseConfirm("testportid", invalidLongChannel, suite.proof, height, addr), // too long channel id - types.NewMsgChannelCloseConfirm("testportid", invalidChannel, suite.proof, height, addr), // channel id contains non-alpha - types.NewMsgChannelCloseConfirm("testportid", "testchannel", emptyProof, height, addr), // empty proof - types.NewMsgChannelCloseConfirm("testportid", "testchannel", suite.proof, clienttypes.ZeroHeight(), addr), // proof height is zero - } - +func (suite *TypesTestSuite) TestMsgChannelCloseConfirmValidateBasic() { testCases := []struct { + name string msg *types.MsgChannelCloseConfirm expPass bool - errMsg string }{ - {testMsgs[0], true, ""}, - {testMsgs[1], false, "too short port id"}, - {testMsgs[2], false, "too long port id"}, - {testMsgs[3], false, "port id contains non-alpha"}, - {testMsgs[4], false, "too short channel id"}, - {testMsgs[5], false, "too long channel id"}, - {testMsgs[6], false, "channel id contains non-alpha"}, - {testMsgs[7], false, "empty proof"}, - {testMsgs[8], false, "proof height is zero"}, + {"", types.NewMsgChannelCloseConfirm(portid, chanid, suite.proof, height, addr), true}, + {"too short port id", types.NewMsgChannelCloseConfirm(invalidShortPort, chanid, suite.proof, height, addr), false}, + {"too long port id", types.NewMsgChannelCloseConfirm(invalidLongPort, chanid, suite.proof, height, addr), false}, + {"port id contains non-alpha", types.NewMsgChannelCloseConfirm(invalidPort, chanid, suite.proof, height, addr), false}, + {"too short channel id", types.NewMsgChannelCloseConfirm(portid, invalidShortChannel, suite.proof, height, addr), false}, + {"too long channel id", types.NewMsgChannelCloseConfirm(portid, invalidLongChannel, suite.proof, height, addr), false}, + {"channel id contains non-alpha", types.NewMsgChannelCloseConfirm(portid, invalidChannel, suite.proof, height, addr), false}, + {"empty proof", types.NewMsgChannelCloseConfirm(portid, chanid, emptyProof, height, addr), false}, + {"proof height is zero", types.NewMsgChannelCloseConfirm(portid, chanid, suite.proof, clienttypes.ZeroHeight(), addr), false}, } - for i, tc := range testCases { - err := tc.msg.ValidateBasic() - if tc.expPass { - suite.Require().NoError(err, "Msg %d failed: %s", i, tc.errMsg) - } else { - suite.Require().Error(err, "Invalid Msg %d passed: %s", i, tc.errMsg) - } + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) } } -// TestMsgRecvPacketType tests Type for MsgRecvPacket. func (suite *TypesTestSuite) TestMsgRecvPacketType() { - msg := types.NewMsgRecvPacket(packet, suite.proof, height, addr1) + msg := types.NewMsgRecvPacket(packet, suite.proof, height, addr) suite.Equal("recv_packet", msg.Type()) } -// TestMsgRecvPacketValidation tests ValidateBasic for MsgRecvPacket -func (suite *TypesTestSuite) TestMsgRecvPacketValidation() { - testMsgs := []*types.MsgRecvPacket{ - types.NewMsgRecvPacket(packet, suite.proof, height, addr1), // valid msg - types.NewMsgRecvPacket(packet, suite.proof, clienttypes.ZeroHeight(), addr1), // proof height is zero - types.NewMsgRecvPacket(packet, emptyProof, height, addr1), // empty proof - types.NewMsgRecvPacket(packet, suite.proof, height, emptyAddr), // missing signer address - types.NewMsgRecvPacket(invalidPacket, suite.proof, height, addr1), // unknown packet - } - +func (suite *TypesTestSuite) TestMsgRecvPacketValidateBasic() { testCases := []struct { + name string msg *types.MsgRecvPacket expPass bool - errMsg string }{ - {testMsgs[0], true, ""}, - {testMsgs[1], false, "proof height is zero"}, - {testMsgs[2], false, "proof contain empty proof"}, - {testMsgs[3], false, "missing signer address"}, - {testMsgs[4], false, "invalid packet"}, + {"", types.NewMsgRecvPacket(packet, suite.proof, height, addr), true}, + {"proof height is zero", types.NewMsgRecvPacket(packet, suite.proof, clienttypes.ZeroHeight(), addr), false}, + {"proof contain empty proof", types.NewMsgRecvPacket(packet, emptyProof, height, addr), false}, + {"missing signer address", types.NewMsgRecvPacket(packet, suite.proof, height, emptyAddr), false}, + {"invalid packet", types.NewMsgRecvPacket(invalidPacket, suite.proof, height, addr), false}, } - for i, tc := range testCases { - err := tc.msg.ValidateBasic() - if tc.expPass { - suite.NoError(err, "Msg %d failed: %v", i, err) - } else { - suite.Error(err, "Invalid Msg %d passed: %s", i, tc.errMsg) - } + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + + if tc.expPass { + suite.NoError(err) + } else { + suite.Error(err) + } + }) } } -// TestMsgRecvPacketGetSignBytes tests GetSignBytes for MsgRecvPacket func (suite *TypesTestSuite) TestMsgRecvPacketGetSignBytes() { - msg := types.NewMsgRecvPacket(packet, suite.proof, height, addr1) + msg := types.NewMsgRecvPacket(packet, suite.proof, height, addr) res := msg.GetSignBytes() expected := fmt.Sprintf( `{"packet":{"data":%s,"destination_channel":"testcpchannel","destination_port":"testcpport","sequence":"1","source_channel":"testchannel","source_port":"testportid","timeout_height":{"version_height":"100","version_number":"0"},"timeout_timestamp":"100"},"proof":"Co0BCi4KCmljczIzOmlhdmwSA0tFWRobChkKA0tFWRIFVkFMVUUaCwgBGAEgASoDAAICClsKDGljczIzOnNpbXBsZRIMaWF2bFN0b3JlS2V5Gj0KOwoMaWF2bFN0b3JlS2V5EiAcIiDXSHQRSvh/Wa07MYpTK0B4XtbaXtzxBED76xk0WhoJCAEYASABKgEA","proof_height":{"version_height":"1","version_number":"0"},"signer":"%s"}`, string(msg.GetDataSignBytes()), - addr1.String(), + addr.String(), ) suite.Equal(expected, string(res)) } -// TestMsgRecvPacketGetSigners tests GetSigners for MsgRecvPacket func (suite *TypesTestSuite) TestMsgRecvPacketGetSigners() { - msg := types.NewMsgRecvPacket(packet, suite.proof, height, addr1) + msg := types.NewMsgRecvPacket(packet, suite.proof, height, addr) res := msg.GetSigners() expected := "[7465737461646472313131313131313131313131]" suite.Equal(expected, fmt.Sprintf("%v", res)) } -// TestMsgTimeout tests ValidateBasic for MsgTimeout -func (suite *TypesTestSuite) TestMsgTimeout() { - testMsgs := []*types.MsgTimeout{ - types.NewMsgTimeout(packet, 1, suite.proof, height, addr), - types.NewMsgTimeout(packet, 1, suite.proof, clienttypes.ZeroHeight(), addr), - types.NewMsgTimeout(packet, 1, suite.proof, height, emptyAddr), - types.NewMsgTimeout(packet, 1, emptyProof, height, addr), - types.NewMsgTimeout(invalidPacket, 1, suite.proof, height, addr), - } - +func (suite *TypesTestSuite) TestMsgTimeoutValidateBasic() { testCases := []struct { + name string msg *types.MsgTimeout expPass bool - errMsg string }{ - {testMsgs[0], true, ""}, - {testMsgs[1], false, "proof height must be > 0"}, - {testMsgs[2], false, "missing signer address"}, - {testMsgs[3], false, "cannot submit an empty proof"}, - {testMsgs[4], false, "invalid packet"}, + {"", types.NewMsgTimeout(packet, 1, suite.proof, height, addr), true}, + {"proof height must be > 0", types.NewMsgTimeout(packet, 1, suite.proof, clienttypes.ZeroHeight(), addr), false}, + {"missing signer address", types.NewMsgTimeout(packet, 1, suite.proof, height, emptyAddr), false}, + {"cannot submit an empty proof", types.NewMsgTimeout(packet, 1, emptyProof, height, addr), false}, + {"invalid packet", types.NewMsgTimeout(invalidPacket, 1, suite.proof, height, addr), false}, } - for i, tc := range testCases { - err := tc.msg.ValidateBasic() - if tc.expPass { - suite.Require().NoError(err, "Msg %d failed: %s", i, tc.errMsg) - } else { - suite.Require().Error(err, "Invalid Msg %d passed: %s", i, tc.errMsg) - } + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) } } -// TestMsgTimeoutOnClose tests ValidateBasic for MsgTimeoutOnClose -func (suite *TypesTestSuite) TestMsgTimeoutOnClose() { +func (suite *TypesTestSuite) TestMsgTimeoutOnCloseValidateBasic() { testCases := []struct { name string msg sdk.Msg @@ -500,34 +423,30 @@ func (suite *TypesTestSuite) TestMsgTimeoutOnClose() { } } -// TestMsgAcknowledgement tests ValidateBasic for MsgAcknowledgement -func (suite *TypesTestSuite) TestMsgAcknowledgement() { - testMsgs := []*types.MsgAcknowledgement{ - types.NewMsgAcknowledgement(packet, packet.GetData(), suite.proof, height, addr), - types.NewMsgAcknowledgement(packet, packet.GetData(), suite.proof, clienttypes.ZeroHeight(), addr), - types.NewMsgAcknowledgement(packet, packet.GetData(), suite.proof, height, emptyAddr), - types.NewMsgAcknowledgement(packet, packet.GetData(), emptyProof, height, addr), - types.NewMsgAcknowledgement(invalidPacket, packet.GetData(), suite.proof, height, addr), - } - +func (suite *TypesTestSuite) TestMsgAcknowledgementValidateBasic() { testCases := []struct { + name string msg *types.MsgAcknowledgement expPass bool - errMsg string }{ - {testMsgs[0], true, ""}, - {testMsgs[1], false, "proof height must be > 0"}, - {testMsgs[2], false, "missing signer address"}, - {testMsgs[3], false, "cannot submit an empty proof"}, - {testMsgs[4], false, "invalid packet"}, + {"", types.NewMsgAcknowledgement(packet, packet.GetData(), suite.proof, height, addr), true}, + {"proof height must be > 0", types.NewMsgAcknowledgement(packet, packet.GetData(), suite.proof, clienttypes.ZeroHeight(), addr), false}, + {"missing signer address", types.NewMsgAcknowledgement(packet, packet.GetData(), suite.proof, height, emptyAddr), false}, + {"cannot submit an empty proof", types.NewMsgAcknowledgement(packet, packet.GetData(), emptyProof, height, addr), false}, + {"invalid packet", types.NewMsgAcknowledgement(invalidPacket, packet.GetData(), suite.proof, height, addr), false}, } - for i, tc := range testCases { - err := tc.msg.ValidateBasic() - if tc.expPass { - suite.Require().NoError(err, "Msg %d failed: %s", i, tc.errMsg) - } else { - suite.Require().Error(err, "Invalid Msg %d passed: %s", i, tc.errMsg) - } + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) } } From 3589a3c7999fb1ea762761173aa2a19e929f01b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Tue, 13 Oct 2020 14:02:24 +0200 Subject: [PATCH 18/84] Fix misbehaviour handling for solo machine (#7515) * add timestamp to SignatureAndData Add timestamp field to signature and data. Add ValidateBasic check for timestamp. Add ValidateBasic test. Update misbehaviour handler to use supplied timestamp. * fix typo * add timestamp check * fix lint Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> --- .../solomachine/v1/solomachine.proto | 1 + .../06-solomachine/types/misbehaviour.go | 3 + .../types/misbehaviour_handle.go | 11 +- .../types/misbehaviour_handle_test.go | 28 +++ .../06-solomachine/types/misbehaviour_test.go | 12 ++ .../06-solomachine/types/solomachine.pb.go | 202 ++++++++++-------- x/ibc/testing/solomachine.go | 5 + 7 files changed, 173 insertions(+), 89 deletions(-) diff --git a/proto/ibc/lightclients/solomachine/v1/solomachine.proto b/proto/ibc/lightclients/solomachine/v1/solomachine.proto index 605af48b5b..5903b1b651 100644 --- a/proto/ibc/lightclients/solomachine/v1/solomachine.proto +++ b/proto/ibc/lightclients/solomachine/v1/solomachine.proto @@ -63,6 +63,7 @@ message SignatureAndData { bytes signature = 1; DataType data_type = 2 [(gogoproto.moretags) = "yaml:\"data_type\""]; bytes data = 3; + uint64 timestamp = 4; } // TimestampedSignatureData contains the signature data and the timestamp of the diff --git a/x/ibc/light-clients/06-solomachine/types/misbehaviour.go b/x/ibc/light-clients/06-solomachine/types/misbehaviour.go index 8a54e23b6c..1f97f323ce 100644 --- a/x/ibc/light-clients/06-solomachine/types/misbehaviour.go +++ b/x/ibc/light-clients/06-solomachine/types/misbehaviour.go @@ -85,6 +85,9 @@ func (sd SignatureAndData) ValidateBasic() error { if sd.DataType == UNSPECIFIED { return sdkerrors.Wrap(ErrInvalidSignatureAndData, "data type cannot be UNSPECIFIED") } + if sd.Timestamp == 0 { + return sdkerrors.Wrap(ErrInvalidSignatureAndData, "timestamp cannot be 0") + } return nil } diff --git a/x/ibc/light-clients/06-solomachine/types/misbehaviour_handle.go b/x/ibc/light-clients/06-solomachine/types/misbehaviour_handle.go index 45ae344cdc..2fcbe75c7a 100644 --- a/x/ibc/light-clients/06-solomachine/types/misbehaviour_handle.go +++ b/x/ibc/light-clients/06-solomachine/types/misbehaviour_handle.go @@ -49,8 +49,15 @@ func (cs ClientState) CheckMisbehaviourAndUpdateState( // verifySignatureAndData verifies that the currently registered public key has signed // over the provided data and that the data is valid. The data is valid if it can be -// unmarshaled into the specified data type. +// unmarshaled into the specified data type or the timestamp of the signature is less +// than the consensus state timestamp. func verifySignatureAndData(cdc codec.BinaryMarshaler, clientState ClientState, misbehaviour *Misbehaviour, sigAndData *SignatureAndData) error { + // timestamp less than consensus state would always fail and not succeed in fooling the + // light client + if sigAndData.Timestamp < clientState.ConsensusState.Timestamp { + return sdkerrors.Wrapf(clienttypes.ErrInvalidMisbehaviour, "timestamp is less than consensus state timestamp (%d < %d)", sigAndData.Timestamp, clientState.ConsensusState.Timestamp) + } + // ensure data can be unmarshaled to the specified data type if _, err := UnmarshalDataByType(cdc, sigAndData.DataType, sigAndData.Data); err != nil { return err @@ -58,7 +65,7 @@ func verifySignatureAndData(cdc codec.BinaryMarshaler, clientState ClientState, data, err := MisbehaviourSignBytes( cdc, - misbehaviour.Sequence, clientState.ConsensusState.Timestamp, + misbehaviour.Sequence, sigAndData.Timestamp, clientState.ConsensusState.Diversifier, sigAndData.DataType, sigAndData.Data, diff --git a/x/ibc/light-clients/06-solomachine/types/misbehaviour_handle_test.go b/x/ibc/light-clients/06-solomachine/types/misbehaviour_handle_test.go index bec4afaf27..fd5871adc6 100644 --- a/x/ibc/light-clients/06-solomachine/types/misbehaviour_handle_test.go +++ b/x/ibc/light-clients/06-solomachine/types/misbehaviour_handle_test.go @@ -75,6 +75,34 @@ func (suite *SoloMachineTestSuite) TestCheckMisbehaviourAndUpdateState() { misbehaviour = m }, false, }, + { + "invalid SignatureOne timestamp", + func() { + clientState = solomachine.ClientState() + m := solomachine.CreateMisbehaviour() + + m.SignatureOne.Timestamp = 1000000000000 + misbehaviour = m + }, false, + }, + { + "invalid SignatureTwo timestamp", + func() { + clientState = solomachine.ClientState() + m := solomachine.CreateMisbehaviour() + + m.SignatureTwo.Timestamp = 1000000000000 + misbehaviour = m + }, false, + }, + { + "timestamp is less than consensus state timestamp", + func() { + clientState = solomachine.ClientState() + solomachine.Time = solomachine.Time - 5 + misbehaviour = solomachine.CreateMisbehaviour() + }, false, + }, { "invalid first signature data", func() { diff --git a/x/ibc/light-clients/06-solomachine/types/misbehaviour_test.go b/x/ibc/light-clients/06-solomachine/types/misbehaviour_test.go index a1138d5d80..311dc8d8c8 100644 --- a/x/ibc/light-clients/06-solomachine/types/misbehaviour_test.go +++ b/x/ibc/light-clients/06-solomachine/types/misbehaviour_test.go @@ -96,6 +96,18 @@ func (suite *SoloMachineTestSuite) TestMisbehaviourValidateBasic() { misbehaviour.SignatureTwo.DataType = types.UNSPECIFIED }, false, }, + { + "timestamp for SignatureOne is zero", + func(misbehaviour *types.Misbehaviour) { + misbehaviour.SignatureOne.Timestamp = 0 + }, false, + }, + { + "timestamp for SignatureTwo is zero", + func(misbehaviour *types.Misbehaviour) { + misbehaviour.SignatureTwo.Timestamp = 0 + }, false, + }, } for _, tc := range testCases { diff --git a/x/ibc/light-clients/06-solomachine/types/solomachine.pb.go b/x/ibc/light-clients/06-solomachine/types/solomachine.pb.go index 1d4f8cb262..833535da16 100644 --- a/x/ibc/light-clients/06-solomachine/types/solomachine.pb.go +++ b/x/ibc/light-clients/06-solomachine/types/solomachine.pb.go @@ -267,6 +267,7 @@ type SignatureAndData struct { Signature []byte `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` DataType DataType `protobuf:"varint,2,opt,name=data_type,json=dataType,proto3,enum=ibc.lightclients.solomachine.v1.DataType" json:"data_type,omitempty" yaml:"data_type"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` } func (m *SignatureAndData) Reset() { *m = SignatureAndData{} } @@ -819,93 +820,93 @@ func init() { } var fileDescriptor_6cc2ee18f7f86d4e = []byte{ - // 1361 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x8f, 0xdb, 0x54, - 0x10, 0x5f, 0xa7, 0xe9, 0x76, 0x33, 0xd9, 0x66, 0x83, 0x9b, 0xb6, 0x59, 0xb7, 0x4a, 0x8c, 0x11, - 0x65, 0x41, 0x34, 0x61, 0x8b, 0xa8, 0x50, 0x85, 0x00, 0xc7, 0x31, 0x34, 0xed, 0xae, 0x37, 0x38, - 0x5e, 0xa0, 0x15, 0x92, 0xe5, 0xd8, 0x6f, 0x13, 0x6b, 0x13, 0x3b, 0xc4, 0x4e, 0xd2, 0x20, 0x21, - 0x21, 0x4e, 0x25, 0xe2, 0xc0, 0x91, 0x4b, 0x24, 0x04, 0x42, 0xe2, 0xa3, 0x20, 0x71, 0x29, 0x37, - 0x4e, 0x01, 0xb5, 0xdf, 0x20, 0x9f, 0x00, 0xd9, 0xef, 0x39, 0xb6, 0xb3, 0x6c, 0x56, 0xfc, 0x3b, - 0xe5, 0xbd, 0x99, 0xdf, 0xfc, 0x66, 0xde, 0xbc, 0xc9, 0xbc, 0x31, 0xec, 0x9a, 0x4d, 0xbd, 0xdc, - 0x31, 0x5b, 0x6d, 0x57, 0xef, 0x98, 0xc8, 0x72, 0x9d, 0xb2, 0x63, 0x77, 0xec, 0xae, 0xa6, 0xb7, - 0x4d, 0x0b, 0x95, 0x87, 0xbb, 0xd1, 0x6d, 0xa9, 0xd7, 0xb7, 0x5d, 0x9b, 0x2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x22, 0x6a, 0x3f, 0xe4, 0x77, 0x21, 0x13, 0x9e, 0xd8, 0x27, 0xf0, 0xe3, 0x8e, 0x56, 0x68, 0x5c, - 0xcf, 0xc9, 0x61, 0xd2, 0x83, 0x43, 0x9f, 0xfe, 0xaf, 0x21, 0x21, 0xfc, 0x4e, 0x41, 0xca, 0xf3, - 0x5b, 0x19, 0xbb, 0xc8, 0xf9, 0x17, 0xff, 0xc1, 0xa5, 0x76, 0x70, 0xee, 0x64, 0x3b, 0x88, 0x25, - 0x39, 0xf9, 0x7f, 0x25, 0xf9, 0xfc, 0x89, 0x24, 0xff, 0x48, 0x01, 0xe0, 0x16, 0xe3, 0x27, 0x65, - 0x0f, 0xd2, 0xe4, 0x8f, 0x7d, 0x66, 0x13, 0xbc, 0x32, 0x9f, 0x15, 0xe9, 0x58, 0x2f, 0x20, 0x5d, - 0x10, 0x37, 0x82, 0x53, 0xba, 0x40, 0xe2, 0x1f, 0x76, 0x81, 0xcf, 0x61, 0x2b, 0xf2, 0x04, 0xfa, - 0xb1, 0xd2, 0x90, 0xec, 0x69, 0x6e, 0x9b, 0x14, 0xac, 0xbf, 0xa6, 0xeb, 0xb0, 0x49, 0x1a, 0x00, - 0x7e, 0xb6, 0x12, 0x2b, 0x0e, 0x70, 0x75, 0x3e, 0x2b, 0x5e, 0x8a, 0x35, 0x0d, 0xf2, 0x30, 0xa5, - 0xf5, 0xd0, 0x13, 0x71, 0xff, 0x15, 0x05, 0x74, 0xfc, 0xb9, 0x38, 0x35, 0x84, 0x07, 0x27, 0x1f, - 0xcf, 0x55, 0x51, 0xfc, 0x8d, 0x17, 0x92, 0xc4, 0x32, 0x84, 0x4b, 0xc2, 0x62, 0xec, 0x58, 0x1d, - 0x8b, 0x08, 0x10, 0x4e, 0x28, 0x24, 0x8c, 0x17, 0xfd, 0xb2, 0xf2, 0x46, 0x94, 0x52, 0x64, 0x7a, - 0xc1, 0x4f, 0x37, 0xd9, 0x89, 0x96, 0x21, 0x47, 0x0c,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 0xad, 0xc9, - 0x94, 0x4d, 0x47, 0x44, 0xf4, 0x0d, 0xb8, 0x12, 0x5a, 0x0a, 0x7b, 0x35, 0x51, 0x52, 0xd4, 0x86, - 0xc2, 0x2b, 0x62, 0x96, 0x62, 0x60, 0x32, 0x65, 0xd7, 0xb1, 0x8c, 0x7e, 0x15, 0xb6, 0x23, 0xb8, - 0x03, 0xa9, 0x21, 0x4a, 0x8d, 0xc3, 0x06, 0x81, 0x26, 0x98, 0x8b, 0x93, 0x29, 0x9b, 0x5a, 0x88, - 0xe9, 0x12, 0x30, 0x31, 0xb4, 0x24, 0x0a, 0x4a, 0xed, 0x40, 0x22, 0xf0, 0x73, 0x4c, 0x66, 0x32, - 0x65, 0x21, 0x94, 0xd3, 0x3b, 0x70, 0x35, 0x82, 0xbf, 0xcb, 0x4b, 0x92, 0xb8, 0x47, 0xc0, 0x49, - 0x26, 0x3d, 0x99, 0xb2, 0x17, 0x88, 0x90, 0x7e, 0x03, 0xae, 0x85, 0xc8, 0x3a, 0x2f, 0xdc, 0x17, - 0x15, 0x55, 0x38, 0xd8, 0xdf, 0xaf, 0x29, 0xfb, 0xa2, 0xa4, 0x64, 0xcf, 0x33, 0xb9, 0xc9, 0x94, - 0xcd, 0x62, 0x45, 0x28, 0xa7, 0xdf, 0x01, 0xf6, 0x84, 0x19, 0x2f, 0xdc, 0x97, 0x0e, 0x3e, 0xda, - 0x13, 0xab, 0xef, 0x8b, 0xbe, 0xed, 0x3a, 0xb3, 0x3d, 0x99, 0xb2, 0x97, 0xb1, 0x76, 0x49, 0x49, - 0xbf, 0xfd, 0x17, 0x04, 0xb2, 0x28, 0x88, 0xb5, 0xba, 0xa2, 0xf2, 0x95, 0x86, 0x28, 0x09, 0x62, - 0xf6, 0x02, 0x93, 0x9f, 0x4c, 0xd9, 0x1c, 0xd6, 0x12, 0x25, 0xd1, 0xd1, 0xb7, 0xe1, 0x7a, 0x68, - 0x2f, 0x89, 0x1f, 0x2b, 0x6a, 0x43, 0xfc, 0xe0, 0xd0, 0x53, 0x79, 0x34, 0x1f, 0x66, 0x37, 0x70, - 0xe0, 0x9e, 0x26, 0x50, 0x78, 0x72, 0x9a, 0x85, 0x6c, 0x68, 0x77, 0x57, 0xe4, 0xab, 0xa2, 0x9c, - 0x4d, 0xe1, 0x9b, 0xc1, 0x3b, 0x26, 0xf9, 0xf8, 0x87, 0xc2, 0x5a, 0x45, 0xfd, 0xf9, 0x69, 0x81, - 0x7a, 0xf2, 0xb4, 0x40, 0xfd, 0xf1, 0xb4, 0x40, 0x7d, 0xf3, 0xac, 0xb0, 0xf6, 0xe4, 0x59, 0x61, - 0xed, 0xb7, 0x67, 0x85, 0xb5, 0x87, 0x62, 0xcb, 0x74, 0xdb, 0x83, 0x66, 0x49, 0xb7, 0xbb, 0x65, - 0xdd, 0x76, 0xba, 0xb6, 0x43, 0x7e, 0x6e, 0x3a, 0xc6, 0x71, 0xf9, 0x51, 0x79, 0xf1, 0x19, 0x75, - 0x33, 0xf8, 0x8e, 0x7a, 0xed, 0xf6, 0xcd, 0xe8, 0xa7, 0x94, 0xf7, 0xca, 0x38, 0xcd, 0x75, 0xbf, - 0x9d, 0xbd, 0xfe, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0xb2, 0xd0, 0x69, 0x77, 0x0d, 0x00, - 0x00, + // 1368 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xdf, 0x8f, 0xdb, 0xc4, + 0x13, 0x3f, 0xa7, 0xe9, 0xf5, 0x32, 0xb9, 0xe6, 0xf2, 0x75, 0xd3, 0x36, 0xe7, 0x56, 0x89, 0xbf, + 0x46, 0x94, 0x03, 0xd1, 0x84, 0x2b, 0xa2, 0x42, 0x15, 0x02, 0x1c, 0xc7, 0xd0, 0xb4, 0x77, 0xbe, + 0xe0, 0xf8, 0x80, 0x56, 0x48, 0x96, 0xe3, 0xec, 0x25,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x37, 0xe7, 0x5f, 0x59, 0xaf, 0xdd, 0xbe, 0x19, 0xfe, + 0xd0, 0xc2, 0xb7, 0x8c, 0x5b, 0x5f, 0xf7, 0xc7, 0xd9, 0xeb, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, + 0x20, 0x84, 0x51, 0xf7, 0x95, 0x0d, 0x00, 0x00, } func (m *ClientState) Marshal() (dAtA []byte, err error) { @@ -1148,6 +1149,11 @@ func (m *SignatureAndData) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Timestamp != 0 { + i = encodeVarintSolomachine(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x20 + } if len(m.Data) > 0 { i -= len(m.Data) copy(dAtA[i:], m.Data) @@ -1727,6 +1733,9 @@ func (m *SignatureAndData) Size() (n int) { if l > 0 { n += 1 + l + sovSolomachine(uint64(l)) } + if m.Timestamp != 0 { + n += 1 + sovSolomachine(uint64(m.Timestamp)) + } return n } @@ -2698,6 +2707,25 @@ func (m *SignatureAndData) Unmarshal(dAtA []byte) error { m.Data = []byte{} } iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSolomachine + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipSolomachine(dAtA[iNdEx:]) diff --git a/x/ibc/testing/solomachine.go b/x/ibc/testing/solomachine.go index c0f9befaa0..21b02516e9 100644 --- a/x/ibc/testing/solomachine.go +++ b/x/ibc/testing/solomachine.go @@ -181,8 +181,12 @@ func (solo *Solomachine) CreateMisbehaviour() *solomachinetypes.Misbehaviour { Signature: sig, DataType: solomachinetypes.CLIENT, Data: dataOne, + Timestamp: solo.Time, } + // misbehaviour signaturess can have different timestamps + solo.Time++ + signBytes = &solomachinetypes.SignBytes{ Sequence: solo.Sequence, Timestamp: solo.Time, @@ -199,6 +203,7 @@ func (solo *Solomachine) CreateMisbehaviour() *solomachinetypes.Misbehaviour { Signature: sig, DataType: solomachinetypes.CONSENSUS, Data: dataTwo, + Timestamp: solo.Time, } return &solomachinetypes.Misbehaviour{ From bbbc0e15f05146a0f217a8e85a87c111f0e39257 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Tue, 13 Oct 2020 14:39:33 +0200 Subject: [PATCH 19/84] Merge PR #7415: Return empty store tree on non-existing version --- CHANGELOG.md | 1 + baseapp/baseapp_test.go | 2 +- go.mod | 7 +++++ go.sum | 14 +++++++++ store/iavl/store.go | 16 +++++++--- store/iavl/store_test.go | 58 ++++++++++++++++++++++++++++++++++- store/rootmulti/store.go | 26 +++++++++++++--- store/rootmulti/store_test.go | 39 +++++++++++++++++++---- store/types/store.go | 10 ++++++ 9 files changed, 155 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd0e455be2..231d3ceda9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -217,6 +217,7 @@ invalid or incomplete requests. * (x/genutil) [\#5938](https://github.com/cosmos/cosmos-sdk/pull/5938) Fix `InitializeNodeValidatorFiles` error handling. * (x/staking) [\#5949](https://github.com/cosmos/cosmos-sdk/pull/5949) Skip staking `HistoricalInfoKey` in simulations as headers are not exported. * (client) [\#5964](https://github.com/cosmos/cosmos-sdk/issues/5964) `--trust-node` is now false by default - for real. Users must ensure it is set to true if they don't want to enable the verifier. +* (kvstore) [\#7415](https://github.com/cosmos/cosmos-sdk/pull/7415) Allow new stores to be registered during on-chain upgrades. ### State Machine Breaking diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index 760e624eb9..233fbabc42 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -422,7 +422,7 @@ func TestLoadVersionPruning(t *testing.T) { for _, v := range []int64{1, 2, 4} { _, err = app.cms.CacheMultiStoreWithVersion(v) - require.Error(t, err) + require.NoError(t, err) } for _, v := range []int64{3, 5, 6, 7} { diff --git a/go.mod b/go.mod index ae408db2f2..140b1c0836 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ module github.com/cosmos/cosmos-sdk require ( github.com/99designs/keyring v1.1.6 + github.com/DataDog/zstd v1.4.5 // indirect github.com/armon/go-metrics v0.3.4 github.com/bgentry/speakeasy v0.1.0 github.com/btcsuite/btcd v0.21.0-beta @@ -12,11 +13,15 @@ require ( github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d github.com/cosmos/iavl v0.15.0-rc3 github.com/cosmos/ledger-cosmos-go v0.11.1 + github.com/dgraph-io/badger/v2 v2.2007.2 // indirect + github.com/dgraph-io/ristretto v0.0.3 // indirect + github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25 github.com/gogo/gateway v1.1.0 github.com/gogo/protobuf v1.3.1 github.com/golang/mock v1.4.4 github.com/golang/protobuf v1.4.2 + github.com/golang/snappy v0.0.2 // indirect github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.15.2 @@ -43,6 +48,8 @@ require ( github.com/tendermint/tendermint v0.34.0-rc4.0.20201005135527-d7d0ffea13c6 github.com/tendermint/tm-db v0.6.2 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a + golang.org/x/net v0.0.0-20200930145003-4acb6c075d10 // indirect + golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f // indirect google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 google.golang.org/grpc v1.32.0 google.golang.org/protobuf v1.25.0 diff --git a/go.sum b/go.sum index 989f37edf0..aec446a89c 100644 --- a/go.sum +++ b/go.sum @@ -26,6 +26,8 @@ github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1: github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1 h1:3oxKN3wbHibqx897utPC2LTQU4J+IHWWJO+glkAkpFM= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= +github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -139,13 +141,19 @@ github.com/dgraph-io/badger/v2 v2.0.3 h1:inzdf6VF/NZ+tJ8RwwYMjJMvsOALTHYdozn0qSl github.com/dgraph-io/badger/v2 v2.0.3/go.mod h1:3KY8+bsP8wI0OEnQJAKpd4wIJW/Mm32yw2j/9FUVnIM= github.com/dgraph-io/badger/v2 v2.2007.1 h1:t36VcBCpo4SsmAD5M8wVv1ieVzcALyGfaJ92z4ccULM= github.com/dgraph-io/badger/v2 v2.2007.1/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= +github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= +github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3 h1:MQLRM35Pp0yAyBYksjbj1nZI/w6eyRY/mWoM1sFf4kU= github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de h1:t0UHb5vdojIDUqktM6+xJAfScFBsVpXZmqC9dsgJmeA= 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 h1:jh22xisGBjrEVnRZ1DVTpBVQm0Xndu8sMl0CWDzSIBI= +github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= 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= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= 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= @@ -228,6 +236,8 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.2 h1:aeE13tS0IiQgFjYdoL8qN3K1N2bXXtI6Vi51/y7BpMw= +github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -681,6 +691,8 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc h1:zK/HqS5bZxDptfPJNq8v7vJfXtkU7r9TLIoSr1bXaP4= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200930145003-4acb6c075d10 h1:YfxMZzv3PjGonQYNUaeU2+DhAdqOxerQ30JFB6WgAXo= +golang.org/x/net v0.0.0-20200930145003-4acb6c075d10/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 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= @@ -729,6 +741,8 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed h1:J22ig1FUekjjkmZUM7pTKixYm8DvrYsvrBZdunYeIuQ= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= diff --git a/store/iavl/store.go b/store/iavl/store.go index 3d6bedabdb..cf7737d5d8 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -43,7 +43,14 @@ type Store struct { // store's version (id) from the provided DB. An error is returned if the version // fails to load. func LoadStore(db dbm.DB, id types.CommitID, lazyLoading bool) (types.CommitKVStore, error) { - tree, err := iavl.NewMutableTree(db, defaultIAVLCacheSize) + return LoadStoreWithInitialVersion(db, id, lazyLoading, 0) +} + +// LoadStore returns an IAVL Store as a CommitKVStore setting its initialVersion +// to the one given. Internally, it will load the store's version (id) from the +// provided DB. An error is returned if the version fails to load. +func LoadStoreWithInitialVersion(db dbm.DB, id types.CommitID, lazyLoading bool, initialVersion uint64) (types.CommitKVStore, error) { + tree, err := iavl.NewMutableTreeWithOpts(db, defaultIAVLCacheSize, &iavl.Options{InitialVersion: initialVersion}) if err != nil { return nil, err } @@ -78,11 +85,11 @@ func UnsafeNewStore(tree *iavl.MutableTree) *Store { // GetImmutable returns a reference to a new store backed by an immutable IAVL // tree at a specific version (height) without any pruning options. This should // be used for querying and iteration only. If the version does not exist or has -// been pruned, an error will be returned. Any mutable operations executed will -// result in a panic. +// been pruned, an empty immutable IAVL tree will be used. +// Any mutable operations executed will result in a panic. func (st *Store) GetImmutable(version int64) (*Store, error) { if !st.VersionExists(version) { - return nil, iavl.ErrVersionDoesNotExist + return &Store{tree: &immutableTree{&iavl.ImmutableTree{}}}, nil } iTree, err := st.tree.GetImmutable(version) @@ -153,7 +160,6 @@ func (st *Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.Ca // Implements types.KVStore. func (st *Store) Set(key, value []byte) { - defer telemetry.MeasureSince(time.Now(), "store", "iavl", "set") types.AssertValidKey(key) types.AssertValidValue(value) st.tree.Set(key, value) diff --git a/store/iavl/store_test.go b/store/iavl/store_test.go index 052021310f..790830038b 100644 --- a/store/iavl/store_test.go +++ b/store/iavl/store_test.go @@ -50,6 +50,62 @@ func newAlohaTree(t *testing.T, db dbm.DB) (*iavl.MutableTree, types.CommitID) { return tree, types.CommitID{Version: ver, Hash: hash} } +func TestLoadStore(t *testing.T) { + db := dbm.NewMemDB() + tree, _ := newAlohaTree(t, db) + store := UnsafeNewStore(tree) + + // Create non-pruned height H + require.True(t, tree.Set([]byte("hello"), []byte("hallo"))) + hash, verH, err := tree.SaveVersion() + cIDH := types.CommitID{Version: verH, Hash: hash} + require.Nil(t, err) + + // Create pruned height Hp + require.True(t, tree.Set([]byte("hello"), []byte("hola"))) + hash, verHp, err := tree.SaveVersion() + cIDHp := types.CommitID{Version: verHp, Hash: hash} + require.Nil(t, err) + + // TODO: Prune this height + + // Create current height Hc + require.True(t, tree.Set([]byte("hello"), []byte("ciao"))) + hash, verHc, err := tree.SaveVersion() + cIDHc := types.CommitID{Version: verHc, Hash: hash} + require.Nil(t, err) + + // Querying an existing store at some previous non-pruned height H + hStore, err := store.GetImmutable(verH) + require.NoError(t, err) + require.Equal(t, string(hStore.Get([]byte("hello"))), "hallo") + + // Querying an existing store at some previous pruned height Hp + hpStore, err := store.GetImmutable(verHp) + require.NoError(t, err) + require.Equal(t, string(hpStore.Get([]byte("hello"))), "hola") + + // Querying an existing store at current height Hc + hcStore, err := store.GetImmutable(verHc) + require.NoError(t, err) + require.Equal(t, string(hcStore.Get([]byte("hello"))), "ciao") + + // Querying a new store at some previous non-pruned height H + newHStore, err := LoadStore(db, cIDH, false) + require.NoError(t, err) + require.Equal(t, string(newHStore.Get([]byte("hello"))), "hallo") + + // Querying a new store at some previous pruned height Hp + newHpStore, err := LoadStore(db, cIDHp, false) + require.NoError(t, err) + require.Equal(t, string(newHpStore.Get([]byte("hello"))), "hola") + + // Querying a new store at current height H + newHcStore, err := LoadStore(db, cIDHc, false) + require.NoError(t, err) + require.Equal(t, string(newHcStore.Get([]byte("hello"))), "ciao") +} + func TestGetImmutable(t *testing.T) { db := dbm.NewMemDB() tree, cID := newAlohaTree(t, db) @@ -61,7 +117,7 @@ func TestGetImmutable(t *testing.T) { require.Nil(t, err) _, err = store.GetImmutable(cID.Version + 1) - require.Error(t, err) + require.NoError(t, err) newStore, err := store.GetImmutable(cID.Version - 1) require.NoError(t, err) diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index bf8a473b8d..90633a9220 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -187,7 +187,14 @@ func (rs *Store) loadVersion(ver int64, upgrades *types.StoreUpgrades) error { var newStores = make(map[types.StoreKey]types.CommitKVStore) for key, storeParams := range rs.storesParams { - store, err := rs.loadCommitStoreFromParams(key, rs.getCommitID(infos, key.Name()), storeParams) + commitID := rs.getCommitID(infos, key.Name()) + + // If it has been added, set the initial version + if upgrades.IsAdded(key.Name()) { + storeParams.initialVersion = uint64(ver) + 1 + } + + store, err := rs.loadCommitStoreFromParams(key, commitID, storeParams) if err != nil { return errors.Wrap(err, "failed to load store") } @@ -813,7 +820,15 @@ func (rs *Store) loadCommitStoreFromParams(key types.StoreKey, id types.CommitID panic("recursive MultiStores not yet supported") case types.StoreTypeIAVL: - store, err := iavl.LoadStore(db, id, rs.lazyLoading) + var store types.CommitKVStore + var err error + + if params.initialVersion == 0 { + store, err = iavl.LoadStore(db, id, rs.lazyLoading) + } else { + store, err = iavl.LoadStoreWithInitialVersion(db, id, rs.lazyLoading, params.initialVersion) + } + if err != nil { return nil, err } @@ -868,9 +883,10 @@ func (rs *Store) buildCommitInfo(version int64) *types.CommitInfo { } type storeParams struct { - key types.StoreKey - db dbm.DB - typ types.StoreType + key types.StoreKey + db dbm.DB + typ types.StoreType + initialVersion uint64 } func getLatestVersion(db dbm.DB) int64 { diff --git a/store/rootmulti/store_test.go b/store/rootmulti/store_test.go index 7341154f2e..efe2618779 100644 --- a/store/rootmulti/store_test.go +++ b/store/rootmulti/store_test.go @@ -79,9 +79,9 @@ func TestCacheMultiStoreWithVersion(t *testing.T) { cID := ms.Commit() require.Equal(t, int64(1), cID.Version) - // require failure when given an invalid or pruned version + // require no failure when given an invalid or pruned version _, err = ms.CacheMultiStoreWithVersion(cID.Version + 1) - require.Error(t, err) + require.NoError(t, err) // require a valid version can be cache-loaded cms, err := ms.CacheMultiStoreWithVersion(cID.Version) @@ -192,6 +192,9 @@ func TestMultistoreLoadWithUpgrade(t *testing.T) { require.NotNil(t, s3) s3.Set(k3, v3) + s4, _ := store.getStoreByName("store4").(types.KVStore) + require.Nil(t, s4) + // do one commit commitID := store.Commit() expectedCommitID := getExpectedCommitID(store, 1) @@ -231,6 +234,24 @@ func TestMultistoreLoadWithUpgrade(t *testing.T) { require.NotNil(t, s3) require.Nil(t, s3.Get(k3)) // data was deleted + // store4 is mounted, with empty data + s4, _ = restore.getStoreByName("store4").(types.KVStore) + require.NotNil(t, s4) + + iterator := s4.Iterator(nil, nil) + + values := 0 + for ; iterator.Valid(); iterator.Next() { + values += 1 + } + require.Zero(t, values) + + require.NoError(t, iterator.Close()) + + // write something inside store4 + k4, v4 := []byte("fourth"), []byte("created") + s4.Set(k4, v4) + // store2 is no longer mounted st2 := restore.getStoreByName("store2") require.Nil(t, st2) @@ -258,12 +279,16 @@ func TestMultistoreLoadWithUpgrade(t *testing.T) { require.NotNil(t, rl2) require.Equal(t, v2, rl2.Get(k2)) + rl4, _ := reload.getStoreByName("store4").(types.KVStore) + require.NotNil(t, rl4) + require.Equal(t, v4, rl4.Get(k4)) + // check commitInfo in storage ci, err = getCommitInfo(db, 2) require.NoError(t, err) require.Equal(t, int64(2), ci.Version) - require.Equal(t, 3, len(ci.StoreInfos), ci.StoreInfos) - checkContains(t, ci.StoreInfos, []string{"store1", "restore2", "store3"}) + require.Equal(t, 4, len(ci.StoreInfos), ci.StoreInfos) + checkContains(t, ci.StoreInfos, []string{"store1", "restore2", "store3", "store4"}) } func TestParsePath(t *testing.T) { @@ -474,7 +499,7 @@ func TestMultiStore_Pruning(t *testing.T) { for _, v := range tc.deleted { _, err := ms.CacheMultiStoreWithVersion(v) - require.Error(t, err, "expected error when loading height: %d", v) + require.NoError(t, err, "expected error when loading height: %d", v) } }) } @@ -510,7 +535,7 @@ func TestMultiStore_PruningRestart(t *testing.T) { for _, v := range pruneHeights { _, err := ms.CacheMultiStoreWithVersion(v) - require.Error(t, err, "expected error when loading height: %d", v) + require.NoError(t, err, "expected error when loading height: %d", v) } } @@ -796,8 +821,10 @@ func newMultiStoreWithModifiedMounts(db dbm.DB, pruningOpts types.PruningOptions store.MountStoreWithDB(types.NewKVStoreKey("store1"), types.StoreTypeIAVL, nil) store.MountStoreWithDB(types.NewKVStoreKey("restore2"), types.StoreTypeIAVL, nil) store.MountStoreWithDB(types.NewKVStoreKey("store3"), types.StoreTypeIAVL, nil) + store.MountStoreWithDB(types.NewKVStoreKey("store4"), types.StoreTypeIAVL, nil) upgrades := &types.StoreUpgrades{ + Added: []string{"store4"}, Renamed: []types.StoreRename{{ OldKey: "store2", NewKey: "restore2", diff --git a/store/types/store.go b/store/types/store.go index 989ae94e8c..f78fcad3f4 100644 --- a/store/types/store.go +++ b/store/types/store.go @@ -9,6 +9,7 @@ import ( snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" "github.com/cosmos/cosmos-sdk/types/kv" + tmstrings "github.com/tendermint/tendermint/libs/strings" ) type Store interface { @@ -44,6 +45,7 @@ type Queryable interface { // StoreUpgrades defines a series of transformations to apply the multistore db upon load type StoreUpgrades struct { + Added []string `json:"added"` Renamed []StoreRename `json:"renamed"` Deleted []string `json:"deleted"` } @@ -63,6 +65,14 @@ type StoreRename struct { NewKey string `json:"new_key"` } +// IsDeleted returns true if the given key should be added +func (s *StoreUpgrades) IsAdded(key string) bool { + if s == nil { + return false + } + return tmstrings.StringInSlice(key, s.Added) +} + // IsDeleted returns true if the given key should be deleted func (s *StoreUpgrades) IsDeleted(key string) bool { if s == nil { From 36c1b24a062594b8928d95ab78e408bc49fdd1d8 Mon Sep 17 00:00:00 2001 From: Jack Zampolin Date: Tue, 13 Oct 2020 12:51:47 -0600 Subject: [PATCH 20/84] ADR 32: Typed Events (#7474) --- docs/architecture/README.md | 2 + docs/architecture/adr-032-typed-events.md | 319 ++++++++++++++++++++++ 2 files changed, 321 insertions(+) create mode 100644 docs/architecture/adr-032-typed-events.md diff --git a/docs/architecture/README.md b/docs/architecture/README.md index a2bce8f771..9a401c17e3 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -56,3 +56,5 @@ Please add a entry below in your Pull Request for an ADR. - [ADR 027: Deterministic Protobuf Serialization](./adr-027-deterministic-protobuf-serialization.md) - [ADR 029: Fee Grant Module](./adr-029-fee-grant-module.md) - [ADR 031: Protobuf Msg Services](./adr-031-msg-service.md) +- [ADR 032: Typed Events](./adr-031-typed-events.md) + diff --git a/docs/architecture/adr-032-typed-events.md b/docs/architecture/adr-032-typed-events.md new file mode 100644 index 0000000000..33758900d4 --- /dev/null +++ b/docs/architecture/adr-032-typed-events.md @@ -0,0 +1,319 @@ +# ADR 032: Typed Events + +## Changelog + +- 28-Sept-2020: Initial Draft + +## Authors + +- Anil Kumar (@anilcse) +- Jack Zampolin (@jackzampolin) +- Adam Bozanich (@boz) + +## Status + +Proposed + +## Abstract + +Currently in the SDK, events are defined in the handlers for each message as well as `BeginBlock` and `EndBlock`. Each module doesn't have types defined for each event, they are implemented as `map[string]string`. Above all else this makes these events difficult to consume as it requires a great deal of raw string matching and parsing. This proposal focuses on updating the events to use **typed events** defined in each module such that emiting and subscribing to events will be much easier. This workflow comes from the experience of the Akash Network team. + +## Context + +Currently in the SDK, events are defined in the handlers for each message, meaning each module doesn't have a cannonical set of types for each event. Above all else this makes these events difficult to consume as it requires a great deal of raw string matching and parsing. This proposal focuses on updating the events to use **typed events** defined in each module such that emiting and subscribing to events will be much easier. This workflow comes from the experience of the Akash Network team. + +[Our platform](http://github.com/ovrclk/akash) requires a number of programatic on chain interactions both on the provider (datacenter - to bid on new orders and listen for leases created) and user (application developer - to send the app manifest to the provider) side. In addition the Akash team is now maintaining the IBC [`relayer`](https://github.com/ovrclk/relayer), another very event driven process. In working on these core pieces of infrastructure, and integrating lessons learned from Kubernetes developement, our team has developed a standard method for defining and consuming typed events in SDK modules. We have found that it is extremely useful in building this type of event driven application. + +As the SDK gets used more extensively for apps like `peggy`, other peg zones, IBC, DeFi, etc... there will be an exploding demand for event driven applications to support new features desired by users. We propose upstreaming our findings into the SDK to enable all SDK applications to quickly and easily build event driven apps to aid their core application. Wallets, exchanges, explorers, and defi protocols all stand to benefit from this work. + +If this proposal is accepted, users will be able to build event driven SDK apps in go by just writing `EventHandler`s for their specific event types and passing them to `EventEmitters` that are defined in the SDK. + +The end of this proposal contains a detailed example of how to consume events after this refactor. + +This proposal is specifically about how to consume these events as a client of the blockchain, not for intermodule communication. + +## Decision + +__Step-1__: Implement additional functionality in the `types` package: `EmitTypedEvent` and `ParseTypedEvent` functions + +```go +// types/events.go + +// EmitTypedEvent takes typed event and emits converting it into sdk.Event +func (em *EventManager) EmitTypedEvent(event proto.Message) error { + evtType := proto.MessageName(event) + evtJSON, err := codec.ProtoMarshalJSON(event) + if err != nil { + return err + } + + var attrMap map[string]json.RawMessage + err = json.Unmarshal(evtJSON, &attrMap) + if err != nil { + return err + } + + var attrs []abci.EventAttribute + for k, v := range attrMap { + attrs = append(attrs, abci.EventAttribute{ + Key: []byte(k), + Value: v, + }) + } + + em.EmitEvent(Event{ + Type: evtType, + Attributes: attrs, + }) + + return nil +} + +// ParseTypedEvent converts abci.Event back to typed event +func ParseTypedEvent(event abci.Event) (proto.Message, error) { + concreteGoType := proto.MessageType(event.Type) + if concreteGoType == nil { + return nil, fmt.Errorf("failed to retrieve the message of type %q", event.Type) + } + + var value reflect.Value + if concreteGoType.Kind() == reflect.Ptr { + value = reflect.New(concreteGoType.Elem()) + } else { + value = reflect.Zero(concreteGoType) + } + + protoMsg, ok := value.Interface().(proto.Message) + if !ok { + return nil, fmt.Errorf("%q does not implement proto.Message", event.Type) + } + + attrMap := make(map[string]json.RawMessage) + for _, attr := range event.Attributes { + attrMap[string(attr.Key)] = attr.Value + } + + attrBytes, err := json.Marshal(attrMap) + if err != nil { + return nil, err + } + + err = jsonpb.Unmarshal(strings.NewReader(string(attrBytes)), protoMsg) + if err != nil { + return nil, err + } + + return protoMsg, nil +} +``` + +Here, the `EmitTypedEvent` is a method on `EventManager` which takes typed event as input and apply json serialization on it. Then it maps the JSON key/value pairs to `event.Attributes` and emits it in form of `sdk.Event`. `Event.Type` will be the type URL of the proto message. + +When we subscribe to emitted events on the tendermint websocket, they are emitted in the form of an `abci.Event`. `ParseTypedEvent` parses the event back to it's original proto message. + +__Step-2__: Add proto definitions for typed events for msgs in each module: + +For example, let's take `MsgSubmitProposal` of `gov` module and implement this event's type. + +```protobuf +// proto/cosmos/gov/v1beta1/gov.proto +// Add typed event definition + +package cosmos.gov.v1beta1; + +message EventSubmitProposal { + string from_address = 1; + uint64 proposal_id = 2; + TextProposal proposal = 3; +} +``` + +__Step-3__: Refactor event emission to use the typed event created and emit using `sdk.EmitTypedEvent`: + +```go +// x/gov/handler.go +func handleMsgSubmitProposal(ctx sdk.Context, keeper keeper.Keeper, msg types.MsgSubmitProposalI) (*sdk.Result, error) { + ... + types.Context.EventManager().EmitTypedEvent( + &EventSubmitProposal{ + FromAddress: fromAddress, + ProposalId: id, + Proposal: proposal, + }, + ) + ... +} +``` + +#### How to subscribe to these typed events in `Client` + +> NOTE: Full code example below + +Users will be able to subscribe using `client.Context.Client.Subscribe` and consume events which are emitted using `EventHandler`s. + +Akash Network has built a simple [`pubsub`](https://github.com/ovrclk/akash/blob/90d258caeb933b611d575355b8df281208a214f8/pubsub/bus.go#L20). This can be used to subscribe to `abci.Events` and [publish](https://github.com/ovrclk/akash/blob/90d258caeb933b611d575355b8df281208a214f8/events/publish.go#L21) them as typed events. + +Please see the below code sample for more detail on this flow looks for clients. + +## Consequences + +### Positive + +* Improves consistency of implementation for the events currently in the sdk +* Provides a much more ergonomic way to handle events and facilitates writing event driven applications +* This implementation will support a middleware ecosystem of `EventHandler`s + +### Negative + + +## Detailed code example of publishing events + +This ADR also proposes adding affordances to emit and consume these events. This way developers will only need to write +`EventHandler`s which define the actions they desire to take. + +```go +// EventEmitter is a type that describes event emitter functions +// This should be defined in `types/events.go` +type EventEmitter func(context.Context, client.Context, ...EventHandler) error + +// EventHandler is a type of function that handles events coming out of the event bus +// This should be defined in `types/events.go` +type EventHandler func(proto.Message) error + +// Sample use of the functions below +func main() { + ctx, cancel := context.WithCancel(context.Background()) + + if err := TxEmitter(ctx, client.Context{}.WithNodeURI("tcp://localhost:26657"), SubmitProposalEventHandler); err != nil { + cancel() + panic(err) + } + + return +} + +// SubmitProposalEventHandler is an example of an event handler that prints proposal details +// when any EventSubmitProposal is emitted. +func SubmitProposalEventHandler(ev proto.Message) (err error) { + switch event := ev.(type) { + // Handle governance proposal events creation events + case govtypes.EventSubmitProposal: + // Users define business logic here e.g. + fmt.Println(ev.FromAddress, ev.ProposalId, ev.Proposal) + return nil + default: + return nil + } +} + +// TxEmitter is an example of an event emitter that emits just transaction events. This can and +// should be implemented somewhere in the SDK. The SDK can include an EventEmitters for tm.event='Tx' +// and/or tm.event='NewBlock' (the new block events may contain typed events) +func TxEmitter(ctx context.Context, cliCtx client.Context, ehs ...EventHandler) (err error) { + // Instantiate and start tendermint RPC client + client, err := cliCtx.GetNode() + if err != nil { + return err + } + + if err = client.Start(); err != nil { + return err + } + + // Start the pubsub bus + bus := pubsub.NewBus() + defer bus.Close() + + // Initialize a new error group + eg, ctx := errgroup.WithContext(ctx) + + // Publish chain events to the pubsub bus + eg.Go(func() error { + return PublishChainTxEvents(ctx, client, bus, simapp.ModuleBasics) + }) + + // Subscribe to the bus events + subscriber, err := bus.Subscribe() + if err != nil { + return err + } + + // Handle all the events coming out of the bus + eg.Go(func() error { + var err error + for { + select { + case <-ctx.Done(): + return nil + case <-subscriber.Done(): + return nil + case ev := <-subscriber.Events(): + for _, eh := range ehs { + if err = eh(ev); err != nil { + break + } + } + } + } + return nil + }) + + return group.Wait() +} + +// PublishChainTxEvents events using tmclient. Waits on context shutdown signals to exit. +func PublishChainTxEvents(ctx context.Context, client tmclient.EventsClient, bus pubsub.Bus, mb module.BasicManager) (err error) { + // Subscribe to transaction events + txch, err := client.Subscribe(ctx, "txevents", "tm.event='Tx'", 100) + if err != nil { + return err + } + + // Unsubscribe from transaction events on function exit + defer func() { + err = client.UnsubscribeAll(ctx, "txevents") + }() + + // Use errgroup to manage concurrency + g, ctx := errgroup.WithContext(ctx) + + // Publish transaction events in a goroutine + g.Go(func() error { + var err error + for { + select { + case <-ctx.Done(): + break + case ed := <-ch: + switch evt := ed.Data.(type) { + case tmtypes.EventDataTx: + if !evt.Result.IsOK() { + continue + } + // range over events, parse them using the basic manager and + // send them to the pubsub bus + for _, abciEv := range events { + typedEvent, err := sdk.ParseTypedEvent(abciEv) + if err != nil { + return er + } + if err := bus.Publish(typedEvent); err != nil { + bus.Close() + return + } + continue + } + } + } + } + return err + }) + + // Exit on error or context cancelation + return g.Wait() +} +``` + +## References +- [Publish Custom Events via a bus](https://github.com/ovrclk/akash/blob/90d258caeb933b611d575355b8df281208a214f8/events/publish.go#L19-L58) +- [Consuming the events in `Client`](https://github.com/ovrclk/deploy/blob/bf6c633ab6c68f3026df59efd9982d6ca1bf0561/cmd/event-handlers.go#L57) From 2323f1ac0e9a69a0da6b43693061036134193464 Mon Sep 17 00:00:00 2001 From: Marko Date: Wed, 14 Oct 2020 08:20:52 +0200 Subject: [PATCH 21/84] tendermint: update sdk to rc5 (#7527) * update sdk to rc5 * Update baseapp/params.go Co-authored-by: Aleksandr Bezobchuk --- Makefile | 2 +- baseapp/params.go | 4 ++-- baseapp/params_test.go | 4 ++-- go.mod | 2 +- go.sum | 2 ++ server/export.go | 2 +- simapp/test_helpers.go | 2 +- third_party/proto/confio/proofs.proto | 1 - third_party/proto/tendermint/abci/types.proto | 20 +++++++++---------- .../proto/tendermint/types/evidence.proto | 12 +++++------ .../proto/tendermint/types/params.proto | 9 ++++----- .../proto/tendermint/types/types.proto | 11 +++------- 12 files changed, 33 insertions(+), 38 deletions(-) diff --git a/Makefile b/Makefile index e077ed22ac..28628f395a 100644 --- a/Makefile +++ b/Makefile @@ -387,7 +387,7 @@ proto-check-breaking-docker: @$(DOCKER_BUF) check breaking --against-input $(HTTPS_GIT)#branch=master .PHONY: proto-check-breaking-ci -TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/3359e0bf2f8414d9687f9eecda67b899d64a9cd1/proto/tendermint +TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0-rc5/proto/tendermint GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/v0.6.2 diff --git a/baseapp/params.go b/baseapp/params.go index 7b3ec6ff7d..9682afb31f 100644 --- a/baseapp/params.go +++ b/baseapp/params.go @@ -63,8 +63,8 @@ func ValidateEvidenceParams(i interface{}) error { return fmt.Errorf("evidence maximum age time duration must be positive: %v", v.MaxAgeDuration) } - if v.MaxNum <= 0 { - return fmt.Errorf("evidence maximum number of evidence must be positive: %v", v.MaxNum) + if v.MaxBytes < 0 { + return fmt.Errorf("maximum evidence bytes must be positive: %v", v.MaxBytes) } return nil diff --git a/baseapp/params_test.go b/baseapp/params_test.go index a78f132de4..2d8f8c1add 100644 --- a/baseapp/params_test.go +++ b/baseapp/params_test.go @@ -36,8 +36,8 @@ func TestValidateEvidenceParams(t *testing.T) { {nil, true}, {&tmproto.EvidenceParams{}, true}, {tmproto.EvidenceParams{}, true}, - {tmproto.EvidenceParams{MaxAgeNumBlocks: -1, MaxAgeDuration: 18004000, MaxNum: 50}, true}, - {tmproto.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: 18004000, MaxNum: 50}, false}, + {tmproto.EvidenceParams{MaxAgeNumBlocks: -1, MaxAgeDuration: 18004000, MaxBytes: 5000000}, true}, + {tmproto.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: 18004000, MaxBytes: 5000000}, false}, } for _, tc := range testCases { diff --git a/go.mod b/go.mod index 140b1c0836..aa334636f1 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/tendermint/btcd v0.1.1 github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 github.com/tendermint/go-amino v0.16.0 - github.com/tendermint/tendermint v0.34.0-rc4.0.20201005135527-d7d0ffea13c6 + github.com/tendermint/tendermint v0.34.0-rc5 github.com/tendermint/tm-db v0.6.2 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a golang.org/x/net v0.0.0-20200930145003-4acb6c075d10 // indirect diff --git a/go.sum b/go.sum index aec446a89c..b5cfec932c 100644 --- a/go.sum +++ b/go.sum @@ -593,6 +593,8 @@ github.com/tendermint/tendermint v0.34.0-rc3 h1:d7Fsd5rdbxq4GmJ0kRfx7l7LesQM7e70 github.com/tendermint/tendermint v0.34.0-rc3/go.mod h1:BoHcEpjfpBHc1Be7RQz3AHaXFNObcDG7SNHCev6Or4g= github.com/tendermint/tendermint v0.34.0-rc4.0.20201005135527-d7d0ffea13c6 h1:gqZ0WDpDYgMm/iaiMEXvI1nt/GoWCuwtBomVpUMiAIs= github.com/tendermint/tendermint v0.34.0-rc4.0.20201005135527-d7d0ffea13c6/go.mod h1:BSXqR6vWbOecet726v66qVwSkFDLfEeBrq+EhkKbij4= +github.com/tendermint/tendermint v0.34.0-rc5 h1:2bnQfWyOMfTCbol5pwB8CgM2nxi6/Kz6zqlS6Udm/Cg= +github.com/tendermint/tendermint v0.34.0-rc5/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= github.com/tendermint/tm-db v0.6.1 h1:w3X87itMPXopcRPlFiqspEKhw4FXihPk2rnFFkP0zGk= github.com/tendermint/tm-db v0.6.1/go.mod h1:m3x9kRP4UFd7JODJL0yBAZqE7wTw+S37uAE90cTx7OA= github.com/tendermint/tm-db v0.6.2 h1:DOn8jwCdjJblrCFJbtonEIPD1IuJWpbRUUdR8GWE4RM= diff --git a/server/export.go b/server/export.go index b5fccaf050..3ed41a6494 100644 --- a/server/export.go +++ b/server/export.go @@ -90,7 +90,7 @@ func ExportCmd(appExporter types.AppExporter, defaultNodeHome string) *cobra.Com Evidence: tmproto.EvidenceParams{ MaxAgeNumBlocks: exported.ConsensusParams.Evidence.MaxAgeNumBlocks, MaxAgeDuration: exported.ConsensusParams.Evidence.MaxAgeDuration, - MaxNum: exported.ConsensusParams.Evidence.MaxNum, + MaxBytes: exported.ConsensusParams.Evidence.MaxBytes, }, Validator: tmproto.ValidatorParams{ PubKeyTypes: exported.ConsensusParams.Validator.PubKeyTypes, diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index 8be599139b..6c9d146204 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -38,7 +38,7 @@ var DefaultConsensusParams = &abci.ConsensusParams{ Evidence: &tmproto.EvidenceParams{ MaxAgeNumBlocks: 302400, MaxAgeDuration: 504 * time.Hour, // 3 weeks is the max duration - MaxNum: 50, + MaxBytes: 10000, }, Validator: &tmproto.ValidatorParams{ PubKeyTypes: []string{ diff --git a/third_party/proto/confio/proofs.proto b/third_party/proto/confio/proofs.proto index da43503ecb..9dd39e614d 100644 --- a/third_party/proto/confio/proofs.proto +++ b/third_party/proto/confio/proofs.proto @@ -1,7 +1,6 @@ syntax = "proto3"; package ics23; -option go_package = "github.com/confio/ics23/go"; enum HashOp { // NO_HASH is the default if no data passed. Note this is an illegal argument some places. diff --git a/third_party/proto/tendermint/abci/types.proto b/third_party/proto/tendermint/abci/types.proto index 09b96f1ddf..2cbcabb29b 100644 --- a/third_party/proto/tendermint/abci/types.proto +++ b/third_party/proto/tendermint/abci/types.proto @@ -334,9 +334,9 @@ message TxResult { // Validator message Validator { - bytes address = 1; // The first 20 bytes of SHA256(public key) + bytes address = 1; // The first 20 bytes of SHA256(public key) // PubKey pub_key = 2 [(gogoproto.nullable)=false]; - int64 power = 3; // The voting power + int64 power = 3; // The voting power } // ValidatorUpdate @@ -352,19 +352,19 @@ message VoteInfo { } enum EvidenceType { - UNKNOWN = 0; - DUPLICATE_VOTE = 1; - LIGHT_CLIENT_ATTACK = 2; + UNKNOWN = 0; + DUPLICATE_VOTE = 1; + LIGHT_CLIENT_ATTACK = 2; } message Evidence { - EvidenceType type = 1; + EvidenceType type = 1; // The offending validator - Validator validator = 2 [(gogoproto.nullable) = false]; - // The height when the offense occurred - int64 height = 3; + Validator validator = 2 [(gogoproto.nullable) = false]; + // The height when the offense occurred + int64 height = 3; // The corresponding time where the offense occurred - google.protobuf.Timestamp time = 4 [ + google.protobuf.Timestamp time = 4 [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; diff --git a/third_party/proto/tendermint/types/evidence.proto b/third_party/proto/tendermint/types/evidence.proto index 3ff10c1b33..5f7d860bf4 100644 --- a/third_party/proto/tendermint/types/evidence.proto +++ b/third_party/proto/tendermint/types/evidence.proto @@ -4,28 +4,28 @@ package tendermint.types; option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; import "tendermint/types/types.proto"; -import "tendermint/crypto/keys.proto"; // DuplicateVoteEvidence contains evidence a validator signed two conflicting // votes. message DuplicateVoteEvidence { Vote vote_a = 1; Vote vote_b = 2; +} - google.protobuf.Timestamp timestamp = 3 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +message LightClientAttackEvidence { + LightBlock conflicting_block = 1; + int64 common_height = 2; } message Evidence { oneof sum { - DuplicateVoteEvidence duplicate_vote_evidence = 1; + DuplicateVoteEvidence duplicate_vote_evidence = 1; + LightClientAttackEvidence light_client_attack_evidence = 2; } } // EvidenceData contains any evidence of malicious wrong-doing by validators message EvidenceData { repeated Evidence evidence = 1 [(gogoproto.nullable) = false]; - bytes hash = 2; } diff --git a/third_party/proto/tendermint/types/params.proto b/third_party/proto/tendermint/types/params.proto index 897c07c17f..0de7d846fb 100644 --- a/third_party/proto/tendermint/types/params.proto +++ b/third_party/proto/tendermint/types/params.proto @@ -48,11 +48,10 @@ message EvidenceParams { google.protobuf.Duration max_age_duration = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; - // This sets the maximum number of evidence that can be committed in a single block. - // and should fall comfortably under the max block bytes when we consider the size of - // each evidence (See MaxEvidenceBytes). The maximum number is MaxEvidencePerBlock. - // Default is 50 - uint32 max_num = 3; + // This sets the maximum size of total evidence in bytes that can be committed in a single block. + // and should fall comfortably under the max block bytes. + // Default is 1048576 or 1MB + int64 max_bytes = 3; } // ValidatorParams restrict the public key types validators can use. diff --git a/third_party/proto/tendermint/types/types.proto b/third_party/proto/tendermint/types/types.proto index 2762f4a785..7f7ea74cac 100644 --- a/third_party/proto/tendermint/types/types.proto +++ b/third_party/proto/tendermint/types/types.proto @@ -5,7 +5,6 @@ option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; -import "tendermint/libs/bits/types.proto"; import "tendermint/crypto/proof.proto"; import "tendermint/version/types.proto"; import "tendermint/types/validator.proto"; @@ -26,13 +25,13 @@ enum SignedMsgType { option (gogoproto.goproto_enum_stringer) = true; option (gogoproto.goproto_enum_prefix) = false; - SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"]; + SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"]; // Votes SIGNED_MSG_TYPE_PREVOTE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"]; SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"]; // Proposals - SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"]; + SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"]; } // PartsetHeader @@ -88,8 +87,6 @@ message Data { // NOTE: not all txs here are valid. We're just agreeing on the order first. // This means that block.AppHash does not include these txs. repeated bytes txs = 1; - // Volatile - bytes hash = 2; } // Vote represents a prevote, precommit, or commit vote from validators for @@ -113,8 +110,6 @@ message Commit { int32 round = 2; BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; repeated CommitSig signatures = 4 [(gogoproto.nullable) = false]; - bytes hash = 5; - tendermint.libs.bits.BitArray bit_array = 6; } // CommitSig is a part of the Vote included in a Commit. @@ -144,7 +139,7 @@ message SignedHeader { message LightBlock { SignedHeader signed_header = 1; - tendermint.types.ValidatorSet validator_set = 2; + tendermint.types.ValidatorSet validator_set = 2; } message BlockMeta { From 080fcf1df25ccdf97f3029b6b6f83caaf5a235e4 Mon Sep 17 00:00:00 2001 From: Cory Date: Wed, 14 Oct 2020 01:55:22 -0700 Subject: [PATCH 22/84] Update changelog on master (from v0.40.x branch) (#7528) * pull updated changelog from v0.40.x branch into master * add link for v0.40.0-rc0 * merge recent changelog entries from master Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- CHANGELOG.md | 576 ++++++++++++++++++++++++++------------------------- 1 file changed, 292 insertions(+), 284 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 231d3ceda9..26ecaceffe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,6 @@ Types of changes (Stanzas): "Client Breaking" for breaking CLI commands and REST routes used by end-users. "API Breaking" for breaking exported APIs used by developers building on SDK. "State Machine Breaking" for any changes that result in a different AppState given same genesisState and txList. - Ref: https://keepachangelog.com/en/1.0.0/ --> @@ -39,300 +38,309 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Client Breaking -* (modules) [\#7243](https://github.com/cosmos/cosmos-sdk/pull/7243) Rename `RegisterCodec` to `RegisterLegacyAminoCodec` and `codec.New()` is now renamed to `codec.NewLegacyAmino()` -* (cli) [\#6651](https://github.com/cosmos/cosmos-sdk/pull/6651) The `gentx` command has been improved. No longer are `--from` and `--name` flags required. Instead, a single argument, `name`, is required which refers to the key pair in the Keyring. In addition, an optional - `--moniker` flag can be provided to override the moniker found in `config.toml`. -* (api) [\#6426](https://github.com/cosmos/cosmos-sdk/pull/6426) The ability to start an out-of-process API REST server has now been removed. Instead, the API server is now started in-process along with the application and Tendermint. Configuration options have been added to `app.toml` to enable/disable the API server along with additional HTTP server options. -* (baseapp) [\#6384](https://github.com/cosmos/cosmos-sdk/pull/6384) The `Result.Data` is now a Protocol Buffer encoded binary blob of type `TxData`. The `TxData` contains `Data` which contains a list of Protocol Buffer encoded message data and the corresponding message type. -* (x/gov) [#6295](https://github.com/cosmos/cosmos-sdk/pull/6295) Fix typo in querying governance params. -* (x/auth) [\#6054](https://github.com/cosmos/cosmos-sdk/pull/6054) Remove custom JSON marshaling for base accounts as multsigs cannot be bech32 decoded. -* (modules) [\#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) The `/bank/balances/{address}` endpoint now returns all account -balances or a single balance by denom when the `denom` query parameter is present. -* (client) [\#5640](https://github.com/cosmos/cosmos-sdk/pull/5640) The rest server endpoint `/swagger-ui/` is replaced by ´/´. -* (x/auth) [\#5702](https://github.com/cosmos/cosmos-sdk/pull/5702) The `x/auth` querier route has changed from `"acc"` to `"auth"`. -* (store/rootmulti) [\#6390](https://github.com/cosmos/cosmos-sdk/pull/6390) Proofs of empty stores are no longer supported. -* (store/types) [\#5730](https://github.com/cosmos/cosmos-sdk/pull/5730) store.types.Cp() is removed in favour of types.CopyBytes(). -* (client) [\#5640](https://github.com/cosmos/cosmos-sdk/issues/5783) Unify all coins representations on JSON client requests for governance proposals. -* [\#5785](https://github.com/cosmos/cosmos-sdk/issues/5785) JSON strings coerced to valid UTF-8 bytes at JSON marshalling time -are now replaced by human-readable expressions. This change can potentially break compatibility with all those client side tools -that parse log messages. -* (client) [\#5799](https://github.com/cosmos/cosmos-sdk/pull/5799) The `tx encode/decode` commands, due to change on encoding break compatibility with -older clients. -* (x/auth) [\#5844](https://github.com/cosmos/cosmos-sdk/pull/5844) `tx sign` command now returns an error when signing is attempted with offline/multisig keys. -* (x/auth) [\#6108](https://github.com/cosmos/cosmos-sdk/pull/6108) `tx sign` command's `--validate-signatures` flag is migrated into a `tx validate-signatures` standalone command. -* (client/keys) [\#5889](https://github.com/cosmos/cosmos-sdk/pull/5889) Remove `keys update` command. -* (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove CLI and REST handlers for querying `x/evidence` parameters. -* (server) [\#5982](https://github.com/cosmos/cosmos-sdk/pull/5982) `--pruning` now must be set to `custom` if you want to customise the granular options. -* (x/gov) [\#7000](https://github.com/cosmos/cosmos-sdk/pull/7000) [\#6859](https://github.com/cosmos/cosmos-sdk/pull/6859) `ProposalStatus` and `VoteOption` are now JSON serialized using its protobuf name, so expect names like `PROPOSAL_STATUS_DEPOSIT_PERIOD` as opposed to `DepositPeriod`. -* (x/auth/vesting) [\#6859](https://github.com/cosmos/cosmos-sdk/pull/6859) Custom JSON marshaling of vesting accounts was removed. Vesting accounts are now marshaled using their default proto or amino JSON representation. * (x/staking) [\#7499](https://github.com/cosmos/cosmos-sdk/pull/7499) `BondStatus` is now a protobuf `enum` instead of an `int32`, and JSON serialized using its protobuf name, so expect names like `BOND_STATUS_UNBONDING` as opposed to `Unbonding`. -### API Breaking Changes - -* (x/bank) [\#7327](https://github.com/cosmos/cosmos-sdk/pull/7327) AddCoins and SubtractCoins no longer return a resultingValue and will only return an error. -* (x/evidence) [\#7251](https://github.com/cosmos/cosmos-sdk/pull/7251) New evidence types and light client evidence handling. The module function names changed. -* (modules) [\#6564](https://github.com/cosmos/cosmos-sdk/pull/6564) Constant `DefaultParamspace` is removed from all modules, use ModuleName instead. -* (client) [\#6525](https://github.com/cosmos/cosmos-sdk/pull/6525) Removed support for `indent` in JSON responses. Clients should consider piping to an external tool such as `jq`. -* (x/staking) [\#6451](https://github.com/cosmos/cosmos-sdk/pull/6451) `DefaultParamspace` and `ParamKeyTable` in staking module are moved from keeper to types to enforce consistency. -* [\#6409](https://github.com/cosmos/cosmos-sdk/pull/6409) Rename all IsEmpty methods to Empty across the codebase and enforce consistency. -* [\#6231](https://github.com/cosmos/cosmos-sdk/pull/6231) Simplify `AppModule` interface, `Route` and `NewHandler` methods become only `Route` -and returns a new `Route` type. -* [\#6212](https://github.com/cosmos/cosmos-sdk/pull/6212) Remove `Get*` prefixes from key construction functions -* [\#6079](https://github.com/cosmos/cosmos-sdk/pull/6079) Remove `UpgradeOldPrivValFile` (deprecated in Tendermint Core v0.28). -* (modules) [\#5664](https://github.com/cosmos/cosmos-sdk/pull/5664) Remove amino `Codec` from simulation `StoreDecoder`, which now returns a function closure in order to unmarshal the key-value pairs. -* (x/auth) [\#6029](https://github.com/cosmos/cosmos-sdk/pull/6029) Module accounts have been moved from `x/supply` to `x/auth`. -* (x/supply) [\#6010](https://github.com/cosmos/cosmos-sdk/pull/6010) All `x/supply` types and APIs have been moved to `x/bank`. -* (baseapp) [\#5865](https://github.com/cosmos/cosmos-sdk/pull/5865) The `SimulationResponse` returned from tx simulation is now JSON encoded instead of Amino binary. -* [\#5719](https://github.com/cosmos/cosmos-sdk/pull/5719) Bump Go requirement to 1.14+ -* (x/params) [\#5619](https://github.com/cosmos/cosmos-sdk/pull/5619) The `x/params` keeper now accepts a `codec.Marshaller` instead of -a reference to an amino codec. Amino is still used for JSON serialization. -* (types) [\#5579](https://github.com/cosmos/cosmos-sdk/pull/5579) The `keepRecent` field has been removed from the `PruningOptions` type. -The `PruningOptions` type now only includes fields `KeepEvery` and `SnapshotEvery`, where `KeepEvery` -determines which committed heights are flushed to disk and `SnapshotEvery` determines which of these -heights are kept after pruning. The `IsValid` method should be called whenever using these options. Methods -`SnapshotVersion` and `FlushVersion` accept a version arugment and determine if the version should be -flushed to disk or kept as a snapshot. Note, `KeepRecent` is automatically inferred from the options -and provided directly the IAVL store. -* (modules) [\#5555](https://github.com/cosmos/cosmos-sdk/pull/5555) Move `x/auth/client/utils/` types and functions to `x/auth/client/`. -* (modules) [\#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) Move account balance logic and APIs from `x/auth` to `x/bank`. -* (types) [\#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Refactored `AppModuleBasic` and `AppModuleGenesis` -to now accept a `codec.JSONMarshaler` for modular serialization of genesis state. -* (types/rest) [\#5779](https://github.com/cosmos/cosmos-sdk/pull/5779) Drop unused Parse{Int64OrReturnBadRequest,QueryParamBool}() functions. -* (keys) [\#5820](https://github.com/cosmos/cosmos-sdk/pull/5820/) Removed method CloseDB from Keybase interface. -* (client/input) [\#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) Removal of unnecessary `GetCheckPassword`, `PrintPrefixed` functions. -* (client/keys) [\#5889](https://github.com/cosmos/cosmos-sdk/pull/5889) Rename `NewKeyBaseFromDir()` -> `NewLegacyKeyBaseFromDir()`. -* (crypto) [\#5880](https://github.com/cosmos/cosmos-sdk/pull/5880) Merge `crypto/keys/mintkey` into `crypto`. -* (crypto/hd) [\#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) `crypto/keys/hd` moved to `crypto/hd`. -* (crypto/keyring): - * [\#5866](https://github.com/cosmos/cosmos-sdk/pull/5866) Rename `crypto/keys/` to `crypto/keyring/`. - * [\#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) `Keybase` -> `Keyring` interfaces migration. `LegacyKeybase` interface is added in order -to guarantee limited backward compatibility with the old Keybase interface for the sole purpose of migrating keys across the new keyring backends. `NewLegacy` -constructor is provided [\#5889](https://github.com/cosmos/cosmos-sdk/pull/5889) to allow for smooth migration of keys from the legacy LevelDB based implementation -to new keyring backends. Plus, the package and the new keyring no longer depends on the sdk.Config singleton. Please consult the package documentation for more -information on how to implement the new `Keyring` interface. - * [\#5858](https://github.com/cosmos/cosmos-sdk/pull/5858) Make Keyring store keys by name and address's hexbytes representation. -* (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove APIs for getting and setting `x/evidence` parameters. `BaseApp` now uses a `ParamStore` to manage Tendermint consensus parameters which is managed via the `x/params` `Substore` type. -* (export) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) `AppExporter` now returns ABCI consensus parameters to be included in marshaled exported state. These parameters must be returned from the application via the `BaseApp`. -* (codec) `*codec.LegacyAmino` is now a wrapper around Amino which provides backwards compatibility with protobuf `Any`. -ALL legacy code should use `*codec.LegacyAmino` instead of `*amino.Codec` directly -* (x/gov) [\#6147](https://github.com/cosmos/cosmos-sdk/pull/6147) The `Content` field on `Proposal` and `MsgSubmitProposal` -is now `Any` in concordance with [ADR 019](docs/architecture/adr-019-protobuf-state-encoding.md) and `GetContent` should now -be used to retrieve the actual proposal `Content`. Also the `NewMsgSubmitProposal` constructor now may return an `error` -* (modules) [\#5989](https://github.com/cosmos/cosmos-sdk/pull/5989) `AppModuleBasic.GetTxCmd` now takes a single `CLIContext` parameter. -* (x/auth) [\#7006](https://github.com/cosmos/cosmos-sdk/pull/7006) All `AccountRetriever` methods now take `client.Context` as a parameter instead of as a struct member. -* (x/auth) [\#6270](https://github.com/cosmos/cosmos-sdk/pull/6270) The passphrase argument has been removed from the signature of the following functions and methods: - - BuildAndSign - - MakeSignature - - SignStdTx - - TxBuilder.BuildAndSign - - TxBuilder.Sign - - TxBuilder.SignStdTx -* (client) [\#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `CLIContext` is renamed to `Context`. `Context` and all related methods have been moved from package context to client. -* (modules) [\#6326](https://github.com/cosmos/cosmos-sdk/pull/6326) `AppModuleBasic.GetQueryCmd` now takes a single `CLIContext` parameter. -* (modules) [\#6336](https://github.com/cosmos/cosmos-sdk/pull/6336) `AppModuleBasic.RegisterQueryService` method was added to support gRPC queries, and `QuerierRoute` and `NewQuerierHandler` were deprecated. -* (modules) [\#6311](https://github.com/cosmos/cosmos-sdk/issues/6311) Remove `alias.go` usage -* (x/auth) [\#6443](https://github.com/cosmos/cosmos-sdk/issues/6443) Move `FeeTx` and `TxWithMemo` interfaces from `x/auth/ante` to `types`. -* (modules) [\#6447](https://github.com/cosmos/cosmos-sdk/issues/6447) Rename `blacklistedAddrs` to `blockedAddrs`. - - Migration guide: - - ```go - cliCtx := context.CLIContext{} - ``` - - Now becomes: - - ```go - clientCtx = client.Context{} - ``` -* (client/rpc) [\#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `RegisterRoutes` of rpc is moved from package client to client/rpc and client/rpc.RegisterRPCRoutes is removed. -* (client/lcd) [\#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `CliCtx` of struct `RestServer` in package client/lcd has been renamed to `ClientCtx`. -* (types) [\#6327](https://github.com/cosmos/cosmos-sdk/pull/6327) `sdk.Msg` now inherits `proto.Message`, as a result all `sdk.Msg` types now use pointer semantics. -* (codec) [\#6330](https://github.com/cosmos/cosmos-sdk/pull/6330) `codec.RegisterCrypto` has been moved to the `crypto/codec` package and the global `codec.Cdc` Amino instance has been deprecated and moved to the `codec/legacy_global` package. -* (x/ibc) [\#6374](https://github.com/cosmos/cosmos-sdk/pull/6374) `VerifyMembership` and `VerifyNonMembership` now take a `specs []string` argument to specify the proof format used for verification. Most SDK chains can simply use `commitmenttypes.GetSDKSpecs()` for this argument. -* (crypto/types/multisig) [\#6373](https://github.com/cosmos/cosmos-sdk/pull/6373) `multisig.Multisignature` has been renamed to `AminoMultisignature` -* (x/auth) [\#6428](https://github.com/cosmos/cosmos-sdk/issues/6428): - * `NewAnteHandler` and `NewSigVerificationDecorator` both now take a `SignModeHandler` parameter. - * `SignatureVerificationGasConsumer` now has the signature: `func(meter sdk.GasMeter, sig signing.SignatureV2, params types.Params) error`. - * The `SigVerifiableTx` interface now has a `GetSignaturesV2() ([]signing.SignatureV2, error)` method and no longer has the `GetSignBytes` method. -* (client/flags) [\#6632](https://github.com/cosmos/cosmos-sdk/pull/6632) Remove NewCompletionCmd(), the function is now available in tendermint. -* (crypto) [\#6780](https://github.com/cosmos/cosmos-sdk/issues/6780) Move ledger code to its own package. -* (modules) [\#6834](https://github.com/cosmos/cosmos-sdk/issues/6834) Add `RegisterInterfaces` method to `AppModuleBasic` to support registration of protobuf interface types. -* (modules) [\#6734](https://github.com/cosmos/cosmos-sdk/issues/6834) Add `TxEncodingConfig` parameter to `AppModuleBasic.ValidateGenesis` command to support JSON tx decoding in `genutil`. -* (genesis) [\#7000](https://github.com/cosmos/cosmos-sdk/pull/7000) The root `GenesisState` is now decoded using `encoding/json` instead of amino so `int64` and `uint64` types are now encoded as integers as opposed to strings. -* (types) [\#7032](https://github.com/cosmos/cosmos-sdk/pull/7032) All types ending with `ID` (e.g. `ProposalID`) now end with `Id` (e.g. `ProposalId`), to match default Protobuf generated format. Also see [\#7033](https://github.com/cosmos/cosmos-sdk/pull/7033) for more details. -* (store) [\#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) The `store.CommitMultiStore` interface now includes the new `snapshots.Snapshotter` interface as well. - -### Features - -* [\#7485](https://github.com/cosmos/cosmos-sdk/pull/7485) Introduce a new optional `--keyring-dir` flag that allows clients to specify a Keyring directory if it does not reside in the directory specified by `--home`. -* [\#6755](https://github.com/cosmos/cosmos-sdk/pull/6755) Add custom regex validation for `Coin` denom by overwriting `CoinDenomRegex` when using `/types/coin.go`. -* [\#7265](https://github.com/cosmos/cosmos-sdk/pull/7265) Support Tendermint block pruning through a new `min-retain-blocks` configuration that can be set in either `app.toml` or via the CLI. This parameter is used in conjunction with other criteria to determine the height at which Tendermint should prune blocks. -* (vesting) [\#7209](https://github.com/cosmos/cosmos-sdk/pull/7209) Create new `MsgCreateVestingAccount` message type along with CLI handler that allows for the creation of delayed and continuous vesting types. -* (events) [\#7121](https://github.com/cosmos/cosmos-sdk/pull/7121) The application now drives what events are indexed by Tendermint via the `index-events` configuration in `app.toml`, which is a list of events taking the form `{eventType}.{attributeKey}`. -* [\#6089](https://github.com/cosmos/cosmos-sdk/pull/6089) Transactions can now have a `TimeoutHeight` set which allows the transaction to be rejected if it's committed at a height greater than the timeout. -* (tests) [\#6489](https://github.com/cosmos/cosmos-sdk/pull/6489) Introduce package `testutil`, new in-process testing network framework for use in integration and unit tests. -* (crypto/multisig) [\#6241](https://github.com/cosmos/cosmos-sdk/pull/6241) Add Multisig type directly to the repo. Previously this was in tendermint. -* (rest) [\#6167](https://github.com/cosmos/cosmos-sdk/pull/6167) Support `max-body-bytes` CLI flag for the REST service. -* (x/ibc) [\#5588](https://github.com/cosmos/cosmos-sdk/pull/5588) Add [ICS 024 - Host State Machine Requirements](https://github.com/cosmos/ics/tree/master/spec/ics-024-host-requirements) subpackage to `x/ibc` module. -* (baseapp) [\#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) Added support for taking state snapshots at regular height intervals, via options `snapshot-interval` and `snapshot-keep-recent`. -* (store) [\#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) Added `rootmulti.Store` methods for taking and restoring snapshots, based on `iavl.Store` export/import. -* (x/ibc) [\#5277](https://github.com/cosmos/cosmos-sdk/pull/5277) `x/ibc` changes from IBC alpha. For more details check the the [`x/ibc/core/spec`](https://github.com/cosmos/tree/master/x/ibc/core/spec) directory: - * [ICS 002 - Client Semantics](https://github.com/cosmos/ics/tree/master/spec/ics-002-client-semantics) subpackage - * [ICS 003 - Connection Semantics](https://github.com/cosmos/ics/blob/master/spec/ics-003-connection-semantics) subpackage - * [ICS 004 - Channel and Packet Semantics](https://github.com/cosmos/ics/blob/master/spec/ics-004-channel-and-packet-semantics) subpackage - * [ICS 005 - Port Allocation](https://github.com/cosmos/ics/blob/master/spec/ics-005-port-allocation) subpackage - * [ICS 007 - Tendermint Client](https://github.com/cosmos/ics/blob/master/spec/ics-007-tendermint-client) subpackage - * [ICS 020 - Fungible Token Transfer](https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer) module - * [ICS 023 - Vector Commitments](https://github.com/cosmos/ics/tree/master/spec/ics-023-vector-commitments) subpackage - * (x/capability) [\#5828](https://github.com/cosmos/cosmos-sdk/pull/5828) Capability module integration as outlined in [ADR 3 - Dynamic Capability Store](https://github.com/cosmos/tree/master/docs/architecture/adr-003-dynamic-capability-store.md). - * (x/params) [\#6005](https://github.com/cosmos/cosmos-sdk/pull/6005) Add new CLI command for querying raw x/params parameters by subspace and key. - * (x/ibc) [\#5769](https://github.com/cosmos/cosmos-sdk/pull/5769) [ICS 009 - Loopback Client](https://github.com/cosmos/ics/tree/master/spec/ics-009-loopback-client) subpackage -* (x/ibc) [\#6374](https://github.com/cosmos/cosmos-sdk/pull/6374) ICS-23 Verify functions will now accept and verify ics23 CommitmentProofs exclusively -* (store) [\#6324](https://github.com/cosmos/cosmos-sdk/pull/6324) IAVL store query proofs now return CommitmentOp which wraps an ics23 CommitmentProof -* (store) [\#6390](https://github.com/cosmos/cosmos-sdk/pull/6390) `RootMulti` store query proofs now return `CommitmentOp` which wraps `CommitmentProofs` - * `store.Query` now only returns chained `ics23.CommitmentProof` wrapped in `merkle.Proof` - * `ProofRuntime` only decodes and verifies `ics23.CommitmentProof` -* (x/auth) [\6350](https://github.com/cosmos/cosmos-sdk/pull/6350) New sign-batch command to sign StdTx batch files. - ### Bug Fixes -* (types) [\#7038](https://github.com/cosmos/cosmos-sdk/issues/7038) Fix infinite looping of `ApproxRoot` by including a hard-coded maximum iterations limit of 100. -* (simulation) [\#7129](https://github.com/cosmos/cosmos-sdk/issues/7129) Fix support for custom `Account` and key types on auth's simulation. -* (types) [\#7084](https://github.com/cosmos/cosmos-sdk/pull/7084) Fix panic when calling `BigInt()` on an uninitialized `Int`. -* (x/bank) [\#6536](https://github.com/cosmos/cosmos-sdk/pull/6536) Fix bug in `WriteGeneratedTxResponse` function used by multiple -REST endpoints. Now it writes a Tx in StdTx format. -* (x/staking) [\#6529](https://github.com/cosmos/cosmos-sdk/pull/6529) Export validator addresses (previously was empty). -* (export) [\#6510](https://github.com/cosmos/cosmos-sdk/pull/6510/) Field TimeIotaMs now is included in genesis file while exporting. -* (client) [\#6402](https://github.com/cosmos/cosmos-sdk/issues/6402) Fix `keys add` `--algo` flag which only worked for Tendermint's `secp256k1` default key signing algorithm. -* (x/staking) [\#6061](https://github.com/cosmos/cosmos-sdk/pull/6061) Allow a validator to immediately unjail when no signing info is present due to -falling below their minimum self-delegation and never having been bonded. The validator may immediately unjail once they've met their minimum self-delegation. -* (modules) [\#5569](https://github.com/cosmos/cosmos-sdk/issues/5569) `InitGenesis`, for the relevant modules, now ensures module accounts exist. -* (crypto/keyring) [\#5844](https://github.com/cosmos/cosmos-sdk/pull/5844) `Keyring.Sign()` methods no longer decode amino signatures when method receivers -are offline/multisig keys. -* (x/auth) [\#5892](https://github.com/cosmos/cosmos-sdk/pull/5892) Add `RegisterKeyTypeCodec` to register new -types (eg. keys) to the `auth` module internal amino codec. -* (rest) [\#5906](https://github.com/cosmos/cosmos-sdk/pull/5906) Fix an issue that make some REST calls panic when sending -invalid or incomplete requests. -* (x/genutil) [\#5938](https://github.com/cosmos/cosmos-sdk/pull/5938) Fix `InitializeNodeValidatorFiles` error handling. -* (x/staking) [\#5949](https://github.com/cosmos/cosmos-sdk/pull/5949) Skip staking `HistoricalInfoKey` in simulations as headers are not exported. -* (client) [\#5964](https://github.com/cosmos/cosmos-sdk/issues/5964) `--trust-node` is now false by default - for real. Users must ensure it is set to true if they don't want to enable the verifier. * (kvstore) [\#7415](https://github.com/cosmos/cosmos-sdk/pull/7415) Allow new stores to be registered during on-chain upgrades. + +## [v0.40.0-rc0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.40.0-rc0) - 2020-10-13 + +v0.40.0, known as the Stargate release of the Cosmos SDK, is one of the largest releases +of the Cosmos SDK since launch. Please read through this changelog and [release notes](./RELEASE_NOTES.md) to make sure you are aware of any relevant breaking changes. + +### Client Breaking Changes + +* __CLI__ + * (client/keys) [\#5889](https://github.com/cosmos/cosmos-sdk/pull/5889) remove `keys update` command. + * (x/auth) [\#5844](https://github.com/cosmos/cosmos-sdk/pull/5844) `tx sign` command now returns an error when signing is attempted with offline/multisig keys. + * (x/auth) [\#6108](https://github.com/cosmos/cosmos-sdk/pull/6108) `tx sign` command's `--validate-signatures` flag is migrated into a `tx validate-signatures` standalone command. + * (x/genutil) [\#6651](https://github.com/cosmos/cosmos-sdk/pull/6651) The `gentx` command has been improved. No longer are `--from` and `--name` flags required. Instead, a single argument, `name`, is required which refers to the key pair in the Keyring. In addition, an optional + `--moniker` flag can be provided to override the moniker found in `config.toml`. +* __REST / Queriers__ + * (api) [\#6426](https://github.com/cosmos/cosmos-sdk/pull/6426) The ability to start an out-of-process API REST server has now been removed. Instead, the API server is now started in-process along with the application and Tendermint. Configuration options have been added to `app.toml` to enable/disable the API server along with additional HTTP server options. + * (client) [\#7246](https://github.com/cosmos/cosmos-sdk/pull/7246) The rest server endpoint `/swagger-ui/` is replaced by `/swagger/`, and contains swagger documentation for gRPC Gateway routes in addition to legacy REST routes. Swagger API is exposed only if set in `app.toml`. + * (x/auth) [\#5702](https://github.com/cosmos/cosmos-sdk/pull/5702) The `x/auth` querier route has changed from `"acc"` to `"auth"`. + * (x/bank) [\#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) The `/bank/balances/{address}` endpoint now returns all account balances or a single balance by denom when the `denom` query parameter is present. + * (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove CLI and REST handlers for querying `x/evidence` parameters. + * (x/gov) [#6295](https://github.com/cosmos/cosmos-sdk/pull/6295) Fix typo in querying governance params. +* __General__ + * (baseapp) [\#6384](https://github.com/cosmos/cosmos-sdk/pull/6384) The `Result.Data` is now a Protocol Buffer encoded binary blob of type `TxData`. The `TxData` contains `Data` which contains a list of Protocol Buffer encoded message data and the corresponding message type. + * (client) [\#5783](https://github.com/cosmos/cosmos-sdk/issues/5783) Unify all coins representations on JSON client requests for governance proposals. + * (store/rootmulti) [\#6390](https://github.com/cosmos/cosmos-sdk/pull/6390) Proofs of empty stores are no longer supported. + * (store/types) [\#5730](https://github.com/cosmos/cosmos-sdk/pull/5730) store.types.Cp() is removed in favour of types.CopyBytes(). + * (x/auth) [\#6054](https://github.com/cosmos/cosmos-sdk/pull/6054) Remove custom JSON marshaling for base accounts as multsigs cannot be bech32 decoded. + * (x/auth/vesting) [\#6859](https://github.com/cosmos/cosmos-sdk/pull/6859) Custom JSON marshaling of vesting accounts was removed. Vesting accounts are now marshaled using their default proto or amino JSON representation. + * (x/bank) [\#5785](https://github.com/cosmos/cosmos-sdk/issues/5785) In x/bank errors, JSON strings coerced to valid UTF-8 bytes at JSON marshalling time + are now replaced by human-readable expressions. This change can potentially break compatibility with all those client side tools + that parse log messages. + * (x/gov) [\#6859](https://github.com/cosmos/cosmos-sdk/pull/6859) `ProposalStatus` and `VoteOption` are now JSON serialized using its protobuf name, so expect names like `PROPOSAL_STATUS_DEPOSIT_PERIOD` as opposed to `DepositPeriod`. + +### API Breaking Changes + +* __Baseapp / Client__ + * (baseapp) [\#5865](https://github.com/cosmos/cosmos-sdk/pull/5865) The `SimulationResponse` returned from tx simulation is now JSON encoded instead of Amino binary. + * (client) [\#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `CLIContext` is renamed to `Context`. `Context` and all related methods have been moved from package context to client. + * (client) [\#6525](https://github.com/cosmos/cosmos-sdk/pull/6525) Removed support for `indent` in JSON responses. Clients should consider piping to an external tool such as `jq`. + * (client/flags) [\#6632](https://github.com/cosmos/cosmos-sdk/pull/6632) Remove NewCompletionCmd(), the function is now available in tendermint. + * (client/input) [\#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) Removal of unnecessary `GetCheckPassword`, `PrintPrefixed` functions. + * (client/keys) [\#5889](https://github.com/cosmos/cosmos-sdk/pull/5889) Rename `NewKeyBaseFromDir()` -> `NewLegacyKeyBaseFromDir()`. + * (client/keys) [\#5820](https://github.com/cosmos/cosmos-sdk/pull/5820/) Removed method CloseDB from Keybase interface. + * (client/rpc) [\#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `client` package and subdirs reorganization. + * (client/lcd) [\#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `CliCtx` of struct `RestServer` in package client/lcd has been renamed to `ClientCtx`. + * (codec) [\#6330](https://github.com/cosmos/cosmos-sdk/pull/6330) `codec.RegisterCrypto` has been moved to the `crypto/codec` package and the global `codec.Cdc` Amino instance has been deprecated and moved to the `codec/legacy_global` package. + * (crypto) [\#6780](https://github.com/cosmos/cosmos-sdk/issues/6780) Move ledger code to its own package. + * (crypto/types/multisig) [\#6373](https://github.com/cosmos/cosmos-sdk/pull/6373) `multisig.Multisignature` has been renamed to `AminoMultisignature` + * (codec) `*codec.LegacyAmino` is now a wrapper around Amino which provides backwards compatibility with protobuf `Any`. ALL legacy code should use `*codec.LegacyAmino` instead of `*amino.Codec` directly + * (crypto) [\#5880](https://github.com/cosmos/cosmos-sdk/pull/5880) Merge `crypto/keys/mintkey` into `crypto`. + * (crypto/hd) [\#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) `crypto/keys/hd` moved to `crypto/hd`. + * (crypto/keyring): + * [\#5866](https://github.com/cosmos/cosmos-sdk/pull/5866) Rename `crypto/keys/` to `crypto/keyring/`. + * [\#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) `Keybase` -> `Keyring` interfaces migration. `LegacyKeybase` interface is added in order + to guarantee limited backward compatibility with the old Keybase interface for the sole purpose of migrating keys across the new keyring backends. `NewLegacy` + constructor is provided [\#5889](https://github.com/cosmos/cosmos-sdk/pull/5889) to allow for smooth migration of keys from the legacy LevelDB based implementation + to new keyring backends. Plus, the package and the new keyring no longer depends on the sdk.Config singleton. Please consult the [package documentation](https://github.com/cosmos/cosmos-sdk/tree/master/crypto/keyring/doc.go) for more + information on how to implement the new `Keyring` interface. + * [\#5858](https://github.com/cosmos/cosmos-sdk/pull/5858) Make Keyring store keys by name and address's hexbytes representation. + * (export) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) `AppExporter` now returns ABCI consensus parameters to be included in marshaled exported state. These parameters must be returned from the application via the `BaseApp`. + * (store) [\#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) The `store.CommitMultiStore` interface now includes the new `snapshots.Snapshotter` interface as well. + * (types) [\#5579](https://github.com/cosmos/cosmos-sdk/pull/5579) The `keepRecent` field has been removed from the `PruningOptions` type. + The `PruningOptions` type now only includes fields `KeepEvery` and `SnapshotEvery`, where `KeepEvery` + determines which committed heights are flushed to disk and `SnapshotEvery` determines which of these + heights are kept after pruning. The `IsValid` method should be called whenever using these options. Methods + `SnapshotVersion` and `FlushVersion` accept a version arugment and determine if the version should be + flushed to disk or kept as a snapshot. Note, `KeepRecent` is automatically inferred from the options + and provided directly the IAVL store. + * (types) [\#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Refactored `AppModuleBasic` and `AppModuleGenesis` + to now accept a `codec.JSONMarshaler` for modular serialization of genesis state. + * (types/rest) [\#5779](https://github.com/cosmos/cosmos-sdk/pull/5779) Drop unused Parse{Int64OrReturnBadRequest,QueryParamBool}() functions. +* __Modules__ + * (modules) [\#7243](https://github.com/cosmos/cosmos-sdk/pull/7243) Rename `RegisterCodec` to `RegisterLegacyAminoCodec` and `codec.New()` is now renamed to `codec.NewLegacyAmino()` + * (modules) [\#6564](https://github.com/cosmos/cosmos-sdk/pull/6564) Constant `DefaultParamspace` is removed from all modules, use ModuleName instead. + * (modules) [\#5989](https://github.com/cosmos/cosmos-sdk/pull/5989) `AppModuleBasic.GetTxCmd` now takes a single `CLIContext` parameter. + * (modules) [\#5664](https://github.com/cosmos/cosmos-sdk/pull/5664) Remove amino `Codec` from simulation `StoreDecoder`, which now returns a function closure in order to unmarshal the key-value pairs. + * (modules) [\#5555](https://github.com/cosmos/cosmos-sdk/pull/5555) Move `x/auth/client/utils/` types and functions to `x/auth/client/`. + * (modules) [\#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) Move account balance logic and APIs from `x/auth` to `x/bank`. + * (modules) [\#6326](https://github.com/cosmos/cosmos-sdk/pull/6326) `AppModuleBasic.GetQueryCmd` now takes a single `client.Context` parameter. + * (modules) [\#6336](https://github.com/cosmos/cosmos-sdk/pull/6336) `AppModuleBasic.RegisterQueryService` method was added to support gRPC queries, and `QuerierRoute` and `NewQuerierHandler` were deprecated. + * (modules) [\#6311](https://github.com/cosmos/cosmos-sdk/issues/6311) Remove `alias.go` usage + * (modules) [\#6447](https://github.com/cosmos/cosmos-sdk/issues/6447) Rename `blacklistedAddrs` to `blockedAddrs`. + * (modules) [\#6834](https://github.com/cosmos/cosmos-sdk/issues/6834) Add `RegisterInterfaces` method to `AppModuleBasic` to support registration of protobuf interface types. + * (modules) [\#6734](https://github.com/cosmos/cosmos-sdk/issues/6834) Add `TxEncodingConfig` parameter to `AppModuleBasic.ValidateGenesis` command to support JSON tx decoding in `genutil`. + * (types) [\#6327](https://github.com/cosmos/cosmos-sdk/pull/6327) `sdk.Msg` now inherits `proto.Message`, as a result all `sdk.Msg` types now use pointer semantics. + * (types) [\#7032](https://github.com/cosmos/cosmos-sdk/pull/7032) All types ending with `ID` (e.g. `ProposalID`) now end with `Id` (e.g. `ProposalId`), to match default Protobuf generated format. Also see [\#7033](https://github.com/cosmos/cosmos-sdk/pull/7033) for more details. + * (x/auth) [\#6029](https://github.com/cosmos/cosmos-sdk/pull/6029) Module accounts have been moved from `x/supply` to `x/auth`. + * (x/auth) [\#6443](https://github.com/cosmos/cosmos-sdk/issues/6443) Move `FeeTx` and `TxWithMemo` interfaces from `x/auth/ante` to `types`. + * (x/bank) [\#7327](https://github.com/cosmos/cosmos-sdk/pull/7327) AddCoins and SubtractCoins no longer return a resultingValue and will only return an error. + * (x/evidence) [\#7251](https://github.com/cosmos/cosmos-sdk/pull/7251) New evidence types and light client evidence handling. The module function names changed. + * (x/ibc) [\#6374](https://github.com/cosmos/cosmos-sdk/pull/6374) `VerifyMembership` and `VerifyNonMembership` now take a `specs []string` argument to specify the proof format used for verification. Most SDK chains can simply use `commitmenttypes.GetSDKSpecs()` for this argument. + * (x/params) [\#5619](https://github.com/cosmos/cosmos-sdk/pull/5619) The `x/params` keeper now accepts a `codec.Marshaller` instead of + a reference to an amino codec. Amino is still used for JSON serialization. + * (x/staking) [\#6451](https://github.com/cosmos/cosmos-sdk/pull/6451) `DefaultParamspace` and `ParamKeyTable` in staking module are moved from keeper to types to enforce consistency. + * (x/supply) [\#6010](https://github.com/cosmos/cosmos-sdk/pull/6010) All `x/supply` types and APIs have been moved to `x/bank`. + * [\#6409](https://github.com/cosmos/cosmos-sdk/pull/6409) Rename all IsEmpty methods to Empty across the codebase and enforce consistency. + * [\#6231](https://github.com/cosmos/cosmos-sdk/pull/6231) Simplify `AppModule` interface, `Route` and `NewHandler` methods become only `Route` + and returns a new `Route` type. + * (x/slashing) [\#6212](https://github.com/cosmos/cosmos-sdk/pull/6212) Remove `Get*` prefixes from key construction functions + * (server) [\#6079](https://github.com/cosmos/cosmos-sdk/pull/6079) Remove `UpgradeOldPrivValFile` (deprecated in Tendermint Core v0.28). + * [\#5719](https://github.com/cosmos/cosmos-sdk/pull/5719) Bump Go requirement to 1.14+ + * (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove APIs for getting and setting `x/evidence` parameters. `BaseApp` now uses a `ParamStore` to manage Tendermint consensus parameters which is managed via the `x/params` `Substore` type. + * (x/gov) [\#6147](https://github.com/cosmos/cosmos-sdk/pull/6147) The `Content` field on `Proposal` and `MsgSubmitProposal` + is now `Any` in concordance with [ADR 019](docs/architecture/adr-019-protobuf-state-encoding.md) and `GetContent` should now + be used to retrieve the actual proposal `Content`. Also the `NewMsgSubmitProposal` constructor now may return an `error` + * (x/auth) [\#7006](https://github.com/cosmos/cosmos-sdk/pull/7006) All `AccountRetriever` methods now take `client.Context` as a parameter instead of as a struct member. + * (x/auth) [\#6270](https://github.com/cosmos/cosmos-sdk/pull/6270) The passphrase argument has been removed from the signature of the following functions and methods: `BuildAndSign`, ` MakeSignature`, ` SignStdTx`, `TxBuilder.BuildAndSign`, `TxBuilder.Sign`, `TxBuilder.SignStdTx` + * (x/auth) [\#6428](https://github.com/cosmos/cosmos-sdk/issues/6428): + * `NewAnteHandler` and `NewSigVerificationDecorator` both now take a `SignModeHandler` parameter. + * `SignatureVerificationGasConsumer` now has the signature: `func(meter sdk.GasMeter, sig signing.SignatureV2, params types.Params) error`. + * The `SigVerifiableTx` interface now has a `GetSignaturesV2() ([]signing.SignatureV2, error)` method and no longer has the `GetSignBytes` method. + ### State Machine Breaking -* (x/staking) [\#6844](https://github.com/cosmos/cosmos-sdk/pull/6844) Validators are now inserted into the unbonding queue based on their unbonding time and height. The relevant keeper APIs are modified to reflect these changes by now also requiring a height. -* (x/bank) [\#6518](https://github.com/cosmos/cosmos-sdk/pull/6518) Support for global and per-denomination send enabled flags. - * Existing send_enabled global flag has been moved into a Params structure as `default_send_enabled`. - * An array of: `{denom: string, enabled: bool}` is added to bank Params to support per-denomination override of global default value. -* (x/staking) [\#6061](https://github.com/cosmos/cosmos-sdk/pull/6061) Allow a validator to immediately unjail when no signing info is present due to +* __General__ + * (client) [\#7268](https://github.com/cosmos/cosmos-sdk/pull/7268) / [\#7147](https://github.com/cosmos/cosmos-sdk/pull/7147) Introduce new protobuf based PubKeys, and migrate PubKey in BaseAccount to use this new protobuf based PubKey format + +* __Modules__ + * (modules) [\#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) Separate balance from accounts per ADR 004. + * Account balances are now persisted and retrieved via the `x/bank` module. + * Vesting account interface has been modified to account for changes. + * Callers to `NewBaseVestingAccount` are responsible for verifying account balance in relation to + the original vesting amount. + * The `SendKeeper` and `ViewKeeper` interfaces in `x/bank` have been modified to account for changes. + * (x/auth) [\#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Migrate the `x/auth` module to use Protocol Buffers for state + serialization instead of Amino. + * The `BaseAccount.PubKey` field is now represented as a Bech32 string instead of a `crypto.Pubkey`. + * `NewBaseAccountWithAddress` now returns a reference to a `BaseAccount`. + * The `x/auth` module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by + requiring a concrete codec to know how to serialize accounts. + * The `AccountRetriever` type now accepts a `Codec` in its constructor in order to know how to + serialize accounts. + * (x/bank) [\#6518](https://github.com/cosmos/cosmos-sdk/pull/6518) Support for global and per-denomination send enabled flags. + * Existing send_enabled global flag has been moved into a Params structure as `default_send_enabled`. + * An array of: `{denom: string, enabled: bool}` is added to bank Params to support per-denomination override of global default value. + * (x/distribution) [\#5610](https://github.com/cosmos/cosmos-sdk/pull/5610) Migrate the `x/distribution` module to use Protocol Buffers for state + serialization instead of Amino. The exact codec used is `codec.HybridCodec` which utilizes Protobuf for binary encoding and Amino + for JSON encoding. + * `ValidatorHistoricalRewards.ReferenceCount` is now of types `uint32` instead of `uint16`. + * `ValidatorSlashEvents` is now a struct with `slashevents`. + * `ValidatorOutstandingRewards` is now a struct with `rewards`. + * `ValidatorAccumulatedCommission` is now a struct with `commission`. + * The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type + provided is specified by `ModuleCdc`. + * (x/evidence) [\#5634](https://github.com/cosmos/cosmos-sdk/pull/5634) Migrate the `x/evidence` module to use Protocol Buffers for state + serialization instead of Amino. + * The `internal` sub-package has been removed in order to expose the types proto file. + * The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by + requiring a concrete codec to know how to serialize `Evidence` types. + * The `MsgSubmitEvidence` message has been removed in favor of `MsgSubmitEvidenceBase`. The application-level + codec must now define the concrete `MsgSubmitEvidence` type which must implement the module's `MsgSubmitEvidence` + interface. + * (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove parameters from `x/evidence` genesis and module state. The `x/evidence` module now solely uses Tendermint consensus parameters to determine of evidence is valid or not. + * (x/gov) [\#5737](https://github.com/cosmos/cosmos-sdk/pull/5737) Migrate the `x/gov` module to use Protocol + Buffers for state serialization instead of Amino. + * `MsgSubmitProposal` will be removed in favor of the application-level proto-defined `MsgSubmitProposal` which + implements the `MsgSubmitProposalI` interface. Applications should extend the `NewMsgSubmitProposalBase` type + to define their own concrete `MsgSubmitProposal` types. + * The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by + requiring a concrete codec to know how to serialize `Proposal` types. + * (x/mint) [\#5634](https://github.com/cosmos/cosmos-sdk/pull/5634) Migrate the `x/mint` module to use Protocol Buffers for state + serialization instead of Amino. + * The `internal` sub-package has been removed in order to expose the types proto file. + * (x/slashing) [\#5627](https://github.com/cosmos/cosmos-sdk/pull/5627) Migrate the `x/slashing` module to use Protocol Buffers for state + serialization instead of Amino. The exact codec used is `codec.HybridCodec` which utilizes Protobuf for binary encoding and Amino + for JSON encoding. + * The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type + provided is specified by `ModuleCdc`. + * (x/staking) [\#6844](https://github.com/cosmos/cosmos-sdk/pull/6844) Validators are now inserted into the unbonding queue based on their unbonding time and height. The relevant keeper APIs are modified to reflect these changes by now also requiring a height. + * (x/staking) [\#6061](https://github.com/cosmos/cosmos-sdk/pull/6061) Allow a validator to immediately unjail when no signing info is present due to + falling below their minimum self-delegation and never having been bonded. The validator may immediately unjail once they've met their minimum self-delegation. + * (x/staking) [\#5600](https://github.com/cosmos/cosmos-sdk/pull/5600) Migrate the `x/staking` module to use Protocol Buffers for state + serialization instead of Amino. The exact codec used is `codec.HybridCodec` which utilizes Protobuf for binary encoding and Amino + for JSON encoding. + * `BondStatus` is now of type `int32` instead of `byte`. + * Types of `int16` in the `Params` type are now of type `int32`. + * Every reference of `crypto.Pubkey` in context of a `Validator` is now of type string. `GetPubKeyFromBech32` must be used to get the `crypto.Pubkey`. + * The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type + provided is specified by `ModuleCdc`. + * (x/supply) [\#6010](https://github.com/cosmos/cosmos-sdk/pull/6010) Removed the `x/supply` module by merging the existing types and APIs into the `x/bank` module. + * (x/supply) [\#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Migrate the `x/supply` module to use Protocol Buffers for state + serialization instead of Amino. + * The `internal` sub-package has been removed in order to expose the types proto file. + * The `x/supply` module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by + requiring a concrete codec to know how to serialize `SupplyI` types. + * The `SupplyI` interface has been modified to no longer return `SupplyI` on methods. Instead the + concrete type's receiver should modify the type. + * (x/upgrade) [\#5659](https://github.com/cosmos/cosmos-sdk/pull/5659) Migrate the `x/upgrade` module to use Protocol + Buffers for state serialization instead of Amino. + * The `internal` sub-package has been removed in order to expose the types proto file. + * The `x/upgrade` module now accepts a `codec.Marshaler` interface. + +### Features + +* __Baseapp / Client / REST__ + * (x/auth) [\#6213](https://github.com/cosmos/cosmos-sdk/issues/6213) Introduce new protobuf based path for transaction signing, see [ADR020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md) for more details + * (x/auth) [\#6350](https://github.com/cosmos/cosmos-sdk/pull/6350) New sign-batch command to sign StdTx batch files. + * (baseapp) [\#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) Added support for taking state snapshots at regular height intervals, via options `snapshot-interval` and `snapshot-keep-recent`. + * (client) [\#5921](https://github.com/cosmos/cosmos-sdk/issues/5921) Introduce new gRPC and gRPC Gateway based APIs for querying app & module data. See [ADR021](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-021-protobuf-query-encoding.md) for more details + * (cli) [\#7485](https://github.com/cosmos/cosmos-sdk/pull/7485) Introduce a new optional `--keyring-dir` flag that allows clients to specify a Keyring directory if it does not reside in the directory specified by `--home`. + * (coin) [\#6755](https://github.com/cosmos/cosmos-sdk/pull/6755) Add custom regex validation for `Coin` denom by overwriting `CoinDenomRegex` when using `/types/coin.go`. + * (config) [\#7265](https://github.com/cosmos/cosmos-sdk/pull/7265) Support Tendermint block pruning through a new `min-retain-blocks` configuration that can be set in either `app.toml` or via the CLI. This parameter is used in conjunction with other criteria to determine the height at which Tendermint should prune blocks. + * (events) [\#7121](https://github.com/cosmos/cosmos-sdk/pull/7121) The application now derives what events are indexed by Tendermint via the `index-events` configuration in `app.toml`, which is a list of events taking the form `{eventType}.{attributeKey}`. + * (tx) [\#6089](https://github.com/cosmos/cosmos-sdk/pull/6089) Transactions can now have a `TimeoutHeight` set which allows the transaction to be rejected if it's committed at a height greater than the timeout. + * (rest) [\#6167](https://github.com/cosmos/cosmos-sdk/pull/6167) Support `max-body-bytes` CLI flag for the REST service. + * (genesis) [\#7089](https://github.com/cosmos/cosmos-sdk/pull/7089) The `export` command now adds a `initial_height` field in the exported JSON. Baseapp's `CommitMultiStore` now also has a `SetInitialVersion` setter, so it can set the initial store version inside `InitChain` and start a new chain from a given height. +* __General__ + * (crypto/multisig) [\#6241](https://github.com/cosmos/cosmos-sdk/pull/6241) Add Multisig type directly to the repo. Previously this was in tendermint. + * (tests) [\#6489](https://github.com/cosmos/cosmos-sdk/pull/6489) Introduce package `testutil`, new in-process testing network framework for use in integration and unit tests. + * (store) [\#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) Added `rootmulti.Store` methods for taking and restoring snapshots, based on `iavl.Store` export/import. + * (store) [\#6324](https://github.com/cosmos/cosmos-sdk/pull/6324) IAVL store query proofs now return CommitmentOp which wraps an ics23 CommitmentProof + * (store) [\#6390](https://github.com/cosmos/cosmos-sdk/pull/6390) `RootMulti` store query proofs now return `CommitmentOp` which wraps `CommitmentProofs` + * `store.Query` now only returns chained `ics23.CommitmentProof` wrapped in `merkle.Proof` + * `ProofRuntime` only decodes and verifies `ics23.CommitmentProof` +* __Modules__ + * (modules) [\#5921](https://github.com/cosmos/cosmos-sdk/issues/5921) Introduction of Query gRPC service definitions along with REST annotations for gRPC Gateway for each module + * (x/auth/vesting) [\#7209](https://github.com/cosmos/cosmos-sdk/pull/7209) Create new `MsgCreateVestingAccount` message type along with CLI handler that allows for the creation of delayed and continuous vesting types. + * (x/capability) [\#5828](https://github.com/cosmos/cosmos-sdk/pull/5828) Capability module integration as outlined in [ADR 3 - Dynamic Capability Store](https://github.com/cosmos/tree/master/docs/architecture/adr-003-dynamic-capability-store.md). + * (x/ibc) [\#5277](https://github.com/cosmos/cosmos-sdk/pull/5277) `x/ibc` changes from IBC alpha. For more details check the the [`x/ibc/core/spec`](https://github.com/cosmos/cosmos-sdk/tree/master/x/ibc/core/spec) directory, or the ICS specs below: + * [ICS 002 - Client Semantics](https://github.com/cosmos/ics/tree/master/spec/ics-002-client-semantics) subpackage + * [ICS 003 - Connection Semantics](https://github.com/cosmos/ics/blob/master/spec/ics-003-connection-semantics) subpackage + * [ICS 004 - Channel and Packet Semantics](https://github.com/cosmos/ics/blob/master/spec/ics-004-channel-and-packet-semantics) subpackage + * [ICS 005 - Port Allocation](https://github.com/cosmos/ics/blob/master/spec/ics-005-port-allocation) subpackage + * [ICS 006 - Solo Machine Client](https://github.com/cosmos/ics/tree/master/spec/ics-006-solo-machine-client) subpackage + * [ICS 007 - Tendermint Client](https://github.com/cosmos/ics/blob/master/spec/ics-007-tendermint-client) subpackage + * [ICS 009 - Loopback Client](https://github.com/cosmos/ics/tree/master/spec/ics-009-loopback-client) subpackage + * [ICS 020 - Fungible Token Transfer](https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer) subpackage + * [ICS 023 - Vector Commitments](https://github.com/cosmos/ics/tree/master/spec/ics-023-vector-commitments) subpackage + * [ICS 024 - Host State Machine Requirements](https://github.com/cosmos/ics/tree/master/spec/ics-024-host-requirements) subpackage + * (x/ibc) [\#6374](https://github.com/cosmos/cosmos-sdk/pull/6374) ICS-23 Verify functions will now accept and verify ics23 CommitmentProofs exclusively + * (x/params) [\#6005](https://github.com/cosmos/cosmos-sdk/pull/6005) Add new CLI command for querying raw x/params parameters by subspace and key. + +### Bug Fixes + +* __Baseapp / Client / REST__ + * (client) [\#5964](https://github.com/cosmos/cosmos-sdk/issues/5964) `--trust-node` is now false by default - for real. Users must ensure it is set to true if they don't want to enable the verifier. + * (client) [\#6402](https://github.com/cosmos/cosmos-sdk/issues/6402) Fix `keys add` `--algo` flag which only worked for Tendermint's `secp256k1` default key signing algorithm. + * (export) [\#6510](https://github.com/cosmos/cosmos-sdk/pull/6510/) Field TimeIotaMs now is included in genesis file while exporting. + * (rest) [\#5906](https://github.com/cosmos/cosmos-sdk/pull/5906) Fix an issue that make some REST calls panic when sending invalid or incomplete requests. + * (crypto/keyring) [\#5844](https://github.com/cosmos/cosmos-sdk/pull/5844) `Keyring.Sign()` methods no longer decode amino signatures when method receivers + are offline/multisig keys. +* __Modules__ + * (modules) [\#5569](https://github.com/cosmos/cosmos-sdk/issues/5569) `InitGenesis`, for the relevant modules, now ensures module accounts exist. + * (x/auth) [\#5892](https://github.com/cosmos/cosmos-sdk/pull/5892) Add `RegisterKeyTypeCodec` to register new + types (eg. keys) to the `auth` module internal amino codec. + * (x/bank) [\#6536](https://github.com/cosmos/cosmos-sdk/pull/6536) Fix bug in `WriteGeneratedTxResponse` function used by multiple + REST endpoints. Now it writes a Tx in StdTx format. + * (x/genutil) [\#5938](https://github.com/cosmos/cosmos-sdk/pull/5938) Fix `InitializeNodeValidatorFiles` error handling. + * (x/staking) [\#6529](https://github.com/cosmos/cosmos-sdk/pull/6529) Export validator addresses (previously was empty). + * (x/staking) [\#5949](https://github.com/cosmos/cosmos-sdk/pull/5949) Skip staking `HistoricalInfoKey` in simulations as headers are not exported. + * (x/staking) [\#6061](https://github.com/cosmos/cosmos-sdk/pull/6061) Allow a validator to immediately unjail when no signing info is present due to falling below their minimum self-delegation and never having been bonded. The validator may immediately unjail once they've met their minimum self-delegation. -* (x/supply) [\#6010](https://github.com/cosmos/cosmos-sdk/pull/6010) Removed the `x/supply` module by merging the existing types and APIs into the `x/bank` module. -* (modules) [\#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) Separate balance from accounts per ADR 004. - * Account balances are now persisted and retrieved via the `x/bank` module. - * Vesting account interface has been modified to account for changes. - * Callers to `NewBaseVestingAccount` are responsible for verifying account balance in relation to - the original vesting amount. - * The `SendKeeper` and `ViewKeeper` interfaces in `x/bank` have been modified to account for changes. -* (x/staking) [\#5600](https://github.com/cosmos/cosmos-sdk/pull/5600) Migrate the `x/staking` module to use Protocol Buffers for state -serialization instead of Amino. The exact codec used is `codec.HybridCodec` which utilizes Protobuf for binary encoding and Amino -for JSON encoding. - * `BondStatus` is now of type `int32` instead of `byte`. - * Types of `int16` in the `Params` type are now of type `int32`. - * Every reference of `crypto.Pubkey` in context of a `Validator` is now of type string. `GetPubKeyFromBech32` must be used to get the `crypto.Pubkey`. - * The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type - provided is specified by `ModuleCdc`. -* (x/slashing) [\#5627](https://github.com/cosmos/cosmos-sdk/pull/5627) Migrate the `x/slashing` module to use Protocol Buffers for state -serialization instead of Amino. The exact codec used is `codec.HybridCodec` which utilizes Protobuf for binary encoding and Amino -for JSON encoding. - * The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type - provided is specified by `ModuleCdc`. -* (x/distribution) [\#5610](https://github.com/cosmos/cosmos-sdk/pull/5610) Migrate the `x/distribution` module to use Protocol Buffers for state -serialization instead of Amino. The exact codec used is `codec.HybridCodec` which utilizes Protobuf for binary encoding and Amino -for JSON encoding. - * `ValidatorHistoricalRewards.ReferenceCount` is now of types `uint32` instead of `uint16`. - * `ValidatorSlashEvents` is now a struct with `slashevents`. - * `ValidatorOutstandingRewards` is now a struct with `rewards`. - * `ValidatorAccumulatedCommission` is now a struct with `commission`. - * The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type - provided is specified by `ModuleCdc`. -* (x/auth) [\#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Migrate the `x/auth` module to use Protocol Buffers for state -serialization instead of Amino. - * The `BaseAccount.PubKey` field is now represented as a Bech32 string instead of a `crypto.Pubkey`. - * `NewBaseAccountWithAddress` now returns a reference to a `BaseAccount`. - * The `x/auth` module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by - requiring a concrete codec to know how to serialize accounts. - * The `AccountRetriever` type now accepts a `Codec` in its constructor in order to know how to - serialize accounts. -* (x/supply) [\#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Migrate the `x/supply` module to use Protocol Buffers for state -serialization instead of Amino. - * The `internal` sub-package has been removed in order to expose the types proto file. - * The `x/supply` module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by - requiring a concrete codec to know how to serialize `SupplyI` types. - * The `SupplyI` interface has been modified to no longer return `SupplyI` on methods. Instead the - concrete type's receiver should modify the type. -* (x/mint) [\#5634](https://github.com/cosmos/cosmos-sdk/pull/5634) Migrate the `x/mint` module to use Protocol Buffers for state -serialization instead of Amino. - * The `internal` sub-package has been removed in order to expose the types proto file. -* (x/evidence) [\#5634](https://github.com/cosmos/cosmos-sdk/pull/5634) Migrate the `x/evidence` module to use Protocol Buffers for state -serialization instead of Amino. - * The `internal` sub-package has been removed in order to expose the types proto file. - * The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by - requiring a concrete codec to know how to serialize `Evidence` types. - * The `MsgSubmitEvidence` message has been removed in favor of `MsgSubmitEvidenceBase`. The application-level - codec must now define the concrete `MsgSubmitEvidence` type which must implement the module's `MsgSubmitEvidence` - interface. -* (x/upgrade) [\#5659](https://github.com/cosmos/cosmos-sdk/pull/5659) Migrate the `x/upgrade` module to use Protocol -Buffers for state serialization instead of Amino. - * The `internal` sub-package has been removed in order to expose the types proto file. - * The `x/upgrade` module now accepts a `codec.Marshaler` interface. -* (x/gov) [\#5737](https://github.com/cosmos/cosmos-sdk/pull/5737) Migrate the `x/gov` module to use Protocol -Buffers for state serialization instead of Amino. - * `MsgSubmitProposal` will be removed in favor of the application-level proto-defined `MsgSubmitProposal` which - implements the `MsgSubmitProposalI` interface. Applications should extend the `NewMsgSubmitProposalBase` type - to define their own concrete `MsgSubmitProposal` types. - * The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by - requiring a concrete codec to know how to serialize `Proposal` types. -* (codec) [\#5799](https://github.com/cosmos/cosmos-sdk/pull/5799) Now we favor the use of `(Un)MarshalBinaryBare` instead of `(Un)MarshalBinaryLengthPrefixed` in all cases that are not needed. -* (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove parameters from `x/evidence` genesis and module state. The `x/evidence` module now solely uses Tendermint consensus parameters to determine of evidence is valid or not. +* __General__ + * (types) [\#7038](https://github.com/cosmos/cosmos-sdk/issues/7038) Fix infinite looping of `ApproxRoot` by including a hard-coded maximum iterations limit of 100. + * (types) [\#7084](https://github.com/cosmos/cosmos-sdk/pull/7084) Fix panic when calling `BigInt()` on an uninitialized `Int`. + * (simulation) [\#7129](https://github.com/cosmos/cosmos-sdk/issues/7129) Fix support for custom `Account` and key types on auth's simulation. + ### Improvements - -* (x/ibc-transfer) [\#6871](https://github.com/cosmos/cosmos-sdk/pull/6871) Implement [ADR 001 - Coin Source Tracing](./docs/architecture/adr-001-coin-source-tracing.md). -* (types) [\#7027](https://github.com/cosmos/cosmos-sdk/pull/7027) `Coin(s)` and `DecCoin(s)` updates: - * Bump denomination max length to 128 - * Allow uppercase letters and numbers in denominations to support [ADR 001](./docs/architecture/adr-001-coin-source-tracing.md) - * Added `Validate` function that returns a descriptive error -* (baseapp) [\#6186](https://github.com/cosmos/cosmos-sdk/issues/6186) Support emitting events during `AnteHandler` execution. -* (x/auth) [\#5702](https://github.com/cosmos/cosmos-sdk/pull/5702) Add parameter querying support for `x/auth`. -* (types) [\#5581](https://github.com/cosmos/cosmos-sdk/pull/5581) Add convenience functions {,Must}Bech32ifyAddressBytes. -* (staking) [\#5584](https://github.com/cosmos/cosmos-sdk/pull/5584) Add util function `ToTmValidator` that converts a `staking.Validator` type to `*tmtypes.Validator`. -* (types) [\#5585](https://github.com/cosmos/cosmos-sdk/pull/5585) IBC additions: - * `Coin` denomination max lenght has been increased to 32. - * Added `CapabilityKey` alias for `StoreKey` to match IBC spec. -* (client) [\#5810](https://github.com/cosmos/cosmos-sdk/pull/5810) Added a new `--offline` flag that allows commands to be executed without an -internet connection. Previously, `--generate-only` served this purpose in addition to only allowing txs to be generated. Now, `--generate-only` solely -allows txs to be generated without being broadcasted and disallows Keybase use and `--offline` allows the use of Keybase but does not allow any -functionality that requires an online connection. -* (types/module) [\#5724](https://github.com/cosmos/cosmos-sdk/issues/5724) The `types/module` package does no longer depend on `x/simulation`. -* (client) [\#5856](https://github.com/cosmos/cosmos-sdk/pull/5856) Added the possibility to set `--offline` flag with config command. -* (client) [\#5895](https://github.com/cosmos/cosmos-sdk/issues/5895) show config options in the config command's help screen. -* (types/rest) [\#5900](https://github.com/cosmos/cosmos-sdk/pull/5900) Add Check*Error function family to spare developers from replicating tons of boilerplate code. -* (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Tendermint Consensus parameters can now be changed via parameter change proposals through `x/gov`. -* (x/evidence) [\#5961](https://github.com/cosmos/cosmos-sdk/issues/5961) Add `StoreDecoder` simulation for evidence module. -* (x/auth/ante) [\#6040](https://github.com/cosmos/cosmos-sdk/pull/6040) `AccountKeeper` interface used for `NewAnteHandler` and handler's decorators to add support of using custom `AccountKeeper` implementations. -* (simulation) [\#6002](https://github.com/cosmos/cosmos-sdk/pull/6002) Add randomized consensus params into simulation. -* (x/staking) [\#6059](https://github.com/cosmos/cosmos-sdk/pull/6059) Updated `HistoricalEntries` parameter default to 100. -* (x/ibc) [\#5948](https://github.com/cosmos/cosmos-sdk/issues/5948) Add `InitGenesis` and `ExportGenesis` functions for `ibc` module. -* (types) [\#6128](https://github.com/cosmos/cosmos-sdk/pull/6137) Add String() method to GasMeter -* (x/staking) [\#6163](https://github.com/cosmos/cosmos-sdk/pull/6163) CLI and REST call to unbonding delegations and delegations now accept -pagination. -* (types) [\#6128](https://github.com/cosmos/cosmos-sdk/pull/6137) Add `String()` method to `GasMeter`. -* (types) [\#6195](https://github.com/cosmos/cosmos-sdk/pull/6195) Add codespace to broadcast(sync/async) response. -* (baseapp) [\#6053](https://github.com/cosmos/cosmos-sdk/pull/6053) Customizable panic recovery handling added for `app.runTx()` method (as proposed in the [ADR 22](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-022-custom-panic-handling.md)). Adds ability for developers to register custom panic handlers extending standard ones. -* (store) [\#6481](https://github.com/cosmos/cosmos-sdk/pull/6481) Move `SimpleProofsFromMap` from Tendermint into the SDK. -* (store) [\#6719](https://github.com/cosmos/cosmos-sdk/6754) Add validity checks to stores for nil and empty keys. -* (types) \#6897 Add KV type from tendermint to `types` directory. +* __Baseapp / Client / REST__ + * (baseapp) [\#6186](https://github.com/cosmos/cosmos-sdk/issues/6186) Support emitting events during `AnteHandler` execution. + * (baseapp) [\#6053](https://github.com/cosmos/cosmos-sdk/pull/6053) Customizable panic recovery handling added for `app.runTx()` method (as proposed in the [ADR 22](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-022-custom-panic-handling.md)). Adds ability for developers to register custom panic handlers extending standard ones. + * (client) [\#5810](https://github.com/cosmos/cosmos-sdk/pull/5810) Added a new `--offline` flag that allows commands to be executed without an + internet connection. Previously, `--generate-only` served this purpose in addition to only allowing txs to be generated. Now, `--generate-only` solely + allows txs to be generated without being broadcasted and disallows Keybase use and `--offline` allows the use of Keybase but does not allow any + functionality that requires an online connection. + * (client) [\#5856](https://github.com/cosmos/cosmos-sdk/pull/5856) Added the possibility to set `--offline` flag with config command. + * (client) [\#5895](https://github.com/cosmos/cosmos-sdk/issues/5895) show config options in the config command's help screen. +* __Modules__ + * (x/auth) [\#5702](https://github.com/cosmos/cosmos-sdk/pull/5702) Add parameter querying support for `x/auth`. + * (x/auth/ante) [\#6040](https://github.com/cosmos/cosmos-sdk/pull/6040) `AccountKeeper` interface used for `NewAnteHandler` and handler's decorators to add support of using custom `AccountKeeper` implementations. + * (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Tendermint Consensus parameters can now be changed via parameter change proposals through `x/gov`. + * (x/evidence) [\#5961](https://github.com/cosmos/cosmos-sdk/issues/5961) Add `StoreDecoder` simulation for evidence module. + * (x/ibc) [\#5948](https://github.com/cosmos/cosmos-sdk/issues/5948) Add `InitGenesis` and `ExportGenesis` functions for `ibc` module. + * (x/ibc-transfer) [\#6871](https://github.com/cosmos/cosmos-sdk/pull/6871) Implement [ADR 001 - Coin Source Tracing](./docs/architecture/adr-001-coin-source-tracing.md). + * (x/staking) [\#6059](https://github.com/cosmos/cosmos-sdk/pull/6059) Updated `HistoricalEntries` parameter default to 100. + * (x/staking) [\#5584](https://github.com/cosmos/cosmos-sdk/pull/5584) Add util function `ToTmValidator` that converts a `staking.Validator` type to `*tmtypes.Validator`. + * (x/staking) [\#6163](https://github.com/cosmos/cosmos-sdk/pull/6163) CLI and REST call to unbonding delegations and delegations now accept + pagination. +* __General__ + * (tendermint) [\#6365](https://github.com/cosmos/cosmos-sdk/issues/6365) Update tendermint version to v0.34, and make necessary upgrades to the SDK + * (simulation) [\#6002](https://github.com/cosmos/cosmos-sdk/pull/6002) Add randomized consensus params into simulation. + * (store) [\#6481](https://github.com/cosmos/cosmos-sdk/pull/6481) Move `SimpleProofsFromMap` from Tendermint into the SDK. + * (store) [\#6719](https://github.com/cosmos/cosmos-sdk/6754) Add validity checks to stores for nil and empty keys. + * (types) [\#7027](https://github.com/cosmos/cosmos-sdk/pull/7027) `Coin(s)` and `DecCoin(s)` updates: + * Bump denomination max length to 128 + * Allow uppercase letters and numbers in denominations to support [ADR 001](./docs/architecture/adr-001-coin-source-tracing.md) + * Added `Validate` function that returns a descriptive error + * (types) [\#5581](https://github.com/cosmos/cosmos-sdk/pull/5581) Add convenience functions {,Must}Bech32ifyAddressBytes. + * (types/module) [\#5724](https://github.com/cosmos/cosmos-sdk/issues/5724) The `types/module` package does no longer depend on `x/simulation`. + * (types) [\#5585](https://github.com/cosmos/cosmos-sdk/pull/5585) IBC additions: + * `Coin` denomination max lenght has been increased to 32. + * Added `CapabilityKey` alias for `StoreKey` to match IBC spec. + * (types/rest) [\#5900](https://github.com/cosmos/cosmos-sdk/pull/5900) Add Check*Error function family to spare developers from replicating tons of boilerplate code. + * (types) [\#6128](https://github.com/cosmos/cosmos-sdk/pull/6137) Add `String()` method to `GasMeter`. + * (types) [\#6195](https://github.com/cosmos/cosmos-sdk/pull/6195) Add codespace to broadcast(sync/async) response. + * (types) \#6897 Add KV type from tendermint to `types` directory. ## [v0.39.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.39.1) - 2020-08-11 From 589835dd98134da353e16d52cb733b538a5ac8f3 Mon Sep 17 00:00:00 2001 From: Marie Gauthier Date: Wed, 14 Oct 2020 14:38:14 +0200 Subject: [PATCH 23/84] Update Building Modules documentation (#7473) * Update module-manager.md * Update modules #messages doc * Fix typo * Update message implementation example link * Update messages-and-queries.md#queries doc * Update querier.md * Update handler.md * Update links in beginblock-endblock.md * Update keeper.md * Update invariants.md * Update genesis.md * Update module-interfaces.md#transaction-commands * Update module-interfaces.md#query-commands * Update module-interfaces.md#flags * Update module-interfaces.md#rest * Update structure.md * Update module-interfaces.md#grpc * Update errors.md * Update module-interfaces.md#grpc-gateway-rest * Add more info on swagger * Address comments * Fix go.sum * Fix app-anatomy.md * Update docs/building-modules/module-interfaces.md Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update docs/building-modules/querier.md Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update docs/building-modules/querier.md Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update docs/building-modules/module-interfaces.md Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update docs/building-modules/module-interfaces.md Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Address part of review comments * Update old ref of RegisterQueryService * Add example code for Manager * Update queriers.md to query-services.md and refs * Add new query-services.md * Revert "Update old ref of RegisterQueryService" This reverts commit 1ea1ea8559604d5c0aa13951b3016967438da2a5. * Update keeper.md * Update handler.md * Update handler.md * Update messages-and-queries.md * Update docs/basics/app-anatomy.md Co-authored-by: Amaury Martiny * Update docs/building-modules/intro.md Co-authored-by: Amaury Martiny * Fix typo Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Amaury Martiny --- docs/basics/app-anatomy.md | 4 +- docs/building-modules/README.md | 2 +- docs/building-modules/beginblock-endblock.md | 4 +- docs/building-modules/errors.md | 2 +- docs/building-modules/genesis.md | 24 ++-- docs/building-modules/handler.md | 32 +++-- docs/building-modules/intro.md | 3 +- docs/building-modules/invariants.md | 4 +- docs/building-modules/keeper.md | 24 ++-- docs/building-modules/messages-and-queries.md | 56 +++++---- docs/building-modules/module-interfaces.md | 110 ++++++++++++------ docs/building-modules/module-manager.md | 48 +++++--- docs/building-modules/querier.md | 56 --------- docs/building-modules/query-services.md | 77 ++++++++++++ docs/building-modules/structure.md | 5 +- docs/core/baseapp.md | 2 +- docs/core/encoding.md | 2 +- docs/core/transactions.md | 2 +- docs/interfaces/query-lifecycle.md | 6 +- docs/interfaces/rest.md | 4 +- 20 files changed, 287 insertions(+), 180 deletions(-) delete mode 100644 docs/building-modules/querier.md create mode 100644 docs/building-modules/query-services.md diff --git a/docs/basics/app-anatomy.md b/docs/basics/app-anatomy.md index 5556b0c6a7..529ec9b275 100644 --- a/docs/basics/app-anatomy.md +++ b/docs/basics/app-anatomy.md @@ -182,7 +182,7 @@ Finally, each module should also implement the `RegisterQueryService` method as Legacy queriers were queriers used before the introduction of Protobuf and gRPC in the SDK. They are present for existing modules, but will be deprecated in a future release of the SDK. If you are developing new modules, gRPC query services should be preferred, and you only need to implement the `LegacyQuerierHandler` interface if you wish to use legacy queriers. -[`Queriers`](../building-modules/querier.md) are very similar to `handlers`, except they serve user queries to the state as opposed to processing transactions. A [query](../building-modules/messages-and-queries.md#queries) is initiated from an [interface](#application-interface) by an end-user who provides a `queryRoute` and some `data`. The query is then routed to the correct application's `querier` by `baseapp`'s `handleQueryCustom` method using `queryRoute`: +[`Legacy queriers`](../building-modules/query-services.md#legacy-queriers) are very similar to `handlers`, except they serve user queries to the state as opposed to processing transactions. A [query](../building-modules/messages-and-queries.md#queries) is initiated from an [interface](#application-interface) by an end-user who provides a `queryRoute` and some `data`. The query is then routed to the correct application's `querier` by `baseapp`'s `handleQueryCustom` method using `queryRoute`: +++ https://github.com/cosmos/cosmos-sdk/blob/d9175200920e96bfa4182b5c8bc46d91b17a28a1/baseapp/abci.go#L388-L418 @@ -236,7 +236,7 @@ The SDK also provides a development endpoint to generate [Swagger](https://swagg #### Legacy API REST Endpoints -The [module's Legacy REST interface](../building-modules/module-interfaces.md#rest) lets users generate transactions and query the state through REST calls to the application's Legacy API Service. REST routes are defined in a file `client/rest/rest.go`, which is composed of: +The [module's Legacy REST interface](../building-modules/module-interfaces.md#legacy-rest) lets users generate transactions and query the state through REST calls to the application's Legacy API Service. REST routes are defined in a file `client/rest/rest.go`, which is composed of: - A `RegisterRoutes` function, which registers each route defined in the file. This function is called from the [main application's interface](#application-interfaces) for each module used within the application. The router used in the SDK is [Gorilla's mux](https://github.com/gorilla/mux). - Custom request type definitions for each query or transaction creation function that needs to be exposed. These custom request types build on the base `request` type of the Cosmos SDK: diff --git a/docs/building-modules/README.md b/docs/building-modules/README.md index 12dd140f89..43b8638ca9 100644 --- a/docs/building-modules/README.md +++ b/docs/building-modules/README.md @@ -12,7 +12,7 @@ This repository contains documentation on concepts developers need to know in or 2. [`AppModule` Interface and Module Manager](./module-manager.md) 3. [Messages and Queries](./messages-and-queries.md) 4. [`Handler`s - Processing Messages](./handler.md) -5. [`Querier`s - Processing Queries](./querier.md) +5. [Query Services - Processing Queries](./query-services.md) 6. [BeginBlocker and EndBlocker](./beginblock-endblock.md) 7. [`Keeper`s](./keeper.md) 8. [Invariants](./invariants.md) diff --git a/docs/building-modules/beginblock-endblock.md b/docs/building-modules/beginblock-endblock.md index fc9c933026..b4f3abaff9 100644 --- a/docs/building-modules/beginblock-endblock.md +++ b/docs/building-modules/beginblock-endblock.md @@ -28,11 +28,11 @@ It is possible for developers to defined the order of execution between the `Beg See an example implementation of `BeginBlocker` from the `distr` module: -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/x/distribution/abci.go#L10-L32 ++++ https://github.com/cosmos/cosmos-sdk/blob/f33749263f4ecc796115ad6e789cb0f7cddf9148/x/distribution/abci.go#L14-L38 and an example implementation of `EndBlocker` from the `staking` module: -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/x/staking/handler.go#L44-L96 ++++ https://github.com/cosmos/cosmos-sdk/blob/f33749263f4ecc796115ad6e789cb0f7cddf9148/x/staking/abci.go#L22-L27 ## Next {hide} diff --git a/docs/building-modules/errors.md b/docs/building-modules/errors.md index 5e3c31bca0..3b6d90535e 100644 --- a/docs/building-modules/errors.md +++ b/docs/building-modules/errors.md @@ -38,7 +38,7 @@ execution. Example: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.38.1/x/distribution/keeper/querier.go#L62-L80 ++++ https://github.com/cosmos/cosmos-sdk/blob/b2d48a9e815fe534a7faeec6ca2adb0874252b81/x/bank/keeper/keeper.go#L85-L122 Regardless if an error is wrapped or not, the SDK's `errors` package provides an API to determine if an error is of a particular kind via `Is`. diff --git a/docs/building-modules/genesis.md b/docs/building-modules/genesis.md index a95064dc03..7314442969 100644 --- a/docs/building-modules/genesis.md +++ b/docs/building-modules/genesis.md @@ -13,25 +13,25 @@ Modules generally handle a subset of the state and, as such, they need to define ## Type Definition -The subset of the genesis state defined from a given module is generally defined in a `./internal/types/genesis.go` file, along with the `DefaultGenesis` and `ValidateGenesis` methods. The struct defining the module's subset of the genesis state is usually called `GenesisState` and contains all the module-related values that need to be initialized during the genesis process. +The subset of the genesis state defined from a given module is generally defined in a `genesis.proto` file ([more info](../core/encoding.md#gogoproto) on how to define protobuf messages). The struct defining the module's subset of the genesis state is usually called `GenesisState` and contains all the module-related values that need to be initialized during the genesis process. -See an example of `GenesisState` type definition from the nameservice tutorial +See an example of `GenesisState` protobuf message definition from the `auth` module: -+++ https://github.com/cosmos/sdk-tutorials/blob/86a27321cf89cc637581762e953d0c07f8c78ece/nameservice/x/nameservice/genesis.go#L10-L12 ++++ https://github.com/cosmos/cosmos-sdk/blob/a9547b54ffac9729fe1393651126ddfc0d236cff/proto/cosmos/auth/v1beta1/genesis.proto Next we present the main genesis-related methods that need to be implemented by module developers in order for their module to be used in Cosmos SDK applications. ### `DefaultGenesis` -The `DefaultGenesis()` method is a simple method that calls the constructor function for `GenesisState` with the default value for each parameter. See an example from the `nameservice` module: +The `DefaultGenesis()` method is a simple method that calls the constructor function for `GenesisState` with the default value for each parameter. See an example from the `auth` module: -+++ https://github.com/cosmos/sdk-tutorials/blob/86a27321cf89cc637581762e953d0c07f8c78ece/nameservice/x/nameservice/genesis.go#L33-L37 ++++ https://github.com/cosmos/cosmos-sdk/blob/64b6bb5270e1a3b688c2d98a8f481ae04bb713ca/x/auth/module.go#L48-L52 ### `ValidateGenesis` -The `ValidateGenesis(genesisState GenesisState)` method is called to verify that the provided `genesisState` is correct. It should perform validity checks on each of the parameter listed in `GenesisState`. See an example from the `nameservice` module: +The `ValidateGenesis(genesisState GenesisState)` method is called to verify that the provided `genesisState` is correct. It should perform validity checks on each of the parameter listed in `GenesisState`. See an example from the `auth` module: -+++ https://github.com/cosmos/sdk-tutorials/blob/86a27321cf89cc637581762e953d0c07f8c78ece/nameservice/x/nameservice/genesis.go#L18-L31 ++++ https://github.com/cosmos/cosmos-sdk/blob/64b6bb5270e1a3b688c2d98a8f481ae04bb713ca/x/auth/types/genesis.go#L57-L70 ## Other Genesis Methods @@ -43,18 +43,18 @@ The `InitGenesis` method is executed during [`InitChain`](../core/baseapp.md#ini The [module manager](./module-manager.md#manager) of the application is responsible for calling the `InitGenesis` method of each of the application's modules, in order. This order is set by the application developer via the manager's `SetOrderGenesisMethod`, which is called in the [application's constructor function](../basics/app-anatomy.md#constructor-function) -See an example of `InitGenesis` from the nameservice tutorial +See an example of `InitGenesis` from the `auth` module -+++ https://github.com/cosmos/sdk-tutorials/blob/86a27321cf89cc637581762e953d0c07f8c78ece/nameservice/x/nameservice/genesis.go#L39-L44 ++++ https://github.com/cosmos/cosmos-sdk/blob/64b6bb5270e1a3b688c2d98a8f481ae04bb713ca/x/auth/genesis.go#L13-L28 ### `ExportGenesis` The `ExportGenesis` method is executed whenever an export of the state is made. It takes the latest known version of the subset of the state managed by the module and creates a new `GenesisState` out of it. This is mainly used when the chain needs to be upgraded via a hard fork. -See an example of `ExportGenesis` from the nameservice tutorial. +See an example of `ExportGenesis` from the `auth` module. -+++ https://github.com/cosmos/sdk-tutorials/blob/86a27321cf89cc637581762e953d0c07f8c78ece/nameservice/x/nameservice/genesis.go#L46-L57 ++++ https://github.com/cosmos/cosmos-sdk/blob/64b6bb5270e1a3b688c2d98a8f481ae04bb713ca/x/auth/genesis.go#L31-L42 ## Next {hide} -Learn about [modules interfaces](#module-interfaces.md) {hide} \ No newline at end of file +Learn about [modules interfaces](module-interfaces.md) {hide} \ No newline at end of file diff --git a/docs/building-modules/handler.md b/docs/building-modules/handler.md index 88f114f390..45e9a4c119 100644 --- a/docs/building-modules/handler.md +++ b/docs/building-modules/handler.md @@ -21,8 +21,8 @@ Let us break it down: - The [`Msg`](./messages-and-queries.md#messages) is the actual object being processed. - The [`Context`](../core/context.md) contains all the necessary information needed to process the `msg`, as well as a cache-wrapped copy of the latest state. If the `msg` is succesfully processed, the modified version of the temporary state contained in the `ctx` will be written to the main state. -- The [`Result`] returned to `baseapp`, which contains (among other things) information on the execution of the `handler`, [`gas`](../basics/gas-fees.md) consumption and [`events`](../core/events.md). - +++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/types/result.go#L15-L40 +- The [`*Result`] returned to `baseapp`, which contains (among other things) information on the execution of the `handler` and [`events`](../core/events.md). + +++ https://github.com/cosmos/cosmos-sdk/blob/d55c1a26657a0af937fa2273b38dcfa1bb3cff9f/proto/cosmos/base/abci/v1beta1/abci.proto#L81-L95 ## Implementation of a module `handler`s @@ -37,10 +37,10 @@ func NewHandler(keeper Keeper) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { - case MsgType1: + case *MsgType1: return handleMsgType1(ctx, keeper, msg) - case MsgType2: + case *MsgType2: return handleMsgType2(ctx, keeper, msg) default: @@ -69,16 +69,28 @@ ctx.EventManager().EmitEvent( These `events` are relayed back to the underlying consensus engine and can be used by service providers to implement services around the application. Click [here](../core/events.md) to learn more about `events`. -Finally, the `handler` function returns a `sdk.Result` which contains the aforementioned `events` and an optional `Data` field. +Finally, the `handler` function returns a `*sdk.Result` which contains the aforementioned `events` and an optional `Data` field. -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/types/result.go#L15-L40 ++++ https://github.com/cosmos/cosmos-sdk/blob/d55c1a26657a0af937fa2273b38dcfa1bb3cff9f/proto/cosmos/base/abci/v1beta1/abci.proto#L81-L95 -Next is an example of how to return a `Result` from the `gov` module: +Next is an example of how to return a `*Result` from the `gov` module: -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/x/gov/handler.go#L59-L62 ++++ https://github.com/cosmos/cosmos-sdk/blob/d55c1a26657a0af937fa2273b38dcfa1bb3cff9f/x/gov/handler.go#L67-L70 -For a deeper look at `handler`s, see this [example implementation of a `handler` function](https://github.com/cosmos/sdk-application-tutorial/blob/c6754a1e313eb1ed973c5c91dcc606f2fd288811/x/nameservice/handler.go) from the nameservice tutorial. +For a deeper look at `handler`s, see this [example implementation of a `handler` function](https://github.com/cosmos/cosmos-sdk/blob/d55c1a26657a0af937fa2273b38dcfa1bb3cff9f/x/gov/handler.go) from the `gov` module. + +The `handler` can then be registered from [`AppModule.Route()`](./module-manager.md#appmodule) as shown in the example below: + ++++ https://github.com/cosmos/cosmos-sdk/blob/228728cce2af8d494c8b4e996d011492139b04ab/x/gov/module.go#L143-L146 + +## Telemetry + +New [telemetry metrics](../core/telemetry.md) can be created from the `handler` when handling messages for instance. + +This is an example from the `auth` module: + ++++ https://github.com/cosmos/cosmos-sdk/blob/d55c1a26657a0af937fa2273b38dcfa1bb3cff9f/x/auth/vesting/handler.go#L68-L80 ## Next {hide} -Learn about [queriers](./querier.md) {hide} +Learn about [query services](./query-services.md) {hide} diff --git a/docs/building-modules/intro.md b/docs/building-modules/intro.md index 99a9a57caa..7b3a4c3faa 100644 --- a/docs/building-modules/intro.md +++ b/docs/building-modules/intro.md @@ -81,7 +81,7 @@ Modules are by convention defined in the `.x/` subfolder (e.g. the `bank` module - Custom [`message` types](./messages-and-queries.md#messages) to trigger state-transitions. - A [`handler`](./handler.md) used to process messages when they are routed to the module by [`baseapp`](../core/baseapp.md#message-routing). - A [`keeper`](./keeper.md), used to access the module's store(s) and update the state. -- A [`querier`](./querier.md), used to process user queries when they are routed to the module by [`baseapp`](../core/baseapp.md#query-routing). +- A [query service](./query-services.md), used to process user queries when they are routed to the module by [`baseapp`](../core/baseapp.md#query-routing). - Interfaces, for end users to query the subset of the state defined by the module and create `message`s of the custom types defined in the module. In addition to these components, modules implement the `AppModule` interface in order to be managed by the [`module manager`](./module-manager.md). @@ -91,4 +91,3 @@ Please refer to the [structure document](./structure.md) to learn about the reco ## Next {hide} Read more on the [`AppModule` interface and the `module manager`](./module-manager.md) {hide} - diff --git a/docs/building-modules/invariants.md b/docs/building-modules/invariants.md index 576baa796b..d21100cb24 100644 --- a/docs/building-modules/invariants.md +++ b/docs/building-modules/invariants.md @@ -18,7 +18,7 @@ An `Invariant` is a function that checks for a particular invariant within a mod where the `string` return value is the invariant message, which can be used when printing logs, and the `bool` return value is the actual result of the invariant check. -In practice, each module implements `Invariant`s in a `./internal/keeper/invariants.go` file within the module's folder. The standard is to implement one `Invariant` function per logical grouping of invariants with the following model: +In practice, each module implements `Invariant`s in a `./keeper/invariants.go` file within the module's folder. The standard is to implement one `Invariant` function per logical grouping of invariants with the following model: ```go // Example for an Invariant that checks balance-related invariants @@ -74,7 +74,7 @@ At its core, the `InvariantRegistry` is defined in the SDK as an interface: Typically, this interface is implemented in the `keeper` of a specific module. The most used implementation of an `InvariantRegistry` can be found in the `crisis` module: -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/x/crisis/internal/keeper/keeper.go#L45-L49 ++++ https://github.com/cosmos/cosmos-sdk/blob/master/x/crisis/keeper/keeper.go#L50-L54 The `InvariantRegistry` is therefore typically instantiated by instantiating the `keeper` of the `crisis` module in the [application's constructor function](../basics/app-anatomy.md#constructor-function). diff --git a/docs/building-modules/keeper.md b/docs/building-modules/keeper.md index ee373d8b56..5c57faef1f 100644 --- a/docs/building-modules/keeper.md +++ b/docs/building-modules/keeper.md @@ -20,7 +20,7 @@ The core idea behind the object-capabilities approach is to only reveal what is ## Type Definition -`keeper`s are generally implemented in a `internal/keeper/keeper.go` file located in the module's folder. By convention, the type `keeper` of a module is simply named `Keeper` and usually follows the following structure: +`keeper`s are generally implemented in a `/keeper/keeper.go` file located in the module's folder. By convention, the type `keeper` of a module is simply named `Keeper` and usually follows the following structure: ```go type Keeper struct { @@ -32,15 +32,15 @@ type Keeper struct { } ``` -For example, here is the [type definition of the `keeper` from the nameservice tutorial: +For example, here is the type definition of the `keeper` from the `staking` module: -+++ https://github.com/cosmos/sdk-tutorials/blob/86a27321cf89cc637581762e953d0c07f8c78ece/nameservice/x/nameservice/internal/keeper/keeper.go#L10-L17 ++++ https://github.com/cosmos/cosmos-sdk/blob/3bafd8255a502e5a9cee07391cf8261538245dfd/x/staking/keeper/keeper.go#L23-L33 Let us go through the different parameters: -- An expected `keeper` is a `keeper` external to a module that is required by the internal `keeper` of said module. External `keeper`s are listed in the internal `keeper`'s type definition as interfaces. These interfaces are themselves defined in a `internal/types/expected_keepers.go` file within the module's folder. In this context, interfaces are used to reduce the number of dependencies, as well as to facilitate the maintenance of the module itself. +- An expected `keeper` is a `keeper` external to a module that is required by the internal `keeper` of said module. External `keeper`s are listed in the internal `keeper`'s type definition as interfaces. These interfaces are themselves defined in a `types/expected_keepers.go` file within the module's folder. In this context, interfaces are used to reduce the number of dependencies, as well as to facilitate the maintenance of the module itself. - `storeKey`s grant access to the store(s) of the [multistore](../core/store.md) managed by the module. They should always remain unexposed to external modules. -- A [codec `cdc`](../core/encoding.md), used to marshall and unmarshall struct to/from `[]byte`. +- A [codec `cdc`](../core/encoding.md), used to marshall and unmarshall struct to/from `[]byte`, that can be any of `codec.BinaryMarshaler`,`codec.JSONMarshaler` or `codec.Marshaler` based on your requirements. It can be either a proto or amino codec as long as they implement these interfaces. Of course, it is possible to define different types of internal `keeper`s for the same module (e.g. a read-only `keeper`). Each type of `keeper` comes with its own constructor function, which is called from the [application's constructor function](../basics/app-anatomy.md). This is where `keeper`s are instantiated, and where developers make sure to pass correct instances of modules' `keeper`s to other modules that require it. @@ -56,7 +56,7 @@ func (k Keeper) Get(ctx sdk.Context, key string) returnType and go through the following steps: -1. Retrieve the appropriate store from the `ctx` using the `storeKey`. This is done through the `KVStore(storeKey sdk.StoreKey` method of the `ctx`. +1. Retrieve the appropriate store from the `ctx` using the `storeKey`. This is done through the `KVStore(storeKey sdk.StoreKey)` method of the `ctx`. Then it's prefered to use the `prefix.Store` to access only the desired limited subset of the store for convenience and safety. 2. If it exists, get the `[]byte` value stored at location `[]byte(key)` using the `Get(key []byte)` method of the store. 3. Unmarshall the retrieved value from `[]byte` to `returnType` using the codec `cdc`. Return the value. @@ -68,11 +68,17 @@ func (k Keeper) Set(ctx sdk.Context, key string, value valueType) and go through the following steps: -1. Retrieve the appropriate store from the `ctx` using the `storeKey`. This is done through the `KVStore(storeKey sdk.StoreKey` method of the `ctx`. -2. Marhsall `value` to `[]byte` using the codec `cdc`. +1. Retrieve the appropriate store from the `ctx` using the `storeKey`. This is done through the `KVStore(storeKey sdk.StoreKey)` method of the `ctx`. Then it's prefered to use the `prefix.Store` to access only the desired limited subset of the store for convenience and safety. +2. Marshal `value` to `[]byte` using the codec `cdc`. 3. Set the encoded value in the store at location `key` using the `Set(key []byte, value []byte)` method of the store. -For more, see an example of `keeper`'s [methods implementation from the nameservice tutorial](https://github.com/cosmos/sdk-application-tutorial/blob/c6754a1e313eb1ed973c5c91dcc606f2fd288811/x/nameservice/internal/keeper/keeper.go). +For more, see an example of `keeper`'s [methods implementation from the `staking` module](https://github.com/cosmos/cosmos-sdk/blob/3bafd8255a502e5a9cee07391cf8261538245dfd/x/staking/keeper/keeper.go). + +The [module `KVStore`](../core/store.md#kvstore-and-commitkvstore-interfaces) also provides an `Iterator()` method which returns an `Iterator` object to iterate over a domain of keys. + +This is an example from the `auth` module to iterate accounts: + ++++ https://github.com/cosmos/cosmos-sdk/blob/bf8809ef9840b4f5369887a38d8345e2380a567f/x/auth/keeper/account.go#L70-L83 ## Next {hide} diff --git a/docs/building-modules/messages-and-queries.md b/docs/building-modules/messages-and-queries.md index 30ea4f344d..7139044981 100644 --- a/docs/building-modules/messages-and-queries.md +++ b/docs/building-modules/messages-and-queries.md @@ -16,39 +16,47 @@ order: 3 When a transaction is relayed from the underlying consensus engine to the SDK application, it is first decoded by [`baseapp`](../core/baseapp.md). Then, each `message` contained in the transaction is extracted and routed to the appropriate module via `baseapp`'s `router` so that it can be processed by the module's [`handler`](./handler.md). For a more detailed explanation of the lifecycle of a transaction, click [here](../basics/tx-lifecycle.md). -Defining `message`s is the responsibility of module developers. Typically, they are defined in a `./internal/types/msgs.go` file inside the module's folder. The `message`'s type definition usually includes a list of parameters needed to process the message that will be provided by end-users when they want to create a new transaction containing said `message`. +Defining `message`s is the responsibility of module developers. Typically, they are defined as protobuf messages in a `proto/` directory (see more info about [conventions and naming](../core/encoding.md#faq)). The `message`'s definition usually includes a list of parameters needed to process the message that will be provided by end-users when they want to create a new transaction containing said `message`. -```go -// Example of a message type definition +Here's an example of a protobuf message definition: -type MsgSubmitProposal struct { - Content Content `json:"content" yaml:"content"` - InitialDeposit sdk.Coins `json:"initial_deposit" yaml:"initial_deposit"` - Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"` -} -``` ++++ https://github.com/cosmos/cosmos-sdk/blob/d55c1a26657a0af937fa2273b38dcfa1bb3cff9f/proto/cosmos/gov/v1beta1/tx.proto#L15-L27 The `Msg` is typically accompanied by a standard constructor function, that is called from one of the [module's interface](./module-interfaces.md). `message`s also need to implement the [`Msg`] interface: -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/types/tx_msg.go#L7-L29 ++++ https://github.com/cosmos/cosmos-sdk/blob/4a1b2fba43b1052ca162b3a1e0b6db6db9c26656/types/tx_msg.go#L10-L33 -It contains the following methods: +It extends `proto.Message` and contains the following methods: - `Route() string`: Name of the route for this message. Typically all `message`s in a module have the same route, which is most often the module's name. - `Type() string`: Type of the message, used primarly in [events](../core/events.md). This should return a message-specific `string`, typically the denomination of the message itself. -- `ValidateBasic() Error`: This method is called by `baseapp` very early in the processing of the `message` (in both [`CheckTx`](../core/baseapp.md#checktx) and [`DeliverTx`](../core/baseapp.md#delivertx)), in order to discard obviously invalid messages. `ValidateBasic` should only include *stateless* checks, i.e. checks that do not require access to the state. This usually consists in checking that the message's parameters are correctly formatted and valid (i.e. that the `amount` is strictly positive for a transfer). +- `ValidateBasic() error`: This method is called by `baseapp` very early in the processing of the `message` (in both [`CheckTx`](../core/baseapp.md#checktx) and [`DeliverTx`](../core/baseapp.md#delivertx)), in order to discard obviously invalid messages. `ValidateBasic` should only include *stateless* checks, i.e. checks that do not require access to the state. This usually consists in checking that the message's parameters are correctly formatted and valid (i.e. that the `amount` is strictly positive for a transfer). - `GetSignBytes() []byte`: Return the canonical byte representation of the message. Used to generate a signature. - `GetSigners() []AccAddress`: Return the list of signers. The SDK will make sure that each `message` contained in a transaction is signed by all the signers listed in the list returned by this method. -See an example implementation of a `message` from the `nameservice` module: +See an example implementation of a `message` from the `gov` module: -+++ https://github.com/cosmos/sdk-tutorials/blob/86a27321cf89cc637581762e953d0c07f8c78ece/nameservice/x/nameservice/internal/types/msgs.go#L10-L51 ++++ https://github.com/cosmos/cosmos-sdk/blob/master/x/gov/types/msgs.go#L94-L136 ## Queries -A `query` is a request for information made by end-users of applications through an interface and processed by a full-node. A `query` is received by a full-node through its consensus engine and relayed to the application via the ABCI. It is then routed to the appropriate module via `baseapp`'s `queryrouter` so that it can be processed by the module's [`querier`](./querier.md). For a deeper look at the lifecycle of a `query`, click [here](../interfaces/query-lifecycle.md). +A `query` is a request for information made by end-users of applications through an interface and processed by a full-node. A `query` is received by a full-node through its consensus engine and relayed to the application via the ABCI. It is then routed to the appropriate module via `baseapp`'s `queryrouter` so that it can be processed by the module's query service (./query-services.md). For a deeper look at the lifecycle of a `query`, click [here](../interfaces/query-lifecycle.md). -Contrary to `message`s, there is usually no specific `query` object defined by module developers. Instead, the SDK takes the simpler approach of using a simple `path` to define each `query`. The `path` contains the `query` type and all the arguments needed in order to process it. For most module queries, the `path` should look like the following: +### gRPC Queries + +Starting from v0.40, the prefered way to define queries is by using [Protobuf services](https://developers.google.com/protocol-buffers/docs/proto#services). A `Query` service should be created per module in `query.proto`. This service lists endpoints starting with `rpc`. + +Here's an example of such a `Query` service definition: + ++++ https://github.com/cosmos/cosmos-sdk/blob/d55c1a26657a0af937fa2273b38dcfa1bb3cff9f/proto/cosmos/auth/v1beta1/query.proto#L12-L23 + +As `proto.Message`s, generated `Response` types implement by default `String()` method of [`fmt.Stringer`](https://golang.org/pkg/fmt/#Stringer). + +A `RegisterQueryServer` method is also generated and should be used to register the module's query server in `RegisterQueryService` method from the [`AppModule` interface](./module-manager.md#appmodule). + +### Legacy Queries + +Before the introduction of Protobuf and gRPC in the SDK, there was usually no specific `query` object defined by module developers, contrary to `message`s. Instead, the SDK took the simpler approach of using a simple `path` to define each `query`. The `path` contains the `query` type and all the arguments needed in order to process it. For most module queries, the `path` should look like the following: ``` queryCategory/queryRoute/queryType/arg1/arg2/... @@ -58,18 +66,24 @@ where: - `queryCategory` is the category of the `query`, typically `custom` for module queries. It is used to differentiate between different kinds of queries within `baseapp`'s [`Query` method](../core/baseapp.md#query). - `queryRoute` is used by `baseapp`'s [`queryRouter`](../core/baseapp.md#query-routing) to map the `query` to its module. Usually, `queryRoute` should be the name of the module. -- `queryType` is used by the module's [`querier`](./querier.md) to map the `query` to the appropriate `querier function` within the module. +- `queryType` is used by the module's [`querier`](./query-services.md#legacy-queriers) to map the `query` to the appropriate `querier function` within the module. - `args` are the actual arguments needed to process the `query`. They are filled out by the end-user. Note that for bigger queries, you might prefer passing arguments in the `Data` field of the request `req` instead of the `path`. The `path` for each `query` must be defined by the module developer in the module's [command-line interface file](./module-interfaces.md#query-commands).Overall, there are 3 mains components module developers need to implement in order to make the subset of the state defined by their module queryable: -- A [`querier`](./querier.md), to process the `query` once it has been [routed to the module](../core/baseapp.md#query-routing). +- A [`querier`](./query-services.md#legacy-queriers), to process the `query` once it has been [routed to the module](../core/baseapp.md#query-routing). - [Query commands](./module-interfaces.md#query-commands) in the module's CLI file, where the `path` for each `query` is specified. -- `query` return types. Typically defined in a file `internal/types/querier.go`, they specify the result type of each of the module's `queries`. These custom types must implement the `String()` method of [`fmt.Stringer`](https://golang.org/pkg/fmt/#Stringer). +- `query` return types. Typically defined in a file `types/querier.go`, they specify the result type of each of the module's `queries`. These custom types must implement the `String()` method of [`fmt.Stringer`](https://golang.org/pkg/fmt/#Stringer). -See an example of `query` return types from the `nameservice` module: +### Store Queries -+++ https://github.com/cosmos/sdk-tutorials/blob/c6754a1e313eb1ed973c5c91dcc606f2fd288811/x/nameservice/internal/types/querier.go#L5-L21 +Store queries query directly for store keys. They use `clientCtx.QueryABCI(req abci.RequestQuery)` to return the full `abci.ResponseQuery` with inclusion Merkle proofs. + +See following examples: + ++++ https://github.com/cosmos/cosmos-sdk/blob/080fcf1df25ccdf97f3029b6b6f83caaf5a235e4/x/ibc/core/client/query.go#L36-L46 + ++++ https://github.com/cosmos/cosmos-sdk/blob/080fcf1df25ccdf97f3029b6b6f83caaf5a235e4/baseapp/abci.go#L722-L749 ## Next {hide} diff --git a/docs/building-modules/module-interfaces.md b/docs/building-modules/module-interfaces.md index d2761248d9..1c8dcdbce2 100644 --- a/docs/building-modules/module-interfaces.md +++ b/docs/building-modules/module-interfaces.md @@ -16,49 +16,47 @@ One of the main interfaces for an application is the [command-line interface](.. ### Transaction Commands -[Transactions](../core/transactions.md) are created by users to wrap messages that trigger state changes when they get included in a valid block. Transaction commands typically have their own `tx.go` file in the module `./x/moduleName/client/cli` folder. The commands are specified in getter functions prefixed with `GetCmd` and include the name of the command. +[Transactions](../core/transactions.md) are created by users to wrap messages that trigger state changes when they get included in a valid block. Transaction commands typically have their own `tx.go` file in the module `./x/moduleName/client/cli` folder. The commands are specified in getter functions and include the name of the command. -Here is an example from the `nameservice` module: +Here is an example from the `auth` module: -+++ https://github.com/cosmos/sdk-tutorials/blob/86a27321cf89cc637581762e953d0c07f8c78ece/nameservice/x/nameservice/client/cli/tx.go#L33-L58 ++++ https://github.com/cosmos/cosmos-sdk/blob/64b6bb5270e1a3b688c2d98a8f481ae04bb713ca/x/auth/client/cli/tx_sign.go#L160-L194 -This getter function creates the command for the Buy Name transaction. It does the following: +This getter function creates the command for the `Sign` transaction. It does the following: -- **Construct the command:** Read the [Cobra Documentation](https://github.com/spf13/cobra) for details on how to create commands. +- **Construct the command:** Read the [Cobra Documentation](https://godoc.org/github.com/spf13/cobra) for details on how to create commands. - **Use:** Specifies the format of a command-line entry users should type in order to invoke this command. In this case, the user uses `buy-name` as the name of the transaction command and provides the `name` the user wishes to buy and the `amount` the user is willing to pay. - **Args:** The number of arguments the user provides, in this case exactly two: `name` and `amount`. - **Short and Long:** A description for the function is provided here. A `Short` description is expected, and `Long` can be used to provide a more detailed description when a user uses the `--help` flag to ask for more information. - **RunE:** Defines a function that can return an error, called when the command is executed. Using `Run` would do the same thing, but would not allow for errors to be returned. - **`RunE` Function Body:** The function should be specified as a `RunE` to allow for errors to be returned. This function encapsulates all of the logic to create a new transaction that is ready to be relayed to nodes. - - The function should first initialize a [`TxBuilder`](../core/transactions.md#txbuilder) with the application `codec`'s `TxEncoder`, as well as a new [`Context`](../interfaces/query-lifecycle.md#context) with the `codec` and `AccountDecoder`. These contexts contain all the information provided by the user and will be used to transfer this user-specific information between processes. To learn more about how contexts are used in a transaction, click [here](../core/transactions.md#transaction-generation). - - If applicable, the command's arguments are parsed. Here, the `amount` given by the user is parsed into a denomination of `coins`. - - If applicable, the `Context` is used to retrieve any parameters such as the transaction originator's address to be used in the transaction. Here, the `from` address is retrieved by calling `cliCtx.getFromAddress()`. + - The function should first get the `clientCtx` with `client.GetClientContextFromCmd(cmd)` and `client.ReadTxCommandFlags(clientCtx, cmd.Flags())`. This context contains all the information provided by the user and will be used to transfer this user-specific information between processes. To learn more about how contexts are used in a transaction, click [here](../core/transactions.md#transaction-generation). + - If applicable, the command's arguments are parsed. + - If applicable, the `Context` is used to retrieve any parameters such as the transaction originator's address to be used in the transaction. Here, the `from` address is retrieved by calling `clientCtx.GetFromAddress()`. - A [message](./messages-and-queries.md) is created using all parameters parsed from the command arguments and `Context`. The constructor function of the specific message type is called directly. It is good practice to call `ValidateBasic()` on the newly created message to run a sanity check and check for invalid arguments. - Depending on what the user wants, the transaction is either generated offline or signed and broadcasted to the preconfigured node using `GenerateOrBroadcastMsgs()`. -- **Flags.** Add any [flags](#flags) to the command. No flags were specified here, but all transaction commands have flags to provide additional information from the user (e.g. amount of fees they are willing to pay). These _persistent_ [transaction flags](../interfaces/cli.md#flags) can be added to a higher-level command so that they apply to all transaction commands. +- **Flags.** Add any [flags](#flags) to the command. All transaction commands have flags to provide additional information from the user (e.g. amount of fees they are willing to pay). These _persistent_ [transaction flags](../interfaces/cli.md#flags) can be added to a higher-level command so that they apply to all transaction commands. -Finally, the module needs to have a `GetTxCmd()`, which aggregates all of the transaction commands of the module. Often, each command getter function has its own file in the module's `cli` folder, and a separate `tx.go` file contains `GetTxCmd()`. Application developers wishing to include the module's transactions will call this function to add them as subcommands in their CLI. Here is the `auth` `GetTxCmd()` function, which adds the `Sign` and `MultiSign` commands. +Finally, the module needs to have a `GetTxCmd()`, which aggregates all of the transaction commands of the module. Often, each command getter function has its own file in the module's `cli` folder, and a separate `tx.go` file contains `GetTxCmd()`. Application developers wishing to include the module's transactions will call this function to add them as subcommands in their CLI. Here is the `auth` `GetTxCmd()` function, which adds the `Sign`, `MultiSign`, `ValidateSignatures` and `SignBatch` commands. -+++ https://github.com/cosmos/cosmos-sdk/blob/67f6b021180c7ef0bcf25b6597a629aca27766b8/x/auth/client/cli/tx.go#L11-L25 ++++ https://github.com/cosmos/cosmos-sdk/blob/351192aa0b52a42b66ff06e81cfa7a9e26667a7f/x/auth/client/cli/tx.go#L10-L26 An application using this module likely adds `auth` module commands to its root `TxCmd` command by calling `txCmd.AddCommand(authModuleClient.GetTxCmd())`. ### Query Commands -[Queries](./messages-and-queries.md#queries) allow users to gather information about the application or network state; they are routed by the application and processed by the module in which they are defined. Query commands typically have their own `query.go` file in the module `x/moduleName/client/cli` folder. Like transaction commands, they are specified in getter functions and have the prefix `GetCmdQuery`. Here is an example of a query command from the `nameservice` module: +[Queries](./messages-and-queries.md#queries) allow users to gather information about the application or network state; they are routed by the application and processed by the module in which they are defined. Query commands typically have their own `query.go` file in the module `x/moduleName/client/cli` folder. Like transaction commands, they are specified in getter functions. Here is an example of a query command from the `auth` module: -+++ https://github.com/cosmos/sdk-tutorials/blob/86a27321cf89cc637581762e953d0c07f8c78ece/nameservice/x/nameservice/client/cli/query.go#L52-L73 ++++ https://github.com/cosmos/cosmos-sdk/blob/d55c1a26657a0af937fa2273b38dcfa1bb3cff9f/x/auth/client/cli/query.go#L76-L108 -This query returns the address that owns a particular name. The getter function does the following: +This query returns the account at a given address. The getter function does the following: -- **`codec` and `queryRoute`.** In addition to taking in the application `codec`, query command getters also take a `queryRoute` used to construct a path [Baseapp](../core/baseapp.md#query-routing) uses to route the query in the application. -- **Construct the command.** Read the [Cobra Documentation](https://github.com/spf13/cobra) and the [transaction command](#transaction-commands) example above for more information. The user must type `whois` and provide the `name` they are querying for as the only argument. +- **Construct the command.** Read the [Cobra Documentation](https://godoc.org/github.com/spf13/cobra) and the [transaction command](#transaction-commands) example above for more information. The user must type `account` and provide the `address` they are querying for as the only argument. - **`RunE`.** The function should be specified as a `RunE` to allow for errors to be returned. This function encapsulates all of the logic to create a new query that is ready to be relayed to nodes. - - The function should first initialize a new [`Context`](../interfaces/query-lifecycle.md#context) with the application `codec`. + - The function should first initialize a new client [`Context`](../interfaces/query-lifecycle.md#context) as described in the [previous section](#transaction-commands) - If applicable, the `Context` is used to retrieve any parameters (e.g. the query originator's address to be used in the query) and marshal them with the query parameter type, in preparation to be relayed to a node. There are no `Context` parameters in this case because the query does not involve any information about the user. - - The `queryRoute` is used to construct a `path` [`baseapp`](../core/baseapp.md) will use to route the query to the appropriate [querier](./querier.md). The expected format for a query `path` is "queryCategory/queryRoute/queryType/arg1/arg2/...", where `queryCategory` can be `p2p`, `store`, `app`, or `custom`, `queryRoute` is the name of the module, and `queryType` is the name of the query type defined within the module. [`baseapp`](../core/baseapp.md) can handle each type of `queryCategory` by routing it to a module querier or retrieving results directly from stores and functions for querying peer nodes. Module queries are `custom` type queries (some SDK modules have exceptions, such as `auth` and `gov` module queries). - - The `Context` `QueryWithData()` function is used to relay the query to a node and retrieve the response. It requires the `path`. It returns the result and height of the query upon success or an error if the query fails. - - The `codec` is used to nmarshal the response and the `Context` is used to print the output back to the user. + - A new `queryClient` should be initialized using `NewQueryClient(clientCtx)`, this method being generated from `query.proto`. Then it can be used to call the appropriate [query](./messages-and-queries.md#grpc-queries). + - The `clientCtx.PrintOutput` method is used to print the output back to the user. - **Flags.** Add any [flags](#flags) to the command. Finally, the module also needs a `GetQueryCmd`, which aggregates all of the query commands of the module. Application developers wishing to include the module's queries will call this function to add them as subcommands in their CLI. Its structure is identical to the `GetTxCmd` command shown above. @@ -71,9 +69,9 @@ The flags for a module are typically found in a `flags.go` file in the `./x/modu For full details on flags, visit the [Cobra Documentation](https://github.com/spf13/cobra). -For example, the SDK `./client/flags` package includes a `PostCommands()` function that adds necessary flags to transaction commands, such as the `from` flag to indicate which address the transaction originates from. +For example, the SDK `./client/flags` package includes a `AddTxFlagsToCmd(cmd *cobra.Command)` function that adds necessary flags to a transaction command, such as the `from` flag to indicate which address the transaction originates from. -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/client/flags/flags.go#L85-L116 ++++ https://github.com/cosmos/cosmos-sdk/blob/cfb5fc03e5092395403d10156c0ee96e6ff1ddbe/client/flags/flags.go#L85-L112 Here is an example of how to add a flag using the `from` flag from this function. @@ -89,11 +87,54 @@ A flag can be marked as _required_ so that an error is automatically thrown if t cmd.MarkFlagRequired(FlagFrom) ``` -Since `PostCommands()` includes all of the basic flags required for a transaction command, module developers may choose not to add any of their own (specifying arguments instead may often be more appropriate). For a full list of what flags are included in the `PostCommands()` function, including which are required inputs from users, see the CLI documentation [here](../interfaces/cli.md#transaction-flags). +Since `AddTxFlagsToCmd(cmd *cobra.Command)` includes all of the basic flags required for a transaction command, module developers may choose not to add any of their own (specifying arguments instead may often be more appropriate). -## REST +Similarly, there is a `AddQueryFlagsToCmd(cmd *cobra.Command)` to add common flags to a module query command. -Applications typically support web services that use HTTP requests (e.g. a web wallet like [Lunie.io](https://lunie.io). Thus, application developers will also use REST Routes to route HTTP requests to the application's modules; these routes will be used by service providers. The module developer's responsibility is to define the REST client by defining [routes](#register-routes) for all possible [requests](#request-types) and [handlers](#request-handlers) for each of them. It's up to the module developer how to organize the REST interface files; there is typically a `rest.go` file found in the module's `./x/moduleName/client/rest` folder. +## gRPC + +[gRPC](https://grpc.io/) is the prefered way for external clients like wallets and exchanges to interact with a node. + +In addition to providing an ABCI query pathway, modules [custom queries](./messages-and-queries.md#grpc-queries) can provide a GRPC proxy server that routes requests in the GRPC protocol to ABCI query requests under the hood. + +In order to do that, module should implement `RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux)` on `AppModuleBasic` to wire the client gRPC requests to the correct handler inside the module. + +Here's an example from the `auth` module: + ++++ https://github.com/cosmos/cosmos-sdk/blob/64b6bb5270e1a3b688c2d98a8f481ae04bb713ca/x/auth/module.go#L69-L72 + +## gRPC-gateway REST + +Applications typically support web services that use HTTP requests (e.g. a web wallet like [Lunie.io](https://lunie.io). Thus, application developers can also use REST Routes to route HTTP requests to the application's modules; these routes will be used by service providers. + +[grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) translates REST calls into gRPC calls, which might be useful for clients that do not use gRPC. + +Modules that want to expose REST queries should add `google.api.http` annotations to their `rpc` methods, such as in the example below from the `auth` module: + +```proto +// Query defines the gRPC querier service. +service Query{ + // Account returns account details based on address. + rpc Account (QueryAccountRequest) returns (QueryAccountResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; + } + + // Params queries all parameters. + rpc Params (QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/params"; + } +} +``` + +gRPC gateway is started in-process along with the application and Tendermint. It can be enabled or disabled by setting gRPC Configuration `enable` in `app.toml`. + +The SDK provides a command for generating [Swagger](https://swagger.io/) documentation (`protoc-gen-swagger`). Setting `swagger` in `app.toml` defines if swagger documentation should be automatically registered. + +## Legacy REST + +Legacy REST endpoints will be deprecated. But developers may choose to keep using legacy REST endpoints for backward compatibility, although the recommended way is to use [gRPC](#grpc) and [gRPC-gateway](#grpc-gateway-rest). + +With this implementation, module developers need to define the REST client by defining [routes](#register-routes) for all possible [requests](#request-types) and [handlers](#request-handlers) for each of them. It's up to the module developer how to organize the REST interface files; there is typically a `rest.go` file found in the module's `./x/moduleName/client/rest` folder. To support HTTP requests, the module developer needs to define possible request types, how to handle them, and provide a way to register them with a provided router. @@ -101,11 +142,11 @@ To support HTTP requests, the module developer needs to define possible request Request types, which define structured interactions from users, must be defined for all _transaction_ requests. Users using this method to interact with an application will send HTTP Requests with the required fields in order to trigger state changes in the application. Conventionally, each request is named with the suffix `Req`, e.g. `SendReq` for a Send transaction. Each struct should include a base request [`baseReq`](../interfaces/rest.md#basereq), the name of the transaction, and all the arguments the user must provide for the transaction. -Here is an example of a request to buy a name from the `nameservice` module: +Here is an example of a request to send coins from the `bank` module: -+++ https://github.com/cosmos/sdk-tutorials/blob/master/nameservice/x/nameservice/client/rest/tx.go#L14-L19 ++++ https://github.com/cosmos/cosmos-sdk/blob/7f59723d889b69ca19966167f0b3a7fec7a39e53/x/bank/client/rest/tx.go#L15-L19 -The `BaseReq` includes basic information that every request needs to have, similar to required flags in a CLI. All of these values, including `GasPrices` and `AccountNumber`, will be provided in the request body. The user will also need to specify the arguments `Name` and `Amount` fields in the body and `Buyer` will be provided by the user's address. +The `BaseReq` includes basic information that every request needs to have, similar to required flags in a CLI. All of these values, including `GasPrices` and `AccountNumber`, will be provided in the request body. The user will also need to specify the argument `Amount` fields in the body. #### BaseReq @@ -116,6 +157,7 @@ The `BaseReq` includes basic information that every request needs to have, simil - `ChainID` specifies the unique identifier of the blockchain the transaction pertains to. - `AccountNumber` is an identifier for the account. - `Sequence`is the value of a counter measuring how many transactions have been sent from the account. It is used to prevent replay attacks. +- `TimeoutHeight` allows a transaction to be rejected if it's committed at a height greater than the timeout. - `Gas` refers to how much [gas](../basics/gas-fees.md), which represents computational resources, Tx consumes. Gas is dependent on the transaction and is not precisely calculated until execution, but can be estimated by providing auto as the value for `Gas`. - `GasAdjustment` can be used to scale gas up in order to avoid underestimating. For example, users can specify their gas adjustment as 1.5 to use 1.5 times the estimated gas. - `GasPrices` specifies how much the user is willing pay per unit of gas, which can be one or multiple denominations of tokens. For example, --gas-prices=0.025uatom, 0.025upho means the user is willing to pay 0.025uatom AND 0.025upho per unit of gas. @@ -124,17 +166,17 @@ The `BaseReq` includes basic information that every request needs to have, simil ### Request Handlers -Request handlers must be defined for both transaction and query requests. Handlers' arguments include a reference to the application's `codec` and the [`Context`](../interfaces/query-lifecycle.md#context) created in the user interaction. +Request handlers must be defined for both transaction and query requests. Handlers' arguments include a reference to the [client `Context`](../interfaces/query-lifecycle.md#context). -Here is an example of a request handler for the nameservice module `buyNameReq` request (the same one shown above): +Here is an example of a request handler for the `bank` module `SendReq` request (the same one shown above): -+++ https://github.com/cosmos/sdk-tutorials/blob/master/nameservice/x/nameservice/client/rest/tx.go#L21-L57 ++++ https://github.com/cosmos/cosmos-sdk/blob/7f59723d889b69ca19966167f0b3a7fec7a39e53/x/bank/client/rest/tx.go#L21-L51 The request handler can be broken down as follows: -- **Parse Request:** The request handler first attempts to parse the request, and then run `Sanitize` and `ValidateBasic` on the underlying `BaseReq` to check the validity of the request. Next, it attempts to parse the arguments `Buyer` and `Amount` to the types `AccountAddress` and `Coins` respectively. -- **Message:** Then, a [message](./messages-and-queries.md) of the type `MsgBuyName` (defined by the module developer to trigger the state changes for this transaction) is created from the values and another sanity check, `ValidateBasic` is run on it. -- **Generate Transaction:** Finally, the HTTP `ResponseWriter`, application [`codec`](../core/encoding.md), [`Context`](../interfaces/query-lifecycle.md#context), request [`BaseReq`](../interfaces/rest.md#basereq), and message is passed to `WriteGenerateStdTxResponse` to further process the request. +- **Parse Request:** First, it tries to parse the argument `address` into a `AccountAddress`. Then, the request handler attempts to parse the request, and then run `Sanitize` and `ValidateBasic` on the underlying `BaseReq` to check the validity of the request. Finally, it attempts to parse `BaseReq.From` to the type `AccountAddress`. +- **Message:** Then, a [message](./messages-and-queries.md#messages) of the type `MsgSend` (defined by the module developer to trigger the state changes for this transaction) is created from the values. +- **Generate Transaction:** Finally, the HTTP `ResponseWriter`, client `Context`, request [`BaseReq`](../interfaces/rest.md#basereq), and message is passed to `WriteGeneratedTxResponse` to further process the request. To read more about how a transaction is generated, visit the transactions documentation [here](../core/transactions.md#transaction-generation). diff --git a/docs/building-modules/module-manager.md b/docs/building-modules/module-manager.md index dad35a9da3..1c034bde71 100644 --- a/docs/building-modules/module-manager.md +++ b/docs/building-modules/module-manager.md @@ -29,15 +29,17 @@ are only used for genesis can take advantage of the `Module` patterns without ha The `AppModuleBasic` interface defines the independent methods modules need to implement. -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/types/module/module.go#L46-L59 ++++ https://github.com/cosmos/cosmos-sdk/blob/325be6ff215db457c6fc7668109640cd7fdac461/types/module/module.go#L49-L63 Let us go through the methods: - `Name()`: Returns the name of the module as a `string`. -- `RegisterLegacyAminoCodec(*codec.LegacyAmino)`: Registers the `amino` codec for the module, which is used to marhsal and unmarshal structs to/from `[]byte` in order to persist them in the moduel's `KVStore`. -- `DefaultGenesis()`: Returns a default [`GenesisState`](./genesis.md#genesisstate) for the module, marshalled to `json.RawMessage`. The default `GenesisState` need to be defined by the module developer and is primarily used for testing. -- `ValidateGenesis(json.RawMessage)`: Used to validate the `GenesisState` defined by a module, given in its `json.RawMessage` form. It will usually unmarshall the `json` before running a custom [`ValidateGenesis`](./genesis.md#validategenesis) function defined by the module developer. +- `RegisterLegacyAminoCodec(*codec.LegacyAmino)`: Registers the `amino` codec for the module, which is used to marshal and unmarshal structs to/from `[]byte` in order to persist them in the module's `KVStore`. +- `RegisterInterfaces(codectypes.InterfaceRegistry)`: Registers a module's interface types and their concrete implementations as `proto.Message`. +- `DefaultGenesis(codec.JSONMarshaler)`: Returns a default [`GenesisState`](./genesis.md#genesisstate) for the module, marshalled to `json.RawMessage`. The default `GenesisState` need to be defined by the module developer and is primarily used for testing. +- `ValidateGenesis(codec.JSONMarshaler, client.TxEncodingConfig, json.RawMessage)`: Used to validate the `GenesisState` defined by a module, given in its `json.RawMessage` form. It will usually unmarshall the `json` before running a custom [`ValidateGenesis`](./genesis.md#validategenesis) function defined by the module developer. - `RegisterRESTRoutes(client.Context, *mux.Router)`: Registers the REST routes for the module. These routes will be used to map REST request to the module in order to process them. See [../interfaces/rest.md] for more. +- `RegisterGRPCRoutes(client.Context, *runtime.ServeMux)`: Registers gRPC routes for the module. - `GetTxCmd()`: Returns the root [`Tx` command](./module-interfaces.md#tx) for the module. The subcommands of this root command are used by end-users to generate new transactions containing [`message`s](./messages-and-queries.md#queries) defined in the module. - `GetQueryCmd()`: Return the root [`query` command](./module-interfaces.md#query) for the module. The subcommands of this root command are used by end-users to generate new queries to the subset of the state defined by the module. @@ -47,20 +49,20 @@ All the `AppModuleBasic` of an application are managed by the [`BasicManager`](# The `AppModuleGenesis` interface is a simple embedding of the `AppModuleBasic` interface with two added methods. -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/types/module/module.go#L126-L131 ++++ https://github.com/cosmos/cosmos-sdk/blob/325be6ff215db457c6fc7668109640cd7fdac461/types/module/module.go#L152-L158 Let us go through the two added methods: -- `InitGenesis(sdk.Context, json.RawMessage)`: Initializes the subset of the state managed by the module. It is called at genesis (i.e. when the chain is first started). -- `ExportGenesis(sdk.Context)`: Exports the latest subset of the state managed by the module to be used in a new genesis file. `ExportGenesis` is called for each module when a new chain is started from the state of an existing chain. +- `InitGenesis(sdk.Context, codec.JSONMarshaler, json.RawMessage)`: Initializes the subset of the state managed by the module. It is called at genesis (i.e. when the chain is first started). +- `ExportGenesis(sdk.Context, codec.JSONMarshaler)`: Exports the latest subset of the state managed by the module to be used in a new genesis file. `ExportGenesis` is called for each module when a new chain is started from the state of an existing chain. -It does not have its own manager, and exists separately from [`AppModule`](#appmodule) only for modules that exist only to implement genesis functionalities, so that they can be managed without having to implement all of `AppModule`'s methods. If the module is not only used during genesis, `InitGenesis(sdk.Context, json.RawMessage)` and `ExportGenesis(sdk.Context)` will generally be defined as methods of the concrete type implementing hte `AppModule` interface. +It does not have its own manager, and exists separately from [`AppModule`](#appmodule) only for modules that exist only to implement genesis functionalities, so that they can be managed without having to implement all of `AppModule`'s methods. If the module is not only used during genesis, `InitGenesis(sdk.Context, codec.JSONMarshaler, json.RawMessage)` and `ExportGenesis(sdk.Context, codec.JSONMarshaler)` will generally be defined as methods of the concrete type implementing hte `AppModule` interface. ### `AppModule` The `AppModule` interface defines the inter-dependent methods modules need to implement. -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/types/module/module.go#L133-L149 ++++ https://github.com/cosmos/cosmos-sdk/blob/228728cce2af8d494c8b4e996d011492139b04ab/types/module/module.go#L160-L182 `AppModule`s are managed by the [module manager](#manager). This interface embeds the `AppModuleGenesis` interface so that the manager can access all the independent and genesis inter-dependent methods of the module. This means that a concrete type implementing the `AppModule` interface must either implement all the methods of `AppModuleGenesis` (and by extension `AppModuleBasic`), or include a concrete type that does as parameter. @@ -68,8 +70,9 @@ Let us go through the methods of `AppModule`: - `RegisterInvariants(sdk.InvariantRegistry)`: Registers the [`invariants`](./invariants.md) of the module. If the invariants deviates from its predicted value, the [`InvariantRegistry`](./invariants.md#registry) triggers appropriate logic (most often the chain will be halted). - `Route()`: Returns the route for [`message`s](./messages-and-queries.md#messages) to be routed to the module by [`baseapp`](../core/baseapp.md#message-routing). -- `QuerierRoute()`: Returns the name of the module's query route, for [`queries`](./messages-and-queries.md#queries) to be routes to the module by [`baseapp`](../core/baseapp.md#query-routing). -- `NewQuerierHandler()`: Returns a [`querier`](./querier.md) given the query `path`, in order to process the `query`. +- `QuerierRoute()` (deprecated): Returns the name of the module's query route, for [`queries`](./messages-and-queries.md#queries) to be routes to the module by [`baseapp`](../core/baseapp.md#query-routing). +- `LegacyQuerierHandler(*codec.LegacyAmino)` (deprecated): Returns a [`querier`](./query-services.md#legacy-queriers) given the query `path`, in order to process the `query`. +- `RegisterQueryService(grpc.Server)`: Allows a module to register a gRPC query service. - `BeginBlock(sdk.Context, abci.RequestBeginBlock)`: This method gives module developers the option to implement logic that is automatically triggered at the beginning of each block. Implement empty if no logic needs to be triggered at the beginning of each block for this module. - `EndBlock(sdk.Context, abci.RequestEndBlock)`: This method gives module developers the option to implement logic that is automatically triggered at the beginning of each block. This is also where the module can inform the underlying consensus engine of validator set changes (e.g. the `staking` module). Implement empty if no logic needs to be triggered at the beginning of each block for this module. @@ -103,15 +106,17 @@ Module managers are used to manage collections of `AppModuleBasic` and `AppModul The `BasicManager` is a structure that lists all the `AppModuleBasic` of an application: -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/types/module/module.go#L61-L63 ++++ https://github.com/cosmos/cosmos-sdk/blob/325be6ff215db457c6fc7668109640cd7fdac461/types/module/module.go#L65-L66 It implements the following methods: - `NewBasicManager(modules ...AppModuleBasic)`: Constructor function. It takes a list of the application's `AppModuleBasic` and builds a new `BasicManager`. This function is generally called in the `init()` function of [`app.go`](../basics/app-anatomy.md#core-application-file) to quickly initialize the independent elements of the application's modules (click [here](https://github.com/cosmos/gaia/blob/master/app/app.go#L59-L74) to see an example). -- `RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)`: Registers the [`codec`s](../core/encoding.md) of each of the application's `AppModuleBasic`. This function is usually called early on in the [application's construction](../basics/app-anatomy.md#constructor). -- `DefaultGenesis()`: Provides default genesis information for modules in the application by calling the [`DefaultGenesis()`](./genesis.md#defaultgenesis) function of each module. It is used to construct a default genesis file for the application. -- `ValidateGenesis(genesis map[string]json.RawMessage)`: Validates the genesis information modules by calling the [`ValidateGenesis()`](./genesis.md#validategenesis) function of each module. +- `RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)`: Registers the [`codec.LegacyAmino`s](../core/encoding.md#amino) of each of the application's `AppModuleBasic`. This function is usually called early on in the [application's construction](../basics/app-anatomy.md#constructor). +- `RegisterInterfaces(registry codectypes.InterfaceRegistry)`: Registers interface types and implementations of each of the application's `AppModuleBasic`. +- `DefaultGenesis(cdc codec.JSONMarshaler)`: Provides default genesis information for modules in the application by calling the [`DefaultGenesis(cdc codec.JSONMarshaler)`](./genesis.md#defaultgenesis) function of each module. It is used to construct a default genesis file for the application. +- `ValidateGenesis(cdc codec.JSONMarshaler, txEncCfg client.TxEncodingConfig, genesis map[string]json.RawMessage)`: Validates the genesis information modules by calling the [`ValidateGenesis(codec.JSONMarshaler, client.TxEncodingConfig, json.RawMessage)`](./genesis.md#validategenesis) function of each module. - `RegisterRESTRoutes(ctx client.Context, rtr *mux.Router)`: Registers REST routes for modules by calling the [`RegisterRESTRoutes`](./module-interfaces.md#register-routes) function of each module. This function is usually called function from the `main.go` function of the [application's command-line interface](../interfaces/cli.md). +- `RegisterGRPCRoutes(clientCtx client.Context, rtr *runtime.ServeMux)`: Registers gRPC routes for modules. - `AddTxCommands(rootTxCmd *cobra.Command)`: Adds modules' transaction commands to the application's [`rootTxCommand`](../interfaces/cli.md#transaction-commands). This function is usually called function from the `main.go` function of the [application's command-line interface](../interfaces/cli.md). - `AddQueryCommands(rootQueryCmd *cobra.Command)`: Adds modules' query commands to the application's [`rootQueryCommand`](../interfaces/cli.md#query-commands). This function is usually called function from the `main.go` function of the [application's command-line interface](../interfaces/cli.md). @@ -119,7 +124,7 @@ It implements the following methods: The `Manager` is a structure that holds all the `AppModule` of an application, and defines the order of execution between several key components of these modules: -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/types/module/module.go#L190-L198 ++++ https://github.com/cosmos/cosmos-sdk/blob/325be6ff215db457c6fc7668109640cd7fdac461/types/module/module.go#L223-L231 The module manager is used throughout the application whenever an action on a collection of modules is required. It implements the following methods: @@ -129,12 +134,17 @@ The module manager is used throughout the application whenever an action on a co - `SetOrderBeginBlockers(moduleNames ...string)`: Sets the order in which the `BeginBlock()` function of each module will be called at the beginning of each block. This function is generally called from the application's main [constructor function](../basics/app-anatomy.md#constructor-function). - `SetOrderEndBlockers(moduleNames ...string)`: Sets the order in which the `EndBlock()` function of each module will be called at the beginning of each block. This function is generally called from the application's main [constructor function](../basics/app-anatomy.md#constructor-function). - `RegisterInvariants(ir sdk.InvariantRegistry)`: Registers the [invariants](./invariants.md) of each module. -- `RegisterRoutes(router sdk.Router, queryRouter sdk.QueryRouter)`: Registers module routes to the application's `router`, in order to route [`message`s](./messages-and-queries.md#messages) to the appropriate [`handler`](./handler.md), and module query routes to the application's `queryRouter`, in order to route [`queries`](./messages-and-queries.md#queries) to the appropriate [`querier`](./querier.md). -- `InitGenesis(ctx sdk.Context, genesisData map[string]json.RawMessage)`: Calls the [`InitGenesis`](./genesis.md#initgenesis) function of each module when the application is first started, in the order defined in `OrderInitGenesis`. Returns an `abci.ResponseInitChain` to the underlying consensus engine, which can contain validator updates. -- `ExportGenesis(ctx sdk.Context)`: Calls the [`ExportGenesis`](./genesis.md#exportgenesis) function of each module, in the order defined in `OrderExportGenesis`. The export constructs a genesis file from a previously existing state, and is mainly used when a hard-fork upgrade of the chain is required. +- `RegisterRoutes(router sdk.Router, queryRouter sdk.QueryRouter, legacyQuerierCdc *codec.LegacyAmino)`: Registers module routes to the application's `router`, in order to route [`message`s](./messages-and-queries.md#messages) to the appropriate [`handler`](./handler.md), and module query routes to the application's `queryRouter`, in order to route [`queries`](./messages-and-queries.md#queries) to the appropriate [`querier`](./query-services.md#legacy-queriers). +- `RegisterQueryServices(grpcRouter grpc.Server)`: Registers all module gRPC query services. +- `InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, genesisData map[string]json.RawMessage)`: Calls the [`InitGenesis`](./genesis.md#initgenesis) function of each module when the application is first started, in the order defined in `OrderInitGenesis`. Returns an `abci.ResponseInitChain` to the underlying consensus engine, which can contain validator updates. +- `ExportGenesis(ctx sdk.Context, cdc codec.JSONMarshaler)`: Calls the [`ExportGenesis`](./genesis.md#exportgenesis) function of each module, in the order defined in `OrderExportGenesis`. The export constructs a genesis file from a previously existing state, and is mainly used when a hard-fork upgrade of the chain is required. - `BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)`: At the beginning of each block, this function is called from [`baseapp`](../core/baseapp.md#beginblock) and, in turn, calls the [`BeginBlock`](./beginblock-endblock.md) function of each module, in the order defined in `OrderBeginBlockers`. It creates a child [context](../core/context.md) with an event manager to aggregate [events](../core/events.md) emitted from all modules. The function returns an `abci.ResponseBeginBlock` which contains the aforementioned events. - `EndBlock(ctx sdk.Context, req abci.RequestEndBlock)`: At the end of each block, this function is called from [`baseapp`](../core/baseapp.md#endblock) and, in turn, calls the [`EndBlock`](./beginblock-endblock.md) function of each module, in the order defined in `OrderEndBlockers`. It creates a child [context](../core/context.md) with an event manager to aggregate [events](../core/events.md) emitted from all modules. The function returns an `abci.ResponseEndBlock` which contains the aforementioned events, as well as validator set updates (if any). +Here's an example of a concrete integration within an application: + ++++ https://github.com/cosmos/cosmos-sdk/blob/2323f1ac0e9a69a0da6b43693061036134193464/simapp/app.go#L315-L362 + ## Next {hide} Learn more about [`message`s and `queries`](./messages-and-queries.md) {hide} diff --git a/docs/building-modules/querier.md b/docs/building-modules/querier.md deleted file mode 100644 index 61eb1c5e10..0000000000 --- a/docs/building-modules/querier.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Queriers - -A `Querier` designates a function that processes [`queries`](./messages-and-queries.md#queries). `querier`s are specific to the module in which they are defined, and only process `queries` defined within said module. They are called from `baseapp`'s [`Query` method](../core/baseapp.md#query). {synopsis} - -## Pre-requisite Readings - -- [Module Manager](./module-manager.md) {prereq} -- [Messages and Queries](./messages-and-queries.md) {prereq} - -## `Querier` type - -The `querier` type defined in the Cosmos SDK specifies the typical structure of a `querier` function: - -+++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/types/queryable.go#L6 - -Let us break it down: - -- The `path` is an array of `string`s that contains the type of the query, and that can also contain `query` arguments. See [`queries`](./messages-and-queries.md#queries) for more information. -- The `req` itself is primarily used to retrieve arguments if they are too large to fit in the `path`. This is done using the `Data` field of `req`. -- The [`Context`](../core/context.md) contains all the necessary information needed to process the `query`, as well as a cache-wrapped copy of the latest state. It is primarily used by the [`keeper`](./keeper.md) to access the state. -- The result `res` returned to `baseapp`, marhsalled using the application's [`codec`](../core/encoding.md). - -## Implementation of a module `querier`s - -Module `querier`s are typically implemented in a `./internal/keeper/querier.go` file inside the module's folder. The [module manager](./module-manager.md) is used to add the module's `querier`s to the [application's `queryRouter`](../core/baseapp.md#query-routing) via the `NewQuerier()` method. Typically, the manager's `NewQuerier()` method simply calls a `NewQuerier()` method defined in `keeper/querier.go`, which looks like the following: - -```go -func NewQuerier(keeper Keeper) sdk.Querier { - return func(ctx sdk.Context, path []string, req abci.RequestQuery) ([]byte, error) { - switch path[0] { - case QueryType1: - return queryType1(ctx, path[1:], req, keeper) - - case QueryType2: - return queryType2(ctx, path[1:], req, keeper) - - default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unknown %s query endpoint: %s", types.ModuleName, path[0]) - } - } -} -``` - -This simple switch returns a `querier` function specific to the type of the received `query`. At this point of the [query lifecycle](../interfaces/query-lifecycle.md), the first element of the `path` (`path[0]`) contains the type of the query. The following elements are either empty or contain arguments needed to process the query. - -The `querier` functions themselves are pretty straighforward. They generally fetch a value or values from the state using the [`keeper`](./keeper.md). Then, they marshall the value(s) using the [`codec`](../core/encoding.md) and return the `[]byte` obtained as result. - -For a deeper look at `querier`s, see this [example implementation of a `querier` function](https://github.com/cosmos/sdk-application-tutorial/blob/c6754a1e313eb1ed973c5c91dcc606f2fd288811/x/nameservice/internal/keeper/querier.go) from the nameservice tutorial. - -## Next {hide} - -Learn about [`BeginBlocker` and `EndBlocker`](./beginblock-endblock.md) {hide} diff --git a/docs/building-modules/query-services.md b/docs/building-modules/query-services.md new file mode 100644 index 0000000000..fa7a6e0bae --- /dev/null +++ b/docs/building-modules/query-services.md @@ -0,0 +1,77 @@ + + +# Query Services + +A query service processes [`queries`](./messages-and-queries.md#queries). Query services are specific to the module in which they are defined, and only process `queries` defined within said module. They are called from `baseapp`'s [`Query` method](../core/baseapp.md#query). {synopsis} + +## Pre-requisite Readings + +- [Module Manager](./module-manager.md) {prereq} +- [Messages and Queries](./messages-and-queries.md) {prereq} + +## `Querier` type + +The `querier` type defined in the Cosmos SDK will be deprecated in favor of [gRPC Services](#grpc-service). It specifies the typical structure of a `querier` function: + ++++ https://github.com/cosmos/cosmos-sdk/blob/9a183ffbcc0163c8deb71c7fd5f8089a83e58f05/types/queryable.go#L9 + +Let us break it down: + +- The `path` is an array of `string`s that contains the type of the query, and that can also contain `query` arguments. See [`queries`](./messages-and-queries.md#queries) for more information. +- The `req` itself is primarily used to retrieve arguments if they are too large to fit in the `path`. This is done using the `Data` field of `req`. +- The [`Context`](../core/context.md) contains all the necessary information needed to process the `query`, as well as a cache-wrapped copy of the latest state. It is primarily used by the [`keeper`](./keeper.md) to access the state. +- The result `res` returned to `baseapp`, marshalled using the application's [`codec`](../core/encoding.md). + +## Implementation of a module query service + +### gRPC Service + +When defining a Protobuf `Query` service, a `QueryServer` interface is generated for each module with all the service methods: + +```go +type QueryServer interface { + QueryBalance(context.Context, *QueryBalanceParams) (*types.Coin, error) + QueryAllBalances(context.Context, *QueryAllBalancesParams) (*QueryAllBalancesResponse, error) +} +``` + +These custom queries methods should be implemented by a module's keeper, typically in `./keeper/grpc_query.go`. The first parameter of these methods is a generic `context.Context`, whereas querier methods generally need an instance of `sdk.Context` to read +from the store. Therefore, the SDK provides a function `sdk.UnwrapSDKContext` to retrieve the `sdk.Context` from the provided +`context.Context`. + +Here's an example implementation for the bank module: + ++++ https://github.com/cosmos/cosmos-sdk/blob/d55c1a26657a0af937fa2273b38dcfa1bb3cff9f/x/bank/keeper/grpc_query.go + +### Legacy Queriers + +Module legacy `querier`s are typically implemented in a `./keeper/querier.go` file inside the module's folder. The [module manager](./module-manager.md) is used to add the module's `querier`s to the [application's `queryRouter`](../core/baseapp.md#query-routing) via the `NewQuerier()` method. Typically, the manager's `NewQuerier()` method simply calls a `NewQuerier()` method defined in `keeper/querier.go`, which looks like the following: + +```go +func NewQuerier(keeper Keeper) sdk.Querier { + return func(ctx sdk.Context, path []string, req abci.RequestQuery) ([]byte, error) { + switch path[0] { + case QueryType1: + return queryType1(ctx, path[1:], req, keeper) + + case QueryType2: + return queryType2(ctx, path[1:], req, keeper) + + default: + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unknown %s query endpoint: %s", types.ModuleName, path[0]) + } + } +} +``` + +This simple switch returns a `querier` function specific to the type of the received `query`. At this point of the [query lifecycle](../interfaces/query-lifecycle.md), the first element of the `path` (`path[0]`) contains the type of the query. The following elements are either empty or contain arguments needed to process the query. + +The `querier` functions themselves are pretty straighforward. They generally fetch a value or values from the state using the [`keeper`](./keeper.md). Then, they marshall the value(s) using the [`codec`](../core/encoding.md) and return the `[]byte` obtained as result. + +For a deeper look at `querier`s, see this [example implementation of a `querier` function](https://github.com/cosmos/cosmos-sdk/blob/7f59723d889b69ca19966167f0b3a7fec7a39e53/x/gov/keeper/querier.go) from the bank module. + +## Next {hide} + +Learn about [`BeginBlocker` and `EndBlocker`](./beginblock-endblock.md) {hide} diff --git a/docs/building-modules/structure.md b/docs/building-modules/structure.md index 15e9c4bced..cdc2c6983c 100644 --- a/docs/building-modules/structure.md +++ b/docs/building-modules/structure.md @@ -27,6 +27,7 @@ x/{module} │   ├── keeper.go │   ├── ... │   └── querier.go +│   └── grpc_query.go ├── types │ ├── codec.go │ ├── errors.go @@ -36,10 +37,12 @@ x/{module} │ ├── keys.go │ ├── msgs.go │ ├── params.go -│ ├── types.pb.go │ ├── types.proto │ ├── ... │ └── querier.go +│ └── {module_name}.pb.go +│ └── query.pb.go +│ └── genesis.pb.go ├── simulation │   ├── decoder.go │   ├── genesis.go diff --git a/docs/core/baseapp.md b/docs/core/baseapp.md index beaba8b5e8..c4ea2c9faf 100644 --- a/docs/core/baseapp.md +++ b/docs/core/baseapp.md @@ -200,7 +200,7 @@ The application's `router` is initilalized with all the routes using the applica ### Query Routing -Similar to `message`s, [`queries`](../building-modules/messages-and-queries.md#queries) need to be routed to the appropriate module's [querier](../building-modules/querier.md). To do so, `baseapp` holds a `query router`, which maps module names to module `querier`s. The `queryRouter` is called during the initial stages of `query` processing, which is done via the [`Query` ABCI message](#query). +Similar to `message`s, [`queries`](../building-modules/messages-and-queries.md#queries) need to be routed to the appropriate module's [querier](../building-modules/query-services.md). To do so, `baseapp` holds a `query router`, which maps module names to module `querier`s. The `queryRouter` is called during the initial stages of `query` processing, which is done via the [`Query` ABCI message](#query). Just like the `router`, the `query router` is initilalized with all the query routes using the application's [module manager](../building-modules/module-manager.md), which itself is initialized with all the application's modules in the application's [constructor](../basics/app-anatomy.md#app-constructor). diff --git a/docs/core/encoding.md b/docs/core/encoding.md index 2e0012407f..69059b39c6 100644 --- a/docs/core/encoding.md +++ b/docs/core/encoding.md @@ -80,7 +80,7 @@ Modules are encouraged to utilize Protobuf encoding for their respective types. Protobuf types can be defined to encode: - state - [`Msg`s](../building-modules/messages-and-queries.md#messages) - - [queries](../building-modules/querier.md) + - [Query services](../building-modules/query-services.md) - [genesis](../building-modules/genesis.md) **Naming and conventions** diff --git a/docs/core/transactions.md b/docs/core/transactions.md index b5ae3bc57f..507f47e6b1 100644 --- a/docs/core/transactions.md +++ b/docs/core/transactions.md @@ -39,7 +39,7 @@ A transaction is created by an end-user through one of the possible [interfaces] Application developers create entrypoints to the application by creating a [command-line interface](../interfaces/cli.md) and/or [REST interface](../interfaces/rest.md), typically found in the application's `./cmd` folder. These interfaces allow users to interact with the application through command-line or through HTTP requests. -For the [command-line interface](../building-modules/module-interfaces.md#cli), module developers create subcommands to add as children to the application top-level transaction command `TxCmd`. For [HTTP requests](../building-modules/module-interfaces.md#rest), module developers specify acceptable request types, register REST routes, and create HTTP Request Handlers. +For the [command-line interface](../building-modules/module-interfaces.md#cli), module developers create subcommands to add as children to the application top-level transaction command `TxCmd`. For [HTTP requests](../building-modules/module-interfaces.md#legacy-rest), module developers specify acceptable request types, register REST routes, and create HTTP Request Handlers. When users interact with the application's interfaces, they invoke the underlying modules' handlers or command functions, directly creating messages. diff --git a/docs/interfaces/query-lifecycle.md b/docs/interfaces/query-lifecycle.md index 26fe4df978..ae4a2e800b 100644 --- a/docs/interfaces/query-lifecycle.md +++ b/docs/interfaces/query-lifecycle.md @@ -107,7 +107,7 @@ params := types.NewQueryDelegatorParams(delegatorAddr) #### Query Route Creation -Important to note is that there will never be a "query" object created for `Query`; the SDK actually takes a simpler approach. Instead of an object, all the full-node needs to process a query is its `route` which specifies exactly which module to route the query to and the name of this query type. The `route` will be passed to the application `baseapp`, then module, then [querier](../building-modules/querier.md), and each will understand the `route` and pass it to the appropriate next step. [`baseapp`](../core/baseapp.md#query-routing) will understand this query to be a `custom` query in the module `staking`, and the `staking` module querier supports the type `QueryDelegatorDelegations`. Thus, the route will be `"custom/staking/delegatorDelegations"`. +Important to note is that there will never be a "query" object created for `Query`; the SDK actually takes a simpler approach. Instead of an object, all the full-node needs to process a query is its `route` which specifies exactly which module to route the query to and the name of this query type. The `route` will be passed to the application `baseapp`, then module, then [querier](../building-modules/query-services.md#legacy-queriers), and each will understand the `route` and pass it to the appropriate next step. [`baseapp`](../core/baseapp.md#query-routing) will understand this query to be a `custom` query in the module `staking`, and the `staking` module querier supports the type `QueryDelegatorDelegations`. Thus, the route will be `"custom/staking/delegatorDelegations"`. Here is what the code looks like: @@ -133,9 +133,9 @@ Read more about ABCI Clients and Tendermint RPC in the Tendermint documentation ## Application Query Handling -When a query is received by the full-node after it has been relayed from the underlying consensus engine, it is now being handled within an environment that understands application-specific types and has a copy of the state. [`baseapp`](../core/baseapp.md) implements the ABCI [`Query()`](../core/baseapp.md#query) function and handles four different types of queries: `app`, `store`, `p2p`, and `custom`. The `queryRoute` is parsed such that the first string must be one of the four options, then the rest of the path is parsed within the subroutines handling each type of query. The first three types (`app`, `store`, `p2p`) are purely application-level and thus directly handled by `baseapp` or the stores, but the `custom` query type requires `baseapp` to route the query to a module's [querier](../building-modules/querier.md). +When a query is received by the full-node after it has been relayed from the underlying consensus engine, it is now being handled within an environment that understands application-specific types and has a copy of the state. [`baseapp`](../core/baseapp.md) implements the ABCI [`Query()`](../core/baseapp.md#query) function and handles four different types of queries: `app`, `store`, `p2p`, and `custom`. The `queryRoute` is parsed such that the first string must be one of the four options, then the rest of the path is parsed within the subroutines handling each type of query. The first three types (`app`, `store`, `p2p`) are purely application-level and thus directly handled by `baseapp` or the stores, but the `custom` query type requires `baseapp` to route the query to a module's [query service](../building-modules/query-services.md). -Since `Query` is a custom query type from the `staking` module, `baseapp` first parses the path, then uses the `QueryRouter` to retrieve the corresponding querier, and routes the query to the module. The querier is responsible for recognizing this query, retrieving the appropriate values from the application's stores, and returning a response. Read more about queriers [here](../building-modules/querier.md). +Since `Query` is a custom query type from the `staking` module, `baseapp` first parses the path, then uses the `QueryRouter` to retrieve the corresponding querier, and routes the query to the module. The querier is responsible for recognizing this query, retrieving the appropriate values from the application's stores, and returning a response. Read more about query services [here](../building-modules/query-services.md). Once a result is received from the querier, `baseapp` begins the process of returning a response to the user. diff --git a/docs/interfaces/rest.md b/docs/interfaces/rest.md index 6db69bc8bf..00e94b1d9a 100644 --- a/docs/interfaces/rest.md +++ b/docs/interfaces/rest.md @@ -4,7 +4,7 @@ order: 4 # REST Interface -This document describes how to create a REST interface for an SDK **application**. A separate document for creating a [**module**](../building-modules/intro.md) REST interface can be found [here](#../module-interfaces.md#rest). {synopsis} +This document describes how to create a REST interface for an SDK **application**. A separate document for creating a [**module**](../building-modules/intro.md) REST interface can be found [here](#../module-interfaces.md#legacy-rest). {synopsis} ## Pre-requisite Readings @@ -41,7 +41,7 @@ In order to enable the REST Server in an SDK application, the `rest.ServeCommand ## Registering Routes -To include routes for each module in an application, the CLI must have some kind of function to register routes in its REST Server. This function is called `RegisterRoutes()`, and is utilized by the `ServeCommand` and must include routes for each of the application's modules. Since each module used by an SDK application implements a [`RegisterRESTRoutes`](../building-modules/module-interfaces.md#rest) function, application developers simply use the [Module Manager](../building-modules/module-manager.md) to call this function for each module (this is done in the [application's constructor](../basics/app-anatomy.md#constructor-function)). +To include routes for each module in an application, the CLI must have some kind of function to register routes in its REST Server. This function is called `RegisterRoutes()`, and is utilized by the `ServeCommand` and must include routes for each of the application's modules. Since each module used by an SDK application implements a [`RegisterRESTRoutes`](../building-modules/module-interfaces.md#legacy-rest) function, application developers simply use the [Module Manager](../building-modules/module-manager.md) to call this function for each module (this is done in the [application's constructor](../basics/app-anatomy.md#constructor-function)). At the bare minimum, a `RegisterRoutes()` function should use the SDK client package `RegisterRoutes()` function to be able to route RPC calls, and instruct the application Module Manager to call `RegisterRESTRoutes()` for all of its modules. This is done in the `main.go` file of the CLI (typically located in `./cmd/appcli/main.go`). From 652d5d93bb4ac33d37fc1ad91356d9fb1290a0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Wed, 14 Oct 2020 16:51:11 +0200 Subject: [PATCH 24/84] remove test_utils.go in tm client (#7522) * remove test_utils from tm client * fix build * fix lint? * fix lint? * apply @fedekunze review suggestion * add tests as per @alessio suggestion * fix typo --- x/ibc/core/02-client/keeper/client_test.go | 34 +++--- x/ibc/core/02-client/keeper/keeper_test.go | 4 +- x/ibc/core/02-client/types/genesis_test.go | 2 +- x/ibc/core/02-client/types/msgs_test.go | 22 ++-- x/ibc/core/genesis_test.go | 29 ++--- x/ibc/core/handler_test.go | 33 ++++-- x/ibc/core/ibc_test.go | 87 --------------- .../types/misbehaviour_handle_test.go | 82 +++++++------- .../07-tendermint/types/misbehaviour_test.go | 35 +++--- .../07-tendermint/types/tendermint_test.go | 2 +- .../07-tendermint/types/test_utils.go | 105 ------------------ .../07-tendermint/types/update_test.go | 38 +++---- x/ibc/testing/chain.go | 81 +++++++++++--- x/ibc/testing/chain_test.go | 47 ++++++++ 14 files changed, 261 insertions(+), 340 deletions(-) delete mode 100644 x/ibc/core/ibc_test.go delete mode 100644 x/ibc/light-clients/07-tendermint/types/test_utils.go create mode 100644 x/ibc/testing/chain_test.go diff --git a/x/ibc/core/02-client/keeper/client_test.go b/x/ibc/core/02-client/keeper/client_test.go index eae37c1aa7..d0e8a06254 100644 --- a/x/ibc/core/02-client/keeper/client_test.go +++ b/x/ibc/core/02-client/keeper/client_test.go @@ -60,14 +60,14 @@ func (suite *KeeperTestSuite) TestUpdateClientTendermint() { heightPlus3 := clienttypes.NewHeight(suite.header.GetHeight().GetVersionNumber(), suite.header.GetHeight().GetVersionHeight()+3) height := suite.header.GetHeight().(clienttypes.Height) - return ibctmtypes.CreateTestHeader(testChainID, heightPlus3, height, suite.header.Header.Time.Add(time.Hour), + return suite.chainA.CreateTMClientHeader(testChainID, int64(heightPlus3.VersionHeight), height, suite.header.Header.Time.Add(time.Hour), suite.valSet, suite.valSet, []tmtypes.PrivValidator{suite.privVal}) } createPastUpdateFn := func(s *KeeperTestSuite) *ibctmtypes.Header { heightMinus2 := clienttypes.NewHeight(suite.header.GetHeight().GetVersionNumber(), suite.header.GetHeight().GetVersionHeight()-2) heightMinus4 := clienttypes.NewHeight(suite.header.GetHeight().GetVersionNumber(), suite.header.GetHeight().GetVersionHeight()-4) - return ibctmtypes.CreateTestHeader(testChainID, heightMinus2, heightMinus4, suite.header.Header.Time, + return suite.chainA.CreateTMClientHeader(testChainID, int64(heightMinus2.VersionHeight), heightMinus4, suite.header.Header.Time, suite.valSet, suite.valSet, []tmtypes.PrivValidator{suite.privVal}) } var ( @@ -393,7 +393,7 @@ func (suite *KeeperTestSuite) TestCheckMisbehaviourAndUpdateState() { // Create signer array and ensure it is in same order as bothValSet _, suiteVal := suite.valSet.GetByIndex(0) - bothSigners := ibctmtypes.CreateSortedSignerArray(altPrivVal, suite.privVal, altVal, suiteVal) + bothSigners := ibctesting.CreateSortedSignerArray(altPrivVal, suite.privVal, altVal, suiteVal) altSigners := []tmtypes.PrivValidator{altPrivVal} @@ -412,8 +412,8 @@ func (suite *KeeperTestSuite) TestCheckMisbehaviourAndUpdateState() { { "trusting period misbehavior should pass", &ibctmtypes.Misbehaviour{ - Header1: ibctmtypes.CreateTestHeader(testChainID, testClientHeight, testClientHeight, altTime, bothValSet, bothValSet, bothSigners), - Header2: ibctmtypes.CreateTestHeader(testChainID, testClientHeight, testClientHeight, suite.ctx.BlockTime(), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(testChainID, int64(testClientHeight.VersionHeight), testClientHeight, altTime, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(testChainID, int64(testClientHeight.VersionHeight), testClientHeight, suite.ctx.BlockTime(), bothValSet, bothValSet, bothSigners), ChainId: testChainID, ClientId: testClientID, }, @@ -429,8 +429,8 @@ func (suite *KeeperTestSuite) TestCheckMisbehaviourAndUpdateState() { { "misbehavior at later height should pass", &ibctmtypes.Misbehaviour{ - Header1: ibctmtypes.CreateTestHeader(testChainID, heightPlus5, testClientHeight, altTime, bothValSet, valSet, bothSigners), - Header2: ibctmtypes.CreateTestHeader(testChainID, heightPlus5, testClientHeight, suite.ctx.BlockTime(), bothValSet, valSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(testChainID, int64(heightPlus5.VersionHeight), testClientHeight, altTime, bothValSet, valSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(testChainID, int64(heightPlus5.VersionHeight), testClientHeight, suite.ctx.BlockTime(), bothValSet, valSet, bothSigners), ChainId: testChainID, ClientId: testClientID, }, @@ -456,8 +456,8 @@ func (suite *KeeperTestSuite) TestCheckMisbehaviourAndUpdateState() { { "misbehavior at later height with different trusted heights should pass", &ibctmtypes.Misbehaviour{ - Header1: ibctmtypes.CreateTestHeader(testChainID, heightPlus5, testClientHeight, altTime, bothValSet, valSet, bothSigners), - Header2: ibctmtypes.CreateTestHeader(testChainID, heightPlus5, heightPlus3, suite.ctx.BlockTime(), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(testChainID, int64(heightPlus5.VersionHeight), testClientHeight, altTime, bothValSet, valSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(testChainID, int64(heightPlus5.VersionHeight), heightPlus3, suite.ctx.BlockTime(), bothValSet, bothValSet, bothSigners), ChainId: testChainID, ClientId: testClientID, }, @@ -483,8 +483,8 @@ func (suite *KeeperTestSuite) TestCheckMisbehaviourAndUpdateState() { { "trusted ConsensusState1 not found", &ibctmtypes.Misbehaviour{ - Header1: ibctmtypes.CreateTestHeader(testChainID, heightPlus5, heightPlus3, altTime, bothValSet, bothValSet, bothSigners), - Header2: ibctmtypes.CreateTestHeader(testChainID, heightPlus5, testClientHeight, suite.ctx.BlockTime(), bothValSet, valSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(testChainID, int64(heightPlus5.VersionHeight), heightPlus3, altTime, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(testChainID, int64(heightPlus5.VersionHeight), testClientHeight, suite.ctx.BlockTime(), bothValSet, valSet, bothSigners), ChainId: testChainID, ClientId: testClientID, }, @@ -500,8 +500,8 @@ func (suite *KeeperTestSuite) TestCheckMisbehaviourAndUpdateState() { { "trusted ConsensusState2 not found", &ibctmtypes.Misbehaviour{ - Header1: ibctmtypes.CreateTestHeader(testChainID, heightPlus5, testClientHeight, altTime, bothValSet, valSet, bothSigners), - Header2: ibctmtypes.CreateTestHeader(testChainID, heightPlus5, heightPlus3, suite.ctx.BlockTime(), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(testChainID, int64(heightPlus5.VersionHeight), testClientHeight, altTime, bothValSet, valSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(testChainID, int64(heightPlus5.VersionHeight), heightPlus3, suite.ctx.BlockTime(), bothValSet, bothValSet, bothSigners), ChainId: testChainID, ClientId: testClientID, }, @@ -523,8 +523,8 @@ func (suite *KeeperTestSuite) TestCheckMisbehaviourAndUpdateState() { { "client already frozen at earlier height", &ibctmtypes.Misbehaviour{ - Header1: ibctmtypes.CreateTestHeader(testChainID, testClientHeight, testClientHeight, altTime, bothValSet, bothValSet, bothSigners), - Header2: ibctmtypes.CreateTestHeader(testChainID, testClientHeight, testClientHeight, suite.ctx.BlockTime(), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(testChainID, int64(testClientHeight.VersionHeight), testClientHeight, altTime, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(testChainID, int64(testClientHeight.VersionHeight), testClientHeight, suite.ctx.BlockTime(), bothValSet, bothValSet, bothSigners), ChainId: testChainID, ClientId: testClientID, }, @@ -543,8 +543,8 @@ func (suite *KeeperTestSuite) TestCheckMisbehaviourAndUpdateState() { { "misbehaviour check failed", &ibctmtypes.Misbehaviour{ - Header1: ibctmtypes.CreateTestHeader(testChainID, testClientHeight, testClientHeight, altTime, bothValSet, bothValSet, bothSigners), - Header2: ibctmtypes.CreateTestHeader(testChainID, testClientHeight, testClientHeight, suite.ctx.BlockTime(), altValSet, bothValSet, altSigners), + Header1: suite.chainA.CreateTMClientHeader(testChainID, int64(testClientHeight.VersionHeight), testClientHeight, altTime, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(testChainID, int64(testClientHeight.VersionHeight), testClientHeight, suite.ctx.BlockTime(), altValSet, bothValSet, altSigners), ChainId: testChainID, ClientId: testClientID, }, diff --git a/x/ibc/core/02-client/keeper/keeper_test.go b/x/ibc/core/02-client/keeper/keeper_test.go index 8db04b6432..c2f18311be 100644 --- a/x/ibc/core/02-client/keeper/keeper_test.go +++ b/x/ibc/core/02-client/keeper/keeper_test.go @@ -94,7 +94,7 @@ func (suite *KeeperTestSuite) SetupTest() { validator := tmtypes.NewValidator(pubKey.(cryptotypes.IntoTmPubKey).AsTmPubKey(), 1) suite.valSet = tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) suite.valSetHash = suite.valSet.Hash() - suite.header = ibctmtypes.CreateTestHeader(testChainID, testClientHeight, testClientHeightMinus1, now2, suite.valSet, suite.valSet, []tmtypes.PrivValidator{suite.privVal}) + suite.header = suite.chainA.CreateTMClientHeader(testChainID, int64(testClientHeight.VersionHeight), testClientHeightMinus1, now2, suite.valSet, suite.valSet, []tmtypes.PrivValidator{suite.privVal}) suite.consensusState = ibctmtypes.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot([]byte("hash")), suite.valSetHash) var validators stakingtypes.Validators @@ -319,7 +319,7 @@ func (suite KeeperTestSuite) TestConsensusStateHelpers() { testClientHeightPlus5 := types.NewHeight(0, height+5) - header := ibctmtypes.CreateTestHeader(testClientID, testClientHeightPlus5, testClientHeight, suite.header.Header.Time.Add(time.Minute), + header := suite.chainA.CreateTMClientHeader(testClientID, int64(testClientHeightPlus5.VersionHeight), testClientHeight, suite.header.Header.Time.Add(time.Minute), suite.valSet, suite.valSet, []tmtypes.PrivValidator{suite.privVal}) // mock update functionality diff --git a/x/ibc/core/02-client/types/genesis_test.go b/x/ibc/core/02-client/types/genesis_test.go index 5661fa05f7..1de9103354 100644 --- a/x/ibc/core/02-client/types/genesis_test.go +++ b/x/ibc/core/02-client/types/genesis_test.go @@ -53,7 +53,7 @@ func (suite *TypesTestSuite) TestValidateGenesis() { valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{val}) heightMinus1 := types.NewHeight(0, height-1) - header := ibctmtypes.CreateTestHeader(chainID, clientHeight, heightMinus1, now, valSet, valSet, []tmtypes.PrivValidator{privVal}) + header := suite.chainA.CreateTMClientHeader(chainID, int64(clientHeight.VersionHeight), heightMinus1, now, valSet, valSet, []tmtypes.PrivValidator{privVal}) testCases := []struct { name string diff --git a/x/ibc/core/02-client/types/msgs_test.go b/x/ibc/core/02-client/types/msgs_test.go index 23c31e3dcb..adaf95cde8 100644 --- a/x/ibc/core/02-client/types/msgs_test.go +++ b/x/ibc/core/02-client/types/msgs_test.go @@ -57,7 +57,7 @@ func (suite *TypesTestSuite) TestMarshalMsgCreateClient() { { "tendermint client", func() { tendermintClient := ibctmtypes.NewClientState(suite.chainA.ChainID, ibctesting.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod, ibctesting.MaxClockDrift, clientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) - msg, err = types.NewMsgCreateClient("tendermint", tendermintClient, suite.chainA.CreateTMClientHeader().ConsensusState(), suite.chainA.SenderAccount.GetAddress()) + msg, err = types.NewMsgCreateClient("tendermint", tendermintClient, suite.chainA.CurrentTMClientHeader().ConsensusState(), suite.chainA.SenderAccount.GetAddress()) suite.Require().NoError(err) }, }, @@ -109,7 +109,7 @@ func (suite *TypesTestSuite) TestMsgCreateClient_ValidateBasic() { "valid - tendermint client", func() { tendermintClient := ibctmtypes.NewClientState(suite.chainA.ChainID, ibctesting.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod, ibctesting.MaxClockDrift, clientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) - msg, err = types.NewMsgCreateClient("tendermint", tendermintClient, suite.chainA.CreateTMClientHeader().ConsensusState(), suite.chainA.SenderAccount.GetAddress()) + msg, err = types.NewMsgCreateClient("tendermint", tendermintClient, suite.chainA.CurrentTMClientHeader().ConsensusState(), suite.chainA.SenderAccount.GetAddress()) suite.Require().NoError(err) }, true, @@ -117,7 +117,7 @@ func (suite *TypesTestSuite) TestMsgCreateClient_ValidateBasic() { { "invalid tendermint client", func() { - msg, err = types.NewMsgCreateClient("tendermint", &ibctmtypes.ClientState{}, suite.chainA.CreateTMClientHeader().ConsensusState(), suite.chainA.SenderAccount.GetAddress()) + msg, err = types.NewMsgCreateClient("tendermint", &ibctmtypes.ClientState{}, suite.chainA.CurrentTMClientHeader().ConsensusState(), suite.chainA.SenderAccount.GetAddress()) suite.Require().NoError(err) }, false, @@ -133,7 +133,7 @@ func (suite *TypesTestSuite) TestMsgCreateClient_ValidateBasic() { "failed to unpack consensus state", func() { tendermintClient := ibctmtypes.NewClientState(suite.chainA.ChainID, ibctesting.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod, ibctesting.MaxClockDrift, clientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) - msg, err = types.NewMsgCreateClient("tendermint", tendermintClient, suite.chainA.CreateTMClientHeader().ConsensusState(), suite.chainA.SenderAccount.GetAddress()) + msg, err = types.NewMsgCreateClient("tendermint", tendermintClient, suite.chainA.CurrentTMClientHeader().ConsensusState(), suite.chainA.SenderAccount.GetAddress()) suite.Require().NoError(err) msg.ConsensusState = nil }, @@ -216,7 +216,7 @@ func (suite *TypesTestSuite) TestMarshalMsgUpdateClient() { }, { "tendermint client", func() { - msg, err = types.NewMsgUpdateClient("tendermint", suite.chainA.CreateTMClientHeader(), suite.chainA.SenderAccount.GetAddress()) + msg, err = types.NewMsgUpdateClient("tendermint", suite.chainA.CurrentTMClientHeader(), suite.chainA.SenderAccount.GetAddress()) suite.Require().NoError(err) }, @@ -268,7 +268,7 @@ func (suite *TypesTestSuite) TestMsgUpdateClient_ValidateBasic() { { "valid - tendermint header", func() { - msg, err = types.NewMsgUpdateClient("tendermint", suite.chainA.CreateTMClientHeader(), suite.chainA.SenderAccount.GetAddress()) + msg, err = types.NewMsgUpdateClient("tendermint", suite.chainA.CurrentTMClientHeader(), suite.chainA.SenderAccount.GetAddress()) suite.Require().NoError(err) }, true, @@ -315,7 +315,7 @@ func (suite *TypesTestSuite) TestMsgUpdateClient_ValidateBasic() { { "unsupported - localhost", func() { - msg, err = types.NewMsgUpdateClient(exported.Localhost, suite.chainA.CreateTMClientHeader(), suite.chainA.SenderAccount.GetAddress()) + msg, err = types.NewMsgUpdateClient(exported.Localhost, suite.chainA.CurrentTMClientHeader(), suite.chainA.SenderAccount.GetAddress()) suite.Require().NoError(err) }, false, @@ -500,8 +500,8 @@ func (suite *TypesTestSuite) TestMarshalMsgSubmitMisbehaviour() { "tendermint client", func() { height := types.NewHeight(0, uint64(suite.chainA.CurrentHeader.Height)) heightMinus1 := types.NewHeight(0, uint64(suite.chainA.CurrentHeader.Height)-1) - header1 := ibctmtypes.CreateTestHeader(suite.chainA.ChainID, height, heightMinus1, suite.chainA.CurrentHeader.Time, suite.chainA.Vals, suite.chainA.Vals, suite.chainA.Signers) - header2 := ibctmtypes.CreateTestHeader(suite.chainA.ChainID, height, heightMinus1, suite.chainA.CurrentHeader.Time.Add(time.Minute), suite.chainA.Vals, suite.chainA.Vals, suite.chainA.Signers) + header1 := suite.chainA.CreateTMClientHeader(suite.chainA.ChainID, int64(height.VersionHeight), heightMinus1, suite.chainA.CurrentHeader.Time, suite.chainA.Vals, suite.chainA.Vals, suite.chainA.Signers) + header2 := suite.chainA.CreateTMClientHeader(suite.chainA.ChainID, int64(height.VersionHeight), heightMinus1, suite.chainA.CurrentHeader.Time.Add(time.Minute), suite.chainA.Vals, suite.chainA.Vals, suite.chainA.Signers) misbehaviour := ibctmtypes.NewMisbehaviour("tendermint", suite.chainA.ChainID, header1, header2) msg, err = types.NewMsgSubmitMisbehaviour("tendermint", misbehaviour, suite.chainA.SenderAccount.GetAddress()) @@ -558,8 +558,8 @@ func (suite *TypesTestSuite) TestMsgSubmitMisbehaviour_ValidateBasic() { func() { height := types.NewHeight(0, uint64(suite.chainA.CurrentHeader.Height)) heightMinus1 := types.NewHeight(0, uint64(suite.chainA.CurrentHeader.Height)-1) - header1 := ibctmtypes.CreateTestHeader(suite.chainA.ChainID, height, heightMinus1, suite.chainA.CurrentHeader.Time, suite.chainA.Vals, suite.chainA.Vals, suite.chainA.Signers) - header2 := ibctmtypes.CreateTestHeader(suite.chainA.ChainID, height, heightMinus1, suite.chainA.CurrentHeader.Time.Add(time.Minute), suite.chainA.Vals, suite.chainA.Vals, suite.chainA.Signers) + header1 := suite.chainA.CreateTMClientHeader(suite.chainA.ChainID, int64(height.VersionHeight), heightMinus1, suite.chainA.CurrentHeader.Time, suite.chainA.Vals, suite.chainA.Vals, suite.chainA.Signers) + header2 := suite.chainA.CreateTMClientHeader(suite.chainA.ChainID, int64(height.VersionHeight), heightMinus1, suite.chainA.CurrentHeader.Time.Add(time.Minute), suite.chainA.Vals, suite.chainA.Vals, suite.chainA.Signers) misbehaviour := ibctmtypes.NewMisbehaviour("tendermint", suite.chainA.ChainID, header1, header2) msg, err = types.NewMsgSubmitMisbehaviour("tendermint", misbehaviour, suite.chainA.SenderAccount.GetAddress()) diff --git a/x/ibc/core/genesis_test.go b/x/ibc/core/genesis_test.go index c5db6ae996..ffc6912d20 100644 --- a/x/ibc/core/genesis_test.go +++ b/x/ibc/core/genesis_test.go @@ -21,6 +21,8 @@ import ( ) func (suite *IBCTestSuite) TestValidateGenesis() { + header := suite.chainA.CreateTMClientHeader(suite.chainA.ChainID, suite.chainA.CurrentHeader.Height, clienttypes.NewHeight(0, uint64(suite.chainA.CurrentHeader.Height-1)), suite.chainA.CurrentHeader.Time, suite.chainA.Vals, suite.chainA.Vals, suite.chainA.Signers) + testCases := []struct { name string genState *types.GenesisState @@ -37,7 +39,7 @@ func (suite *IBCTestSuite) TestValidateGenesis() { ClientGenesis: clienttypes.NewGenesisState( []clienttypes.IdentifiedClientState{ clienttypes.NewIdentifiedClientState( - clientID, ibctmtypes.NewClientState(chainID, ibctmtypes.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, clientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false), + clientID, ibctmtypes.NewClientState(suite.chainA.ChainID, ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod, ibctesting.MaxClockDrift, clientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false), ), clienttypes.NewIdentifiedClientState( exported.Localhost, localhosttypes.NewClientState("chaindID", clientHeight), @@ -48,9 +50,9 @@ func (suite *IBCTestSuite) TestValidateGenesis() { clientID, []clienttypes.ConsensusStateWithHeight{ clienttypes.NewConsensusStateWithHeight( - suite.header.GetHeight().(clienttypes.Height), + header.GetHeight().(clienttypes.Height), ibctmtypes.NewConsensusState( - suite.header.GetTime(), commitmenttypes.NewMerkleRoot(suite.header.Header.AppHash), suite.header.Header.NextValidatorsHash, + header.GetTime(), commitmenttypes.NewMerkleRoot(header.Header.AppHash), header.Header.NextValidatorsHash, ), ), }, @@ -70,8 +72,8 @@ func (suite *IBCTestSuite) TestValidateGenesis() { []channeltypes.IdentifiedChannel{ channeltypes.NewIdentifiedChannel( port1, channel1, channeltypes.NewChannel( - channeltypes.INIT, channelOrder, - channeltypes.NewCounterparty(port2, channel2), []string{connectionID}, channelVersion, + channeltypes.INIT, channeltypes.ORDERED, + channeltypes.NewCounterparty(port2, channel2), []string{connectionID}, ibctesting.DefaultChannelVersion, ), ), }, @@ -100,7 +102,7 @@ func (suite *IBCTestSuite) TestValidateGenesis() { ClientGenesis: clienttypes.NewGenesisState( []clienttypes.IdentifiedClientState{ clienttypes.NewIdentifiedClientState( - clientID, ibctmtypes.NewClientState(chainID, ibctmtypes.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, clientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false), + clientID, ibctmtypes.NewClientState(suite.chainA.ChainID, ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod, ibctesting.MaxClockDrift, clientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false), ), clienttypes.NewIdentifiedClientState( exported.Localhost, localhosttypes.NewClientState("(chaindID)", clienttypes.ZeroHeight()), @@ -155,6 +157,8 @@ func (suite *IBCTestSuite) TestValidateGenesis() { } func (suite *IBCTestSuite) TestInitGenesis() { + header := suite.chainA.CreateTMClientHeader(suite.chainA.ChainID, suite.chainA.CurrentHeader.Height, clienttypes.NewHeight(0, uint64(suite.chainA.CurrentHeader.Height-1)), suite.chainA.CurrentHeader.Time, suite.chainA.Vals, suite.chainA.Vals, suite.chainA.Signers) + testCases := []struct { name string genState *types.GenesisState @@ -169,7 +173,7 @@ func (suite *IBCTestSuite) TestInitGenesis() { ClientGenesis: clienttypes.NewGenesisState( []clienttypes.IdentifiedClientState{ clienttypes.NewIdentifiedClientState( - clientID, ibctmtypes.NewClientState(chainID, ibctmtypes.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, clientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false), + clientID, ibctmtypes.NewClientState(suite.chainA.ChainID, ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod, ibctesting.MaxClockDrift, clientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false), ), clienttypes.NewIdentifiedClientState( exported.Localhost, localhosttypes.NewClientState("chaindID", clientHeight), @@ -180,9 +184,9 @@ func (suite *IBCTestSuite) TestInitGenesis() { clientID, []clienttypes.ConsensusStateWithHeight{ clienttypes.NewConsensusStateWithHeight( - suite.header.GetHeight().(clienttypes.Height), + header.GetHeight().(clienttypes.Height), ibctmtypes.NewConsensusState( - suite.header.GetTime(), commitmenttypes.NewMerkleRoot(suite.header.Header.AppHash), suite.header.Header.NextValidatorsHash, + header.GetTime(), commitmenttypes.NewMerkleRoot(header.Header.AppHash), header.Header.NextValidatorsHash, ), ), }, @@ -202,8 +206,8 @@ func (suite *IBCTestSuite) TestInitGenesis() { []channeltypes.IdentifiedChannel{ channeltypes.NewIdentifiedChannel( port1, channel1, channeltypes.NewChannel( - channeltypes.INIT, channelOrder, - channeltypes.NewCounterparty(port2, channel2), []string{connectionID}, channelVersion, + channeltypes.INIT, channeltypes.ORDERED, + channeltypes.NewCounterparty(port2, channel2), []string{connectionID}, ibctesting.DefaultChannelVersion, ), ), }, @@ -236,8 +240,7 @@ func (suite *IBCTestSuite) TestInitGenesis() { } } -// TODO: HandlerTestSuite should replace IBCTestSuite -func (suite *HandlerTestSuite) TestExportGenesis() { +func (suite *IBCTestSuite) TestExportGenesis() { testCases := []struct { msg string malleate func() diff --git a/x/ibc/core/handler_test.go b/x/ibc/core/handler_test.go index 4616a726b6..712811dbe1 100644 --- a/x/ibc/core/handler_test.go +++ b/x/ibc/core/handler_test.go @@ -12,12 +12,28 @@ import ( ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" ) +const ( + connectionID = "connectionidone" + clientID = "clientidone" + connectionID2 = "connectionidtwo" + clientID2 = "clientidtwo" + + port1 = "firstport" + port2 = "secondport" + + channel1 = "firstchannel" + channel2 = "secondchannel" + + height = 10 +) + var ( timeoutHeight = clienttypes.NewHeight(0, 10000) maxSequence = uint64(10) + clientHeight = clienttypes.NewHeight(0, 10) ) -type HandlerTestSuite struct { +type IBCTestSuite struct { suite.Suite coordinator *ibctesting.Coordinator @@ -27,14 +43,15 @@ type HandlerTestSuite struct { } // SetupTest creates a coordinator with 2 test chains. -func (suite *HandlerTestSuite) SetupTest() { +func (suite *IBCTestSuite) SetupTest() { suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) + suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0)) suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(1)) } -func TestHandlerTestSuite(t *testing.T) { - suite.Run(t, new(HandlerTestSuite)) +func TestIBCTestSuite(t *testing.T) { + suite.Run(t, new(IBCTestSuite)) } // tests the IBC handler receiving a packet on ordered and unordered channels. @@ -42,7 +59,7 @@ func TestHandlerTestSuite(t *testing.T) { // tests high level properties like ordering and basic sanity checks. More // rigorous testing of 'RecvPacket' and 'WriteReceipt' can be found in the // 04-channel/keeper/packet_test.go. -func (suite *HandlerTestSuite) TestHandleRecvPacket() { +func (suite *IBCTestSuite) TestHandleRecvPacket() { var ( packet channeltypes.Packet ) @@ -162,7 +179,7 @@ func (suite *HandlerTestSuite) TestHandleRecvPacket() { // occurs. It test high level properties like ordering and basic sanity // checks. More rigorous testing of 'AcknowledgePacket' and 'AcknowledgementExecuted' // can be found in the 04-channel/keeper/packet_test.go. -func (suite *HandlerTestSuite) TestHandleAcknowledgePacket() { +func (suite *IBCTestSuite) TestHandleAcknowledgePacket() { var ( packet channeltypes.Packet ) @@ -320,7 +337,7 @@ func (suite *HandlerTestSuite) TestHandleAcknowledgePacket() { // high level properties like ordering and basic sanity checks. More // rigorous testing of 'TimeoutPacket' and 'TimeoutExecuted' can be found in // the 04-channel/keeper/timeout_test.go. -func (suite *HandlerTestSuite) TestHandleTimeoutPacket() { +func (suite *IBCTestSuite) TestHandleTimeoutPacket() { var ( packet channeltypes.Packet packetKey []byte @@ -443,7 +460,7 @@ func (suite *HandlerTestSuite) TestHandleTimeoutPacket() { // commitment occurs. It tests high level properties like ordering and basic // sanity checks. More rigorous testing of 'TimeoutOnClose' and //'TimeoutExecuted' can be found in the 04-channel/keeper/timeout_test.go. -func (suite *HandlerTestSuite) TestHandleTimeoutOnClosePacket() { +func (suite *IBCTestSuite) TestHandleTimeoutOnClosePacket() { var ( packet channeltypes.Packet packetKey []byte diff --git a/x/ibc/core/ibc_test.go b/x/ibc/core/ibc_test.go deleted file mode 100644 index ce61d15f26..0000000000 --- a/x/ibc/core/ibc_test.go +++ /dev/null @@ -1,87 +0,0 @@ -package ibc_test - -import ( - "testing" - "time" - - "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtypes "github.com/tendermint/tendermint/types" - - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" - clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types" - ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" - ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" - ibctestingmock "github.com/cosmos/cosmos-sdk/x/ibc/testing/mock" -) - -const ( - chainID = "chainID" - - connectionID = "connectionidone" - clientID = "clientidone" - connectionID2 = "connectionidtwo" - clientID2 = "clientidtwo" - - port1 = "firstport" - port2 = "secondport" - - channel1 = "firstchannel" - channel2 = "secondchannel" - - channelOrder = channeltypes.ORDERED - channelVersion = "1.0" - - height = 10 - - trustingPeriod time.Duration = time.Hour * 24 * 7 * 2 - ubdPeriod time.Duration = time.Hour * 24 * 7 * 3 - maxClockDrift time.Duration = time.Second * 10 -) - -var clientHeight = clienttypes.NewHeight(0, 10) - -type IBCTestSuite struct { - suite.Suite - - coordinator *ibctesting.Coordinator - - chainA *ibctesting.TestChain - chainB *ibctesting.TestChain - - ctx sdk.Context - app *simapp.SimApp - header *ibctmtypes.Header -} - -func (suite *IBCTestSuite) SetupTest() { - suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) - - suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0)) - suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(1)) - - isCheckTx := false - suite.app = simapp.Setup(isCheckTx) - - privVal := ibctestingmock.NewPV() - pubKey, err := privVal.GetPubKey() - suite.Require().NoError(err) - - now := time.Now().UTC() - - val := tmtypes.NewValidator(pubKey.(cryptotypes.IntoTmPubKey).AsTmPubKey(), 10) - valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{val}) - - clientHeightMinus1 := clienttypes.NewHeight(0, height-1) - - suite.header = ibctmtypes.CreateTestHeader(chainID, clientHeight, clientHeightMinus1, now, valSet, valSet, []tmtypes.PrivValidator{privVal}) - - suite.ctx = suite.app.BaseApp.NewContext(isCheckTx, tmproto.Header{}) -} - -func TestIBCTestSuite(t *testing.T) { - suite.Run(t, new(IBCTestSuite)) -} diff --git a/x/ibc/light-clients/07-tendermint/types/misbehaviour_handle_test.go b/x/ibc/light-clients/07-tendermint/types/misbehaviour_handle_test.go index 5ca74030ee..2133611860 100644 --- a/x/ibc/light-clients/07-tendermint/types/misbehaviour_handle_test.go +++ b/x/ibc/light-clients/07-tendermint/types/misbehaviour_handle_test.go @@ -33,7 +33,7 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { _, suiteVal := suite.valSet.GetByIndex(0) // Create signer array and ensure it is in same order as bothValSet - bothSigners := types.CreateSortedSignerArray(altPrivVal, suite.privVal, altVal, suiteVal) + bothSigners := ibctesting.CreateSortedSignerArray(altPrivVal, suite.privVal, altVal, suiteVal) altSigners := []tmtypes.PrivValidator{altPrivVal} @@ -60,8 +60,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), bothValsHash), height, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, height, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainID, height, height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), ChainId: chainID, ClientId: chainID, }, @@ -76,8 +76,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), bothValsHash), heightMinus1, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainID, height, heightMinus1, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), ChainId: chainID, ClientId: chainID, }, @@ -92,8 +92,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), suite.valsHash), heightMinus3, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainID, height, heightMinus3, suite.now.Add(time.Minute), bothValSet, suite.valSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus3, suite.now.Add(time.Minute), bothValSet, suite.valSet, bothSigners), ChainId: chainID, ClientId: chainID, }, @@ -108,8 +108,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), suite.valsHash), heightMinus3, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainIDVersion0, height, heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainIDVersion0, height, heightMinus3, suite.now.Add(time.Minute), bothValSet, suite.valSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainIDVersion0, int64(height.VersionHeight), heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainIDVersion0, int64(height.VersionHeight), heightMinus3, suite.now.Add(time.Minute), bothValSet, suite.valSet, bothSigners), ChainId: chainIDVersion0, ClientId: chainID, }, @@ -124,8 +124,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), suite.valsHash), heightMinus3, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainIDVersion0, clienttypes.NewHeight(1, 3), heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainIDVersion0, clienttypes.NewHeight(1, 3), heightMinus3, suite.now.Add(time.Minute), bothValSet, suite.valSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainIDVersion0, 3, heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainIDVersion0, 3, heightMinus3, suite.now.Add(time.Minute), bothValSet, suite.valSet, bothSigners), ChainId: chainIDVersion0, ClientId: chainID, }, @@ -140,8 +140,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), suite.valsHash), heightMinus3, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainIDVersion1, clienttypes.NewHeight(1, 1), heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainIDVersion1, clienttypes.NewHeight(1, 1), heightMinus3, suite.now.Add(time.Minute), bothValSet, suite.valSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainIDVersion1, 1, heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainIDVersion1, 1, heightMinus3, suite.now.Add(time.Minute), bothValSet, suite.valSet, bothSigners), ChainId: chainIDVersion1, ClientId: chainID, }, @@ -156,8 +156,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), suite.valsHash), height, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, height, suite.now, bothValSet, suite.valSet, bothSigners), - Header2: types.CreateTestHeader(chainID, height, height, suite.now.Add(time.Minute), bothValSet, suite.valSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now, bothValSet, suite.valSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now.Add(time.Minute), bothValSet, suite.valSet, bothSigners), ChainId: chainID, ClientId: chainID, }, @@ -172,8 +172,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), bothValsHash), height, &types.Misbehaviour{ - Header1: types.CreateTestHeader("ethermint", height, height, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader("ethermint", height, height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader("ethermint", int64(height.VersionHeight), height, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader("ethermint", int64(height.VersionHeight), height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), ChainId: "ethermint", ClientId: chainID, }, @@ -188,8 +188,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), suite.valsHash), heightMinus3, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainID, height, height, suite.now.Add(time.Minute), bothValSet, suite.valSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now.Add(time.Minute), bothValSet, suite.valSet, bothSigners), ChainId: chainID, ClientId: chainID, }, @@ -204,8 +204,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), suite.valsHash), heightMinus3, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainID, height, heightMinus3, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus3, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), ChainId: chainID, ClientId: chainID, }, @@ -220,8 +220,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), bothValsHash), height, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, height, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainID, height, height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), ChainId: chainID, ClientId: chainID, }, @@ -236,8 +236,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), bothValsHash), height, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainID, height, height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), ChainId: chainID, ClientId: chainID, }, @@ -263,8 +263,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), bothValsHash), height, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, height, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainID, height, height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), ChainId: chainID, ClientId: chainID, }, @@ -279,8 +279,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), bothValsHash), height, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, height, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainID, height, height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), ChainId: chainID, ClientId: chainID, }, @@ -295,8 +295,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), bothValsHash), height, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainID, height, heightMinus1, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), ChainId: chainID, ClientId: chainID, }, @@ -311,8 +311,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), bothValsHash), height, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainID, height, height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), ChainId: chainID, ClientId: chainID, }, @@ -327,8 +327,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), bothValsHash), height, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, height, suite.now, bothValSet, suite.valSet, bothSigners), - Header2: types.CreateTestHeader(chainID, height, height, suite.now.Add(time.Minute), bothValSet, suite.valSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now, bothValSet, suite.valSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now.Add(time.Minute), bothValSet, suite.valSet, bothSigners), ChainId: chainID, ClientId: chainID, }, @@ -343,8 +343,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), bothValsHash), height, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, height, suite.now, altValSet, bothValSet, altSigners), - Header2: types.CreateTestHeader(chainID, height, height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now, altValSet, bothValSet, altSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now.Add(time.Minute), bothValSet, bothValSet, bothSigners), ChainId: chainID, ClientId: chainID, }, @@ -359,8 +359,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), bothValsHash), height, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, height, suite.now, bothValSet, bothValSet, bothSigners), - Header2: types.CreateTestHeader(chainID, height, height, suite.now.Add(time.Minute), altValSet, bothValSet, altSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now, bothValSet, bothValSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now.Add(time.Minute), altValSet, bothValSet, altSigners), ChainId: chainID, ClientId: chainID, }, @@ -375,8 +375,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() { types.NewConsensusState(suite.now, commitmenttypes.NewMerkleRoot(tmhash.Sum([]byte("app_hash"))), bothValsHash), height, &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, height, suite.now, altValSet, bothValSet, altSigners), - Header2: types.CreateTestHeader(chainID, height, height, suite.now.Add(time.Minute), altValSet, bothValSet, altSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now, altValSet, bothValSet, altSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), height, suite.now.Add(time.Minute), altValSet, bothValSet, altSigners), ChainId: chainID, ClientId: chainID, }, diff --git a/x/ibc/light-clients/07-tendermint/types/misbehaviour_test.go b/x/ibc/light-clients/07-tendermint/types/misbehaviour_test.go index de2bd38422..22bd8674fb 100644 --- a/x/ibc/light-clients/07-tendermint/types/misbehaviour_test.go +++ b/x/ibc/light-clients/07-tendermint/types/misbehaviour_test.go @@ -10,6 +10,7 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" + ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" ibctestingmock "github.com/cosmos/cosmos-sdk/x/ibc/testing/mock" ) @@ -19,7 +20,7 @@ func (suite *TendermintTestSuite) TestMisbehaviour() { misbehaviour := &types.Misbehaviour{ Header1: suite.header, - Header2: types.CreateTestHeader(chainID, height, heightMinus1, suite.now, suite.valSet, suite.valSet, signers), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now, suite.valSet, suite.valSet, signers), ChainId: chainID, ClientId: clientID, } @@ -47,7 +48,7 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { // Create signer array and ensure it is in same order as bothValSet _, suiteVal := suite.valSet.GetByIndex(0) - bothSigners := types.CreateSortedSignerArray(altPrivVal, suite.privVal, altVal, suiteVal) + bothSigners := ibctesting.CreateSortedSignerArray(altPrivVal, suite.privVal, altVal, suiteVal) altSigners := []tmtypes.PrivValidator{altPrivVal} @@ -63,7 +64,7 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { "valid misbehaviour", &types.Misbehaviour{ Header1: suite.header, - Header2: types.CreateTestHeader(chainID, height, heightMinus1, suite.now.Add(time.Minute), suite.valSet, suite.valSet, signers), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now.Add(time.Minute), suite.valSet, suite.valSet, signers), ChainId: chainID, ClientId: clientID, }, @@ -86,7 +87,7 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { "valid misbehaviour with different trusted headers", &types.Misbehaviour{ Header1: suite.header, - Header2: types.CreateTestHeader(chainID, height, clienttypes.NewHeight(0, height.VersionHeight-3), suite.now.Add(time.Minute), suite.valSet, bothValSet, signers), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), clienttypes.NewHeight(0, height.VersionHeight-3), suite.now.Add(time.Minute), suite.valSet, bothValSet, signers), ChainId: chainID, ClientId: clientID, }, @@ -96,7 +97,7 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { { "trusted height is 0 in Header1", &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, clienttypes.ZeroHeight(), suite.now.Add(time.Minute), suite.valSet, suite.valSet, signers), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), clienttypes.ZeroHeight(), suite.now.Add(time.Minute), suite.valSet, suite.valSet, signers), Header2: suite.header, ChainId: chainID, ClientId: clientID, @@ -108,7 +109,7 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { "trusted height is 0 in Header2", &types.Misbehaviour{ Header1: suite.header, - Header2: types.CreateTestHeader(chainID, height, clienttypes.ZeroHeight(), suite.now.Add(time.Minute), suite.valSet, suite.valSet, signers), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), clienttypes.ZeroHeight(), suite.now.Add(time.Minute), suite.valSet, suite.valSet, signers), ChainId: chainID, ClientId: clientID, }, @@ -118,7 +119,7 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { { "trusted valset is nil in Header1", &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, heightMinus1, suite.now.Add(time.Minute), suite.valSet, nil, signers), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now.Add(time.Minute), suite.valSet, nil, signers), Header2: suite.header, ChainId: chainID, ClientId: clientID, @@ -130,7 +131,7 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { "trusted valset is nil in Header2", &types.Misbehaviour{ Header1: suite.header, - Header2: types.CreateTestHeader(chainID, height, heightMinus1, suite.now.Add(time.Minute), suite.valSet, nil, signers), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now.Add(time.Minute), suite.valSet, nil, signers), ChainId: chainID, ClientId: clientID, }, @@ -141,7 +142,7 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { "invalid client ID ", &types.Misbehaviour{ Header1: suite.header, - Header2: types.CreateTestHeader(chainID, height, heightMinus1, suite.now, suite.valSet, suite.valSet, signers), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now, suite.valSet, suite.valSet, signers), ChainId: chainID, ClientId: "GAIA", }, @@ -152,7 +153,7 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { "wrong chainID on header1", &types.Misbehaviour{ Header1: suite.header, - Header2: types.CreateTestHeader("ethermint", height, heightMinus1, suite.now, suite.valSet, suite.valSet, signers), + Header2: suite.chainA.CreateTMClientHeader("ethermint", int64(height.VersionHeight), heightMinus1, suite.now, suite.valSet, suite.valSet, signers), ChainId: "ethermint", ClientId: clientID, }, @@ -163,7 +164,7 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { "wrong chainID on header2", &types.Misbehaviour{ Header1: suite.header, - Header2: types.CreateTestHeader("ethermint", height, heightMinus1, suite.now, suite.valSet, suite.valSet, signers), + Header2: suite.chainA.CreateTMClientHeader("ethermint", int64(height.VersionHeight), heightMinus1, suite.now, suite.valSet, suite.valSet, signers), ChainId: chainID, ClientId: clientID, }, @@ -174,7 +175,7 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { "wrong chainID in misbehaviour", &types.Misbehaviour{ Header1: suite.header, - Header2: types.CreateTestHeader(chainID, height, heightMinus1, suite.now.Add(time.Minute), suite.valSet, suite.valSet, signers), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now.Add(time.Minute), suite.valSet, suite.valSet, signers), ChainId: "ethermint", ClientId: clientID, }, @@ -185,7 +186,7 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { "mismatched heights", &types.Misbehaviour{ Header1: suite.header, - Header2: types.CreateTestHeader(chainID, clienttypes.NewHeight(0, 6), clienttypes.NewHeight(0, 4), suite.now, suite.valSet, suite.valSet, signers), + Header2: suite.chainA.CreateTMClientHeader(chainID, 6, clienttypes.NewHeight(0, 4), suite.now, suite.valSet, suite.valSet, signers), ChainId: chainID, ClientId: clientID, }, @@ -206,7 +207,7 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { { "header 1 doesn't have 2/3 majority", &types.Misbehaviour{ - Header1: types.CreateTestHeader(chainID, height, heightMinus1, suite.now, bothValSet, suite.valSet, bothSigners), + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now, bothValSet, suite.valSet, bothSigners), Header2: suite.header, ChainId: chainID, ClientId: clientID, @@ -229,7 +230,7 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { "header 2 doesn't have 2/3 majority", &types.Misbehaviour{ Header1: suite.header, - Header2: types.CreateTestHeader(chainID, height, heightMinus1, suite.now, bothValSet, suite.valSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now, bothValSet, suite.valSet, bothSigners), ChainId: chainID, ClientId: clientID, }, @@ -251,12 +252,12 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() { "validators sign off on wrong commit", &types.Misbehaviour{ Header1: suite.header, - Header2: types.CreateTestHeader(chainID, height, heightMinus1, suite.now, bothValSet, suite.valSet, bothSigners), + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now, bothValSet, suite.valSet, bothSigners), ChainId: chainID, ClientId: clientID, }, func(misbehaviour *types.Misbehaviour) error { - tmBlockID := types.MakeBlockID(tmhash.Sum([]byte("other_hash")), 3, tmhash.Sum([]byte("other_partset"))) + tmBlockID := ibctesting.MakeBlockID(tmhash.Sum([]byte("other_hash")), 3, tmhash.Sum([]byte("other_partset"))) misbehaviour.Header2.Commit.BlockID = tmBlockID.ToProto() return nil }, diff --git a/x/ibc/light-clients/07-tendermint/types/tendermint_test.go b/x/ibc/light-clients/07-tendermint/types/tendermint_test.go index 4c1f4d2ecc..b175bfd5a5 100644 --- a/x/ibc/light-clients/07-tendermint/types/tendermint_test.go +++ b/x/ibc/light-clients/07-tendermint/types/tendermint_test.go @@ -85,7 +85,7 @@ func (suite *TendermintTestSuite) SetupTest() { val := tmtypes.NewValidator(pubKey.(cryptotypes.IntoTmPubKey).AsTmPubKey(), 10) suite.valSet = tmtypes.NewValidatorSet([]*tmtypes.Validator{val}) suite.valsHash = suite.valSet.Hash() - suite.header = ibctmtypes.CreateTestHeader(chainID, height, heightMinus1, suite.now, suite.valSet, suite.valSet, []tmtypes.PrivValidator{suite.privVal}) + suite.header = suite.chainA.CreateTMClientHeader(chainID, int64(height.VersionHeight), heightMinus1, suite.now, suite.valSet, suite.valSet, []tmtypes.PrivValidator{suite.privVal}) suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 1, Time: suite.now}) } diff --git a/x/ibc/light-clients/07-tendermint/types/test_utils.go b/x/ibc/light-clients/07-tendermint/types/test_utils.go deleted file mode 100644 index 5e19849053..0000000000 --- a/x/ibc/light-clients/07-tendermint/types/test_utils.go +++ /dev/null @@ -1,105 +0,0 @@ -package types - -import ( - "bytes" - "time" - - "github.com/tendermint/tendermint/crypto/tmhash" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmprotoversion "github.com/tendermint/tendermint/proto/tendermint/version" - tmtypes "github.com/tendermint/tendermint/types" - tmversion "github.com/tendermint/tendermint/version" - - clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" -) - -// MakeBlockID is a copied unimported test function from tmtypes to use here -func MakeBlockID(hash []byte, partSetSize uint32, partSetHash []byte) tmtypes.BlockID { - return tmtypes.BlockID{ - Hash: hash, - PartSetHeader: tmtypes.PartSetHeader{ - Total: partSetSize, - Hash: partSetHash, - }, - } -} - -// CreateTestHeader creates a mock header for testing only. -func CreateTestHeader(chainID string, height, trustedHeight clienttypes.Height, timestamp time.Time, tmValSet, tmTrustedVals *tmtypes.ValidatorSet, signers []tmtypes.PrivValidator) *Header { - var ( - valSet *tmproto.ValidatorSet - trustedVals *tmproto.ValidatorSet - ) - vsetHash := tmValSet.Hash() - blockHeight := int64(height.VersionHeight) - tmHeader := tmtypes.Header{ - Version: tmprotoversion.Consensus{Block: tmversion.BlockProtocol, App: 2}, - ChainID: chainID, - Height: blockHeight, - Time: timestamp, - LastBlockID: MakeBlockID(make([]byte, tmhash.Size), 10_000, make([]byte, tmhash.Size)), - LastCommitHash: tmhash.Sum([]byte("last_commit_hash")), - DataHash: tmhash.Sum([]byte("data_hash")), - ValidatorsHash: vsetHash, - NextValidatorsHash: vsetHash, - ConsensusHash: tmhash.Sum([]byte("consensus_hash")), - AppHash: tmhash.Sum([]byte("app_hash")), - LastResultsHash: tmhash.Sum([]byte("last_results_hash")), - EvidenceHash: tmhash.Sum([]byte("evidence_hash")), - ProposerAddress: tmValSet.Proposer.Address, - } - - hhash := tmHeader.Hash() - blockID := MakeBlockID(hhash, 3, tmhash.Sum([]byte("part_set"))) - voteSet := tmtypes.NewVoteSet(chainID, blockHeight, 1, tmproto.PrecommitType, tmValSet) - commit, err := tmtypes.MakeCommit(blockID, blockHeight, 1, voteSet, signers, timestamp) - if err != nil { - panic(err) - } - - signedHeader := tmproto.SignedHeader{ - Header: tmHeader.ToProto(), - Commit: commit.ToProto(), - } - - if tmValSet != nil { - valSet, err = tmValSet.ToProto() - if err != nil { - panic(err) - } - } - - if tmTrustedVals != nil { - trustedVals, err = tmTrustedVals.ToProto() - if err != nil { - panic(err) - } - } - - return &Header{ - SignedHeader: &signedHeader, - ValidatorSet: valSet, - TrustedHeight: trustedHeight, - TrustedValidators: trustedVals, - } -} - -// CreateSortedSignerArray takes two PrivValidators, and the corresponding Validator structs -// (including voting power). It returns a signer array of PrivValidators that matches the -// sorting of ValidatorSet. -// The sorting is first by .VotingPower (descending), with secondary index of .Address (ascending). -func CreateSortedSignerArray(altPrivVal, suitePrivVal tmtypes.PrivValidator, - altVal, suiteVal *tmtypes.Validator) []tmtypes.PrivValidator { - - switch { - case altVal.VotingPower > suiteVal.VotingPower: - return []tmtypes.PrivValidator{altPrivVal, suitePrivVal} - case altVal.VotingPower < suiteVal.VotingPower: - return []tmtypes.PrivValidator{suitePrivVal, altPrivVal} - default: - if bytes.Compare(altVal.Address, suiteVal.Address) == -1 { - return []tmtypes.PrivValidator{altPrivVal, suitePrivVal} - } - return []tmtypes.PrivValidator{suitePrivVal, altPrivVal} - } -} diff --git a/x/ibc/light-clients/07-tendermint/types/update_test.go b/x/ibc/light-clients/07-tendermint/types/update_test.go index 358548e854..2d075ad0a5 100644 --- a/x/ibc/light-clients/07-tendermint/types/update_test.go +++ b/x/ibc/light-clients/07-tendermint/types/update_test.go @@ -46,7 +46,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { // Create signer array and ensure it is in same order as bothValSet _, suiteVal := suite.valSet.GetByIndex(0) - bothSigners := types.CreateSortedSignerArray(altPrivVal, suite.privVal, altVal, suiteVal) + bothSigners := ibctesting.CreateSortedSignerArray(altPrivVal, suite.privVal, altVal, suiteVal) altSigners := []tmtypes.PrivValidator{altPrivVal} @@ -60,7 +60,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) - newHeader = types.CreateTestHeader(chainID, heightPlus1, height, suite.headerTime, suite.valSet, suite.valSet, signers) + newHeader = suite.chainA.CreateTMClientHeader(chainID, int64(heightPlus1.VersionHeight), height, suite.headerTime, suite.valSet, suite.valSet, signers) currentTime = suite.now }, expPass: true, @@ -70,7 +70,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) - newHeader = types.CreateTestHeader(chainID, heightPlus5, height, suite.headerTime, bothValSet, suite.valSet, bothSigners) + newHeader = suite.chainA.CreateTMClientHeader(chainID, int64(heightPlus5.VersionHeight), height, suite.headerTime, bothValSet, suite.valSet, bothSigners) currentTime = suite.now }, expPass: true, @@ -80,7 +80,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), bothValSet.Hash()) - newHeader = types.CreateTestHeader(chainID, heightPlus1, height, suite.headerTime, bothValSet, bothValSet, bothSigners) + newHeader = suite.chainA.CreateTMClientHeader(chainID, int64(heightPlus1.VersionHeight), height, suite.headerTime, bothValSet, bothValSet, bothSigners) currentTime = suite.now }, expPass: true, @@ -91,7 +91,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) consStateHeight = heightMinus3 - newHeader = types.CreateTestHeader(chainID, heightMinus1, heightMinus3, suite.headerTime, bothValSet, suite.valSet, bothSigners) + newHeader = suite.chainA.CreateTMClientHeader(chainID, int64(heightMinus1.VersionHeight), heightMinus3, suite.headerTime, bothValSet, suite.valSet, bothSigners) currentTime = suite.now }, expPass: true, @@ -101,7 +101,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainIDVersion1, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) - newHeader = types.CreateTestHeader(chainIDVersion0, height, heightMinus3, suite.headerTime, bothValSet, suite.valSet, bothSigners) + newHeader = suite.chainA.CreateTMClientHeader(chainIDVersion0, int64(height.VersionHeight), heightMinus3, suite.headerTime, bothValSet, suite.valSet, bothSigners) currentTime = suite.now }, expPass: true, @@ -111,7 +111,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) - newHeader = types.CreateTestHeader("ethermint", heightPlus1, height, suite.headerTime, suite.valSet, suite.valSet, signers) + newHeader = suite.chainA.CreateTMClientHeader("ethermint", int64(heightPlus1.VersionHeight), height, suite.headerTime, suite.valSet, suite.valSet, signers) currentTime = suite.now }, expPass: false, @@ -121,7 +121,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainIDVersion0, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) - newHeader = types.CreateTestHeader(chainIDVersion1, clienttypes.NewHeight(1, 1), height, suite.headerTime, suite.valSet, suite.valSet, signers) + newHeader = suite.chainA.CreateTMClientHeader(chainIDVersion1, 1, height, suite.headerTime, suite.valSet, suite.valSet, signers) currentTime = suite.now }, expPass: false, @@ -131,7 +131,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainIDVersion1, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, clienttypes.NewHeight(1, 1), ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) - newHeader = types.CreateTestHeader(chainIDVersion1, clienttypes.NewHeight(1, 3), height, suite.headerTime, suite.valSet, suite.valSet, signers) + newHeader = suite.chainA.CreateTMClientHeader(chainIDVersion1, 3, height, suite.headerTime, suite.valSet, suite.valSet, signers) currentTime = suite.now }, expPass: false, @@ -141,7 +141,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) - newHeader = types.CreateTestHeader(chainID, heightPlus1, height, suite.headerTime, bothValSet, suite.valSet, bothSigners) + newHeader = suite.chainA.CreateTMClientHeader(chainID, int64(heightPlus1.VersionHeight), height, suite.headerTime, bothValSet, suite.valSet, bothSigners) currentTime = suite.now }, expPass: false, @@ -151,7 +151,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), bothValSet.Hash()) - newHeader = types.CreateTestHeader(chainID, heightPlus1, height, suite.headerTime, suite.valSet, bothValSet, signers) + newHeader = suite.chainA.CreateTMClientHeader(chainID, int64(heightPlus1.VersionHeight), height, suite.headerTime, suite.valSet, bothValSet, signers) currentTime = suite.now }, expPass: false, @@ -161,7 +161,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) - newHeader = types.CreateTestHeader(chainID, heightPlus5, height, suite.headerTime, altValSet, suite.valSet, altSigners) + newHeader = suite.chainA.CreateTMClientHeader(chainID, int64(heightPlus5.VersionHeight), height, suite.headerTime, altValSet, suite.valSet, altSigners) currentTime = suite.now }, expPass: false, @@ -171,7 +171,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) - newHeader = types.CreateTestHeader(chainID, heightPlus5, height, suite.headerTime, bothValSet, bothValSet, bothSigners) + newHeader = suite.chainA.CreateTMClientHeader(chainID, int64(heightPlus5.VersionHeight), height, suite.headerTime, bothValSet, bothValSet, bothSigners) currentTime = suite.now }, expPass: false, @@ -181,7 +181,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) - newHeader = types.CreateTestHeader(chainID, heightPlus1, height, suite.headerTime, suite.valSet, suite.valSet, signers) + newHeader = suite.chainA.CreateTMClientHeader(chainID, int64(heightPlus1.VersionHeight), height, suite.headerTime, suite.valSet, suite.valSet, signers) // make current time pass trusting period from last timestamp on clientstate currentTime = suite.now.Add(trustingPeriod) }, @@ -192,7 +192,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) - newHeader = types.CreateTestHeader(chainID, heightPlus1, height, suite.now.Add(time.Minute), suite.valSet, suite.valSet, signers) + newHeader = suite.chainA.CreateTMClientHeader(chainID, int64(heightPlus1.VersionHeight), height, suite.now.Add(time.Minute), suite.valSet, suite.valSet, signers) currentTime = suite.now }, expPass: false, @@ -202,7 +202,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) - newHeader = types.CreateTestHeader(chainID, heightPlus1, height, suite.clientTime, suite.valSet, suite.valSet, signers) + newHeader = suite.chainA.CreateTMClientHeader(chainID, int64(heightPlus1.VersionHeight), height, suite.clientTime, suite.valSet, suite.valSet, signers) currentTime = suite.now }, expPass: false, @@ -212,7 +212,7 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { setup: func() { clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) - newHeader = types.CreateTestHeader(chainID, heightPlus1, height, suite.headerTime, suite.valSet, suite.valSet, signers) + newHeader = suite.chainA.CreateTMClientHeader(chainID, int64(heightPlus1.VersionHeight), height, suite.headerTime, suite.valSet, suite.valSet, signers) // cause new header to fail validatebasic by changing commit height to mismatch header height newHeader.SignedHeader.Commit.Height = versionHeight - 1 currentTime = suite.now @@ -222,10 +222,10 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() { { name: "header height < consensus height", setup: func() { - clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, heightPlus5, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) + clientState = types.NewClientState(chainID, types.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, clienttypes.NewHeight(height.VersionNumber, heightPlus5.VersionHeight), ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) consensusState = types.NewConsensusState(suite.clientTime, commitmenttypes.NewMerkleRoot(suite.header.Header.GetAppHash()), suite.valsHash) // Make new header at height less than latest client state - newHeader = types.CreateTestHeader(chainID, heightMinus1, height, suite.headerTime, suite.valSet, suite.valSet, signers) + newHeader = suite.chainA.CreateTMClientHeader(chainID, int64(heightMinus1.VersionHeight), height, suite.headerTime, suite.valSet, suite.valSet, signers) currentTime = suite.now }, expPass: false, diff --git a/x/ibc/testing/chain.go b/x/ibc/testing/chain.go index 107300fc7d..9331ef405c 100644 --- a/x/ibc/testing/chain.go +++ b/x/ibc/testing/chain.go @@ -1,6 +1,7 @@ package ibctesting import ( + "bytes" "fmt" "strconv" "testing" @@ -266,7 +267,8 @@ func (chain *TestChain) QueryConsensusStateProof(clientID string) ([]byte, clien // CONTRACT: this function must only be called after app.Commit() occurs func (chain *TestChain) NextBlock() { // set the last header to the current header - chain.LastHeader = chain.CreateTMClientHeader() + // use nil trusted fields + chain.LastHeader = chain.CurrentTMClientHeader() // increment the current header chain.CurrentHeader = tmproto.Header{ @@ -518,14 +520,28 @@ func (chain *TestChain) ExpireClient(amount time.Duration) { chain.CurrentHeader.Time = chain.CurrentHeader.Time.Add(amount) } -// CreateTMClientHeader creates a TM header to update the TM client. -func (chain *TestChain) CreateTMClientHeader() *ibctmtypes.Header { - vsetHash := chain.Vals.Hash() +// CurrentTMClientHeader creates a TM header using the current header parameters +// on the chain. The trusted fields in the header are set to nil. +func (chain *TestChain) CurrentTMClientHeader() *ibctmtypes.Header { + return chain.CreateTMClientHeader(chain.ChainID, chain.CurrentHeader.Height, clienttypes.Height{}, chain.CurrentHeader.Time, chain.Vals, nil, chain.Signers) +} + +// CreateTMClientHeader creates a TM header to update the TM client. Args are passed in to allow +// caller flexibility to use params that differ from the chain. +func (chain *TestChain) CreateTMClientHeader(chainID string, blockHeight int64, trustedHeight clienttypes.Height, timestamp time.Time, tmValSet, tmTrustedVals *tmtypes.ValidatorSet, signers []tmtypes.PrivValidator) *ibctmtypes.Header { + var ( + valSet *tmproto.ValidatorSet + trustedVals *tmproto.ValidatorSet + ) + require.NotNil(chain.t, tmValSet) + + vsetHash := tmValSet.Hash() + tmHeader := tmtypes.Header{ Version: tmprotoversion.Consensus{Block: tmversion.BlockProtocol, App: 2}, - ChainID: chain.ChainID, - Height: chain.CurrentHeader.Height, - Time: chain.CurrentHeader.Time, + ChainID: chainID, + Height: blockHeight, + Time: timestamp, LastBlockID: MakeBlockID(make([]byte, tmhash.Size), 10_000, make([]byte, tmhash.Size)), LastCommitHash: chain.App.LastCommitID().Hash, DataHash: tmhash.Sum([]byte("data_hash")), @@ -535,15 +551,13 @@ func (chain *TestChain) CreateTMClientHeader() *ibctmtypes.Header { AppHash: chain.CurrentHeader.AppHash, LastResultsHash: tmhash.Sum([]byte("last_results_hash")), EvidenceHash: tmhash.Sum([]byte("evidence_hash")), - ProposerAddress: chain.Vals.Proposer.Address, + ProposerAddress: tmValSet.Proposer.Address, //nolint:staticcheck } hhash := tmHeader.Hash() - blockID := MakeBlockID(hhash, 3, tmhash.Sum([]byte("part_set"))) + voteSet := tmtypes.NewVoteSet(chainID, blockHeight, 1, tmproto.PrecommitType, tmValSet) - voteSet := tmtypes.NewVoteSet(chain.ChainID, chain.CurrentHeader.Height, 1, tmproto.PrecommitType, chain.Vals) - - commit, err := tmtypes.MakeCommit(blockID, chain.CurrentHeader.Height, 1, voteSet, chain.Signers, chain.CurrentHeader.Time) + commit, err := tmtypes.MakeCommit(blockID, blockHeight, 1, voteSet, signers, timestamp) require.NoError(chain.t, err) signedHeader := &tmproto.SignedHeader{ @@ -551,16 +565,27 @@ func (chain *TestChain) CreateTMClientHeader() *ibctmtypes.Header { Commit: commit.ToProto(), } - valSet, err := chain.Vals.ToProto() - if err != nil { - panic(err) + if tmValSet != nil { + valSet, err = tmValSet.ToProto() + if err != nil { + panic(err) + } } - // Do not set trusted field here, these fields can be inserted before relaying messages to a client. + if tmTrustedVals != nil { + trustedVals, err = tmTrustedVals.ToProto() + if err != nil { + panic(err) + } + } + + // The trusted fields may be nil. They may be filled before relaying messages to a client. // The relayer is responsible for querying client and injecting appropriate trusted fields. return &ibctmtypes.Header{ - SignedHeader: signedHeader, - ValidatorSet: valSet, + SignedHeader: signedHeader, + ValidatorSet: valSet, + TrustedHeight: trustedHeight, + TrustedValidators: trustedVals, } } @@ -575,6 +600,26 @@ func MakeBlockID(hash []byte, partSetSize uint32, partSetHash []byte) tmtypes.Bl } } +// CreateSortedSignerArray takes two PrivValidators, and the corresponding Validator structs +// (including voting power). It returns a signer array of PrivValidators that matches the +// sorting of ValidatorSet. +// The sorting is first by .VotingPower (descending), with secondary index of .Address (ascending). +func CreateSortedSignerArray(altPrivVal, suitePrivVal tmtypes.PrivValidator, + altVal, suiteVal *tmtypes.Validator) []tmtypes.PrivValidator { + + switch { + case altVal.VotingPower > suiteVal.VotingPower: + return []tmtypes.PrivValidator{altPrivVal, suitePrivVal} + case altVal.VotingPower < suiteVal.VotingPower: + return []tmtypes.PrivValidator{suitePrivVal, altPrivVal} + default: + if bytes.Compare(altVal.Address, suiteVal.Address) == -1 { + return []tmtypes.PrivValidator{altPrivVal, suitePrivVal} + } + return []tmtypes.PrivValidator{suitePrivVal, altPrivVal} + } +} + // ConnectionOpenInit will construct and execute a MsgConnectionOpenInit. func (chain *TestChain) ConnectionOpenInit( counterparty *TestChain, diff --git a/x/ibc/testing/chain_test.go b/x/ibc/testing/chain_test.go new file mode 100644 index 0000000000..243eb06447 --- /dev/null +++ b/x/ibc/testing/chain_test.go @@ -0,0 +1,47 @@ +package ibctesting_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + tmtypes "github.com/tendermint/tendermint/types" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" + "github.com/cosmos/cosmos-sdk/x/ibc/testing/mock" +) + +func TestCreateSortedSignerArray(t *testing.T) { + privVal1 := mock.NewPV() + pubKey1, err := privVal1.GetPubKey() + require.NoError(t, err) + + privVal2 := mock.NewPV() + pubKey2, err := privVal2.GetPubKey() + require.NoError(t, err) + + validator1 := tmtypes.NewValidator(pubKey1.(cryptotypes.IntoTmPubKey).AsTmPubKey(), 1) + validator2 := tmtypes.NewValidator(pubKey2.(cryptotypes.IntoTmPubKey).AsTmPubKey(), 2) + + expected := []tmtypes.PrivValidator{privVal2, privVal1} + + actual := ibctesting.CreateSortedSignerArray(privVal1, privVal2, validator1, validator2) + require.Equal(t, expected, actual) + + // swap order + actual = ibctesting.CreateSortedSignerArray(privVal2, privVal1, validator2, validator1) + require.Equal(t, expected, actual) + + // smaller address + validator1.Address = []byte{1} + validator2.VotingPower = 1 + + expected = []tmtypes.PrivValidator{privVal1, privVal2} + + actual = ibctesting.CreateSortedSignerArray(privVal1, privVal2, validator1, validator2) + require.Equal(t, expected, actual) + + // swap order + actual = ibctesting.CreateSortedSignerArray(privVal2, privVal1, validator2, validator1) + require.Equal(t, expected, actual) +} From f260ca4319376c3f00df365aedd916730f23e4b9 Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 14 Oct 2020 23:13:48 +0800 Subject: [PATCH 25/84] shutdown gracefully without os.Exit (#7480) * shutdown gracefully without os.Exit * Update server/util.go Co-authored-by: Alessio Treglia Co-authored-by: Alessio Treglia --- server/start.go | 16 ++++++++-------- server/util.go | 18 ++++++++++++++++++ simapp/simd/main.go | 8 +++++++- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/server/start.go b/server/start.go index 9f8b87ba88..ca39a7606e 100644 --- a/server/start.go +++ b/server/start.go @@ -179,14 +179,14 @@ func startStandAlone(ctx *Context, appCreator types.AppCreator) error { tmos.Exit(err.Error()) } - TrapSignal(func() { + defer func() { if err = svr.Stop(); err != nil { tmos.Exit(err.Error()) } - }) + }() - // run forever (the node will not be returned) - select {} + // Wait for SIGINT or SIGTERM signal + return WaitForQuitSignals() } // legacyAminoCdc is used for the legacy REST API @@ -290,7 +290,7 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App } } - TrapSignal(func() { + defer func() { if tmNode.IsRunning() { _ = tmNode.Stop() } @@ -308,8 +308,8 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App } ctx.Logger.Info("exiting...") - }) + }() - // run forever (the node will not be returned) - select {} + // Wait for SIGINT or SIGTERM signal + return WaitForQuitSignals() } diff --git a/server/util.go b/server/util.go index 4796aca0f6..a91862b2fc 100644 --- a/server/util.go +++ b/server/util.go @@ -8,6 +8,7 @@ import ( "os" "os/signal" "path/filepath" + "strconv" "syscall" "time" @@ -39,6 +40,15 @@ type Context struct { Logger log.Logger } +// ErrorCode contains the exit code for server exit. +type ErrorCode struct { + Code int +} + +func (e ErrorCode) Error() string { + return strconv.Itoa(e.Code) +} + func NewDefaultContext() *Context { return NewContext(viper.New(), tmcfg.DefaultConfig(), log.NewTMLogger(log.NewSyncWriter(os.Stdout))) } @@ -245,6 +255,14 @@ func TrapSignal(cleanupFunc func()) { }() } +// WaitForQuitSignals waits for SIGINT and SIGTERM and returns. +func WaitForQuitSignals() ErrorCode { + sigs := make(chan os.Signal, 1) + signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) + sig := <-sigs + return ErrorCode{Code: int(sig.(syscall.Signal)) + 128} +} + func skipInterface(iface net.Interface) bool { if iface.Flags&net.FlagUp == 0 { return true // interface down diff --git a/simapp/simd/main.go b/simapp/simd/main.go index 126e14975e..26fb4d7b3e 100644 --- a/simapp/simd/main.go +++ b/simapp/simd/main.go @@ -3,12 +3,18 @@ package main import ( "os" + "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/simapp/simd/cmd" ) func main() { rootCmd, _ := cmd.NewRootCmd() if err := cmd.Execute(rootCmd); err != nil { - os.Exit(1) + switch e := err.(type) { + case server.ErrorCode: + os.Exit(e.Code) + default: + os.Exit(1) + } } } From 23bfbe391b04092536d8778aef9beac53db927b3 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 14 Oct 2020 17:27:43 +0200 Subject: [PATCH 26/84] Adding a rule for private files in gitignore (#7535) In daily work, we have some files, scripts which are not comitable yet useful when working. Seeing them in git status is annoying. Let's support them in `.gitignore` Co-authored-by: Alessio Treglia --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 26659679aa..912ca3e3c9 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,10 @@ .idea *.pyc +# private files +private[.-]* +private + # Build vendor build From 24714f80cb16b6802965c4e99c0e3512d1765ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Wed, 14 Oct 2020 22:17:53 +0200 Subject: [PATCH 27/84] fix typo (#7536) Co-authored-by: Aleksandr Bezobchuk --- docs/architecture/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture/README.md b/docs/architecture/README.md index 9a401c17e3..c4f3280053 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -56,5 +56,5 @@ Please add a entry below in your Pull Request for an ADR. - [ADR 027: Deterministic Protobuf Serialization](./adr-027-deterministic-protobuf-serialization.md) - [ADR 029: Fee Grant Module](./adr-029-fee-grant-module.md) - [ADR 031: Protobuf Msg Services](./adr-031-msg-service.md) -- [ADR 032: Typed Events](./adr-031-typed-events.md) +- [ADR 032: Typed Events](./adr-032-typed-events.md) From e6e4a94071d58a70034ad5397c632b4122d071f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Oct 2020 07:20:30 +0000 Subject: [PATCH 28/84] Bump github.com/spf13/cobra from 1.0.0 to 1.1.0 (#7553) Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.0.0 to 1.1.0. - [Release notes](https://github.com/spf13/cobra/releases) - [Changelog](https://github.com/spf13/cobra/blob/master/CHANGELOG.md) - [Commits](https://github.com/spf13/cobra/compare/v1.0.0...v1.1.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index aa334636f1..7d37898608 100644 --- a/go.mod +++ b/go.mod @@ -37,7 +37,7 @@ require ( github.com/regen-network/cosmos-proto v0.3.0 github.com/spf13/afero v1.2.2 // indirect github.com/spf13/cast v1.3.1 - github.com/spf13/cobra v1.0.0 + github.com/spf13/cobra v1.1.0 github.com/spf13/jwalterweatherman v1.1.0 // indirect; indirects github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.7.1 diff --git a/go.sum b/go.sum index b5cfec932c..f1285f3426 100644 --- a/go.sum +++ b/go.sum @@ -553,6 +553,8 @@ github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3 github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.1.0 h1:aq3wCKjTPmzcNWLVGnsFVN4rflK7Uzn10F8/aw8MhdQ= +github.com/spf13/cobra v1.1.0/go.mod h1:yk5b0mALVusDL5fMM6Rd1wgnoO5jUPhwsQ6LQAJTidQ= 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= @@ -562,6 +564,7 @@ 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.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -591,8 +594,6 @@ github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2l github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tendermint/tendermint v0.34.0-rc3 h1:d7Fsd5rdbxq4GmJ0kRfx7l7LesQM7e70f0ytWLTQ/Go= github.com/tendermint/tendermint v0.34.0-rc3/go.mod h1:BoHcEpjfpBHc1Be7RQz3AHaXFNObcDG7SNHCev6Or4g= -github.com/tendermint/tendermint v0.34.0-rc4.0.20201005135527-d7d0ffea13c6 h1:gqZ0WDpDYgMm/iaiMEXvI1nt/GoWCuwtBomVpUMiAIs= -github.com/tendermint/tendermint v0.34.0-rc4.0.20201005135527-d7d0ffea13c6/go.mod h1:BSXqR6vWbOecet726v66qVwSkFDLfEeBrq+EhkKbij4= github.com/tendermint/tendermint v0.34.0-rc5 h1:2bnQfWyOMfTCbol5pwB8CgM2nxi6/Kz6zqlS6Udm/Cg= github.com/tendermint/tendermint v0.34.0-rc5/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= github.com/tendermint/tm-db v0.6.1 h1:w3X87itMPXopcRPlFiqspEKhw4FXihPk2rnFFkP0zGk= From 55242a659c2ae49b0747ba652e7dcd0c67a4c9bd Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Thu, 15 Oct 2020 15:07:59 +0200 Subject: [PATCH 29/84] Add ADR 031 BaseApp and codec infrastructure (#7519) * Refactor RegisterQueryServices -> RegisterServices * Cleaner proto files * Fix tests * Add MsgServer * Fix lint * Remove MsgServer from configurator for now * Remove useless file * Fix build * typo * Add router * Fix test * WIP * Add router * Remove test helper * Add beginning of test * Move test to simapp? * ServiceMsg implement sdk.Msg * Add handler by MsgServiceRouter * Correct signature * Add full test * use TxEncoder * Update baseapp/msg_service_router.go Co-authored-by: Aaron Craelius * Push changes * WIP on ServiceMsg unpacking * Make TestMsgService test pass * Fix tests * Tidying up * Tidying up * Tidying up * Add JSON test * Add comments * Tidying * Lint * Register MsgRequest interface * Rename * Fix tests * RegisterCustomTypeURL * Add changelog entries * Put in features * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk * Address review comments * Address nit * Fix lint * Update codec/types/interface_registry.go Co-authored-by: Marie Gauthier * godoc Co-authored-by: Aaron Craelius Co-authored-by: Aaron Craelius Co-authored-by: Aleksandr Bezobchuk Co-authored-by: Marie Gauthier --- CHANGELOG.md | 9 + baseapp/abci.go | 2 +- baseapp/baseapp.go | 77 +- baseapp/baseapp_test.go | 6 +- baseapp/grpcrouter_helpers.go | 11 +- baseapp/grpcrouter_test.go | 4 +- baseapp/msg_service_router.go | 94 + baseapp/msg_service_router_test.go | 74 + baseapp/options.go | 8 + client/context_test.go | 2 +- client/grpc_query_test.go | 2 +- codec/json.go | 4 +- codec/proto_codec.go | 21 +- codec/types/interface_registry.go | 57 +- codec/types/types_test.go | 66 +- codec/unknownproto/benchmarks_test.go | 4 +- codec/unknownproto/unknown_fields.go | 51 +- codec/unknownproto/unknown_fields_test.go | 10 +- scripts/protocgen.sh | 2 +- server/grpc/server_test.go | 2 +- simapp/app.go | 5 +- std/codec.go | 3 - .../testdata/{test_helper.go => codec.go} | 9 +- .../{test_service.go => grpc_query.go} | 12 +- testutil/testdata/msg_server.go | 16 + testutil/testdata/query.pb.go | 1371 +++++ testutil/testdata/query.proto | 39 + testutil/testdata/testdata.pb.go | 1412 +++++ testutil/testdata/testdata.proto | 37 + testutil/testdata/{test_tx.go => tx.go} | 12 + testutil/testdata/tx.pb.go | 764 +++ testutil/testdata/tx.proto | 28 + .../{proto.pb.go => unknonwnproto.pb.go} | 4679 ++++------------- .../{proto.proto => unknonwnproto.proto} | 66 - types/codec.go | 3 + types/service_msg.go | 58 + types/tx/tx.pb.go | 7 +- types/tx/types.go | 38 +- x/auth/ante/testutil_test.go | 3 +- x/auth/client/tx_test.go | 2 +- x/auth/tx/builder.go | 23 +- x/auth/tx/config.go | 2 +- x/auth/tx/decoder.go | 6 +- x/auth/tx/encode_decode_test.go | 5 +- x/auth/tx/encoder.go | 6 +- x/auth/tx/sigs.go | 2 +- x/auth/types/codec.go | 2 +- x/auth/vesting/types/codec.go | 2 + x/bank/types/tx.pb.go | 6 + 49 files changed, 5274 insertions(+), 3850 deletions(-) create mode 100644 baseapp/msg_service_router.go create mode 100644 baseapp/msg_service_router_test.go rename testutil/testdata/{test_helper.go => codec.go} (83%) rename testutil/testdata/{test_service.go => grpc_query.go} (72%) create mode 100644 testutil/testdata/msg_server.go create mode 100644 testutil/testdata/query.pb.go create mode 100644 testutil/testdata/query.proto create mode 100644 testutil/testdata/testdata.pb.go create mode 100644 testutil/testdata/testdata.proto rename testutil/testdata/{test_tx.go => tx.go} (81%) create mode 100644 testutil/testdata/tx.pb.go create mode 100644 testutil/testdata/tx.proto rename testutil/testdata/{proto.pb.go => unknonwnproto.pb.go} (70%) rename testutil/testdata/{proto.proto => unknonwnproto.proto} (87%) create mode 100644 types/service_msg.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 26ecaceffe..1e52621cc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,15 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/staking) [\#7499](https://github.com/cosmos/cosmos-sdk/pull/7499) `BondStatus` is now a protobuf `enum` instead of an `int32`, and JSON serialized using its protobuf name, so expect names like `BOND_STATUS_UNBONDING` as opposed to `Unbonding`. +### API Breaking + +* (AppModule) [\#7518](https://github.com/cosmos/cosmos-sdk/pull/7518) Rename `AppModule.RegisterQueryServices` to `AppModule.RegisterServices`, as this method now registers multiple services (the gRPC query service and the protobuf Msg service). A `Configurator` struct is used to hold the different services. + +### Features + +* (codec) [\#7519](https://github.com/cosmos/cosmos-sdk/pull/7519) `InterfaceRegistry` now inherits `jsonpb.AnyResolver`, and has a `RegisterCustomTypeURL` method to support ADR 031 packing of `Any`s. `AnyResolver` is now a required parameter to `RejectUnknownFields`. +* (baseapp) [\#7519](https://github.com/cosmos/cosmos-sdk/pull/7519) Add `ServiceMsgRouter` to BaseApp to handle routing of protobuf service `Msg`s. The two new types defined in ADR 031, `sdk.ServiceMsg` and `sdk.MsgRequest` are introduced with this router. + ### Bug Fixes * (kvstore) [\#7415](https://github.com/cosmos/cosmos-sdk/pull/7415) Allow new stores to be registered during on-chain upgrades. diff --git a/baseapp/abci.go b/baseapp/abci.go index e3a07d6204..07c6be72b2 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -688,7 +688,7 @@ func handleQueryApp(app *BaseApp, path []string, req abci.RequestQuery) abci.Res Result: res, } - bz, err := codec.ProtoMarshalJSON(simRes) + bz, err := codec.ProtoMarshalJSON(simRes, app.interfaceRegistry) if err != nil { return sdkerrors.QueryResult(sdkerrors.Wrap(err, "failed to JSON encode simulation response")) } diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 23a9d1dd8d..f215868654 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -13,6 +13,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" + "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/snapshots" "github.com/cosmos/cosmos-sdk/store" "github.com/cosmos/cosmos-sdk/store/rootmulti" @@ -45,15 +46,17 @@ type ( // BaseApp reflects the ABCI application implementation. type BaseApp struct { // nolint: maligned // initialized on creation - logger log.Logger - name string // application name from abci.Info - db dbm.DB // common DB backend - cms sdk.CommitMultiStore // Main (uncached) state - storeLoader StoreLoader // function to handle store loading, may be overridden with SetStoreLoader() - router sdk.Router // handle any kind of message - queryRouter sdk.QueryRouter // router for redirecting query calls - grpcQueryRouter *GRPCQueryRouter // router for redirecting gRPC query calls - txDecoder sdk.TxDecoder // unmarshal []byte into sdk.Tx + logger log.Logger + name string // application name from abci.Info + db dbm.DB // common DB backend + cms sdk.CommitMultiStore // Main (uncached) state + storeLoader StoreLoader // function to handle store loading, may be overridden with SetStoreLoader() + router sdk.Router // handle any kind of message + queryRouter sdk.QueryRouter // router for redirecting query calls + grpcQueryRouter *GRPCQueryRouter // router for redirecting gRPC query calls + msgServiceRouter *MsgServiceRouter // router for redirecting Msg service messages + interfaceRegistry types.InterfaceRegistry + txDecoder sdk.TxDecoder // unmarshal []byte into sdk.Tx anteHandler sdk.AnteHandler // ante handler for fee and auth initChainer sdk.InitChainer // initialize state with validators and state blob @@ -136,16 +139,17 @@ func NewBaseApp( name string, logger log.Logger, db dbm.DB, txDecoder sdk.TxDecoder, options ...func(*BaseApp), ) *BaseApp { app := &BaseApp{ - logger: logger, - name: name, - db: db, - cms: store.NewCommitMultiStore(db), - storeLoader: DefaultStoreLoader, - router: NewRouter(), - queryRouter: NewQueryRouter(), - grpcQueryRouter: NewGRPCQueryRouter(), - txDecoder: txDecoder, - fauxMerkleMode: false, + logger: logger, + name: name, + db: db, + cms: store.NewCommitMultiStore(db), + storeLoader: DefaultStoreLoader, + router: NewRouter(), + queryRouter: NewQueryRouter(), + grpcQueryRouter: NewGRPCQueryRouter(), + msgServiceRouter: NewMsgServiceRouter(), + txDecoder: txDecoder, + fauxMerkleMode: false, } for _, option := range options { @@ -176,6 +180,9 @@ func (app *BaseApp) Logger() log.Logger { return app.logger } +// MsgServiceRouter returns the MsgServiceRouter of a BaseApp. +func (app *BaseApp) MsgServiceRouter() *MsgServiceRouter { return app.msgServiceRouter } + // MountStores mounts all IAVL or DB stores to the provided keys in the BaseApp // multistore. func (app *BaseApp) MountStores(keys ...sdk.StoreKey) { @@ -682,20 +689,38 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (*s break } - msgRoute := msg.Route() - handler := app.router.Route(ctx, msgRoute) + var ( + msgEvents sdk.Events + msgResult *sdk.Result + msgFqName string + err error + ) - if handler == nil { - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message route: %s; message index: %d", msgRoute, i) + if svcMsg, ok := msg.(sdk.ServiceMsg); ok { + msgFqName = svcMsg.MethodName + handler := app.msgServiceRouter.Handler(msgFqName) + if handler == nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message service method: %s; message index: %d", msgFqName, i) + } + msgResult, err = handler(ctx, svcMsg.Request) + } else { + // legacy sdk.Msg routing + msgRoute := msg.Route() + msgFqName = msg.Type() + handler := app.router.Route(ctx, msgRoute) + if handler == nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message route: %s; message index: %d", msgRoute, i) + } + + msgResult, err = handler(ctx, msg) } - msgResult, err := handler(ctx, msg) if err != nil { return nil, sdkerrors.Wrapf(err, "failed to execute message; message index: %d", i) } - msgEvents := sdk.Events{ - sdk.NewEvent(sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyAction, msg.Type())), + msgEvents = sdk.Events{ + sdk.NewEvent(sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyAction, msgFqName)), } msgEvents = msgEvents.AppendEvents(msgResult.GetEvents()) diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index 233fbabc42..32c1ce2395 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -1692,9 +1692,9 @@ func TestQuery(t *testing.T) { func TestGRPCQuery(t *testing.T) { grpcQueryOpt := func(bapp *BaseApp) { - testdata.RegisterTestServiceServer( + testdata.RegisterQueryServer( bapp.GRPCQueryRouter(), - testdata.TestServiceImpl{}, + testdata.QueryImpl{}, ) } @@ -1711,7 +1711,7 @@ func TestGRPCQuery(t *testing.T) { reqQuery := abci.RequestQuery{ Data: reqBz, - Path: "/testdata.TestService/SayHello", + Path: "/testdata.Query/SayHello", } resQuery := app.Query(reqQuery) diff --git a/baseapp/grpcrouter_helpers.go b/baseapp/grpcrouter_helpers.go index 5d4048e0ed..bd7d498e7a 100644 --- a/baseapp/grpcrouter_helpers.go +++ b/baseapp/grpcrouter_helpers.go @@ -4,12 +4,11 @@ import ( gocontext "context" "fmt" - "github.com/cosmos/cosmos-sdk/codec/types" - gogogrpc "github.com/gogo/protobuf/grpc" abci "github.com/tendermint/tendermint/abci/types" "google.golang.org/grpc" + "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -22,6 +21,11 @@ type QueryServiceTestHelper struct { ctx sdk.Context } +var ( + _ gogogrpc.Server = &QueryServiceTestHelper{} + _ gogogrpc.ClientConn = &QueryServiceTestHelper{} +) + // NewQueryServerTestHelper creates a new QueryServiceTestHelper that wraps // the provided sdk.Context func NewQueryServerTestHelper(ctx sdk.Context, interfaceRegistry types.InterfaceRegistry) *QueryServiceTestHelper { @@ -62,6 +66,3 @@ func (q *QueryServiceTestHelper) Invoke(_ gocontext.Context, method string, args func (q *QueryServiceTestHelper) NewStream(gocontext.Context, *grpc.StreamDesc, string, ...grpc.CallOption) (grpc.ClientStream, error) { return nil, fmt.Errorf("not supported") } - -var _ gogogrpc.Server = &QueryServiceTestHelper{} -var _ gogogrpc.ClientConn = &QueryServiceTestHelper{} diff --git a/baseapp/grpcrouter_test.go b/baseapp/grpcrouter_test.go index 8761780f9f..d2051a1132 100644 --- a/baseapp/grpcrouter_test.go +++ b/baseapp/grpcrouter_test.go @@ -15,12 +15,12 @@ func TestGRPCRouter(t *testing.T) { qr := NewGRPCQueryRouter() interfaceRegistry := testdata.NewTestInterfaceRegistry() qr.SetInterfaceRegistry(interfaceRegistry) - testdata.RegisterTestServiceServer(qr, testdata.TestServiceImpl{}) + testdata.RegisterQueryServer(qr, testdata.QueryImpl{}) helper := &QueryServiceTestHelper{ GRPCQueryRouter: qr, ctx: sdk.Context{}.WithContext(context.Background()), } - client := testdata.NewTestServiceClient(helper) + client := testdata.NewQueryClient(helper) res, err := client.Echo(context.Background(), &testdata.EchoRequest{Message: "hello"}) require.Nil(t, err) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go new file mode 100644 index 0000000000..efc108881b --- /dev/null +++ b/baseapp/msg_service_router.go @@ -0,0 +1,94 @@ +package baseapp + +import ( + "context" + "fmt" + + "github.com/gogo/protobuf/proto" + + gogogrpc "github.com/gogo/protobuf/grpc" + "google.golang.org/grpc" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// MsgServiceRouter routes fully-qualified Msg service methods to their handler. +type MsgServiceRouter struct { + interfaceRegistry codectypes.InterfaceRegistry + routes map[string]MsgServiceHandler +} + +var _ gogogrpc.Server = &MsgServiceRouter{} + +// NewMsgServiceRouter creates a new MsgServiceRouter. +func NewMsgServiceRouter() *MsgServiceRouter { + return &MsgServiceRouter{ + routes: map[string]MsgServiceHandler{}, + } +} + +// MsgServiceHandler defines a function type which handles Msg service message. +type MsgServiceHandler = func(ctx sdk.Context, req sdk.MsgRequest) (*sdk.Result, error) + +// Handler returns the MsgServiceHandler for a given query route path or nil +// if not found. +func (msr *MsgServiceRouter) Handler(methodName string) MsgServiceHandler { + return msr.routes[methodName] +} + +// RegisterService implements the gRPC Server.RegisterService method. sd is a gRPC +// service description, handler is an object which implements that gRPC service. +func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler interface{}) { + // Adds a top-level query handler based on the gRPC service name. + for _, method := range sd.Methods { + fqMethod := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) + methodHandler := method.Handler + + // NOTE: This is how we pull the concrete request type for each handler for registering in the InterfaceRegistry. + // This approach is maybe a bit hacky, but less hacky than reflecting on the handler object itself. + // We use a no-op interceptor to avoid actually calling into the handler itself. + _, _ = methodHandler(nil, context.Background(), func(i interface{}) error { + msg, ok := i.(proto.Message) + if !ok { + // We panic here because there is no other alternative and the app cannot be initialized correctly + // this should only happen if there is a problem with code generation in which case the app won't + // work correctly anyway. + panic(fmt.Errorf("can't register request type %T for service method %s", i, fqMethod)) + } + + msr.interfaceRegistry.RegisterCustomTypeURL((*sdk.MsgRequest)(nil), fqMethod, msg) + return nil + }, func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { + return nil, nil + }) + + msr.routes[fqMethod] = func(ctx sdk.Context, req sdk.MsgRequest) (*sdk.Result, error) { + ctx = ctx.WithEventManager(sdk.NewEventManager()) + + // Call the method handler from the service description with the handler object. + res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), func(_ interface{}) error { + // We don't do any decoding here because the decoding was already done. + return nil + }, func(goCtx context.Context, _ interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { + goCtx = context.WithValue(goCtx, sdk.SdkContextKey, ctx) + return handler(goCtx, req) + }) + if err != nil { + return nil, err + } + + resMsg, ok := res.(proto.Message) + if !ok { + return nil, fmt.Errorf("can't proto encode %T", resMsg) + } + + return sdk.WrapServiceResult(ctx, resMsg, err) + } + } +} + +// SetInterfaceRegistry sets the interface registry for the router. +func (msr *MsgServiceRouter) SetInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry) { + msr.interfaceRegistry = interfaceRegistry +} diff --git a/baseapp/msg_service_router_test.go b/baseapp/msg_service_router_test.go new file mode 100644 index 0000000000..f0f9be57b4 --- /dev/null +++ b/baseapp/msg_service_router_test.go @@ -0,0 +1,74 @@ +package baseapp_test + +import ( + "os" + "testing" + + "github.com/cosmos/cosmos-sdk/baseapp" + + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" + + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/testutil/testdata" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" +) + +func TestMsgService(t *testing.T) { + priv, _, _ := testdata.KeyTestPubAddr() + encCfg := simapp.MakeEncodingConfig() + db := dbm.NewMemDB() + app := baseapp.NewBaseApp("test", log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, encCfg.TxConfig.TxDecoder()) + app.SetInterfaceRegistry(encCfg.InterfaceRegistry) + testdata.RegisterMsgServer( + app.MsgServiceRouter(), + testdata.MsgServerImpl{}, + ) + _ = app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: 1}}) + + msg := testdata.NewServiceMsgCreateDog(&testdata.MsgCreateDog{Dog: &testdata.Dog{Name: "Spot"}}) + txBuilder := encCfg.TxConfig.NewTxBuilder() + txBuilder.SetFeeAmount(testdata.NewTestFeeAmount()) + txBuilder.SetGasLimit(testdata.NewTestGasLimit()) + err := txBuilder.SetMsgs(msg) + require.NoError(t, err) + + // First round: we gather all the signer infos. We use the "set empty + // signature" hack to do that. + sigV2 := signing.SignatureV2{ + PubKey: priv.PubKey(), + Data: &signing.SingleSignatureData{ + SignMode: encCfg.TxConfig.SignModeHandler().DefaultMode(), + Signature: nil, + }, + Sequence: 0, + } + + err = txBuilder.SetSignatures(sigV2) + require.NoError(t, err) + + // Second round: all signer infos are set, so each signer can sign. + signerData := authsigning.SignerData{ + ChainID: "test", + AccountNumber: 0, + Sequence: 0, + } + sigV2, err = tx.SignWithPrivKey( + encCfg.TxConfig.SignModeHandler().DefaultMode(), signerData, + txBuilder, priv, encCfg.TxConfig, 0) + require.NoError(t, err) + err = txBuilder.SetSignatures(sigV2) + require.NoError(t, err) + + // Send the tx to the app + txBytes, err := encCfg.TxConfig.TxEncoder()(txBuilder.GetTx()) + require.NoError(t, err) + res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes}) + require.Equal(t, abci.CodeTypeOK, res.Code, "res=%+v", res) +} diff --git a/baseapp/options.go b/baseapp/options.go index 026433ae5b..008af9a185 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -6,6 +6,7 @@ import ( dbm "github.com/tendermint/tm-db" + "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/snapshots" "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" @@ -221,3 +222,10 @@ func (app *BaseApp) SetSnapshotKeepRecent(snapshotKeepRecent uint32) { } app.snapshotKeepRecent = snapshotKeepRecent } + +// SetInterfaceRegistry sets the InterfaceRegistry. +func (app *BaseApp) SetInterfaceRegistry(registry types.InterfaceRegistry) { + app.interfaceRegistry = registry + app.grpcQueryRouter.SetInterfaceRegistry(registry) + app.msgServiceRouter.SetInterfaceRegistry(registry) +} diff --git a/client/context_test.go b/client/context_test.go index 79f6de5d0d..c4628d0ef2 100644 --- a/client/context_test.go +++ b/client/context_test.go @@ -108,7 +108,7 @@ func TestCLIQueryConn(t *testing.T) { n := network.New(t, cfg) defer n.Cleanup() - testClient := testdata.NewTestServiceClient(n.Validators[0].ClientCtx) + testClient := testdata.NewQueryClient(n.Validators[0].ClientCtx) res, err := testClient.Echo(context.Background(), &testdata.EchoRequest{Message: "hello"}) require.NoError(t, err) require.Equal(t, "hello", res.Message) diff --git a/client/grpc_query_test.go b/client/grpc_query_test.go index d98a73fbf2..c4d2f024a0 100644 --- a/client/grpc_query_test.go +++ b/client/grpc_query_test.go @@ -43,7 +43,7 @@ func (s *IntegrationTestSuite) TestGRPCQuery() { val0 := s.network.Validators[0] // gRPC query to test service should work - testClient := testdata.NewTestServiceClient(val0.ClientCtx) + testClient := testdata.NewQueryClient(val0.ClientCtx) testRes, err := testClient.Echo(context.Background(), &testdata.EchoRequest{Message: "hello"}) s.Require().NoError(err) s.Require().Equal("hello", testRes.Message) diff --git a/codec/json.go b/codec/json.go index 044a6ae2b8..db77365e03 100644 --- a/codec/json.go +++ b/codec/json.go @@ -11,10 +11,10 @@ import ( // ProtoMarshalJSON provides an auxiliary function to return Proto3 JSON encoded // bytes of a message. -func ProtoMarshalJSON(msg proto.Message) ([]byte, error) { +func ProtoMarshalJSON(msg proto.Message, resolver jsonpb.AnyResolver) ([]byte, error) { // We use the OrigName because camel casing fields just doesn't make sense. // EmitDefaults is also often the more expected behavior for CLI users - jm := &jsonpb.Marshaler{OrigName: true, EmitDefaults: true} + jm := &jsonpb.Marshaler{OrigName: true, EmitDefaults: true, AnyResolver: resolver} err := types.UnpackInterfaces(msg, types.ProtoJSONPacker{JSONPBMarshaler: jm}) if err != nil { return nil, err diff --git a/codec/proto_codec.go b/codec/proto_codec.go index 02677af362..c9123f5d75 100644 --- a/codec/proto_codec.go +++ b/codec/proto_codec.go @@ -14,14 +14,14 @@ import ( // ProtoCodec defines a codec that utilizes Protobuf for both binary and JSON // encoding. type ProtoCodec struct { - anyUnpacker types.AnyUnpacker + interfaceRegistry types.InterfaceRegistry } var _ Marshaler = &ProtoCodec{} // NewProtoCodec returns a reference to a new ProtoCodec -func NewProtoCodec(anyUnpacker types.AnyUnpacker) *ProtoCodec { - return &ProtoCodec{anyUnpacker: anyUnpacker} +func NewProtoCodec(interfaceRegistry types.InterfaceRegistry) *ProtoCodec { + return &ProtoCodec{interfaceRegistry: interfaceRegistry} } // MarshalBinaryBare implements BinaryMarshaler.MarshalBinaryBare method. @@ -67,7 +67,7 @@ func (pc *ProtoCodec) UnmarshalBinaryBare(bz []byte, ptr ProtoMarshaler) error { if err != nil { return err } - err = types.UnpackInterfaces(ptr, pc.anyUnpacker) + err = types.UnpackInterfaces(ptr, pc.interfaceRegistry) if err != nil { return err } @@ -113,7 +113,7 @@ func (pc *ProtoCodec) MarshalJSON(o proto.Message) ([]byte, error) { return nil, fmt.Errorf("cannot protobuf JSON encode unsupported type: %T", o) } - return ProtoMarshalJSON(m) + return ProtoMarshalJSON(m, pc.interfaceRegistry) } // MustMarshalJSON implements JSONMarshaler.MustMarshalJSON method, @@ -135,12 +135,13 @@ func (pc *ProtoCodec) UnmarshalJSON(bz []byte, ptr proto.Message) error { return fmt.Errorf("cannot protobuf JSON decode unsupported type: %T", ptr) } - err := jsonpb.Unmarshal(strings.NewReader(string(bz)), m) + unmarshaler := jsonpb.Unmarshaler{AnyResolver: pc.interfaceRegistry} + err := unmarshaler.Unmarshal(strings.NewReader(string(bz)), m) if err != nil { return err } - return types.UnpackInterfaces(ptr, pc.anyUnpacker) + return types.UnpackInterfaces(ptr, pc.interfaceRegistry) } // MustUnmarshalJSON implements JSONMarshaler.MustUnmarshalJSON method, @@ -155,5 +156,9 @@ func (pc *ProtoCodec) MustUnmarshalJSON(bz []byte, ptr proto.Message) { // it unpacks the value in any to the interface pointer passed in as // iface. func (pc *ProtoCodec) UnpackAny(any *types.Any, iface interface{}) error { - return pc.anyUnpacker.UnpackAny(any, iface) + return pc.interfaceRegistry.UnpackAny(any, iface) +} + +func (pc *ProtoCodec) InterfaceRegistry() types.InterfaceRegistry { + return pc.interfaceRegistry } diff --git a/codec/types/interface_registry.go b/codec/types/interface_registry.go index 8bdb8168f5..966e935692 100644 --- a/codec/types/interface_registry.go +++ b/codec/types/interface_registry.go @@ -4,6 +4,8 @@ import ( "fmt" "reflect" + "github.com/gogo/protobuf/jsonpb" + "github.com/gogo/protobuf/proto" ) @@ -24,6 +26,7 @@ type AnyUnpacker interface { // implementations that can be safely unpacked from Any type InterfaceRegistry interface { AnyUnpacker + jsonpb.AnyResolver // RegisterInterface associates protoName as the public name for the // interface passed in as iface. This is to be used primarily to create @@ -43,6 +46,17 @@ type InterfaceRegistry interface { // registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, &MsgMultiSend{}) RegisterImplementations(iface interface{}, impls ...proto.Message) + // RegisterCustomTypeURL allows a protobuf message to be registered as a + // google.protobuf.Any with a custom typeURL (besides its own canonical + // typeURL). iface should be an interface as type, as in RegisterInterface + // and RegisterImplementations. + // + // Ex: + // This will allow us to pack service methods in Any's using the full method name + // as the type URL and the request body as the value, and allow us to unpack + // such packed methods using the normal UnpackAny method for the interface iface. + RegisterCustomTypeURL(iface interface{}, typeURL string, impl proto.Message) + // ListAllInterfaces list the type URLs of all registered interfaces. ListAllInterfaces() []string @@ -78,6 +92,7 @@ type UnpackInterfacesMessage interface { type interfaceRegistry struct { interfaceNames map[string]reflect.Type interfaceImpls map[reflect.Type]interfaceMap + typeURLMap map[string]reflect.Type } type interfaceMap = map[string]reflect.Type @@ -87,6 +102,7 @@ func NewInterfaceRegistry() InterfaceRegistry { return &interfaceRegistry{ interfaceNames: map[string]reflect.Type{}, interfaceImpls: map[reflect.Type]interfaceMap{}, + typeURLMap: map[string]reflect.Type{}, } } @@ -100,21 +116,31 @@ func (registry *interfaceRegistry) RegisterInterface(protoName string, iface int } func (registry *interfaceRegistry) RegisterImplementations(iface interface{}, impls ...proto.Message) { + for _, impl := range impls { + typeURL := "/" + proto.MessageName(impl) + registry.registerImpl(iface, typeURL, impl) + } +} + +func (registry *interfaceRegistry) RegisterCustomTypeURL(iface interface{}, typeURL string, impl proto.Message) { + registry.registerImpl(iface, typeURL, impl) +} + +func (registry *interfaceRegistry) registerImpl(iface interface{}, typeURL string, impl proto.Message) { ityp := reflect.TypeOf(iface).Elem() imap, found := registry.interfaceImpls[ityp] if !found { imap = map[string]reflect.Type{} } - for _, impl := range impls { - implType := reflect.TypeOf(impl) - if !implType.AssignableTo(ityp) { - panic(fmt.Errorf("type %T doesn't actually implement interface %+v", impl, ityp)) - } - - imap["/"+proto.MessageName(impl)] = implType + implType := reflect.TypeOf(impl) + if !implType.AssignableTo(ityp) { + panic(fmt.Errorf("type %T doesn't actually implement interface %+v", impl, ityp)) } + imap[typeURL] = implType + registry.typeURLMap[typeURL] = implType + registry.interfaceImpls[ityp] = imap } @@ -198,6 +224,23 @@ func (registry *interfaceRegistry) UnpackAny(any *Any, iface interface{}) error return nil } +// Resolve returns the proto message given its typeURL. It works with types +// registered with RegisterInterface/RegisterImplementations, as well as those +// registered with RegisterWithCustomTypeURL. +func (registry *interfaceRegistry) Resolve(typeURL string) (proto.Message, error) { + typ, found := registry.typeURLMap[typeURL] + if !found { + return nil, fmt.Errorf("unable to resolve type URL %s", typeURL) + } + + msg, ok := reflect.New(typ.Elem()).Interface().(proto.Message) + if !ok { + return nil, fmt.Errorf("can't resolve type URL %s", typeURL) + } + + return msg, nil +} + // UnpackInterfaces is a convenience function that calls UnpackInterfaces // on x if x implements UnpackInterfacesMessage func UnpackInterfaces(x interface{}, unpacker AnyUnpacker) error { diff --git a/codec/types/types_test.go b/codec/types/types_test.go index 0a14ed3e61..5e2a0f7f77 100644 --- a/codec/types/types_test.go +++ b/codec/types/types_test.go @@ -1,15 +1,20 @@ package types_test import ( + "context" + "fmt" "strings" "testing" + "github.com/gogo/protobuf/grpc" "github.com/gogo/protobuf/jsonpb" - - "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/gogo/protobuf/proto" + grpc2 "google.golang.org/grpc" "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" ) @@ -153,3 +158,60 @@ func TestAny_ProtoJSON(t *testing.T) { require.NoError(t, err) require.Equal(t, spot, ha2.Animal.GetCachedValue()) } + +// this instance of grpc.ClientConn is used to test packing service method +// requests into Any's +type testAnyPackClient struct { + any types.Any + interfaceRegistry types.InterfaceRegistry +} + +var _ grpc.ClientConn = &testAnyPackClient{} + +func (t *testAnyPackClient) Invoke(_ context.Context, method string, args, _ interface{}, _ ...grpc2.CallOption) error { + reqMsg, ok := args.(proto.Message) + if !ok { + return fmt.Errorf("can't proto marshal %T", args) + } + + // registry the method request type with the interface registry + t.interfaceRegistry.RegisterCustomTypeURL((*interface{})(nil), method, reqMsg) + + bz, err := proto.Marshal(reqMsg) + if err != nil { + return err + } + + t.any.TypeUrl = method + t.any.Value = bz + + return nil +} + +func (t *testAnyPackClient) NewStream(context.Context, *grpc2.StreamDesc, string, ...grpc2.CallOption) (grpc2.ClientStream, error) { + return nil, fmt.Errorf("not supported") +} + +func TestAny_ServiceRequestProtoJSON(t *testing.T) { + interfaceRegistry := types.NewInterfaceRegistry() + anyPacker := &testAnyPackClient{interfaceRegistry: interfaceRegistry} + dogMsgClient := testdata.NewMsgClient(anyPacker) + _, err := dogMsgClient.CreateDog(context.Background(), &testdata.MsgCreateDog{Dog: &testdata.Dog{ + Name: "spot", + }}) + require.NoError(t, err) + + // marshal JSON + cdc := codec.NewProtoCodec(interfaceRegistry) + bz, err := cdc.MarshalJSON(&anyPacker.any) + require.NoError(t, err) + require.Equal(t, + `{"@type":"/testdata.Msg/CreateDog","dog":{"size":"","name":"spot"}}`, + string(bz)) + + // unmarshal JSON + var any2 types.Any + err = cdc.UnmarshalJSON(bz, &any2) + require.NoError(t, err) + require.Equal(t, anyPacker.any, any2) +} diff --git a/codec/unknownproto/benchmarks_test.go b/codec/unknownproto/benchmarks_test.go index e2c4b2c196..373dda7acf 100644 --- a/codec/unknownproto/benchmarks_test.go +++ b/codec/unknownproto/benchmarks_test.go @@ -56,7 +56,7 @@ func benchmarkRejectUnknownFields(b *testing.B, parallel bool) { b.ResetTimer() for i := 0; i < b.N; i++ { n1A := new(testdata.Nested1A) - if err := unknownproto.RejectUnknownFieldsStrict(n1BBlob, n1A); err == nil { + if err := unknownproto.RejectUnknownFieldsStrict(n1BBlob, n1A, unknownproto.DefaultAnyResolver{}); err == nil { b.Fatal("expected an error") } b.SetBytes(int64(len(n1BBlob))) @@ -68,7 +68,7 @@ func benchmarkRejectUnknownFields(b *testing.B, parallel bool) { for pb.Next() { // To simulate the conditions of multiple transactions being processed in parallel. n1A := new(testdata.Nested1A) - if err := unknownproto.RejectUnknownFieldsStrict(n1BBlob, n1A); err == nil { + if err := unknownproto.RejectUnknownFieldsStrict(n1BBlob, n1A, unknownproto.DefaultAnyResolver{}); err == nil { b.Fatal("expected an error") } mu.Lock() diff --git a/codec/unknownproto/unknown_fields.go b/codec/unknownproto/unknown_fields.go index 4faaca0b85..b2e7a0e069 100644 --- a/codec/unknownproto/unknown_fields.go +++ b/codec/unknownproto/unknown_fields.go @@ -7,8 +7,10 @@ import ( "fmt" "io/ioutil" "reflect" + "strings" "sync" + "github.com/gogo/protobuf/jsonpb" "github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" "google.golang.org/protobuf/encoding/protowire" @@ -24,8 +26,9 @@ type descriptorIface interface { // RejectUnknownFieldsStrict rejects any bytes bz with an error that has unknown fields for the provided proto.Message type. // This function traverses inside of messages nested via google.protobuf.Any. It does not do any deserialization of the proto.Message. -func RejectUnknownFieldsStrict(bz []byte, msg proto.Message) error { - _, err := RejectUnknownFields(bz, msg, false) +// An AnyResolver must be provided for traversing inside google.protobuf.Any's. +func RejectUnknownFieldsStrict(bz []byte, msg proto.Message, resolver jsonpb.AnyResolver) error { + _, err := RejectUnknownFields(bz, msg, false, resolver) return err } @@ -34,7 +37,8 @@ func RejectUnknownFieldsStrict(bz []byte, msg proto.Message) error { // hasUnknownNonCriticals will be set to true if non-critical fields were encountered during traversal. This flag can be // used to treat a message with non-critical field different in different security contexts (such as transaction signing). // This function traverses inside of messages nested via google.protobuf.Any. It does not do any deserialization of the proto.Message. -func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals bool) (hasUnknownNonCriticals bool, err error) { +// An AnyResolver must be provided for traversing inside google.protobuf.Any's. +func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals bool, resolver jsonpb.AnyResolver) (hasUnknownNonCriticals bool, err error) { if len(bz) == 0 { return hasUnknownNonCriticals, nil } @@ -115,9 +119,12 @@ func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals _, o := protowire.ConsumeVarint(fieldBytes) fieldBytes = fieldBytes[o:] + var msg proto.Message + var err error + if protoMessageName == ".google.protobuf.Any" { // Firstly typecheck types.Any to ensure nothing snuck in. - hasUnknownNonCriticalsChild, err := RejectUnknownFields(fieldBytes, (*types.Any)(nil), allowUnknownNonCriticals) + hasUnknownNonCriticalsChild, err := RejectUnknownFields(fieldBytes, (*types.Any)(nil), allowUnknownNonCriticals, resolver) hasUnknownNonCriticals = hasUnknownNonCriticals || hasUnknownNonCriticalsChild if err != nil { return hasUnknownNonCriticals, err @@ -129,14 +136,18 @@ func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals } protoMessageName = any.TypeUrl fieldBytes = any.Value + msg, err = resolver.Resolve(protoMessageName) + if err != nil { + return hasUnknownNonCriticals, err + } + } else { + msg, err = protoMessageForTypeName(protoMessageName[1:]) + if err != nil { + return hasUnknownNonCriticals, err + } } - msg, err := protoMessageForTypeName(protoMessageName[1:]) - if err != nil { - return hasUnknownNonCriticals, err - } - - hasUnknownNonCriticalsChild, err := RejectUnknownFields(fieldBytes, msg, allowUnknownNonCriticals) + hasUnknownNonCriticalsChild, err := RejectUnknownFields(fieldBytes, msg, allowUnknownNonCriticals, resolver) hasUnknownNonCriticals = hasUnknownNonCriticals || hasUnknownNonCriticalsChild if err != nil { return hasUnknownNonCriticals, err @@ -401,3 +412,23 @@ func getDescriptorInfo(desc descriptorIface, msg proto.Message) (map[int32]*desc return tagNumToTypeIndex, md, nil } + +// DefaultAnyResolver is a default implementation of AnyResolver which uses +// the default encoding of type URLs as specified by the protobuf specification. +type DefaultAnyResolver struct{} + +var _ jsonpb.AnyResolver = DefaultAnyResolver{} + +// Resolve is the AnyResolver.Resolve method. +func (d DefaultAnyResolver) Resolve(typeURL string) (proto.Message, error) { + // Only the part of typeURL after the last slash is relevant. + mname := typeURL + if slash := strings.LastIndex(mname, "/"); slash >= 0 { + mname = mname[slash+1:] + } + mt := proto.MessageType(mname) + if mt == nil { + return nil, fmt.Errorf("unknown message type %q", mname) + } + return reflect.New(mt.Elem()).Interface().(proto.Message), nil +} diff --git a/codec/unknownproto/unknown_fields_test.go b/codec/unknownproto/unknown_fields_test.go index 937e8654d5..ad3926cedb 100644 --- a/codec/unknownproto/unknown_fields_test.go +++ b/codec/unknownproto/unknown_fields_test.go @@ -230,7 +230,7 @@ func TestRejectUnknownFieldsRepeated(t *testing.T) { if err != nil { t.Fatal(err) } - hasUnknownNonCriticals, gotErr := RejectUnknownFields(protoBlob, tt.recv, tt.allowUnknownNonCriticals) + hasUnknownNonCriticals, gotErr := RejectUnknownFields(protoBlob, tt.recv, tt.allowUnknownNonCriticals, DefaultAnyResolver{}) require.Equal(t, tt.wantErr, gotErr) require.Equal(t, tt.hasUnknownNonCriticals, hasUnknownNonCriticals) }) @@ -289,7 +289,7 @@ func TestRejectUnknownFields_allowUnknownNonCriticals(t *testing.T) { } c1 := new(testdata.Customer1) - _, gotErr := RejectUnknownFields(blob, c1, tt.allowUnknownNonCriticals) + _, gotErr := RejectUnknownFields(blob, c1, tt.allowUnknownNonCriticals, DefaultAnyResolver{}) if !reflect.DeepEqual(gotErr, tt.wantErr) { t.Fatalf("Error mismatch\nGot:\n%s\n\nWant:\n%s", gotErr, tt.wantErr) } @@ -490,7 +490,7 @@ func TestRejectUnknownFieldsNested(t *testing.T) { if err != nil { t.Fatal(err) } - gotErr := RejectUnknownFieldsStrict(protoBlob, tt.recv) + gotErr := RejectUnknownFieldsStrict(protoBlob, tt.recv, DefaultAnyResolver{}) if !reflect.DeepEqual(gotErr, tt.wantErr) { t.Fatalf("Error mismatch\nGot:\n%s\n\nWant:\n%s", gotErr, tt.wantErr) } @@ -643,7 +643,7 @@ func TestRejectUnknownFieldsFlat(t *testing.T) { } c1 := new(testdata.Customer1) - gotErr := RejectUnknownFieldsStrict(blob, c1) + gotErr := RejectUnknownFieldsStrict(blob, c1, DefaultAnyResolver{}) if !reflect.DeepEqual(gotErr, tt.wantErr) { t.Fatalf("Error mismatch\nGot:\n%s\n\nWant:\n%s", gotErr, tt.wantErr) } @@ -660,7 +660,7 @@ func TestPackedEncoding(t *testing.T) { require.NoError(t, err) unmarshalled := &testdata.TestRepeatedUints{} - _, err = RejectUnknownFields(marshalled, unmarshalled, false) + _, err = RejectUnknownFields(marshalled, unmarshalled, false, DefaultAnyResolver{}) require.NoError(t, err) } diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 74447d8497..e1592aa780 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -22,7 +22,7 @@ done # generate codec/testdata proto code protoc -I "proto" -I "third_party/proto" -I "testutil/testdata" --gocosmos_out=plugins=interfacetype+grpc,\ -Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. ./testutil/testdata/proto.proto +Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. ./testutil/testdata/*.proto # move proto files to the right places cp -r github.com/cosmos/cosmos-sdk/* ./ diff --git a/server/grpc/server_test.go b/server/grpc/server_test.go index 19cac38acf..f5db3c7fc2 100644 --- a/server/grpc/server_test.go +++ b/server/grpc/server_test.go @@ -50,7 +50,7 @@ func (s *IntegrationTestSuite) TestGRPCServer() { s.Require().NoError(err) // gRPC query to test service should work - testClient := testdata.NewTestServiceClient(conn) + testClient := testdata.NewQueryClient(conn) testRes, err := testClient.Echo(context.Background(), &testdata.EchoRequest{Message: "hello"}) s.Require().NoError(err) s.Require().Equal("hello", testRes.Message) diff --git a/simapp/app.go b/simapp/app.go index d209aafb7b..aa1375ea7a 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -114,6 +114,7 @@ var ( upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, + vesting.AppModuleBasic{}, ) // module account permissions @@ -202,7 +203,7 @@ func NewSimApp( bApp := baseapp.NewBaseApp(appName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetAppVersion(version.Version) - bApp.GRPCQueryRouter().SetInterfaceRegistry(interfaceRegistry) + bApp.SetInterfaceRegistry(interfaceRegistry) bApp.GRPCQueryRouter().RegisterSimulateService(bApp.Simulate, interfaceRegistry) keys := sdk.NewKVStoreKeys( @@ -362,7 +363,7 @@ func NewSimApp( app.mm.RegisterServices(module.NewConfigurator(app.GRPCQueryRouter())) // add test gRPC service for testing gRPC queries in isolation - testdata.RegisterTestServiceServer(app.GRPCQueryRouter(), testdata.TestServiceImpl{}) + testdata.RegisterQueryServer(app.GRPCQueryRouter(), testdata.QueryImpl{}) // create the simulation manager and define the order of the modules for deterministic simulations // diff --git a/std/codec.go b/std/codec.go index 7cd633b412..7310d75a25 100644 --- a/std/codec.go +++ b/std/codec.go @@ -6,14 +6,12 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" txtypes "github.com/cosmos/cosmos-sdk/types/tx" - vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" ) // RegisterLegacyAminoCodec registers types with the Amino codec. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { sdk.RegisterLegacyAminoCodec(cdc) cryptocodec.RegisterCrypto(cdc) - vesting.RegisterLegacyAminoCodec(cdc) } // RegisterInterfaces registers Interfaces from sdk/types, vesting, crypto, tx. @@ -21,5 +19,4 @@ func RegisterInterfaces(interfaceRegistry types.InterfaceRegistry) { sdk.RegisterInterfaces(interfaceRegistry) txtypes.RegisterInterfaces(interfaceRegistry) cryptocodec.RegisterInterfaces(interfaceRegistry) - vesting.RegisterInterfaces(interfaceRegistry) } diff --git a/testutil/testdata/test_helper.go b/testutil/testdata/codec.go similarity index 83% rename from testutil/testdata/test_helper.go rename to testutil/testdata/codec.go index 8952ebbe07..54f63d03c2 100644 --- a/testutil/testdata/test_helper.go +++ b/testutil/testdata/codec.go @@ -4,10 +4,18 @@ import ( amino "github.com/tendermint/go-amino" "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) func NewTestInterfaceRegistry() types.InterfaceRegistry { registry := types.NewInterfaceRegistry() + RegisterInterfaces(registry) + return registry +} + +func RegisterInterfaces(registry types.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), &TestMsg{}) + registry.RegisterInterface("Animal", (*Animal)(nil)) registry.RegisterImplementations( (*Animal)(nil), @@ -22,7 +30,6 @@ func NewTestInterfaceRegistry() types.InterfaceRegistry { (*HasHasAnimalI)(nil), &HasHasAnimal{}, ) - return registry } func NewTestAmino() *amino.Codec { diff --git a/testutil/testdata/test_service.go b/testutil/testdata/grpc_query.go similarity index 72% rename from testutil/testdata/test_service.go rename to testutil/testdata/grpc_query.go index 5311c160b8..6e2b641529 100644 --- a/testutil/testdata/test_service.go +++ b/testutil/testdata/grpc_query.go @@ -9,9 +9,11 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" ) -type TestServiceImpl struct{} +type QueryImpl struct{} -func (e TestServiceImpl) TestAny(_ context.Context, request *TestAnyRequest) (*TestAnyResponse, error) { +var _ QueryServer = QueryImpl{} + +func (e QueryImpl) TestAny(_ context.Context, request *TestAnyRequest) (*TestAnyResponse, error) { animal, ok := request.AnyAnimal.GetCachedValue().(Animal) if !ok { return nil, fmt.Errorf("expected Animal") @@ -28,17 +30,15 @@ func (e TestServiceImpl) TestAny(_ context.Context, request *TestAnyRequest) (*T }}, nil } -func (e TestServiceImpl) Echo(_ context.Context, req *EchoRequest) (*EchoResponse, error) { +func (e QueryImpl) Echo(_ context.Context, req *EchoRequest) (*EchoResponse, error) { return &EchoResponse{Message: req.Message}, nil } -func (e TestServiceImpl) SayHello(_ context.Context, request *SayHelloRequest) (*SayHelloResponse, error) { +func (e QueryImpl) SayHello(_ context.Context, request *SayHelloRequest) (*SayHelloResponse, error) { greeting := fmt.Sprintf("Hello %s!", request.Name) return &SayHelloResponse{Greeting: greeting}, nil } -var _ TestServiceServer = TestServiceImpl{} - var _ types.UnpackInterfacesMessage = &TestAnyRequest{} func (m *TestAnyRequest) UnpackInterfaces(unpacker types.AnyUnpacker) error { diff --git a/testutil/testdata/msg_server.go b/testutil/testdata/msg_server.go new file mode 100644 index 0000000000..3b434c68c8 --- /dev/null +++ b/testutil/testdata/msg_server.go @@ -0,0 +1,16 @@ +package testdata + +import ( + "context" +) + +type MsgServerImpl struct{} + +var _ MsgServer = MsgServerImpl{} + +// CreateDog implements the MsgServer interface. +func (m MsgServerImpl) CreateDog(_ context.Context, msg *MsgCreateDog) (*MsgCreateDogResponse, error) { + return &MsgCreateDogResponse{ + Name: msg.Dog.Name, + }, nil +} diff --git a/testutil/testdata/query.pb.go b/testutil/testdata/query.pb.go new file mode 100644 index 0000000000..fc5f7af7cb --- /dev/null +++ b/testutil/testdata/query.pb.go @@ -0,0 +1,1371 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: query.proto + +package testdata + +import ( + context "context" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type EchoRequest struct { + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +} + +func (m *EchoRequest) Reset() { *m = EchoRequest{} } +func (m *EchoRequest) String() string { return proto.CompactTextString(m) } +func (*EchoRequest) ProtoMessage() {} +func (*EchoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5c6ac9b241082464, []int{0} +} +func (m *EchoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EchoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EchoRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EchoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_EchoRequest.Merge(m, src) +} +func (m *EchoRequest) XXX_Size() int { + return m.Size() +} +func (m *EchoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_EchoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_EchoRequest proto.InternalMessageInfo + +func (m *EchoRequest) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +type EchoResponse struct { + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +} + +func (m *EchoResponse) Reset() { *m = EchoResponse{} } +func (m *EchoResponse) String() string { return proto.CompactTextString(m) } +func (*EchoResponse) ProtoMessage() {} +func (*EchoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5c6ac9b241082464, []int{1} +} +func (m *EchoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EchoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EchoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EchoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_EchoResponse.Merge(m, src) +} +func (m *EchoResponse) XXX_Size() int { + return m.Size() +} +func (m *EchoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_EchoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_EchoResponse proto.InternalMessageInfo + +func (m *EchoResponse) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +type SayHelloRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *SayHelloRequest) Reset() { *m = SayHelloRequest{} } +func (m *SayHelloRequest) String() string { return proto.CompactTextString(m) } +func (*SayHelloRequest) ProtoMessage() {} +func (*SayHelloRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5c6ac9b241082464, []int{2} +} +func (m *SayHelloRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SayHelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SayHelloRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SayHelloRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SayHelloRequest.Merge(m, src) +} +func (m *SayHelloRequest) XXX_Size() int { + return m.Size() +} +func (m *SayHelloRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SayHelloRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SayHelloRequest proto.InternalMessageInfo + +func (m *SayHelloRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type SayHelloResponse struct { + Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"` +} + +func (m *SayHelloResponse) Reset() { *m = SayHelloResponse{} } +func (m *SayHelloResponse) String() string { return proto.CompactTextString(m) } +func (*SayHelloResponse) ProtoMessage() {} +func (*SayHelloResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5c6ac9b241082464, []int{3} +} +func (m *SayHelloResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SayHelloResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SayHelloResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SayHelloResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SayHelloResponse.Merge(m, src) +} +func (m *SayHelloResponse) XXX_Size() int { + return m.Size() +} +func (m *SayHelloResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SayHelloResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SayHelloResponse proto.InternalMessageInfo + +func (m *SayHelloResponse) GetGreeting() string { + if m != nil { + return m.Greeting + } + return "" +} + +type TestAnyRequest struct { + AnyAnimal *types.Any `protobuf:"bytes,1,opt,name=any_animal,json=anyAnimal,proto3" json:"any_animal,omitempty"` +} + +func (m *TestAnyRequest) Reset() { *m = TestAnyRequest{} } +func (m *TestAnyRequest) String() string { return proto.CompactTextString(m) } +func (*TestAnyRequest) ProtoMessage() {} +func (*TestAnyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5c6ac9b241082464, []int{4} +} +func (m *TestAnyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestAnyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestAnyRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestAnyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestAnyRequest.Merge(m, src) +} +func (m *TestAnyRequest) XXX_Size() int { + return m.Size() +} +func (m *TestAnyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TestAnyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_TestAnyRequest proto.InternalMessageInfo + +func (m *TestAnyRequest) GetAnyAnimal() *types.Any { + if m != nil { + return m.AnyAnimal + } + return nil +} + +type TestAnyResponse struct { + HasAnimal *HasAnimal `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"` +} + +func (m *TestAnyResponse) Reset() { *m = TestAnyResponse{} } +func (m *TestAnyResponse) String() string { return proto.CompactTextString(m) } +func (*TestAnyResponse) ProtoMessage() {} +func (*TestAnyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5c6ac9b241082464, []int{5} +} +func (m *TestAnyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestAnyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestAnyResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestAnyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestAnyResponse.Merge(m, src) +} +func (m *TestAnyResponse) XXX_Size() int { + return m.Size() +} +func (m *TestAnyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TestAnyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_TestAnyResponse proto.InternalMessageInfo + +func (m *TestAnyResponse) GetHasAnimal() *HasAnimal { + if m != nil { + return m.HasAnimal + } + return nil +} + +func init() { + proto.RegisterType((*EchoRequest)(nil), "testdata.EchoRequest") + proto.RegisterType((*EchoResponse)(nil), "testdata.EchoResponse") + proto.RegisterType((*SayHelloRequest)(nil), "testdata.SayHelloRequest") + proto.RegisterType((*SayHelloResponse)(nil), "testdata.SayHelloResponse") + proto.RegisterType((*TestAnyRequest)(nil), "testdata.TestAnyRequest") + proto.RegisterType((*TestAnyResponse)(nil), "testdata.TestAnyResponse") +} + +func init() { proto.RegisterFile("query.proto", fileDescriptor_5c6ac9b241082464) } + +var fileDescriptor_5c6ac9b241082464 = []byte{ + // 359 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xcf, 0x4f, 0xc2, 0x30, + 0x14, 0xc7, 0x59, 0x82, 0x02, 0x0f, 0x03, 0xa6, 0xfe, 0x08, 0xf4, 0xb0, 0x98, 0x25, 0x46, 0x2e, + 0x76, 0x09, 0xc4, 0xab, 0x09, 0x26, 0x24, 0x5c, 0x45, 0x4f, 0x5e, 0x4c, 0x81, 0xba, 0x2d, 0x6e, + 0x2d, 0xd0, 0xee, 0xb0, 0xff, 0xc2, 0x7f, 0xc9, 0x9b, 0x47, 0x8e, 0x1e, 0x0d, 0xfc, 0x23, 0x66, + 0x5b, 0xbb, 0x09, 0x21, 0x9e, 0xda, 0xd7, 0x7e, 0xde, 0xe7, 0xe5, 0x7d, 0xa1, 0xb9, 0x8c, 0xd9, + 0x2a, 0x21, 0x8b, 0x95, 0x50, 0x02, 0xd5, 0x15, 0x93, 0x6a, 0x4e, 0x15, 0xc5, 0x5d, 0x4f, 0x08, + 0x2f, 0x64, 0x6e, 0xf6, 0x3e, 0x8d, 0xdf, 0x5c, 0xca, 0x35, 0x84, 0x5b, 0x06, 0xca, 0x6b, 0xe7, + 0x06, 0x9a, 0xa3, 0x99, 0x2f, 0x26, 0x6c, 0x19, 0x33, 0xa9, 0x50, 0x07, 0x6a, 0x11, 0x93, 0x92, + 0x7a, 0xac, 0x63, 0x5d, 0x59, 0xbd, 0xc6, 0xc4, 0x94, 0x4e, 0x0f, 0x4e, 0x72, 0x50, 0x2e, 0x04, + 0x97, 0xec, 0x1f, 0xf2, 0x1a, 0xda, 0x4f, 0x34, 0x19, 0xb3, 0x30, 0x2c, 0xb4, 0x08, 0xaa, 0x9c, + 0x46, 0x86, 0xcc, 0xee, 0x0e, 0x81, 0xd3, 0x12, 0xd3, 0x52, 0x0c, 0x75, 0x6f, 0xc5, 0x98, 0x0a, + 0xb8, 0xa7, 0xd9, 0xa2, 0x76, 0x46, 0xd0, 0x7a, 0x66, 0x52, 0x0d, 0x79, 0x62, 0xac, 0x03, 0x00, + 0xca, 0x93, 0x57, 0xca, 0x83, 0x88, 0x86, 0x19, 0xdf, 0xec, 0x9f, 0x93, 0x7c, 0x77, 0x62, 0x76, + 0x27, 0x69, 0x43, 0x83, 0xf2, 0x64, 0x98, 0x61, 0xce, 0x08, 0xda, 0x85, 0x46, 0x4f, 0xed, 0x03, + 0xf8, 0x54, 0xee, 0x7a, 0xce, 0x48, 0x11, 0xd4, 0x98, 0xca, 0xbc, 0x77, 0xd2, 0xf0, 0xcd, 0xb5, + 0xff, 0x69, 0xc1, 0xd1, 0x63, 0x1a, 0x3e, 0xba, 0x83, 0x6a, 0x1a, 0x0c, 0xba, 0x28, 0x3b, 0xfe, + 0x24, 0x8a, 0x2f, 0xf7, 0x9f, 0xf5, 0xd0, 0x21, 0xd4, 0xcd, 0xfa, 0xa8, 0x5b, 0x32, 0x7b, 0xc9, + 0x61, 0x7c, 0xe8, 0x4b, 0x2b, 0xee, 0xa1, 0xa6, 0x57, 0x41, 0x9d, 0x12, 0xdb, 0x0d, 0x09, 0x77, + 0x0f, 0xfc, 0xe4, 0xfd, 0x0f, 0xe3, 0xaf, 0x8d, 0x6d, 0xad, 0x37, 0xb6, 0xf5, 0xb3, 0xb1, 0xad, + 0x8f, 0xad, 0x5d, 0x59, 0x6f, 0xed, 0xca, 0xf7, 0xd6, 0xae, 0xbc, 0x10, 0x2f, 0x50, 0x7e, 0x3c, + 0x25, 0x33, 0x11, 0xb9, 0x33, 0x21, 0x23, 0x21, 0xf5, 0x71, 0x2b, 0xe7, 0xef, 0x6e, 0x2a, 0x8c, + 0x55, 0x10, 0xba, 0xc6, 0x3c, 0x3d, 0xce, 0xd2, 0x1e, 0xfc, 0x06, 0x00, 0x00, 0xff, 0xff, 0xe8, + 0xb4, 0x42, 0x4e, 0x90, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) + SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) + TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) { + out := new(EchoResponse) + err := c.cc.Invoke(ctx, "/testdata.Query/Echo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) { + out := new(SayHelloResponse) + err := c.cc.Invoke(ctx, "/testdata.Query/SayHello", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error) { + out := new(TestAnyResponse) + err := c.cc.Invoke(ctx, "/testdata.Query/TestAny", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Echo(context.Context, *EchoRequest) (*EchoResponse, error) + SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) + TestAny(context.Context, *TestAnyRequest) (*TestAnyResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Echo(ctx context.Context, req *EchoRequest) (*EchoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") +} +func (*UnimplementedQueryServer) SayHello(ctx context.Context, req *SayHelloRequest) (*SayHelloResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented") +} +func (*UnimplementedQueryServer) TestAny(ctx context.Context, req *TestAnyRequest) (*TestAnyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TestAny not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EchoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Echo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/testdata.Query/Echo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Echo(ctx, req.(*EchoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SayHelloRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SayHello(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/testdata.Query/SayHello", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SayHello(ctx, req.(*SayHelloRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TestAny_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TestAnyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TestAny(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/testdata.Query/TestAny", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TestAny(ctx, req.(*TestAnyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "testdata.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Echo", + Handler: _Query_Echo_Handler, + }, + { + MethodName: "SayHello", + Handler: _Query_SayHello_Handler, + }, + { + MethodName: "TestAny", + Handler: _Query_TestAny_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "query.proto", +} + +func (m *EchoRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EchoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EchoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EchoResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EchoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EchoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SayHelloRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SayHelloRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SayHelloRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SayHelloResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SayHelloResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SayHelloResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Greeting) > 0 { + i -= len(m.Greeting) + copy(dAtA[i:], m.Greeting) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Greeting))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TestAnyRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestAnyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestAnyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AnyAnimal != nil { + { + size, err := m.AnyAnimal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TestAnyResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestAnyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestAnyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.HasAnimal != nil { + { + size, err := m.HasAnimal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EchoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Message) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *EchoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Message) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *SayHelloRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *SayHelloResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Greeting) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *TestAnyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AnyAnimal != nil { + l = m.AnyAnimal.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *TestAnyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HasAnimal != nil { + l = m.HasAnimal.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EchoRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EchoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EchoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EchoResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EchoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EchoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SayHelloRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SayHelloRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SayHelloRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SayHelloResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SayHelloResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SayHelloResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Greeting", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Greeting = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestAnyRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestAnyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestAnyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AnyAnimal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AnyAnimal == nil { + m.AnyAnimal = &types.Any{} + } + if err := m.AnyAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestAnyResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestAnyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestAnyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HasAnimal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.HasAnimal == nil { + m.HasAnimal = &HasAnimal{} + } + if err := m.HasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/testutil/testdata/query.proto b/testutil/testdata/query.proto new file mode 100644 index 0000000000..0090b4fca8 --- /dev/null +++ b/testutil/testdata/query.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package testdata; + +import "google/protobuf/any.proto"; +import "testdata.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/testutil/testdata"; + +// Query tests the protobuf Query service as defined in +// https://github.com/cosmos/cosmos-sdk/issues/5921. +service Query { + rpc Echo(EchoRequest) returns (EchoResponse); + rpc SayHello(SayHelloRequest) returns (SayHelloResponse); + rpc TestAny(TestAnyRequest) returns (TestAnyResponse); +} + +message EchoRequest { + string message = 1; +} + +message EchoResponse { + string message = 1; +} + +message SayHelloRequest { + string name = 1; +} + +message SayHelloResponse { + string greeting = 1; +} + +message TestAnyRequest { + google.protobuf.Any any_animal = 1; +} + +message TestAnyResponse { + testdata.HasAnimal has_animal = 1; +} diff --git a/testutil/testdata/testdata.pb.go b/testutil/testdata/testdata.pb.go new file mode 100644 index 0000000000..3c5b44e7a4 --- /dev/null +++ b/testutil/testdata/testdata.pb.go @@ -0,0 +1,1412 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: testdata.proto + +package testdata + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Dog struct { + Size_ string `protobuf:"bytes,1,opt,name=size,proto3" json:"size,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *Dog) Reset() { *m = Dog{} } +func (m *Dog) String() string { return proto.CompactTextString(m) } +func (*Dog) ProtoMessage() {} +func (*Dog) Descriptor() ([]byte, []int) { + return fileDescriptor_40c4782d007dfce9, []int{0} +} +func (m *Dog) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Dog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Dog.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Dog) XXX_Merge(src proto.Message) { + xxx_messageInfo_Dog.Merge(m, src) +} +func (m *Dog) XXX_Size() int { + return m.Size() +} +func (m *Dog) XXX_DiscardUnknown() { + xxx_messageInfo_Dog.DiscardUnknown(m) +} + +var xxx_messageInfo_Dog proto.InternalMessageInfo + +func (m *Dog) GetSize_() string { + if m != nil { + return m.Size_ + } + return "" +} + +func (m *Dog) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type Cat struct { + Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` + Lives int32 `protobuf:"varint,2,opt,name=lives,proto3" json:"lives,omitempty"` +} + +func (m *Cat) Reset() { *m = Cat{} } +func (m *Cat) String() string { return proto.CompactTextString(m) } +func (*Cat) ProtoMessage() {} +func (*Cat) Descriptor() ([]byte, []int) { + return fileDescriptor_40c4782d007dfce9, []int{1} +} +func (m *Cat) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Cat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Cat.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Cat) XXX_Merge(src proto.Message) { + xxx_messageInfo_Cat.Merge(m, src) +} +func (m *Cat) XXX_Size() int { + return m.Size() +} +func (m *Cat) XXX_DiscardUnknown() { + xxx_messageInfo_Cat.DiscardUnknown(m) +} + +var xxx_messageInfo_Cat proto.InternalMessageInfo + +func (m *Cat) GetMoniker() string { + if m != nil { + return m.Moniker + } + return "" +} + +func (m *Cat) GetLives() int32 { + if m != nil { + return m.Lives + } + return 0 +} + +type HasAnimal struct { + Animal *types.Any `protobuf:"bytes,1,opt,name=animal,proto3" json:"animal,omitempty"` + X int64 `protobuf:"varint,2,opt,name=x,proto3" json:"x,omitempty"` +} + +func (m *HasAnimal) Reset() { *m = HasAnimal{} } +func (m *HasAnimal) String() string { return proto.CompactTextString(m) } +func (*HasAnimal) ProtoMessage() {} +func (*HasAnimal) Descriptor() ([]byte, []int) { + return fileDescriptor_40c4782d007dfce9, []int{2} +} +func (m *HasAnimal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HasAnimal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HasAnimal) XXX_Merge(src proto.Message) { + xxx_messageInfo_HasAnimal.Merge(m, src) +} +func (m *HasAnimal) XXX_Size() int { + return m.Size() +} +func (m *HasAnimal) XXX_DiscardUnknown() { + xxx_messageInfo_HasAnimal.DiscardUnknown(m) +} + +var xxx_messageInfo_HasAnimal proto.InternalMessageInfo + +func (m *HasAnimal) GetAnimal() *types.Any { + if m != nil { + return m.Animal + } + return nil +} + +func (m *HasAnimal) GetX() int64 { + if m != nil { + return m.X + } + return 0 +} + +type HasHasAnimal struct { + HasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"` +} + +func (m *HasHasAnimal) Reset() { *m = HasHasAnimal{} } +func (m *HasHasAnimal) String() string { return proto.CompactTextString(m) } +func (*HasHasAnimal) ProtoMessage() {} +func (*HasHasAnimal) Descriptor() ([]byte, []int) { + return fileDescriptor_40c4782d007dfce9, []int{3} +} +func (m *HasHasAnimal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HasHasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HasHasAnimal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HasHasAnimal) XXX_Merge(src proto.Message) { + xxx_messageInfo_HasHasAnimal.Merge(m, src) +} +func (m *HasHasAnimal) XXX_Size() int { + return m.Size() +} +func (m *HasHasAnimal) XXX_DiscardUnknown() { + xxx_messageInfo_HasHasAnimal.DiscardUnknown(m) +} + +var xxx_messageInfo_HasHasAnimal proto.InternalMessageInfo + +func (m *HasHasAnimal) GetHasAnimal() *types.Any { + if m != nil { + return m.HasAnimal + } + return nil +} + +type HasHasHasAnimal struct { + HasHasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_has_animal,json=hasHasAnimal,proto3" json:"has_has_animal,omitempty"` +} + +func (m *HasHasHasAnimal) Reset() { *m = HasHasHasAnimal{} } +func (m *HasHasHasAnimal) String() string { return proto.CompactTextString(m) } +func (*HasHasHasAnimal) ProtoMessage() {} +func (*HasHasHasAnimal) Descriptor() ([]byte, []int) { + return fileDescriptor_40c4782d007dfce9, []int{4} +} +func (m *HasHasHasAnimal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HasHasHasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HasHasHasAnimal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HasHasHasAnimal) XXX_Merge(src proto.Message) { + xxx_messageInfo_HasHasHasAnimal.Merge(m, src) +} +func (m *HasHasHasAnimal) XXX_Size() int { + return m.Size() +} +func (m *HasHasHasAnimal) XXX_DiscardUnknown() { + xxx_messageInfo_HasHasHasAnimal.DiscardUnknown(m) +} + +var xxx_messageInfo_HasHasHasAnimal proto.InternalMessageInfo + +func (m *HasHasHasAnimal) GetHasHasAnimal() *types.Any { + if m != nil { + return m.HasHasAnimal + } + return nil +} + +// bad MultiSignature with extra fields +type BadMultiSignature struct { + Signatures [][]byte `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` + MaliciousField []byte `protobuf:"bytes,5,opt,name=malicious_field,json=maliciousField,proto3" json:"malicious_field,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *BadMultiSignature) Reset() { *m = BadMultiSignature{} } +func (m *BadMultiSignature) String() string { return proto.CompactTextString(m) } +func (*BadMultiSignature) ProtoMessage() {} +func (*BadMultiSignature) Descriptor() ([]byte, []int) { + return fileDescriptor_40c4782d007dfce9, []int{5} +} +func (m *BadMultiSignature) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BadMultiSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BadMultiSignature.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BadMultiSignature) XXX_Merge(src proto.Message) { + xxx_messageInfo_BadMultiSignature.Merge(m, src) +} +func (m *BadMultiSignature) XXX_Size() int { + return m.Size() +} +func (m *BadMultiSignature) XXX_DiscardUnknown() { + xxx_messageInfo_BadMultiSignature.DiscardUnknown(m) +} + +var xxx_messageInfo_BadMultiSignature proto.InternalMessageInfo + +func (m *BadMultiSignature) GetSignatures() [][]byte { + if m != nil { + return m.Signatures + } + return nil +} + +func (m *BadMultiSignature) GetMaliciousField() []byte { + if m != nil { + return m.MaliciousField + } + return nil +} + +func init() { + proto.RegisterType((*Dog)(nil), "testdata.Dog") + proto.RegisterType((*Cat)(nil), "testdata.Cat") + proto.RegisterType((*HasAnimal)(nil), "testdata.HasAnimal") + proto.RegisterType((*HasHasAnimal)(nil), "testdata.HasHasAnimal") + proto.RegisterType((*HasHasHasAnimal)(nil), "testdata.HasHasHasAnimal") + proto.RegisterType((*BadMultiSignature)(nil), "testdata.BadMultiSignature") +} + +func init() { proto.RegisterFile("testdata.proto", fileDescriptor_40c4782d007dfce9) } + +var fileDescriptor_40c4782d007dfce9 = []byte{ + // 365 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x31, 0x4f, 0xc2, 0x40, + 0x18, 0x86, 0x39, 0x0b, 0x28, 0x9f, 0x0d, 0xc4, 0x0b, 0x43, 0x65, 0xa8, 0xa4, 0x8b, 0x0c, 0xd2, + 0x26, 0x12, 0x17, 0x36, 0xc0, 0x28, 0x0b, 0x4b, 0xdd, 0x5c, 0xc8, 0x95, 0x1e, 0xed, 0x85, 0xb6, + 0x67, 0xb8, 0xab, 0x01, 0x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0xc8, 0xd2, 0xc3, 0xa3, 0xae, + 0xe5, 0xc1, 0xd5, 0x90, 0xf8, 0x93, 0x34, 0x92, 0xec, 0x85, 0x05, 0x09, 0x91, 0xe9, 0x92, 0x62, + 0x13, 0x40, 0x14, 0x46, 0x18, 0xa8, 0xad, 0x75, 0x74, 0xf7, 0x28, 0xc1, 0xb7, 0xd0, 0x88, 0x49, + 0xc4, 0x66, 0x8c, 0xa7, 0x62, 0x3a, 0x67, 0x34, 0xf2, 0x8d, 0x4a, 0x1b, 0x75, 0x74, 0xb7, 0xfe, + 0x1f, 0x3f, 0x65, 0x69, 0xbf, 0xbc, 0xf9, 0xba, 0x41, 0xc3, 0xf1, 0xf7, 0xd6, 0x44, 0x9b, 0xad, + 0x89, 0x7e, 0xb7, 0x26, 0xfa, 0xdc, 0x99, 0xa5, 0xcd, 0xce, 0x2c, 0xfd, 0xec, 0xcc, 0xd2, 0xab, + 0x1d, 0x30, 0x19, 0xa6, 0x9e, 0x3d, 0xe3, 0xb1, 0x33, 0xe3, 0x22, 0xe6, 0x62, 0xff, 0xe9, 0x0a, + 0x7f, 0xe1, 0x64, 0x87, 0x91, 0x4a, 0x16, 0x39, 0xc5, 0x85, 0x78, 0x55, 0xf5, 0x92, 0xde, 0x5f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x51, 0x62, 0x40, 0x44, 0x02, 0x00, 0x00, +} + +func (m *Dog) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Dog) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Dog) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTestdata(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Size_) > 0 { + i -= len(m.Size_) + copy(dAtA[i:], m.Size_) + i = encodeVarintTestdata(dAtA, i, uint64(len(m.Size_))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Cat) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Cat) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Cat) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Lives != 0 { + i = encodeVarintTestdata(dAtA, i, uint64(m.Lives)) + i-- + dAtA[i] = 0x10 + } + if len(m.Moniker) > 0 { + i -= len(m.Moniker) + copy(dAtA[i:], m.Moniker) + i = encodeVarintTestdata(dAtA, i, uint64(len(m.Moniker))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HasAnimal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HasAnimal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.X != 0 { + i = encodeVarintTestdata(dAtA, i, uint64(m.X)) + i-- + dAtA[i] = 0x10 + } + if m.Animal != nil { + { + size, err := m.Animal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTestdata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HasHasAnimal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HasHasAnimal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HasHasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.HasAnimal != nil { + { + size, err := m.HasAnimal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTestdata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HasHasHasAnimal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HasHasHasAnimal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HasHasHasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.HasHasAnimal != nil { + { + size, err := m.HasHasAnimal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTestdata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BadMultiSignature) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BadMultiSignature) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BadMultiSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.MaliciousField) > 0 { + i -= len(m.MaliciousField) + copy(dAtA[i:], m.MaliciousField) + i = encodeVarintTestdata(dAtA, i, uint64(len(m.MaliciousField))) + i-- + dAtA[i] = 0x2a + } + if len(m.Signatures) > 0 { + for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Signatures[iNdEx]) + copy(dAtA[i:], m.Signatures[iNdEx]) + i = encodeVarintTestdata(dAtA, i, uint64(len(m.Signatures[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintTestdata(dAtA []byte, offset int, v uint64) int { + offset -= sovTestdata(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Dog) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Size_) + if l > 0 { + n += 1 + l + sovTestdata(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTestdata(uint64(l)) + } + return n +} + +func (m *Cat) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Moniker) + if l > 0 { + n += 1 + l + sovTestdata(uint64(l)) + } + if m.Lives != 0 { + n += 1 + sovTestdata(uint64(m.Lives)) + } + return n +} + +func (m *HasAnimal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Animal != nil { + l = m.Animal.Size() + n += 1 + l + sovTestdata(uint64(l)) + } + if m.X != 0 { + n += 1 + sovTestdata(uint64(m.X)) + } + return n +} + +func (m *HasHasAnimal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HasAnimal != nil { + l = m.HasAnimal.Size() + n += 1 + l + sovTestdata(uint64(l)) + } + return n +} + +func (m *HasHasHasAnimal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HasHasAnimal != nil { + l = m.HasHasAnimal.Size() + n += 1 + l + sovTestdata(uint64(l)) + } + return n +} + +func (m *BadMultiSignature) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Signatures) > 0 { + for _, b := range m.Signatures { + l = len(b) + n += 1 + l + sovTestdata(uint64(l)) + } + } + l = len(m.MaliciousField) + if l > 0 { + n += 1 + l + sovTestdata(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovTestdata(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTestdata(x uint64) (n int) { + return sovTestdata(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Dog) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Dog: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Dog: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Size_ = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTestdata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Cat) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Cat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Cat: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Moniker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Lives", wireType) + } + m.Lives = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Lives |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTestdata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HasAnimal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HasAnimal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Animal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Animal == nil { + m.Animal = &types.Any{} + } + if err := m.Animal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + m.X = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.X |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTestdata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HasHasAnimal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HasHasAnimal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HasHasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HasAnimal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.HasAnimal == nil { + m.HasAnimal = &types.Any{} + } + if err := m.HasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTestdata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HasHasHasAnimal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HasHasHasAnimal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HasHasHasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HasHasAnimal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.HasHasAnimal == nil { + m.HasHasAnimal = &types.Any{} + } + if err := m.HasHasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTestdata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BadMultiSignature) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BadMultiSignature: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BadMultiSignature: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signatures = append(m.Signatures, make([]byte, postIndex-iNdEx)) + copy(m.Signatures[len(m.Signatures)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaliciousField", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTestdata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTestdata + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTestdata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MaliciousField = append(m.MaliciousField[:0], dAtA[iNdEx:postIndex]...) + if m.MaliciousField == nil { + m.MaliciousField = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTestdata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTestdata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTestdata(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTestdata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTestdata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTestdata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTestdata + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTestdata + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTestdata + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTestdata = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTestdata = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTestdata = fmt.Errorf("proto: unexpected end of group") +) diff --git a/testutil/testdata/testdata.proto b/testutil/testdata/testdata.proto new file mode 100644 index 0000000000..585c2303c1 --- /dev/null +++ b/testutil/testdata/testdata.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package testdata; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/testutil/testdata"; + +message Dog { + string size = 1; + string name = 2; +} + +message Cat { + string moniker = 1; + int32 lives = 2; +} + +message HasAnimal { + google.protobuf.Any animal = 1; + int64 x = 2; +} + +message HasHasAnimal { + google.protobuf.Any has_animal = 1; +} + +message HasHasHasAnimal { + google.protobuf.Any has_has_animal = 1; +} + +// bad MultiSignature with extra fields +message BadMultiSignature { + option (gogoproto.goproto_unrecognized) = true; + repeated bytes signatures = 1; + bytes malicious_field = 5; +} diff --git a/testutil/testdata/test_tx.go b/testutil/testdata/tx.go similarity index 81% rename from testutil/testdata/test_tx.go rename to testutil/testdata/tx.go index 72f8d0f00a..09e1e365f1 100644 --- a/testutil/testdata/test_tx.go +++ b/testutil/testdata/tx.go @@ -65,3 +65,15 @@ func (msg *TestMsg) GetSigners() []sdk.AccAddress { return addrs } func (msg *TestMsg) ValidateBasic() error { return nil } + +var _ sdk.MsgRequest = &MsgCreateDog{} + +func (msg *MsgCreateDog) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{} } +func (msg *MsgCreateDog) ValidateBasic() error { return nil } + +func NewServiceMsgCreateDog(msg *MsgCreateDog) sdk.Msg { + return sdk.ServiceMsg{ + MethodName: "/testdata.Msg/CreateDog", + Request: msg, + } +} diff --git a/testutil/testdata/tx.pb.go b/testutil/testdata/tx.pb.go new file mode 100644 index 0000000000..3b0530fe46 --- /dev/null +++ b/testutil/testdata/tx.pb.go @@ -0,0 +1,764 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: tx.proto + +package testdata + +import ( + context "context" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MsgCreateDog struct { + Dog *Dog `protobuf:"bytes,1,opt,name=dog,proto3" json:"dog,omitempty"` +} + +func (m *MsgCreateDog) Reset() { *m = MsgCreateDog{} } +func (m *MsgCreateDog) String() string { return proto.CompactTextString(m) } +func (*MsgCreateDog) ProtoMessage() {} +func (*MsgCreateDog) Descriptor() ([]byte, []int) { + return fileDescriptor_0fd2153dc07d3b5c, []int{0} +} +func (m *MsgCreateDog) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateDog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateDog.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateDog) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateDog.Merge(m, src) +} +func (m *MsgCreateDog) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateDog) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateDog.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateDog proto.InternalMessageInfo + +func (m *MsgCreateDog) GetDog() *Dog { + if m != nil { + return m.Dog + } + return nil +} + +type MsgCreateDogResponse struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *MsgCreateDogResponse) Reset() { *m = MsgCreateDogResponse{} } +func (m *MsgCreateDogResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateDogResponse) ProtoMessage() {} +func (*MsgCreateDogResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0fd2153dc07d3b5c, []int{1} +} +func (m *MsgCreateDogResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateDogResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateDogResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateDogResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateDogResponse.Merge(m, src) +} +func (m *MsgCreateDogResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateDogResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateDogResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateDogResponse proto.InternalMessageInfo + +func (m *MsgCreateDogResponse) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// TestMsg is msg type for testing protobuf message using any, as defined in +// https://github.com/cosmos/cosmos-sdk/issues/6213. +type TestMsg struct { + Signers []string `protobuf:"bytes,1,rep,name=signers,proto3" json:"signers,omitempty"` +} + +func (m *TestMsg) Reset() { *m = TestMsg{} } +func (m *TestMsg) String() string { return proto.CompactTextString(m) } +func (*TestMsg) ProtoMessage() {} +func (*TestMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_0fd2153dc07d3b5c, []int{2} +} +func (m *TestMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestMsg.Merge(m, src) +} +func (m *TestMsg) XXX_Size() int { + return m.Size() +} +func (m *TestMsg) XXX_DiscardUnknown() { + xxx_messageInfo_TestMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_TestMsg proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgCreateDog)(nil), "testdata.MsgCreateDog") + proto.RegisterType((*MsgCreateDogResponse)(nil), "testdata.MsgCreateDogResponse") + proto.RegisterType((*TestMsg)(nil), "testdata.TestMsg") +} + +func init() { proto.RegisterFile("tx.proto", fileDescriptor_0fd2153dc07d3b5c) } + +var fileDescriptor_0fd2153dc07d3b5c = []byte{ + // 258 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x28, 0xa9, 0xd0, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x28, 0x49, 0x2d, 0x2e, 0x49, 0x49, 0x2c, 0x49, 0x94, 0x12, + 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x0b, 0xea, 0x83, 0x58, 0x10, 0x79, 0x29, 0x3e, 0x98, 0x3c, 0x84, + 0xaf, 0xa4, 0xcf, 0xc5, 0xe3, 0x5b, 0x9c, 0xee, 0x5c, 0x94, 0x9a, 0x58, 0x92, 0xea, 0x92, 0x9f, + 0x2e, 0x24, 0xcf, 0xc5, 0x9c, 0x92, 0x9f, 0x2e, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0xc4, 0xab, + 0x07, 0x57, 0xed, 0x92, 0x9f, 0x1e, 0x04, 0x92, 0x51, 0xd2, 0xe2, 0x12, 0x41, 0xd6, 0x10, 0x94, + 0x5a, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0x2a, 0x24, 0xc4, 0xc5, 0x92, 0x97, 0x98, 0x9b, 0x0a, 0xd6, + 0xc9, 0x19, 0x04, 0x66, 0x2b, 0x69, 0x72, 0xb1, 0x87, 0xa4, 0x16, 0x97, 0xf8, 0x16, 0xa7, 0x0b, + 0x49, 0x70, 0xb1, 0x17, 0x67, 0xa6, 0xe7, 0xa5, 0x16, 0x15, 0x4b, 0x30, 0x2a, 0x30, 0x6b, 0x70, + 0x06, 0xc1, 0xb8, 0x56, 0x2c, 0x1d, 0x0b, 0xe4, 0x19, 0x8c, 0xbc, 0xb8, 0x98, 0x41, 0xca, 0x9c, + 0xb9, 0x38, 0x11, 0x6e, 0x11, 0x43, 0x58, 0x8f, 0x6c, 0xa5, 0x94, 0x1c, 0x76, 0x71, 0x98, 0x53, + 0x9c, 0x3c, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, + 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x2f, 0x3d, 0xb3, + 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0x39, 0xbf, 0x38, 0x37, 0xbf, 0x18, 0x4a, + 0xe9, 0x16, 0xa7, 0x64, 0xeb, 0x83, 0x4c, 0x2d, 0x2d, 0xc9, 0xcc, 0xd1, 0x87, 0x19, 0x9f, 0xc4, + 0x06, 0x0e, 0x24, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x15, 0x63, 0x9a, 0x1b, 0x60, 0x01, + 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + CreateDog(ctx context.Context, in *MsgCreateDog, opts ...grpc.CallOption) (*MsgCreateDogResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateDog(ctx context.Context, in *MsgCreateDog, opts ...grpc.CallOption) (*MsgCreateDogResponse, error) { + out := new(MsgCreateDogResponse) + err := c.cc.Invoke(ctx, "/testdata.Msg/CreateDog", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + CreateDog(context.Context, *MsgCreateDog) (*MsgCreateDogResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreateDog(ctx context.Context, req *MsgCreateDog) (*MsgCreateDogResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDog not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreateDog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateDog) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateDog(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/testdata.Msg/CreateDog", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateDog(ctx, req.(*MsgCreateDog)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "testdata.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateDog", + Handler: _Msg_CreateDog_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "tx.proto", +} + +func (m *MsgCreateDog) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateDog) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateDog) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Dog != nil { + { + size, err := m.Dog.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateDogResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateDogResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateDogResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TestMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestMsg) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signers) > 0 { + for iNdEx := len(m.Signers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Signers[iNdEx]) + copy(dAtA[i:], m.Signers[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signers[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreateDog) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Dog != nil { + l = m.Dog.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateDogResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *TestMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Signers) > 0 { + for _, s := range m.Signers { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgCreateDog) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateDog: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDog: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Dog", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Dog == nil { + m.Dog = &Dog{} + } + if err := m.Dog.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateDogResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateDogResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDogResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TestMsg) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signers = append(m.Signers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/testutil/testdata/tx.proto b/testutil/testdata/tx.proto new file mode 100644 index 0000000000..8f670fc50e --- /dev/null +++ b/testutil/testdata/tx.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package testdata; + +import "gogoproto/gogo.proto"; +import "testdata.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/testutil/testdata"; + +// Msg tests the Protobuf message service as defined in +// https://github.com/cosmos/cosmos-sdk/issues/7500. +service Msg { + rpc CreateDog(MsgCreateDog) returns (MsgCreateDogResponse); +} + +message MsgCreateDog { + testdata.Dog dog = 1; +} + +message MsgCreateDogResponse { + string name = 1; +} + +// TestMsg is msg type for testing protobuf message using any, as defined in +// https://github.com/cosmos/cosmos-sdk/issues/6213. +message TestMsg { + option (gogoproto.goproto_getters) = false; + repeated string signers = 1; +} diff --git a/testutil/testdata/proto.pb.go b/testutil/testdata/unknonwnproto.pb.go similarity index 70% rename from testutil/testdata/proto.pb.go rename to testutil/testdata/unknonwnproto.pb.go index 929f0d4423..b8a5425e87 100644 --- a/testutil/testdata/proto.pb.go +++ b/testutil/testdata/unknonwnproto.pb.go @@ -1,20 +1,15 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: proto.proto +// source: unknonwnproto.proto package testdata import ( - context "context" encoding_binary "encoding/binary" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" tx "github.com/cosmos/cosmos-sdk/types/tx" _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -62,607 +57,7 @@ func (x Customer2_City) String() string { } func (Customer2_City) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{14, 0} -} - -type Dog struct { - Size_ string `protobuf:"bytes,1,opt,name=size,proto3" json:"size,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *Dog) Reset() { *m = Dog{} } -func (m *Dog) String() string { return proto.CompactTextString(m) } -func (*Dog) ProtoMessage() {} -func (*Dog) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{0} -} -func (m *Dog) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Dog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Dog.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Dog) XXX_Merge(src proto.Message) { - xxx_messageInfo_Dog.Merge(m, src) -} -func (m *Dog) XXX_Size() int { - return m.Size() -} -func (m *Dog) XXX_DiscardUnknown() { - xxx_messageInfo_Dog.DiscardUnknown(m) -} - -var xxx_messageInfo_Dog proto.InternalMessageInfo - -func (m *Dog) GetSize_() string { - if m != nil { - return m.Size_ - } - return "" -} - -func (m *Dog) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type Cat struct { - Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` - Lives int32 `protobuf:"varint,2,opt,name=lives,proto3" json:"lives,omitempty"` -} - -func (m *Cat) Reset() { *m = Cat{} } -func (m *Cat) String() string { return proto.CompactTextString(m) } -func (*Cat) ProtoMessage() {} -func (*Cat) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{1} -} -func (m *Cat) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Cat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Cat.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Cat) XXX_Merge(src proto.Message) { - xxx_messageInfo_Cat.Merge(m, src) -} -func (m *Cat) XXX_Size() int { - return m.Size() -} -func (m *Cat) XXX_DiscardUnknown() { - xxx_messageInfo_Cat.DiscardUnknown(m) -} - -var xxx_messageInfo_Cat proto.InternalMessageInfo - -func (m *Cat) GetMoniker() string { - if m != nil { - return m.Moniker - } - return "" -} - -func (m *Cat) GetLives() int32 { - if m != nil { - return m.Lives - } - return 0 -} - -type HasAnimal struct { - Animal *types.Any `protobuf:"bytes,1,opt,name=animal,proto3" json:"animal,omitempty"` - X int64 `protobuf:"varint,2,opt,name=x,proto3" json:"x,omitempty"` -} - -func (m *HasAnimal) Reset() { *m = HasAnimal{} } -func (m *HasAnimal) String() string { return proto.CompactTextString(m) } -func (*HasAnimal) ProtoMessage() {} -func (*HasAnimal) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{2} -} -func (m *HasAnimal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HasAnimal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HasAnimal) XXX_Merge(src proto.Message) { - xxx_messageInfo_HasAnimal.Merge(m, src) -} -func (m *HasAnimal) XXX_Size() int { - return m.Size() -} -func (m *HasAnimal) XXX_DiscardUnknown() { - xxx_messageInfo_HasAnimal.DiscardUnknown(m) -} - -var xxx_messageInfo_HasAnimal proto.InternalMessageInfo - -func (m *HasAnimal) GetAnimal() *types.Any { - if m != nil { - return m.Animal - } - return nil -} - -func (m *HasAnimal) GetX() int64 { - if m != nil { - return m.X - } - return 0 -} - -type HasHasAnimal struct { - HasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"` -} - -func (m *HasHasAnimal) Reset() { *m = HasHasAnimal{} } -func (m *HasHasAnimal) String() string { return proto.CompactTextString(m) } -func (*HasHasAnimal) ProtoMessage() {} -func (*HasHasAnimal) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{3} -} -func (m *HasHasAnimal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HasHasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HasHasAnimal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HasHasAnimal) XXX_Merge(src proto.Message) { - xxx_messageInfo_HasHasAnimal.Merge(m, src) -} -func (m *HasHasAnimal) XXX_Size() int { - return m.Size() -} -func (m *HasHasAnimal) XXX_DiscardUnknown() { - xxx_messageInfo_HasHasAnimal.DiscardUnknown(m) -} - -var xxx_messageInfo_HasHasAnimal proto.InternalMessageInfo - -func (m *HasHasAnimal) GetHasAnimal() *types.Any { - if m != nil { - return m.HasAnimal - } - return nil -} - -type HasHasHasAnimal struct { - HasHasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_has_animal,json=hasHasAnimal,proto3" json:"has_has_animal,omitempty"` -} - -func (m *HasHasHasAnimal) Reset() { *m = HasHasHasAnimal{} } -func (m *HasHasHasAnimal) String() string { return proto.CompactTextString(m) } -func (*HasHasHasAnimal) ProtoMessage() {} -func (*HasHasHasAnimal) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{4} -} -func (m *HasHasHasAnimal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HasHasHasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HasHasHasAnimal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HasHasHasAnimal) XXX_Merge(src proto.Message) { - xxx_messageInfo_HasHasHasAnimal.Merge(m, src) -} -func (m *HasHasHasAnimal) XXX_Size() int { - return m.Size() -} -func (m *HasHasHasAnimal) XXX_DiscardUnknown() { - xxx_messageInfo_HasHasHasAnimal.DiscardUnknown(m) -} - -var xxx_messageInfo_HasHasHasAnimal proto.InternalMessageInfo - -func (m *HasHasHasAnimal) GetHasHasAnimal() *types.Any { - if m != nil { - return m.HasHasAnimal - } - return nil -} - -type EchoRequest struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` -} - -func (m *EchoRequest) Reset() { *m = EchoRequest{} } -func (m *EchoRequest) String() string { return proto.CompactTextString(m) } -func (*EchoRequest) ProtoMessage() {} -func (*EchoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{5} -} -func (m *EchoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EchoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EchoRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EchoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_EchoRequest.Merge(m, src) -} -func (m *EchoRequest) XXX_Size() int { - return m.Size() -} -func (m *EchoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_EchoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_EchoRequest proto.InternalMessageInfo - -func (m *EchoRequest) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -type EchoResponse struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` -} - -func (m *EchoResponse) Reset() { *m = EchoResponse{} } -func (m *EchoResponse) String() string { return proto.CompactTextString(m) } -func (*EchoResponse) ProtoMessage() {} -func (*EchoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{6} -} -func (m *EchoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EchoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EchoResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EchoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_EchoResponse.Merge(m, src) -} -func (m *EchoResponse) XXX_Size() int { - return m.Size() -} -func (m *EchoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_EchoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_EchoResponse proto.InternalMessageInfo - -func (m *EchoResponse) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -type SayHelloRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *SayHelloRequest) Reset() { *m = SayHelloRequest{} } -func (m *SayHelloRequest) String() string { return proto.CompactTextString(m) } -func (*SayHelloRequest) ProtoMessage() {} -func (*SayHelloRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{7} -} -func (m *SayHelloRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SayHelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SayHelloRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SayHelloRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SayHelloRequest.Merge(m, src) -} -func (m *SayHelloRequest) XXX_Size() int { - return m.Size() -} -func (m *SayHelloRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SayHelloRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SayHelloRequest proto.InternalMessageInfo - -func (m *SayHelloRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type SayHelloResponse struct { - Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"` -} - -func (m *SayHelloResponse) Reset() { *m = SayHelloResponse{} } -func (m *SayHelloResponse) String() string { return proto.CompactTextString(m) } -func (*SayHelloResponse) ProtoMessage() {} -func (*SayHelloResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{8} -} -func (m *SayHelloResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SayHelloResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SayHelloResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SayHelloResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SayHelloResponse.Merge(m, src) -} -func (m *SayHelloResponse) XXX_Size() int { - return m.Size() -} -func (m *SayHelloResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SayHelloResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SayHelloResponse proto.InternalMessageInfo - -func (m *SayHelloResponse) GetGreeting() string { - if m != nil { - return m.Greeting - } - return "" -} - -type TestAnyRequest struct { - AnyAnimal *types.Any `protobuf:"bytes,1,opt,name=any_animal,json=anyAnimal,proto3" json:"any_animal,omitempty"` -} - -func (m *TestAnyRequest) Reset() { *m = TestAnyRequest{} } -func (m *TestAnyRequest) String() string { return proto.CompactTextString(m) } -func (*TestAnyRequest) ProtoMessage() {} -func (*TestAnyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{9} -} -func (m *TestAnyRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestAnyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestAnyRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestAnyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestAnyRequest.Merge(m, src) -} -func (m *TestAnyRequest) XXX_Size() int { - return m.Size() -} -func (m *TestAnyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TestAnyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TestAnyRequest proto.InternalMessageInfo - -func (m *TestAnyRequest) GetAnyAnimal() *types.Any { - if m != nil { - return m.AnyAnimal - } - return nil -} - -type TestAnyResponse struct { - HasAnimal *HasAnimal `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"` -} - -func (m *TestAnyResponse) Reset() { *m = TestAnyResponse{} } -func (m *TestAnyResponse) String() string { return proto.CompactTextString(m) } -func (*TestAnyResponse) ProtoMessage() {} -func (*TestAnyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{10} -} -func (m *TestAnyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestAnyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestAnyResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestAnyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestAnyResponse.Merge(m, src) -} -func (m *TestAnyResponse) XXX_Size() int { - return m.Size() -} -func (m *TestAnyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TestAnyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TestAnyResponse proto.InternalMessageInfo - -func (m *TestAnyResponse) GetHasAnimal() *HasAnimal { - if m != nil { - return m.HasAnimal - } - return nil -} - -// msg type for testing -type TestMsg struct { - Signers []string `protobuf:"bytes,1,rep,name=signers,proto3" json:"signers,omitempty"` -} - -func (m *TestMsg) Reset() { *m = TestMsg{} } -func (m *TestMsg) String() string { return proto.CompactTextString(m) } -func (*TestMsg) ProtoMessage() {} -func (*TestMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{11} -} -func (m *TestMsg) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TestMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TestMsg.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TestMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestMsg.Merge(m, src) -} -func (m *TestMsg) XXX_Size() int { - return m.Size() -} -func (m *TestMsg) XXX_DiscardUnknown() { - xxx_messageInfo_TestMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_TestMsg proto.InternalMessageInfo - -// bad MultiSignature with extra fields -type BadMultiSignature struct { - Signatures [][]byte `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` - MaliciousField []byte `protobuf:"bytes,5,opt,name=malicious_field,json=maliciousField,proto3" json:"malicious_field,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *BadMultiSignature) Reset() { *m = BadMultiSignature{} } -func (m *BadMultiSignature) String() string { return proto.CompactTextString(m) } -func (*BadMultiSignature) ProtoMessage() {} -func (*BadMultiSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{12} -} -func (m *BadMultiSignature) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BadMultiSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BadMultiSignature.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BadMultiSignature) XXX_Merge(src proto.Message) { - xxx_messageInfo_BadMultiSignature.Merge(m, src) -} -func (m *BadMultiSignature) XXX_Size() int { - return m.Size() -} -func (m *BadMultiSignature) XXX_DiscardUnknown() { - xxx_messageInfo_BadMultiSignature.DiscardUnknown(m) -} - -var xxx_messageInfo_BadMultiSignature proto.InternalMessageInfo - -func (m *BadMultiSignature) GetSignatures() [][]byte { - if m != nil { - return m.Signatures - } - return nil -} - -func (m *BadMultiSignature) GetMaliciousField() []byte { - if m != nil { - return m.MaliciousField - } - return nil + return fileDescriptor_448ea787339d1228, []int{1, 0} } type Customer1 struct { @@ -676,7 +71,7 @@ func (m *Customer1) Reset() { *m = Customer1{} } func (m *Customer1) String() string { return proto.CompactTextString(m) } func (*Customer1) ProtoMessage() {} func (*Customer1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{13} + return fileDescriptor_448ea787339d1228, []int{0} } func (m *Customer1) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -747,7 +142,7 @@ func (m *Customer2) Reset() { *m = Customer2{} } func (m *Customer2) String() string { return proto.CompactTextString(m) } func (*Customer2) ProtoMessage() {} func (*Customer2) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{14} + return fileDescriptor_448ea787339d1228, []int{1} } func (m *Customer2) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -834,7 +229,7 @@ func (m *Nested4A) Reset() { *m = Nested4A{} } func (m *Nested4A) String() string { return proto.CompactTextString(m) } func (*Nested4A) ProtoMessage() {} func (*Nested4A) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{15} + return fileDescriptor_448ea787339d1228, []int{2} } func (m *Nested4A) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -888,7 +283,7 @@ func (m *Nested3A) Reset() { *m = Nested3A{} } func (m *Nested3A) String() string { return proto.CompactTextString(m) } func (*Nested3A) ProtoMessage() {} func (*Nested3A) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{16} + return fileDescriptor_448ea787339d1228, []int{3} } func (m *Nested3A) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -955,7 +350,7 @@ func (m *Nested2A) Reset() { *m = Nested2A{} } func (m *Nested2A) String() string { return proto.CompactTextString(m) } func (*Nested2A) ProtoMessage() {} func (*Nested2A) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{17} + return fileDescriptor_448ea787339d1228, []int{4} } func (m *Nested2A) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1014,7 +409,7 @@ func (m *Nested1A) Reset() { *m = Nested1A{} } func (m *Nested1A) String() string { return proto.CompactTextString(m) } func (*Nested1A) ProtoMessage() {} func (*Nested1A) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{18} + return fileDescriptor_448ea787339d1228, []int{5} } func (m *Nested1A) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1067,7 +462,7 @@ func (m *Nested4B) Reset() { *m = Nested4B{} } func (m *Nested4B) String() string { return proto.CompactTextString(m) } func (*Nested4B) ProtoMessage() {} func (*Nested4B) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{19} + return fileDescriptor_448ea787339d1228, []int{6} } func (m *Nested4B) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1128,7 +523,7 @@ func (m *Nested3B) Reset() { *m = Nested3B{} } func (m *Nested3B) String() string { return proto.CompactTextString(m) } func (*Nested3B) ProtoMessage() {} func (*Nested3B) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{20} + return fileDescriptor_448ea787339d1228, []int{7} } func (m *Nested3B) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1196,7 +591,7 @@ func (m *Nested2B) Reset() { *m = Nested2B{} } func (m *Nested2B) String() string { return proto.CompactTextString(m) } func (*Nested2B) ProtoMessage() {} func (*Nested2B) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{21} + return fileDescriptor_448ea787339d1228, []int{8} } func (m *Nested2B) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1263,7 +658,7 @@ func (m *Nested1B) Reset() { *m = Nested1B{} } func (m *Nested1B) String() string { return proto.CompactTextString(m) } func (*Nested1B) ProtoMessage() {} func (*Nested1B) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{22} + return fileDescriptor_448ea787339d1228, []int{9} } func (m *Nested1B) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1330,7 +725,7 @@ func (m *Customer3) Reset() { *m = Customer3{} } func (m *Customer3) String() string { return proto.CompactTextString(m) } func (*Customer3) ProtoMessage() {} func (*Customer3) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{23} + return fileDescriptor_448ea787339d1228, []int{10} } func (m *Customer3) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1467,7 +862,7 @@ func (m *TestVersion1) Reset() { *m = TestVersion1{} } func (m *TestVersion1) String() string { return proto.CompactTextString(m) } func (*TestVersion1) ProtoMessage() {} func (*TestVersion1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{24} + return fileDescriptor_448ea787339d1228, []int{11} } func (m *TestVersion1) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1612,7 +1007,7 @@ func (m *TestVersion2) Reset() { *m = TestVersion2{} } func (m *TestVersion2) String() string { return proto.CompactTextString(m) } func (*TestVersion2) ProtoMessage() {} func (*TestVersion2) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{25} + return fileDescriptor_448ea787339d1228, []int{12} } func (m *TestVersion2) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1764,7 +1159,7 @@ func (m *TestVersion3) Reset() { *m = TestVersion3{} } func (m *TestVersion3) String() string { return proto.CompactTextString(m) } func (*TestVersion3) ProtoMessage() {} func (*TestVersion3) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{26} + return fileDescriptor_448ea787339d1228, []int{13} } func (m *TestVersion3) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1915,7 +1310,7 @@ func (m *TestVersion3LoneOneOfValue) Reset() { *m = TestVersion3LoneOneO func (m *TestVersion3LoneOneOfValue) String() string { return proto.CompactTextString(m) } func (*TestVersion3LoneOneOfValue) ProtoMessage() {} func (*TestVersion3LoneOneOfValue) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{27} + return fileDescriptor_448ea787339d1228, []int{14} } func (m *TestVersion3LoneOneOfValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2056,7 +1451,7 @@ func (m *TestVersion3LoneNesting) Reset() { *m = TestVersion3LoneNesting func (m *TestVersion3LoneNesting) String() string { return proto.CompactTextString(m) } func (*TestVersion3LoneNesting) ProtoMessage() {} func (*TestVersion3LoneNesting) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{28} + return fileDescriptor_448ea787339d1228, []int{15} } func (m *TestVersion3LoneNesting) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2198,7 +1593,7 @@ func (m *TestVersion3LoneNesting_Inner1) Reset() { *m = TestVersion3Lone func (m *TestVersion3LoneNesting_Inner1) String() string { return proto.CompactTextString(m) } func (*TestVersion3LoneNesting_Inner1) ProtoMessage() {} func (*TestVersion3LoneNesting_Inner1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{28, 0} + return fileDescriptor_448ea787339d1228, []int{15, 0} } func (m *TestVersion3LoneNesting_Inner1) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2261,7 +1656,7 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) String() string { } func (*TestVersion3LoneNesting_Inner1_InnerInner) ProtoMessage() {} func (*TestVersion3LoneNesting_Inner1_InnerInner) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{28, 0, 0} + return fileDescriptor_448ea787339d1228, []int{15, 0, 0} } func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2314,7 +1709,7 @@ func (m *TestVersion3LoneNesting_Inner2) Reset() { *m = TestVersion3Lone func (m *TestVersion3LoneNesting_Inner2) String() string { return proto.CompactTextString(m) } func (*TestVersion3LoneNesting_Inner2) ProtoMessage() {} func (*TestVersion3LoneNesting_Inner2) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{28, 1} + return fileDescriptor_448ea787339d1228, []int{15, 1} } func (m *TestVersion3LoneNesting_Inner2) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2377,7 +1772,7 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) String() string { } func (*TestVersion3LoneNesting_Inner2_InnerInner) ProtoMessage() {} func (*TestVersion3LoneNesting_Inner2_InnerInner) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{28, 1, 0} + return fileDescriptor_448ea787339d1228, []int{15, 1, 0} } func (m *TestVersion3LoneNesting_Inner2_InnerInner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2443,7 +1838,7 @@ func (m *TestVersion4LoneNesting) Reset() { *m = TestVersion4LoneNesting func (m *TestVersion4LoneNesting) String() string { return proto.CompactTextString(m) } func (*TestVersion4LoneNesting) ProtoMessage() {} func (*TestVersion4LoneNesting) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{29} + return fileDescriptor_448ea787339d1228, []int{16} } func (m *TestVersion4LoneNesting) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2585,7 +1980,7 @@ func (m *TestVersion4LoneNesting_Inner1) Reset() { *m = TestVersion4Lone func (m *TestVersion4LoneNesting_Inner1) String() string { return proto.CompactTextString(m) } func (*TestVersion4LoneNesting_Inner1) ProtoMessage() {} func (*TestVersion4LoneNesting_Inner1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{29, 0} + return fileDescriptor_448ea787339d1228, []int{16, 0} } func (m *TestVersion4LoneNesting_Inner1) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2648,7 +2043,7 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) String() string { } func (*TestVersion4LoneNesting_Inner1_InnerInner) ProtoMessage() {} func (*TestVersion4LoneNesting_Inner1_InnerInner) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{29, 0, 0} + return fileDescriptor_448ea787339d1228, []int{16, 0, 0} } func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2701,7 +2096,7 @@ func (m *TestVersion4LoneNesting_Inner2) Reset() { *m = TestVersion4Lone func (m *TestVersion4LoneNesting_Inner2) String() string { return proto.CompactTextString(m) } func (*TestVersion4LoneNesting_Inner2) ProtoMessage() {} func (*TestVersion4LoneNesting_Inner2) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{29, 1} + return fileDescriptor_448ea787339d1228, []int{16, 1} } func (m *TestVersion4LoneNesting_Inner2) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2764,7 +2159,7 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) String() string { } func (*TestVersion4LoneNesting_Inner2_InnerInner) ProtoMessage() {} func (*TestVersion4LoneNesting_Inner2_InnerInner) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{29, 1, 0} + return fileDescriptor_448ea787339d1228, []int{16, 1, 0} } func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2822,7 +2217,7 @@ func (m *TestVersionFD1) Reset() { *m = TestVersionFD1{} } func (m *TestVersionFD1) String() string { return proto.CompactTextString(m) } func (*TestVersionFD1) ProtoMessage() {} func (*TestVersionFD1) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{30} + return fileDescriptor_448ea787339d1228, []int{17} } func (m *TestVersionFD1) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2939,7 +2334,7 @@ func (m *TestVersionFD1WithExtraAny) Reset() { *m = TestVersionFD1WithEx func (m *TestVersionFD1WithExtraAny) String() string { return proto.CompactTextString(m) } func (*TestVersionFD1WithExtraAny) ProtoMessage() {} func (*TestVersionFD1WithExtraAny) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{31} + return fileDescriptor_448ea787339d1228, []int{18} } func (m *TestVersionFD1WithExtraAny) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3051,7 +2446,7 @@ func (m *AnyWithExtra) Reset() { *m = AnyWithExtra{} } func (m *AnyWithExtra) String() string { return proto.CompactTextString(m) } func (*AnyWithExtra) ProtoMessage() {} func (*AnyWithExtra) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{32} + return fileDescriptor_448ea787339d1228, []int{19} } func (m *AnyWithExtra) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3106,7 +2501,7 @@ func (m *TestUpdatedTxRaw) Reset() { *m = TestUpdatedTxRaw{} } func (m *TestUpdatedTxRaw) String() string { return proto.CompactTextString(m) } func (*TestUpdatedTxRaw) ProtoMessage() {} func (*TestUpdatedTxRaw) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{33} + return fileDescriptor_448ea787339d1228, []int{20} } func (m *TestUpdatedTxRaw) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3184,7 +2579,7 @@ func (m *TestUpdatedTxBody) Reset() { *m = TestUpdatedTxBody{} } func (m *TestUpdatedTxBody) String() string { return proto.CompactTextString(m) } func (*TestUpdatedTxBody) ProtoMessage() {} func (*TestUpdatedTxBody) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{34} + return fileDescriptor_448ea787339d1228, []int{21} } func (m *TestUpdatedTxBody) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3273,7 +2668,7 @@ func (m *TestUpdatedAuthInfo) Reset() { *m = TestUpdatedAuthInfo{} } func (m *TestUpdatedAuthInfo) String() string { return proto.CompactTextString(m) } func (*TestUpdatedAuthInfo) ProtoMessage() {} func (*TestUpdatedAuthInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{35} + return fileDescriptor_448ea787339d1228, []int{22} } func (m *TestUpdatedAuthInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3338,7 +2733,7 @@ func (m *TestRepeatedUints) Reset() { *m = TestRepeatedUints{} } func (m *TestRepeatedUints) String() string { return proto.CompactTextString(m) } func (*TestRepeatedUints) ProtoMessage() {} func (*TestRepeatedUints) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{36} + return fileDescriptor_448ea787339d1228, []int{23} } func (m *TestRepeatedUints) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3376,19 +2771,6 @@ func (m *TestRepeatedUints) GetNums() []uint64 { func init() { proto.RegisterEnum("testdata.Customer2_City", Customer2_City_name, Customer2_City_value) - proto.RegisterType((*Dog)(nil), "testdata.Dog") - proto.RegisterType((*Cat)(nil), "testdata.Cat") - proto.RegisterType((*HasAnimal)(nil), "testdata.HasAnimal") - proto.RegisterType((*HasHasAnimal)(nil), "testdata.HasHasAnimal") - proto.RegisterType((*HasHasHasAnimal)(nil), "testdata.HasHasHasAnimal") - proto.RegisterType((*EchoRequest)(nil), "testdata.EchoRequest") - proto.RegisterType((*EchoResponse)(nil), "testdata.EchoResponse") - proto.RegisterType((*SayHelloRequest)(nil), "testdata.SayHelloRequest") - proto.RegisterType((*SayHelloResponse)(nil), "testdata.SayHelloResponse") - proto.RegisterType((*TestAnyRequest)(nil), "testdata.TestAnyRequest") - proto.RegisterType((*TestAnyResponse)(nil), "testdata.TestAnyResponse") - proto.RegisterType((*TestMsg)(nil), "testdata.TestMsg") - proto.RegisterType((*BadMultiSignature)(nil), "testdata.BadMultiSignature") proto.RegisterType((*Customer1)(nil), "testdata.Customer1") proto.RegisterType((*Customer2)(nil), "testdata.Customer2") proto.RegisterType((*Nested4A)(nil), "testdata.Nested4A") @@ -3424,734 +2806,113 @@ func init() { proto.RegisterType((*TestRepeatedUints)(nil), "testdata.TestRepeatedUints") } -func init() { proto.RegisterFile("proto.proto", fileDescriptor_2fcc84b9998d60d8) } +func init() { proto.RegisterFile("unknonwnproto.proto", fileDescriptor_448ea787339d1228) } -var fileDescriptor_2fcc84b9998d60d8 = []byte{ - // 1987 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xcd, 0x6f, 0x1b, 0xc7, - 0x15, 0xd7, 0x72, 0x49, 0x89, 0x7c, 0xa2, 0x29, 0x7a, 0xe2, 0xa6, 0x6b, 0x3a, 0x96, 0x95, 0x85, - 0x63, 0x33, 0x41, 0x4c, 0x5a, 0x4b, 0x1a, 0x28, 0x7c, 0x28, 0x4c, 0xca, 0x52, 0x64, 0xc0, 0x96, - 0x8b, 0xb5, 0x93, 0x16, 0xbe, 0x10, 0xcb, 0xdd, 0x21, 0xb9, 0x30, 0x39, 0xa3, 0xee, 0x2c, 0x25, - 0xb1, 0xa7, 0xa2, 0x3d, 0xb4, 0xc7, 0x5c, 0x8a, 0x02, 0x3d, 0xb5, 0xc7, 0x9e, 0x8a, 0xfc, 0x07, - 0xbd, 0xd5, 0x97, 0x02, 0xbe, 0x14, 0x28, 0x50, 0x20, 0x28, 0xec, 0x6b, 0xff, 0x83, 0xa2, 0x48, - 0x31, 0x1f, 0xfb, 0x41, 0x89, 0x54, 0x68, 0xa5, 0x8d, 0x21, 0x20, 0x17, 0x72, 0xe6, 0xed, 0x6f, - 0x7e, 0xf3, 0xe6, 0x7d, 0xed, 0xce, 0x0c, 0xac, 0xee, 0x07, 0x34, 0xa4, 0x35, 0xf1, 0x8b, 0xf2, - 0x21, 0x66, 0xa1, 0xe7, 0x84, 0x4e, 0xe5, 0x52, 0x9f, 0xf6, 0xa9, 0x10, 0xd6, 0x79, 0x4b, 0x3e, - 0xaf, 0x5c, 0xee, 0x53, 0xda, 0x1f, 0xe2, 0xba, 0xe8, 0x75, 0xc7, 0xbd, 0xba, 0x43, 0x26, 0xea, - 0x51, 0xc5, 0xa5, 0x6c, 0x44, 0x59, 0x3d, 0x3c, 0xaa, 0x1f, 0x6c, 0x76, 0x71, 0xe8, 0x6c, 0xd6, - 0xc3, 0x23, 0xf9, 0xcc, 0xbc, 0x05, 0xfa, 0x7d, 0xda, 0x47, 0x08, 0xb2, 0xcc, 0xff, 0x19, 0x36, - 0xb4, 0x0d, 0xad, 0x5a, 0xb0, 0x45, 0x9b, 0xcb, 0x88, 0x33, 0xc2, 0x46, 0x46, 0xca, 0x78, 0xdb, - 0xbc, 0x03, 0xfa, 0x96, 0x13, 0x22, 0x03, 0x56, 0x46, 0x94, 0xf8, 0xcf, 0x71, 0xa0, 0x46, 0x44, - 0x5d, 0x74, 0x09, 0x72, 0x43, 0xff, 0x00, 0x33, 0x31, 0x2a, 0x67, 0xcb, 0x8e, 0xf9, 0x09, 0x14, - 0x76, 0x1d, 0xd6, 0x22, 0xfe, 0xc8, 0x19, 0xa2, 0x8f, 0x61, 0xd9, 0x11, 0x2d, 0x31, 0x76, 0xd5, - 0xba, 0x54, 0x93, 0xaa, 0xd7, 0x22, 0xd5, 0x6b, 0x2d, 0x32, 0xb1, 0x15, 0x06, 0x15, 0x41, 0x3b, - 0x12, 0x64, 0xba, 0xad, 0x1d, 0x99, 0x5b, 0x50, 0xdc, 0x75, 0x58, 0xc2, 0xd5, 0x00, 0x18, 0x38, - 0xac, 0xb3, 0x00, 0x5f, 0x61, 0x10, 0x0d, 0x32, 0x1f, 0xc1, 0x9a, 0x24, 0x49, 0x78, 0xee, 0x42, - 0x89, 0xf3, 0x2c, 0xc8, 0x55, 0x1c, 0xa4, 0xc6, 0x9a, 0x37, 0x61, 0x75, 0xdb, 0x1d, 0x50, 0x1b, - 0xff, 0x74, 0x8c, 0x99, 0xb4, 0x0d, 0x66, 0xcc, 0xe9, 0xe3, 0xd8, 0x36, 0xb2, 0x6b, 0x56, 0xa1, - 0x28, 0x81, 0x6c, 0x9f, 0x12, 0x86, 0x4f, 0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ff, 0xff, 0x8b, 0xd7, 0x2e, 0x82, 0xb2, - 0x1c, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// TestServiceClient is the client API for TestService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type TestServiceClient interface { - Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) - SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) - TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error) -} - -type testServiceClient struct { - cc grpc1.ClientConn -} - -func NewTestServiceClient(cc grpc1.ClientConn) TestServiceClient { - return &testServiceClient{cc} -} - -func (c *testServiceClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) { - out := new(EchoResponse) - err := c.cc.Invoke(ctx, "/testdata.TestService/Echo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testServiceClient) SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) { - out := new(SayHelloResponse) - err := c.cc.Invoke(ctx, "/testdata.TestService/SayHello", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testServiceClient) TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error) { - out := new(TestAnyResponse) - err := c.cc.Invoke(ctx, "/testdata.TestService/TestAny", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// TestServiceServer is the server API for TestService service. -type TestServiceServer interface { - Echo(context.Context, *EchoRequest) (*EchoResponse, error) - SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) - TestAny(context.Context, *TestAnyRequest) (*TestAnyResponse, error) -} - -// UnimplementedTestServiceServer can be embedded to have forward compatible implementations. -type UnimplementedTestServiceServer struct { -} - -func (*UnimplementedTestServiceServer) Echo(ctx context.Context, req *EchoRequest) (*EchoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") -} -func (*UnimplementedTestServiceServer) SayHello(ctx context.Context, req *SayHelloRequest) (*SayHelloResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented") -} -func (*UnimplementedTestServiceServer) TestAny(ctx context.Context, req *TestAnyRequest) (*TestAnyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TestAny not implemented") -} - -func RegisterTestServiceServer(s grpc1.Server, srv TestServiceServer) { - s.RegisterService(&_TestService_serviceDesc, srv) -} - -func _TestService_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EchoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestServiceServer).Echo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/testdata.TestService/Echo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestServiceServer).Echo(ctx, req.(*EchoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestService_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SayHelloRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestServiceServer).SayHello(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/testdata.TestService/SayHello", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestServiceServer).SayHello(ctx, req.(*SayHelloRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestService_TestAny_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TestAnyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestServiceServer).TestAny(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/testdata.TestService/TestAny", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestServiceServer).TestAny(ctx, req.(*TestAnyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _TestService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "testdata.TestService", - HandlerType: (*TestServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Echo", - Handler: _TestService_Echo_Handler, - }, - { - MethodName: "SayHello", - Handler: _TestService_SayHello_Handler, - }, - { - MethodName: "TestAny", - Handler: _TestService_TestAny_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "proto.proto", -} - -func (m *Dog) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Dog) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Dog) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Size_) > 0 { - i -= len(m.Size_) - copy(dAtA[i:], m.Size_) - i = encodeVarintProto(dAtA, i, uint64(len(m.Size_))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Cat) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Cat) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Cat) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Lives != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Lives)) - i-- - dAtA[i] = 0x10 - } - if len(m.Moniker) > 0 { - i -= len(m.Moniker) - copy(dAtA[i:], m.Moniker) - i = encodeVarintProto(dAtA, i, uint64(len(m.Moniker))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HasAnimal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HasAnimal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) - i-- - dAtA[i] = 0x10 - } - if m.Animal != nil { - { - size, err := m.Animal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HasHasAnimal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HasHasAnimal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HasHasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.HasAnimal != nil { - { - size, err := m.HasAnimal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HasHasHasAnimal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HasHasHasAnimal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HasHasHasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.HasHasAnimal != nil { - { - size, err := m.HasHasAnimal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EchoRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EchoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EchoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintProto(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EchoResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EchoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EchoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintProto(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SayHelloRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SayHelloRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SayHelloRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SayHelloResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SayHelloResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SayHelloResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Greeting) > 0 { - i -= len(m.Greeting) - copy(dAtA[i:], m.Greeting) - i = encodeVarintProto(dAtA, i, uint64(len(m.Greeting))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TestAnyRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestAnyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestAnyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AnyAnimal != nil { - { - size, err := m.AnyAnimal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TestAnyResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestAnyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestAnyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.HasAnimal != nil { - { - size, err := m.HasAnimal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TestMsg) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TestMsg) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TestMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signers) > 0 { - for iNdEx := len(m.Signers) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Signers[iNdEx]) - copy(dAtA[i:], m.Signers[iNdEx]) - i = encodeVarintProto(dAtA, i, uint64(len(m.Signers[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *BadMultiSignature) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BadMultiSignature) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BadMultiSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.MaliciousField) > 0 { - i -= len(m.MaliciousField) - copy(dAtA[i:], m.MaliciousField) - i = encodeVarintProto(dAtA, i, uint64(len(m.MaliciousField))) - i-- - dAtA[i] = 0x2a - } - if len(m.Signatures) > 0 { - for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Signatures[iNdEx]) - copy(dAtA[i:], m.Signatures[iNdEx]) - i = encodeVarintProto(dAtA, i, uint64(len(m.Signatures[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil +var fileDescriptor_448ea787339d1228 = []byte{ + // 1644 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0x4f, 0x6f, 0x1b, 0xc7, + 0x15, 0xd7, 0x70, 0x49, 0x89, 0x7c, 0xa2, 0x69, 0x66, 0x6c, 0xb4, 0x1b, 0x3a, 0x66, 0x98, 0x85, + 0xeb, 0xb0, 0x41, 0x43, 0x9a, 0x4b, 0x06, 0x28, 0x72, 0x32, 0xe9, 0x58, 0x95, 0x01, 0x57, 0x2e, + 0xa6, 0x4e, 0x5a, 0xf8, 0x42, 0x2c, 0xb9, 0x43, 0x72, 0x21, 0x72, 0x46, 0xdd, 0x99, 0xb5, 0xc8, + 0x5b, 0xd1, 0x1e, 0x7a, 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x46, 0x99, 0x34, 0x77, 0xb4, 0x86, 0x78, + 0x6a, 0x7d, 0x91, 0x59, 0x6e, 0x6b, 0x9f, 0xda, 0xb6, 0x02, 0x79, 0x8f, 0xb9, 0x81, 0x90, 0xfe, + 0x42, 0x6f, 0x9d, 0x23, 0xc9, 0x3c, 0x31, 0xc9, 0x48, 0x99, 0x74, 0x13, 0x72, 0x23, 0x7a, 0x4c, + 0x7d, 0x33, 0xab, 0xed, 0x08, 0x27, 0xf8, 0x16, 0xe4, 0x7d, 0x2a, 0xa8, 0xff, 0x9c, 0xba, 0xe6, + 0x1f, 0xf2, 0x35, 0x54, 0x37, 0x48, 0x22, 0xc0, 0x3f, 0x82, 0xec, 0xd0, 0x93, 0x0b, 0x73, 0xbb, + 0x86, 0xea, 0x25, 0xdb, 0x6c, 0xc4, 0xe4, 0x36, 0x12, 0xab, 0x1a, 0x0f, 0x3c, 0xb9, 0x20, 0x1a, + 0x85, 0x3f, 0x86, 0x6b, 0x33, 0x4f, 0x0c, 0xe9, 0x74, 0xea, 0x30, 0xca, 0x03, 0x61, 0x42, 0x0d, + 0xd5, 0x77, 0xed, 0x9b, 0x8d, 0x90, 0xf3, 0x46, 0xcc, 0x79, 0xa3, 0xcb, 0x16, 0x64, 0x15, 0x6a, + 0xfd, 0x04, 0xb2, 0x4a, 0x13, 0xce, 0x43, 0xf6, 0xb1, 0xc3, 0x45, 0x79, 0x0b, 0x97, 0x00, 0x1e, + 0x73, 0xd1, 0x65, 0x63, 0x3a, 0xa5, 0xa2, 0x8c, 0x70, 0x11, 0xf2, 0x3f, 0x73, 0xa6, 0xbc, 0x3b, + 0x95, 0xbc, 0x9c, 0xc1, 0x00, 0xdb, 0x3f, 0xe5, 0x62, 0xc8, 0x8f, 0xcb, 0x06, 0xde, 0x85, 0x9d, + 0x03, 0xc7, 0xf3, 0xf9, 0xc0, 0x2b, 0x67, 0xad, 0x06, 0xe4, 0x0f, 0xa8, 0x90, 0xd4, 0xed, 0x74, + 0x37, 0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x05, 0xae, 0x2f, 0xef, 0xdc, 0x54, 0xd1, 0x9c, 0x5e, 0xb8, 0x47, 0x69, + 0x78, 0x17, 0xb7, 0x92, 0x5d, 0x6d, 0x1d, 0xb7, 0x54, 0x76, 0xb5, 0x37, 0xcd, 0xae, 0xf7, 0xc3, + 0xe4, 0x22, 0xf4, 0x88, 0x2a, 0x57, 0x3e, 0xf5, 0x98, 0xd4, 0xa9, 0xc2, 0x82, 0x59, 0x68, 0x7f, + 0x96, 0xe8, 0x71, 0x6f, 0xff, 0xc5, 0xab, 0x2a, 0x7a, 0xf9, 0xaa, 0x8a, 0xfe, 0xf9, 0xaa, 0x8a, + 0x3e, 0x7f, 0x5d, 0xdd, 0x7a, 0xf9, 0xba, 0xba, 0xf5, 0xf7, 0xd7, 0xd5, 0xad, 0x67, 0x8d, 0xb1, + 0x27, 0x27, 0xc1, 0xa0, 0x31, 0xe4, 0xb3, 0x66, 0xf4, 0x8f, 0x86, 0xf0, 0xe7, 0x43, 0xe1, 0x1e, + 0x36, 0x55, 0xdd, 0x07, 0xd2, 0x9b, 0x36, 0xe3, 0x06, 0x30, 0xd8, 0xd6, 0x44, 0xb7, 0xff, 0x1b, + 0x00, 0x00, 0xff, 0xff, 0xa6, 0x69, 0x10, 0x33, 0xe6, 0x18, 0x00, 0x00, } func (m *Customer1) Marshal() (dAtA []byte, err error) { @@ -4177,7 +2938,7 @@ func (m *Customer1) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Payment) > 0 { i -= len(m.Payment) copy(dAtA[i:], m.Payment) - i = encodeVarintProto(dAtA, i, uint64(len(m.Payment))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Payment))) i-- dAtA[i] = 0x3a } @@ -4190,12 +2951,12 @@ func (m *Customer1) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -4223,7 +2984,7 @@ func (m *Customer2) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if m.Reserved != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Reserved)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Reserved)) i-- dAtA[i] = 0x41 i-- @@ -4236,13 +2997,13 @@ func (m *Customer2) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x52 } if m.City != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.City)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.City)) i-- dAtA[i] = 0x30 } @@ -4255,17 +3016,17 @@ func (m *Customer2) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x1a } if m.Industry != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Industry)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Industry)) i-- dAtA[i] = 0x10 } if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -4295,12 +3056,12 @@ func (m *Nested4A) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -4338,15 +3099,15 @@ func (m *Nested3A) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } - i = encodeVarintProto(dAtA, i, uint64(k)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 - i = encodeVarintProto(dAtA, i, uint64(baseI-i)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x2a } @@ -4359,7 +3120,7 @@ func (m *Nested3A) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 @@ -4368,12 +3129,12 @@ func (m *Nested3A) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -4407,7 +3168,7 @@ func (m *Nested2A) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -4415,12 +3176,12 @@ func (m *Nested2A) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -4454,13 +3215,13 @@ func (m *Nested1A) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -4490,17 +3251,17 @@ func (m *Nested4B) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x1a } if m.Age != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Age)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Age)) i-- dAtA[i] = 0x10 } if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -4535,7 +3296,7 @@ func (m *Nested3B) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 @@ -4544,17 +3305,17 @@ func (m *Nested3B) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x1a } if m.Age != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Age)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Age)) i-- dAtA[i] = 0x10 } if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -4584,7 +3345,7 @@ func (m *Nested2B) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Route) > 0 { i -= len(m.Route) copy(dAtA[i:], m.Route) - i = encodeVarintProto(dAtA, i, uint64(len(m.Route))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Route))) i-- dAtA[i] = 0x22 } @@ -4595,7 +3356,7 @@ func (m *Nested2B) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -4607,7 +3368,7 @@ func (m *Nested2B) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x11 } if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -4635,7 +3396,7 @@ func (m *Nested1B) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if m.Age != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Age)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Age)) i-- dAtA[i] = 0x18 } @@ -4646,13 +3407,13 @@ func (m *Nested1B) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -4686,7 +3447,7 @@ func (m *Customer3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a @@ -4703,7 +3464,7 @@ func (m *Customer3) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Destination) > 0 { i -= len(m.Destination) copy(dAtA[i:], m.Destination) - i = encodeVarintProto(dAtA, i, uint64(len(m.Destination))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Destination))) i-- dAtA[i] = 0x2a } @@ -4722,12 +3483,12 @@ func (m *Customer3) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -4743,7 +3504,7 @@ func (m *Customer3_CreditCardNo) MarshalToSizedBuffer(dAtA []byte) (int, error) i := len(dAtA) i -= len(m.CreditCardNo) copy(dAtA[i:], m.CreditCardNo) - i = encodeVarintProto(dAtA, i, uint64(len(m.CreditCardNo))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.CreditCardNo))) i-- dAtA[i] = 0x3a return len(dAtA) - i, nil @@ -4757,7 +3518,7 @@ func (m *Customer3_ChequeNo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.ChequeNo) copy(dAtA[i:], m.ChequeNo) - i = encodeVarintProto(dAtA, i, uint64(len(m.ChequeNo))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.ChequeNo))) i-- dAtA[i] = 0x42 return len(dAtA) - i, nil @@ -4789,7 +3550,7 @@ func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x62 @@ -4802,7 +3563,7 @@ func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a @@ -4815,7 +3576,7 @@ func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 @@ -4837,7 +3598,7 @@ func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a @@ -4851,7 +3612,7 @@ func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 @@ -4864,7 +3625,7 @@ func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -4876,13 +3637,13 @@ func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) i-- dAtA[i] = 0x8 } @@ -4896,7 +3657,7 @@ func (m *TestVersion1_E) MarshalTo(dAtA []byte) (int, error) { func (m *TestVersion1_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarintProto(dAtA, i, uint64(m.E)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.E)) i-- dAtA[i] = 0x30 return len(dAtA) - i, nil @@ -4915,7 +3676,7 @@ func (m *TestVersion1_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3a @@ -4943,7 +3704,7 @@ func (m *TestVersion2) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if m.NewField != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.NewField)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.NewField)) i-- dAtA[i] = 0x1 i-- @@ -4956,7 +3717,7 @@ func (m *TestVersion2) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x62 @@ -4969,7 +3730,7 @@ func (m *TestVersion2) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a @@ -4982,7 +3743,7 @@ func (m *TestVersion2) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 @@ -5004,7 +3765,7 @@ func (m *TestVersion2) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a @@ -5018,7 +3779,7 @@ func (m *TestVersion2) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 @@ -5031,7 +3792,7 @@ func (m *TestVersion2) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -5043,13 +3804,13 @@ func (m *TestVersion2) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) i-- dAtA[i] = 0x8 } @@ -5063,7 +3824,7 @@ func (m *TestVersion2_E) MarshalTo(dAtA []byte) (int, error) { func (m *TestVersion2_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarintProto(dAtA, i, uint64(m.E)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.E)) i-- dAtA[i] = 0x30 return len(dAtA) - i, nil @@ -5082,7 +3843,7 @@ func (m *TestVersion2_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3a @@ -5112,7 +3873,7 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.NonCriticalField) > 0 { i -= len(m.NonCriticalField) copy(dAtA[i:], m.NonCriticalField) - i = encodeVarintProto(dAtA, i, uint64(len(m.NonCriticalField))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NonCriticalField))) i-- dAtA[i] = 0x40 i-- @@ -5125,7 +3886,7 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x62 @@ -5138,7 +3899,7 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a @@ -5151,7 +3912,7 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 @@ -5173,7 +3934,7 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a @@ -5187,7 +3948,7 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 @@ -5200,7 +3961,7 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -5212,13 +3973,13 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) i-- dAtA[i] = 0x8 } @@ -5232,7 +3993,7 @@ func (m *TestVersion3_E) MarshalTo(dAtA []byte) (int, error) { func (m *TestVersion3_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarintProto(dAtA, i, uint64(m.E)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.E)) i-- dAtA[i] = 0x30 return len(dAtA) - i, nil @@ -5251,7 +4012,7 @@ func (m *TestVersion3_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3a @@ -5281,7 +4042,7 @@ func (m *TestVersion3LoneOneOfValue) MarshalToSizedBuffer(dAtA []byte) (int, err if len(m.NonCriticalField) > 0 { i -= len(m.NonCriticalField) copy(dAtA[i:], m.NonCriticalField) - i = encodeVarintProto(dAtA, i, uint64(len(m.NonCriticalField))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NonCriticalField))) i-- dAtA[i] = 0x40 i-- @@ -5294,7 +4055,7 @@ func (m *TestVersion3LoneOneOfValue) MarshalToSizedBuffer(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x62 @@ -5307,7 +4068,7 @@ func (m *TestVersion3LoneOneOfValue) MarshalToSizedBuffer(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a @@ -5320,7 +4081,7 @@ func (m *TestVersion3LoneOneOfValue) MarshalToSizedBuffer(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 @@ -5342,7 +4103,7 @@ func (m *TestVersion3LoneOneOfValue) MarshalToSizedBuffer(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a @@ -5356,7 +4117,7 @@ func (m *TestVersion3LoneOneOfValue) MarshalToSizedBuffer(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 @@ -5369,7 +4130,7 @@ func (m *TestVersion3LoneOneOfValue) MarshalToSizedBuffer(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -5381,13 +4142,13 @@ func (m *TestVersion3LoneOneOfValue) MarshalToSizedBuffer(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) i-- dAtA[i] = 0x8 } @@ -5401,7 +4162,7 @@ func (m *TestVersion3LoneOneOfValue_E) MarshalTo(dAtA []byte) (int, error) { func (m *TestVersion3LoneOneOfValue_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarintProto(dAtA, i, uint64(m.E)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.E)) i-- dAtA[i] = 0x30 return len(dAtA) - i, nil @@ -5429,7 +4190,7 @@ func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) if len(m.NonCriticalField) > 0 { i -= len(m.NonCriticalField) copy(dAtA[i:], m.NonCriticalField) - i = encodeVarintProto(dAtA, i, uint64(len(m.NonCriticalField))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NonCriticalField))) i-- dAtA[i] = 0x40 i-- @@ -5442,7 +4203,7 @@ func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x7a @@ -5454,7 +4215,7 @@ func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x72 @@ -5466,7 +4227,7 @@ func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x62 @@ -5479,7 +4240,7 @@ func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a @@ -5492,7 +4253,7 @@ func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 @@ -5514,7 +4275,7 @@ func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a @@ -5528,7 +4289,7 @@ func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 @@ -5541,7 +4302,7 @@ func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -5553,13 +4314,13 @@ func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) i-- dAtA[i] = 0x8 } @@ -5580,7 +4341,7 @@ func (m *TestVersion3LoneNesting_F) MarshalToSizedBuffer(dAtA []byte) (int, erro return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3a @@ -5614,7 +4375,7 @@ func (m *TestVersion3LoneNesting_Inner1) MarshalToSizedBuffer(dAtA []byte) (int, return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -5622,12 +4383,12 @@ func (m *TestVersion3LoneNesting_Inner1) MarshalToSizedBuffer(dAtA []byte) (int, if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -5657,14 +4418,14 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) MarshalToSizedBuffer(dAtA [] if len(m.City) > 0 { i -= len(m.City) copy(dAtA[i:], m.City) - i = encodeVarintProto(dAtA, i, uint64(len(m.City))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.City))) i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) - i = encodeVarintProto(dAtA, i, uint64(len(m.Id))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } @@ -5698,7 +4459,7 @@ func (m *TestVersion3LoneNesting_Inner2) MarshalToSizedBuffer(dAtA []byte) (int, return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -5706,14 +4467,14 @@ func (m *TestVersion3LoneNesting_Inner2) MarshalToSizedBuffer(dAtA []byte) (int, if len(m.Country) > 0 { i -= len(m.Country) copy(dAtA[i:], m.Country) - i = encodeVarintProto(dAtA, i, uint64(len(m.Country))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Country))) i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) - i = encodeVarintProto(dAtA, i, uint64(len(m.Id))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } @@ -5743,14 +4504,14 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) MarshalToSizedBuffer(dAtA [] if len(m.City) > 0 { i -= len(m.City) copy(dAtA[i:], m.City) - i = encodeVarintProto(dAtA, i, uint64(len(m.City))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.City))) i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) - i = encodeVarintProto(dAtA, i, uint64(len(m.Id))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } @@ -5780,7 +4541,7 @@ func (m *TestVersion4LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) if len(m.NonCriticalField) > 0 { i -= len(m.NonCriticalField) copy(dAtA[i:], m.NonCriticalField) - i = encodeVarintProto(dAtA, i, uint64(len(m.NonCriticalField))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NonCriticalField))) i-- dAtA[i] = 0x40 i-- @@ -5793,7 +4554,7 @@ func (m *TestVersion4LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x7a @@ -5805,7 +4566,7 @@ func (m *TestVersion4LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x72 @@ -5817,7 +4578,7 @@ func (m *TestVersion4LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x62 @@ -5830,7 +4591,7 @@ func (m *TestVersion4LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a @@ -5843,7 +4604,7 @@ func (m *TestVersion4LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 @@ -5865,7 +4626,7 @@ func (m *TestVersion4LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a @@ -5879,7 +4640,7 @@ func (m *TestVersion4LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 @@ -5892,7 +4653,7 @@ func (m *TestVersion4LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -5904,13 +4665,13 @@ func (m *TestVersion4LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) i-- dAtA[i] = 0x8 } @@ -5931,7 +4692,7 @@ func (m *TestVersion4LoneNesting_F) MarshalToSizedBuffer(dAtA []byte) (int, erro return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3a @@ -5965,7 +4726,7 @@ func (m *TestVersion4LoneNesting_Inner1) MarshalToSizedBuffer(dAtA []byte) (int, return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -5973,12 +4734,12 @@ func (m *TestVersion4LoneNesting_Inner1) MarshalToSizedBuffer(dAtA []byte) (int, if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -6008,12 +4769,12 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) MarshalToSizedBuffer(dAtA [] if len(m.City) > 0 { i -= len(m.City) copy(dAtA[i:], m.City) - i = encodeVarintProto(dAtA, i, uint64(len(m.City))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.City))) i-- dAtA[i] = 0x12 } if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -6047,7 +4808,7 @@ func (m *TestVersion4LoneNesting_Inner2) MarshalToSizedBuffer(dAtA []byte) (int, return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -6055,14 +4816,14 @@ func (m *TestVersion4LoneNesting_Inner2) MarshalToSizedBuffer(dAtA []byte) (int, if len(m.Country) > 0 { i -= len(m.Country) copy(dAtA[i:], m.Country) - i = encodeVarintProto(dAtA, i, uint64(len(m.Country))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Country))) i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) - i = encodeVarintProto(dAtA, i, uint64(len(m.Id))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } @@ -6090,14 +4851,14 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) MarshalToSizedBuffer(dAtA [] var l int _ = l if m.Value != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Value)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Value)) i-- dAtA[i] = 0x10 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) - i = encodeVarintProto(dAtA, i, uint64(len(m.Id))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } @@ -6132,7 +4893,7 @@ func (m *TestVersionFD1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a @@ -6145,7 +4906,7 @@ func (m *TestVersionFD1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 @@ -6166,13 +4927,13 @@ func (m *TestVersionFD1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) i-- dAtA[i] = 0x8 } @@ -6186,7 +4947,7 @@ func (m *TestVersionFD1_E) MarshalTo(dAtA []byte) (int, error) { func (m *TestVersionFD1_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarintProto(dAtA, i, uint64(m.E)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.E)) i-- dAtA[i] = 0x30 return len(dAtA) - i, nil @@ -6205,7 +4966,7 @@ func (m *TestVersionFD1_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3a @@ -6240,7 +5001,7 @@ func (m *TestVersionFD1WithExtraAny) MarshalToSizedBuffer(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a @@ -6253,7 +5014,7 @@ func (m *TestVersionFD1WithExtraAny) MarshalToSizedBuffer(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 @@ -6274,13 +5035,13 @@ func (m *TestVersionFD1WithExtraAny) MarshalToSizedBuffer(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) i-- dAtA[i] = 0x8 } @@ -6294,7 +5055,7 @@ func (m *TestVersionFD1WithExtraAny_E) MarshalTo(dAtA []byte) (int, error) { func (m *TestVersionFD1WithExtraAny_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarintProto(dAtA, i, uint64(m.E)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.E)) i-- dAtA[i] = 0x30 return len(dAtA) - i, nil @@ -6313,7 +5074,7 @@ func (m *TestVersionFD1WithExtraAny_F) MarshalToSizedBuffer(dAtA []byte) (int, e return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3a @@ -6341,12 +5102,12 @@ func (m *AnyWithExtra) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if m.C != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.C)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.C)) i-- dAtA[i] = 0x20 } if m.B != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.B)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.B)) i-- dAtA[i] = 0x18 } @@ -6357,7 +5118,7 @@ func (m *AnyWithExtra) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -6388,7 +5149,7 @@ func (m *TestUpdatedTxRaw) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.NewField_1024) > 0 { i -= len(m.NewField_1024) copy(dAtA[i:], m.NewField_1024) - i = encodeVarintProto(dAtA, i, uint64(len(m.NewField_1024))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NewField_1024))) i-- dAtA[i] = 0x40 i-- @@ -6397,7 +5158,7 @@ func (m *TestUpdatedTxRaw) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.NewField_5) > 0 { i -= len(m.NewField_5) copy(dAtA[i:], m.NewField_5) - i = encodeVarintProto(dAtA, i, uint64(len(m.NewField_5))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NewField_5))) i-- dAtA[i] = 0x2a } @@ -6405,7 +5166,7 @@ func (m *TestUpdatedTxRaw) MarshalToSizedBuffer(dAtA []byte) (int, error) { for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Signatures[iNdEx]) copy(dAtA[i:], m.Signatures[iNdEx]) - i = encodeVarintProto(dAtA, i, uint64(len(m.Signatures[iNdEx]))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Signatures[iNdEx]))) i-- dAtA[i] = 0x1a } @@ -6413,14 +5174,14 @@ func (m *TestUpdatedTxRaw) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.AuthInfoBytes) > 0 { i -= len(m.AuthInfoBytes) copy(dAtA[i:], m.AuthInfoBytes) - i = encodeVarintProto(dAtA, i, uint64(len(m.AuthInfoBytes))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.AuthInfoBytes))) i-- dAtA[i] = 0x12 } if len(m.BodyBytes) > 0 { i -= len(m.BodyBytes) copy(dAtA[i:], m.BodyBytes) - i = encodeVarintProto(dAtA, i, uint64(len(m.BodyBytes))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.BodyBytes))) i-- dAtA[i] = 0xa } @@ -6455,7 +5216,7 @@ func (m *TestUpdatedTxBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x7f @@ -6466,7 +5227,7 @@ func (m *TestUpdatedTxBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.SomeNewFieldNonCriticalField) > 0 { i -= len(m.SomeNewFieldNonCriticalField) copy(dAtA[i:], m.SomeNewFieldNonCriticalField) - i = encodeVarintProto(dAtA, i, uint64(len(m.SomeNewFieldNonCriticalField))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.SomeNewFieldNonCriticalField))) i-- dAtA[i] = 0x41 i-- @@ -6480,7 +5241,7 @@ func (m *TestUpdatedTxBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3f @@ -6489,19 +5250,19 @@ func (m *TestUpdatedTxBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { } } if m.SomeNewField != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.SomeNewField)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.SomeNewField)) i-- dAtA[i] = 0x20 } if m.TimeoutHeight != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.TimeoutHeight)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.TimeoutHeight)) i-- dAtA[i] = 0x18 } if len(m.Memo) > 0 { i -= len(m.Memo) copy(dAtA[i:], m.Memo) - i = encodeVarintProto(dAtA, i, uint64(len(m.Memo))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.Memo))) i-- dAtA[i] = 0x12 } @@ -6513,7 +5274,7 @@ func (m *TestUpdatedTxBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -6545,7 +5306,7 @@ func (m *TestUpdatedAuthInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.NewField_1024) > 0 { i -= len(m.NewField_1024) copy(dAtA[i:], m.NewField_1024) - i = encodeVarintProto(dAtA, i, uint64(len(m.NewField_1024))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NewField_1024))) i-- dAtA[i] = 0x40 i-- @@ -6554,7 +5315,7 @@ func (m *TestUpdatedAuthInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.NewField_3) > 0 { i -= len(m.NewField_3) copy(dAtA[i:], m.NewField_3) - i = encodeVarintProto(dAtA, i, uint64(len(m.NewField_3))) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(len(m.NewField_3))) i-- dAtA[i] = 0x1a } @@ -6565,7 +5326,7 @@ func (m *TestUpdatedAuthInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 @@ -6578,7 +5339,7 @@ func (m *TestUpdatedAuthInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -6608,28 +5369,28 @@ func (m *TestRepeatedUints) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.Nums) > 0 { - dAtA59 := make([]byte, len(m.Nums)*10) - var j58 int + dAtA54 := make([]byte, len(m.Nums)*10) + var j53 int for _, num := range m.Nums { for num >= 1<<7 { - dAtA59[j58] = uint8(uint64(num)&0x7f | 0x80) + dAtA54[j53] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j58++ + j53++ } - dAtA59[j58] = uint8(num) - j58++ + dAtA54[j53] = uint8(num) + j53++ } - i -= j58 - copy(dAtA[i:], dAtA59[:j58]) - i = encodeVarintProto(dAtA, i, uint64(j58)) + i -= j53 + copy(dAtA[i:], dAtA54[:j53]) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(j53)) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarintProto(dAtA []byte, offset int, v uint64) int { - offset -= sovProto(v) +func encodeVarintUnknonwnproto(dAtA []byte, offset int, v uint64) int { + offset -= sovUnknonwnproto(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -6639,196 +5400,6 @@ func encodeVarintProto(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Dog) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Size_) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *Cat) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Moniker) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.Lives != 0 { - n += 1 + sovProto(uint64(m.Lives)) - } - return n -} - -func (m *HasAnimal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Animal != nil { - l = m.Animal.Size() - n += 1 + l + sovProto(uint64(l)) - } - if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) - } - return n -} - -func (m *HasHasAnimal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.HasAnimal != nil { - l = m.HasAnimal.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *HasHasHasAnimal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.HasHasAnimal != nil { - l = m.HasHasAnimal.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *EchoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Message) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *EchoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Message) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *SayHelloRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *SayHelloResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Greeting) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestAnyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AnyAnimal != nil { - l = m.AnyAnimal.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestAnyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.HasAnimal != nil { - l = m.HasAnimal.Size() - n += 1 + l + sovProto(uint64(l)) - } - return n -} - -func (m *TestMsg) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Signers) > 0 { - for _, s := range m.Signers { - l = len(s) - n += 1 + l + sovProto(uint64(l)) - } - } - return n -} - -func (m *BadMultiSignature) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Signatures) > 0 { - for _, b := range m.Signatures { - l = len(b) - n += 1 + l + sovProto(uint64(l)) - } - } - l = len(m.MaliciousField) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - func (m *Customer1) Size() (n int) { if m == nil { return 0 @@ -6836,18 +5407,18 @@ func (m *Customer1) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } l = len(m.Name) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.SubscriptionFee != 0 { n += 5 } l = len(m.Payment) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -6859,27 +5430,27 @@ func (m *Customer2) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } if m.Industry != 0 { - n += 1 + sovProto(uint64(m.Industry)) + n += 1 + sovUnknonwnproto(uint64(m.Industry)) } l = len(m.Name) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Fewer != 0 { n += 5 } if m.City != 0 { - n += 1 + sovProto(uint64(m.City)) + n += 1 + sovUnknonwnproto(uint64(m.City)) } if m.Miscellaneous != nil { l = m.Miscellaneous.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Reserved != 0 { - n += 2 + sovProto(uint64(m.Reserved)) + n += 2 + sovUnknonwnproto(uint64(m.Reserved)) } return n } @@ -6891,11 +5462,11 @@ func (m *Nested4A) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } l = len(m.Name) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -6907,16 +5478,16 @@ func (m *Nested3A) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } l = len(m.Name) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.A4) > 0 { for _, e := range m.A4 { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if len(m.Index) > 0 { @@ -6926,10 +5497,10 @@ func (m *Nested3A) Size() (n int) { l = 0 if v != nil { l = v.Size() - l += 1 + sovProto(uint64(l)) + l += 1 + sovUnknonwnproto(uint64(l)) } - mapEntrySize := 1 + sovProto(uint64(k)) + l - n += mapEntrySize + 1 + sovProto(uint64(mapEntrySize)) + mapEntrySize := 1 + sovUnknonwnproto(uint64(k)) + l + n += mapEntrySize + 1 + sovUnknonwnproto(uint64(mapEntrySize)) } } return n @@ -6942,15 +5513,15 @@ func (m *Nested2A) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } l = len(m.Name) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Nested != nil { l = m.Nested.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -6962,11 +5533,11 @@ func (m *Nested1A) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } if m.Nested != nil { l = m.Nested.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -6978,14 +5549,14 @@ func (m *Nested4B) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } if m.Age != 0 { - n += 1 + sovProto(uint64(m.Age)) + n += 1 + sovUnknonwnproto(uint64(m.Age)) } l = len(m.Name) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -6997,19 +5568,19 @@ func (m *Nested3B) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } if m.Age != 0 { - n += 1 + sovProto(uint64(m.Age)) + n += 1 + sovUnknonwnproto(uint64(m.Age)) } l = len(m.Name) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.B4) > 0 { for _, e := range m.B4 { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } return n @@ -7022,18 +5593,18 @@ func (m *Nested2B) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } if m.Fee != 0 { n += 9 } if m.Nested != nil { l = m.Nested.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } l = len(m.Route) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7045,14 +5616,14 @@ func (m *Nested1B) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } if m.Nested != nil { l = m.Nested.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Age != 0 { - n += 1 + sovProto(uint64(m.Age)) + n += 1 + sovUnknonwnproto(uint64(m.Age)) } return n } @@ -7064,11 +5635,11 @@ func (m *Customer3) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } l = len(m.Name) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Sf != 0 { n += 5 @@ -7078,14 +5649,14 @@ func (m *Customer3) Size() (n int) { } l = len(m.Destination) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Payment != nil { n += m.Payment.Size() } if m.Original != nil { l = m.Original.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7097,7 +5668,7 @@ func (m *Customer3_CreditCardNo) Size() (n int) { var l int _ = l l = len(m.CreditCardNo) - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) return n } func (m *Customer3_ChequeNo) Size() (n int) { @@ -7107,7 +5678,7 @@ func (m *Customer3_ChequeNo) Size() (n int) { var l int _ = l l = len(m.ChequeNo) - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) return n } func (m *TestVersion1) Size() (n int) { @@ -7117,26 +5688,26 @@ func (m *TestVersion1) Size() (n int) { var l int _ = l if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) + n += 1 + sovUnknonwnproto(uint64(m.X)) } if m.A != nil { l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.B != nil { l = m.B.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.C) > 0 { for _, e := range m.C { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if len(m.D) > 0 { for _, e := range m.D { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if m.Sum != nil { @@ -7144,17 +5715,17 @@ func (m *TestVersion1) Size() (n int) { } if m.G != nil { l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.H) > 0 { for _, e := range m.H { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if m.Customer1 != nil { l = m.Customer1.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7165,7 +5736,7 @@ func (m *TestVersion1_E) Size() (n int) { } var l int _ = l - n += 1 + sovProto(uint64(m.E)) + n += 1 + sovUnknonwnproto(uint64(m.E)) return n } func (m *TestVersion1_F) Size() (n int) { @@ -7176,7 +5747,7 @@ func (m *TestVersion1_F) Size() (n int) { _ = l if m.F != nil { l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7187,26 +5758,26 @@ func (m *TestVersion2) Size() (n int) { var l int _ = l if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) + n += 1 + sovUnknonwnproto(uint64(m.X)) } if m.A != nil { l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.B != nil { l = m.B.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.C) > 0 { for _, e := range m.C { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if len(m.D) > 0 { for _, e := range m.D { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if m.Sum != nil { @@ -7214,20 +5785,20 @@ func (m *TestVersion2) Size() (n int) { } if m.G != nil { l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.H) > 0 { for _, e := range m.H { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if m.Customer1 != nil { l = m.Customer1.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.NewField != 0 { - n += 2 + sovProto(uint64(m.NewField)) + n += 2 + sovUnknonwnproto(uint64(m.NewField)) } return n } @@ -7238,7 +5809,7 @@ func (m *TestVersion2_E) Size() (n int) { } var l int _ = l - n += 1 + sovProto(uint64(m.E)) + n += 1 + sovUnknonwnproto(uint64(m.E)) return n } func (m *TestVersion2_F) Size() (n int) { @@ -7249,7 +5820,7 @@ func (m *TestVersion2_F) Size() (n int) { _ = l if m.F != nil { l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7260,26 +5831,26 @@ func (m *TestVersion3) Size() (n int) { var l int _ = l if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) + n += 1 + sovUnknonwnproto(uint64(m.X)) } if m.A != nil { l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.B != nil { l = m.B.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.C) > 0 { for _, e := range m.C { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if len(m.D) > 0 { for _, e := range m.D { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if m.Sum != nil { @@ -7287,21 +5858,21 @@ func (m *TestVersion3) Size() (n int) { } if m.G != nil { l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.H) > 0 { for _, e := range m.H { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if m.Customer1 != nil { l = m.Customer1.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } l = len(m.NonCriticalField) if l > 0 { - n += 2 + l + sovProto(uint64(l)) + n += 2 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7312,7 +5883,7 @@ func (m *TestVersion3_E) Size() (n int) { } var l int _ = l - n += 1 + sovProto(uint64(m.E)) + n += 1 + sovUnknonwnproto(uint64(m.E)) return n } func (m *TestVersion3_F) Size() (n int) { @@ -7323,7 +5894,7 @@ func (m *TestVersion3_F) Size() (n int) { _ = l if m.F != nil { l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7334,26 +5905,26 @@ func (m *TestVersion3LoneOneOfValue) Size() (n int) { var l int _ = l if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) + n += 1 + sovUnknonwnproto(uint64(m.X)) } if m.A != nil { l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.B != nil { l = m.B.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.C) > 0 { for _, e := range m.C { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if len(m.D) > 0 { for _, e := range m.D { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if m.Sum != nil { @@ -7361,21 +5932,21 @@ func (m *TestVersion3LoneOneOfValue) Size() (n int) { } if m.G != nil { l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.H) > 0 { for _, e := range m.H { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if m.Customer1 != nil { l = m.Customer1.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } l = len(m.NonCriticalField) if l > 0 { - n += 2 + l + sovProto(uint64(l)) + n += 2 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7386,7 +5957,7 @@ func (m *TestVersion3LoneOneOfValue_E) Size() (n int) { } var l int _ = l - n += 1 + sovProto(uint64(m.E)) + n += 1 + sovUnknonwnproto(uint64(m.E)) return n } func (m *TestVersion3LoneNesting) Size() (n int) { @@ -7396,26 +5967,26 @@ func (m *TestVersion3LoneNesting) Size() (n int) { var l int _ = l if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) + n += 1 + sovUnknonwnproto(uint64(m.X)) } if m.A != nil { l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.B != nil { l = m.B.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.C) > 0 { for _, e := range m.C { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if len(m.D) > 0 { for _, e := range m.D { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if m.Sum != nil { @@ -7423,29 +5994,29 @@ func (m *TestVersion3LoneNesting) Size() (n int) { } if m.G != nil { l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.H) > 0 { for _, e := range m.H { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if m.Customer1 != nil { l = m.Customer1.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Inner1 != nil { l = m.Inner1.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Inner2 != nil { l = m.Inner2.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } l = len(m.NonCriticalField) if l > 0 { - n += 2 + l + sovProto(uint64(l)) + n += 2 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7458,7 +6029,7 @@ func (m *TestVersion3LoneNesting_F) Size() (n int) { _ = l if m.F != nil { l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7469,15 +6040,15 @@ func (m *TestVersion3LoneNesting_Inner1) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } l = len(m.Name) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Inner != nil { l = m.Inner.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7490,11 +6061,11 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) Size() (n int) { _ = l l = len(m.Id) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } l = len(m.City) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7507,15 +6078,15 @@ func (m *TestVersion3LoneNesting_Inner2) Size() (n int) { _ = l l = len(m.Id) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } l = len(m.Country) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Inner != nil { l = m.Inner.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7528,11 +6099,11 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) Size() (n int) { _ = l l = len(m.Id) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } l = len(m.City) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7544,26 +6115,26 @@ func (m *TestVersion4LoneNesting) Size() (n int) { var l int _ = l if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) + n += 1 + sovUnknonwnproto(uint64(m.X)) } if m.A != nil { l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.B != nil { l = m.B.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.C) > 0 { for _, e := range m.C { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if len(m.D) > 0 { for _, e := range m.D { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if m.Sum != nil { @@ -7571,29 +6142,29 @@ func (m *TestVersion4LoneNesting) Size() (n int) { } if m.G != nil { l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.H) > 0 { for _, e := range m.H { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if m.Customer1 != nil { l = m.Customer1.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Inner1 != nil { l = m.Inner1.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Inner2 != nil { l = m.Inner2.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } l = len(m.NonCriticalField) if l > 0 { - n += 2 + l + sovProto(uint64(l)) + n += 2 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7606,7 +6177,7 @@ func (m *TestVersion4LoneNesting_F) Size() (n int) { _ = l if m.F != nil { l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7617,15 +6188,15 @@ func (m *TestVersion4LoneNesting_Inner1) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } l = len(m.Name) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Inner != nil { l = m.Inner.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7637,11 +6208,11 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } l = len(m.City) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7654,15 +6225,15 @@ func (m *TestVersion4LoneNesting_Inner2) Size() (n int) { _ = l l = len(m.Id) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } l = len(m.Country) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Inner != nil { l = m.Inner.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7675,10 +6246,10 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) Size() (n int) { _ = l l = len(m.Id) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Value != 0 { - n += 1 + sovProto(uint64(m.Value)) + n += 1 + sovUnknonwnproto(uint64(m.Value)) } return n } @@ -7690,23 +6261,23 @@ func (m *TestVersionFD1) Size() (n int) { var l int _ = l if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) + n += 1 + sovUnknonwnproto(uint64(m.X)) } if m.A != nil { l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Sum != nil { n += m.Sum.Size() } if m.G != nil { l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.H) > 0 { for _, e := range m.H { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } return n @@ -7718,7 +6289,7 @@ func (m *TestVersionFD1_E) Size() (n int) { } var l int _ = l - n += 1 + sovProto(uint64(m.E)) + n += 1 + sovUnknonwnproto(uint64(m.E)) return n } func (m *TestVersionFD1_F) Size() (n int) { @@ -7729,7 +6300,7 @@ func (m *TestVersionFD1_F) Size() (n int) { _ = l if m.F != nil { l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7740,23 +6311,23 @@ func (m *TestVersionFD1WithExtraAny) Size() (n int) { var l int _ = l if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) + n += 1 + sovUnknonwnproto(uint64(m.X)) } if m.A != nil { l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.Sum != nil { n += m.Sum.Size() } if m.G != nil { l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.H) > 0 { for _, e := range m.H { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } return n @@ -7768,7 +6339,7 @@ func (m *TestVersionFD1WithExtraAny_E) Size() (n int) { } var l int _ = l - n += 1 + sovProto(uint64(m.E)) + n += 1 + sovUnknonwnproto(uint64(m.E)) return n } func (m *TestVersionFD1WithExtraAny_F) Size() (n int) { @@ -7779,7 +6350,7 @@ func (m *TestVersionFD1WithExtraAny_F) Size() (n int) { _ = l if m.F != nil { l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7791,13 +6362,13 @@ func (m *AnyWithExtra) Size() (n int) { _ = l if m.Any != nil { l = m.Any.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.B != 0 { - n += 1 + sovProto(uint64(m.B)) + n += 1 + sovUnknonwnproto(uint64(m.B)) } if m.C != 0 { - n += 1 + sovProto(uint64(m.C)) + n += 1 + sovUnknonwnproto(uint64(m.C)) } return n } @@ -7810,25 +6381,25 @@ func (m *TestUpdatedTxRaw) Size() (n int) { _ = l l = len(m.BodyBytes) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } l = len(m.AuthInfoBytes) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.Signatures) > 0 { for _, b := range m.Signatures { l = len(b) - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } l = len(m.NewField_5) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } l = len(m.NewField_1024) if l > 0 { - n += 2 + l + sovProto(uint64(l)) + n += 2 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7842,33 +6413,33 @@ func (m *TestUpdatedTxBody) Size() (n int) { if len(m.Messages) > 0 { for _, e := range m.Messages { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } l = len(m.Memo) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if m.TimeoutHeight != 0 { - n += 1 + sovProto(uint64(m.TimeoutHeight)) + n += 1 + sovUnknonwnproto(uint64(m.TimeoutHeight)) } if m.SomeNewField != 0 { - n += 1 + sovProto(uint64(m.SomeNewField)) + n += 1 + sovUnknonwnproto(uint64(m.SomeNewField)) } if len(m.ExtensionOptions) > 0 { for _, e := range m.ExtensionOptions { l = e.Size() - n += 2 + l + sovProto(uint64(l)) + n += 2 + l + sovUnknonwnproto(uint64(l)) } } l = len(m.SomeNewFieldNonCriticalField) if l > 0 { - n += 2 + l + sovProto(uint64(l)) + n += 2 + l + sovUnknonwnproto(uint64(l)) } if len(m.NonCriticalExtensionOptions) > 0 { for _, e := range m.NonCriticalExtensionOptions { l = e.Size() - n += 2 + l + sovProto(uint64(l)) + n += 2 + l + sovUnknonwnproto(uint64(l)) } } return n @@ -7883,20 +6454,20 @@ func (m *TestUpdatedAuthInfo) Size() (n int) { if len(m.SignerInfos) > 0 { for _, e := range m.SignerInfos { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } if m.Fee != nil { l = m.Fee.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } l = len(m.NewField_3) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } l = len(m.NewField_1024) if l > 0 { - n += 2 + l + sovProto(uint64(l)) + n += 2 + l + sovUnknonwnproto(uint64(l)) } return n } @@ -7910,1248 +6481,18 @@ func (m *TestRepeatedUints) Size() (n int) { if len(m.Nums) > 0 { l = 0 for _, e := range m.Nums { - l += sovProto(uint64(e)) + l += sovUnknonwnproto(uint64(e)) } - n += 1 + sovProto(uint64(l)) + l + n += 1 + sovUnknonwnproto(uint64(l)) + l } return n } -func sovProto(x uint64) (n int) { +func sovUnknonwnproto(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } -func sozProto(x uint64) (n int) { - return sovProto(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Dog) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Dog: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Dog: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Size_ = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Cat) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Cat: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Cat: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Moniker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Lives", wireType) - } - m.Lives = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Lives |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HasAnimal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HasAnimal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Animal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Animal == nil { - m.Animal = &types.Any{} - } - if err := m.Animal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) - } - m.X = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.X |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HasHasAnimal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HasHasAnimal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HasHasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HasAnimal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.HasAnimal == nil { - m.HasAnimal = &types.Any{} - } - if err := m.HasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HasHasHasAnimal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HasHasHasAnimal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HasHasHasAnimal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HasHasAnimal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.HasHasAnimal == nil { - m.HasHasAnimal = &types.Any{} - } - if err := m.HasHasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EchoRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EchoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EchoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EchoResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EchoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EchoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SayHelloRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SayHelloRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SayHelloRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SayHelloResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SayHelloResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SayHelloResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Greeting", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Greeting = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestAnyRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestAnyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestAnyRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AnyAnimal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AnyAnimal == nil { - m.AnyAnimal = &types.Any{} - } - if err := m.AnyAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestAnyResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestAnyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestAnyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HasAnimal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.HasAnimal == nil { - m.HasAnimal = &HasAnimal{} - } - if err := m.HasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TestMsg) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TestMsg: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TestMsg: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signers", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signers = append(m.Signers, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BadMultiSignature) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BadMultiSignature: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BadMultiSignature: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signatures = append(m.Signatures, make([]byte, postIndex-iNdEx)) - copy(m.Signatures[len(m.Signatures)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaliciousField", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProto - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProto - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MaliciousField = append(m.MaliciousField[:0], dAtA[iNdEx:postIndex]...) - if m.MaliciousField == nil { - m.MaliciousField = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +func sozUnknonwnproto(x uint64) (n int) { + return sovUnknonwnproto(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *Customer1) Unmarshal(dAtA []byte) error { l := len(dAtA) @@ -9161,7 +6502,7 @@ func (m *Customer1) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9189,7 +6530,7 @@ func (m *Customer1) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9208,7 +6549,7 @@ func (m *Customer1) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9222,11 +6563,11 @@ func (m *Customer1) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9251,7 +6592,7 @@ func (m *Customer1) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9265,11 +6606,11 @@ func (m *Customer1) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9278,15 +6619,15 @@ func (m *Customer1) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -9308,7 +6649,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9336,7 +6677,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9355,7 +6696,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { m.Industry = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9374,7 +6715,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9388,11 +6729,11 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9417,7 +6758,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { m.City = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9436,7 +6777,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9449,11 +6790,11 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9472,7 +6813,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { m.Reserved = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9486,15 +6827,15 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -9516,7 +6857,7 @@ func (m *Nested4A) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9544,7 +6885,7 @@ func (m *Nested4A) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9563,7 +6904,7 @@ func (m *Nested4A) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9577,11 +6918,11 @@ func (m *Nested4A) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9590,15 +6931,15 @@ func (m *Nested4A) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -9620,7 +6961,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9648,7 +6989,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9667,7 +7008,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9681,11 +7022,11 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9699,7 +7040,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9712,11 +7053,11 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9733,7 +7074,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9746,11 +7087,11 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9765,7 +7106,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9781,7 +7122,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9797,7 +7138,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9810,11 +7151,11 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { } } if mapmsglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postmsgIndex > l { return io.ErrUnexpectedEOF @@ -9826,12 +7167,12 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { iNdEx = postmsgIndex } else { iNdEx = entryPreIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9843,15 +7184,15 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -9873,7 +7214,7 @@ func (m *Nested2A) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9901,7 +7242,7 @@ func (m *Nested2A) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9920,7 +7261,7 @@ func (m *Nested2A) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9934,11 +7275,11 @@ func (m *Nested2A) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9952,7 +7293,7 @@ func (m *Nested2A) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9965,11 +7306,11 @@ func (m *Nested2A) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9983,15 +7324,15 @@ func (m *Nested2A) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10013,7 +7354,7 @@ func (m *Nested1A) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10041,7 +7382,7 @@ func (m *Nested1A) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10060,7 +7401,7 @@ func (m *Nested1A) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10073,11 +7414,11 @@ func (m *Nested1A) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10091,15 +7432,15 @@ func (m *Nested1A) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10121,7 +7462,7 @@ func (m *Nested4B) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10149,7 +7490,7 @@ func (m *Nested4B) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10168,7 +7509,7 @@ func (m *Nested4B) Unmarshal(dAtA []byte) error { m.Age = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10187,7 +7528,7 @@ func (m *Nested4B) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10201,11 +7542,11 @@ func (m *Nested4B) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10214,15 +7555,15 @@ func (m *Nested4B) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10244,7 +7585,7 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10272,7 +7613,7 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10291,7 +7632,7 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { m.Age = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10310,7 +7651,7 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10324,11 +7665,11 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10342,7 +7683,7 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10355,11 +7696,11 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10371,15 +7712,15 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10401,7 +7742,7 @@ func (m *Nested2B) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10429,7 +7770,7 @@ func (m *Nested2B) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10459,7 +7800,7 @@ func (m *Nested2B) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10472,11 +7813,11 @@ func (m *Nested2B) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10495,7 +7836,7 @@ func (m *Nested2B) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10509,11 +7850,11 @@ func (m *Nested2B) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10522,15 +7863,15 @@ func (m *Nested2B) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10552,7 +7893,7 @@ func (m *Nested1B) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10580,7 +7921,7 @@ func (m *Nested1B) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10599,7 +7940,7 @@ func (m *Nested1B) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10612,11 +7953,11 @@ func (m *Nested1B) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10635,7 +7976,7 @@ func (m *Nested1B) Unmarshal(dAtA []byte) error { m.Age = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10649,15 +7990,15 @@ func (m *Nested1B) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10679,7 +8020,7 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10707,7 +8048,7 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10726,7 +8067,7 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10740,11 +8081,11 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10780,7 +8121,7 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10794,11 +8135,11 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10812,7 +8153,7 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10826,11 +8167,11 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10844,7 +8185,7 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10858,11 +8199,11 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10876,7 +8217,7 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10889,11 +8230,11 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10907,15 +8248,15 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10937,7 +8278,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10965,7 +8306,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10984,7 +8325,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10997,11 +8338,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11020,7 +8361,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11033,11 +8374,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11056,7 +8397,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11069,11 +8410,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11090,7 +8431,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11103,11 +8444,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11124,7 +8465,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11144,7 +8485,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11157,11 +8498,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11179,7 +8520,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11192,11 +8533,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11215,7 +8556,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11228,11 +8569,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11249,7 +8590,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11262,11 +8603,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11280,15 +8621,15 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -11310,7 +8651,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11338,7 +8679,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11357,7 +8698,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11370,11 +8711,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11393,7 +8734,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11406,11 +8747,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11429,7 +8770,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11442,11 +8783,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11463,7 +8804,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11476,11 +8817,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11497,7 +8838,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11517,7 +8858,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11530,11 +8871,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11552,7 +8893,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11565,11 +8906,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11588,7 +8929,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11601,11 +8942,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11622,7 +8963,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11635,11 +8976,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11658,7 +8999,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { m.NewField = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11672,15 +9013,15 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -11702,7 +9043,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11730,7 +9071,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11749,7 +9090,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11762,11 +9103,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11785,7 +9126,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11798,11 +9139,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11821,7 +9162,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11834,11 +9175,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11855,7 +9196,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11868,11 +9209,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11889,7 +9230,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11909,7 +9250,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11922,11 +9263,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11944,7 +9285,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11957,11 +9298,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11980,7 +9321,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11993,11 +9334,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12014,7 +9355,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12027,11 +9368,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12050,7 +9391,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12064,11 +9405,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12077,15 +9418,15 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -12107,7 +9448,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12135,7 +9476,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12154,7 +9495,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12167,11 +9508,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12190,7 +9531,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12203,11 +9544,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12226,7 +9567,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12239,11 +9580,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12260,7 +9601,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12273,11 +9614,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12294,7 +9635,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12314,7 +9655,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12327,11 +9668,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12350,7 +9691,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12363,11 +9704,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12384,7 +9725,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12397,11 +9738,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12420,7 +9761,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12434,11 +9775,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12447,15 +9788,15 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -12477,7 +9818,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12505,7 +9846,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12524,7 +9865,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12537,11 +9878,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12560,7 +9901,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12573,11 +9914,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12596,7 +9937,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12609,11 +9950,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12630,7 +9971,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12643,11 +9984,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12664,7 +10005,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12677,11 +10018,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12699,7 +10040,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12712,11 +10053,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12735,7 +10076,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12748,11 +10089,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12769,7 +10110,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12782,11 +10123,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12805,7 +10146,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12818,11 +10159,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12841,7 +10182,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12854,11 +10195,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12877,7 +10218,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12891,11 +10232,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12904,15 +10245,15 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -12934,7 +10275,7 @@ func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12962,7 +10303,7 @@ func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12981,7 +10322,7 @@ func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12995,11 +10336,11 @@ func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13013,7 +10354,7 @@ func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13026,11 +10367,11 @@ func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13044,15 +10385,15 @@ func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -13074,7 +10415,7 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13102,7 +10443,7 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13116,11 +10457,11 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13134,7 +10475,7 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13148,11 +10489,11 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13161,15 +10502,15 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -13191,7 +10532,7 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13219,7 +10560,7 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13233,11 +10574,11 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13251,7 +10592,7 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13265,11 +10606,11 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13283,7 +10624,7 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13296,11 +10637,11 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13314,15 +10655,15 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -13344,7 +10685,7 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13372,7 +10713,7 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13386,11 +10727,11 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13404,7 +10745,7 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13418,11 +10759,11 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13431,15 +10772,15 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -13461,7 +10802,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13489,7 +10830,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13508,7 +10849,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13521,11 +10862,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13544,7 +10885,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13557,11 +10898,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13580,7 +10921,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13593,11 +10934,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13614,7 +10955,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13627,11 +10968,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13648,7 +10989,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13661,11 +11002,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13683,7 +11024,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13696,11 +11037,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13719,7 +11060,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13732,11 +11073,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13753,7 +11094,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13766,11 +11107,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13789,7 +11130,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13802,11 +11143,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13825,7 +11166,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13838,11 +11179,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13861,7 +11202,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13875,11 +11216,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13888,15 +11229,15 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -13918,7 +11259,7 @@ func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13946,7 +11287,7 @@ func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13965,7 +11306,7 @@ func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13979,11 +11320,11 @@ func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13997,7 +11338,7 @@ func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14010,11 +11351,11 @@ func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14028,15 +11369,15 @@ func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14058,7 +11399,7 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14086,7 +11427,7 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14105,7 +11446,7 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14119,11 +11460,11 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14132,15 +11473,15 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14162,7 +11503,7 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14190,7 +11531,7 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14204,11 +11545,11 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14222,7 +11563,7 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14236,11 +11577,11 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14254,7 +11595,7 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14267,11 +11608,11 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14285,15 +11626,15 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14315,7 +11656,7 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14343,7 +11684,7 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14357,11 +11698,11 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14375,7 +11716,7 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14389,15 +11730,15 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error } default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14419,7 +11760,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14447,7 +11788,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14466,7 +11807,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14479,11 +11820,11 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14502,7 +11843,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14522,7 +11863,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14535,11 +11876,11 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14557,7 +11898,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14570,11 +11911,11 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14593,7 +11934,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14606,11 +11947,11 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14622,15 +11963,15 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14652,7 +11993,7 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14680,7 +12021,7 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14699,7 +12040,7 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14712,11 +12053,11 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14735,7 +12076,7 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14755,7 +12096,7 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14768,11 +12109,11 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14790,7 +12131,7 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14803,11 +12144,11 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14826,7 +12167,7 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14839,11 +12180,11 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14855,15 +12196,15 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14885,7 +12226,7 @@ func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14913,7 +12254,7 @@ func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14926,11 +12267,11 @@ func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14949,7 +12290,7 @@ func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { m.B = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14968,7 +12309,7 @@ func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { m.C = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14982,15 +12323,15 @@ func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -15012,7 +12353,7 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15040,7 +12381,7 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15053,11 +12394,11 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15074,7 +12415,7 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15087,11 +12428,11 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15108,7 +12449,7 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15121,11 +12462,11 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15140,7 +12481,7 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15153,11 +12494,11 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15174,7 +12515,7 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15187,11 +12528,11 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15203,15 +12544,15 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -15233,7 +12574,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15261,7 +12602,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15274,11 +12615,11 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15295,7 +12636,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15309,11 +12650,11 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15327,7 +12668,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { m.TimeoutHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15346,7 +12687,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { m.SomeNewField = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15365,7 +12706,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15378,11 +12719,11 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15399,7 +12740,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15413,11 +12754,11 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15431,7 +12772,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15444,11 +12785,11 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15460,15 +12801,15 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -15490,7 +12831,7 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15518,7 +12859,7 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15531,11 +12872,11 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15552,7 +12893,7 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15565,11 +12906,11 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15588,7 +12929,7 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15601,11 +12942,11 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15622,7 +12963,7 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15635,11 +12976,11 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15651,15 +12992,15 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -15681,7 +13022,7 @@ func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15707,7 +13048,7 @@ func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15724,7 +13065,7 @@ func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15737,11 +13078,11 @@ func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15761,7 +13102,7 @@ func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15780,15 +13121,15 @@ func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -15802,7 +13143,7 @@ func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { } return nil } -func skipProto(dAtA []byte) (n int, err error) { +func skipUnknonwnproto(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 @@ -15810,7 +13151,7 @@ func skipProto(dAtA []byte) (n int, err error) { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowProto + return 0, ErrIntOverflowUnknonwnproto } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -15827,7 +13168,7 @@ func skipProto(dAtA []byte) (n int, err error) { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowProto + return 0, ErrIntOverflowUnknonwnproto } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -15843,7 +13184,7 @@ func skipProto(dAtA []byte) (n int, err error) { var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowProto + return 0, ErrIntOverflowUnknonwnproto } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -15856,14 +13197,14 @@ func skipProto(dAtA []byte) (n int, err error) { } } if length < 0 { - return 0, ErrInvalidLengthProto + return 0, ErrInvalidLengthUnknonwnproto } iNdEx += length case 3: depth++ case 4: if depth == 0 { - return 0, ErrUnexpectedEndOfGroupProto + return 0, ErrUnexpectedEndOfGroupUnknonwnproto } depth-- case 5: @@ -15872,7 +13213,7 @@ func skipProto(dAtA []byte) (n int, err error) { return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { - return 0, ErrInvalidLengthProto + return 0, ErrInvalidLengthUnknonwnproto } if depth == 0 { return iNdEx, nil @@ -15882,7 +13223,7 @@ func skipProto(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthProto = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProto = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupProto = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthUnknonwnproto = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowUnknonwnproto = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupUnknonwnproto = fmt.Errorf("proto: unexpected end of group") ) diff --git a/testutil/testdata/proto.proto b/testutil/testdata/unknonwnproto.proto similarity index 87% rename from testutil/testdata/proto.proto rename to testutil/testdata/unknonwnproto.proto index 154bd92be8..a11773f92e 100644 --- a/testutil/testdata/proto.proto +++ b/testutil/testdata/unknonwnproto.proto @@ -7,72 +7,6 @@ import "cosmos/tx/v1beta1/tx.proto"; option go_package = "github.com/cosmos/cosmos-sdk/testutil/testdata"; -message Dog { - string size = 1; - string name = 2; -} - -message Cat { - string moniker = 1; - int32 lives = 2; -} - -message HasAnimal { - google.protobuf.Any animal = 1; - int64 x = 2; -} - -message HasHasAnimal { - google.protobuf.Any has_animal = 1; -} - -message HasHasHasAnimal { - google.protobuf.Any has_has_animal = 1; -} - -service TestService { - rpc Echo(EchoRequest) returns (EchoResponse); - rpc SayHello(SayHelloRequest) returns (SayHelloResponse); - rpc TestAny(TestAnyRequest) returns (TestAnyResponse); -} - -message EchoRequest { - string message = 1; -} - -message EchoResponse { - string message = 1; -} - -message SayHelloRequest { - string name = 1; -} - -message SayHelloResponse { - string greeting = 1; -} - -message TestAnyRequest { - google.protobuf.Any any_animal = 1; -} - -message TestAnyResponse { - HasAnimal has_animal = 1; -} - -// msg type for testing -message TestMsg { - option (gogoproto.goproto_getters) = false; - repeated string signers = 1; -} - -// bad MultiSignature with extra fields -message BadMultiSignature { - option (gogoproto.goproto_unrecognized) = true; - repeated bytes signatures = 1; - bytes malicious_field = 5; -} - message Customer1 { int32 id = 1; string name = 2; diff --git a/types/codec.go b/types/codec.go index 5d1bf40e4c..152bb9d724 100644 --- a/types/codec.go +++ b/types/codec.go @@ -14,4 +14,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { // RegisterInterfaces registers the sdk message type. func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterInterface("cosmos.base.v1beta1.Msg", (*Msg)(nil)) + // the interface name for MsgRequest is ServiceMsg because this is most useful for clients + // to understand - it will be the way for clients to introspect on available Msg service methods + registry.RegisterInterface("cosmos.base.v1beta1.ServiceMsg", (*MsgRequest)(nil)) } diff --git a/types/service_msg.go b/types/service_msg.go new file mode 100644 index 0000000000..61c0f15ab1 --- /dev/null +++ b/types/service_msg.go @@ -0,0 +1,58 @@ +package types + +import ( + "github.com/gogo/protobuf/proto" +) + +// MsgRequest is the interface a transaction message, defined as a proto +// service method, must fulfill. +type MsgRequest interface { + proto.Message + // ValidateBasic does a simple validation check that + // doesn't require access to any other information. + ValidateBasic() error + // Signers returns the addrs of signers that must sign. + // CONTRACT: All signatures must be present to be valid. + // CONTRACT: Returns addrs in some deterministic order. + GetSigners() []AccAddress +} + +// ServiceMsg is the struct into which an Any whose typeUrl matches a service +// method format (ex. `/cosmos.gov.Msg/SubmitProposal`) unpacks. +type ServiceMsg struct { + // MethodName is the fully-qualified service method name. + MethodName string + // Request is the request payload. + Request MsgRequest +} + +var _ Msg = ServiceMsg{} + +func (msg ServiceMsg) ProtoMessage() {} +func (msg ServiceMsg) Reset() {} +func (msg ServiceMsg) String() string { return "ServiceMsg" } + +// Route implements Msg.Route method. +func (msg ServiceMsg) Route() string { + return msg.MethodName +} + +// ValidateBasic implements Msg.ValidateBasic method. +func (msg ServiceMsg) ValidateBasic() error { + return msg.Request.ValidateBasic() +} + +// GetSignBytes implements Msg.GetSignBytes method. +func (msg ServiceMsg) GetSignBytes() []byte { + panic("ServiceMsg does not have a GetSignBytes method") +} + +// GetSigners implements Msg.GetSigners method. +func (msg ServiceMsg) GetSigners() []AccAddress { + return msg.Request.GetSigners() +} + +// Type implements Msg.Type method. +func (msg ServiceMsg) Type() string { + return msg.MethodName +} diff --git a/types/tx/tx.pb.go b/types/tx/tx.pb.go index 996ed527cb..aef71a802f 100644 --- a/types/tx/tx.pb.go +++ b/types/tx/tx.pb.go @@ -5,6 +5,10 @@ package tx import ( fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + types "github.com/cosmos/cosmos-sdk/codec/types" types1 "github.com/cosmos/cosmos-sdk/crypto/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -12,9 +16,6 @@ import ( signing "github.com/cosmos/cosmos-sdk/types/tx/signing" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/types/tx/types.go b/types/tx/types.go index b5463c1bcc..e9066ef41b 100644 --- a/types/tx/types.go +++ b/types/tx/types.go @@ -1,7 +1,8 @@ package tx import ( - fmt "fmt" + "fmt" + "strings" "github.com/tendermint/tendermint/crypto" @@ -26,7 +27,15 @@ func (t *Tx) GetMsgs() []sdk.Msg { anys := t.Body.Messages res := make([]sdk.Msg, len(anys)) for i, any := range anys { - msg := any.GetCachedValue().(sdk.Msg) + var msg sdk.Msg + if isServiceMsg(any.TypeUrl) { + msg = sdk.ServiceMsg{ + MethodName: any.TypeUrl, + Request: any.GetCachedValue().(sdk.MsgRequest), + } + } else { + msg = any.GetCachedValue().(sdk.Msg) + } res[i] = msg } return res @@ -138,12 +147,23 @@ func (t *Tx) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { // UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method func (m *TxBody) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { for _, any := range m.Messages { - var msg sdk.Msg - err := unpacker.UnpackAny(any, &msg) - if err != nil { - return err + // If the any's typeUrl contains 2 slashes, then we unpack the any into + // a ServiceMsg struct as per ADR-031. + if isServiceMsg(any.TypeUrl) { + var req sdk.MsgRequest + err := unpacker.UnpackAny(any, &req) + if err != nil { + return err + } + } else { + var msg sdk.Msg + err := unpacker.UnpackAny(any, &msg) + if err != nil { + return err + } } } + return nil } @@ -168,3 +188,9 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterInterface("cosmos.tx.v1beta1.Tx", (*sdk.Tx)(nil)) registry.RegisterImplementations((*sdk.Tx)(nil), &Tx{}) } + +// isServiceMsg checks if a type URL corresponds to a service method name, +// i.e. /cosmos.bank.Msg/Send vs /cosmos.bank.MsgSend +func isServiceMsg(typeURL string) bool { + return strings.Count(typeURL, "/") >= 2 +} diff --git a/x/auth/ante/testutil_test.go b/x/auth/ante/testutil_test.go index 5ab35b7f19..a6755d0c35 100644 --- a/x/auth/ante/testutil_test.go +++ b/x/auth/ante/testutil_test.go @@ -54,8 +54,9 @@ func (suite *AnteTestSuite) SetupTest(isCheckTx bool) { // Set up TxConfig. encodingConfig := simapp.MakeEncodingConfig() - // We're using TestMsg amino encoding in some tests, so register it here. + // We're using TestMsg encoding in some tests, so register it here. encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) + testdata.RegisterInterfaces(encodingConfig.InterfaceRegistry) suite.clientCtx = client.Context{}. WithTxConfig(encodingConfig.TxConfig) diff --git a/x/auth/client/tx_test.go b/x/auth/client/tx_test.go index 66371fdc29..7ab1597bc8 100644 --- a/x/auth/client/tx_test.go +++ b/x/auth/client/tx_test.go @@ -31,7 +31,7 @@ func TestParseQueryResponse(t *testing.T) { Result: &sdk.Result{Data: []byte("tx data"), Log: "log"}, } - bz, err := codec.ProtoMarshalJSON(simRes) + bz, err := codec.ProtoMarshalJSON(simRes, nil) require.NoError(t, err) res, err := authclient.ParseQueryResponse(bz) diff --git a/x/auth/tx/builder.go b/x/auth/tx/builder.go index 42645f375b..b3697e70b2 100644 --- a/x/auth/tx/builder.go +++ b/x/auth/tx/builder.go @@ -205,10 +205,27 @@ func (w *wrapper) SetMsgs(msgs ...sdk.Msg) error { for i, msg := range msgs { var err error - anys[i], err = codectypes.NewAnyWithValue(msg) - if err != nil { - return err + switch msg := msg.(type) { + case sdk.ServiceMsg: + { + bz, err := proto.Marshal(msg.Request) + if err != nil { + return err + } + anys[i] = &codectypes.Any{ + TypeUrl: msg.MethodName, + Value: bz, + } + } + default: + { + anys[i], err = codectypes.NewAnyWithValue(msg) + if err != nil { + return err + } + } } + } w.tx.Body.Messages = anys diff --git a/x/auth/tx/config.go b/x/auth/tx/config.go index 5b6fc5abf6..b7ca179a84 100644 --- a/x/auth/tx/config.go +++ b/x/auth/tx/config.go @@ -29,7 +29,7 @@ func NewTxConfig(protoCodec *codec.ProtoCodec, enabledSignModes []signingtypes.S decoder: DefaultTxDecoder(protoCodec), encoder: DefaultTxEncoder(), jsonDecoder: DefaultJSONTxDecoder(protoCodec), - jsonEncoder: DefaultJSONTxEncoder(), + jsonEncoder: DefaultJSONTxEncoder(protoCodec), protoCodec: protoCodec, } } diff --git a/x/auth/tx/decoder.go b/x/auth/tx/decoder.go index 76129a3a1f..59ba8467eb 100644 --- a/x/auth/tx/decoder.go +++ b/x/auth/tx/decoder.go @@ -14,7 +14,7 @@ func DefaultTxDecoder(cdc *codec.ProtoCodec) sdk.TxDecoder { var raw tx.TxRaw // reject all unknown proto fields in the root TxRaw - err := unknownproto.RejectUnknownFieldsStrict(txBytes, &raw) + err := unknownproto.RejectUnknownFieldsStrict(txBytes, &raw, cdc.InterfaceRegistry()) if err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrTxDecode, err.Error()) } @@ -27,7 +27,7 @@ func DefaultTxDecoder(cdc *codec.ProtoCodec) sdk.TxDecoder { var body tx.TxBody // allow non-critical unknown fields in TxBody - txBodyHasUnknownNonCriticals, err := unknownproto.RejectUnknownFields(raw.BodyBytes, &body, true) + txBodyHasUnknownNonCriticals, err := unknownproto.RejectUnknownFields(raw.BodyBytes, &body, true, cdc.InterfaceRegistry()) if err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrTxDecode, err.Error()) } @@ -40,7 +40,7 @@ func DefaultTxDecoder(cdc *codec.ProtoCodec) sdk.TxDecoder { var authInfo tx.AuthInfo // reject all unknown proto fields in AuthInfo - err = unknownproto.RejectUnknownFieldsStrict(raw.AuthInfoBytes, &authInfo) + err = unknownproto.RejectUnknownFieldsStrict(raw.AuthInfoBytes, &authInfo, cdc.InterfaceRegistry()) if err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrTxDecode, err.Error()) } diff --git a/x/auth/tx/encode_decode_test.go b/x/auth/tx/encode_decode_test.go index a509704ef4..55fff38c36 100644 --- a/x/auth/tx/encode_decode_test.go +++ b/x/auth/tx/encode_decode_test.go @@ -15,7 +15,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" - sdk "github.com/cosmos/cosmos-sdk/types" ) func TestDefaultTxDecoderError(t *testing.T) { @@ -32,9 +31,9 @@ func TestDefaultTxDecoderError(t *testing.T) { require.NoError(t, err) _, err = decoder(txBz) - require.EqualError(t, err, "no registered implementations of type types.Msg: tx parse error") + require.EqualError(t, err, "unable to resolve type URL /testdata.TestMsg: tx parse error") - registry.RegisterImplementations((*sdk.Msg)(nil), &testdata.TestMsg{}) + testdata.RegisterInterfaces(registry) _, err = decoder(txBz) require.NoError(t, err) } diff --git a/x/auth/tx/encoder.go b/x/auth/tx/encoder.go index f8889cb62f..5655df7686 100644 --- a/x/auth/tx/encoder.go +++ b/x/auth/tx/encoder.go @@ -29,16 +29,16 @@ func DefaultTxEncoder() sdk.TxEncoder { } // DefaultJSONTxEncoder returns a default protobuf JSON TxEncoder using the provided Marshaler. -func DefaultJSONTxEncoder() sdk.TxEncoder { +func DefaultJSONTxEncoder(cdc *codec.ProtoCodec) sdk.TxEncoder { return func(tx sdk.Tx) ([]byte, error) { txWrapper, ok := tx.(*wrapper) if ok { - return codec.ProtoMarshalJSON(txWrapper.tx) + return cdc.MarshalJSON(txWrapper.tx) } protoTx, ok := tx.(*txtypes.Tx) if ok { - return codec.ProtoMarshalJSON(protoTx) + return cdc.MarshalJSON(protoTx) } return nil, fmt.Errorf("expected %T, got %T", &wrapper{}, tx) diff --git a/x/auth/tx/sigs.go b/x/auth/tx/sigs.go index 0f58ace4ff..d0e43ede75 100644 --- a/x/auth/tx/sigs.go +++ b/x/auth/tx/sigs.go @@ -125,7 +125,7 @@ func (g config) MarshalSignatureJSON(sigs []signing.SignatureV2) ([]byte, error) toJSON := &signing.SignatureDescriptors{Signatures: descs} - return codec.ProtoMarshalJSON(toJSON) + return codec.ProtoMarshalJSON(toJSON, nil) } func (g config) UnmarshalSignatureJSON(bz []byte) ([]signing.SignatureV2, error) { diff --git a/x/auth/types/codec.go b/x/auth/types/codec.go index beb14eab7a..629e2919d2 100644 --- a/x/auth/types/codec.go +++ b/x/auth/types/codec.go @@ -30,7 +30,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { ) registry.RegisterInterface( - "cosmos.auth.GenesisAccount", + "cosmos.auth.v1beta1.GenesisAccount", (*GenesisAccount)(nil), &BaseAccount{}, &ModuleAccount{}, diff --git a/x/auth/vesting/types/codec.go b/x/auth/vesting/types/codec.go index 8abf56cd6b..f5652ea017 100644 --- a/x/auth/vesting/types/codec.go +++ b/x/auth/vesting/types/codec.go @@ -31,6 +31,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations( (*authtypes.AccountI)(nil), + &BaseVestingAccount{}, &DelayedVestingAccount{}, &ContinuousVestingAccount{}, &PeriodicVestingAccount{}, @@ -38,6 +39,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations( (*authtypes.GenesisAccount)(nil), + &BaseVestingAccount{}, &DelayedVestingAccount{}, &ContinuousVestingAccount{}, &PeriodicVestingAccount{}, diff --git a/x/bank/types/tx.pb.go b/x/bank/types/tx.pb.go index abc37dcf0a..a9e70007c3 100644 --- a/x/bank/types/tx.pb.go +++ b/x/bank/types/tx.pb.go @@ -70,6 +70,7 @@ func (m *MsgSend) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSend proto.InternalMessageInfo +// MsgSendResponse defines the Msg/Send response type. type MsgSendResponse struct { } @@ -159,6 +160,7 @@ func (m *MsgMultiSend) GetOutputs() []Output { return nil } +// MsgMultiSendResponse defines the Msg/MultiSend response type. type MsgMultiSendResponse struct { } @@ -248,7 +250,9 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { + // Send defines a method for sending coins from one account to another account. Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) + // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) } @@ -280,7 +284,9 @@ func (c *msgClient) MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grp // MsgServer is the server API for Msg service. type MsgServer interface { + // Send defines a method for sending coins from one account to another account. Send(context.Context, *MsgSend) (*MsgSendResponse, error) + // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(context.Context, *MsgMultiSend) (*MsgMultiSendResponse, error) } From 1279da53ea62c4676bdcd1eeab32858644cf2cdb Mon Sep 17 00:00:00 2001 From: Marie Gauthier Date: Thu, 15 Oct 2020 15:35:28 +0200 Subject: [PATCH 30/84] Add back option go_package to third_party confio proofs.proto (#7565) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- third_party/proto/confio/proofs.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/third_party/proto/confio/proofs.proto b/third_party/proto/confio/proofs.proto index 9dd39e614d..da43503ecb 100644 --- a/third_party/proto/confio/proofs.proto +++ b/third_party/proto/confio/proofs.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package ics23; +option go_package = "github.com/confio/ics23/go"; enum HashOp { // NO_HASH is the default if no data passed. Note this is an illegal argument some places. From bf7165414da38896444b8a221de921d3c870238f Mon Sep 17 00:00:00 2001 From: atheeshp <59333759+atheeshp@users.noreply.github.com> Date: Thu, 15 Oct 2020 19:24:16 +0530 Subject: [PATCH 31/84] Refactor x/distribution according to ADR 031 (#7524) * Refactor x/distribution according to ADR 31 * lint * removed unused * Apply suggestions from code review Co-authored-by: Marie Gauthier Co-authored-by: Aaron Craelius Co-authored-by: Marie Gauthier Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- proto/cosmos/distribution/v1beta1/tx.proto | 33 +- x/distribution/handler.go | 130 +--- x/distribution/keeper/msg_server.go | 140 ++++ x/distribution/types/tx.pb.go | 859 ++++++++++++++++++++- 4 files changed, 1009 insertions(+), 153 deletions(-) create mode 100644 x/distribution/keeper/msg_server.go diff --git a/proto/cosmos/distribution/v1beta1/tx.proto b/proto/cosmos/distribution/v1beta1/tx.proto index 97427c49bd..783f06d1d7 100644 --- a/proto/cosmos/distribution/v1beta1/tx.proto +++ b/proto/cosmos/distribution/v1beta1/tx.proto @@ -7,6 +7,25 @@ option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +// Msg defines the distribution Msg service. +service Msg { + // SetWithdrawAddress defines a method to change the withdraw address + // for a delegator (or validator self-delegation). + rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse); + + // WithdrawDelegatorReward defines a method to withdraw rewards of delegator + // from a single validator. + rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) returns (MsgWithdrawDelegatorRewardResponse); + + // WithdrawValidatorCommission defines a method to withdraw the + // full commission to the validator address. + rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse); + + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); +} + // MsgSetWithdrawAddress sets the withdraw address for // a delegator (or validator self-delegation). message MsgSetWithdrawAddress { @@ -17,6 +36,9 @@ message MsgSetWithdrawAddress { string withdraw_address = 2 [(gogoproto.moretags) = "yaml:\"withdraw_address\""]; } +// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. +message MsgSetWithdrawAddressResponse { } + // MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator // from a single validator. message MsgWithdrawDelegatorReward { @@ -27,6 +49,9 @@ message MsgWithdrawDelegatorReward { string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; } +// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. +message MsgWithdrawDelegatorRewardResponse { } + // MsgWithdrawValidatorCommission withdraws the full commission to the validator // address. message MsgWithdrawValidatorCommission { @@ -36,6 +61,9 @@ message MsgWithdrawValidatorCommission { string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; } +// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. +message MsgWithdrawValidatorCommissionResponse { } + // MsgFundCommunityPool allows an account to directly // fund the community pool. message MsgFundCommunityPool { @@ -45,4 +73,7 @@ message MsgFundCommunityPool { repeated cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; string depositor = 2; -} \ No newline at end of file +} + +// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +message MsgFundCommunityPoolResponse { } diff --git a/x/distribution/handler.go b/x/distribution/handler.go index 36274544b2..e89b9fbf8c 100644 --- a/x/distribution/handler.go +++ b/x/distribution/handler.go @@ -1,9 +1,6 @@ package distribution import ( - metrics "github.com/armon/go-metrics" - - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/distribution/keeper" @@ -15,18 +12,24 @@ func NewHandler(k keeper.Keeper) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) + msgServer := keeper.NewMsgServerImpl(k) + switch msg := msg.(type) { case *types.MsgSetWithdrawAddress: - return handleMsgModifyWithdrawAddress(ctx, msg, k) + res, err := msgServer.SetWithdrawAddress(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgWithdrawDelegatorReward: - return handleMsgWithdrawDelegatorReward(ctx, msg, k) + res, err := msgServer.WithdrawDelegatorReward(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgWithdrawValidatorCommission: - return handleMsgWithdrawValidatorCommission(ctx, msg, k) + res, err := msgServer.WithdrawValidatorCommission(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgFundCommunityPool: - return handleMsgFundCommunityPool(ctx, msg, k) + res, err := msgServer.FundCommunityPool(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized distribution message type: %T", msg) @@ -34,119 +37,6 @@ func NewHandler(k keeper.Keeper) sdk.Handler { } } -// These functions assume everything has been authenticated (ValidateBasic passed, and signatures checked) - -func handleMsgModifyWithdrawAddress(ctx sdk.Context, msg *types.MsgSetWithdrawAddress, k keeper.Keeper) (*sdk.Result, error) { - delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) - if err != nil { - return nil, err - } - withdrawAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) - if err != nil { - return nil, err - } - err = k.SetWithdrawAddr(ctx, delegatorAddress, withdrawAddress) - if err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgWithdrawDelegatorReward(ctx sdk.Context, msg *types.MsgWithdrawDelegatorReward, k keeper.Keeper) (*sdk.Result, error) { - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) - if err != nil { - return nil, err - } - delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) - if err != nil { - return nil, err - } - amount, err := k.WithdrawDelegationRewards(ctx, delegatorAddress, valAddr) - if err != nil { - return nil, err - } - - defer func() { - for _, a := range amount { - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", "withdraw_reward"}, - float32(a.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, - ) - } - }() - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgWithdrawValidatorCommission(ctx sdk.Context, msg *types.MsgWithdrawValidatorCommission, k keeper.Keeper) (*sdk.Result, error) { - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) - if err != nil { - return nil, err - } - amount, err := k.WithdrawValidatorCommission(ctx, valAddr) - if err != nil { - return nil, err - } - - defer func() { - for _, a := range amount { - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", "withdraw_commission"}, - float32(a.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, - ) - } - }() - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.ValidatorAddress), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgFundCommunityPool(ctx sdk.Context, msg *types.MsgFundCommunityPool, k keeper.Keeper) (*sdk.Result, error) { - depositer, err := sdk.AccAddressFromBech32(msg.Depositor) - if err != nil { - return nil, err - } - if err := k.FundCommunityPool(ctx, msg.Amount, depositer); err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Depositor), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - func NewCommunityPoolSpendProposalHandler(k keeper.Keeper) govtypes.Handler { return func(ctx sdk.Context, content govtypes.Content) error { switch c := content.(type) { diff --git a/x/distribution/keeper/msg_server.go b/x/distribution/keeper/msg_server.go new file mode 100644 index 0000000000..9aa24529d8 --- /dev/null +++ b/x/distribution/keeper/msg_server.go @@ -0,0 +1,140 @@ +package keeper + +import ( + "context" + + "github.com/armon/go-metrics" + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/distribution/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the bank MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +func (k msgServer) SetWithdrawAddress(goCtx context.Context, msg *types.MsgSetWithdrawAddress) (*types.MsgSetWithdrawAddressResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + withdrawAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + err = k.SetWithdrawAddr(ctx, delegatorAddress, withdrawAddress) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), + ), + ) + + return &types.MsgSetWithdrawAddressResponse{}, nil +} + +func (k msgServer) WithdrawDelegatorReward(goCtx context.Context, msg *types.MsgWithdrawDelegatorReward) (*types.MsgWithdrawDelegatorRewardResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if err != nil { + return nil, err + } + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + amount, err := k.WithdrawDelegationRewards(ctx, delegatorAddress, valAddr) + if err != nil { + return nil, err + } + + defer func() { + for _, a := range amount { + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", "withdraw_reward"}, + float32(a.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, + ) + } + }() + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), + ), + ) + return &types.MsgWithdrawDelegatorRewardResponse{}, nil +} + +func (k msgServer) WithdrawValidatorCommission(goCtx context.Context, msg *types.MsgWithdrawValidatorCommission) (*types.MsgWithdrawValidatorCommissionResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if err != nil { + return nil, err + } + amount, err := k.Keeper.WithdrawValidatorCommission(ctx, valAddr) + if err != nil { + return nil, err + } + + defer func() { + for _, a := range amount { + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", "withdraw_commission"}, + float32(a.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, + ) + } + }() + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.ValidatorAddress), + ), + ) + + return &types.MsgWithdrawValidatorCommissionResponse{}, nil +} + +func (k msgServer) FundCommunityPool(goCtx context.Context, msg *types.MsgFundCommunityPool) (*types.MsgFundCommunityPoolResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + depositer, err := sdk.AccAddressFromBech32(msg.Depositor) + if err != nil { + return nil, err + } + if err := k.Keeper.FundCommunityPool(ctx, msg.Amount, depositer); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Depositor), + ), + ) + + return &types.MsgFundCommunityPoolResponse{}, nil +} diff --git a/x/distribution/types/tx.pb.go b/x/distribution/types/tx.pb.go index 38261f340a..5d7d761de9 100644 --- a/x/distribution/types/tx.pb.go +++ b/x/distribution/types/tx.pb.go @@ -4,11 +4,16 @@ package types import ( + context "context" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + grpc1 "github.com/gogo/protobuf/grpc" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -65,6 +70,43 @@ func (m *MsgSetWithdrawAddress) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetWithdrawAddress proto.InternalMessageInfo +// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. +type MsgSetWithdrawAddressResponse struct { +} + +func (m *MsgSetWithdrawAddressResponse) Reset() { *m = MsgSetWithdrawAddressResponse{} } +func (m *MsgSetWithdrawAddressResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetWithdrawAddressResponse) ProtoMessage() {} +func (*MsgSetWithdrawAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{1} +} +func (m *MsgSetWithdrawAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetWithdrawAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetWithdrawAddressResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetWithdrawAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetWithdrawAddressResponse.Merge(m, src) +} +func (m *MsgSetWithdrawAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetWithdrawAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetWithdrawAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetWithdrawAddressResponse proto.InternalMessageInfo + // MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator // from a single validator. type MsgWithdrawDelegatorReward struct { @@ -76,7 +118,7 @@ func (m *MsgWithdrawDelegatorReward) Reset() { *m = MsgWithdrawDelegator func (m *MsgWithdrawDelegatorReward) String() string { return proto.CompactTextString(m) } func (*MsgWithdrawDelegatorReward) ProtoMessage() {} func (*MsgWithdrawDelegatorReward) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{1} + return fileDescriptor_ed4f433d965e58ca, []int{2} } func (m *MsgWithdrawDelegatorReward) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -105,6 +147,43 @@ func (m *MsgWithdrawDelegatorReward) XXX_DiscardUnknown() { var xxx_messageInfo_MsgWithdrawDelegatorReward proto.InternalMessageInfo +// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. +type MsgWithdrawDelegatorRewardResponse struct { +} + +func (m *MsgWithdrawDelegatorRewardResponse) Reset() { *m = MsgWithdrawDelegatorRewardResponse{} } +func (m *MsgWithdrawDelegatorRewardResponse) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawDelegatorRewardResponse) ProtoMessage() {} +func (*MsgWithdrawDelegatorRewardResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{3} +} +func (m *MsgWithdrawDelegatorRewardResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawDelegatorRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawDelegatorRewardResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgWithdrawDelegatorRewardResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawDelegatorRewardResponse.Merge(m, src) +} +func (m *MsgWithdrawDelegatorRewardResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawDelegatorRewardResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawDelegatorRewardResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawDelegatorRewardResponse proto.InternalMessageInfo + // MsgWithdrawValidatorCommission withdraws the full commission to the validator // address. type MsgWithdrawValidatorCommission struct { @@ -115,7 +194,7 @@ func (m *MsgWithdrawValidatorCommission) Reset() { *m = MsgWithdrawValid func (m *MsgWithdrawValidatorCommission) String() string { return proto.CompactTextString(m) } func (*MsgWithdrawValidatorCommission) ProtoMessage() {} func (*MsgWithdrawValidatorCommission) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{2} + return fileDescriptor_ed4f433d965e58ca, []int{4} } func (m *MsgWithdrawValidatorCommission) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -144,6 +223,45 @@ func (m *MsgWithdrawValidatorCommission) XXX_DiscardUnknown() { var xxx_messageInfo_MsgWithdrawValidatorCommission proto.InternalMessageInfo +// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. +type MsgWithdrawValidatorCommissionResponse struct { +} + +func (m *MsgWithdrawValidatorCommissionResponse) Reset() { + *m = MsgWithdrawValidatorCommissionResponse{} +} +func (m *MsgWithdrawValidatorCommissionResponse) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawValidatorCommissionResponse) ProtoMessage() {} +func (*MsgWithdrawValidatorCommissionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{5} +} +func (m *MsgWithdrawValidatorCommissionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawValidatorCommissionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawValidatorCommissionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgWithdrawValidatorCommissionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawValidatorCommissionResponse.Merge(m, src) +} +func (m *MsgWithdrawValidatorCommissionResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawValidatorCommissionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawValidatorCommissionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawValidatorCommissionResponse proto.InternalMessageInfo + // MsgFundCommunityPool allows an account to directly // fund the community pool. type MsgFundCommunityPool struct { @@ -155,7 +273,7 @@ func (m *MsgFundCommunityPool) Reset() { *m = MsgFundCommunityPool{} } func (m *MsgFundCommunityPool) String() string { return proto.CompactTextString(m) } func (*MsgFundCommunityPool) ProtoMessage() {} func (*MsgFundCommunityPool) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{3} + return fileDescriptor_ed4f433d965e58ca, []int{6} } func (m *MsgFundCommunityPool) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -184,11 +302,52 @@ func (m *MsgFundCommunityPool) XXX_DiscardUnknown() { var xxx_messageInfo_MsgFundCommunityPool proto.InternalMessageInfo +// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +type MsgFundCommunityPoolResponse struct { +} + +func (m *MsgFundCommunityPoolResponse) Reset() { *m = MsgFundCommunityPoolResponse{} } +func (m *MsgFundCommunityPoolResponse) String() string { return proto.CompactTextString(m) } +func (*MsgFundCommunityPoolResponse) ProtoMessage() {} +func (*MsgFundCommunityPoolResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{7} +} +func (m *MsgFundCommunityPoolResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFundCommunityPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFundCommunityPoolResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgFundCommunityPoolResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFundCommunityPoolResponse.Merge(m, src) +} +func (m *MsgFundCommunityPoolResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgFundCommunityPoolResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFundCommunityPoolResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFundCommunityPoolResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSetWithdrawAddress)(nil), "cosmos.distribution.v1beta1.MsgSetWithdrawAddress") + proto.RegisterType((*MsgSetWithdrawAddressResponse)(nil), "cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse") proto.RegisterType((*MsgWithdrawDelegatorReward)(nil), "cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward") + proto.RegisterType((*MsgWithdrawDelegatorRewardResponse)(nil), "cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse") proto.RegisterType((*MsgWithdrawValidatorCommission)(nil), "cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission") + proto.RegisterType((*MsgWithdrawValidatorCommissionResponse)(nil), "cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse") proto.RegisterType((*MsgFundCommunityPool)(nil), "cosmos.distribution.v1beta1.MsgFundCommunityPool") + proto.RegisterType((*MsgFundCommunityPoolResponse)(nil), "cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse") } func init() { @@ -196,35 +355,331 @@ func init() { } var fileDescriptor_ed4f433d965e58ca = []byte{ - // 436 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xbd, 0x8e, 0xd3, 0x40, - 0x1c, 0xc4, 0xbd, 0x87, 0x74, 0xe2, 0x96, 0x82, 0x9c, 0x75, 0x88, 0x90, 0x3b, 0xad, 0x4f, 0x16, - 0x45, 0x1a, 0x6c, 0x02, 0xdd, 0x75, 0xe4, 0xd0, 0x49, 0x29, 0x22, 0x90, 0x91, 0x40, 0xa2, 0x41, - 0x6b, 0xef, 0xca, 0x59, 0x61, 0xfb, 0x1f, 0x79, 0xd7, 0x71, 0xf2, 0x06, 0x94, 0x3c, 0x42, 0x24, - 0x1a, 0x44, 0x4d, 0xc9, 0x03, 0xa4, 0x4c, 0x49, 0x15, 0x90, 0xd3, 0x50, 0xe7, 0x09, 0x50, 0xfc, - 0x95, 0x2f, 0x44, 0x03, 0x95, 0xad, 0xf1, 0xec, 0x6f, 0x46, 0xd6, 0x2c, 0x7e, 0xe8, 0x81, 0x0c, - 0x41, 0xda, 0x4c, 0x48, 0x15, 0x0b, 0x37, 0x51, 0x02, 0x22, 0x7b, 0xd4, 0x71, 0xb9, 0xa2, 0x1d, - 0x5b, 0x8d, 0xad, 0x61, 0x0c, 0x0a, 0xf4, 0xf3, 0xc2, 0x65, 0x6d, 0xbb, 0xac, 0xd2, 0xd5, 0x3a, - 0xf3,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0x1f, 0xd3, 0x10, 0x92, 0x48, 0x35, 0xd1, 0xe5, 0xad, 0xf6, - 0x9d, 0x27, 0x0f, 0xac, 0x72, 0x69, 0xeb, 0xd9, 0x54, 0x0b, 0xb3, 0xae, 0x41, 0x44, 0xdd, 0xc7, - 0xb3, 0x85, 0xa1, 0x7d, 0xf9, 0x61, 0xb4, 0x7d, 0xa1, 0x06, 0x89, 0x6b, 0x79, 0x10, 0xda, 0xe5, - 0xc6, 0x8a, 0xc7, 0x23, 0xc9, 0xde, 0xdb, 0x6a, 0x32, 0xe4, 0x32, 0x3f, 0x20, 0x9d, 0x12, 0xad, - 0x5f, 0xe0, 0x13, 0xc6, 0x87, 0x20, 0x85, 0x82, 0xb8, 0xf8, 0x83, 0xce, 0x46, 0xd8, 0xb4, 0xec, - 0xbe, 0xf8, 0x9c, 0x11, 0x34, 0xcb, 0x08, 0x9a, 0x67, 0x04, 0xfd, 0xcc, 0x08, 0xfa, 0xb8, 0x24, - 0xda, 0x7c, 0x49, 0xb4, 0xef, 0x4b, 0xa2, 0xbd, 0xed, 0xfc, 0x35, 0x77, 0xbc, 0x7b, 0x83, 0xf2, - 0x1a, 0xee, 0x71, 0x3e, 0xf5, 0xa7, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x89, 0x6e, 0x9f, 0xc2, - 0x65, 0x03, 0x00, 0x00, + // 558 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0x3f, 0x6f, 0xd3, 0x40, + 0x18, 0xc6, 0x7d, 0x2d, 0xaa, 0xe8, 0x31, 0x90, 0x58, 0x45, 0x0d, 0x4e, 0x38, 0x57, 0x56, 0x85, + 0xb2, 0x60, 0x93, 0x30, 0x20, 0xc2, 0x80, 0x48, 0x50, 0xa5, 0x0e, 0x11, 0xc8, 0x48, 0x20, 0xb1, + 0x20, 0x3b, 0x77, 0x72, 0x4f, 0xc4, 0xbe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x7d, 0x10, 0xac, 0xe4, 0x85, 0x4c, 0xb6, 0xa8, 0x0f, 0xaf, 0xc0, 0xf5, 0x36, 0x77, + 0xe4, 0x77, 0x00, 0xca, 0x39, 0x17, 0xa5, 0xae, 0x2f, 0xb9, 0x96, 0x7a, 0x6e, 0x4d, 0x95, 0xc6, + 0xc5, 0x3d, 0x49, 0x1c, 0xf9, 0x23, 0x80, 0xdb, 0x8b, 0x7a, 0x7d, 0xff, 0x3c, 0xee, 0x02, 0xa3, + 0xf2, 0xe8, 0x3f, 0x8d, 0x69, 0xaa, 0x4f, 0x00, 0x96, 0x97, 0x35, 0xf1, 0xe1, 0xbf, 0x3e, 0x20, + 0xc7, 0xac, 0xb4, 0x56, 0x30, 0xa7, 0x09, 0xdf, 0x02, 0x58, 0xcc, 0x36, 0xb1, 0x76, 0x1e, 0x3a, + 0x63, 0x51, 0x1e, 0x5c, 0xd8, 0x92, 0x64, 0x68, 0x3e, 0xfd, 0x32, 0x46, 0x60, 0x38, 0x46, 0xe0, + 0x64, 0x8c, 0xc0, 0xaf, 0x31, 0x02, 0x1f, 0x26, 0x48, 0x3a, 0x99, 0x20, 0xe9, 0xc7, 0x04, 0x49, + 0xaf, 0x6a, 0x4b, 0x2b, 0x7e, 0x34, 0xff, 0x76, 0x08, 0x1b, 0x6f, 0x6f, 0x84, 0x7f, 0xe3, 0xf7, + 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0xd2, 0x18, 0x71, 0xb0, 0x41, 0x06, 0x00, 0x00, +} + +func (this *MsgSetWithdrawAddressResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgSetWithdrawAddressResponse) + if !ok { + that2, ok := that.(MsgSetWithdrawAddressResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *MsgWithdrawDelegatorRewardResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgWithdrawDelegatorRewardResponse) + if !ok { + that2, ok := that.(MsgWithdrawDelegatorRewardResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *MsgWithdrawValidatorCommissionResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgWithdrawValidatorCommissionResponse) + if !ok { + that2, ok := that.(MsgWithdrawValidatorCommissionResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *MsgFundCommunityPoolResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgFundCommunityPoolResponse) + if !ok { + that2, ok := that.(MsgFundCommunityPoolResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // ModifyWithdrawAddress defines a method to change the withdraw address + // for a delegator (or validator self-delegation). + SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAddress, opts ...grpc.CallOption) (*MsgSetWithdrawAddressResponse, error) + // WithdrawDelegatorReward defines a method to withdraw rewards of delegator + // from a single validator. + WithdrawDelegatorReward(ctx context.Context, in *MsgWithdrawDelegatorReward, opts ...grpc.CallOption) (*MsgWithdrawDelegatorRewardResponse, error) + // WithdrawValidatorCommission defines a method to withdraw the + // full commission to the validator address + WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAddress, opts ...grpc.CallOption) (*MsgSetWithdrawAddressResponse, error) { + out := new(MsgSetWithdrawAddressResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/SetWithdrawAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) WithdrawDelegatorReward(ctx context.Context, in *MsgWithdrawDelegatorReward, opts ...grpc.CallOption) (*MsgWithdrawDelegatorRewardResponse, error) { + out := new(MsgWithdrawDelegatorRewardResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/WithdrawDelegatorReward", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) { + out := new(MsgWithdrawValidatorCommissionResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/WithdrawValidatorCommission", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) { + out := new(MsgFundCommunityPoolResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/FundCommunityPool", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // ModifyWithdrawAddress defines a method to change the withdraw address + // for a delegator (or validator self-delegation). + SetWithdrawAddress(context.Context, *MsgSetWithdrawAddress) (*MsgSetWithdrawAddressResponse, error) + // WithdrawDelegatorReward defines a method to withdraw rewards of delegator + // from a single validator. + WithdrawDelegatorReward(context.Context, *MsgWithdrawDelegatorReward) (*MsgWithdrawDelegatorRewardResponse, error) + // WithdrawValidatorCommission defines a method to withdraw the + // full commission to the validator address + WithdrawValidatorCommission(context.Context, *MsgWithdrawValidatorCommission) (*MsgWithdrawValidatorCommissionResponse, error) + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + FundCommunityPool(context.Context, *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SetWithdrawAddress(ctx context.Context, req *MsgSetWithdrawAddress) (*MsgSetWithdrawAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetWithdrawAddress not implemented") +} +func (*UnimplementedMsgServer) WithdrawDelegatorReward(ctx context.Context, req *MsgWithdrawDelegatorReward) (*MsgWithdrawDelegatorRewardResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawDelegatorReward not implemented") +} +func (*UnimplementedMsgServer) WithdrawValidatorCommission(ctx context.Context, req *MsgWithdrawValidatorCommission) (*MsgWithdrawValidatorCommissionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawValidatorCommission not implemented") +} +func (*UnimplementedMsgServer) FundCommunityPool(ctx context.Context, req *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FundCommunityPool not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_SetWithdrawAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetWithdrawAddress) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetWithdrawAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/SetWithdrawAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetWithdrawAddress(ctx, req.(*MsgSetWithdrawAddress)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_WithdrawDelegatorReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawDelegatorReward) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).WithdrawDelegatorReward(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/WithdrawDelegatorReward", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawDelegatorReward(ctx, req.(*MsgWithdrawDelegatorReward)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_WithdrawValidatorCommission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawValidatorCommission) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).WithdrawValidatorCommission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/WithdrawValidatorCommission", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawValidatorCommission(ctx, req.(*MsgWithdrawValidatorCommission)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_FundCommunityPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFundCommunityPool) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FundCommunityPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/FundCommunityPool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FundCommunityPool(ctx, req.(*MsgFundCommunityPool)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.distribution.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SetWithdrawAddress", + Handler: _Msg_SetWithdrawAddress_Handler, + }, + { + MethodName: "WithdrawDelegatorReward", + Handler: _Msg_WithdrawDelegatorReward_Handler, + }, + { + MethodName: "WithdrawValidatorCommission", + Handler: _Msg_WithdrawValidatorCommission_Handler, + }, + { + MethodName: "FundCommunityPool", + Handler: _Msg_FundCommunityPool_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/distribution/v1beta1/tx.proto", } func (m *MsgSetWithdrawAddress) Marshal() (dAtA []byte, err error) { @@ -264,6 +719,29 @@ func (m *MsgSetWithdrawAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgSetWithdrawAddressResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetWithdrawAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetWithdrawAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgWithdrawDelegatorReward) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -301,6 +779,29 @@ func (m *MsgWithdrawDelegatorReward) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *MsgWithdrawDelegatorRewardResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgWithdrawDelegatorRewardResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawDelegatorRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgWithdrawValidatorCommission) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -331,6 +832,29 @@ func (m *MsgWithdrawValidatorCommission) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *MsgWithdrawValidatorCommissionResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgWithdrawValidatorCommissionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawValidatorCommissionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgFundCommunityPool) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -375,6 +899,29 @@ func (m *MsgFundCommunityPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgFundCommunityPoolResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgFundCommunityPoolResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFundCommunityPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -403,6 +950,15 @@ func (m *MsgSetWithdrawAddress) Size() (n int) { return n } +func (m *MsgSetWithdrawAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgWithdrawDelegatorReward) Size() (n int) { if m == nil { return 0 @@ -420,6 +976,15 @@ func (m *MsgWithdrawDelegatorReward) Size() (n int) { return n } +func (m *MsgWithdrawDelegatorRewardResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgWithdrawValidatorCommission) Size() (n int) { if m == nil { return 0 @@ -433,6 +998,15 @@ func (m *MsgWithdrawValidatorCommission) Size() (n int) { return n } +func (m *MsgWithdrawValidatorCommissionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgFundCommunityPool) Size() (n int) { if m == nil { return 0 @@ -452,6 +1026,15 @@ func (m *MsgFundCommunityPool) Size() (n int) { return n } +func (m *MsgFundCommunityPoolResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -575,6 +1158,59 @@ func (m *MsgSetWithdrawAddress) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSetWithdrawAddressResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetWithdrawAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetWithdrawAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgWithdrawDelegatorReward) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -692,6 +1328,59 @@ func (m *MsgWithdrawDelegatorReward) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgWithdrawDelegatorRewardResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgWithdrawDelegatorRewardResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawDelegatorRewardResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgWithdrawValidatorCommission) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -777,6 +1466,59 @@ func (m *MsgWithdrawValidatorCommission) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgWithdrawValidatorCommissionResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgWithdrawValidatorCommissionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawValidatorCommissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgFundCommunityPool) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -896,6 +1638,59 @@ func (m *MsgFundCommunityPool) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgFundCommunityPoolResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgFundCommunityPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFundCommunityPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 503b518efc6c52aa1f204877dff6a9e782155c33 Mon Sep 17 00:00:00 2001 From: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Date: Thu, 15 Oct 2020 16:19:57 +0200 Subject: [PATCH 32/84] client: add GetAccount and GetAccountWithHeight to AccountRetriever (#7558) * client: add GetAccount and GetAccountWithHeight to AccountRetriever * update ADR * address comments from review --- client/account_retriever.go | 20 +++++- client/test_helpers.go | 64 ++++++++++++++++--- .../adr-020-protobuf-transaction-encoding.md | 3 + x/auth/types/account_retriever.go | 9 ++- 4 files changed, 83 insertions(+), 13 deletions(-) diff --git a/client/account_retriever.go b/client/account_retriever.go index e7f9fbaea4..51c0a7fa9b 100644 --- a/client/account_retriever.go +++ b/client/account_retriever.go @@ -1,11 +1,25 @@ package client -import "github.com/cosmos/cosmos-sdk/types" +import ( + "github.com/tendermint/tendermint/crypto" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// Account defines a read-only version of the auth module's AccountI. +type Account interface { + GetAddress() sdk.AccAddress + GetPubKey() crypto.PubKey // can return nil. + GetAccountNumber() uint64 + GetSequence() uint64 +} // AccountRetriever defines the interfaces required by transactions to // ensure an account exists and to be able to query for account fields necessary // for signing. type AccountRetriever interface { - EnsureExists(clientCtx Context, addr types.AccAddress) error - GetAccountNumberSequence(clientCtx Context, addr types.AccAddress) (accNum uint64, accSeq uint64, err error) + GetAccount(clientCtx Context, addr sdk.AccAddress) (Account, error) + GetAccountWithHeight(clientCtx Context, addr sdk.AccAddress) (Account, int64, error) + EnsureExists(clientCtx Context, addr sdk.AccAddress) error + GetAccountNumberSequence(clientCtx Context, addr sdk.AccAddress) (accNum uint64, accSeq uint64, err error) } diff --git a/client/test_helpers.go b/client/test_helpers.go index 673519c5fa..1140298fda 100644 --- a/client/test_helpers.go +++ b/client/test_helpers.go @@ -3,19 +3,67 @@ package client import ( "fmt" + "github.com/tendermint/tendermint/crypto" + sdk "github.com/cosmos/cosmos-sdk/types" ) -// TestAccountRetriever is an AccountRetriever that can be used in unit tests -type TestAccountRetriever struct { - Accounts map[string]struct { - Address sdk.AccAddress - Num uint64 - Seq uint64 - } +var ( + _ AccountRetriever = TestAccountRetriever{} + _ Account = TestAccount{} +) + +// TestAccount represents a client Account that can be used in unit tests +type TestAccount struct { + Address sdk.AccAddress + Num uint64 + Seq uint64 } -var _ AccountRetriever = TestAccountRetriever{} +// GetAddress implements client Account.GetAddress +func (t TestAccount) GetAddress() sdk.AccAddress { + return t.Address +} + +// GetPubKey implements client Account.GetPubKey +func (t TestAccount) GetPubKey() crypto.PubKey { + return nil +} + +// GetAccountNumber implements client Account.GetAccountNumber +func (t TestAccount) GetAccountNumber() uint64 { + return t.Num +} + +// GetSequence implements client Account.GetSequence +func (t TestAccount) GetSequence() uint64 { + return t.Seq +} + +// TestAccountRetriever is an AccountRetriever that can be used in unit tests +type TestAccountRetriever struct { + Accounts map[string]TestAccount +} + +// GetAccount implements AccountRetriever.GetAccount +func (t TestAccountRetriever) GetAccount(_ Context, addr sdk.AccAddress) (Account, error) { + acc, ok := t.Accounts[addr.String()] + if !ok { + return nil, fmt.Errorf("account %s not found", addr) + } + + return acc, nil +} + +// GetAccountWithHeight implements AccountRetriever.GetAccountWithHeight +func (t TestAccountRetriever) GetAccountWithHeight(clientCtx Context, addr sdk.AccAddress) (Account, int64, error) { + acc, err := t.GetAccount(clientCtx, addr) + if err != nil { + return nil, 0, err + } + + return acc, 0, nil +} // EnsureExists implements AccountRetriever.EnsureExists func (t TestAccountRetriever) EnsureExists(_ Context, addr sdk.AccAddress) error { diff --git a/docs/architecture/adr-020-protobuf-transaction-encoding.md b/docs/architecture/adr-020-protobuf-transaction-encoding.md index 3d1eb531a3..0e9a644a59 100644 --- a/docs/architecture/adr-020-protobuf-transaction-encoding.md +++ b/docs/architecture/adr-020-protobuf-transaction-encoding.md @@ -11,6 +11,7 @@ - 2020 August 07: Use ADR 027 for serializing `SignDoc`. - 2020 August 19: Move sequence field from `SignDoc` to `SignerInfo`. - 2020 September 25: Remove `PublicKey` type in favor of `secp256k1.PubKey`, `ed25519.PubKey` and `multisig.LegacyAminoPubKey`. +- 2020 October 15: Add `GetAccount` and `GetAccountWithHeight` methods to the `AccountRetriever` interface. ## Status @@ -315,6 +316,8 @@ and messages. ```go type AccountRetriever interface { + GetAccount(clientCtx Context, addr sdk.AccAddress) (client.Account, error) + GetAccountWithHeight(clientCtx Context, addr sdk.AccAddress) (client.Account, int64, error) EnsureExists(clientCtx client.Context, addr sdk.AccAddress) error GetAccountNumberSequence(clientCtx client.Context, addr sdk.AccAddress) (uint64, uint64, error) } diff --git a/x/auth/types/account_retriever.go b/x/auth/types/account_retriever.go index 2b8d24ac27..f84c744188 100644 --- a/x/auth/types/account_retriever.go +++ b/x/auth/types/account_retriever.go @@ -13,13 +13,18 @@ import ( grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" ) +var ( + _ client.Account = AccountI(nil) + _ client.AccountRetriever = AccountRetriever{} +) + // AccountRetriever defines the properties of a type that can be used to // retrieve accounts. type AccountRetriever struct{} // GetAccount queries for an account given an address and a block height. An // error is returned if the query or decoding fails. -func (ar AccountRetriever) GetAccount(clientCtx client.Context, addr sdk.AccAddress) (AccountI, error) { +func (ar AccountRetriever) GetAccount(clientCtx client.Context, addr sdk.AccAddress) (client.Account, error) { account, _, err := ar.GetAccountWithHeight(clientCtx, addr) return account, err } @@ -28,7 +33,7 @@ func (ar AccountRetriever) GetAccount(clientCtx client.Context, addr sdk.AccAddr // height of the query with the account. An error is returned if the query // or decoding fails. //nolint:interfacer -func (ar AccountRetriever) GetAccountWithHeight(clientCtx client.Context, addr sdk.AccAddress) (AccountI, int64, error) { +func (ar AccountRetriever) GetAccountWithHeight(clientCtx client.Context, addr sdk.AccAddress) (client.Account, int64, error) { var header metadata.MD queryClient := NewQueryClient(clientCtx) From c59a04d70f9739ba80066103244f338c6c3bd88a Mon Sep 17 00:00:00 2001 From: Marie Gauthier Date: Thu, 15 Oct 2020 16:38:15 +0200 Subject: [PATCH 33/84] [x/slashing] Implement Protobuf Msg Services (#7557) * Update x/slashing to use proto msg service * Fix proto-gen Co-authored-by: Aaron Craelius Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- proto/cosmos/slashing/v1beta1/tx.proto | 17 +- .../07-tendermint/types/tendermint.pb.go | 9 +- x/slashing/handler.go | 28 +- x/slashing/keeper/msg_server.go | 46 + x/slashing/types/tx.pb.go | 256 +++- x/staking/types/staking.pb.go | 1158 ++++++++--------- 6 files changed, 889 insertions(+), 625 deletions(-) create mode 100644 x/slashing/keeper/msg_server.go diff --git a/proto/cosmos/slashing/v1beta1/tx.proto b/proto/cosmos/slashing/v1beta1/tx.proto index 14494aa477..4d63370ecc 100644 --- a/proto/cosmos/slashing/v1beta1/tx.proto +++ b/proto/cosmos/slashing/v1beta1/tx.proto @@ -6,12 +6,21 @@ option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; -// MsgUnjail is an sdk.Msg used for unjailing a jailed validator, thus returning -// them into the bonded validator set, so they can begin receiving provisions -// and rewards again. +// Msg defines the slashing Msg service. +service Msg { + // 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); +} + +// MsgUnjail defines the Msg/Unjail request type message MsgUnjail { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = true; string validator_addr = 1 [(gogoproto.moretags) = "yaml:\"address\"", (gogoproto.jsontag) = "address"]; -} \ No newline at end of file +} + +// MsgUnjailResponse defines the Msg/Unjail response type +message MsgUnjailResponse {} \ No newline at end of file diff --git a/x/ibc/light-clients/07-tendermint/types/tendermint.pb.go b/x/ibc/light-clients/07-tendermint/types/tendermint.pb.go index f4b26ae3c0..1db3eef309 100644 --- a/x/ibc/light-clients/07-tendermint/types/tendermint.pb.go +++ b/x/ibc/light-clients/07-tendermint/types/tendermint.pb.go @@ -5,6 +5,11 @@ package types import ( fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + time "time" + _go "github.com/confio/ics23/go" types "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" types2 "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types" @@ -16,10 +21,6 @@ import ( types1 "github.com/tendermint/tendermint/abci/types" github_com_tendermint_tendermint_libs_bytes "github.com/tendermint/tendermint/libs/bytes" types3 "github.com/tendermint/tendermint/proto/tendermint/types" - io "io" - math "math" - math_bits "math/bits" - time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/slashing/handler.go b/x/slashing/handler.go index e27b1e439a..eab71edb41 100644 --- a/x/slashing/handler.go +++ b/x/slashing/handler.go @@ -12,35 +12,15 @@ func NewHandler(k keeper.Keeper) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) + msgServer := keeper.NewMsgServerImpl(k) + switch msg := msg.(type) { case *types.MsgUnjail: - return handleMsgUnjail(ctx, msg, k) + res, err := msgServer.Unjail(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } } } - -// Validators must submit a transaction to unjail itself after -// having been jailed (and thus unbonded) for downtime -func handleMsgUnjail(ctx sdk.Context, msg *types.MsgUnjail, k keeper.Keeper) (*sdk.Result, error) { - valAddr, valErr := sdk.ValAddressFromBech32(msg.ValidatorAddr) - if valErr != nil { - return nil, valErr - } - err := k.Unjail(ctx, valAddr) - if err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.ValidatorAddr), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} diff --git a/x/slashing/keeper/msg_server.go b/x/slashing/keeper/msg_server.go new file mode 100644 index 0000000000..90a2558384 --- /dev/null +++ b/x/slashing/keeper/msg_server.go @@ -0,0 +1,46 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/slashing/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the slashing MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +// Unjail implements MsgServer.Unjail method. +// Validators must submit a transaction to unjail itself after +// having been jailed (and thus unbonded) for downtime +func (k msgServer) Unjail(goCtx context.Context, msg *types.MsgUnjail) (*types.MsgUnjailResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + valAddr, valErr := sdk.ValAddressFromBech32(msg.ValidatorAddr) + if valErr != nil { + return nil, valErr + } + err := k.Keeper.Unjail(ctx, valAddr) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.ValidatorAddr), + ), + ) + + return &types.MsgUnjailResponse{}, nil +} diff --git a/x/slashing/types/tx.pb.go b/x/slashing/types/tx.pb.go index 01e951a7c8..8412b3291b 100644 --- a/x/slashing/types/tx.pb.go +++ b/x/slashing/types/tx.pb.go @@ -4,9 +4,14 @@ package types import ( + context "context" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -23,9 +28,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// MsgUnjail is an sdk.Msg used for unjailing a jailed validator, thus returning -// them into the bonded validator set, so they can begin receiving provisions -// and rewards again. +// MsgUnjail defines the Msg/Unjail request type type MsgUnjail struct { ValidatorAddr string `protobuf:"bytes,1,opt,name=validator_addr,json=validatorAddr,proto3" json:"address" yaml:"address"` } @@ -63,14 +66,52 @@ func (m *MsgUnjail) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnjail proto.InternalMessageInfo +// MsgUnjailResponse defines the Msg/Unjail response type +type MsgUnjailResponse struct { +} + +func (m *MsgUnjailResponse) Reset() { *m = MsgUnjailResponse{} } +func (m *MsgUnjailResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUnjailResponse) ProtoMessage() {} +func (*MsgUnjailResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3c5611c0c4a59d9d, []int{1} +} +func (m *MsgUnjailResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUnjailResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUnjailResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUnjailResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUnjailResponse.Merge(m, src) +} +func (m *MsgUnjailResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUnjailResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUnjailResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUnjailResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUnjail)(nil), "cosmos.slashing.v1beta1.MsgUnjail") + proto.RegisterType((*MsgUnjailResponse)(nil), "cosmos.slashing.v1beta1.MsgUnjailResponse") } func init() { proto.RegisterFile("cosmos/slashing/v1beta1/tx.proto", fileDescriptor_3c5611c0c4a59d9d) } var fileDescriptor_3c5611c0c4a59d9d = []byte{ - // 227 bytes of a gzipped FileDescriptorProto + // 269 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x2f, 0xce, 0x49, 0x2c, 0xce, 0xc8, 0xcc, 0x4b, 0xd7, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x87, 0xa8, @@ -80,12 +121,14 @@ var fileDescriptor_3c5611c0c4a59d9d = []byte{ 0x52, 0x8a, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x64, 0x5f, 0xdd, 0x93, 0x67, 0x07, 0xf1, 0x53, 0x8b, 0x8b, 0x3f, 0xdd, 0x93, 0xe7, 0xab, 0x4c, 0xcc, 0xcd, 0xb1, 0x52, 0x82, 0x0a, 0x28, 0x05, 0xf1, 0xc2, 0x35, 0x39, 0xa6, 0xa4, 0x14, 0x59, 0x71, 0x74, 0x2c, 0x90, 0x67, 0x98, 0xb1, - 0x40, 0x9e, 0xd1, 0xc9, 0x7b, 0xc5, 0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, - 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, - 0x96, 0x63, 0x88, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x87, - 0x7a, 0x0b, 0x42, 0xe9, 0x16, 0xa7, 0x64, 0xeb, 0x57, 0x20, 0xfc, 0x58, 0x52, 0x59, 0x90, 0x5a, - 0x9c, 0xc4, 0x06, 0x76, 0xb0, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x4d, 0x4a, 0x48, 0x01, 0x03, - 0x01, 0x00, 0x00, + 0x40, 0x9e, 0x51, 0x49, 0x98, 0x4b, 0x10, 0x6e, 0x78, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, + 0xaa, 0x51, 0x3c, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x50, 0x04, 0x17, 0x1b, 0xd4, 0x56, 0x25, 0x3d, + 0x1c, 0x4e, 0xd6, 0x83, 0x6b, 0x96, 0xd2, 0x22, 0xac, 0x06, 0x66, 0x81, 0x93, 0xf7, 0x8a, 0x47, + 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, + 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9b, 0x9e, 0x59, + 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0x0d, 0x4c, 0x08, 0xa5, 0x5b, 0x9c, 0x92, + 0xad, 0x5f, 0x81, 0x08, 0xd9, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x30, 0x19, 0x03, + 0x02, 0x00, 0x00, 0xff, 0xff, 0x1b, 0xa7, 0xdc, 0xcf, 0x79, 0x01, 0x00, 0x00, } func (this *MsgUnjail) Equal(that interface{}) bool { @@ -112,6 +155,114 @@ func (this *MsgUnjail) Equal(that interface{}) bool { } return true } +func (this *MsgUnjailResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgUnjailResponse) + if !ok { + that2, ok := that.(MsgUnjailResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // 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. + Unjail(ctx context.Context, in *MsgUnjail, opts ...grpc.CallOption) (*MsgUnjailResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Unjail(ctx context.Context, in *MsgUnjail, opts ...grpc.CallOption) (*MsgUnjailResponse, error) { + out := new(MsgUnjailResponse) + err := c.cc.Invoke(ctx, "/cosmos.slashing.v1beta1.Msg/Unjail", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // 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. + Unjail(context.Context, *MsgUnjail) (*MsgUnjailResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) Unjail(ctx context.Context, req *MsgUnjail) (*MsgUnjailResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Unjail not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_Unjail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUnjail) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Unjail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.slashing.v1beta1.Msg/Unjail", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Unjail(ctx, req.(*MsgUnjail)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.slashing.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Unjail", + Handler: _Msg_Unjail_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/slashing/v1beta1/tx.proto", +} + func (m *MsgUnjail) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -142,6 +293,29 @@ func (m *MsgUnjail) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgUnjailResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUnjailResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnjailResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -166,6 +340,15 @@ func (m *MsgUnjail) Size() (n int) { return n } +func (m *MsgUnjailResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -257,6 +440,59 @@ func (m *MsgUnjail) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUnjailResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUnjailResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUnjailResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/staking/types/staking.pb.go b/x/staking/types/staking.pb.go index 08d6ccc761..1c743ca1cd 100644 --- a/x/staking/types/staking.pb.go +++ b/x/staking/types/staking.pb.go @@ -1211,590 +1211,582 @@ func (this *Pool) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_ func StakingDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) { d := &github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet{} var gzipped = []byte{ - // 9322 bytes of a gzipped FileDescriptorSet + // 9194 bytes of a gzipped FileDescriptorSet 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x7d, 0x6d, 0x70, 0x5c, 0xd7, - 0x75, 0x18, 0xdf, 0x7e, 0x00, 0xbb, 0x67, 0x17, 0xc0, 0xe2, 0x02, 0x04, 0x97, 0x4b, 0x12, 0x80, - 0x9e, 0x64, 0x89, 0xa2, 0x28, 0x40, 0xa2, 0x48, 0x8a, 0x5c, 0xda, 0x92, 0xb1, 0xd8, 0x25, 0x08, - 0x12, 0x5f, 0x7a, 0x00, 0x28, 0xc9, 0x4e, 0xba, 0xf3, 0xb0, 0x7b, 0xb1, 0x78, 0xe2, 0xee, 0x7b, - 0x4f, 0xef, 0xbd, 0x25, 0x01, 0xd9, 0x9e, 0x51, 0x62, 0xd7, 0xb5, 0x95, 0xa6, 0xb6, 0xea, 0x4c, - 0x6a, 0x2b, 0xa6, 0x2b, 0xc7, 0x69, 0x9d, 0x3a, 0x69, 0xf3, 0xe1, 0xd4, 0x6d, 0xda, 0xce, 0xd4, - 0x6e, 0x9b, 0xc6, 0x69, 0xa7, 0x19, 0x69, 0x9a, 0x99, 0xa6, 0x99, 0x86, 0x49, 0x65, 0x4d, 0xaa, - 0xba, 0x6e, 0xeb, 0xb0, 0x6a, 0x9a, 0x8e, 0x67, 0xda, 0xce, 0xfd, 0x7a, 0x5f, 0xbb, 0x8b, 0x5d, - 0x40, 0xa4, 0xe4, 0x34, 0xf9, 0x85, 0xbd, 0xe7, 0x9e, 0x73, 0xee, 0x39, 0xe7, 0x9e, 0x73, 0xee, - 0xb9, 0xf7, 0xdd, 0xf7, 0x00, 0xff, 0xfc, 0x02, 0x4c, 0xd6, 0x0c, 0xa3, 0x56, 0xc7, 0xd3, 0xa6, - 0x65, 0x38, 0xc6, 0x46, 0x73, 0x73, 0xba, 0x8a, 0xed, 0x8a, 0xa5, 0x99, 0x8e, 0x61, 0x4d, 0x51, - 0x18, 0x1a, 0x62, 0x18, 0x53, 0x02, 0x43, 0x5e, 0x84, 0xe1, 0x8b, 0x5a, 0x1d, 0x17, 0x5d, 0xc4, - 0x55, 0xec, 0xa0, 0x73, 0x10, 0xdb, 0xd4, 0xea, 0x38, 0x2b, 0x4d, 0x46, 0x8f, 0xa7, 0x4e, 0xdd, - 0x37, 0x15, 0x22, 0x9a, 0x0a, 0x52, 0xac, 0x10, 0xb0, 0x42, 0x29, 0xe4, 0x37, 0x63, 0x30, 0xd2, - 0xa6, 0x17, 0x21, 0x88, 0xe9, 0x6a, 0x83, 0x70, 0x94, 0x8e, 0x27, 0x15, 0xfa, 0x1b, 0x65, 0xa1, - 0xdf, 0x54, 0x2b, 0xd7, 0xd4, 0x1a, 0xce, 0x46, 0x28, 0x58, 0x34, 0xd1, 0x38, 0x40, 0x15, 0x9b, - 0x58, 0xaf, 0x62, 0xbd, 0xb2, 0x93, 0x8d, 0x4e, 0x46, 0x8f, 0x27, 0x15, 0x1f, 0x04, 0x3d, 0x04, - 0xc3, 0x66, 0x73, 0xa3, 0xae, 0x55, 0xca, 0x3e, 0x34, 0x98, 0x8c, 0x1e, 0x8f, 0x2b, 0x19, 0xd6, - 0x51, 0xf4, 0x90, 0x1f, 0x80, 0xa1, 0x1b, 0x58, 0xbd, 0xe6, 0x47, 0x4d, 0x51, 0xd4, 0x41, 0x02, - 0xf6, 0x21, 0xce, 0x42, 0xba, 0x81, 0x6d, 0x5b, 0xad, 0xe1, 0xb2, 0xb3, 0x63, 0xe2, 0x6c, 0x8c, - 0x6a, 0x3f, 0xd9, 0xa2, 0x7d, 0x58, 0xf3, 0x14, 0xa7, 0x5a, 0xdb, 0x31, 0x31, 0x9a, 0x81, 0x24, - 0xd6, 0x9b, 0x0d, 0xc6, 0x21, 0xde, 0xc1, 0x7e, 0x25, 0xbd, 0xd9, 0x08, 0x73, 0x49, 0x10, 0x32, - 0xce, 0xa2, 0xdf, 0xc6, 0xd6, 0x75, 0xad, 0x82, 0xb3, 0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x8b, 0x0b, 0xcb, - 0x33, 0x6b, 0x99, 0x88, 0xdb, 0x9e, 0x5f, 0x5a, 0x3b, 0x7b, 0x3a, 0x13, 0x75, 0x09, 0xd6, 0x19, - 0x20, 0xe6, 0x47, 0x78, 0xec, 0x54, 0x26, 0x8e, 0x32, 0x90, 0x66, 0x0c, 0xe6, 0x9f, 0x29, 0x15, - 0xcf, 0x9e, 0xce, 0xf4, 0x05, 0x21, 0x8f, 0x9d, 0xca, 0xf4, 0xa3, 0x01, 0x48, 0x52, 0x48, 0x61, - 0x79, 0x79, 0x21, 0x93, 0x70, 0x79, 0xae, 0xae, 0x29, 0xf3, 0x4b, 0x73, 0x99, 0xa4, 0xcb, 0x73, - 0x4e, 0x59, 0x5e, 0x5f, 0xc9, 0x80, 0xcb, 0x61, 0xb1, 0xb4, 0xba, 0x3a, 0x33, 0x57, 0xca, 0xa4, - 0x5c, 0x8c, 0xc2, 0xb3, 0x6b, 0xa5, 0xd5, 0x4c, 0x3a, 0x20, 0xd6, 0x63, 0xa7, 0x32, 0x03, 0xee, - 0x10, 0xa5, 0xa5, 0xf5, 0xc5, 0xcc, 0x20, 0x1a, 0x86, 0x01, 0x36, 0x84, 0x10, 0x62, 0x28, 0x04, - 0x3a, 0x7b, 0x3a, 0x93, 0xf1, 0x04, 0x61, 0x5c, 0x86, 0x03, 0x80, 0xb3, 0xa7, 0x33, 0x48, 0x9e, - 0x85, 0x38, 0x75, 0x43, 0x84, 0x60, 0x70, 0x61, 0xa6, 0x50, 0x5a, 0x28, 0x2f, 0xaf, 0xac, 0xcd, - 0x2f, 0x2f, 0xcd, 0x2c, 0x64, 0x24, 0x0f, 0xa6, 0x94, 0x9e, 0x5a, 0x9f, 0x57, 0x4a, 0xc5, 0x4c, - 0xc4, 0x0f, 0x5b, 0x29, 0xcd, 0xac, 0x95, 0x8a, 0x99, 0xa8, 0x5c, 0x81, 0xd1, 0x76, 0x09, 0xb5, - 0x6d, 0x08, 0xf9, 0x7c, 0x21, 0x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c, 0x12, - 0xc7, 0x2a, 0x36, 0x76, 0xca, 0x37, 0x34, 0x8b, 0x06, 0x64, 0x43, 0x65, 0x8b, 0xa3, 0xeb, 0x3f, - 0xa3, 0x1c, 0x6b, 0x15, 0x3b, 0x4f, 0x6b, 0x16, 0x09, 0xb7, 0x86, 0xea, 0xa0, 0x05, 0x98, 0xd0, - 0x8d, 0xb2, 0xed, 0xa8, 0x7a, 0x55, 0xb5, 0xaa, 0x65, 0xef, 0x40, 0xab, 0xac, 0x56, 0x2a, 0xd8, - 0xb6, 0x0d, 0xb6, 0x10, 0xba, 0x5c, 0x8e, 0xea, 0xc6, 0x2a, 0x47, 0xf6, 0x56, 0x88, 0x19, 0x8e, - 0x1a, 0x72, 0xdf, 0x68, 0x27, 0xf7, 0x3d, 0x02, 0xc9, 0x86, 0x6a, 0x96, 0xb1, 0xee, 0x58, 0x3b, - 0xb4, 0x3e, 0x4f, 0x28, 0x89, 0x86, 0x6a, 0x96, 0x48, 0xfb, 0x5d, 0xd9, 0x26, 0x5d, 0x8e, 0x25, - 0x12, 0x99, 0xe4, 0xe5, 0x58, 0x22, 0x99, 0x01, 0xf9, 0x8d, 0x28, 0xa4, 0xfd, 0xf5, 0x3a, 0xd9, - 0xfe, 0x54, 0xe8, 0x8a, 0x25, 0xd1, 0x9c, 0x76, 0xef, 0xae, 0xd5, 0xfd, 0xd4, 0x2c, 0x59, 0xca, - 0xf2, 0x7d, 0xac, 0x38, 0x56, 0x18, 0x25, 0x29, 0x23, 0x88, 0xb3, 0x61, 0x56, 0x8c, 0x24, 0x14, - 0xde, 0x42, 0x73, 0xd0, 0xf7, 0x9c, 0x4d, 0x79, 0xf7, 0x51, 0xde, 0xf7, 0xed, 0xce, 0xfb, 0xf2, - 0x2a, 0x65, 0x9e, 0xbc, 0xbc, 0x5a, 0x5e, 0x5a, 0x56, 0x16, 0x67, 0x16, 0x14, 0x4e, 0x8e, 0x0e, - 0x43, 0xac, 0xae, 0xbe, 0xb0, 0x13, 0x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0x20, 0x64, 0xf9, - 0x91, 0xf9, 0x62, 0x69, 0x71, 0x65, 0x79, 0xad, 0xb4, 0x34, 0xfb, 0x6c, 0x79, 0x7d, 0xe9, 0xca, - 0xd2, 0xf2, 0xd3, 0x4b, 0x4a, 0x46, 0x0b, 0xa1, 0xdd, 0xc5, 0xb0, 0x5f, 0x81, 0x4c, 0x58, 0x28, - 0x74, 0x08, 0xda, 0x89, 0x95, 0x39, 0x80, 0x46, 0x60, 0x68, 0x69, 0xb9, 0xbc, 0x3a, 0x5f, 0x2c, - 0x95, 0x4b, 0x17, 0x2f, 0x96, 0x66, 0xd7, 0x56, 0xd9, 0xb9, 0x87, 0x8b, 0xbd, 0x16, 0x08, 0x70, - 0xf9, 0x95, 0x28, 0x8c, 0xb4, 0x91, 0x04, 0xcd, 0xf0, 0x1d, 0x0b, 0xdb, 0x44, 0x3d, 0xdc, 0x8b, - 0xf4, 0x53, 0xa4, 0x66, 0x58, 0x51, 0x2d, 0x87, 0x6f, 0x70, 0x1e, 0x04, 0x62, 0x25, 0xdd, 0xd1, - 0x36, 0x35, 0x6c, 0xf1, 0xf3, 0x24, 0xb6, 0x8d, 0x19, 0xf2, 0xe0, 0xec, 0x48, 0xe9, 0x24, 0x20, - 0xd3, 0xb0, 0x35, 0x47, 0xbb, 0x8e, 0xcb, 0x9a, 0x2e, 0x0e, 0x9f, 0xc8, 0xb6, 0x26, 0xa6, 0x64, - 0x44, 0xcf, 0xbc, 0xee, 0xb8, 0xd8, 0x3a, 0xae, 0xa9, 0x21, 0x6c, 0x92, 0xcc, 0xa3, 0x4a, 0x46, - 0xf4, 0xb8, 0xd8, 0xf7, 0x40, 0xba, 0x6a, 0x34, 0x49, 0xad, 0xc7, 0xf0, 0xc8, 0xda, 0x21, 0x29, - 0x29, 0x06, 0x73, 0x51, 0x78, 0x15, 0xef, 0x9d, 0x7a, 0xa5, 0x95, 0x14, 0x83, 0x31, 0x94, 0x07, - 0x60, 0x48, 0xad, 0xd5, 0x2c, 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8, 0xe7, 0x95, 0x4a, 0x77, 0xea, 0x4f, 0xf3, - 0xc1, 0x05, 0x45, 0xfe, 0x71, 0x88, 0xf7, 0x68, 0xf0, 0x9f, 0xe4, 0xa4, 0x0c, 0x3f, 0x3f, 0x0b, - 0x29, 0x5f, 0x75, 0xd2, 0x9d, 0xfc, 0xaf, 0x71, 0x72, 0x3f, 0x15, 0x11, 0x9d, 0x57, 0x27, 0xdd, - 0x19, 0x7c, 0x46, 0x88, 0xce, 0x29, 0x88, 0xd9, 0x44, 0x61, 0xd2, 0x9d, 0xfa, 0xb3, 0xc2, 0xea, - 0x82, 0x24, 0xff, 0x24, 0x24, 0xdd, 0xc5, 0xa6, 0x3b, 0xfd, 0xcb, 0x9c, 0xde, 0xa3, 0x21, 0x16, - 0xf0, 0x2d, 0x76, 0xdd, 0x59, 0xfc, 0x75, 0x61, 0x01, 0x1f, 0x15, 0x09, 0xa3, 0x70, 0x01, 0xd3, - 0x9d, 0xd3, 0xe7, 0x44, 0x18, 0x85, 0xea, 0x17, 0x32, 0x9b, 0x34, 0xe7, 0x77, 0x67, 0xf1, 0x53, - 0x62, 0x36, 0x29, 0x3e, 0x11, 0x23, 0x5c, 0x11, 0x74, 0xe7, 0xf1, 0x37, 0x84, 0x18, 0xa1, 0x82, - 0x20, 0xbf, 0x02, 0xa8, 0xb5, 0x1a, 0xe8, 0xce, 0xef, 0xf3, 0x9c, 0xdf, 0x70, 0x4b, 0x31, 0x90, - 0x7f, 0x1a, 0xc6, 0xda, 0x57, 0x02, 0xdd, 0xb9, 0x7e, 0xe1, 0xed, 0xd0, 0xde, 0xcd, 0x5f, 0x08, - 0xe4, 0xd7, 0xbc, 0x25, 0xc5, 0x5f, 0x05, 0x74, 0x67, 0xfb, 0xca, 0xdb, 0xc1, 0xc4, 0xed, 0x2f, - 0x02, 0xf2, 0x33, 0x00, 0xde, 0x02, 0xdc, 0x9d, 0xd7, 0x17, 0x39, 0x2f, 0x1f, 0x11, 0x09, 0x0d, - 0x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, 0x61, 0xd5, 0x55, - 0x1f, 0xb5, 0xfb, 0x20, 0x81, 0xcf, 0x52, 0x30, 0xad, 0xb1, 0x8e, 0x40, 0x92, 0x5e, 0xc8, 0xa7, - 0x28, 0xec, 0xf2, 0x59, 0x82, 0x00, 0x68, 0xe7, 0x03, 0x30, 0xe4, 0x65, 0x50, 0x86, 0x92, 0x60, - 0x5c, 0x3c, 0x30, 0x45, 0x7c, 0x04, 0x46, 0x75, 0xbc, 0x4d, 0xaf, 0xc3, 0x05, 0xb0, 0x93, 0x14, - 0x1b, 0x91, 0xbe, 0xab, 0x41, 0x8a, 0xf7, 0xc1, 0x60, 0x45, 0x18, 0x9f, 0xe1, 0x02, 0xc5, 0x1d, - 0x70, 0xa1, 0x14, 0xed, 0x30, 0x24, 0x54, 0xd3, 0x64, 0x08, 0x29, 0x9e, 0x41, 0x4d, 0x93, 0x76, - 0x9d, 0x80, 0x61, 0xaa, 0xa3, 0x85, 0xed, 0x66, 0xdd, 0xe1, 0x4c, 0xd2, 0x14, 0x67, 0x88, 0x74, - 0x28, 0x0c, 0x4e, 0x71, 0xef, 0x85, 0x01, 0x7c, 0x5d, 0xab, 0x62, 0xbd, 0x82, 0x19, 0xde, 0x00, - 0xc5, 0x4b, 0x0b, 0x20, 0x45, 0x7a, 0x10, 0xdc, 0xcc, 0x58, 0x16, 0x59, 0x7b, 0x90, 0xf1, 0x13, - 0xf0, 0x19, 0x06, 0x96, 0x4f, 0x42, 0xac, 0xa8, 0x3a, 0x2a, 0x29, 0x31, 0x9c, 0x6d, 0xb6, 0x14, - 0xa5, 0x15, 0xf2, 0xb3, 0x6d, 0xb8, 0xbd, 0x15, 0x81, 0xd8, 0x55, 0xc3, 0xc1, 0xe8, 0x31, 0x5f, - 0x59, 0x38, 0xd8, 0xce, 0xc7, 0x57, 0xb5, 0x9a, 0x8e, 0xab, 0x8b, 0x76, 0xcd, 0xf7, 0x46, 0xad, - 0xe7, 0x62, 0x91, 0x80, 0x8b, 0x8d, 0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 0x31, 0xe8, - 0x33, 0x36, 0x37, 0xc5, 0x65, 0x9a, 0x98, 0xc2, 0x5b, 0x68, 0x14, 0xe2, 0x75, 0xad, 0xa1, 0x31, - 0xa3, 0xc4, 0x14, 0xd6, 0x40, 0x13, 0x90, 0xaa, 0x10, 0xdd, 0xcb, 0xec, 0xf6, 0x71, 0x4c, 0x7c, - 0x25, 0xa4, 0xa9, 0x3b, 0x6b, 0x04, 0x22, 0x3f, 0x09, 0x69, 0x36, 0x1e, 0x2f, 0xa0, 0x0f, 0x43, - 0x82, 0xde, 0x16, 0xf5, 0x46, 0xed, 0x27, 0xed, 0x2b, 0xec, 0x8d, 0x1b, 0xc6, 0x85, 0x0d, 0xcc, - 0x1a, 0x85, 0x42, 0x47, 0x53, 0x1e, 0xef, 0x9e, 0xec, 0x98, 0xa1, 0x5c, 0x33, 0xfe, 0x46, 0x1c, - 0x0e, 0xf2, 0x07, 0xe1, 0xaa, 0xa9, 0x4d, 0x6f, 0x39, 0x8e, 0x78, 0x95, 0x0d, 0xf8, 0xce, 0x55, - 0x35, 0x35, 0x79, 0x07, 0x62, 0x97, 0x1c, 0xc7, 0x44, 0x27, 0x20, 0x6e, 0x35, 0xeb, 0x58, 0x1c, - 0xe0, 0x8e, 0x4e, 0x79, 0x38, 0x53, 0x04, 0x41, 0x69, 0xd6, 0xb1, 0xc2, 0x50, 0x50, 0x09, 0x26, - 0x36, 0x9b, 0xf5, 0xfa, 0x4e, 0xb9, 0x8a, 0xe9, 0x3f, 0x78, 0x72, 0xff, 0x45, 0x02, 0xde, 0x36, - 0x55, 0xdd, 0x2d, 0x3e, 0x12, 0xca, 0x51, 0x8a, 0x56, 0xa4, 0x58, 0xe2, 0xdf, 0x23, 0x94, 0x04, - 0x8e, 0xfc, 0x7b, 0x11, 0x48, 0x08, 0xd6, 0xf4, 0x15, 0x18, 0x5c, 0xc7, 0x15, 0xc7, 0x10, 0x8f, - 0x34, 0xdd, 0x36, 0x42, 0x10, 0xad, 0xf1, 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0xb7, 0x2d, 0x2f, 0x01, 0x6a, 0x9d, 0xdc, 0xf0, 0xf7, 0x1e, 0x93, 0xde, 0xf7, - 0x1e, 0x47, 0x21, 0xee, 0xff, 0x22, 0x22, 0x6b, 0xdc, 0xbd, 0xdb, 0x42, 0xff, 0x2f, 0x00, 0x00, - 0xff, 0xff, 0x2d, 0x40, 0x2b, 0xb4, 0xf6, 0x8e, 0x00, 0x00, + 0x75, 0x18, 0xdf, 0x7e, 0x00, 0xbb, 0x07, 0x0b, 0x60, 0x71, 0x01, 0x82, 0xcb, 0x25, 0x09, 0x40, + 0x4f, 0xb2, 0x44, 0x51, 0x12, 0x20, 0x51, 0x22, 0x45, 0x2e, 0x63, 0xc9, 0x58, 0xec, 0x12, 0x04, + 0x89, 0x2f, 0x3d, 0x00, 0x94, 0x3f, 0x92, 0xee, 0x3c, 0xbc, 0xbd, 0x58, 0x3c, 0x71, 0xf7, 0xbd, + 0xa7, 0xf7, 0xde, 0x92, 0x80, 0x6c, 0xcf, 0x28, 0xb1, 0xeb, 0xda, 0x4a, 0x53, 0xdb, 0x71, 0x26, + 0xb5, 0x65, 0xd3, 0x95, 0xe3, 0xb4, 0x4e, 0x9d, 0xb4, 0xf9, 0x70, 0xea, 0x36, 0x6d, 0x67, 0xea, + 0x74, 0x9a, 0xc6, 0x69, 0x67, 0x32, 0xd2, 0x34, 0x33, 0x4d, 0x33, 0x0d, 0x93, 0xca, 0x9a, 0x54, + 0x75, 0xdd, 0xc6, 0x61, 0xd5, 0x36, 0x1d, 0xcf, 0xb4, 0x9d, 0xfb, 0xf5, 0xbe, 0x76, 0x17, 0xbb, + 0x80, 0x48, 0xc9, 0x69, 0xfa, 0x0b, 0x7b, 0xcf, 0x3d, 0xe7, 0xdc, 0x73, 0xce, 0x3d, 0xf7, 0xdc, + 0x73, 0xcf, 0xbb, 0xef, 0x01, 0xbe, 0x78, 0x01, 0xa6, 0x6a, 0xa6, 0x59, 0xab, 0xe3, 0x19, 0xcb, + 0x36, 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0x99, 0x6e, + 0x92, 0x4c, 0x97, 0x05, 0x9d, 0x42, 0xc8, 0x94, 0x21, 0x1c, 0x6a, 0xa3, 0x12, 0x80, 0x69, 0x60, + 0x73, 0xab, 0x52, 0xc5, 0x5a, 0x3d, 0x97, 0xea, 0x60, 0xa5, 0x15, 0x82, 0xd2, 0x62, 0x25, 0x93, + 0x41, 0xb5, 0x3a, 0x3a, 0xef, 0xbb, 0x5a, 0x7f, 0x07, 0x4f, 0x59, 0x62, 0x8b, 0xac, 0xc5, 0xdb, + 0x36, 0x60, 0xc8, 0xc6, 0xc4, 0xef, 0x71, 0x95, 0x6b, 0x96, 0xa6, 0x42, 0x4c, 0x77, 0xd5, 0x4c, + 0xe1, 0x64, 0x4c, 0xb1, 0x41, 0x3b, 0xd8, 0x44, 0xf7, 0x82, 0x07, 0xa8, 0x50, 0xb7, 0x02, 0x1a, + 0x85, 0x32, 0x02, 0xb8, 0xac, 0x36, 0x70, 0xfe, 0x05, 0x18, 0x0a, 0x9b, 0x07, 0x8d, 0x41, 0xd2, + 0x71, 0x55, 0xdb, 0xa5, 0x5e, 0x98, 0x54, 0x58, 0x03, 0x65, 0x21, 0x8e, 0x8d, 0x2a, 0x8d, 0x72, + 0x49, 0x85, 0xfc, 0x44, 0xef, 0xf3, 0x15, 0x8e, 0x53, 0x85, 0xef, 0x6f, 0x9d, 0xd1, 0x10, 0xe7, + 0xa8, 0xde, 0xf9, 0x27, 0x61, 0x30, 0xa4, 0x40, 0xaf, 0x43, 0xcb, 0x1f, 0x81, 0xc3, 0x6d, 0x59, + 0xa3, 0xf7, 0xc3, 0x58, 0xd3, 0xd0, 0x0d, 0x17, 0xdb, 0x96, 0x8d, 0x89, 0xc7, 0xb2, 0xa1, 0x72, + 0xff, 0xb1, 0xbf, 0x83, 0xcf, 0x6d, 0x04, 0xb1, 0x19, 0x17, 0x65, 0xb4, 0xd9, 0x0a, 0x3c, 0x95, + 0x4e, 0xbd, 0xd9, 0x9f, 0x7d, 0xf1, 0xc5, 0x17, 0x5f, 0x8c, 0xc9, 0x9f, 0xef, 0x83, 0xb1, 0x76, + 0x6b, 0xa6, 0xed, 0xf2, 0x1d, 0x87, 0x3e, 0xa3, 0xd9, 0xd8, 0xc4, 0x36, 0x35, 0x52, 0x52, 0xe1, + 0x2d, 0x34, 0x0b, 0xc9, 0xba, 0xba, 0x89, 0xeb, 0xb9, 0xc4, 0x94, 0x74, 0x72, 0xe8, 0xf4, 0x43, + 0x3d, 0xad, 0xca, 0xe9, 0x45, 0x42, 0xa2, 0x30, 0x4a, 0xf4, 0x14, 0x24, 0x78, 0x88, 0x26, 0x1c, + 0x4e, 0xf5, 0xc6, 0x81, 0xac, 0x25, 0x85, 0xd2, 0xa1, 0x63, 0x90, 0x26, 0x7f, 0x99, 0x6f, 0xf4, + 0x51, 0x99, 0x53, 0x04, 0x40, 0xfc, 0x02, 0xe5, 0x21, 0x45, 0x97, 0x49, 0x15, 0x8b, 0xad, 0xcd, + 0x6b, 0x13, 0xc7, 0xaa, 0xe2, 0x2d, 0xb5, 0x59, 0x77, 0x2b, 0xd7, 0xd5, 0x7a, 0x13, 0x53, 0x87, + 0x4f, 0x2b, 0x19, 0x0e, 0xbc, 0x4a, 0x60, 0x68, 0x12, 0x06, 0xd8, 0xaa, 0xd2, 0x8d, 0x2a, 0xde, + 0xa1, 0xd1, 0x33, 0xa9, 0xb0, 0x85, 0xb6, 0x40, 0x20, 0x64, 0xf8, 0xe7, 0x1c, 0xd3, 0x10, 0xae, + 0x49, 0x87, 0x20, 0x00, 0x3a, 0xfc, 0x93, 0xd1, 0xc0, 0x7d, 0xa2, 0xbd, 0x7a, 0x51, 0x9f, 0x92, + 0xbf, 0x19, 0x83, 0x04, 0x8d, 0x17, 0xc3, 0x30, 0xb0, 0xfe, 0x81, 0xd5, 0x72, 0xa5, 0xb4, 0xb2, + 0x51, 0x5c, 0x2c, 0x67, 0x25, 0x34, 0x04, 0x40, 0x01, 0x17, 0x17, 0x57, 0x66, 0xd7, 0xb3, 0x31, + 0xaf, 0xbd, 0xb0, 0xbc, 0x7e, 0xf6, 0x89, 0x6c, 0xdc, 0x23, 0xd8, 0x60, 0x80, 0x44, 0x10, 0xe1, + 0xf1, 0xd3, 0xd9, 0x24, 0xca, 0x42, 0x86, 0x31, 0x58, 0x78, 0x7f, 0xb9, 0x74, 0xf6, 0x89, 0x6c, + 0x5f, 0x18, 0xf2, 0xf8, 0xe9, 0x6c, 0x3f, 0x1a, 0x84, 0x34, 0x85, 0x14, 0x57, 0x56, 0x16, 0xb3, + 0x29, 0x8f, 0xe7, 0xda, 0xba, 0xb2, 0xb0, 0x3c, 0x9f, 0x4d, 0x7b, 0x3c, 0xe7, 0x95, 0x95, 0x8d, + 0xd5, 0x2c, 0x78, 0x1c, 0x96, 0xca, 0x6b, 0x6b, 0xb3, 0xf3, 0xe5, 0xec, 0x80, 0x87, 0x51, 0xfc, + 0xc0, 0x7a, 0x79, 0x2d, 0x9b, 0x09, 0x89, 0xf5, 0xf8, 0xe9, 0xec, 0xa0, 0x37, 0x44, 0x79, 0x79, + 0x63, 0x29, 0x3b, 0x84, 0x46, 0x60, 0x90, 0x0d, 0x21, 0x84, 0x18, 0x8e, 0x80, 0xce, 0x3e, 0x91, + 0xcd, 0xfa, 0x82, 0x30, 0x2e, 0x23, 0x21, 0xc0, 0xd9, 0x27, 0xb2, 0x48, 0x9e, 0x83, 0x24, 0xf5, + 0x2e, 0x84, 0x60, 0x68, 0x71, 0xb6, 0x58, 0x5e, 0xac, 0xac, 0xac, 0xae, 0x2f, 0xac, 0x2c, 0xcf, + 0x2e, 0x66, 0x25, 0x1f, 0xa6, 0x94, 0x9f, 0xd9, 0x58, 0x50, 0xca, 0xa5, 0x6c, 0x2c, 0x08, 0x5b, + 0x2d, 0xcf, 0xae, 0x97, 0x4b, 0xd9, 0xb8, 0xac, 0xc1, 0x58, 0xbb, 0x38, 0xd9, 0x76, 0x65, 0x04, + 0xa6, 0x38, 0xd6, 0x61, 0x8a, 0x29, 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x9f, 0x4a, 0xb8, 0x46, 0x71, 0xe6, 0x08, 0xca, 0x86, 0xbb, 0x75, 0x0e, 0xad, 0x41, + 0x86, 0x4c, 0x46, 0x43, 0x7f, 0x01, 0x57, 0xb6, 0x4c, 0x9b, 0x6e, 0x8d, 0x43, 0x6d, 0x42, 0x53, + 0xc0, 0x82, 0xd3, 0x2b, 0x9c, 0x60, 0xc9, 0xac, 0xe2, 0x42, 0x72, 0x6d, 0xb5, 0x5c, 0x2e, 0x29, + 0x03, 0x82, 0xcb, 0x45, 0xd3, 0x26, 0x0e, 0x55, 0x33, 0x3d, 0x03, 0x0f, 0x30, 0x87, 0xaa, 0x99, + 0xc2, 0xbc, 0x67, 0x60, 0x54, 0xd3, 0x98, 0xce, 0xba, 0x56, 0xe1, 0x67, 0x2c, 0x27, 0x97, 0x0d, + 0x19, 0x4b, 0xd3, 0xe6, 0x19, 0x02, 0xf7, 0x71, 0x07, 0x9d, 0x87, 0xc3, 0xbe, 0xb1, 0x82, 0x84, + 0x23, 0x2d, 0x5a, 0x46, 0x49, 0xcf, 0xc0, 0xa8, 0xb5, 0xdb, 0x4a, 0x88, 0x42, 0x23, 0x5a, 0xbb, + 0x51, 0xb2, 0x27, 0x61, 0xcc, 0xda, 0xb6, 0x5a, 0xe9, 0x4e, 0x05, 0xe9, 0x90, 0xb5, 0x6d, 0x45, + 0x09, 0xdf, 0x43, 0x0f, 0xdc, 0x36, 0xd6, 0x54, 0x17, 0x57, 0x73, 0x47, 0x82, 0xe8, 0x81, 0x0e, + 0x34, 0x03, 0x59, 0x4d, 0xab, 0x60, 0x43, 0xdd, 0xac, 0xe3, 0x8a, 0x6a, 0x63, 0x43, 0x75, 0x72, + 0x93, 0x41, 0xe4, 0x21, 0x4d, 0x2b, 0xd3, 0xde, 0x59, 0xda, 0x89, 0x4e, 0xc1, 0x88, 0xb9, 0xf9, + 0x9c, 0xc6, 0x5c, 0xb2, 0x62, 0xd9, 0x78, 0x4b, 0xdf, 0xc9, 0xdd, 0x47, 0xed, 0x3b, 0x4c, 0x3a, + 0xa8, 0x43, 0xae, 0x52, 0x30, 0x7a, 0x10, 0xb2, 0x9a, 0xb3, 0xad, 0xda, 0x16, 0x8d, 0xc9, 0x8e, + 0xa5, 0x6a, 0x38, 0xf7, 0x1e, 0x86, 0xca, 0xe0, 0xcb, 0x02, 0x4c, 0x96, 0x84, 0x73, 0x43, 0xdf, + 0x72, 0x05, 0xc7, 0x07, 0xd8, 0x92, 0xa0, 0x30, 0xce, 0xed, 0x24, 0x64, 0x89, 0x29, 0x42, 0x03, + 0x9f, 0xa4, 0x68, 0x43, 0xd6, 0xb6, 0x15, 0x1c, 0xf7, 0x5e, 0x18, 0x24, 0x98, 0xfe, 0xa0, 0x0f, + 0xb2, 0x84, 0xcc, 0xda, 0x0e, 0x8c, 0xf8, 0x04, 0x8c, 0x13, 0xa4, 0x06, 0x76, 0xd5, 0xaa, 0xea, + 0xaa, 0x01, 0xec, 0x87, 0x29, 0x36, 0xb1, 0xfb, 0x12, 0xef, 0x0c, 0xc9, 0x69, 0x37, 0x37, 0x77, + 0x3d, 0xcf, 0x7a, 0x84, 0xc9, 0x49, 0x60, 0xc2, 0xb7, 0xee, 0x5a, 0xd2, 0x2d, 0x17, 0x20, 0x13, + 0x74, 0x7c, 0x94, 0x06, 0xe6, 0xfa, 0x59, 0x89, 0x64, 0x41, 0x73, 0x2b, 0x25, 0x92, 0xbf, 0x7c, + 0xb0, 0x9c, 0x8d, 0x91, 0x3c, 0x6a, 0x71, 0x61, 0xbd, 0x5c, 0x51, 0x36, 0x96, 0xd7, 0x17, 0x96, + 0xca, 0xd9, 0x78, 0x20, 0x61, 0xbf, 0x9c, 0x48, 0xdd, 0x9f, 0x7d, 0x40, 0x7e, 0x2d, 0x06, 0x43, + 0xe1, 0x13, 0x18, 0xfa, 0x11, 0x38, 0x22, 0xca, 0x25, 0x0e, 0x76, 0x2b, 0x37, 0x74, 0x9b, 0xae, + 0xc8, 0x86, 0xca, 0x76, 0x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xc2, 0x93, 0x90, 0xec, 0xd1, 0xe0, 0x3f, 0xc5, + 0x49, 0x19, 0x7e, 0x61, 0x0e, 0x06, 0x02, 0xd9, 0x49, 0x77, 0xf2, 0xbf, 0xc1, 0xc9, 0x83, 0x54, + 0x44, 0x74, 0x9e, 0x9d, 0x74, 0x67, 0xf0, 0x69, 0x21, 0x3a, 0xa7, 0x20, 0x66, 0x13, 0x89, 0x49, + 0x77, 0xea, 0xcf, 0x08, 0xab, 0x0b, 0x92, 0xc2, 0xd3, 0x90, 0xf6, 0x36, 0x9b, 0xee, 0xf4, 0x9f, + 0xe5, 0xf4, 0x3e, 0x0d, 0xb1, 0x40, 0x60, 0xb3, 0xeb, 0xce, 0xe2, 0xa7, 0x85, 0x05, 0x02, 0x54, + 0x64, 0x19, 0x45, 0x13, 0x98, 0xee, 0x9c, 0x3e, 0x27, 0x96, 0x51, 0x24, 0x7f, 0x21, 0xb3, 0x49, + 0x63, 0x7e, 0x77, 0x16, 0x3f, 0x23, 0x66, 0x93, 0xe2, 0x13, 0x31, 0xa2, 0x19, 0x41, 0x77, 0x1e, + 0x7f, 0x53, 0x88, 0x11, 0x49, 0x08, 0x0a, 0xab, 0x80, 0x5a, 0xb3, 0x81, 0xee, 0xfc, 0x3e, 0xcf, + 0xf9, 0x8d, 0xb4, 0x24, 0x03, 0x85, 0x67, 0x61, 0xbc, 0x7d, 0x26, 0xd0, 0x9d, 0xeb, 0x17, 0xde, + 0x8a, 0x9c, 0xdd, 0x82, 0x89, 0x40, 0x61, 0xdd, 0xdf, 0x52, 0x82, 0x59, 0x40, 0x77, 0xb6, 0x2f, + 0xbf, 0x15, 0x0e, 0xdc, 0xc1, 0x24, 0xa0, 0x30, 0x0b, 0xe0, 0x6f, 0xc0, 0xdd, 0x79, 0x7d, 0x89, + 0xf3, 0x0a, 0x10, 0x91, 0xa5, 0xc1, 0xf7, 0xdf, 0xee, 0xf4, 0x37, 0xc5, 0xd2, 0xe0, 0x14, 0x64, + 0x69, 0x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x74, 0x48, 0x11, + 0x80, 0x42, 0x8a, 0x68, 0xf5, 0xe6, 0x57, 0x26, 0xa5, 0x62, 0x12, 0xe2, 0x4e, 0xb3, 0x71, 0x57, + 0x7d, 0xe0, 0xe5, 0x24, 0x4c, 0x05, 0x29, 0x69, 0x04, 0xba, 0xae, 0xd6, 0xf5, 0xaa, 0xea, 0xbf, + 0x55, 0x9a, 0x0d, 0xe8, 0x48, 0x31, 0xda, 0xab, 0x98, 0xdf, 0xd3, 0x52, 0xf2, 0xaf, 0x49, 0x90, + 0xb9, 0x2a, 0x38, 0xaf, 0x61, 0x17, 0x5d, 0x00, 0xf0, 0x46, 0x12, 0xcb, 0xe2, 0xd8, 0x74, 0x74, + 0xac, 0x69, 0x8f, 0x46, 0x09, 0xa0, 0xa3, 0x27, 0xa9, 0xa3, 0x59, 0xa6, 0xc3, 0xef, 0xd4, 0x77, + 0x21, 0xf5, 0x90, 0xd1, 0xc3, 0x80, 0x68, 0x04, 0xab, 0x5c, 0x37, 0x5d, 0xdd, 0xa8, 0x55, 0x2c, + 0xf3, 0x06, 0x7f, 0x01, 0x29, 0xae, 0x64, 0x69, 0xcf, 0x55, 0xda, 0xb1, 0x4a, 0xe0, 0x44, 0xe8, + 0xb4, 0xc7, 0x85, 0xec, 0x17, 0x6a, 0xb5, 0x6a, 0x63, 0xc7, 0xe1, 0x41, 0x4a, 0x34, 0xd1, 0x05, + 0xe8, 0xb7, 0x9a, 0x9b, 0x15, 0x11, 0x11, 0x06, 0x4e, 0x1f, 0x6f, 0xb7, 0xbe, 0xc5, 0xfc, 0xf3, + 0x15, 0xde, 0x67, 0x35, 0x37, 0x89, 0x37, 0xdc, 0x03, 0x99, 0x36, 0xc2, 0x0c, 0x5c, 0xf7, 0xe5, + 0xa0, 0xaf, 0xc4, 0x72, 0x0d, 0x2a, 0x96, 0xad, 0x9b, 0xb6, 0xee, 0xee, 0xd2, 0x27, 0xe2, 0x71, + 0x25, 0x2b, 0x3a, 0x56, 0x39, 0x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 0x08, 0xce, 0x4f, 0xd0, 0xa0, + 0xfb, 0x21, 0xa5, 0x6d, 0xab, 0xba, 0x51, 0xd1, 0xab, 0x22, 0xb3, 0x7d, 0xfd, 0xd6, 0x64, 0xff, + 0x1c, 0x81, 0x2d, 0x94, 0x94, 0x7e, 0xda, 0xb9, 0x50, 0x25, 0x3b, 0xfd, 0x36, 0xd6, 0x6b, 0xdb, + 0x2e, 0x5f, 0x61, 0xbc, 0x85, 0xce, 0x41, 0x82, 0x38, 0x04, 0x7f, 0x5b, 0x24, 0xdf, 0x72, 0xe2, + 0xf0, 0xb2, 0xb8, 0x62, 0x8a, 0x0c, 0xfc, 0x99, 0x3f, 0x9a, 0x94, 0x14, 0x4a, 0x81, 0xe6, 0x60, + 0xb0, 0xae, 0x3a, 0x6e, 0x85, 0xee, 0x50, 0x64, 0xf8, 0x24, 0x65, 0x71, 0xb4, 0xd5, 0x20, 0xdc, + 0xb0, 0x5c, 0xf4, 0x01, 0x42, 0xc5, 0x40, 0x55, 0x74, 0x12, 0xb2, 0x94, 0x89, 0x66, 0x36, 0x1a, + 0xba, 0xcb, 0x72, 0xa7, 0x3e, 0x6a, 0xf7, 0x21, 0x02, 0x9f, 0xa3, 0x60, 0x9a, 0x41, 0x1d, 0x83, + 0x34, 0xbd, 0x9e, 0x4e, 0x51, 0xd8, 0x55, 0xac, 0x14, 0x01, 0xd0, 0xce, 0x07, 0x60, 0xd8, 0x8f, + 0x8f, 0x0c, 0x25, 0xc5, 0xb8, 0xf8, 0x60, 0x8a, 0xf8, 0x28, 0x8c, 0x19, 0x78, 0x87, 0x5e, 0x0e, + 0x0b, 0x61, 0xa7, 0x29, 0x36, 0x22, 0x7d, 0x57, 0xc3, 0x14, 0xef, 0x81, 0x21, 0x4d, 0x18, 0x9f, + 0xe1, 0x02, 0xc5, 0x1d, 0xf4, 0xa0, 0x14, 0xed, 0x28, 0xa4, 0x54, 0xcb, 0x62, 0x08, 0x03, 0x3c, + 0x3e, 0x5a, 0x16,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0x8c, 0x58, 0x48, 0x7d, 0xfe, 0x95, 0xc9, 0x43, 0xf4, 0xc9, 0xc8, 0x6b, 0x12, 0x80, + 0x6f, 0x31, 0xf4, 0xa3, 0x90, 0xd5, 0xbc, 0x16, 0xa5, 0x75, 0xf8, 0x1c, 0x3e, 0xd0, 0x69, 0x2e, + 0x22, 0xf6, 0x66, 0x49, 0xc7, 0xab, 0xb7, 0x26, 0x25, 0x65, 0x58, 0x8b, 0x4c, 0xc5, 0x87, 0x60, + 0xa0, 0x69, 0x55, 0x55, 0x17, 0x57, 0xe8, 0x01, 0x35, 0xd6, 0x35, 0x81, 0x99, 0x20, 0xbc, 0x6e, + 0xdf, 0x9a, 0x44, 0x4c, 0xad, 0x00, 0xb1, 0x4c, 0xd3, 0x1a, 0x60, 0x10, 0x42, 0x10, 0xd0, 0xe9, + 0x77, 0x24, 0x18, 0x28, 0x05, 0xae, 0xc5, 0xe4, 0xa0, 0xbf, 0x61, 0x1a, 0xfa, 0x35, 0xee, 0x8f, + 0x69, 0x45, 0x34, 0x51, 0x1e, 0x52, 0xec, 0x0d, 0x25, 0x77, 0x57, 0xd4, 0x70, 0x45, 0x9b, 0x50, + 0xdd, 0xc0, 0x9b, 0x8e, 0x2e, 0x66, 0x43, 0x11, 0x4d, 0x74, 0x11, 0xb2, 0x0e, 0xd6, 0x9a, 0xb6, + 0xee, 0xee, 0x56, 0x34, 0xd3, 0x70, 0x55, 0xcd, 0x65, 0xef, 0xba, 0x14, 0x8f, 0xdd, 0xbe, 0x35, + 0x79, 0x84, 0xc9, 0x1a, 0xc5, 0x90, 0x95, 0x61, 0x01, 0x9a, 0x63, 0x10, 0x32, 0x42, 0x15, 0xbb, + 0xaa, 0x5e, 0x77, 0x68, 0x4e, 0x98, 0x56, 0x44, 0x33, 0xa0, 0xcb, 0xff, 0xee, 0x0b, 0x56, 0xec, + 0x2e, 0x42, 0xd6, 0xb4, 0xb0, 0x1d, 0xca, 0xb0, 0xa5, 0xe8, 0xc8, 0x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7a, 0x65, 0x53, 0xad, + 0xab, 0x86, 0x76, 0x90, 0x3c, 0x98, 0x85, 0x7c, 0x3e, 0x6c, 0x84, 0x9d, 0xac, 0x0c, 0x71, 0x48, + 0x91, 0x01, 0xd0, 0x25, 0xe8, 0x17, 0x43, 0x25, 0x0e, 0x94, 0x6d, 0x08, 0xf2, 0x40, 0xca, 0xf6, + 0x53, 0x71, 0x18, 0x51, 0x70, 0xf5, 0xff, 0x4f, 0xc5, 0xfe, 0xa6, 0x62, 0x09, 0x80, 0x2d, 0x77, + 0x12, 0x60, 0x0f, 0x30, 0x1b, 0x24, 0x60, 0xa4, 0x19, 0x87, 0x92, 0xe3, 0x06, 0xe6, 0xe3, 0x56, + 0x0c, 0x32, 0xc1, 0xf9, 0xf8, 0x4b, 0xba, 0x2b, 0xa1, 0x05, 0x3f, 0x12, 0x25, 0xf8, 0x27, 0x12, + 0x3b, 0x44, 0xa2, 0x16, 0xef, 0xdd, 0x3b, 0x04, 0xfd, 0x8f, 0x18, 0xf4, 0xad, 0xaa, 0xb6, 0xda, + 0x70, 0x90, 0xd6, 0x92, 0x69, 0x8a, 0x4a, 0x69, 0xcb, 0xf7, 0x6d, 0x79, 0x95, 0xa1, 0x4b, 0xa2, + 0xf9, 0xf9, 0x36, 0x89, 0xe6, 0xfb, 0x60, 0x88, 0x1c, 0x70, 0x03, 0xb7, 0x2d, 0x88, 0xb5, 0x07, + 0x8b, 0x47, 0x7d, 0x2e, 0xe1, 0x7e, 0x76, 0xfe, 0xbd, 0x1a, 0xbc, 0x6e, 0x31, 0x40, 0x30, 0xfc, + 0xc0, 0x4c, 0xc8, 0xc7, 0xfd, 0x83, 0x66, 0xa0, 0x53, 0x56, 0xa0, 0xa1, 0xee, 0x94, 0x59, 0x03, + 0x2d, 0x02, 0xda, 0xf6, 0x6a, 0x1d, 0x15, 0xdf, 0x9c, 0x84, 0xfe, 0xc4, 0xed, 0x5b, 0x93, 0x47, + 0x19, 0x7d, 0x2b, 0x8e, 0xac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0x3a, 0x5f, 0x95, 0x20, 0xdf, 0x4e, 0x65, 0x3e, 0x7d, 0x3a, 0x8c, 0x87, 0x9e, 0xf9, 0x45, + 0x67, 0xf0, 0xe1, 0x5e, 0x9e, 0x74, 0x45, 0x96, 0xd1, 0x61, 0x1b, 0xdf, 0xed, 0x3c, 0x60, 0x32, + 0xec, 0xa1, 0xad, 0x99, 0xf5, 0xbb, 0xb6, 0x7c, 0x7e, 0xbd, 0x25, 0xae, 0xfe, 0x85, 0xc8, 0xbd, + 0x77, 0x60, 0xa2, 0x83, 0xd4, 0x77, 0x7b, 0xdf, 0xdb, 0xee, 0x38, 0x99, 0x77, 0x3a, 0x7d, 0x7f, + 0x82, 0xaf, 0x84, 0xf0, 0x2b, 0x12, 0x81, 0xb3, 0x58, 0xbb, 0x97, 0x47, 0xe5, 0x0f, 0xc0, 0xb1, + 0xb6, 0x54, 0x5c, 0xb6, 0x02, 0x24, 0xb6, 0x75, 0xc7, 0xe5, 0x62, 0xdd, 0xdf, 0x49, 0xac, 0x08, + 0x35, 0xa5, 0x91, 0x11, 0x64, 0x29, 0xeb, 0x55, 0xd3, 0xac, 0x73, 0x31, 0xe4, 0x2b, 0x30, 0x12, + 0x80, 0xf1, 0x41, 0xce, 0x42, 0xc2, 0x32, 0xf9, 0x87, 0x4f, 0x06, 0x4e, 0x1f, 0xef, 0x34, 0x08, + 0xa1, 0xe1, 0x6a, 0x53, 0x7c, 0x79, 0x0c, 0x10, 0x63, 0x46, 0xaf, 0x84, 0x88, 0x21, 0xd6, 0x60, + 0x34, 0x04, 0xe5, 0x83, 0xfc, 0x08, 0xf4, 0x59, 0x14, 0xe2, 0xbd, 0xe5, 0xd7, 0x69, 0x18, 0x8a, + 0xe5, 0x7d, 0x6a, 0x82, 0xb6, 0x4e, 0x7f, 0xf7, 0x30, 0x24, 0x29, 0x57, 0xf4, 0x05, 0x09, 0x20, + 0x70, 0xc1, 0x63, 0xba, 0x13, 0x9b, 0xf6, 0x67, 0xe2, 0x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0x39, 0x2d, 0x5a, 0x44, 0x0b, 0x12, 0xa3, 0x4f, + 0x48, 0x70, 0xb8, 0xed, 0x26, 0x48, 0xff, 0xc1, 0xdf, 0x3e, 0x8b, 0x74, 0x11, 0xe3, 0xb4, 0xe5, + 0x2b, 0x2b, 0x63, 0xcd, 0x76, 0xd9, 0xc4, 0x2a, 0x0c, 0x86, 0x36, 0xb0, 0x9c, 0xf8, 0x37, 0x9d, + 0xbd, 0xdf, 0xcb, 0x0e, 0x33, 0x40, 0x79, 0x48, 0xe1, 0x1d, 0xcb, 0xb4, 0x5d, 0x5c, 0xa5, 0x57, + 0x1e, 0x52, 0x8a, 0xd7, 0x96, 0x97, 0x01, 0xb5, 0x4e, 0x6e, 0xf4, 0x43, 0x8b, 0x69, 0xff, 0x43, + 0x8b, 0x63, 0x90, 0x0c, 0x7e, 0x8a, 0x90, 0x35, 0xee, 0xde, 0x6d, 0xa1, 0xff, 0x1b, 0x00, 0x00, + 0xff, 0xff, 0x08, 0x1f, 0x88, 0x9b, 0x77, 0x8d, 0x00, 0x00, } r := bytes.NewReader(gzipped) gzipr, err := compress_gzip.NewReader(r) From c735a8eb81f368a05d71168f309793af0d597662 Mon Sep 17 00:00:00 2001 From: Zaki Manian Date: Thu, 15 Oct 2020 08:12:35 -0700 Subject: [PATCH 34/84] Add the option of emitting amino encoded json from the CLI (#7221) * Add the option of emitting amino encoded json * Update AMINO JSON serialization with ConvertTxToStdTx * Make the Amino flag more self documenting by serializing the BroadcastRequest type instead of StdTx * Handle amino encoding error * Update x/auth/client/cli/tx_multisign.go Co-authored-by: Alessio Treglia * Update x/auth/client/cli/tx_sign.go Co-authored-by: Alessio Treglia * Apply suggestions from code review Co-authored-by: Alessio Treglia * Fix go format Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Alessio Treglia Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- x/auth/client/cli/tx_multisign.go | 27 ++++++++++++++++++++++++--- x/auth/client/cli/tx_sign.go | 30 +++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/x/auth/client/cli/tx_multisign.go b/x/auth/client/cli/tx_multisign.go index e3ef24b42e..fc5e907de0 100644 --- a/x/auth/client/cli/tx_multisign.go +++ b/x/auth/client/cli/tx_multisign.go @@ -19,6 +19,7 @@ import ( signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/version" authclient "github.com/cosmos/cosmos-sdk/x/auth/client" + "github.com/cosmos/cosmos-sdk/x/auth/client/rest" "github.com/cosmos/cosmos-sdk/x/auth/signing" ) @@ -52,6 +53,7 @@ recommended to set such parameters manually. cmd.Flags().Bool(flagSigOnly, false, "Print only the generated signature, then exit") cmd.Flags().String(flags.FlagOutputDocument, "", "The document will be written to the given file instead of STDOUT") + cmd.Flags().Bool(flagAmino, false, "Generate Amino encoded JSON suitable for submiting to the txs REST endpoint") flags.AddTxFlagsToCmd(cmd) cmd.Flags().String(flags.FlagChainID, "", "network chain ID") @@ -147,9 +149,28 @@ func makeMultiSignCmd() func(cmd *cobra.Command, args []string) error { sigOnly, _ := cmd.Flags().GetBool(flagSigOnly) - json, err := marshalSignatureJSON(txCfg, txBuilder, sigOnly) - if err != nil { - return err + aminoJSON, _ := cmd.Flags().GetBool(flagAmino) + + var json []byte + + if aminoJSON { + stdTx, err := tx.ConvertTxToStdTx(clientCtx.LegacyAmino, txBuilder.GetTx()) + if err != nil { + return err + } + + req := rest.BroadcastReq{ + Tx: stdTx, + Mode: "block|sync|async", + } + + json, _ = clientCtx.LegacyAmino.MarshalJSON(req) + + } else { + json, err = marshalSignatureJSON(txCfg, txBuilder, sigOnly) + if err != nil { + return err + } } outputDoc, _ := cmd.Flags().GetString(flags.FlagOutputDocument) diff --git a/x/auth/client/cli/tx_sign.go b/x/auth/client/cli/tx_sign.go index b5bceecb2f..7046c495d6 100644 --- a/x/auth/client/cli/tx_sign.go +++ b/x/auth/client/cli/tx_sign.go @@ -12,12 +12,14 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" authclient "github.com/cosmos/cosmos-sdk/x/auth/client" + "github.com/cosmos/cosmos-sdk/x/auth/client/rest" ) const ( flagMultisig = "multisig" flagAppend = "append" flagSigOnly = "signature-only" + flagAmino = "amino" ) // GetSignBatchCommand returns the transaction sign-batch command. @@ -187,6 +189,7 @@ be generated via the 'multisign' command. cmd.Flags().Bool(flagSigOnly, false, "Print only the generated signature, then exit") cmd.Flags().String(flags.FlagOutputDocument, "", "The document will be written to the given file instead of STDOUT") cmd.Flags().String(flags.FlagChainID, "", "The network chain ID") + cmd.Flags().Bool(flagAmino, false, "Generate Amino encoded JSON suitable for submiting to the txs REST endpoint") cmd.MarkFlagRequired(flags.FlagFrom) flags.AddTxFlagsToCmd(cmd) @@ -257,11 +260,36 @@ func makeSignCmd() func(cmd *cobra.Command, args []string) error { return err } - json, err := marshalSignatureJSON(txCfg, txBuilder, generateSignatureOnly) + aminoJSON, _ := cmd.Flags().GetBool(flagAmino) + if err != nil { return err } + var json []byte + + if aminoJSON { + stdTx, err := tx.ConvertTxToStdTx(clientCtx.LegacyAmino, txBuilder.GetTx()) + if err != nil { + return err + } + + req := rest.BroadcastReq{ + Tx: stdTx, + Mode: "block|sync|async", + } + + json, err = clientCtx.LegacyAmino.MarshalJSON(req) + if err != nil { + return err + } + } else { + json, err = marshalSignatureJSON(txCfg, txBuilder, generateSignatureOnly) + if err != nil { + return err + } + } + outputDoc, _ := cmd.Flags().GetString(flags.FlagOutputDocument) if outputDoc == "" { cmd.Printf("%s\n", json) From 332d8ec03894cf0c3b66333e67fcd80b83d7d132 Mon Sep 17 00:00:00 2001 From: SaReN Date: Fri, 16 Oct 2020 00:32:45 +0530 Subject: [PATCH 35/84] update upgrade query (#7567) --- x/upgrade/client/cli/query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/upgrade/client/cli/query.go b/x/upgrade/client/cli/query.go index 0155c8c5d7..f2245aaaeb 100644 --- a/x/upgrade/client/cli/query.go +++ b/x/upgrade/client/cli/query.go @@ -47,7 +47,7 @@ func GetCurrentPlanCmd() *cobra.Command { return err } - if len(res.Plan.Name) == 0 { + if res.Plan == nil { return fmt.Errorf("no upgrade scheduled") } From 08eade65b4f365c447fc308122e39f7b8b209bbc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2020 09:03:44 +0000 Subject: [PATCH 36/84] Bump github.com/golang/protobuf from 1.4.2 to 1.4.3 (#7571) Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.4.2 to 1.4.3. - [Release notes](https://github.com/golang/protobuf/releases) - [Commits](https://github.com/golang/protobuf/compare/v1.4.2...v1.4.3) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 7d37898608..1d0d8434d4 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/gogo/gateway v1.1.0 github.com/gogo/protobuf v1.3.1 github.com/golang/mock v1.4.4 - github.com/golang/protobuf v1.4.2 + github.com/golang/protobuf v1.4.3 github.com/golang/snappy v0.0.2 // indirect github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 diff --git a/go.sum b/go.sum index f1285f3426..333bfe3644 100644 --- a/go.sum +++ b/go.sum @@ -233,6 +233,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= From ec8e02b42f2c917facdc74e3f0876d2602b08759 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2020 09:24:32 +0000 Subject: [PATCH 37/84] Bump github.com/prometheus/client_golang from 1.7.1 to 1.8.0 (#7572) Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.7.1 to 1.8.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/master/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.7.1...v1.8.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- go.mod | 3 +-- go.sum | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 1d0d8434d4..8c5c73cf01 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/otiai10/copy v1.2.0 github.com/pelletier/go-toml v1.8.0 // indirect github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.7.1 + github.com/prometheus/client_golang v1.8.0 github.com/prometheus/common v0.14.0 github.com/rakyll/statik v0.1.7 github.com/regen-network/cosmos-proto v0.3.0 @@ -49,7 +49,6 @@ require ( github.com/tendermint/tm-db v0.6.2 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a golang.org/x/net v0.0.0-20200930145003-4acb6c075d10 // indirect - golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f // indirect google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 google.golang.org/grpc v1.32.0 google.golang.org/protobuf v1.25.0 diff --git a/go.sum b/go.sum index 333bfe3644..b457369995 100644 --- a/go.sum +++ b/go.sum @@ -485,6 +485,8 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.8.0 h1:zvJNkoCFAnYFNC24FV8nW4JdRJ3GIFcLbg65lL/JDcw= +github.com/prometheus/client_golang v1.8.0/go.mod h1:O9VU6huf47PktckDQfMTX0Y8tY0/7TSWwj+ITvv0TnM= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -509,6 +511,8 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= @@ -746,8 +750,8 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed h1:J22ig1FUekjjkmZUM7pTKixYm8DvrYsvrBZdunYeIuQ= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211 h1:9UQO31fZ+0aKQOFldThf7BKPMJTiBfWycGh/u3UoO88= +golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= From 3e49249adb0db84c4ef054b099ae2e62342082bb Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 16 Oct 2020 11:43:28 +0200 Subject: [PATCH 38/84] msg_service_router: reduce code complexity (#7570) * msg_service_router: reduce code complexity * order imports Co-authored-by: Alessio Treglia Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- baseapp/msg_service_router.go | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index efc108881b..b02fbd10c0 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -4,13 +4,13 @@ import ( "context" "fmt" - "github.com/gogo/protobuf/proto" - gogogrpc "github.com/gogo/protobuf/grpc" + "github.com/gogo/protobuf/proto" "google.golang.org/grpc" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // MsgServiceRouter routes fully-qualified Msg service methods to their handler. @@ -59,28 +59,24 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter msr.interfaceRegistry.RegisterCustomTypeURL((*sdk.MsgRequest)(nil), fqMethod, msg) return nil - }, func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { - return nil, nil - }) + }, noopInterceptor) msr.routes[fqMethod] = func(ctx sdk.Context, req sdk.MsgRequest) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) - - // Call the method handler from the service description with the handler object. - res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), func(_ interface{}) error { - // We don't do any decoding here because the decoding was already done. - return nil - }, func(goCtx context.Context, _ interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { + interceptor := func(goCtx context.Context, _ interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { goCtx = context.WithValue(goCtx, sdk.SdkContextKey, ctx) return handler(goCtx, req) - }) + } + // Call the method handler from the service description with the handler object. + // We don't do any decoding here because the decoding was already done. + res, err := methodHandler(handler, sdk.WrapSDKContext(ctx), noopDecoder, interceptor) if err != nil { return nil, err } resMsg, ok := res.(proto.Message) if !ok { - return nil, fmt.Errorf("can't proto encode %T", resMsg) + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "Expecting proto.Message, got %T", resMsg) } return sdk.WrapServiceResult(ctx, resMsg, err) @@ -92,3 +88,10 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter func (msr *MsgServiceRouter) SetInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry) { msr.interfaceRegistry = interfaceRegistry } + +// gRPC NOOP interceptor +func noopInterceptor(_ context.Context, _ interface{}, _ *grpc.UnaryServerInfo, _ grpc.UnaryHandler) (interface{}, error) { + return nil, nil +} + +func noopDecoder(_ interface{}) error { return nil } From 781886716329205c32e6b7a4c990c15b33a423d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Fri, 16 Oct 2020 14:24:48 +0200 Subject: [PATCH 39/84] ibc: update solo machine client command (#7579) Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> --- .../06-solomachine/client/cli/tx.go | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/x/ibc/light-clients/06-solomachine/client/cli/tx.go b/x/ibc/light-clients/06-solomachine/client/cli/tx.go index dec55d1622..dc791f4a58 100644 --- a/x/ibc/light-clients/06-solomachine/client/cli/tx.go +++ b/x/ibc/light-clients/06-solomachine/client/cli/tx.go @@ -6,13 +6,13 @@ import ( "strconv" "github.com/pkg/errors" - "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/version" clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/06-solomachine/types" @@ -25,11 +25,11 @@ const ( // NewCreateClientCmd defines the command to create a new solo machine client. func NewCreateClientCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "create [client-id] [sequence] [path/to/consensus_state.json]", + Use: "create [client-id] [sequence] [path/to/public-key.json] [diversifier] [timestamp]", Short: "create new solo machine client", - Long: "create a new solo machine client with the specified identifier and consensus state", - Example: fmt.Sprintf("%s tx ibc %s create [client-id] [sequence] [path/to/consensus_state.json] --from node0 --home ../node0/cli --chain-id $CID", version.AppName, types.SubModuleName), - Args: cobra.ExactArgs(3), + Long: "create a new solo machine client with the specified identifier and public key", + Example: fmt.Sprintf("%s tx ibc %s create [client-id] [sequence] [public-key] [diversifier] [timestamp] --from node0 --home ../node0/cli --chain-id $CID", version.AppName, types.SubModuleName), + Args: cobra.ExactArgs(5), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) clientCtx, err := client.ReadTxCommandFlags(clientCtx, cmd.Flags()) @@ -38,26 +38,42 @@ func NewCreateClientCmd() *cobra.Command { } clientID := args[0] + diversifier := args[3] sequence, err := strconv.ParseUint(args[1], 10, 64) if err != nil { return err } + timestamp, err := strconv.ParseUint(args[4], 10, 64) + if err != nil { + return err + } + cdc := codec.NewProtoCodec(clientCtx.InterfaceRegistry) - var consensusState *types.ConsensusState - if err := cdc.UnmarshalJSON([]byte(args[2]), consensusState); err != nil { + var publicKey *codectypes.Any + + // attempt to unmarshal public key argument + if err := cdc.UnmarshalJSON([]byte(args[2]), publicKey); err != nil { + // check for file path if JSON input is not provided - contents, err := ioutil.ReadFile(args[1]) + contents, err := ioutil.ReadFile(args[2]) if err != nil { - return errors.New("neither JSON input nor path to .json file were provided") + return errors.New("neither JSON input nor path to .json file for public key were provided") } - if err := cdc.UnmarshalJSON(contents, consensusState); err != nil { - return errors.Wrap(err, "error unmarshalling consensus state file") + + if err := cdc.UnmarshalJSON(contents, publicKey); err != nil { + return errors.Wrap(err, "error unmarshalling public key file") } } + consensusState := &types.ConsensusState{ + PublicKey: publicKey, + Diversifier: diversifier, + Timestamp: timestamp, + } + allowUpdateAfterProposal, _ := cmd.Flags().GetBool(flagAllowUpdateAfterProposal) clientState := types.NewClientState(sequence, consensusState, allowUpdateAfterProposal) From 69e2b7df16bc627c61289231cfe1cbca85e39f5c Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Fri, 16 Oct 2020 14:42:48 +0200 Subject: [PATCH 40/84] docs: Revert SPEC-SPEC and update x/{auth,bank,evidence,slashing} (#7407) * Revert some changes from #7404 * Update x/slashing * Address review comments * Small tweak Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- docs/spec/SPEC-SPEC.md | 41 ++- x/auth/keeper/account.go | 6 +- x/auth/keeper/keeper.go | 34 +- x/auth/spec/02_state.md | 53 ++-- .../{03_messages.md => 03_antehandlers.md} | 6 +- x/auth/spec/03_types.md | 70 ----- x/auth/spec/04_keepers.md | 39 +-- x/auth/spec/07_params.md | 2 +- x/auth/spec/README.md | 35 +-- x/bank/spec/01_state.md | 11 + x/bank/spec/02_keepers.md | 123 ++++++++ x/bank/spec/03_messages.md | 32 ++ x/bank/spec/04_events.md | 29 ++ x/bank/spec/05_params.md | 24 ++ x/bank/spec/README.md | 296 +++--------------- x/evidence/spec/01_concepts.md | 75 +++++ x/evidence/spec/02_state.md | 19 ++ x/evidence/spec/03_messages.md | 48 +++ x/evidence/spec/04_events.md | 18 ++ x/evidence/spec/05_params.md | 7 + x/evidence/spec/06_begin_block.md | 155 +++++++++ x/evidence/spec/README.md | 272 +--------------- x/slashing/spec/01_concepts.md | 22 +- x/slashing/spec/02_state.md | 36 ++- x/slashing/spec/03_messages.md | 20 +- x/slashing/spec/04_begin_block.md | 2 +- x/slashing/spec/05_hooks.md | 2 +- x/slashing/spec/07_tombstone.md | 42 +-- x/slashing/spec/README.md | 24 +- 29 files changed, 799 insertions(+), 744 deletions(-) rename x/auth/spec/{03_messages.md => 03_antehandlers.md} (90%) delete mode 100644 x/auth/spec/03_types.md create mode 100644 x/bank/spec/01_state.md create mode 100644 x/bank/spec/02_keepers.md create mode 100644 x/bank/spec/03_messages.md create mode 100644 x/bank/spec/04_events.md create mode 100644 x/bank/spec/05_params.md create mode 100644 x/evidence/spec/01_concepts.md create mode 100644 x/evidence/spec/02_state.md create mode 100644 x/evidence/spec/03_messages.md create mode 100644 x/evidence/spec/04_events.md create mode 100644 x/evidence/spec/05_params.md create mode 100644 x/evidence/spec/06_begin_block.md diff --git a/docs/spec/SPEC-SPEC.md b/docs/spec/SPEC-SPEC.md index bdbf4d53b7..fb95c3ab96 100644 --- a/docs/spec/SPEC-SPEC.md +++ b/docs/spec/SPEC-SPEC.md @@ -19,33 +19,28 @@ element as a part of a larger description. ## Common Layout -The specifications should be contained in a single `README.md` file inside the -`spec/` folder of a given module. +The following generalized file structure should be used to breakdown +specifications for modules. With the exception of README.md, `XX` at the +beginning of the file name should be replaced with a number to indicate +document flow (ex. read `01_state.md` before `02_state_transitions.md`). The +following list is nonbinding and all files are optional. -The following generalized document structure should be used to breakdown -specifications for modules. Each bullet item corresponds to a new section in -the document, and should begin with a secondary heading (`## {HEADING}` in -Markdown). The `XX` at the beginning of the section name should be replaced -with a number to indicate document flow (ex. read `01. Concepts` before -`02. State Transitions`). The following list is nonbinding and all sections are -optional. - -- `XX. Abstract` - overview of the module -- `XX. Concepts` - describe specialized concepts and definitions used throughout the spec -- `XX. State` - specify and describe structures expected to marshalled into the store, and their keys -- `XX. State Transitions` - standard state transition operations triggered by hooks, messages, etc. -- `XX. Messages` - specify message structure(s) and expected state machine behaviour(s) -- `XX. BeginBlock` - specify any begin-block operations -- `XX. EndBlock` - specify any end-block operations -- `XX. Hooks` - describe available hooks to be called by/from this module -- `XX. Events` - list and describe event tags used -- `XX. Params` - list all module parameters, their types (in JSON) and examples -- `XX. Future Improvements` - describe future improvements of this module -- `XX. Appendix` - supplementary details referenced elsewhere within the spec +- `README.md` - overview of the module +- `XX_concepts.md` - describe specialized concepts and definitions used throughout the spec +- `XX_state.md` - specify and describe structures expected to marshalled into the store, and their keys +- `XX_state_transitions.md` - standard state transition operations triggered by hooks, messages, etc. +- `XX_messages.md` - specify message structure(s) and expected state machine behaviour(s) +- `XX_begin_block.md` - specify any begin-block operations +- `XX_end_block.md` - specify any end-block operations +- `XX_hooks.md` - describe available hooks to be called by/from this module +- `XX_events.md` - list and describe event tags used +- `XX_params.md` - list all module parameters, their types (in JSON) and examples +- `XX_future_improvements.md` - describe future improvements of this module +- `XX_appendix.md` - supplementary details referenced elsewhere within the spec ### Notation for key-value mapping -Within the `State` section, the following notation `->` should be used to describe key to +Within `state.md` the following notation `->` should be used to describe key to value mapping: ``` diff --git a/x/auth/keeper/account.go b/x/auth/keeper/account.go index e39c98ac52..9921bb96f9 100644 --- a/x/auth/keeper/account.go +++ b/x/auth/keeper/account.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/types" ) -// NewAccountWithAddress implements sdk.AccountKeeper. +// NewAccountWithAddress implements AccountKeeperI. func (ak AccountKeeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) types.AccountI { acc := ak.proto() err := acc.SetAddress(addr) @@ -25,7 +25,7 @@ func (ak AccountKeeper) NewAccount(ctx sdk.Context, acc types.AccountI) types.Ac return acc } -// GetAccount implements sdk.AccountKeeper. +// GetAccount implements AccountKeeperI. func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI { store := ctx.KVStore(ak.key) bz := store.Get(types.AddressStoreKey(addr)) @@ -46,7 +46,7 @@ func (ak AccountKeeper) GetAllAccounts(ctx sdk.Context) (accounts []types.Accoun return accounts } -// SetAccount implements sdk.AccountKeeper. +// SetAccount implements AccountKeeperI. func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc types.AccountI) { addr := acc.GetAddress() store := ctx.KVStore(ak.key) diff --git a/x/auth/keeper/keeper.go b/x/auth/keeper/keeper.go index eaefead6c2..86189b62a2 100644 --- a/x/auth/keeper/keeper.go +++ b/x/auth/keeper/keeper.go @@ -14,6 +14,36 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) +// AccountKeeperI is the interface contract that x/auth's keeper implements. +type AccountKeeperI interface { + // Return a new account with the next account number and the specified address. Does not save the new account to the store. + NewAccountWithAddress(sdk.Context, sdk.AccAddress) types.AccountI + + // Return a new account with the next account number. Does not save the new account to the store. + NewAccount(sdk.Context, types.AccountI) types.AccountI + + // Retrieve an account from the store. + GetAccount(sdk.Context, sdk.AccAddress) types.AccountI + + // Set an account in the store. + SetAccount(sdk.Context, types.AccountI) + + // Remove an account from the store. + RemoveAccount(sdk.Context, types.AccountI) + + // Iterate over all accounts, calling the provided function. Stop iteraiton when it returns false. + IterateAccounts(sdk.Context, func(types.AccountI) bool) + + // Fetch the public key of an account at a specified address + GetPubKey(sdk.Context, sdk.AccAddress) (crypto.PubKey, error) + + // Fetch the sequence of an account at a specified address. + GetSequence(sdk.Context, sdk.AccAddress) (uint64, error) + + // Fetch the next account number, and increment the internal counter. + GetNextAccountNumber(sdk.Context) uint64 +} + // AccountKeeper encodes/decodes accounts using the go-amino (binary) // encoding/decoding library. type AccountKeeper struct { @@ -26,7 +56,9 @@ type AccountKeeper struct { proto func() types.AccountI } -// NewAccountKeeper returns a new sdk.AccountKeeper that uses go-amino to +var _ AccountKeeperI = &AccountKeeper{} + +// NewAccountKeeper returns a new AccountKeeperI that uses go-amino to // (binary) encode and decode concrete sdk.Accounts. func NewAccountKeeper( cdc codec.BinaryMarshaler, key sdk.StoreKey, paramstore paramtypes.Subspace, proto func() types.AccountI, diff --git a/x/auth/spec/02_state.md b/x/auth/spec/02_state.md index 37afc5e03d..b9008603d1 100644 --- a/x/auth/spec/02_state.md +++ b/x/auth/spec/02_state.md @@ -15,30 +15,39 @@ Accounts are exposed externally as an interface, and stored internally as either a base account or vesting account. Module clients wishing to add more account types may do so. -- `0x01 | Address -> amino(account)` +- `0x01 | Address -> ProtocolBuffer(account)` ### Account Interface The account interface exposes methods to read and write standard account information. -Note that all of these methods operate on an account struct confirming to the interface -- in order to write the account to the store, the account keeper will need to be used. +Note that all of these methods operate on an account struct confirming to the +interface - in order to write the account to the store, the account keeper will +need to be used. ```go -type Account interface { - GetAddress() AccAddress - SetAddress(AccAddress) +// AccountI is an interface used to store coins at a given address within state. +// It presumes a notion of sequence numbers for replay protection, +// a notion of account numbers for replay protection for previously pruned accounts, +// and a pubkey for authentication purposes. +// +// Many complex conditions can be used in the concrete struct which implements AccountI. +type AccountI interface { + proto.Message - GetPubKey() PubKey - SetPubKey(PubKey) + GetAddress() sdk.AccAddress + SetAddress(sdk.AccAddress) error // errors if already set. - GetAccountNumber() uint64 - SetAccountNumber(uint64) + GetPubKey() crypto.PubKey // can return nil. + SetPubKey(crypto.PubKey) error - GetSequence() uint64 - SetSequence(uint64) + GetAccountNumber() uint64 + SetAccountNumber(uint64) error - GetCoins() Coins - SetCoins(Coins) + GetSequence() uint64 + SetSequence(uint64) error + + // Ensure that account implements stringer + String() string } ``` @@ -47,13 +56,15 @@ type Account interface { A base account is the simplest and most common account type, which just stores all requisite fields directly in a struct. -```go -type BaseAccount struct { - Address AccAddress - Coins Coins - PubKey PubKey - AccountNumber uint64 - Sequence uint64 +```protobuf +// 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). +message BaseAccount { + string address = 1; + google.protobuf.Any pub_key = 2; + uint64 account_number = 3; + uint64 sequence = 4; } ``` diff --git a/x/auth/spec/03_messages.md b/x/auth/spec/03_antehandlers.md similarity index 90% rename from x/auth/spec/03_messages.md rename to x/auth/spec/03_antehandlers.md index 37834d8d16..709cae3789 100644 --- a/x/auth/spec/03_messages.md +++ b/x/auth/spec/03_antehandlers.md @@ -2,16 +2,14 @@ order: 3 --> -# Messages - -TODO make this file conform to typical messages spec +# AnthHandlers ## Handlers The auth module presently has no transaction handlers of its own, but does expose the special `AnteHandler`, used for performing basic validity checks on a transaction, such that it could be thrown out of the mempool. Note that the ante handler is called on -`CheckTx`, but *also* on `DeliverTx`, as Tendermint proposers presently have the ability +`CheckTx`, but _also_ on `DeliverTx`, as Tendermint proposers presently have the ability to include in their proposed block transactions which fail `CheckTx`. ### Ante Handler diff --git a/x/auth/spec/03_types.md b/x/auth/spec/03_types.md deleted file mode 100644 index 5e768fc3b8..0000000000 --- a/x/auth/spec/03_types.md +++ /dev/null @@ -1,70 +0,0 @@ - - -# Types - -Besides accounts (specified in [State](02_state.md)), the types exposed by the auth module -are `StdFee`, the combination of an amount and gas limit, `StdSignature`, the combination -of an optional public key and a cryptographic signature as a byte array, `StdTx`, -a struct which implements the `sdk.Tx` interface using `StdFee` and `StdSignature`, and -`StdSignDoc`, a replay-prevention structure for `StdTx` which transaction senders must sign over. - -## StdFee - -A `StdFee` is simply the combination of a fee amount, in any number of denominations, -and a gas limit (where dividing the amount by the gas limit gives a "gas price"). - -```go -type StdFee struct { - Amount Coins - Gas uint64 -} -``` - -## StdSignature - -A `StdSignature` is the combination of an optional public key and a cryptographic signature -as a byte array. The SDK is agnostic to particular key or signature formats and supports any -supported by the `PubKey` interface. - -```go -type StdSignature struct { - PubKey PubKey - Signature []byte -} -``` - -## StdTx - -A `StdTx` is a struct which implements the `sdk.Tx` interface, and is likely to be generic -enough to serve the purposes of many Cosmos SDK blockchains. - -```go -type StdTx struct { - Msgs []sdk.Msg - Fee StdFee - Signatures []StdSignature - Memo string -} -``` - -## StdSignDoc - -A `StdSignDoc` is a replay-prevention structure to be signed over, which ensures that -any submitted transaction (which is simply a signature over a particular bytestring) -will only be executable once on a particular blockchain. - -`json.RawMessage` is preferred over using the SDK types for future compatibility. - -```go -type StdSignMsg struct { - ChainID string - AccountNumber uint64 - Sequence uint64 - TimeoutHeight uint64 - Fee StdFee - Msgs []sdk.Msg - Memo string -} -``` diff --git a/x/auth/spec/04_keepers.md b/x/auth/spec/04_keepers.md index e154e53830..f57988b4fa 100644 --- a/x/auth/spec/04_keepers.md +++ b/x/auth/spec/04_keepers.md @@ -12,32 +12,33 @@ Presently only one fully-permissioned account keeper is exposed, which has the a all fields of all accounts, and to iterate over all stored accounts. ```go -type AccountKeeper interface { - // Return a new account with the next account number and the specified address. Does not save the new account to the store. - NewAccountWithAddress(AccAddress) Account +// AccountKeeperI is the interface contract that x/auth's keeper implements. +type AccountKeeperI interface { + // Return a new account with the next account number and the specified address. Does not save the new account to the store. + NewAccountWithAddress(sdk.Context, sdk.AccAddress) types.AccountI - // Return a new account with the next account number. Does not save the new account to the store. - NewAccount(Account) Account + // Return a new account with the next account number. Does not save the new account to the store. + NewAccount(sdk.Context, types.AccountI) types.AccountI - // Retrieve an account from the store - GetAccount(AccAddress) Account + // Retrieve an account from the store. + GetAccount(sdk.Context, sdk.AccAddress) types.AccountI - // Set an account in the store - SetAccount(Account) + // Set an account in the store. + SetAccount(sdk.Context, types.AccountI) - // Remove an account from the store - RemoveAccount(Account) + // Remove an account from the store. + RemoveAccount(sdk.Context, types.AccountI) - // Iterate over all accounts, calling the provided function. Stop iteraiton when it returns false. - IterateAccounts(func(Account) (bool)) + // Iterate over all accounts, calling the provided function. Stop iteraiton when it returns false. + IterateAccounts(sdk.Context, func(types.AccountI) bool) - // Fetch the public key of an account at a specified address - GetPubKey(AccAddress) PubKey + // Fetch the public key of an account at a specified address + GetPubKey(sdk.Context, sdk.AccAddress) (crypto.PubKey, error) - // Fetch the sequence of an account at a specified address - GetSequence(AccAddress) uint64 + // Fetch the sequence of an account at a specified address. + GetSequence(sdk.Context, sdk.AccAddress) (uint64, error) - // Fetch the next account number, and increment the internal counter - GetNextAccountNumber() uint64 + // Fetch the next account number, and increment the internal counter. + GetNextAccountNumber(sdk.Context) uint64 } ``` diff --git a/x/auth/spec/07_params.md b/x/auth/spec/07_params.md index 6ef63ed121..93ddc89c22 100644 --- a/x/auth/spec/07_params.md +++ b/x/auth/spec/07_params.md @@ -7,7 +7,7 @@ order: 7 The auth module contains the following parameters: | Key | Type | Example | -|------------------------|-----------------|---------| +| ---------------------- | --------------- | ------- | | MaxMemoCharacters | string (uint64) | "256" | | TxSigLimit | string (uint64) | "7" | | TxSizeCostPerByte | string (uint64) | "10" | diff --git a/x/auth/spec/README.md b/x/auth/spec/README.md index ea49a9736e..f666e0923b 100644 --- a/x/auth/spec/README.md +++ b/x/auth/spec/README.md @@ -21,24 +21,19 @@ This module will be used in the Cosmos Hub. ## Contents 1. **[Concepts](01_concepts.md)** - - [Gas & Fees](01_concepts.md#gas-&-fees) + - [Gas & Fees](01_concepts.md#gas-&-fees) 2. **[State](02_state.md)** - - [Accounts](02_state.md#accounts) -3. **[Messages](03_messages.md)** - - [Handlers](03_messages.md#handlers) -4. **[Types](03_types.md)** - - [StdFee](03_types.md#stdfee) - - [StdSignature](03_types.md#stdsignature) - - [StdTx](03_types.md#stdtx) - - [StdSignDoc](03_types.md#stdsigndoc) -5. **[Keepers](04_keepers.md)** - - [Account Keeper](04_keepers.md#account-keeper) -6. **[Vesting](05_vesting.md)** - - [Intro and Requirements](05_vesting.md#intro-and-requirements) - - [Vesting Account Types](05_vesting.md#vesting-account-types) - - [Vesting Account Specification](05_vesting.md#vesting-account-specification) - - [Keepers & Handlers](05_vesting.md#keepers-&-handlers) - - [Genesis Initialization](05_vesting.md#genesis-initialization) - - [Examples](05_vesting.md#examples) - - [Glossary](05_vesting.md#glossary) -7. **[Parameters](07_params.md)** + - [Accounts](02_state.md#accounts) +3. **[AnteHandlers](03_antehandlers.md)** + - [Handlers](03_antehandlers.md#handlers) +4. **[Keepers](04_keepers.md)** + - [Account Keeper](04_keepers.md#account-keeper) +5. **[Vesting](05_vesting.md)** + - [Intro and Requirements](05_vesting.md#intro-and-requirements) + - [Vesting Account Types](05_vesting.md#vesting-account-types) + - [Vesting Account Specification](05_vesting.md#vesting-account-specification) + - [Keepers & Handlers](05_vesting.md#keepers-&-handlers) + - [Genesis Initialization](05_vesting.md#genesis-initialization) + - [Examples](05_vesting.md#examples) + - [Glossary](05_vesting.md#glossary) +6. **[Parameters](07_params.md)** diff --git a/x/bank/spec/01_state.md b/x/bank/spec/01_state.md new file mode 100644 index 0000000000..f744e2e779 --- /dev/null +++ b/x/bank/spec/01_state.md @@ -0,0 +1,11 @@ + + +# State + +The `x/bank` module keeps state of two primary objects, account balances and the +total supply of all balances. + +- Balances: `[]byte("balances") | []byte(address) / []byte(balance.Denom) -> ProtocolBuffer(balance)` +- Supply: `0x0 -> ProtocolBuffer(Supply)` diff --git a/x/bank/spec/02_keepers.md b/x/bank/spec/02_keepers.md new file mode 100644 index 0000000000..ec74358fbb --- /dev/null +++ b/x/bank/spec/02_keepers.md @@ -0,0 +1,123 @@ + + +# Keepers + +The bank module provides three different exported keeper interfaces which can be passed to other modules which need to read or update account balances. Modules should use the least-permissive interface which provides the functionality they require. + +Note that you should always review the `bank` module code to ensure that permissions are limited in the way that you expect. + +## Common Types + +### Input + +An input of a multiparty transfer + +```protobuf +// Input models transaction input. +message Input { + string address = 1; + repeated cosmos.base.v1beta1.Coin coins = 2; +} +``` + +### Output + +An output of a multiparty transfer. + +```protobuf +// Output models transaction outputs. +message Output { + string address = 1; + repeated cosmos.base.v1beta1.Coin coins = 2; +} +``` + +## BaseKeeper + +The base keeper provides full-permission access: the ability to arbitrary modify any account's balance and mint or burn coins. + +```go +// Keeper defines a module interface that facilitates the transfer of coins +// between accounts. +type Keeper interface { + SendKeeper + + InitGenesis(sdk.Context, types.GenesisState) + ExportGenesis(sdk.Context) *types.GenesisState + + GetSupply(ctx sdk.Context) exported.SupplyI + SetSupply(ctx sdk.Context, supply exported.SupplyI) + + GetDenomMetaData(ctx sdk.Context, denom string) types.Metadata + SetDenomMetaData(ctx sdk.Context, denomMetaData types.Metadata) + IterateAllDenomMetaData(ctx sdk.Context, cb func(types.Metadata) bool) + + SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + DelegateCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + UndelegateCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + + DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) error + UndelegateCoins(ctx sdk.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) error + MarshalSupply(supplyI exported.SupplyI) ([]byte, error) + UnmarshalSupply(bz []byte) (exported.SupplyI, error) + + types.QueryServer +} +``` + +## SendKeeper + +The send keeper provides access to account balances and the ability to transfer coins between accounts, but not to alter the total supply (mint or burn coins). + +```go +// SendKeeper defines a module interface that facilitates the transfer of coins +// between accounts without the possibility of creating coins. +type SendKeeper interface { + ViewKeeper + + InputOutputCoins(ctx sdk.Context, inputs []types.Input, outputs []types.Output) error + SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error + + SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) error + AddCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) error + + SetBalance(ctx sdk.Context, addr sdk.AccAddress, balance sdk.Coin) error + SetBalances(ctx sdk.Context, addr sdk.AccAddress, balances sdk.Coins) error + + GetParams(ctx sdk.Context) types.Params + SetParams(ctx sdk.Context, params types.Params) + + SendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool + SendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error + + BlockedAddr(addr sdk.AccAddress) bool +} +``` + +## ViewKeeper + +The view keeper provides read-only access to account balances but no balance alteration functionality. All balance lookups are `O(1)`. + +```go +// ViewKeeper defines a module interface that facilitates read only access to +// account balances. +type ViewKeeper interface { + ValidateBalance(ctx sdk.Context, addr sdk.AccAddress) error + HasBalance(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coin) bool + + GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + GetAccountsBalances(ctx sdk.Context) []types.Balance + GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + + IterateAccountBalances(ctx sdk.Context, addr sdk.AccAddress, cb func(coin sdk.Coin) (stop bool)) + IterateAllBalances(ctx sdk.Context, cb func(address sdk.AccAddress, coin sdk.Coin) (stop bool)) +} +``` diff --git a/x/bank/spec/03_messages.md b/x/bank/spec/03_messages.md new file mode 100644 index 0000000000..ecb9dc695f --- /dev/null +++ b/x/bank/spec/03_messages.md @@ -0,0 +1,32 @@ + + +# Messages + +## MsgSend + +```go +// MsgSend represents a message to send coins from one account to another. +message MsgSend { + string from_address = 1; + string to_address = 2; + repeated cosmos.base.v1beta1.Coin amount = 3; +} +``` + +`handleMsgSend` just runs `inputOutputCoins`. + +``` +handleMsgSend(msg MsgSend) + inputSum = 0 + for input in inputs + inputSum += input.Amount + outputSum = 0 + for output in outputs + outputSum += output.Amount + if inputSum != outputSum: + fail with "input/output amount mismatch" + + return inputOutputCoins(msg.Inputs, msg.Outputs) +``` diff --git a/x/bank/spec/04_events.md b/x/bank/spec/04_events.md new file mode 100644 index 0000000000..55c93b805e --- /dev/null +++ b/x/bank/spec/04_events.md @@ -0,0 +1,29 @@ + + +# Events + +The bank module emits the following events: + +## Handlers + +### MsgSend + +| Type | Attribute Key | Attribute Value | +| -------- | ------------- | ------------------ | +| transfer | recipient | {recipientAddress} | +| transfer | amount | {amount} | +| message | module | bank | +| message | action | send | +| message | sender | {senderAddress} | + +### MsgMultiSend + +| Type | Attribute Key | Attribute Value | +| -------- | ------------- | ------------------ | +| transfer | recipient | {recipientAddress} | +| transfer | amount | {amount} | +| message | module | bank | +| message | action | multisend | +| message | sender | {senderAddress} | diff --git a/x/bank/spec/05_params.md b/x/bank/spec/05_params.md new file mode 100644 index 0000000000..8d254243c4 --- /dev/null +++ b/x/bank/spec/05_params.md @@ -0,0 +1,24 @@ + + +# Parameters + +The bank module contains the following parameters: + +| Key | Type | Example | +| ------------------ | ------------- | ---------------------------------- | +| SendEnabled | []SendEnabled | [{denom: "stake", enabled: true }] | +| DefaultSendEnabled | bool | true | + +## SendEnabled + +The send enabled parameter is an array of SendEnabled entries mapping coin +denominations to their send_enabled status. Entries in this list take +precedence over the `DefaultSendEnabled` setting. + +## DefaultSendEnabled + +The default send enabled value controls send transfer capability for all +coin denominations unless specifically included in the array of `SendEnabled` +parameters. diff --git a/x/bank/spec/README.md b/x/bank/spec/README.md index 254488945c..9a1a0afb6e 100644 --- a/x/bank/spec/README.md +++ b/x/bank/spec/README.md @@ -1,26 +1,13 @@ + + # `x/bank` -## Table of Contents - - - -- **[01. Abstract](#01-abstract)** -- **[02. Concepts](#02-concepts)** - - [Supply](#supply) - - [Module Accounts](#module-accounts) -- **[03. State](#03-state)** -- **[04. Keepers](#04-keepers)** - - [Common Types](#common-types) - - [BaseKeeper](#basekeeper) - - [SendKeeper](#sendkeeper) - - [ViewKeeper](#viewkeeper) -- **[05. Messages](#05-messages)** - - [MsgSend](#msgsend) -- **[06. Events](#06-events)** - - [Handlers](#handlers) -- **[07. Parameters](#07-parameters)** - -## 01. Abstract +## Abstract This document specifies the bank module of the Cosmos SDK. @@ -35,46 +22,42 @@ supply of all assets used in the application. This module will be used in the Cosmos Hub. -## 02. Concepts +## Supply -### Supply - -The `supply` module: +The `supply` functionality: - passively tracks the total supply of coins within a chain, - provides a pattern for modules to hold/interact with `Coins`, and - introduces the invariant check to verify a chain's total supply. -#### Total Supply +### Total Supply The total `Supply` of the network is equal to the sum of all coins from the account. The total supply is updated every time a `Coin` is minted (eg: as part of the inflation mechanism) or burned (eg: due to slashing or if a governance proposal is vetoed). -### Module Accounts +## Module Accounts -The supply module introduces a new type of `auth.AccountI` interface, called `ModuleAccountI`, which can be used by +The supply functionality introduces a new type of `auth.Account` which can be used by modules to allocate tokens and in special cases mint or burn tokens. At a base level these module accounts are capable of sending/receiving tokens to and from -`auth.AccountI` interfaces and other module accounts. This design replaces previous +`auth.Account`s and other module accounts. This design replaces previous alternative designs where, to hold tokens, modules would burn the incoming tokens from the sender account, and then track those tokens internally. Later, in order to send tokens, the module would need to effectively mint tokens within a destination account. The new design removes duplicate logic between modules to perform this accounting. -The `ModuleAccountI` interface is defined as follows: +The `ModuleAccount` interface is defined as follows: ```go -// ModuleAccountI defines an account interface for modules that hold tokens in -// an escrow. -type ModuleAccountI interface { - AccountI // same methods as the Account interface +type ModuleAccount interface { + auth.Account // same methods as the Account interface - GetName() string // name of the module; used to obtain the address - GetPermissions() []string // permissions of module account - HasPermission(string) bool + GetName() string // name of the module; used to obtain the address + GetPermissions() []string // permissions of module account + HasPermission(string) bool } ``` @@ -82,20 +65,20 @@ type ModuleAccountI interface { > Any module or message handler that allows either direct or indirect sending of funds must explicitly guarantee those funds cannot be sent to module accounts (unless allowed). The supply `Keeper` also introduces new wrapper functions for the auth `Keeper` -and the bank `Keeper` that are related to `ModuleAccountI`s in order to be able +and the bank `Keeper` that are related to `ModuleAccount`s in order to be able to: -- Get and set `ModuleAccountI`s by providing the `Name`. -- Send coins from and to other `ModuleAccountI`s or standard `Account`s +- Get and set `ModuleAccount`s by providing the `Name`. +- Send coins from and to other `ModuleAccount`s or standard `Account`s (`BaseAccount` or `VestingAccount`) by passing only the `Name`. -- `Mint` or `Burn` coins for a `ModuleAccountI` (restricted to its permissions). +- `Mint` or `Burn` coins for a `ModuleAccount` (restricted to its permissions). -#### Permissions +### Permissions -Each `ModuleAccountI` has a different set of permissions that provide different +Each `ModuleAccount` has a different set of permissions that provide different object capabilities to perform certain actions. Permissions need to be registered upon the creation of the supply `Keeper` so that every time a -`ModuleAccountI` calls the allowed functions, the `Keeper` can lookup the +`ModuleAccount` calls the allowed functions, the `Keeper` can lookup the permissions to that specific account and perform or not the action. The available permissions are: @@ -104,217 +87,16 @@ The available permissions are: - `Burner`: allows for a module to burn a specific amount of coins. - `Staking`: allows for a module to delegate and undelegate a specific amount of coins. -## 03. State +## Contents -The `x/bank` module keeps state of two primary objects, account balances and the -total supply of all balances. - -- Balances: `[]byte("balances") | []byte(address) / []byte(balance.Denom) -> ProtocolBuffer(balance)` -- Supply: `0x0 -> ProtocolBuffer(Supply)` - -## 04. Keepers - -The bank module provides three different exported keeper interfaces which can be passed to other modules which need to read or update account balances. Modules should use the least-permissive interface which provides the functionality they require. - -Note that you should always review the `bank` module code to ensure that permissions are limited in the way that you expect. - -### Common Types - -#### Input - -An input of a multiparty transfer - -```protobuf -// Input models transaction input. -message Input { - string address = 1; - repeated cosmos.base.v1beta1.Coin coins = 2; -} -``` - -#### Output - -An output of a multiparty transfer. - -```protobuf -// Output models transaction outputs. -message Output { - string address = 1; - repeated cosmos.base.v1beta1.Coin coins = 2; -} -``` - -### BaseKeeper - -The base keeper provides full-permission access: the ability to arbitrary modify any account's balance and mint or burn coins. The `BaseKeeper` struct implements the following `Keeper` interface. - -```go -// Keeper defines a module interface that facilitates the transfer of coins -// between accounts. -type Keeper interface { - SendKeeper - - InitGenesis(sdk.Context, types.GenesisState) - ExportGenesis(sdk.Context) *types.GenesisState - - GetSupply(ctx sdk.Context) exported.SupplyI - SetSupply(ctx sdk.Context, supply exported.SupplyI) - - GetDenomMetaData(ctx sdk.Context, denom string) types.Metadata - SetDenomMetaData(ctx sdk.Context, denomMetaData types.Metadata) - IterateAllDenomMetaData(ctx sdk.Context, cb func(types.Metadata) bool) - - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - DelegateCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - UndelegateCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error - BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error - - DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) error - UndelegateCoins(ctx sdk.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) error - MarshalSupply(supplyI exported.SupplyI) ([]byte, error) - UnmarshalSupply(bz []byte) (exported.SupplyI, error) - - types.QueryServer -} -``` - -### SendKeeper - -The send keeper provides access to account balances and the ability to transfer coins between accounts, but not to alter the total supply (mint or burn coins). - -```go -// SendKeeper defines a module interface that facilitates the transfer of coins -// between accounts without the possibility of creating coins. -type SendKeeper interface { - ViewKeeper - - InputOutputCoins(ctx sdk.Context, inputs []types.Input, outputs []types.Output) error - SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error - - SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) error - AddCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) error - - SetBalance(ctx sdk.Context, addr sdk.AccAddress, balance sdk.Coin) error - SetBalances(ctx sdk.Context, addr sdk.AccAddress, balances sdk.Coins) error - - GetParams(ctx sdk.Context) types.Params - SetParams(ctx sdk.Context, params types.Params) - - SendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool - SendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error - - BlockedAddr(addr sdk.AccAddress) bool -} -``` - -### ViewKeeper - -The view keeper provides read-only access to account balances but no balance alteration functionality. All balance lookups are `O(1)`. - -```go -// ViewKeeper defines a module interface that facilitates read only access to -// account balances. -type ViewKeeper interface { - ValidateBalance(ctx sdk.Context, addr sdk.AccAddress) error - HasBalance(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coin) bool - - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - GetAccountsBalances(ctx sdk.Context) []types.Balance - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - - IterateAccountBalances(ctx sdk.Context, addr sdk.AccAddress, cb func(coin sdk.Coin) (stop bool)) - IterateAllBalances(ctx sdk.Context, cb func(address sdk.AccAddress, coin sdk.Coin) (stop bool)) -} -``` - -## 05. Messages - -### MsgSend - -```protobuf -// MsgSend represents a message to send coins from one account to another. -message MsgSend { - string from_address = 1; - string to_address = 2; - repeated cosmos.base.v1beta1.Coin amount = 3; -} -``` - -`handleMsgSend` just runs `inputOutputCoins`. - -``` -handleMsgSend(msg MsgSend) - inputSum = 0 - for input in inputs - inputSum += input.Amount - outputSum = 0 - for output in outputs - outputSum += output.Amount - if inputSum != outputSum: - fail with "input/output amount mismatch" - - return inputOutputCoins(msg.Inputs, msg.Outputs) -``` - -## 06. Events - -The bank module emits the following events: - -### Handlers - -#### MsgSend - -| Type | Attribute Key | Attribute Value | -| -------- | ------------- | ------------------ | -| transfer | recipient | {recipientAddress} | -| transfer | amount | {amount} | -| message | module | bank | -| message | action | send | -| message | sender | {senderAddress} | - -#### MsgMultiSend - -| Type | Attribute Key | Attribute Value | -| -------- | ------------- | ------------------ | -| transfer | recipient | {recipientAddress} | -| transfer | amount | {amount} | -| message | module | bank | -| message | action | multisend | -| message | sender | {senderAddress} | - -## 07. Parameters - -The bank module contains the following parameters: - -| Key | Type | Example | -| ------------------ | ------------- | ---------------------------------- | -| SendEnabled | []SendEnabled | [{denom: "stake", enabled: true }] | -| DefaultSendEnabled | bool | true | - -The corresponding Protobuf message is: - -```protobuf -// Params defines the parameters for the bank module. -message Params { - option = false; - repeated SendEnabled send_enabled = 1; - bool default_send_enabled = 2; -} -``` - -### SendEnabled - -The send enabled parameter is an array of SendEnabled entries mapping coin -denominations to their send_enabled status. Entries in this list take -precedence over the `DefaultSendEnabled` setting. - -### DefaultSendEnabled - -The default send enabled value controls send transfer capability for all -coin denominations unless specifically included in the array of `SendEnabled` -parameters. +1. **[State](01_state.md)** +2. **[Keepers](02_keepers.md)** + - [Common Types](02_keepers.md#common-types) + - [BaseKeeper](02_keepers.md#basekeeper) + - [SendKeeper](02_keepers.md#sendkeeper) + - [ViewKeeper](02_keepers.md#viewkeeper) +3. **[Messages](03_messages.md)** + - [MsgSend](03_messages.md#msgsend) +4. **[Events](04_events.md)** + - [Handlers](04_events.md#handlers) +5. **[Parameters](05_params.md)** diff --git a/x/evidence/spec/01_concepts.md b/x/evidence/spec/01_concepts.md new file mode 100644 index 0000000000..736e75c9a6 --- /dev/null +++ b/x/evidence/spec/01_concepts.md @@ -0,0 +1,75 @@ + + +# Concepts + +## Evidence + +Any concrete type of evidence submitted to the `x/evidence` module must fulfill the +`Evidence` contract outlined below. Not all concrete types of evidence will fulfill +this contract in the same way and some data may be entirely irrelevant to certain +types of evidence. An additional `ValidatorEvidence`, which extends `Evidence`, +has also been created to define a contract for evidence against malicious validators. + +```go +// Evidence defines the contract which concrete evidence types of misbehavior +// must implement. +type Evidence interface { + Route() string + Type() string + String() string + Hash() tmbytes.HexBytes + ValidateBasic() error + + // Height at which the infraction occurred + GetHeight() int64 +} + +// ValidatorEvidence extends Evidence interface to define contract +// for evidence against malicious validators +type ValidatorEvidence interface { + Evidence + + // The consensus address of the malicious validator at time of infraction + GetConsensusAddress() sdk.ConsAddress + + // The total power of the malicious validator at time of infraction + GetValidatorPower() int64 + + // The total validator set power at time of infraction + GetTotalPower() int64 +} +``` + +## Registration & Handling + +The `x/evidence` module must first know about all types of evidence it is expected +to handle. This is accomplished by registering the `Route` method in the `Evidence` +contract with what is known as a `Router` (defined below). The `Router` accepts +`Evidence` and attempts to find the corresponding `Handler` for the `Evidence` +via the `Route` method. + +```go +type Router interface { + AddRoute(r string, h Handler) Router + HasRoute(r string) bool + GetRoute(path string) Handler + Seal() + Sealed() bool +} +``` + +The `Handler` (defined below) is responsible for executing the entirety of the +business logic for handling `Evidence`. This typically includes validating the +evidence, both stateless checks via `ValidateBasic` and stateful checks via any +keepers provided to the `Handler`. In addition, the `Handler` may also perform +capabilities such as slashing and jailing a validator. + +```go +// Handler defines an agnostic Evidence handler. The handler is responsible +// for executing all corresponding business logic necessary for verifying the +// evidence as valid. In addition, the Handler may execute any necessary +// slashing and potential jailing. +type Handler func(Context, Evidence) error +``` diff --git a/x/evidence/spec/02_state.md b/x/evidence/spec/02_state.md new file mode 100644 index 0000000000..00d8d05bed --- /dev/null +++ b/x/evidence/spec/02_state.md @@ -0,0 +1,19 @@ + + +# State + +Currently the `x/evidence` module only stores valid submitted `Evidence` in state. +The evidence state is also stored and exported in the `x/evidence` module's `GenesisState`. + +```protobuf +// GenesisState defines the evidence module's genesis state. +message GenesisState { + // evidence defines all the evidence at genesis. + repeated google.protobuf.Any evidence = 1; +} + +``` + +All `Evidence` is retrieved and stored via a prefix `KVStore` using prefix `0x00` (`KeyPrefixEvidence`). diff --git a/x/evidence/spec/03_messages.md b/x/evidence/spec/03_messages.md new file mode 100644 index 0000000000..85a8228905 --- /dev/null +++ b/x/evidence/spec/03_messages.md @@ -0,0 +1,48 @@ + + +# Messages + +## MsgSubmitEvidence + +Evidence is submitted through a `MsgSubmitEvidence` message: + +```protobuf +// MsgSubmitEvidence represents a message that supports submitting arbitrary +// Evidence of misbehavior such as equivocation or counterfactual signing. +message MsgSubmitEvidence { + string submitter = 1; + google.protobuf.Any evidence = 2; +} +``` + +Note, the `Evidence` of a `MsgSubmitEvidence` message must have a corresponding +`Handler` registered with the `x/evidence` module's `Router` in order to be processed +and routed correctly. + +Given the `Evidence` is registered with a corresponding `Handler`, it is processed +as follows: + +```go +func SubmitEvidence(ctx Context, evidence Evidence) error { + if _, ok := GetEvidence(ctx, evidence.Hash()); ok { + return ErrEvidenceExists(codespace, evidence.Hash().String()) + } + if !router.HasRoute(evidence.Route()) { + return ErrNoEvidenceHandlerExists(codespace, evidence.Route()) + } + + handler := router.GetRoute(evidence.Route()) + if err := handler(ctx, evidence); err != nil { + return ErrInvalidEvidence(codespace, err.Error()) + } + + SetEvidence(ctx, evidence) + return nil +} +``` + +First, there must not already exist valid submitted `Evidence` of the exact same +type. Secondly, the `Evidence` is routed to the `Handler` and executed. Finally, +if there is no error in handling the `Evidence`, it is persisted to state. diff --git a/x/evidence/spec/04_events.md b/x/evidence/spec/04_events.md new file mode 100644 index 0000000000..35fd77b3f5 --- /dev/null +++ b/x/evidence/spec/04_events.md @@ -0,0 +1,18 @@ + + +# Events + +The `x/evidence` module emits the following events: + +## Handlers + +### MsgSubmitEvidence + +| Type | Attribute Key | Attribute Value | +| --------------- | ------------- | --------------- | +| submit_evidence | evidence_hash | {evidenceHash} | +| message | module | evidence | +| message | sender | {senderAddress} | +| message | action | submit_evidence | diff --git a/x/evidence/spec/05_params.md b/x/evidence/spec/05_params.md new file mode 100644 index 0000000000..4c48b540af --- /dev/null +++ b/x/evidence/spec/05_params.md @@ -0,0 +1,7 @@ + + +# Parameters + +The evidence module does not contain any parameters. diff --git a/x/evidence/spec/06_begin_block.md b/x/evidence/spec/06_begin_block.md new file mode 100644 index 0000000000..317b5523ee --- /dev/null +++ b/x/evidence/spec/06_begin_block.md @@ -0,0 +1,155 @@ + + +# BeginBlock + +## Evidence Handling + +Tendermint blocks can include +[Evidence](https://github.com/tendermint/tendermint/blob/master/docs/spec/blockchain/blockchain.md#evidence), +which indicates that a validator committed malicious behavior. The relevant information is +forwarded to the application as ABCI Evidence in `abci.RequestBeginBlock` so that +the validator an be accordingly punished. + +### Equivocation + +Currently, the SDK handles two types of evidence inside ABCI's `BeginBlock`: + +- `DuplicateVoteEvidence`, +- `LightClientAttackEvidence`. + +These two evidence types are handled the same way by the evidence module. First, the SDK converts the Tendermint concrete evidence type to a SDK `Evidence` interface using `Equivocation` as the concrete type. + +```proto +// Equivocation implements the Evidence interface. +message Equivocation { + int64 height = 1; + google.protobuf.Timestamp time = 2; + int64 power = 3; + string consensus_address = 4; +} +``` + +For some `Equivocation` submitted in `block` to be valid, it must satisfy: + +`Evidence.Timestamp >= block.Timestamp - MaxEvidenceAge` + +Where `Evidence.Timestamp` is the timestamp in the block at height `Evidence.Height` and +`block.Timestamp` is the current block timestamp. + +If valid `Equivocation` evidence is included in a block, the validator's stake is +reduced (slashed) by `SlashFractionDoubleSign`, which is defined by the `x/slashing` module, +of what their stake was when the infraction occurred (rather than when the evidence was discovered). +We want to "follow the stake", i.e. the stake which contributed to the infraction +should be slashed, even if it has since been redelegated or started unbonding. + +In addition, the validator is permanently jailed and tombstoned making it impossible for that +validator to ever re-enter the validator set. + +The `Equivocation` evidence is handled as follows: + +```go +func (k Keeper) HandleEquivocationEvidence(ctx sdk.Context, evidence *types.Equivocation) { + logger := k.Logger(ctx) + consAddr := evidence.GetConsensusAddress() + + if _, err := k.slashingKeeper.GetPubkey(ctx, consAddr.Bytes()); err != nil { + // Ignore evidence that cannot be handled. + // + // NOTE: We used to panic with: + // `panic(fmt.Sprintf("Validator consensus-address %v not found", consAddr))`, + // but this couples the expectations of the app to both Tendermint and + // the simulator. Both are expected to provide the full range of + // allowable but none of the disallowed evidence types. Instead of + // getting this coordination right, it is easier to relax the + // constraints and ignore evidence that cannot be handled. + return + } + + // calculate the age of the evidence + infractionHeight := evidence.GetHeight() + infractionTime := evidence.GetTime() + ageDuration := ctx.BlockHeader().Time.Sub(infractionTime) + ageBlocks := ctx.BlockHeader().Height - infractionHeight + + // Reject evidence if the double-sign is too old. Evidence is considered stale + // if the difference in time and number of blocks is greater than the allowed + // parameters defined. + cp := ctx.ConsensusParams() + if cp != nil && cp.Evidence != nil { + if ageDuration > cp.Evidence.MaxAgeDuration && ageBlocks > cp.Evidence.MaxAgeNumBlocks { + logger.Info( + "ignored equivocation; evidence too old", + "validator", consAddr, + "infraction_height", infractionHeight, + "max_age_num_blocks", cp.Evidence.MaxAgeNumBlocks, + "infraction_time", infractionTime, + "max_age_duration", cp.Evidence.MaxAgeDuration, + ) + return + } + } + + validator := k.stakingKeeper.ValidatorByConsAddr(ctx, consAddr) + if validator == nil || validator.IsUnbonded() { + // Defensive: Simulation doesn't take unbonding periods into account, and + // Tendermint might break this assumption at some point. + return + } + + if ok := k.slashingKeeper.HasValidatorSigningInfo(ctx, consAddr); !ok { + panic(fmt.Sprintf("expected signing info for validator %s but not found", consAddr)) + } + + // ignore if the validator is already tombstoned + if k.slashingKeeper.IsTombstoned(ctx, consAddr) { + logger.Info( + "ignored equivocation; validator already tombstoned", + "validator", consAddr, + "infraction_height", infractionHeight, + "infraction_time", infractionTime, + ) + return + } + + logger.Info( + "confirmed equivocation", + "validator", consAddr, + "infraction_height", infractionHeight, + "infraction_time", infractionTime, + ) + + // We need to retrieve the stake distribution which signed the block, so we + // subtract ValidatorUpdateDelay from the evidence height. + // Note, that this *can* result in a negative "distributionHeight", up to + // -ValidatorUpdateDelay, i.e. at the end of the + // pre-genesis block (none) = at the beginning of the genesis block. + // That's fine since this is just used to filter unbonding delegations & redelegations. + distributionHeight := infractionHeight - sdk.ValidatorUpdateDelay + + // Slash validator. The `power` is the int64 power of the validator as provided + // to/by Tendermint. This value is validator.Tokens as sent to Tendermint via + // ABCI, and now received as evidence. The fraction is passed in to separately + // to slash unbonding and rebonding delegations. + k.slashingKeeper.Slash( + ctx, + consAddr, + k.slashingKeeper.SlashFractionDoubleSign(ctx), + evidence.GetValidatorPower(), distributionHeight, + ) + + // Jail the validator if not already jailed. This will begin unbonding the + // validator if not already unbonding (tombstoned). + if !validator.IsJailed() { + k.slashingKeeper.Jail(ctx, consAddr) + } + + k.slashingKeeper.JailUntil(ctx, consAddr, types.DoubleSignJailEndTime) + k.slashingKeeper.Tombstone(ctx, consAddr) +} +``` + +Note, the slashing, jailing, and tombstoning calls are delegated through the `x/slashing` module +which emit informative events and finally delegate calls to the `x/staking` module. Documentation +on slashing and jailing can be found in the [x/staking spec](/.././cosmos-sdk/x/staking/spec/02_state_transitions.md) diff --git a/x/evidence/spec/README.md b/x/evidence/spec/README.md index b94a73ffd1..dd72780164 100644 --- a/x/evidence/spec/README.md +++ b/x/evidence/spec/README.md @@ -1,18 +1,24 @@ + + # `x/evidence` ## Table of Contents -- **[01. Abstract](#01-abstract)** -- **[02. Concepts](#02-concepts)** -- **[03. State](#03-state)** -- **[04. Messages](#04-messages)** -- **[05. Events](#05-events)** -- **[06. Parameters](#06-parameters)** -- **[07. BeginBlock](#07-beginblock)** +1. **[Concepts](01_concepts.md)** +2. **[State](02_state.md)** +3. **[Messages](03_messages.md)** +4. **[Events](04_events.md)** +5. **[Params](05_params.md)** +6. **[BeginBlock](06_begin_block.md)** -## 01. Abstract +## Abstract `x/evidence` is an implementation of a Cosmos SDK module, per [ADR 009](./../../../docs/architecture/adr-009-evidence-module.md), that allows for the submission and handling of arbitrary evidence of misbehavior such @@ -32,253 +38,3 @@ keeper in order for it to be successfully routed and executed. Each corresponding handler must also fulfill the `Handler` interface contract. The `Handler` for a given `Evidence` type can perform any arbitrary state transitions such as slashing, jailing, and tombstoning. - -## 02. Concepts - -### Evidence - -Any concrete type of evidence submitted to the `x/evidence` module must fulfill the -`Evidence` contract outlined below. Not all concrete types of evidence will fulfill -this contract in the same way and some data may be entirely irrelevant to certain -types of evidence. An additional `ValidatorEvidence`, which extends `Evidence`, has also -been created to define a contract for evidence against malicious validators. - -```go -// Evidence defines the contract which concrete evidence types of misbehavior -// must implement. -type Evidence interface { - Route() string - Type() string - String() string - Hash() tmbytes.HexBytes - ValidateBasic() error - - // Height at which the infraction occurred - GetHeight() int64 -} - -// ValidatorEvidence extends Evidence interface to define contract -// for evidence against malicious validators -type ValidatorEvidence interface { - Evidence - - // The consensus address of the malicious validator at time of infraction - GetConsensusAddress() sdk.ConsAddress - - // The total power of the malicious validator at time of infraction - GetValidatorPower() int64 - - // The total validator set power at time of infraction - GetTotalPower() int64 -} -``` - -### Registration & Handling - -The `x/evidence` module must first know about all types of evidence it is expected -to handle. This is accomplished by registering the `Route` method in the `Evidence` -contract with what is known as a `Router` (defined below). The `Router` accepts -`Evidence` and attempts to find the corresponding `Handler` for the `Evidence` -via the `Route` method. - -```go -// Router defines a contract for which any Evidence handling module must -// implement in order to route Evidence to registered Handlers. -type Router interface { - AddRoute(r string, h Handler) Router - HasRoute(r string) bool - GetRoute(path string) Handler - Seal() - Sealed() bool -} -``` - -The `Handler` (defined below) is responsible for executing the entirety of the -business logic for handling `Evidence`. This typically includes validating the -evidence, both stateless checks via `ValidateBasic` and stateful checks via any -keepers provided to the `Handler`. In addition, the `Handler` may also perform -capabilities such as slashing and jailing a validator. - -```go -// Handler defines an agnostic Evidence handler. The handler is responsible -// for executing all corresponding business logic necessary for verifying the -// evidence as valid. In addition, the Handler may execute any necessary -// slashing and potential jailing. -type Handler func(Context, Evidence) error -``` - -## 03. State - -Currently the `x/evidence` module only stores valid submitted `Evidence` in state. -The evidence state is also stored and exported in the `x/evidence` module's `GenesisState`. - -```protobuf -// GenesisState defines the evidence module's genesis state. -message GenesisState { - // evidence defines all the evidence at genesis. - repeated google.protobuf.Any evidence = 1; -} -``` - -All `Evidence` is retrieved and stored via a prefix `KVStore` using prefix `0x00` (`KeyPrefixEvidence`). - -## 04. Messages - -### MsgSubmitEvidence - -Evidence is submitted through a `MsgSubmitEvidence` message: - -```protobuf -// MsgSubmitEvidence represents a message that supports submitting arbitrary -// Evidence of misbehavior such as equivocation or counterfactual signing. -message MsgSubmitEvidence { - string submitter = 1; - google.protobuf.Any evidence = 2; -} -``` - -Note, the `Evidence` of a `MsgSubmitEvidence` message must have a corresponding -`Handler` registered with the `x/evidence` module's `Router` in order to be processed -and routed correctly. - -Given the `Evidence` is registered with a corresponding `Handler`, it is processed -as follows: - -```go -func SubmitEvidence(ctx Context, evidence Evidence) error { - if _, ok := GetEvidence(ctx, evidence.Hash()); ok { - return ErrEvidenceExists(codespace, evidence.Hash().String()) - } - if !router.HasRoute(evidence.Route()) { - return ErrNoEvidenceHandlerExists(codespace, evidence.Route()) - } - - handler := router.GetRoute(evidence.Route()) - if err := handler(ctx, evidence); err != nil { - return ErrInvalidEvidence(codespace, err.Error()) - } - - SetEvidence(ctx, evidence) - return nil -} -``` - -First, there must not already exist valid submitted `Evidence` of the exact same -type. Secondly, the `Evidence` is routed to the `Handler` and executed. Finally, -if there is no error in handling the `Evidence`, it is persisted to state. - -## 05. Events - -The `x/evidence` module emits the following events: - -### Handlers - -#### MsgSubmitEvidence - -| Type | Attribute Key | Attribute Value | -| --------------- | ------------- | --------------- | -| submit_evidence | evidence_hash | {evidenceHash} | -| message | module | evidence | -| message | sender | {senderAddress} | -| message | action | submit_evidence | - -## 06. Parameters - -The evidence module does not have any parameters. - -## 07. BeginBlock - -### Evidence Handling - -Tendermint blocks can include -[Evidence](https://github.com/tendermint/tendermint/blob/master/docs/spec/blockchain/blockchain.md#evidence), -which indicates that a validator committed malicious behavior. The relevant information is -forwarded to the application as ABCI Evidence in `abci.RequestBeginBlock` so that -the validator an be accordingly punished. - -#### Equivocation - -Currently, the evidence module only handles evidence of type `Equivocation` which is derived from -Tendermint's `ABCIEvidenceTypeDuplicateVote` during `BeginBlock`. - -For some `Equivocation` submitted in `block` to be valid, it must satisfy: - -`Evidence.Timestamp >= block.Timestamp - MaxEvidenceAge` - -Where `Evidence.Timestamp` is the timestamp in the block at height `Evidence.Height` and -`block.Timestamp` is the current block timestamp. - -If valid `Equivocation` evidence is included in a block, the validator's stake is -reduced (slashed) by `SlashFractionDoubleSign`, which is defined by the `x/slashing` module, -of what their stake was when the infraction occurred (rather than when the evidence was discovered). -We want to "follow the stake", i.e. the stake which contributed to the infraction -should be slashed, even if it has since been redelegated or started unbonding. - -In addition, the validator is permanently jailed and tombstoned making it impossible for that -validator to ever re-enter the validator set. - -The `Equivocation` evidence is handled as follows: - -```go -func (k Keeper) HandleDoubleSign(ctx Context, evidence Equivocation) { - consAddr := evidence.GetConsensusAddress() - infractionHeight := evidence.GetHeight() - - // calculate the age of the evidence - blockTime := ctx.BlockHeader().Time - age := blockTime.Sub(evidence.GetTime()) - - // reject evidence we cannot handle - if _, err := k.slashingKeeper.GetPubkey(ctx, consAddr.Bytes()); err != nil { - return - } - - // reject evidence if it is too old - if age > k.MaxEvidenceAge(ctx) { - return - } - - // reject evidence if the validator is already unbonded - validator := k.stakingKeeper.ValidatorByConsAddr(ctx, consAddr) - if validator == nil || validator.IsUnbonded() { - return - } - - // verify the validator has signing info in order to be slashed and tombstoned - if ok := k.slashingKeeper.HasValidatorSigningInfo(ctx, consAddr); !ok { - panic(...) - } - - // reject evidence if the validator is already tombstoned - if k.slashingKeeper.IsTombstoned(ctx, consAddr) { - return - } - - // We need to retrieve the stake distribution which signed the block, so we - // subtract ValidatorUpdateDelay from the evidence height. - // Note, that this *can* result in a negative "distributionHeight", up to - // -ValidatorUpdateDelay, i.e. at the end of the - // pre-genesis block (none) = at the beginning of the genesis block. - // That's fine since this is just used to filter unbonding delegations & redelegations. - distributionHeight := infractionHeight - sdk.ValidatorUpdateDelay - - // Slash validator. The `power` is the int64 power of the validator as provided - // to/by Tendermint. This value is validator.Tokens as sent to Tendermint via - // ABCI, and now received as evidence. The fraction is passed in to separately - // to slash unbonding and rebonding delegations. - k.slashingKeeper.Slash(ctx, consAddr, evidence.GetValidatorPower(), distributionHeight) - - // Jail the validator if not already jailed. This will begin unbonding the - // validator if not already unbonding (tombstoned). - if !validator.IsJailed() { - k.slashingKeeper.Jail(ctx, consAddr) - } - - k.slashingKeeper.JailUntil(ctx, consAddr, types.DoubleSignJailEndTime) - k.slashingKeeper.Tombstone(ctx, consAddr) -} -``` - -Note, the slashing, jailing, and tombstoning calls are delegated through the `x/slashing` module -which emit informative events and finally delegate calls to the `x/staking` module. Documentation -on slashing and jailing can be found in the [x/staking spec](/.././cosmos-sdk/x/staking/spec/02_state_transitions.md) diff --git a/x/slashing/spec/01_concepts.md b/x/slashing/spec/01_concepts.md index b38a6edbed..9505706f90 100644 --- a/x/slashing/spec/01_concepts.md +++ b/x/slashing/spec/01_concepts.md @@ -8,8 +8,8 @@ order: 1 At any given time, there are any number of validators registered in the state machine. Each block, the top `MaxValidators` (defined by `x/staking`) validators -who are not jailed become *bonded*, meaning that they may propose and vote on -blocks. Validators who are *bonded* are *at stake*, meaning that part or all of +who are not jailed become _bonded_, meaning that they may propose and vote on +blocks. Validators who are _bonded_ are _at stake_, meaning that part or all of their stake and their delegators' stake is at risk if they commit a protocol fault. For each of these validators we keep a `ValidatorSigningInfo` record that contains @@ -20,26 +20,26 @@ attributes. In order to mitigate the impact of initially likely categories of non-malicious protocol faults, the Cosmos Hub implements for each validator -a *tombstone* cap, which only allows a validator to be slashed once for a double +a _tombstone_ cap, which only allows a validator to be slashed once for a double sign fault. For example, if you misconfigure your HSM and double-sign a bunch of old blocks, you'll only be punished for the first double-sign (and then immediately tombstombed). This will still be quite expensive and desirable to avoid, but tombstone caps somewhat blunt the economic impact of unintentional misconfiguration. -Liveness faults do not have caps, as they can't stack upon each other. Liveness bugs are "detected" as soon as the infraction occurs, and the validators are immediately put in jail, so it is not possible for them to commit multiple liveness faults without unjailing in between. +Liveness faults do not have caps, as they can't stack upon each other. Liveness bugs are "detected" as soon as the infraction occurs, and the validators are immediately put in jail, so it is not possible for them to commit multiple liveness faults without unjailing in between. ## Infraction Timelines To illustrate how the `x/slashing` module handles submitted evidence through Tendermint consensus, consider the following examples: -__Definitions__: +**Definitions**: -*[* : timeline start -*]* : timeline end -*Cn* : infraction `n` committed -*Dn* : infraction `n` discovered -*Vb* : validator bonded -*Vu* : validator unbonded +_[_ : timeline start +_]_ : timeline end +_Cn_ : infraction `n` committed +_Dn_ : infraction `n` discovered +_Vb_ : validator bonded +_Vu_ : validator unbonded ### Single Double Sign Infraction diff --git a/x/slashing/spec/02_state.md b/x/slashing/spec/02_state.md index 867fa79983..17931ce866 100644 --- a/x/slashing/spec/02_state.md +++ b/x/slashing/spec/02_state.md @@ -40,27 +40,35 @@ bonded validator. The `SignedBlocksWindow` parameter defines the size The information stored for tracking validator liveness is as follows: -```go -type ValidatorSigningInfo struct { - Address sdk.ConsAddress - StartHeight int64 - IndexOffset int64 - JailedUntil time.Time - Tombstoned bool - MissedBlocksCounter int64 +```protobuf +// ValidatorSigningInfo defines a validator's signing info for monitoring their +// liveness activity. +message ValidatorSigningInfo { + string address = 1; + // height at which validator was first a candidate OR was unjailed + int64 start_height = 2; + // index offset into signed block bit array + int64 index_offset = 3; + // timestamp validator cannot be unjailed until + google.protobuf.Timestamp jailed_until = 4; + // whether or not a validator has been tombstoned (killed out of validator + // set) + bool tombstoned = 5; + // missed blocks counter (to avoid scanning the array every time) + int64 missed_blocks_counter = 6; } ``` Where: -- __Address__: The validator's consensus address. -- __StartHeight__: The height that the candidate became an active validator +- **Address**: The validator's consensus address. +- **StartHeight**: The height that the candidate became an active validator (with non-zero voting power). -- __IndexOffset__: Index which is incremented each time the validator was a bonded +- **IndexOffset**: Index which is incremented each time the validator was a bonded in a block and may have signed a precommit or not. This in conjunction with the `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. -- __JailedUntil__: Time for which the validator is jailed until due to liveness downtime. -- __Tombstoned__: Desribes if the validator is tombstoned or not. It is set once the +- **JailedUntil**: Time for which the validator is jailed until due to liveness downtime. +- **Tombstoned**: Desribes if the validator is tombstoned or not. It is set once the validator commits an equivocation or for any other configured misbehiavor. -- __MissedBlocksCounter__: A counter kept to avoid unnecessary array reads. Note +- **MissedBlocksCounter**: A counter kept to avoid unnecessary array reads. Note that `Sum(MissedBlocksBitArray)` equals `MissedBlocksCounter` always. diff --git a/x/slashing/spec/03_messages.md b/x/slashing/spec/03_messages.md index d7825bfd0b..6e7d168ffd 100644 --- a/x/slashing/spec/03_messages.md +++ b/x/slashing/spec/03_messages.md @@ -9,15 +9,21 @@ In this section we describe the processing of messages for the `slashing` module ## Unjail If a validator was automatically unbonded due to downtime and wishes to come back online & -possibly rejoin the bonded set, it must send `TxUnjail`: +possibly rejoin the bonded set, it must send `MsgUnjail`: + +```protobuf +// MsgUnjail is an sdk.Msg used for unjailing a jailed validator, thus returning +// them into the bonded validator set, so they can begin receiving provisions +// and rewards again. +message MsgUnjail { + string validator_addr = 1; +} +``` + +And below is its corresponding handler: ``` -type TxUnjail struct { - ValidatorAddr sdk.AccAddress -} - -handleMsgUnjail(tx TxUnjail) - +handleMsgUnjail(tx MsgUnjail) validator = getValidator(tx.ValidatorAddr) if validator == nil fail with "No validator found" diff --git a/x/slashing/spec/04_begin_block.md b/x/slashing/spec/04_begin_block.md index 96d1217f19..99572c419f 100644 --- a/x/slashing/spec/04_begin_block.md +++ b/x/slashing/spec/04_begin_block.md @@ -23,7 +23,7 @@ greater than `minHeight` and the validator's `MissedBlocksCounter` is greater th for `DowntimeJailDuration`, and have the following values reset: `MissedBlocksBitArray`, `MissedBlocksCounter`, and `IndexOffset`. -__Note__: Liveness slashes do **NOT** lead to a tombstombing. +**Note**: Liveness slashes do **NOT** lead to a tombstombing. ```go height := block.Height diff --git a/x/slashing/spec/05_hooks.md b/x/slashing/spec/05_hooks.md index adb8da39b0..8f78cdff01 100644 --- a/x/slashing/spec/05_hooks.md +++ b/x/slashing/spec/05_hooks.md @@ -25,6 +25,6 @@ onValidatorBonded(address sdk.ValAddress) } setValidatorSigningInfo(signingInfo) } - + return ``` diff --git a/x/slashing/spec/07_tombstone.md b/x/slashing/spec/07_tombstone.md index a062278cec..4759a89b71 100644 --- a/x/slashing/spec/07_tombstone.md +++ b/x/slashing/spec/07_tombstone.md @@ -15,18 +15,18 @@ and evidence of the infraction reaching the state machine (this is one of the primary reasons for the existence of the unbonding period). > Note: The tombstone concept, only applies to faults that have a delay between -the infraction occurring and evidence reaching the state machine. For example, -evidence of a validator double signing may take a while to reach the state machine -due to unpredictable evidence gossip layer delays and the ability of validators to -selectively reveal double-signatures (e.g. to infrequently-online light clients). -Liveness slashing, on the other hand, is detected immediately as soon as the -infraction occurs, and therefore no slashing period is needed. A validator is -immediately put into jail period, and they cannot commit another liveness fault -until they unjail. In the future, there may be other types of byzantine faults -that have delays (for example, submitting evidence of an invalid proposal as a transaction). -When implemented, it will have to be decided whether these future types of -byzantine faults will result in a tombstoning (and if not, the slash amounts -will not be capped by a slashing period). +> the infraction occurring and evidence reaching the state machine. For example, +> evidence of a validator double signing may take a while to reach the state machine +> due to unpredictable evidence gossip layer delays and the ability of validators to +> selectively reveal double-signatures (e.g. to infrequently-online light clients). +> Liveness slashing, on the other hand, is detected immediately as soon as the +> infraction occurs, and therefore no slashing period is needed. A validator is +> immediately put into jail period, and they cannot commit another liveness fault +> until they unjail. In the future, there may be other types of byzantine faults +> that have delays (for example, submitting evidence of an invalid proposal as a transaction). +> When implemented, it will have to be decided whether these future types of +> byzantine faults will result in a tombstoning (and if not, the slash amounts +> will not be capped by a slashing period). In the current system design, once a validator is put in the jail for a consensus fault, after the `JailPeriod` they are allowed to send a transaction to `unjail` @@ -72,10 +72,10 @@ As the number of slashing periods increase, it creates more complexity as we hav to keep track of the highest infraction amount for every single slashing period. > Note: Currently, according to the `slashing` module spec, a new slashing period -is created every time a validator is unbonded then rebonded. This should probably -be changed to jailed/unjailed. See issue [#3205](https://github.com/cosmos/cosmos-sdk/issues/3205) -for further details. For the remainder of this, I will assume that we only start -a new slashing period when a validator gets unjailed. +> is created every time a validator is unbonded then rebonded. This should probably +> be changed to jailed/unjailed. See issue [#3205](https://github.com/cosmos/cosmos-sdk/issues/3205) +> for further details. For the remainder of this, I will assume that we only start +> a new slashing period when a validator gets unjailed. The maximum number of slashing periods is the `len(UnbondingPeriod) / len(JailPeriod)`. The current defaults in Gaia for the `UnbondingPeriod` and `JailPeriod` are 3 weeks @@ -85,7 +85,7 @@ we only have to track 1 slashing period (i.e not have to track slashing periods) Currently, in the jail period implementation, once a validator unjails, all of their delegators who are delegated to them (haven't unbonded / redelegated away), -stay with them. Given that consensus safety faults are so egregious +stay with them. Given that consensus safety faults are so egregious (way more so than liveness faults), it is probably prudent to have delegators not "auto-rebond" to the validator. Thus, we propose setting the "jail time" for a validator who commits a consensus safety fault, to `infinite` (i.e. a tombstone state). @@ -93,7 +93,7 @@ This essentially kicks the validator out of the validator set and does not allow them to re-enter the validator set. All of their delegators (including the operator themselves) have to either unbond or redelegate away. The validator operator can create a new validator if they would like, with a new operator key and consensus key, but they -have to "re-earn" their delegations back. To put the validator in the tombstone +have to "re-earn" their delegations back. To put the validator in the tombstone state, we set `DoubleSignJailEndTime` to `time.Unix(253402300800)`, the maximum time supported by Amino. @@ -106,7 +106,7 @@ of the hooks defined in the `slashing` module consumed by the `staking` module Another optimization that can be made is that if we assume that all ABCI faults for Tendermint consensus are slashed at the same level, we don't have to keep -track of "max slash". Once an ABCI fault happens, we don't have to worry about +track of "max slash". Once an ABCI fault happens, we don't have to worry about comparing potential future ones to find the max. Currently the only Tendermint ABCI fault is: @@ -121,5 +121,5 @@ Given that these faults are both attributable byzantine faults, we will likely want to slash them equally, and thus we can enact the above change. > Note: This change may make sense for current Tendermint consensus, but maybe -not for a different consensus algorithm or future versions of Tendermint that -may want to punish at different levels (for example, partial slashing). +> not for a different consensus algorithm or future versions of Tendermint that +> may want to punish at different levels (for example, partial slashing). diff --git a/x/slashing/spec/README.md b/x/slashing/spec/README.md index 7f694d03d3..2263065623 100644 --- a/x/slashing/spec/README.md +++ b/x/slashing/spec/README.md @@ -5,7 +5,7 @@ parent: title: "slashing" --> -# `slashing` +# `x/slashing` ## Abstract @@ -25,21 +25,21 @@ This module will be used by the Cosmos Hub, the first hub in the Cosmos ecosyste ## Contents 1. **[Concepts](01_concepts.md)** - - [States](01_concepts.md#states) - - [Tombstone Caps](01_concepts.md#tombstone-caps) - - [ASCII timelines](01_concepts.md#ascii-timelines) + - [States](01_concepts.md#states) + - [Tombstone Caps](01_concepts.md#tombstone-caps) + - [ASCII timelines](01_concepts.md#ascii-timelines) 2. **[State](02_state.md)** - - [Signing Info](02_state.md#signing-info) + - [Signing Info](02_state.md#signing-info) 3. **[Messages](03_messages.md)** - - [Unjail](03_messages.md#unjail) + - [Unjail](03_messages.md#unjail) 4. **[Begin-Block](04_begin_block.md)** - - [Evidence handling](04_begin_block.md#evidence-handling) - - [Uptime tracking](04_begin_block.md#uptime-tracking) + - [Evidence handling](04_begin_block.md#evidence-handling) + - [Uptime tracking](04_begin_block.md#uptime-tracking) 5. **[05_hooks.md](05_hooks.md)** - - [Hooks](05_hooks.md#hooks) + - [Hooks](05_hooks.md#hooks) 6. **[Events](06_events.md)** - - [BeginBlocker](06_events.md#beginblocker) - - [Handlers](06_events.md#handlers) + - [BeginBlocker](06_events.md#beginblocker) + - [Handlers](06_events.md#handlers) 7. **[Staking Tombstone](07_tombstone.md)** - - [Abstract](07_tombstone.md#abstract) + - [Abstract](07_tombstone.md#abstract) 8. **[Parameters](08_params.md)** From 6e569e125571c6b0918ea97d1c7aa7384525eb2e Mon Sep 17 00:00:00 2001 From: atheeshp <59333759+atheeshp@users.noreply.github.com> Date: Fri, 16 Oct 2020 18:34:02 +0530 Subject: [PATCH 41/84] Refactor x/{gov, crisis} according to ADR 031 (#7533) * Refactor x/gov according to ADR 31 * fix tests * Refactor x/crisis according to ADR 031 * fix lint * lint * lint * review changes * lint * review change * fic doc Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- proto/cosmos/crisis/v1beta1/tx.proto | 9 + proto/cosmos/gov/v1beta1/tx.proto | 37 +- x/crisis/handler.go | 73 +-- x/crisis/keeper/msg_server.go | 78 ++++ x/crisis/types/tx.pb.go | 226 +++++++++- x/gov/abci_test.go | 13 +- x/gov/handler.go | 124 +----- x/gov/keeper/msg_server.go | 128 ++++++ x/gov/types/msgs.go | 19 +- x/gov/types/tx.pb.go | 642 +++++++++++++++++++++++++-- 10 files changed, 1099 insertions(+), 250 deletions(-) create mode 100644 x/crisis/keeper/msg_server.go create mode 100644 x/gov/keeper/msg_server.go diff --git a/proto/cosmos/crisis/v1beta1/tx.proto b/proto/cosmos/crisis/v1beta1/tx.proto index 5c77a6a491..c6156b8a72 100644 --- a/proto/cosmos/crisis/v1beta1/tx.proto +++ b/proto/cosmos/crisis/v1beta1/tx.proto @@ -5,6 +5,12 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; import "gogoproto/gogo.proto"; +// Msg defines the bank Msg service. +service Msg { + // VerifyInvariant defines a method to verify a particular invariance. + rpc VerifyInvariant(MsgVerifyInvariant) returns (MsgVerifyInvariantResponse); +} + // MsgVerifyInvariant represents a message to verify a particular invariance. message MsgVerifyInvariant { option (gogoproto.equal) = false; @@ -14,3 +20,6 @@ message MsgVerifyInvariant { string invariant_module_name = 2 [(gogoproto.moretags) = "yaml:\"invariant_module_name\""]; string invariant_route = 3 [(gogoproto.moretags) = "yaml:\"invariant_route\""]; } + +// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. +message MsgVerifyInvariantResponse { } diff --git a/proto/cosmos/gov/v1beta1/tx.proto b/proto/cosmos/gov/v1beta1/tx.proto index 01e3bf2be0..5c0560757d 100644 --- a/proto/cosmos/gov/v1beta1/tx.proto +++ b/proto/cosmos/gov/v1beta1/tx.proto @@ -8,14 +8,26 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = false; -option (gogoproto.goproto_getters_all) = false; + +// Msg defines the bank Msg service. +service Msg { + // SubmitProposal defines a method to create new proposal given a content. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // Vote defines a method to add a vote on a specific proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // Deposit defines a method to add deposit on a specific proposal. + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); +} // MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary // proposal Content. message 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 [ @@ -26,21 +38,38 @@ message MsgSubmitProposal { string proposer = 3; } +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; +} + // MsgVote defines a message to cast a vote. message MsgVote { 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", (gogoproto.moretags) = "yaml:\"proposal_id\""]; string voter = 2; VoteOption option = 3; } +// MsgVoteResponse defines the Msg/Vote response type. +message MsgVoteResponse {} + // MsgDeposit defines a message to submit a deposit to an existing proposal. message 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", (gogoproto.moretags) = "yaml:\"proposal_id\""]; string depositor = 2; repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} \ No newline at end of file +} + +// MsgDepositResponse defines the Msg/Deposit response type. +message MsgDepositResponse {} diff --git a/x/crisis/handler.go b/x/crisis/handler.go index eee27a95c1..0e6cf985f8 100644 --- a/x/crisis/handler.go +++ b/x/crisis/handler.go @@ -3,90 +3,23 @@ package crisis import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/crisis/keeper" "github.com/cosmos/cosmos-sdk/x/crisis/types" ) // RouterKey const RouterKey = types.ModuleName -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k types.MsgServer) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { case *types.MsgVerifyInvariant: - return handleMsgVerifyInvariant(ctx, msg, k) + res, err := k.VerifyInvariant(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized crisis message type: %T", msg) } } } - -func handleMsgVerifyInvariant(ctx sdk.Context, msg *types.MsgVerifyInvariant, k keeper.Keeper) (*sdk.Result, error) { - constantFee := sdk.NewCoins(k.GetConstantFee(ctx)) - - sender, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return nil, err - } - if err := k.SendCoinsFromAccountToFeeCollector(ctx, sender, constantFee); err != nil { - return nil, err - } - - // use a cached context to avoid gas costs during invariants - cacheCtx, _ := ctx.CacheContext() - - found := false - msgFullRoute := msg.FullInvariantRoute() - - var res string - var stop bool - for _, invarRoute := range k.Routes() { - if invarRoute.FullRoute() == msgFullRoute { - res, stop = invarRoute.Invar(cacheCtx) - found = true - - break - } - } - - if !found { - return nil, types.ErrUnknownInvariant - } - - if stop { - // NOTE currently, because the chain halts here, this transaction will never be included - // in the blockchain thus the constant fee will have never been deducted. Thus no - // refund is required. - - // TODO uncomment the following code block with implementation of the circuit breaker - //// refund constant fee - //err := k.distrKeeper.DistributeFromFeePool(ctx, constantFee, msg.Sender) - //if err != nil { - //// if there are insufficient coins to refund, log the error, - //// but still halt the chain. - //logger := ctx.Logger().With("module", "x/crisis") - //logger.Error(fmt.Sprintf( - //"WARNING: insufficient funds to allocate to sender from fee pool, err: %s", err)) - //} - - // TODO replace with circuit breaker - panic(res) - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeInvariant, - sdk.NewAttribute(types.AttributeKeyRoute, msg.InvariantRoute), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCrisis), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), - ), - }) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} diff --git a/x/crisis/keeper/msg_server.go b/x/crisis/keeper/msg_server.go new file mode 100644 index 0000000000..304f8b1724 --- /dev/null +++ b/x/crisis/keeper/msg_server.go @@ -0,0 +1,78 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/crisis/types" +) + +var _ types.MsgServer = Keeper{} + +func (k Keeper) VerifyInvariant(goCtx context.Context, msg *types.MsgVerifyInvariant) (*types.MsgVerifyInvariantResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + constantFee := sdk.NewCoins(k.GetConstantFee(ctx)) + + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, err + } + if err := k.SendCoinsFromAccountToFeeCollector(ctx, sender, constantFee); err != nil { + return nil, err + } + + // use a cached context to avoid gas costs during invariants + cacheCtx, _ := ctx.CacheContext() + + found := false + msgFullRoute := msg.FullInvariantRoute() + + var res string + var stop bool + for _, invarRoute := range k.Routes() { + if invarRoute.FullRoute() == msgFullRoute { + res, stop = invarRoute.Invar(cacheCtx) + found = true + + break + } + } + + if !found { + return nil, types.ErrUnknownInvariant + } + + if stop { + // NOTE currently, because the chain halts here, this transaction will never be included + // in the blockchain thus the constant fee will have never been deducted. Thus no + // refund is required. + + // TODO uncomment the following code block with implementation of the circuit breaker + //// refund constant fee + //err := k.distrKeeper.DistributeFromFeePool(ctx, constantFee, msg.Sender) + //if err != nil { + //// if there are insufficient coins to refund, log the error, + //// but still halt the chain. + //logger := ctx.Logger().With("module", "x/crisis") + //logger.Error(fmt.Sprintf( + //"WARNING: insufficient funds to allocate to sender from fee pool, err: %s", err)) + //} + + // TODO replace with circuit breaker + panic(res) + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeInvariant, + sdk.NewAttribute(types.AttributeKeyRoute, msg.InvariantRoute), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCrisis), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + ), + }) + + return &types.MsgVerifyInvariantResponse{}, nil +} diff --git a/x/crisis/types/tx.pb.go b/x/crisis/types/tx.pb.go index 64102a50d0..7fed79516c 100644 --- a/x/crisis/types/tx.pb.go +++ b/x/crisis/types/tx.pb.go @@ -4,9 +4,14 @@ package types import ( + context "context" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -63,14 +68,52 @@ func (m *MsgVerifyInvariant) XXX_DiscardUnknown() { var xxx_messageInfo_MsgVerifyInvariant proto.InternalMessageInfo +// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. +type MsgVerifyInvariantResponse struct { +} + +func (m *MsgVerifyInvariantResponse) Reset() { *m = MsgVerifyInvariantResponse{} } +func (m *MsgVerifyInvariantResponse) String() string { return proto.CompactTextString(m) } +func (*MsgVerifyInvariantResponse) ProtoMessage() {} +func (*MsgVerifyInvariantResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_61276163172fe867, []int{1} +} +func (m *MsgVerifyInvariantResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVerifyInvariantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVerifyInvariantResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgVerifyInvariantResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVerifyInvariantResponse.Merge(m, src) +} +func (m *MsgVerifyInvariantResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgVerifyInvariantResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVerifyInvariantResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVerifyInvariantResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgVerifyInvariant)(nil), "cosmos.crisis.v1beta1.MsgVerifyInvariant") + proto.RegisterType((*MsgVerifyInvariantResponse)(nil), "cosmos.crisis.v1beta1.MsgVerifyInvariantResponse") } func init() { proto.RegisterFile("cosmos/crisis/v1beta1/tx.proto", fileDescriptor_61276163172fe867) } var fileDescriptor_61276163172fe867 = []byte{ - // 276 bytes of a gzipped FileDescriptorProto + // 318 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xca, 0x2c, 0xce, 0x2c, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xc8, 0xeb, 0x41, @@ -83,12 +126,96 @@ var fileDescriptor_61276163172fe867 = []byte{ 0x94, 0x82, 0x84, 0xe1, 0xe2, 0xbe, 0x60, 0x61, 0xbf, 0xc4, 0xdc, 0x54, 0x21, 0x67, 0x2e, 0x7e, 0x84, 0xf2, 0xa2, 0xfc, 0xd2, 0x92, 0x54, 0x09, 0x66, 0xb0, 0x79, 0x52, 0x9f, 0xee, 0xc9, 0x8b, 0xa1, 0x9b, 0x07, 0x56, 0xa0, 0x14, 0xc4, 0x07, 0x17, 0x09, 0x02, 0x09, 0x58, 0x71, 0x74, 0x2c, - 0x90, 0x67, 0x78, 0xb1, 0x40, 0x9e, 0xc1, 0xc9, 0xf5, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, - 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, - 0xe5, 0x18, 0xa2, 0xb4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x61, - 0xa1, 0x08, 0xa6, 0x74, 0x8b, 0x53, 0xb2, 0xf5, 0x2b, 0x60, 0x41, 0x5a, 0x52, 0x59, 0x90, 0x5a, - 0x9c, 0xc4, 0x06, 0x0e, 0x21, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x29, 0x57, 0x7a, 0x12, - 0x70, 0x01, 0x00, 0x00, + 0x90, 0x67, 0x78, 0xb1, 0x40, 0x9e, 0x41, 0x49, 0x86, 0x4b, 0x0a, 0xd3, 0x4b, 0x41, 0xa9, 0xc5, + 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x46, 0x65, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x42, 0xf9, 0x5c, 0xfc, + 0xe8, 0x9e, 0xd6, 0xd4, 0xc3, 0x1a, 0x72, 0x7a, 0x98, 0x86, 0x49, 0x19, 0x12, 0xad, 0x14, 0x66, + 0xaf, 0x93, 0xeb, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, + 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x69, 0xa7, 0x67, + 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xc3, 0xe2, 0x16, 0x4c, 0xe9, 0x16, 0xa7, + 0x64, 0xeb, 0x57, 0xc0, 0x22, 0xba, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0x6f, 0xc6, + 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9c, 0x60, 0x68, 0x5a, 0x06, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // VerifyInvariant defines a method to verify a particular invariance. + VerifyInvariant(ctx context.Context, in *MsgVerifyInvariant, opts ...grpc.CallOption) (*MsgVerifyInvariantResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) VerifyInvariant(ctx context.Context, in *MsgVerifyInvariant, opts ...grpc.CallOption) (*MsgVerifyInvariantResponse, error) { + out := new(MsgVerifyInvariantResponse) + err := c.cc.Invoke(ctx, "/cosmos.crisis.v1beta1.Msg/VerifyInvariant", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // VerifyInvariant defines a method to verify a particular invariance. + VerifyInvariant(context.Context, *MsgVerifyInvariant) (*MsgVerifyInvariantResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) VerifyInvariant(ctx context.Context, req *MsgVerifyInvariant) (*MsgVerifyInvariantResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyInvariant not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_VerifyInvariant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgVerifyInvariant) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).VerifyInvariant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.crisis.v1beta1.Msg/VerifyInvariant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).VerifyInvariant(ctx, req.(*MsgVerifyInvariant)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.crisis.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "VerifyInvariant", + Handler: _Msg_VerifyInvariant_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/crisis/v1beta1/tx.proto", } func (m *MsgVerifyInvariant) Marshal() (dAtA []byte, err error) { @@ -135,6 +262,29 @@ func (m *MsgVerifyInvariant) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgVerifyInvariantResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgVerifyInvariantResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVerifyInvariantResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -167,6 +317,15 @@ func (m *MsgVerifyInvariant) Size() (n int) { return n } +func (m *MsgVerifyInvariantResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -322,6 +481,59 @@ func (m *MsgVerifyInvariant) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgVerifyInvariantResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgVerifyInvariantResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVerifyInvariantResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index bfe5ceac54..70a172ee1b 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "github.com/golang/protobuf/proto" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -172,7 +173,11 @@ func TestTickPassedDepositPeriod(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - proposalID := types.GetProposalIDFromBytes(res.Data) + var proposalData types.MsgSubmitProposalResponse + err = proto.Unmarshal(res.Data, &proposalData) + require.NoError(t, err) + + proposalID := proposalData.ProposalId inactiveQueue = app.GovKeeper.InactiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) require.False(t, inactiveQueue.Valid()) @@ -224,7 +229,11 @@ func TestTickPassedVotingPeriod(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - proposalID := types.GetProposalIDFromBytes(res.Data) + var proposalData types.MsgSubmitProposalResponse + err = proto.Unmarshal(res.Data, &proposalData) + require.NoError(t, err) + + proposalID := proposalData.ProposalId newHeader := ctx.BlockHeader() newHeader.Time = ctx.BlockHeader().Time.Add(time.Duration(1) * time.Second) diff --git a/x/gov/handler.go b/x/gov/handler.go index 5eacdaf10f..25d97bfabb 100644 --- a/x/gov/handler.go +++ b/x/gov/handler.go @@ -1,12 +1,6 @@ package gov import ( - "fmt" - "strconv" - - metrics "github.com/armon/go-metrics" - - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/keeper" @@ -14,125 +8,27 @@ import ( ) // NewHandler creates an sdk.Handler for all the gov type messages -func NewHandler(keeper keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) sdk.Handler { + msgServer := keeper.NewMsgServerImpl(k) + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { case *types.MsgDeposit: - return handleMsgDeposit(ctx, keeper, msg) + res, err := msgServer.Deposit(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) - case types.MsgSubmitProposalI: - return handleMsgSubmitProposal(ctx, keeper, msg) + case *types.MsgSubmitProposal: + res, err := msgServer.SubmitProposal(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgVote: - return handleMsgVote(ctx, keeper, msg) + res, err := msgServer.Vote(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } } } - -func handleMsgSubmitProposal(ctx sdk.Context, keeper keeper.Keeper, msg types.MsgSubmitProposalI) (*sdk.Result, error) { - proposal, err := keeper.SubmitProposal(ctx, msg.GetContent()) - if err != nil { - return nil, err - } - - defer telemetry.IncrCounter(1, types.ModuleName, "proposal") - - votingStarted, err := keeper.AddDeposit(ctx, proposal.ProposalId, msg.GetProposer(), msg.GetInitialDeposit()) - if err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.GetProposer().String()), - ), - ) - - submitEvent := sdk.NewEvent(types.EventTypeSubmitProposal, sdk.NewAttribute(types.AttributeKeyProposalType, msg.GetContent().ProposalType())) - if votingStarted { - submitEvent = submitEvent.AppendAttributes( - sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", proposal.ProposalId)), - ) - } - - ctx.EventManager().EmitEvent(submitEvent) - - return &sdk.Result{ - Data: types.GetProposalIDBytes(proposal.ProposalId), - Events: ctx.EventManager().ABCIEvents(), - }, nil -} - -func handleMsgDeposit(ctx sdk.Context, keeper keeper.Keeper, msg *types.MsgDeposit) (*sdk.Result, error) { - accAddr, err := sdk.AccAddressFromBech32(msg.Depositor) - if err != nil { - return nil, err - } - votingStarted, err := keeper.AddDeposit(ctx, msg.ProposalId, accAddr, msg.Amount) - if err != nil { - return nil, err - } - - defer telemetry.IncrCounterWithLabels( - []string{types.ModuleName, "deposit"}, - 1, - []metrics.Label{ - telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), - }, - ) - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Depositor), - ), - ) - - if votingStarted { - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeProposalDeposit, - sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", msg.ProposalId)), - ), - ) - } - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgVote(ctx sdk.Context, keeper keeper.Keeper, msg *types.MsgVote) (*sdk.Result, error) { - accAddr, accErr := sdk.AccAddressFromBech32(msg.Voter) - if accErr != nil { - return nil, accErr - } - err := keeper.AddVote(ctx, msg.ProposalId, accAddr, msg.Option) - if err != nil { - return nil, err - } - - defer telemetry.IncrCounterWithLabels( - []string{types.ModuleName, "vote"}, - 1, - []metrics.Label{ - telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), - }, - ) - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Voter), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go new file mode 100644 index 0000000000..aee3d3c380 --- /dev/null +++ b/x/gov/keeper/msg_server.go @@ -0,0 +1,128 @@ +package keeper + +import ( + "context" + "fmt" + "strconv" + + "github.com/armon/go-metrics" + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the gov MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +func (k msgServer) SubmitProposal(goCtx context.Context, msg *types.MsgSubmitProposal) (*types.MsgSubmitProposalResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + proposal, err := k.Keeper.SubmitProposal(ctx, msg.GetContent()) + if err != nil { + return nil, err + } + + defer telemetry.IncrCounter(1, types.ModuleName, "proposal") + + votingStarted, err := k.Keeper.AddDeposit(ctx, proposal.ProposalId, msg.GetProposer(), msg.GetInitialDeposit()) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.GetProposer().String()), + ), + ) + + submitEvent := sdk.NewEvent(types.EventTypeSubmitProposal, sdk.NewAttribute(types.AttributeKeyProposalType, msg.GetContent().ProposalType())) + if votingStarted { + submitEvent = submitEvent.AppendAttributes( + sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", proposal.ProposalId)), + ) + } + + ctx.EventManager().EmitEvent(submitEvent) + return &types.MsgSubmitProposalResponse{ + ProposalId: proposal.ProposalId, + }, nil +} + +func (k msgServer) Vote(goCtx context.Context, msg *types.MsgVote) (*types.MsgVoteResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + accAddr, accErr := sdk.AccAddressFromBech32(msg.Voter) + if accErr != nil { + return nil, accErr + } + err := k.Keeper.AddVote(ctx, msg.ProposalId, accAddr, msg.Option) + if err != nil { + return nil, err + } + + defer telemetry.IncrCounterWithLabels( + []string{types.ModuleName, "vote"}, + 1, + []metrics.Label{ + telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), + }, + ) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Voter), + ), + ) + + return &types.MsgVoteResponse{}, nil +} + +func (k msgServer) Deposit(goCtx context.Context, msg *types.MsgDeposit) (*types.MsgDepositResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + accAddr, err := sdk.AccAddressFromBech32(msg.Depositor) + if err != nil { + return nil, err + } + votingStarted, err := k.Keeper.AddDeposit(ctx, msg.ProposalId, accAddr, msg.Amount) + if err != nil { + return nil, err + } + + defer telemetry.IncrCounterWithLabels( + []string{types.ModuleName, "deposit"}, + 1, + []metrics.Label{ + telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), + }, + ) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Depositor), + ), + ) + + if votingStarted { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeProposalDeposit, + sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", msg.ProposalId)), + ), + ) + } + + return &types.MsgDepositResponse{}, nil +} diff --git a/x/gov/types/msgs.go b/x/gov/types/msgs.go index 42c4ceafd1..e97c25ce8f 100644 --- a/x/gov/types/msgs.go +++ b/x/gov/types/msgs.go @@ -21,26 +21,9 @@ const ( var ( _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{} - _ MsgSubmitProposalI = &MsgSubmitProposal{} _ types.UnpackInterfacesMessage = &MsgSubmitProposal{} ) -// MsgSubmitProposalI defines the specific interface a concrete message must -// implement in order to process governance proposals. The concrete MsgSubmitProposal -// must be defined at the application-level. -type MsgSubmitProposalI interface { - sdk.Msg - - GetContent() Content - SetContent(Content) error - - GetInitialDeposit() sdk.Coins - SetInitialDeposit(sdk.Coins) - - GetProposer() sdk.AccAddress - SetProposer(sdk.AccAddress) -} - // NewMsgSubmitProposal creates a new MsgSubmitProposal. //nolint:interfacer func NewMsgSubmitProposal(content Content, initialDeposit sdk.Coins, proposer sdk.AccAddress) (*MsgSubmitProposal, error) { @@ -74,7 +57,7 @@ func (m *MsgSubmitProposal) SetInitialDeposit(coins sdk.Coins) { m.InitialDeposit = coins } -func (m *MsgSubmitProposal) SetProposer(address sdk.AccAddress) { +func (m *MsgSubmitProposal) SetProposer(address fmt.Stringer) { m.Proposer = address.String() } diff --git a/x/gov/types/tx.pb.go b/x/gov/types/tx.pb.go index a16cc62aa5..c1391e12ef 100644 --- a/x/gov/types/tx.pb.go +++ b/x/gov/types/tx.pb.go @@ -4,13 +4,18 @@ package types import ( + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" + grpc1 "github.com/gogo/protobuf/grpc" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types1 "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" _ "github.com/regen-network/cosmos-proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -67,6 +72,51 @@ func (m *MsgSubmitProposal) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitProposal proto.InternalMessageInfo +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +type MsgSubmitProposalResponse struct { + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"` +} + +func (m *MsgSubmitProposalResponse) Reset() { *m = MsgSubmitProposalResponse{} } +func (m *MsgSubmitProposalResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitProposalResponse) ProtoMessage() {} +func (*MsgSubmitProposalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []int{1} +} +func (m *MsgSubmitProposalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitProposalResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSubmitProposalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitProposalResponse.Merge(m, src) +} +func (m *MsgSubmitProposalResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitProposalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitProposalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitProposalResponse proto.InternalMessageInfo + +func (m *MsgSubmitProposalResponse) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + // MsgVote defines a message to cast a vote. type MsgVote struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"` @@ -77,7 +127,7 @@ type MsgVote struct { func (m *MsgVote) Reset() { *m = MsgVote{} } func (*MsgVote) ProtoMessage() {} func (*MsgVote) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{1} + return fileDescriptor_3c053992595e3dce, []int{2} } func (m *MsgVote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -106,6 +156,43 @@ func (m *MsgVote) XXX_DiscardUnknown() { var xxx_messageInfo_MsgVote proto.InternalMessageInfo +// MsgVoteResponse defines the Msg/Vote response type. +type MsgVoteResponse struct { +} + +func (m *MsgVoteResponse) Reset() { *m = MsgVoteResponse{} } +func (m *MsgVoteResponse) String() string { return proto.CompactTextString(m) } +func (*MsgVoteResponse) ProtoMessage() {} +func (*MsgVoteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []int{3} +} +func (m *MsgVoteResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVoteResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgVoteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVoteResponse.Merge(m, src) +} +func (m *MsgVoteResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgVoteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVoteResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVoteResponse proto.InternalMessageInfo + // MsgDeposit defines a message to submit a deposit to an existing proposal. type MsgDeposit struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"` @@ -116,7 +203,7 @@ type MsgDeposit struct { func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } func (*MsgDeposit) ProtoMessage() {} func (*MsgDeposit) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{2} + return fileDescriptor_3c053992595e3dce, []int{4} } func (m *MsgDeposit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -145,48 +232,251 @@ func (m *MsgDeposit) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDeposit proto.InternalMessageInfo +// MsgDepositResponse defines the Msg/Deposit response type. +type MsgDepositResponse struct { +} + +func (m *MsgDepositResponse) Reset() { *m = MsgDepositResponse{} } +func (m *MsgDepositResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDepositResponse) ProtoMessage() {} +func (*MsgDepositResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []int{5} +} +func (m *MsgDepositResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDepositResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgDepositResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDepositResponse.Merge(m, src) +} +func (m *MsgDepositResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDepositResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDepositResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1beta1.MsgSubmitProposal") + proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1beta1.MsgSubmitProposalResponse") proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1beta1.MsgVote") + proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1beta1.MsgVoteResponse") proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1beta1.MsgDeposit") + proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1beta1.MsgDepositResponse") } func init() { proto.RegisterFile("cosmos/gov/v1beta1/tx.proto", fileDescriptor_3c053992595e3dce) } var fileDescriptor_3c053992595e3dce = []byte{ - // 498 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0x31, 0x8b, 0x13, 0x41, - 0x14, 0xde, 0x4d, 0xce, 0xc4, 0x9b, 0xc0, 0x89, 0x43, 0x90, 0x5c, 0x3c, 0x66, 0xc3, 0x82, 0x90, - 0xe6, 0x66, 0xbd, 0x08, 0x16, 0x67, 0x65, 0x4e, 0x04, 0x85, 0xa8, 0xac, 0x60, 0x61, 0x13, 0x76, - 0x37, 0xeb, 0x38, 0x98, 0x9d, 0xb7, 0x64, 0x26, 0xe1, 0xd2, 0x09, 0xf6, 0xe2, 0x4f, 0xb0, 0xb1, - 0xb1, 0xf6, 0x47, 0x04, 0xab, 0x2b, 0xaf, 0x31, 0x7a, 0x49, 0x23, 0x96, 0xf7, 0x0b, 0x64, 0x67, - 0x66, 0xcf, 0x43, 0x45, 0x11, 0xac, 0x92, 0xf7, 0xbe, 0xf9, 0xbe, 0xf9, 0xbe, 0xf7, 0x66, 0xd1, - 0xd5, 0x04, 0x64, 0x06, 0x32, 0x60, 0x30, 0x0b, 0x66, 0x7b, 0x71, 0xaa, 0xa2, 0xbd, 0x40, 0x1d, - 0xd2, 0x7c, 0x02, 0x0a, 0x30, 0x36, 0x20, 0x65, 0x30, 0xa3, 0x16, 0x6c, 0x13, 0x4b, 0x88, 0x23, - 0x99, 0x9e, 0x31, 0x12, 0xe0, 0xc2, 0x70, 0xda, 0x3b, 0xbf, 0x11, 0x2c, 0xf8, 0x06, 0xdd, 0x36, - 0xe8, 0x50, 0x57, 0x81, 0x95, 0x37, 0x50, 0x93, 0x01, 0x03, 0xd3, 0x2f, 0xfe, 0x95, 0x04, 0x06, - 0xc0, 0xc6, 0x69, 0xa0, 0xab, 0x78, 0xfa, 0x2c, 0x88, 0xc4, 0xdc, 0x40, 0xfe, 0xab, 0x0a, 0xba, - 0x3c, 0x90, 0xec, 0xf1, 0x34, 0x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0xba, 0x37, 0xc2, 0x4d, 0x74, 0x61, 0x06, 0x2a, - 0x9d, 0xb4, 0x2a, 0xfa, 0x4a, 0x53, 0xe0, 0x9b, 0xa8, 0x06, 0xb9, 0xe2, 0x20, 0xb4, 0x93, 0xad, - 0x1e, 0xa1, 0xbf, 0x3e, 0x0f, 0x5a, 0xf8, 0x78, 0xa8, 0x4f, 0x85, 0xf6, 0xb4, 0xf5, 0xf9, 0xc9, - 0x45, 0x68, 0x20, 0x59, 0x19, 0xec, 0x7f, 0x59, 0xdd, 0x41, 0x9b, 0x76, 0xd0, 0x50, 0xda, 0xfd, - 0xd1, 0xc0, 0x09, 0xaa, 0x45, 0x19, 0x4c, 0x85, 0x6a, 0x55, 0xff, 0xb6, 0xc5, 0xeb, 0xc5, 0x16, - 0xff, 0x69, 0x57, 0x56, 0xda, 0xe4, 0xeb, 0x3f, 0x58, 0x9c, 0x10, 0xe7, 0xf8, 0x84, 0x38, 0x2f, - 0x57, 0xc4, 0x59, 0xac, 0x88, 0x7b, 0xb4, 0x22, 0xee, 0x97, 0x15, 0x71, 0xdf, 0xac, 0x89, 0x73, - 0xb4, 0x26, 0xce, 0xf1, 0x9a, 0x38, 0x4f, 0xff, 0xac, 0x7e, 0xa8, 0xbf, 0x1a, 0x7d, 0x47, 0x5c, - 0xd3, 0xcf, 0xf5, 0xc6, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x32, 0xb4, 0xbb, 0xa1, 0x03, - 0x00, 0x00, + // 586 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xbf, 0x6f, 0xd3, 0x40, + 0x14, 0xb6, 0x93, 0xd2, 0xd0, 0x8b, 0x94, 0xd2, 0x53, 0x84, 0x12, 0xb7, 0xb2, 0x23, 0xa3, 0xa2, + 0x2c, 0xb1, 0x69, 0x90, 0x18, 0xca, 0x44, 0x8a, 0x10, 0x20, 0x45, 0x80, 0x91, 0x18, 0x58, 0x22, + 0xdb, 0x71, 0x8d, 0x45, 0xe2, 0x67, 0xe5, 0x2e, 0x51, 0xb3, 0x31, 0x22, 0x06, 0x60, 0x64, 0xcc, + 0xcc, 0x86, 0xc4, 0x1f, 0x51, 0x31, 0x75, 0x64, 0x40, 0x01, 0x25, 0x0b, 0x30, 0xf6, 0x2f, 0x40, + 0xbe, 0x1f, 0x69, 0xd5, 0xa4, 0x01, 0xa4, 0x4e, 0xc9, 0x7b, 0xdf, 0xfb, 0x3e, 0xdd, 0xf7, 0xdd, + 0xf3, 0xa1, 0x4d, 0x1f, 0x48, 0x17, 0x88, 0x1d, 0xc2, 0xc0, 0x1e, 0xec, 0x78, 0x01, 0x75, 0x77, + 0x6c, 0x7a, 0x60, 0x25, 0x3d, 0xa0, 0x80, 0x31, 0x07, 0xad, 0x10, 0x06, 0x96, 0x00, 0x35, 0x5d, + 0x10, 0x3c, 0x97, 0x04, 0x33, 0x86, 0x0f, 0x51, 0xcc, 0x39, 0xda, 0xd6, 0x02, 0xc1, 0x94, 0xcf, + 0xd1, 0x32, 0x47, 0x5b, 0xac, 0xb2, 0x85, 0x3c, 0x87, 0x8a, 0x21, 0x84, 0xc0, 0xfb, 0xe9, 0x3f, + 0x49, 0x08, 0x01, 0xc2, 0x4e, 0x60, 0xb3, 0xca, 0xeb, 0xef, 0xdb, 0x6e, 0x3c, 0xe4, 0x90, 0xf9, + 0x2e, 0x83, 0x36, 0x9a, 0x24, 0x7c, 0xda, 0xf7, 0xba, 0x11, 0x7d, 0xdc, 0x83, 0x04, 0x88, 0xdb, + 0xc1, 0xb7, 0x51, 0xce, 0x87, 0x98, 0x06, 0x31, 0x2d, 0xa9, 0x15, 0xb5, 0x9a, 0xaf, 0x17, 0x2d, + 0x2e, 0x61, 0x49, 0x09, 0xeb, 0x4e, 0x3c, 0x6c, 0xe4, 0xbf, 0x7c, 0xae, 0xe5, 0xf6, 0xf8, 0xa0, + 0x23, 0x19, 0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, 0xcc, 0xac, 0x17, 0xea, 0xba, 0x35, 0xbf, 0x8f, + 0x56, 0x7a, 0x8e, 0x47, 0x6c, 0xca, 0x11, 0xd3, 0x0b, 0x82, 0xd9, 0x40, 0xeb, 0xe2, 0xc8, 0x32, + 0x0e, 0xf3, 0x97, 0x8a, 0x50, 0x93, 0x84, 0x32, 0xe8, 0x8b, 0x72, 0xb2, 0x85, 0xd6, 0xc4, 0xc5, + 0x83, 0x74, 0x73, 0xd2, 0xc0, 0x3e, 0x5a, 0x75, 0xbb, 0xd0, 0x8f, 0x69, 0x29, 0xfb, 0xb7, 0xad, + 0xba, 0x91, 0x6e, 0xd5, 0x7f, 0xed, 0x8e, 0x90, 0x5e, 0x60, 0xbf, 0x88, 0xf0, 0x89, 0x55, 0x99, + 0x40, 0xfd, 0x4d, 0x06, 0x65, 0x9b, 0x24, 0xc4, 0xfb, 0xa8, 0x70, 0xe6, 0x1b, 0xda, 0x5e, 0x14, + 0xf4, 0xdc, 0x66, 0x69, 0xb5, 0x7f, 0x1a, 0x9b, 0x2d, 0xe0, 0x7d, 0xb4, 0xc2, 0x96, 0x66, 0xf3, + 0x1c, 0x5a, 0x0a, 0x6a, 0xd7, 0x96, 0x80, 0x33, 0xa5, 0x27, 0x28, 0x27, 0xef, 0x4d, 0x3f, 0x67, + 0x5e, 0xe0, 0xda, 0xf5, 0xe5, 0xb8, 0x94, 0x6c, 0x34, 0x0e, 0x27, 0xba, 0x7a, 0x34, 0xd1, 0xd5, + 0x1f, 0x13, 0x5d, 0x7d, 0x3f, 0xd5, 0x95, 0xa3, 0xa9, 0xae, 0x7c, 0x9d, 0xea, 0xca, 0xf3, 0xe5, + 0x17, 0x70, 0xc0, 0x1e, 0x3a, 0x76, 0x0d, 0xde, 0x2a, 0x7b, 0x61, 0x6e, 0xfe, 0x09, 0x00, 0x00, + 0xff, 0xff, 0x7f, 0x09, 0x3f, 0x57, 0x54, 0x05, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // SubmitProposal defines a method to create new proposal given a content. + SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) + // Vote defines a method to add a vote on a specific proposal. + Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) + // Deposit defines a method to add deposit on a specific proposal. + Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) { + out := new(MsgSubmitProposalResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/SubmitProposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { + out := new(MsgVoteResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/Vote", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { + out := new(MsgDepositResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/Deposit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // SubmitProposal defines a method to create new proposal given a content. + SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) + // Vote defines a method to add a vote on a specific proposal. + Vote(context.Context, *MsgVote) (*MsgVoteResponse, error) + // Deposit defines a method to add deposit on a specific proposal. + Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SubmitProposal(ctx context.Context, req *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitProposal not implemented") +} +func (*UnimplementedMsgServer) Vote(ctx context.Context, req *MsgVote) (*MsgVoteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") +} +func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*MsgDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_SubmitProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitProposal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Msg/SubmitProposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitProposal(ctx, req.(*MsgSubmitProposal)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgVote) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Vote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Msg/Vote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Vote(ctx, req.(*MsgVote)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDeposit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Deposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Msg/Deposit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Deposit(ctx, req.(*MsgDeposit)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.gov.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SubmitProposal", + Handler: _Msg_SubmitProposal_Handler, + }, + { + MethodName: "Vote", + Handler: _Msg_Vote_Handler, + }, + { + MethodName: "Deposit", + Handler: _Msg_Deposit_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/gov/v1beta1/tx.proto", } func (m *MsgSubmitProposal) Marshal() (dAtA []byte, err error) { @@ -245,6 +535,34 @@ func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgSubmitProposalResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSubmitProposalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *MsgVote) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -285,6 +603,29 @@ func (m *MsgVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgVoteResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgVoteResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgDeposit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -334,6 +675,29 @@ func (m *MsgDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgDepositResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -368,6 +732,18 @@ func (m *MsgSubmitProposal) Size() (n int) { return n } +func (m *MsgSubmitProposalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovTx(uint64(m.ProposalId)) + } + return n +} + func (m *MsgVote) Size() (n int) { if m == nil { return 0 @@ -387,6 +763,15 @@ func (m *MsgVote) Size() (n int) { return n } +func (m *MsgVoteResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgDeposit) Size() (n int) { if m == nil { return 0 @@ -409,6 +794,15 @@ func (m *MsgDeposit) Size() (n int) { return n } +func (m *MsgDepositResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -570,6 +964,78 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSubmitProposalResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgVote) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -693,6 +1159,59 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgVoteResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgVoteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgDeposit) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -831,6 +1350,59 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgDepositResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgDepositResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 8384a5a180823f09a5a3045c01953b459594dfd0 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 16 Oct 2020 08:56:10 -0500 Subject: [PATCH 42/84] =?UTF-8?q?fix:=20Rework=20InterceptConfigsPreRunHan?= =?UTF-8?q?dler=20to=20make=20sure=20configuration=20=E2=80=A6=20(#7501)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Rework InterceptConfigsPreRunHandler to make sure configuration is pulled from all Viper sources * docs: Add configuration documentation in a new file --- server/doc.go | 27 +++ server/util.go | 55 ++++-- server/util_test.go | 446 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 511 insertions(+), 17 deletions(-) create mode 100644 server/doc.go create mode 100644 server/util_test.go diff --git a/server/doc.go b/server/doc.go new file mode 100644 index 0000000000..befac1302e --- /dev/null +++ b/server/doc.go @@ -0,0 +1,27 @@ +/* +The commands from the SDK are defined with `cobra` and configured with the +`viper` package. + +This takes place in the `InterceptConfigsPreRunHandler` function. +Since the `viper` package is used for configuration the precedence is dictated +by that package. That is + +1. Command line switches +2. Environment variables +3. Files from configuration values +4. Default values + +The global configuration instance exposed by the `viper` package is not +used by Cosmos SDK in this function. A new instance of `viper.Viper` is created +and the following is performed. The environmental variable prefix is set +to the current program name. Environmental variables consider the underscore +to be equivalent to the `.` or `-` character. This means that an configuration +value called `rpc.laddr` would be read from an environmental variable called +`MYTOOL_RPC_LADDR` if the current program name is `mytool`. + +Running the `InterceptConfigsPreRunHandler` also reads `app.toml` +and `config.toml` from the home directory under the `config` directory. +If `config.toml` or `app.toml` do not exist then those files are created +and populated with default values. +*/ +package server diff --git a/server/util.go b/server/util.go index a91862b2fc..8407f9b492 100644 --- a/server/util.go +++ b/server/util.go @@ -7,8 +7,10 @@ import ( "net" "os" "os/signal" + "path" "path/filepath" "strconv" + "strings" "syscall" "time" @@ -65,15 +67,31 @@ func NewContext(v *viper.Viper, config *tmcfg.Config, logger log.Logger) *Contex // the application configuration. Command handlers can fetch the server Context // to get the Tendermint configuration or to get access to Viper. func InterceptConfigsPreRunHandler(cmd *cobra.Command) error { - rootViper := viper.New() - rootViper.BindPFlags(cmd.Flags()) - rootViper.BindPFlags(cmd.PersistentFlags()) - serverCtx := NewDefaultContext() - config, err := interceptConfigs(serverCtx, rootViper) + + // Get the executable name and configure the viper instance so that environmental + // variables are checked based off that name. The underscore character is used + // as a separator + executableName, err := os.Executable() if err != nil { return err } + basename := path.Base(executableName) + + // Configure the viper instance + serverCtx.Viper.BindPFlags(cmd.Flags()) + serverCtx.Viper.BindPFlags(cmd.PersistentFlags()) + serverCtx.Viper.SetEnvPrefix(basename) + serverCtx.Viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_")) + serverCtx.Viper.AutomaticEnv() + + // Intercept configuration files, using both Viper instances separately + config, err := interceptConfigs(serverCtx.Viper) + if err != nil { + return err + } + // Return value is a tendermint configuration object + serverCtx.Config = config logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) logger, err = tmflags.ParseLogLevel(config.LogLevel, logger, tmcfg.DefaultLogLevel()) @@ -81,11 +99,12 @@ func InterceptConfigsPreRunHandler(cmd *cobra.Command) error { return err } - if rootViper.GetBool(tmcli.TraceFlag) { + // Check if the tendermint flag for trace logging is set + // if it is then setup a tracing logger in this app as well + if serverCtx.Viper.GetBool(tmcli.TraceFlag) { logger = log.NewTracingLogger(logger) } - serverCtx.Config = config serverCtx.Logger = logger.With("module", "main") return SetCmdServerContext(cmd, serverCtx) @@ -120,7 +139,7 @@ func SetCmdServerContext(cmd *cobra.Command, serverCtx *Context) error { // configuration file. The Tendermint configuration file is parsed given a root // Viper object, whereas the application is parsed with the private package-aware // viperCfg object. -func interceptConfigs(ctx *Context, rootViper *viper.Viper) (*tmcfg.Config, error) { +func interceptConfigs(rootViper *viper.Viper) (*tmcfg.Config, error) { rootDir := rootViper.GetString(flags.FlagHome) configPath := filepath.Join(rootDir, "config") configFile := filepath.Join(configPath, "config.toml") @@ -146,17 +165,19 @@ func interceptConfigs(ctx *Context, rootViper *viper.Viper) (*tmcfg.Config, erro if err := rootViper.ReadInConfig(); err != nil { return nil, fmt.Errorf("failed to read in app.toml: %w", err) } - - if err := rootViper.Unmarshal(conf); err != nil { - return nil, err - } } + // Read into the configuration whatever data the viper instance has for it + // This may come from the configuration file above but also any of the other sources + // viper uses + if err := rootViper.Unmarshal(conf); err != nil { + return nil, err + } conf.SetRoot(rootDir) appConfigFilePath := filepath.Join(configPath, "app.toml") if _, err := os.Stat(appConfigFilePath); os.IsNotExist(err) { - appConf, err := config.ParseConfig(ctx.Viper) + appConf, err := config.ParseConfig(rootViper) if err != nil { return nil, fmt.Errorf("failed to parse app.toml: %w", err) } @@ -164,10 +185,10 @@ func interceptConfigs(ctx *Context, rootViper *viper.Viper) (*tmcfg.Config, erro config.WriteConfigFile(appConfigFilePath, appConf) } - ctx.Viper.SetConfigType("toml") - ctx.Viper.SetConfigName("app") - ctx.Viper.AddConfigPath(configPath) - if err := ctx.Viper.ReadInConfig(); err != nil { + rootViper.SetConfigType("toml") + rootViper.SetConfigName("app") + rootViper.AddConfigPath(configPath) + if err := rootViper.ReadInConfig(); err != nil { return nil, fmt.Errorf("failed to read in app.toml: %w", err) } diff --git a/server/util_test.go b/server/util_test.go new file mode 100644 index 0000000000..7cc10b3542 --- /dev/null +++ b/server/util_test.go @@ -0,0 +1,446 @@ +package server + +import ( + "context" + "errors" + "fmt" + "os" + "path" + "strings" + "testing" + + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" +) + +var CancelledInPreRun = errors.New("Canelled in prerun") + +// Used in each test to run the function under test via Cobra +// but to always halt the command +func preRunETestImpl(cmd *cobra.Command, args []string) error { + err := InterceptConfigsPreRunHandler(cmd) + if err != nil { + return err + } + + return CancelledInPreRun +} + +func TestInterceptConfigsPreRunHandlerCreatesConfigFilesWhenMissing(t *testing.T) { + tempDir := t.TempDir() + cmd := StartCmd(nil, "/foobar") + if err := cmd.Flags().Set(flags.FlagHome, tempDir); err != nil { + t.Fatalf("Could not set home flag [%T] %v", err, err) + } + + cmd.PreRunE = preRunETestImpl + + serverCtx := &Context{} + ctx := context.WithValue(context.Background(), ServerContextKey, serverCtx) + if err := cmd.ExecuteContext(ctx); err != CancelledInPreRun { + t.Fatalf("function failed with [%T] %v", err, err) + } + + // Test that config.toml is created + configTomlPath := path.Join(tempDir, "config", "config.toml") + s, err := os.Stat(configTomlPath) + if err != nil { + t.Fatalf("Could not stat config.toml after run %v", err) + } + + if !s.Mode().IsRegular() { + t.Fatal("config.toml not created as regular file") + } + + if s.Size() == 0 { + t.Fatal("config.toml created as empty file") + } + + // Test that tendermint config is initialized + if serverCtx.Config == nil { + t.Fatal("tendermint config not created") + } + + // Test that app.toml is created + appTomlPath := path.Join(tempDir, "config", "app.toml") + s, err = os.Stat(appTomlPath) + if err != nil { + t.Fatalf("Could not stat app.toml after run %v", err) + } + + if !s.Mode().IsRegular() { + t.Fatal("appp.toml not created as regular file") + } + + if s.Size() == 0 { + t.Fatal("config.toml created as empty file") + } + + // Test that the config for use in server/start.go is created + if serverCtx.Viper == nil { + t.Error("app config Viper instance not created") + } +} + +func TestInterceptConfigsPreRunHandlerReadsConfigToml(t *testing.T) { + const testDbBackend = "awesome_test_db" + tempDir := t.TempDir() + err := os.Mkdir(path.Join(tempDir, "config"), os.ModePerm) + if err != nil { + t.Fatalf("creating config dir failed: %v", err) + } + configTomlPath := path.Join(tempDir, "config", "config.toml") + writer, err := os.Create(configTomlPath) + if err != nil { + t.Fatalf("creating config.toml file failed: %v", err) + } + + _, err = writer.WriteString(fmt.Sprintf("db_backend = '%s'\n", testDbBackend)) + if err != nil { + t.Fatalf("Failed writing string to config.toml: %v", err) + } + + if err := writer.Close(); err != nil { + t.Fatalf("Failed closing config.toml: %v", err) + } + + cmd := StartCmd(nil, "/foobar") + if err := cmd.Flags().Set(flags.FlagHome, tempDir); err != nil { + t.Fatalf("Could not set home flag [%T] %v", err, err) + } + + cmd.PreRunE = preRunETestImpl + + serverCtx := &Context{} + ctx := context.WithValue(context.Background(), ServerContextKey, serverCtx) + + if err := cmd.ExecuteContext(ctx); err != CancelledInPreRun { + t.Fatalf("function failed with [%T] %v", err, err) + } + + if testDbBackend != serverCtx.Config.DBBackend { + t.Error("DBPath was not set from config.toml") + } +} + +func TestInterceptConfigsPreRunHandlerReadsAppToml(t *testing.T) { + const testHaltTime = 1337 + tempDir := t.TempDir() + err := os.Mkdir(path.Join(tempDir, "config"), os.ModePerm) + if err != nil { + t.Fatalf("creating config dir failed: %v", err) + } + appTomlPath := path.Join(tempDir, "config", "app.toml") + writer, err := os.Create(appTomlPath) + if err != nil { + t.Fatalf("creating app.toml file failed: %v", err) + } + + _, err = writer.WriteString(fmt.Sprintf("halt-time = %d\n", testHaltTime)) + if err != nil { + t.Fatalf("Failed writing string to app.toml: %v", err) + } + + if err := writer.Close(); err != nil { + t.Fatalf("Failed closing app.toml: %v", err) + } + cmd := StartCmd(nil, tempDir) + + cmd.PreRunE = preRunETestImpl + + serverCtx := &Context{} + ctx := context.WithValue(context.Background(), ServerContextKey, serverCtx) + + if err := cmd.ExecuteContext(ctx); err != CancelledInPreRun { + t.Fatalf("function failed with [%T] %v", err, err) + } + + if testHaltTime != serverCtx.Viper.GetInt("halt-time") { + t.Error("Halt time was not set from app.toml") + } +} + +func TestInterceptConfigsPreRunHandlerDoesNotMixConfigFiles(t *testing.T) { + // The goal of this test is to make sure that app.toml and config.toml + // are separate files and that mixing values does not work + const testDbBackend = "awesome_test_db" + const testHaltTime = 1337 + const testHaltHeight = 2001 + + tempDir := t.TempDir() + err := os.Mkdir(path.Join(tempDir, "config"), os.ModePerm) + if err != nil { + t.Fatalf("creating config dir failed: %v", err) + } + configTomlPath := path.Join(tempDir, "config", "config.toml") + writer, err := os.Create(configTomlPath) + if err != nil { + t.Fatalf("creating config.toml file failed: %v", err) + } + + // Put a value in config.toml that should be in app.toml + _, err = writer.WriteString(fmt.Sprintf("halt-time = %d\ndb_backend = \"%s\"\n", testHaltTime, testDbBackend)) + if err != nil { + t.Fatalf("Failed writing string to config.toml: %v", err) + } + + if err := writer.Close(); err != nil { + t.Fatalf("Failed closing config.toml: %v", err) + } + + appTomlPath := path.Join(tempDir, "config", "app.toml") + writer, err = os.Create(appTomlPath) + if err != nil { + t.Fatalf("creating app.toml file failed %v", err) + } + + // Put a different value in app.toml + _, err = writer.WriteString(fmt.Sprintf("halt-height = %d\n", testHaltHeight)) + if err != nil { + t.Fatalf("Failed writing string to app.toml: %v", err) + } + + if err := writer.Close(); err != nil { + t.Fatalf("Failed closing app.toml: %v", err) + } + + cmd := StartCmd(nil, tempDir) + cmd.PreRunE = preRunETestImpl + + serverCtx := &Context{} + ctx := context.WithValue(context.Background(), ServerContextKey, serverCtx) + + if err := cmd.ExecuteContext(ctx); err != CancelledInPreRun { + t.Fatalf("function failed with [%T] %v", err, err) + } + + // check that the intended value from config.toml is used + if testDbBackend != serverCtx.Config.DBBackend { + t.Error("DBPath was not set from config.toml") + } + + // The value from app.toml should be used for this + if testHaltHeight != serverCtx.Viper.GetInt("halt-height") { + t.Error("Halt height is not using provided value") + } + + // The value from config.toml should not be used, default is used instead + if 0 != serverCtx.Viper.GetInt("halt-time") { + t.Error("Halt time is not using default") + } +} + +func TestInterceptConfigsPreRunHandlerReadsFlags(t *testing.T) { + const testAddr = "tcp://127.1.2.3:12345" + tempDir := t.TempDir() + cmd := StartCmd(nil, "/foobar") + + if err := cmd.Flags().Set(flags.FlagHome, tempDir); err != nil { + t.Fatalf("Could not set home flag [%T] %v", err, err) + } + + // This flag is added by tendermint + if err := cmd.Flags().Set("rpc.laddr", testAddr); err != nil { + t.Fatalf("Could not set address flag [%T] %v", err, err) + } + + cmd.PreRunE = preRunETestImpl + + serverCtx := &Context{} + ctx := context.WithValue(context.Background(), ServerContextKey, serverCtx) + + if err := cmd.ExecuteContext(ctx); err != CancelledInPreRun { + t.Fatalf("function failed with [%T] %v", err, err) + } + + if testAddr != serverCtx.Config.RPC.ListenAddress { + t.Error("RPCListenAddress was not set from command flags") + } +} + +func TestInterceptConfigsPreRunHandlerReadsEnvVars(t *testing.T) { + const testAddr = "tcp://127.1.2.3:12345" + tempDir := t.TempDir() + cmd := StartCmd(nil, "/foobar") + if err := cmd.Flags().Set(flags.FlagHome, tempDir); err != nil { + t.Fatalf("Could not set home flag [%T] %v", err, err) + } + + executableName, err := os.Executable() + if err != nil { + t.Fatalf("Could not get executable name: %v", err) + } + basename := path.Base(executableName) + basename = strings.ReplaceAll(basename, ".", "_") + // This is added by tendermint + envVarName := fmt.Sprintf("%s_RPC_LADDR", strings.ToUpper(basename)) + os.Setenv(envVarName, testAddr) + t.Cleanup(func() { + os.Unsetenv(envVarName) + }) + + cmd.PreRunE = preRunETestImpl + + serverCtx := &Context{} + ctx := context.WithValue(context.Background(), ServerContextKey, serverCtx) + + if err := cmd.ExecuteContext(ctx); err != CancelledInPreRun { + t.Fatalf("function failed with [%T] %v", err, err) + } + + if testAddr != serverCtx.Config.RPC.ListenAddress { + t.Errorf("RPCListenAddress was not set from env. var. %q", envVarName) + } +} + +/* + The following tests are here to check the precedence of each + of the configuration sources. A common setup functionality is used + to avoid duplication of code between tests. +*/ + +var ( + TestAddrExpected = "tcp://127.126.125.124:12345" // expected to be used in test + TestAddrNotExpected = "tcp://127.127.127.127:11111" // not expected to be used in test +) + +type precedenceCommon struct { + envVarName string + flagName string + configTomlPath string + + cmd *cobra.Command +} + +func newPrecedenceCommon(t *testing.T) precedenceCommon { + retval := precedenceCommon{} + + // Determine the env. var. name based off the executable name + executableName, err := os.Executable() + if err != nil { + t.Fatalf("Could not get executable name: %v", err) + } + basename := path.Base(executableName) + basename = strings.ReplaceAll(basename, ".", "_") + basename = strings.ReplaceAll(basename, "-", "_") + // Store the name of the env. var. + retval.envVarName = fmt.Sprintf("%s_RPC_LADDR", strings.ToUpper(basename)) + + // Store the flag name. This flag is added by tendermint + retval.flagName = "rpc.laddr" + + // Create a tempdir and create './config' under that + tempDir := t.TempDir() + err = os.Mkdir(path.Join(tempDir, "config"), os.ModePerm) + if err != nil { + t.Fatalf("creating config dir failed: %v", err) + } + // Store the path for config.toml + retval.configTomlPath = path.Join(tempDir, "config", "config.toml") + + // always remove the env. var. after each test execution + t.Cleanup(func() { + // This should not fail but if it does just panic + if err := os.Unsetenv(retval.envVarName); err != nil { + panic("Could not clear configuration env. var. used in test") + } + }) + + // Set up the command object that is used in this test + retval.cmd = StartCmd(nil, tempDir) + retval.cmd.PreRunE = preRunETestImpl + + return retval +} + +func (v precedenceCommon) setAll(t *testing.T, setFlag *string, setEnvVar *string, setConfigFile *string) { + if setFlag != nil { + if err := v.cmd.Flags().Set(v.flagName, *setFlag); err != nil { + t.Fatalf("Failed setting flag %q", v.flagName) + } + } + + if setEnvVar != nil { + os.Setenv(v.envVarName, *setEnvVar) + } + + if setConfigFile != nil { + writer, err := os.Create(v.configTomlPath) + if err != nil { + t.Fatalf("creating config.toml file failed: %v", err) + } + + _, err = writer.WriteString(fmt.Sprintf("[rpc]\nladdr = \"%s\"\n", *setConfigFile)) + if err != nil { + t.Fatalf("Failed writing string to config.toml: %v", err) + } + + if err := writer.Close(); err != nil { + t.Fatalf("Failed closing config.toml: %v", err) + } + } +} + +func TestInterceptConfigsPreRunHandlerPrecedenceFlag(t *testing.T) { + testCommon := newPrecedenceCommon(t) + testCommon.setAll(t, &TestAddrExpected, &TestAddrNotExpected, &TestAddrNotExpected) + + serverCtx := &Context{} + ctx := context.WithValue(context.Background(), ServerContextKey, serverCtx) + + if err := testCommon.cmd.ExecuteContext(ctx); err != CancelledInPreRun { + t.Fatalf("function failed with [%T] %v", err, err) + } + + if TestAddrExpected != serverCtx.Config.RPC.ListenAddress { + t.Fatalf("RPCListenAddress was not set from flag %q", testCommon.flagName) + } +} + +func TestInterceptConfigsPreRunHandlerPrecedenceEnvVar(t *testing.T) { + testCommon := newPrecedenceCommon(t) + testCommon.setAll(t, nil, &TestAddrExpected, &TestAddrNotExpected) + + serverCtx := &Context{} + ctx := context.WithValue(context.Background(), ServerContextKey, serverCtx) + + if err := testCommon.cmd.ExecuteContext(ctx); err != CancelledInPreRun { + t.Fatalf("function failed with [%T] %v", err, err) + } + + if TestAddrExpected != serverCtx.Config.RPC.ListenAddress { + t.Errorf("RPCListenAddress was not set from env. var. %q", testCommon.envVarName) + } +} + +func TestInterceptConfigsPreRunHandlerPrecedenceConfigFile(t *testing.T) { + testCommon := newPrecedenceCommon(t) + testCommon.setAll(t, nil, nil, &TestAddrExpected) + + serverCtx := &Context{} + ctx := context.WithValue(context.Background(), ServerContextKey, serverCtx) + + if err := testCommon.cmd.ExecuteContext(ctx); err != CancelledInPreRun { + t.Fatalf("function failed with [%T] %v", err, err) + } + + if TestAddrExpected != serverCtx.Config.RPC.ListenAddress { + t.Errorf("RPCListenAddress was not read from file %q", testCommon.configTomlPath) + } +} + +func TestInterceptConfigsPreRunHandlerPrecedenceConfigDefault(t *testing.T) { + testCommon := newPrecedenceCommon(t) + // Do not set anything + + serverCtx := &Context{} + ctx := context.WithValue(context.Background(), ServerContextKey, serverCtx) + + if err := testCommon.cmd.ExecuteContext(ctx); err != CancelledInPreRun { + t.Fatalf("function failed with [%T] %v", err, err) + } + + if "tcp://127.0.0.1:26657" != serverCtx.Config.RPC.ListenAddress { + t.Error("RPCListenAddress is not using default") + } +} From 18ef33caff995c9e2c8a3cedf59185edf7a7e578 Mon Sep 17 00:00:00 2001 From: atheeshp <59333759+atheeshp@users.noreply.github.com> Date: Fri, 16 Oct 2020 20:23:49 +0530 Subject: [PATCH 43/84] Refactor x/staking according to ADR 031 (#7556) * Refactor x/staking according to ADR 031 * lint * review changes * review changes * review changes Co-authored-by: Aaron Craelius --- proto/cosmos/staking/v1beta1/tx.proto | 53 +- x/distribution/handler.go | 4 +- x/distribution/keeper/msg_server.go | 2 +- x/staking/handler.go | 353 +------- x/staking/handler_test.go | 71 +- x/staking/keeper/msg_server.go | 350 ++++++++ x/staking/types/tx.pb.go | 1076 +++++++++++++++++++++++-- 7 files changed, 1465 insertions(+), 444 deletions(-) create mode 100644 x/staking/keeper/msg_server.go diff --git a/proto/cosmos/staking/v1beta1/tx.proto b/proto/cosmos/staking/v1beta1/tx.proto index 4eb3c8418a..c68e037dca 100644 --- a/proto/cosmos/staking/v1beta1/tx.proto +++ b/proto/cosmos/staking/v1beta1/tx.proto @@ -3,11 +3,33 @@ package cosmos.staking.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; import "cosmos/staking/v1beta1/staking.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; -// MsgCreateValidator defines an SDK message for creating a new validator. +// Msg defines the staking Msg service. +service Msg { + // CreateValidator defines a method for creating a new validator. + rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse); + + // EditValidator defines a method for editing an existing validator. + rpc EditValidator(MsgEditValidator) returns (MsgEditValidatorResponse); + + // Delegate defines a method for performing a delegation of coins + // from a delegator to a validator. + rpc Delegate(MsgDelegate) returns (MsgDelegateResponse); + + // BeginRedelegate defines a method for performing a redelegation + // of coins from a delegator and source validator to a destination validator. + rpc BeginRedelegate(MsgBeginRedelegate) returns (MsgBeginRedelegateResponse); + + // Undelegate defines a method for performing an undelegation from a + // delegate and a validator. + rpc Undelegate(MsgUndelegate) returns (MsgUndelegateResponse); +} + +// MsgCreateValidator defines a SDK message for creating a new validator. message MsgCreateValidator { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; @@ -25,7 +47,10 @@ message MsgCreateValidator { cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false]; } -// MsgEditValidator defines an SDK message for editing an existing validator. +// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. +message MsgCreateValidatorResponse { } + +// MsgEditValidator defines a SDK message for editing an existing validator. message MsgEditValidator { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; @@ -48,7 +73,10 @@ message MsgEditValidator { ]; } -// MsgDelegate defines an SDK message for performing a delegation of coins +// MsgEditValidatorResponse defines the Msg/EditValidator response type. +message MsgEditValidatorResponse { } + +// MsgDelegate defines a SDK message for performing a delegation of coins // from a delegator to a validator. message MsgDelegate { option (gogoproto.equal) = false; @@ -59,7 +87,10 @@ message MsgDelegate { cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; } -// MsgBeginRedelegate defines an SDK message for performing a redelegation +// MsgDelegateResponse defines the Msg/Delegate response type. +message MsgDelegateResponse { } + +// MsgBeginRedelegate defines a SDK message for performing a redelegation // of coins from a delegator and source validator to a destination validator. message MsgBeginRedelegate { option (gogoproto.equal) = false; @@ -71,7 +102,12 @@ message MsgBeginRedelegate { cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false]; } -// MsgUndelegate defines an SDK message for performing an undelegation from a +// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. +message MsgBeginRedelegateResponse { + google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// MsgUndelegate defines a SDK message for performing an undelegation from a // delegate and a validator. message MsgUndelegate { option (gogoproto.equal) = false; @@ -80,4 +116,9 @@ message MsgUndelegate { string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; -} \ No newline at end of file +} + +// MsgUndelegateResponse defines the Msg/Undelegate response type. +message MsgUndelegateResponse { + google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} diff --git a/x/distribution/handler.go b/x/distribution/handler.go index e89b9fbf8c..279a6bf726 100644 --- a/x/distribution/handler.go +++ b/x/distribution/handler.go @@ -9,11 +9,11 @@ import ( ) func NewHandler(k keeper.Keeper) sdk.Handler { + msgServer := keeper.NewMsgServerImpl(k) + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) - msgServer := keeper.NewMsgServerImpl(k) - switch msg := msg.(type) { case *types.MsgSetWithdrawAddress: res, err := msgServer.SetWithdrawAddress(sdk.WrapSDKContext(ctx), msg) diff --git a/x/distribution/keeper/msg_server.go b/x/distribution/keeper/msg_server.go index 9aa24529d8..017aeeb216 100644 --- a/x/distribution/keeper/msg_server.go +++ b/x/distribution/keeper/msg_server.go @@ -13,7 +13,7 @@ type msgServer struct { Keeper } -// NewMsgServerImpl returns an implementation of the bank MsgServer interface +// NewMsgServerImpl returns an implementation of the distribution MsgServer interface // for the provided Keeper. func NewMsgServerImpl(keeper Keeper) types.MsgServer { return &msgServer{Keeper: keeper} diff --git a/x/staking/handler.go b/x/staking/handler.go index 4da6b05a66..6d89c7a29c 100644 --- a/x/staking/handler.go +++ b/x/staking/handler.go @@ -1,13 +1,6 @@ package staking import ( - "time" - - metrics "github.com/armon/go-metrics" - gogotypes "github.com/gogo/protobuf/types" - tmstrings "github.com/tendermint/tendermint/libs/strings" - - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/staking/keeper" @@ -15,356 +8,34 @@ import ( ) func NewHandler(k keeper.Keeper) sdk.Handler { + msgServer := keeper.NewMsgServerImpl(k) + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { case *types.MsgCreateValidator: - return handleMsgCreateValidator(ctx, msg, k) + res, err := msgServer.CreateValidator(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgEditValidator: - return handleMsgEditValidator(ctx, msg, k) + res, err := msgServer.EditValidator(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgDelegate: - return handleMsgDelegate(ctx, msg, k) + res, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgBeginRedelegate: - return handleMsgBeginRedelegate(ctx, msg, k) + res, err := msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgUndelegate: - return handleMsgUndelegate(ctx, msg, k) + res, err := msgServer.Undelegate(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } } } - -// These functions assume everything has been authenticated, -// now we just perform action and save - -func handleMsgCreateValidator(ctx sdk.Context, msg *types.MsgCreateValidator, k keeper.Keeper) (*sdk.Result, error) { - - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) - if err != nil { - return nil, err - } - - // check to see if the pubkey or sender has been registered before - if _, found := k.GetValidator(ctx, valAddr); found { - return nil, types.ErrValidatorOwnerExists - } - - pk, err := sdk.GetPubKeyFromBech32(sdk.Bech32PubKeyTypeConsPub, msg.Pubkey) - if err != nil { - return nil, err - } - - if _, found := k.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pk)); found { - return nil, types.ErrValidatorPubKeyExists - } - - bondDenom := k.BondDenom(ctx) - if msg.Value.Denom != bondDenom { - return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Value.Denom, bondDenom) - } - - if _, err := msg.Description.EnsureLength(); err != nil { - return nil, err - } - - cp := ctx.ConsensusParams() - if cp != nil && cp.Validator != nil { - if !tmstrings.StringInSlice(pk.Type(), cp.Validator.PubKeyTypes) { - return nil, sdkerrors.Wrapf( - types.ErrValidatorPubKeyTypeNotSupported, - "got: %s, expected: %s", pk.Type(), cp.Validator.PubKeyTypes, - ) - } - } - - validator := types.NewValidator(valAddr, pk, msg.Description) - commission := types.NewCommissionWithTime( - msg.Commission.Rate, msg.Commission.MaxRate, - msg.Commission.MaxChangeRate, ctx.BlockHeader().Time, - ) - - validator, err = validator.SetInitialCommission(commission) - if err != nil { - return nil, err - } - - delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) - if err != nil { - return nil, err - } - - validator.MinSelfDelegation = msg.MinSelfDelegation - - k.SetValidator(ctx, validator) - k.SetValidatorByConsAddr(ctx, validator) - k.SetNewValidatorByPowerIndex(ctx, validator) - - // call the after-creation hook - k.AfterValidatorCreated(ctx, validator.GetOperator()) - - // move coins from the msg.Address account to a (self-delegation) delegator account - // the validator account and global shares are updated within here - // NOTE source will always be from a wallet which are unbonded - _, err = k.Delegate(ctx, delegatorAddress, msg.Value.Amount, types.Unbonded, validator, true) - if err != nil { - return nil, err - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeCreateValidator, - sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), - sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Value.Amount.String()), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), - ), - }) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgEditValidator(ctx sdk.Context, msg *types.MsgEditValidator, k keeper.Keeper) (*sdk.Result, error) { - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) - if err != nil { - return nil, err - } - // validator must already be registered - validator, found := k.GetValidator(ctx, valAddr) - if !found { - return nil, types.ErrNoValidatorFound - } - - // replace all editable fields (clients should autofill existing values) - description, err := validator.Description.UpdateDescription(msg.Description) - if err != nil { - return nil, err - } - - validator.Description = description - - if msg.CommissionRate != nil { - commission, err := k.UpdateValidatorCommission(ctx, validator, *msg.CommissionRate) - if err != nil { - return nil, err - } - - // call the before-modification hook since we're about to update the commission - k.BeforeValidatorModified(ctx, valAddr) - - validator.Commission = commission - } - - if msg.MinSelfDelegation != nil { - if !msg.MinSelfDelegation.GT(validator.MinSelfDelegation) { - return nil, types.ErrMinSelfDelegationDecreased - } - - if msg.MinSelfDelegation.GT(validator.Tokens) { - return nil, types.ErrSelfDelegationBelowMinimum - } - - validator.MinSelfDelegation = (*msg.MinSelfDelegation) - } - - k.SetValidator(ctx, validator) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeEditValidator, - sdk.NewAttribute(types.AttributeKeyCommissionRate, validator.Commission.String()), - sdk.NewAttribute(types.AttributeKeyMinSelfDelegation, validator.MinSelfDelegation.String()), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.ValidatorAddress), - ), - }) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgDelegate(ctx sdk.Context, msg *types.MsgDelegate, k keeper.Keeper) (*sdk.Result, error) { - valAddr, valErr := sdk.ValAddressFromBech32(msg.ValidatorAddress) - if valErr != nil { - return nil, valErr - } - - validator, found := k.GetValidator(ctx, valAddr) - if !found { - return nil, types.ErrNoValidatorFound - } - - delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) - if err != nil { - return nil, err - } - - bondDenom := k.BondDenom(ctx) - if msg.Amount.Denom != bondDenom { - return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Amount.Denom, bondDenom) - } - - // NOTE: source funds are always unbonded - _, err = k.Delegate(ctx, delegatorAddress, msg.Amount.Amount, types.Unbonded, validator, true) - if err != nil { - return nil, err - } - - defer func() { - telemetry.IncrCounter(1, types.ModuleName, "delegate") - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", msg.Type()}, - float32(msg.Amount.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", msg.Amount.Denom)}, - ) - }() - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeDelegate, - sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), - sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.Amount.String()), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), - ), - }) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgUndelegate(ctx sdk.Context, msg *types.MsgUndelegate, k keeper.Keeper) (*sdk.Result, error) { - addr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) - if err != nil { - return nil, err - } - delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) - if err != nil { - return nil, err - } - shares, err := k.ValidateUnbondAmount( - ctx, delegatorAddress, addr, msg.Amount.Amount, - ) - if err != nil { - return nil, err - } - - bondDenom := k.BondDenom(ctx) - if msg.Amount.Denom != bondDenom { - return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Amount.Denom, bondDenom) - } - - completionTime, err := k.Undelegate(ctx, delegatorAddress, addr, shares) - if err != nil { - return nil, err - } - - ts, err := gogotypes.TimestampProto(completionTime) - if err != nil { - return nil, types.ErrBadRedelegationAddr - } - - defer func() { - telemetry.IncrCounter(1, types.ModuleName, "undelegate") - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", msg.Type()}, - float32(msg.Amount.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", msg.Amount.Denom)}, - ) - }() - - completionTimeBz := types.ModuleCdc.MustMarshalBinaryLengthPrefixed(ts) - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeUnbond, - sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), - sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.Amount.String()), - sdk.NewAttribute(types.AttributeKeyCompletionTime, completionTime.Format(time.RFC3339)), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), - ), - }) - - return &sdk.Result{Data: completionTimeBz, Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgBeginRedelegate(ctx sdk.Context, msg *types.MsgBeginRedelegate, k keeper.Keeper) (*sdk.Result, error) { - valSrcAddr, err := sdk.ValAddressFromBech32(msg.ValidatorSrcAddress) - if err != nil { - return nil, err - } - delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) - if err != nil { - return nil, err - } - shares, err := k.ValidateUnbondAmount( - ctx, delegatorAddress, valSrcAddr, msg.Amount.Amount, - ) - if err != nil { - return nil, err - } - - bondDenom := k.BondDenom(ctx) - if msg.Amount.Denom != bondDenom { - return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Amount.Denom, bondDenom) - } - - valDstAddr, err := sdk.ValAddressFromBech32(msg.ValidatorDstAddress) - if err != nil { - return nil, err - } - - completionTime, err := k.BeginRedelegation( - ctx, delegatorAddress, valSrcAddr, valDstAddr, shares, - ) - if err != nil { - return nil, err - } - - ts, err := gogotypes.TimestampProto(completionTime) - if err != nil { - return nil, types.ErrBadRedelegationAddr - } - - defer func() { - telemetry.IncrCounter(1, types.ModuleName, "redelegate") - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", msg.Type()}, - float32(msg.Amount.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", msg.Amount.Denom)}, - ) - }() - - completionTimeBz := types.ModuleCdc.MustMarshalBinaryLengthPrefixed(ts) - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeRedelegate, - sdk.NewAttribute(types.AttributeKeySrcValidator, msg.ValidatorSrcAddress), - sdk.NewAttribute(types.AttributeKeyDstValidator, msg.ValidatorDstAddress), - sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.Amount.String()), - sdk.NewAttribute(types.AttributeKeyCompletionTime, completionTime.Format(time.RFC3339)), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), - ), - }) - - return &sdk.Result{Data: completionTimeBz, Events: ctx.EventManager().ABCIEvents()}, nil -} diff --git a/x/staking/handler_test.go b/x/staking/handler_test.go index 8114355d90..51a7323ca0 100644 --- a/x/staking/handler_test.go +++ b/x/staking/handler_test.go @@ -5,7 +5,6 @@ import ( "testing" "time" - gogotypes "github.com/gogo/protobuf/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" @@ -21,6 +20,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/golang/protobuf/proto" ) func bootstrapHandlerGenesisTest(t *testing.T, power int64, numAddrs int, accAmount int64) (*simapp.SimApp, sdk.Context, []sdk.AccAddress, []sdk.ValAddress) { @@ -117,13 +117,11 @@ func TestValidatorByPowerIndex(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err := gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime) + ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) staking.EndBlocker(ctx, app.StakingKeeper) @@ -255,13 +253,11 @@ func TestLegacyValidatorDelegations(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err := gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime) + ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) // verify the validator record still exists, is jailed, and has correct tokens @@ -500,13 +496,11 @@ func TestIncrementsMsgUnbond(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err := gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime) + ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) // check that the accounts and the bond account have the appropriate values @@ -618,10 +612,8 @@ func TestMultipleMsgCreateValidator(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - _, err = gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) // adds validator into unbonding queue @@ -676,13 +668,11 @@ func TestMultipleMsgDelegate(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err := gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime) + ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) // check that the account is unbonded @@ -715,13 +705,11 @@ func TestJailValidator(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err := gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime) + ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddr) @@ -735,13 +723,10 @@ func TestJailValidator(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts = &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err = gogotypes.TimestampFromProto(ts) + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime) + ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) // verify that the pubkey can now be reused @@ -783,13 +768,11 @@ func TestValidatorQueue(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err := gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime) + ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) origHeader := ctx.BlockHeader() @@ -889,13 +872,11 @@ func TestUnbondingFromUnbondingValidator(t *testing.T) { require.NotNil(t, res) // change the ctx to Block Time one second before the validator would have unbonded - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err := gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime.Add(time.Second * -1)) + ctx = ctx.WithBlockTime(resData.CompletionTime.Add(time.Second * -1)) // unbond the delegator from the validator msgUndelegateDelegator := types.NewMsgUndelegate(delegatorAddr, validatorAddr, unbondAmt) diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go new file mode 100644 index 0000000000..d408440226 --- /dev/null +++ b/x/staking/keeper/msg_server.go @@ -0,0 +1,350 @@ +package keeper + +import ( + "context" + "time" + + metrics "github.com/armon/go-metrics" + tmstrings "github.com/tendermint/tendermint/libs/strings" + + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the bank MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateValidator) (*types.MsgCreateValidatorResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if err != nil { + return nil, err + } + + // check to see if the pubkey or sender has been registered before + if _, found := k.GetValidator(ctx, valAddr); found { + return nil, types.ErrValidatorOwnerExists + } + + pk, err := sdk.GetPubKeyFromBech32(sdk.Bech32PubKeyTypeConsPub, msg.Pubkey) + if err != nil { + return nil, err + } + + if _, found := k.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pk)); found { + return nil, types.ErrValidatorPubKeyExists + } + + bondDenom := k.BondDenom(ctx) + if msg.Value.Denom != bondDenom { + return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Value.Denom, bondDenom) + } + + if _, err := msg.Description.EnsureLength(); err != nil { + return nil, err + } + + cp := ctx.ConsensusParams() + if cp != nil && cp.Validator != nil { + if !tmstrings.StringInSlice(pk.Type(), cp.Validator.PubKeyTypes) { + return nil, sdkerrors.Wrapf( + types.ErrValidatorPubKeyTypeNotSupported, + "got: %s, expected: %s", pk.Type(), cp.Validator.PubKeyTypes, + ) + } + } + + validator := types.NewValidator(valAddr, pk, msg.Description) + commission := types.NewCommissionWithTime( + msg.Commission.Rate, msg.Commission.MaxRate, + msg.Commission.MaxChangeRate, ctx.BlockHeader().Time, + ) + + validator, err = validator.SetInitialCommission(commission) + if err != nil { + return nil, err + } + + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + + validator.MinSelfDelegation = msg.MinSelfDelegation + + k.SetValidator(ctx, validator) + k.SetValidatorByConsAddr(ctx, validator) + k.SetNewValidatorByPowerIndex(ctx, validator) + + // call the after-creation hook + k.AfterValidatorCreated(ctx, validator.GetOperator()) + + // move coins from the msg.Address account to a (self-delegation) delegator account + // the validator account and global shares are updated within here + // NOTE source will always be from a wallet which are unbonded + _, err = k.Keeper.Delegate(ctx, delegatorAddress, msg.Value.Amount, types.Unbonded, validator, true) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeCreateValidator, + sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), + sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Value.Amount.String()), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), + ), + }) + + return &types.MsgCreateValidatorResponse{}, nil +} + +func (k msgServer) EditValidator(goCtx context.Context, msg *types.MsgEditValidator) (*types.MsgEditValidatorResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if err != nil { + return nil, err + } + // validator must already be registered + validator, found := k.GetValidator(ctx, valAddr) + if !found { + return nil, types.ErrNoValidatorFound + } + + // replace all editable fields (clients should autofill existing values) + description, err := validator.Description.UpdateDescription(msg.Description) + if err != nil { + return nil, err + } + + validator.Description = description + + if msg.CommissionRate != nil { + commission, err := k.UpdateValidatorCommission(ctx, validator, *msg.CommissionRate) + if err != nil { + return nil, err + } + + // call the before-modification hook since we're about to update the commission + k.BeforeValidatorModified(ctx, valAddr) + + validator.Commission = commission + } + + if msg.MinSelfDelegation != nil { + if !msg.MinSelfDelegation.GT(validator.MinSelfDelegation) { + return nil, types.ErrMinSelfDelegationDecreased + } + + if msg.MinSelfDelegation.GT(validator.Tokens) { + return nil, types.ErrSelfDelegationBelowMinimum + } + + validator.MinSelfDelegation = (*msg.MinSelfDelegation) + } + + k.SetValidator(ctx, validator) + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeEditValidator, + sdk.NewAttribute(types.AttributeKeyCommissionRate, validator.Commission.String()), + sdk.NewAttribute(types.AttributeKeyMinSelfDelegation, validator.MinSelfDelegation.String()), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.ValidatorAddress), + ), + }) + + return &types.MsgEditValidatorResponse{}, nil +} + +func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*types.MsgDelegateResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + valAddr, valErr := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if valErr != nil { + return nil, valErr + } + + validator, found := k.GetValidator(ctx, valAddr) + if !found { + return nil, types.ErrNoValidatorFound + } + + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + + bondDenom := k.BondDenom(ctx) + if msg.Amount.Denom != bondDenom { + return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Amount.Denom, bondDenom) + } + + // NOTE: source funds are always unbonded + _, err = k.Keeper.Delegate(ctx, delegatorAddress, msg.Amount.Amount, types.Unbonded, validator, true) + if err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounter(1, types.ModuleName, "delegate") + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", msg.Type()}, + float32(msg.Amount.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", msg.Amount.Denom)}, + ) + }() + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeDelegate, + sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), + sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.Amount.String()), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), + ), + }) + + return &types.MsgDelegateResponse{}, nil +} + +func (k msgServer) BeginRedelegate(goCtx context.Context, msg *types.MsgBeginRedelegate) (*types.MsgBeginRedelegateResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + valSrcAddr, err := sdk.ValAddressFromBech32(msg.ValidatorSrcAddress) + if err != nil { + return nil, err + } + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + shares, err := k.ValidateUnbondAmount( + ctx, delegatorAddress, valSrcAddr, msg.Amount.Amount, + ) + if err != nil { + return nil, err + } + + bondDenom := k.BondDenom(ctx) + if msg.Amount.Denom != bondDenom { + return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Amount.Denom, bondDenom) + } + + valDstAddr, err := sdk.ValAddressFromBech32(msg.ValidatorDstAddress) + if err != nil { + return nil, err + } + + completionTime, err := k.BeginRedelegation( + ctx, delegatorAddress, valSrcAddr, valDstAddr, shares, + ) + if err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounter(1, types.ModuleName, "redelegate") + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", msg.Type()}, + float32(msg.Amount.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", msg.Amount.Denom)}, + ) + }() + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeRedelegate, + sdk.NewAttribute(types.AttributeKeySrcValidator, msg.ValidatorSrcAddress), + sdk.NewAttribute(types.AttributeKeyDstValidator, msg.ValidatorDstAddress), + sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.Amount.String()), + sdk.NewAttribute(types.AttributeKeyCompletionTime, completionTime.Format(time.RFC3339)), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), + ), + }) + + return &types.MsgBeginRedelegateResponse{ + CompletionTime: completionTime, + }, nil +} + +func (k msgServer) Undelegate(goCtx context.Context, msg *types.MsgUndelegate) (*types.MsgUndelegateResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + addr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if err != nil { + return nil, err + } + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + shares, err := k.ValidateUnbondAmount( + ctx, delegatorAddress, addr, msg.Amount.Amount, + ) + if err != nil { + return nil, err + } + + bondDenom := k.BondDenom(ctx) + if msg.Amount.Denom != bondDenom { + return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Amount.Denom, bondDenom) + } + + completionTime, err := k.Keeper.Undelegate(ctx, delegatorAddress, addr, shares) + if err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounter(1, types.ModuleName, "undelegate") + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", msg.Type()}, + float32(msg.Amount.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", msg.Amount.Denom)}, + ) + }() + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeUnbond, + sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), + sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.Amount.String()), + sdk.NewAttribute(types.AttributeKeyCompletionTime, completionTime.Format(time.RFC3339)), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), + ), + }) + + return &types.MsgUndelegateResponse{ + CompletionTime: completionTime, + }, nil +} diff --git a/x/staking/types/tx.pb.go b/x/staking/types/tx.pb.go index 07c643c7dc..d2d26bd251 100644 --- a/x/staking/types/tx.pb.go +++ b/x/staking/types/tx.pb.go @@ -4,20 +4,29 @@ package types import ( + context "context" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + grpc1 "github.com/gogo/protobuf/grpc" 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/golang/protobuf/ptypes/timestamp" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -25,7 +34,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// MsgCreateValidator defines an SDK message for creating a new validator. +// MsgCreateValidator defines a SDK message for creating a new validator. type MsgCreateValidator struct { Description Description `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` Commission CommissionRates `protobuf:"bytes,2,opt,name=commission,proto3" json:"commission"` @@ -69,7 +78,44 @@ func (m *MsgCreateValidator) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreateValidator proto.InternalMessageInfo -// MsgEditValidator defines an SDK message for editing an existing validator. +// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. +type MsgCreateValidatorResponse struct { +} + +func (m *MsgCreateValidatorResponse) Reset() { *m = MsgCreateValidatorResponse{} } +func (m *MsgCreateValidatorResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateValidatorResponse) ProtoMessage() {} +func (*MsgCreateValidatorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0926ef28816b35ab, []int{1} +} +func (m *MsgCreateValidatorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateValidatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateValidatorResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateValidatorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateValidatorResponse.Merge(m, src) +} +func (m *MsgCreateValidatorResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateValidatorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateValidatorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateValidatorResponse proto.InternalMessageInfo + +// MsgEditValidator defines a SDK message for editing an existing validator. type MsgEditValidator struct { Description Description `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"address"` @@ -86,7 +132,7 @@ func (m *MsgEditValidator) Reset() { *m = MsgEditValidator{} } func (m *MsgEditValidator) String() string { return proto.CompactTextString(m) } func (*MsgEditValidator) ProtoMessage() {} func (*MsgEditValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{1} + return fileDescriptor_0926ef28816b35ab, []int{2} } func (m *MsgEditValidator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -115,7 +161,44 @@ func (m *MsgEditValidator) XXX_DiscardUnknown() { var xxx_messageInfo_MsgEditValidator proto.InternalMessageInfo -// MsgDelegate defines an SDK message for performing a delegation of coins +// MsgEditValidatorResponse defines the Msg/EditValidator response type. +type MsgEditValidatorResponse struct { +} + +func (m *MsgEditValidatorResponse) Reset() { *m = MsgEditValidatorResponse{} } +func (m *MsgEditValidatorResponse) String() string { return proto.CompactTextString(m) } +func (*MsgEditValidatorResponse) ProtoMessage() {} +func (*MsgEditValidatorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0926ef28816b35ab, []int{3} +} +func (m *MsgEditValidatorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEditValidatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEditValidatorResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgEditValidatorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEditValidatorResponse.Merge(m, src) +} +func (m *MsgEditValidatorResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgEditValidatorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEditValidatorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEditValidatorResponse proto.InternalMessageInfo + +// MsgDelegate defines a SDK message for performing a delegation of coins // from a delegator to a validator. type MsgDelegate struct { DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` @@ -127,7 +210,7 @@ func (m *MsgDelegate) Reset() { *m = MsgDelegate{} } func (m *MsgDelegate) String() string { return proto.CompactTextString(m) } func (*MsgDelegate) ProtoMessage() {} func (*MsgDelegate) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{2} + return fileDescriptor_0926ef28816b35ab, []int{4} } func (m *MsgDelegate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -156,7 +239,44 @@ func (m *MsgDelegate) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDelegate proto.InternalMessageInfo -// MsgBeginRedelegate defines an SDK message for performing a redelegation +// MsgDelegateResponse defines the Msg/Delegate response type. +type MsgDelegateResponse struct { +} + +func (m *MsgDelegateResponse) Reset() { *m = MsgDelegateResponse{} } +func (m *MsgDelegateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDelegateResponse) ProtoMessage() {} +func (*MsgDelegateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0926ef28816b35ab, []int{5} +} +func (m *MsgDelegateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDelegateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDelegateResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgDelegateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDelegateResponse.Merge(m, src) +} +func (m *MsgDelegateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDelegateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDelegateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDelegateResponse proto.InternalMessageInfo + +// MsgBeginRedelegate defines a SDK message for performing a redelegation // of coins from a delegator and source validator to a destination validator. type MsgBeginRedelegate struct { DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` @@ -169,7 +289,7 @@ func (m *MsgBeginRedelegate) Reset() { *m = MsgBeginRedelegate{} } func (m *MsgBeginRedelegate) String() string { return proto.CompactTextString(m) } func (*MsgBeginRedelegate) ProtoMessage() {} func (*MsgBeginRedelegate) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{3} + return fileDescriptor_0926ef28816b35ab, []int{6} } func (m *MsgBeginRedelegate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -198,7 +318,52 @@ func (m *MsgBeginRedelegate) XXX_DiscardUnknown() { var xxx_messageInfo_MsgBeginRedelegate proto.InternalMessageInfo -// MsgUndelegate defines an SDK message for performing an undelegation from a +// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. +type MsgBeginRedelegateResponse struct { + CompletionTime time.Time `protobuf:"bytes,1,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"` +} + +func (m *MsgBeginRedelegateResponse) Reset() { *m = MsgBeginRedelegateResponse{} } +func (m *MsgBeginRedelegateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgBeginRedelegateResponse) ProtoMessage() {} +func (*MsgBeginRedelegateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0926ef28816b35ab, []int{7} +} +func (m *MsgBeginRedelegateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBeginRedelegateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBeginRedelegateResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBeginRedelegateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBeginRedelegateResponse.Merge(m, src) +} +func (m *MsgBeginRedelegateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBeginRedelegateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBeginRedelegateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBeginRedelegateResponse proto.InternalMessageInfo + +func (m *MsgBeginRedelegateResponse) GetCompletionTime() time.Time { + if m != nil { + return m.CompletionTime + } + return time.Time{} +} + +// MsgUndelegate defines a SDK message for performing an undelegation from a // delegate and a validator. type MsgUndelegate struct { DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` @@ -210,7 +375,7 @@ func (m *MsgUndelegate) Reset() { *m = MsgUndelegate{} } func (m *MsgUndelegate) String() string { return proto.CompactTextString(m) } func (*MsgUndelegate) ProtoMessage() {} func (*MsgUndelegate) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{4} + return fileDescriptor_0926ef28816b35ab, []int{8} } func (m *MsgUndelegate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -239,57 +404,359 @@ func (m *MsgUndelegate) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUndelegate proto.InternalMessageInfo +// MsgUndelegateResponse defines the Msg/Undelegate response type. +type MsgUndelegateResponse struct { + CompletionTime time.Time `protobuf:"bytes,1,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"` +} + +func (m *MsgUndelegateResponse) Reset() { *m = MsgUndelegateResponse{} } +func (m *MsgUndelegateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUndelegateResponse) ProtoMessage() {} +func (*MsgUndelegateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0926ef28816b35ab, []int{9} +} +func (m *MsgUndelegateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUndelegateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUndelegateResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUndelegateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUndelegateResponse.Merge(m, src) +} +func (m *MsgUndelegateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUndelegateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUndelegateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUndelegateResponse proto.InternalMessageInfo + +func (m *MsgUndelegateResponse) GetCompletionTime() time.Time { + if m != nil { + return m.CompletionTime + } + return time.Time{} +} + func init() { proto.RegisterType((*MsgCreateValidator)(nil), "cosmos.staking.v1beta1.MsgCreateValidator") + proto.RegisterType((*MsgCreateValidatorResponse)(nil), "cosmos.staking.v1beta1.MsgCreateValidatorResponse") proto.RegisterType((*MsgEditValidator)(nil), "cosmos.staking.v1beta1.MsgEditValidator") + proto.RegisterType((*MsgEditValidatorResponse)(nil), "cosmos.staking.v1beta1.MsgEditValidatorResponse") proto.RegisterType((*MsgDelegate)(nil), "cosmos.staking.v1beta1.MsgDelegate") + proto.RegisterType((*MsgDelegateResponse)(nil), "cosmos.staking.v1beta1.MsgDelegateResponse") proto.RegisterType((*MsgBeginRedelegate)(nil), "cosmos.staking.v1beta1.MsgBeginRedelegate") + proto.RegisterType((*MsgBeginRedelegateResponse)(nil), "cosmos.staking.v1beta1.MsgBeginRedelegateResponse") proto.RegisterType((*MsgUndelegate)(nil), "cosmos.staking.v1beta1.MsgUndelegate") + proto.RegisterType((*MsgUndelegateResponse)(nil), "cosmos.staking.v1beta1.MsgUndelegateResponse") } func init() { proto.RegisterFile("cosmos/staking/v1beta1/tx.proto", fileDescriptor_0926ef28816b35ab) } var fileDescriptor_0926ef28816b35ab = []byte{ - // 621 bytes of a gzipped FileDescriptorProto -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0x6d, 0x50, 0xb6, 0x68, 0x68, 0xfe, 0xb2, 0x86, 0x9e, 0x89, 0xe0, 0x7a, - 0x93, 0xda, 0xef, 0x3c, 0xeb, 0x7f, 0xcf, 0x4e, 0xfd, 0xe5, 0xc9, 0x48, 0x16, 0x4f, 0x47, 0xb2, - 0xf8, 0x6b, 0x24, 0x8b, 0x5f, 0xc6, 0xb2, 0x70, 0x3a, 0x96, 0x85, 0x1f, 0x63, 0x59, 0xf8, 0xf0, - 0xe0, 0xdc, 0x1b, 0x3a, 0x48, 0x9e, 0xcc, 0xe8, 0xae, 0xb6, 0x0b, 0xd1, 0x4b, 0xf9, 0xf8, 0x4f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x4f, 0x9f, 0xcb, 0x45, 0xc0, 0x07, 0x00, 0x00, + // 815 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x96, 0x4f, 0x6b, 0xdb, 0x48, + 0x18, 0xc6, 0x2d, 0xdb, 0xf1, 0x66, 0x27, 0xe4, 0x9f, 0xb2, 0x09, 0x5e, 0x11, 0xac, 0xa0, 0xec, + 0xb6, 0xa1, 0x6d, 0xa4, 0x26, 0xa5, 0x14, 0x72, 0x29, 0x75, 0xdc, 0xd2, 0xd0, 0xfa, 0xa2, 0xa4, + 0x3d, 0x94, 0x82, 0x91, 0xa5, 0xb1, 0x2a, 0x2c, 0x69, 0x1c, 0xcd, 0x38, 0x24, 0xd0, 0x0f, 0xd0, + 0x63, 0xa0, 0xb7, 0x42, 0x21, 0x1f, 0x27, 0xa7, 0x92, 0x63, 0xe9, 0xc1, 0x2d, 0x09, 0x94, 0x9c, + 0xfd, 0x09, 0x8a, 0x46, 0xd2, 0x58, 0x96, 0x6d, 0x61, 0x42, 0x7d, 0xe9, 0x29, 0xf1, 0xe8, 0x37, + 0xcf, 0x68, 0x9e, 0x79, 0xe6, 0x7d, 0x05, 0x44, 0x1d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b7, 0x2b, 0x9c, 0xec, 0x3f, + 0x96, 0xae, 0x39, 0x30, 0x5b, 0xc5, 0xe6, 0x2b, 0xd7, 0xf8, 0xe3, 0xf3, 0xdb, 0x00, 0xcb, 0x7d, + 0x3b, 0x9d, 0x90, 0xa5, 0xdb, 0x9f, 0xf2, 0x20, 0x57, 0xc5, 0x26, 0x7f, 0x08, 0xe6, 0x93, 0x1f, + 0x01, 0x77, 0x46, 0xd5, 0xec, 0xc1, 0x8e, 0x20, 0x6c, 0x8f, 0xcf, 0xb2, 0x9d, 0x34, 0xc1, 0x6c, + 0x7f, 0xe7, 0xd8, 0x48, 0x11, 0xe9, 0x23, 0x85, 0xfb, 0xe3, 0x92, 0x6c, 0xb1, 0xb7, 0x60, 0x9a, + 0x15, 0xbd, 0xf5, 0x94, 0xd9, 0x11, 0x24, 0xdc, 0x1d, 0x03, 0x62, 0xea, 0x87, 0x60, 0x3e, 0x59, + 0x52, 0xd2, 0xdc, 0x4b, 0xb0, 0xa9, 0xee, 0x8d, 0xba, 0x5a, 0x75, 0x00, 0x62, 0xf7, 0xe0, 0xff, + 0x14, 0x85, 0x1e, 0x26, 0x6c, 0x8e, 0x85, 0x45, 0x6b, 0x94, 0x9f, 0x9d, 0x5f, 0x96, 0xb8, 0x8b, + 0xcb, 0x12, 0xf7, 0xe3, 0xb2, 0xc4, 0x9d, 0x5e, 0x95, 0x32, 0x17, 0x57, 0xa5, 0xcc, 0xd7, 0xab, + 0x52, 0xe6, 0xcd, 0xbd, 0xd4, 0x36, 0x76, 0xcc, 0xbe, 0x3a, 0x69, 0x43, 0xab, 0x17, 0x68, 0x24, + 0x1f, 0xfc, 0x0a, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x72, 0xf7, 0x1e, 0x24, 0x0b, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // CreateValidator defines a method for creating a new validator. + CreateValidator(ctx context.Context, in *MsgCreateValidator, opts ...grpc.CallOption) (*MsgCreateValidatorResponse, error) + // EditValidator defines a method for editing an existing validator. + EditValidator(ctx context.Context, in *MsgEditValidator, opts ...grpc.CallOption) (*MsgEditValidatorResponse, error) + // Delegate defines a method for performing a delegation of coins + // from a delegator to a validator. + Delegate(ctx context.Context, in *MsgDelegate, opts ...grpc.CallOption) (*MsgDelegateResponse, error) + // BeginRedelegate defines a method for performing a redelegation + // of coins from a delegator and source validator to a destination validator. + BeginRedelegate(ctx context.Context, in *MsgBeginRedelegate, opts ...grpc.CallOption) (*MsgBeginRedelegateResponse, error) + // Undelegate defines a method for performing an undelegation from a + // delegate and a validator. + Undelegate(ctx context.Context, in *MsgUndelegate, opts ...grpc.CallOption) (*MsgUndelegateResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateValidator(ctx context.Context, in *MsgCreateValidator, opts ...grpc.CallOption) (*MsgCreateValidatorResponse, error) { + out := new(MsgCreateValidatorResponse) + err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/CreateValidator", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) EditValidator(ctx context.Context, in *MsgEditValidator, opts ...grpc.CallOption) (*MsgEditValidatorResponse, error) { + out := new(MsgEditValidatorResponse) + err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/EditValidator", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Delegate(ctx context.Context, in *MsgDelegate, opts ...grpc.CallOption) (*MsgDelegateResponse, error) { + out := new(MsgDelegateResponse) + err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/Delegate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) BeginRedelegate(ctx context.Context, in *MsgBeginRedelegate, opts ...grpc.CallOption) (*MsgBeginRedelegateResponse, error) { + out := new(MsgBeginRedelegateResponse) + err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/BeginRedelegate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Undelegate(ctx context.Context, in *MsgUndelegate, opts ...grpc.CallOption) (*MsgUndelegateResponse, error) { + out := new(MsgUndelegateResponse) + err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/Undelegate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // CreateValidator defines a method for creating a new validator. + CreateValidator(context.Context, *MsgCreateValidator) (*MsgCreateValidatorResponse, error) + // EditValidator defines a method for editing an existing validator. + EditValidator(context.Context, *MsgEditValidator) (*MsgEditValidatorResponse, error) + // Delegate defines a method for performing a delegation of coins + // from a delegator to a validator. + Delegate(context.Context, *MsgDelegate) (*MsgDelegateResponse, error) + // BeginRedelegate defines a method for performing a redelegation + // of coins from a delegator and source validator to a destination validator. + BeginRedelegate(context.Context, *MsgBeginRedelegate) (*MsgBeginRedelegateResponse, error) + // Undelegate defines a method for performing an undelegation from a + // delegate and a validator. + Undelegate(context.Context, *MsgUndelegate) (*MsgUndelegateResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreateValidator(ctx context.Context, req *MsgCreateValidator) (*MsgCreateValidatorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateValidator not implemented") +} +func (*UnimplementedMsgServer) EditValidator(ctx context.Context, req *MsgEditValidator) (*MsgEditValidatorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EditValidator not implemented") +} +func (*UnimplementedMsgServer) Delegate(ctx context.Context, req *MsgDelegate) (*MsgDelegateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delegate not implemented") +} +func (*UnimplementedMsgServer) BeginRedelegate(ctx context.Context, req *MsgBeginRedelegate) (*MsgBeginRedelegateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BeginRedelegate not implemented") +} +func (*UnimplementedMsgServer) Undelegate(ctx context.Context, req *MsgUndelegate) (*MsgUndelegateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Undelegate not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreateValidator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateValidator) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateValidator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.staking.v1beta1.Msg/CreateValidator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateValidator(ctx, req.(*MsgCreateValidator)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_EditValidator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgEditValidator) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).EditValidator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.staking.v1beta1.Msg/EditValidator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).EditValidator(ctx, req.(*MsgEditValidator)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Delegate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDelegate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Delegate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.staking.v1beta1.Msg/Delegate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Delegate(ctx, req.(*MsgDelegate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_BeginRedelegate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBeginRedelegate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).BeginRedelegate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.staking.v1beta1.Msg/BeginRedelegate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).BeginRedelegate(ctx, req.(*MsgBeginRedelegate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Undelegate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUndelegate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Undelegate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.staking.v1beta1.Msg/Undelegate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Undelegate(ctx, req.(*MsgUndelegate)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.staking.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateValidator", + Handler: _Msg_CreateValidator_Handler, + }, + { + MethodName: "EditValidator", + Handler: _Msg_EditValidator_Handler, + }, + { + MethodName: "Delegate", + Handler: _Msg_Delegate_Handler, + }, + { + MethodName: "BeginRedelegate", + Handler: _Msg_BeginRedelegate_Handler, + }, + { + MethodName: "Undelegate", + Handler: _Msg_Undelegate_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/staking/v1beta1/tx.proto", } func (m *MsgCreateValidator) Marshal() (dAtA []byte, err error) { @@ -376,6 +843,29 @@ func (m *MsgCreateValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgCreateValidatorResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateValidatorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateValidatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgEditValidator) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -440,6 +930,29 @@ func (m *MsgEditValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgEditValidatorResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgEditValidatorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEditValidatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgDelegate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -487,6 +1000,29 @@ func (m *MsgDelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgDelegateResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgDelegateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDelegateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgBeginRedelegate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -541,6 +1077,37 @@ func (m *MsgBeginRedelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgBeginRedelegateResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBeginRedelegateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBeginRedelegateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintTx(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *MsgUndelegate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -588,6 +1155,37 @@ func (m *MsgUndelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgUndelegateResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUndelegateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUndelegateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) + if err9 != nil { + return 0, err9 + } + i -= n9 + i = encodeVarintTx(dAtA, i, uint64(n9)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -628,6 +1226,15 @@ func (m *MsgCreateValidator) Size() (n int) { return n } +func (m *MsgCreateValidatorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgEditValidator) Size() (n int) { if m == nil { return 0 @@ -651,6 +1258,15 @@ func (m *MsgEditValidator) Size() (n int) { return n } +func (m *MsgEditValidatorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgDelegate) Size() (n int) { if m == nil { return 0 @@ -670,6 +1286,15 @@ func (m *MsgDelegate) Size() (n int) { return n } +func (m *MsgDelegateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgBeginRedelegate) Size() (n int) { if m == nil { return 0 @@ -693,6 +1318,17 @@ func (m *MsgBeginRedelegate) Size() (n int) { return n } +func (m *MsgBeginRedelegateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime) + n += 1 + l + sovTx(uint64(l)) + return n +} + func (m *MsgUndelegate) Size() (n int) { if m == nil { return 0 @@ -712,6 +1348,17 @@ func (m *MsgUndelegate) Size() (n int) { return n } +func (m *MsgUndelegateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime) + n += 1 + l + sovTx(uint64(l)) + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1000,6 +1647,59 @@ func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgCreateValidatorResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateValidatorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgEditValidator) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1190,6 +1890,59 @@ func (m *MsgEditValidator) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgEditValidatorResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgEditValidatorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEditValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgDelegate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1340,6 +2093,59 @@ func (m *MsgDelegate) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgDelegateResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgDelegateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgBeginRedelegate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1522,6 +2328,92 @@ func (m *MsgBeginRedelegate) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgBeginRedelegateResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgBeginRedelegateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBeginRedelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompletionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CompletionTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1672,6 +2564,92 @@ func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUndelegateResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUndelegateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUndelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompletionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CompletionTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 58eabcb71ffcd2170cd580c89d33bd2852d61211 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Fri, 16 Oct 2020 18:05:25 +0200 Subject: [PATCH 44/84] Refactor x/evidence to ADR-031 (#7538) * Refactor x/evidence to ADR-031 * Add hash in response * Update changelog * Update x/evidence/keeper/keeper.go * Update proto/cosmos/evidence/v1beta1/tx.proto Co-authored-by: Marie Gauthier * Use msgServer struct Co-authored-by: Marie Gauthier --- CHANGELOG.md | 1 + proto/cosmos/evidence/v1beta1/tx.proto | 13 ++ x/bank/handler.go | 4 +- x/evidence/exported/evidence.go | 4 +- x/evidence/handler.go | 30 +-- x/evidence/handler_test.go | 9 +- x/evidence/keeper/msg_server.go | 42 ++++ x/evidence/types/msgs.go | 2 +- x/evidence/types/msgs_test.go | 2 +- x/evidence/types/tx.pb.go | 309 ++++++++++++++++++++++++- 10 files changed, 376 insertions(+), 40 deletions(-) create mode 100644 x/evidence/keeper/msg_server.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e52621cc5..b09bc01d73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Client Breaking * (x/staking) [\#7499](https://github.com/cosmos/cosmos-sdk/pull/7499) `BondStatus` is now a protobuf `enum` instead of an `int32`, and JSON serialized using its protobuf name, so expect names like `BOND_STATUS_UNBONDING` as opposed to `Unbonding`. +* (x/evidence) [\#7538](https://github.com/cosmos/cosmos-sdk/pull/7538) The ABCI's `Result.Data` field of `MsgSubmitEvidence` does not contain the raw evidence's hash, but the encoded `MsgSubmitEvidenceResponse` struct. ### API Breaking diff --git a/proto/cosmos/evidence/v1beta1/tx.proto b/proto/cosmos/evidence/v1beta1/tx.proto index 352f7a1c23..38795f25d4 100644 --- a/proto/cosmos/evidence/v1beta1/tx.proto +++ b/proto/cosmos/evidence/v1beta1/tx.proto @@ -8,6 +8,13 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; +// Msg defines the evidence Msg service. +service Msg { + // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or + // counterfactual signing. + rpc SubmitEvidence(MsgSubmitEvidence) returns (MsgSubmitEvidenceResponse); +} + // MsgSubmitEvidence represents a message that supports submitting arbitrary // Evidence of misbehavior such as equivocation or counterfactual signing. message MsgSubmitEvidence { @@ -17,3 +24,9 @@ message MsgSubmitEvidence { string submitter = 1; google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "Evidence"]; } + +// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. +message MsgSubmitEvidenceResponse { + // hash defines the hash of the evidence. + bytes hash = 4; +} diff --git a/x/bank/handler.go b/x/bank/handler.go index d7c04897a5..0fb0f53a4c 100644 --- a/x/bank/handler.go +++ b/x/bank/handler.go @@ -9,11 +9,11 @@ import ( // NewHandler returns a handler for "bank" type messages. func NewHandler(k keeper.Keeper) sdk.Handler { + msgServer := keeper.NewMsgServerImpl(k) + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) - msgServer := keeper.NewMsgServerImpl(k) - switch msg := msg.(type) { case *types.MsgSend: res, err := msgServer.Send(sdk.WrapSDKContext(ctx), msg) diff --git a/x/evidence/exported/evidence.go b/x/evidence/exported/evidence.go index 0bba5fc487..1be263a870 100644 --- a/x/evidence/exported/evidence.go +++ b/x/evidence/exported/evidence.go @@ -34,10 +34,10 @@ type ValidatorEvidence interface { GetTotalPower() int64 } -// MsgSubmitEvidence defines the specific interface a concrete message must +// MsgSubmitEvidenceI defines the specific interface a concrete message must // implement in order to process submitted evidence. The concrete MsgSubmitEvidence // must be defined at the application-level. -type MsgSubmitEvidence interface { +type MsgSubmitEvidenceI interface { sdk.Msg GetEvidence() Evidence diff --git a/x/evidence/handler.go b/x/evidence/handler.go index 60c59158ed..93da4d7bf5 100644 --- a/x/evidence/handler.go +++ b/x/evidence/handler.go @@ -3,42 +3,24 @@ package evidence import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/evidence/exported" "github.com/cosmos/cosmos-sdk/x/evidence/keeper" "github.com/cosmos/cosmos-sdk/x/evidence/types" ) +// NewHandler returns a handler for evidence messages. func NewHandler(k keeper.Keeper) sdk.Handler { + msgServer := keeper.NewMsgServerImpl(k) + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { - case exported.MsgSubmitEvidence: - return handleMsgSubmitEvidence(ctx, k, msg) + case *types.MsgSubmitEvidence: + res, err := msgServer.SubmitEvidence(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } } } - -func handleMsgSubmitEvidence(ctx sdk.Context, k keeper.Keeper, msg exported.MsgSubmitEvidence) (*sdk.Result, error) { - evidence := msg.GetEvidence() - if err := k.SubmitEvidence(ctx, evidence); err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.GetSubmitter().String()), - ), - ) - - return &sdk.Result{ - Data: evidence.Hash(), - Events: ctx.EventManager().ABCIEvents(), - }, nil -} diff --git a/x/evidence/handler_test.go b/x/evidence/handler_test.go index 4011483688..b3f95c300a 100644 --- a/x/evidence/handler_test.go +++ b/x/evidence/handler_test.go @@ -25,7 +25,7 @@ type HandlerTestSuite struct { app *simapp.SimApp } -func testMsgSubmitEvidence(r *require.Assertions, e exported.Evidence, s sdk.AccAddress) exported.MsgSubmitEvidence { +func testMsgSubmitEvidence(r *require.Assertions, e exported.Evidence, s sdk.AccAddress) exported.MsgSubmitEvidenceI { msg, err := types.NewMsgSubmitEvidence(s, e) r.NoError(err) return msg @@ -113,8 +113,11 @@ func (suite *HandlerTestSuite) TestMsgSubmitEvidence() { suite.Require().NoError(err, "unexpected error; tc #%d", i) suite.Require().NotNil(res, "expected non-nil result; tc #%d", i) - msg := tc.msg.(exported.MsgSubmitEvidence) - suite.Require().Equal(msg.GetEvidence().Hash().Bytes(), res.Data, "invalid hash; tc #%d", i) + msg := tc.msg.(exported.MsgSubmitEvidenceI) + + var resultData types.MsgSubmitEvidenceResponse + suite.app.AppCodec().UnmarshalBinaryBare(res.Data, &resultData) + suite.Require().Equal(msg.GetEvidence().Hash().Bytes(), resultData.Hash, "invalid hash; tc #%d", i) } } } diff --git a/x/evidence/keeper/msg_server.go b/x/evidence/keeper/msg_server.go new file mode 100644 index 0000000000..df3cabd4fe --- /dev/null +++ b/x/evidence/keeper/msg_server.go @@ -0,0 +1,42 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/evidence/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the bank MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +// SubmitEvidence implements the MsgServer.SubmitEvidence method. +func (ms msgServer) SubmitEvidence(goCtx context.Context, msg *types.MsgSubmitEvidence) (*types.MsgSubmitEvidenceResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + evidence := msg.GetEvidence() + if err := ms.Keeper.SubmitEvidence(ctx, evidence); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.GetSubmitter().String()), + ), + ) + + return &types.MsgSubmitEvidenceResponse{ + Hash: evidence.Hash(), + }, nil +} diff --git a/x/evidence/types/msgs.go b/x/evidence/types/msgs.go index 74ffd0f500..cd2e2ba032 100644 --- a/x/evidence/types/msgs.go +++ b/x/evidence/types/msgs.go @@ -19,7 +19,7 @@ const ( var ( _ sdk.Msg = &MsgSubmitEvidence{} _ types.UnpackInterfacesMessage = MsgSubmitEvidence{} - _ exported.MsgSubmitEvidence = &MsgSubmitEvidence{} + _ exported.MsgSubmitEvidenceI = &MsgSubmitEvidence{} ) // NewMsgSubmitEvidence returns a new MsgSubmitEvidence with a signer/submitter. diff --git a/x/evidence/types/msgs_test.go b/x/evidence/types/msgs_test.go index 8bcf061ff3..4248b0dfba 100644 --- a/x/evidence/types/msgs_test.go +++ b/x/evidence/types/msgs_test.go @@ -12,7 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/evidence/types" ) -func testMsgSubmitEvidence(t *testing.T, e exported.Evidence, s sdk.AccAddress) exported.MsgSubmitEvidence { +func testMsgSubmitEvidence(t *testing.T, e exported.Evidence, s sdk.AccAddress) exported.MsgSubmitEvidenceI { msg, err := types.NewMsgSubmitEvidence(s, e) require.NoError(t, err) return msg diff --git a/x/evidence/types/tx.pb.go b/x/evidence/types/tx.pb.go index 876bf30e64..5dc9c0fb6c 100644 --- a/x/evidence/types/tx.pb.go +++ b/x/evidence/types/tx.pb.go @@ -4,11 +4,17 @@ package types import ( + bytes "bytes" + context "context" fmt "fmt" 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/regen-network/cosmos-proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -65,14 +71,61 @@ func (m *MsgSubmitEvidence) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitEvidence proto.InternalMessageInfo +// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. +type MsgSubmitEvidenceResponse struct { + // hash defines the hash of the evidence. + Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *MsgSubmitEvidenceResponse) Reset() { *m = MsgSubmitEvidenceResponse{} } +func (m *MsgSubmitEvidenceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitEvidenceResponse) ProtoMessage() {} +func (*MsgSubmitEvidenceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3e3242cb23c956e0, []int{1} +} +func (m *MsgSubmitEvidenceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitEvidenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitEvidenceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSubmitEvidenceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitEvidenceResponse.Merge(m, src) +} +func (m *MsgSubmitEvidenceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitEvidenceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitEvidenceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitEvidenceResponse proto.InternalMessageInfo + +func (m *MsgSubmitEvidenceResponse) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + func init() { proto.RegisterType((*MsgSubmitEvidence)(nil), "cosmos.evidence.v1beta1.MsgSubmitEvidence") + proto.RegisterType((*MsgSubmitEvidenceResponse)(nil), "cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse") } func init() { proto.RegisterFile("cosmos/evidence/v1beta1/tx.proto", fileDescriptor_3e3242cb23c956e0) } var fileDescriptor_3e3242cb23c956e0 = []byte{ - // 257 bytes of a gzipped FileDescriptorProto + // 316 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0x4c, 0x49, 0xcd, 0x4b, 0x4e, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x87, 0xa8, @@ -84,12 +137,124 @@ var fileDescriptor_3e3242cb23c956e0 = []byte{ 0x10, 0x42, 0x40, 0xc8, 0x8e, 0x8b, 0x03, 0xe6, 0x24, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x11, 0x3d, 0x88, 0xdd, 0x7a, 0x30, 0xbb, 0xf5, 0x1c, 0xf3, 0x2a, 0x9d, 0x78, 0x4e, 0x6d, 0xd1, 0xe5, 0x80, 0x99, 0x19, 0x04, 0xd7, 0x63, 0xc5, 0xd1, 0xb1, 0x40, 0x9e, 0xe1, 0xc5, 0x02, 0x79, - 0x06, 0x27, 0xef, 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, - 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, - 0x21, 0x4a, 0x37, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x17, 0xea, 0x66, 0x28, - 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x5f, 0x81, 0x08, 0xb9, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, - 0xb0, 0xe5, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0x3b, 0xe2, 0x83, 0x59, 0x01, 0x00, - 0x00, + 0x06, 0x25, 0x7d, 0x2e, 0x49, 0x0c, 0xcb, 0x83, 0x52, 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, + 0x84, 0xb8, 0x58, 0x32, 0x12, 0x8b, 0x33, 0x24, 0x58, 0x14, 0x18, 0x35, 0x78, 0x82, 0xc0, 0x6c, + 0xa3, 0x72, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x02, 0x2e, 0x3e, 0x34, 0x17, 0x6b, 0xe9, 0xe1, + 0x08, 0x2c, 0x3d, 0x0c, 0x0b, 0xa4, 0x8c, 0x88, 0x57, 0x0b, 0x73, 0x8c, 0x93, 0xf7, 0x8a, 0x47, + 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, + 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9b, 0x9e, 0x59, + 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0x0b, 0x0d, 0x5d, 0x28, 0xa5, 0x5b, 0x9c, 0x92, 0xad, + 0x5f, 0x81, 0x88, 0xe3, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x30, 0x19, 0x03, 0x02, + 0x00, 0x00, 0xff, 0xff, 0xa7, 0x78, 0xdf, 0xa8, 0x03, 0x02, 0x00, 0x00, +} + +func (this *MsgSubmitEvidenceResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgSubmitEvidenceResponse) + if !ok { + that2, ok := that.(MsgSubmitEvidenceResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Hash, that1.Hash) { + return false + } + return true +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // Send submits an arbitrary Evidence of misbehavior such as equivocation or + // counterfactual signing. + SubmitEvidence(ctx context.Context, in *MsgSubmitEvidence, opts ...grpc.CallOption) (*MsgSubmitEvidenceResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SubmitEvidence(ctx context.Context, in *MsgSubmitEvidence, opts ...grpc.CallOption) (*MsgSubmitEvidenceResponse, error) { + out := new(MsgSubmitEvidenceResponse) + err := c.cc.Invoke(ctx, "/cosmos.evidence.v1beta1.Msg/SubmitEvidence", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Send submits an arbitrary Evidence of misbehavior such as equivocation or + // counterfactual signing. + SubmitEvidence(context.Context, *MsgSubmitEvidence) (*MsgSubmitEvidenceResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SubmitEvidence(ctx context.Context, req *MsgSubmitEvidence) (*MsgSubmitEvidenceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitEvidence not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_SubmitEvidence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitEvidence) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitEvidence(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.evidence.v1beta1.Msg/SubmitEvidence", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitEvidence(ctx, req.(*MsgSubmitEvidence)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.evidence.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SubmitEvidence", + Handler: _Msg_SubmitEvidence_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/evidence/v1beta1/tx.proto", } func (m *MsgSubmitEvidence) Marshal() (dAtA []byte, err error) { @@ -134,6 +299,36 @@ func (m *MsgSubmitEvidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgSubmitEvidenceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSubmitEvidenceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitEvidenceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTx(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -162,6 +357,19 @@ func (m *MsgSubmitEvidence) Size() (n int) { return n } +func (m *MsgSubmitEvidenceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -289,6 +497,93 @@ func (m *MsgSubmitEvidence) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSubmitEvidenceResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitEvidenceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitEvidenceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 06c068713d803a3d406a7e865b1aae311f36f911 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sat, 17 Oct 2020 12:09:06 +0100 Subject: [PATCH 45/84] Makefile: fix db-specific ldflags (#7554) Closes: #7534 --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 28628f395a..01ca0a594f 100644 --- a/Makefile +++ b/Makefile @@ -70,10 +70,12 @@ endif ifeq (rocksdb,$(findstring rocksdb,$(COSMOS_BUILD_OPTIONS))) CGO_ENABLED=1 BUILD_TAGS += rocksdb + ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=rocksdb endif # handle boltdb ifeq (boltdb,$(findstring boltdb,$(COSMOS_BUILD_OPTIONS))) BUILD_TAGS += boltdb + ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=boltdb endif ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) From c40f3d02a0cdd41380d92aae3d7acd353c3ceab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Sat, 17 Oct 2020 23:05:26 +0200 Subject: [PATCH 46/84] remove id in localhost (#7577) Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Christopher Goes --- .../lightclients/localhost/v1/localhost.proto | 6 +- .../09-localhost/types/localhost.pb.go | 82 ++++--------------- 2 files changed, 20 insertions(+), 68 deletions(-) diff --git a/proto/ibc/lightclients/localhost/v1/localhost.proto b/proto/ibc/lightclients/localhost/v1/localhost.proto index 766bc17dc3..d48a1c0076 100644 --- a/proto/ibc/lightclients/localhost/v1/localhost.proto +++ b/proto/ibc/lightclients/localhost/v1/localhost.proto @@ -10,10 +10,8 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/09-localho // access to keys outside the client prefix. message ClientState { option (gogoproto.goproto_getters) = false; - // client id - string id = 1; // self chain ID - string chain_id = 2 [(gogoproto.moretags) = "yaml:\"chain_id\""]; + string chain_id = 1 [(gogoproto.moretags) = "yaml:\"chain_id\""]; // self latest block height - ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; + ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false]; } diff --git a/x/ibc/light-clients/09-localhost/types/localhost.pb.go b/x/ibc/light-clients/09-localhost/types/localhost.pb.go index a01f162419..28f7f74d38 100644 --- a/x/ibc/light-clients/09-localhost/types/localhost.pb.go +++ b/x/ibc/light-clients/09-localhost/types/localhost.pb.go @@ -27,12 +27,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // ClientState defines a loopback (localhost) client. It requires (read-only) // access to keys outside the client prefix. type ClientState struct { - // client id - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // self chain ID - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty" yaml:"chain_id"` + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty" yaml:"chain_id"` // self latest block height - Height types.Height `protobuf:"bytes,3,opt,name=height,proto3" json:"height"` + Height types.Height `protobuf:"bytes,2,opt,name=height,proto3" json:"height"` } func (m *ClientState) Reset() { *m = ClientState{} } @@ -77,26 +75,25 @@ func init() { } var fileDescriptor_acd9f5b22d41bf6d = []byte{ - // 294 bytes of a gzipped FileDescriptorProto + // 279 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xcd, 0x4c, 0x4a, 0xd6, 0xcf, 0xc9, 0x4c, 0xcf, 0x28, 0x49, 0xce, 0xc9, 0x4c, 0xcd, 0x2b, 0x29, 0xd6, 0xcf, 0xc9, 0x4f, 0x4e, 0xcc, 0xc9, 0xc8, 0x2f, 0x2e, 0xd1, 0x2f, 0x33, 0x44, 0x70, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x64, 0x33, 0x93, 0x92, 0xf5, 0x90, 0x95, 0xeb, 0x21, 0x54, 0x94, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x55, 0xea, 0x83, 0x58, 0x10, 0x4d, 0x52, 0xf2, 0x20, 0x3b, 0x92, - 0xf3, 0x8b, 0x52, 0xf5, 0x21, 0x9a, 0x40, 0x06, 0x43, 0x58, 0x10, 0x05, 0x4a, 0xbd, 0x8c, 0x5c, - 0xdc, 0xce, 0x60, 0x81, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x3e, 0x2e, 0xa6, 0xcc, 0x14, 0x09, - 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0xa6, 0xcc, 0x14, 0x21, 0x3d, 0x2e, 0x8e, 0xe4, 0x8c, 0xc4, - 0xcc, 0xbc, 0xf8, 0xcc, 0x14, 0x09, 0x26, 0x90, 0xa8, 0x93, 0xf0, 0xa7, 0x7b, 0xf2, 0xfc, 0x95, - 0x89, 0xb9, 0x39, 0x56, 0x4a, 0x30, 0x19, 0xa5, 0x20, 0x76, 0x30, 0xd3, 0x33, 0x45, 0xc8, 0x82, - 0x8b, 0x2d, 0x23, 0x15, 0xe4, 0x48, 0x09, 0x66, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x29, 0x3d, 0x90, - 0xb3, 0x41, 0x2e, 0xd0, 0x83, 0xda, 0x5b, 0x66, 0xa8, 0xe7, 0x01, 0x56, 0xe1, 0xc4, 0x72, 0xe2, - 0x9e, 0x3c, 0x43, 0x10, 0x54, 0xbd, 0x15, 0x4b, 0xc7, 0x02, 0x79, 0x06, 0xa7, 0xd8, 0x13, 0x8f, - 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, - 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x72, 0x4e, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, - 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0x86, 0x52, 0xba, 0xc5, 0x29, 0xd9, - 0xfa, 0x15, 0xfa, 0xf0, 0xd0, 0xd4, 0x85, 0x05, 0xa7, 0x81, 0xa5, 0x2e, 0x22, 0x44, 0x4b, 0x2a, - 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xbe, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xe7, 0xec, - 0x4b, 0x6c, 0x7c, 0x01, 0x00, 0x00, + 0xf3, 0x8b, 0x52, 0xf5, 0x21, 0x9a, 0x40, 0x06, 0x43, 0x58, 0x10, 0x05, 0x4a, 0xb5, 0x5c, 0xdc, + 0xce, 0x60, 0x7e, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x1e, 0x17, 0x47, 0x72, 0x46, 0x62, 0x66, + 0x5e, 0x7c, 0x66, 0x8a, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xa7, 0x93, 0xf0, 0xa7, 0x7b, 0xf2, 0xfc, + 0x95, 0x89, 0xb9, 0x39, 0x56, 0x4a, 0x30, 0x19, 0xa5, 0x20, 0x76, 0x30, 0xd3, 0x33, 0x45, 0xc8, + 0x82, 0x8b, 0x2d, 0x23, 0x15, 0xe4, 0x26, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x29, 0x3d, + 0x90, 0x2b, 0x41, 0x16, 0xea, 0x41, 0xad, 0x29, 0x33, 0xd4, 0xf3, 0x00, 0xab, 0x70, 0x62, 0x39, + 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xaa, 0xde, 0x8a, 0xa5, 0x63, 0x81, 0x3c, 0x83, 0x53, 0xec, 0x89, + 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, + 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x39, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, + 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0x43, 0x29, 0xdd, 0xe2, 0x94, + 0x6c, 0xfd, 0x0a, 0x7d, 0x78, 0xe0, 0xe9, 0xc2, 0x42, 0xcf, 0xc0, 0x52, 0x17, 0x11, 0x80, 0x25, + 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x4f, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xcd, + 0x7d, 0x91, 0x77, 0x6b, 0x01, 0x00, 0x00, } func (m *ClientState) Marshal() (dAtA []byte, err error) { @@ -128,19 +125,12 @@ func (m *ClientState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintLocalhost(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 if len(m.ChainId) > 0 { i -= len(m.ChainId) copy(dAtA[i:], m.ChainId) i = encodeVarintLocalhost(dAtA, i, uint64(len(m.ChainId))) i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintLocalhost(dAtA, i, uint64(len(m.Id))) - i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -163,10 +153,6 @@ func (m *ClientState) Size() (n int) { } var l int _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovLocalhost(uint64(l)) - } l = len(m.ChainId) if l > 0 { n += 1 + l + sovLocalhost(uint64(l)) @@ -212,38 +198,6 @@ func (m *ClientState) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLocalhost - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLocalhost - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLocalhost - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } @@ -275,7 +229,7 @@ func (m *ClientState) Unmarshal(dAtA []byte) error { } m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } From 4fcd899b810bc1742c9c2a05c65e8f541d3ba708 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2020 04:37:14 -0300 Subject: [PATCH 47/84] build(deps): bump codecov/codecov-action from v1.0.13 to v1.0.14 (#7591) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from v1.0.13 to v1.0.14. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Commits](https://github.com/codecov/codecov-action/compare/v1.0.13...7d5dfa54903bd909319c580a00535b483d1efcf3) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 822b509137..33968233fe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -121,7 +121,7 @@ jobs: sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt done if: env.GIT_DIFF - - uses: codecov/codecov-action@v1.0.13 + - uses: codecov/codecov-action@v1.0.14 with: file: ./coverage.txt if: env.GIT_DIFF @@ -163,7 +163,7 @@ jobs: sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt done if: env.GIT_DIFF - - uses: codecov/codecov-action@v1.0.13 + - uses: codecov/codecov-action@v1.0.14 with: file: ./coverage.txt if: env.GIT_DIFF @@ -205,7 +205,7 @@ jobs: sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt done if: env.GIT_DIFF - - uses: codecov/codecov-action@v1.0.13 + - uses: codecov/codecov-action@v1.0.14 with: file: ./coverage.txt if: env.GIT_DIFF @@ -247,7 +247,7 @@ jobs: sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt done if: env.GIT_DIFF - - uses: codecov/codecov-action@v1.0.13 + - uses: codecov/codecov-action@v1.0.14 with: file: ./coverage.txt if: env.GIT_DIFF From 3991af365b1527d03d79adcf3db96c4541b6235a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2020 09:02:42 +0000 Subject: [PATCH 48/84] build(deps): bump github.com/spf13/cobra from 1.1.0 to 1.1.1 (#7592) Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.1.0 to 1.1.1. - [Release notes](https://github.com/spf13/cobra/releases) - [Changelog](https://github.com/spf13/cobra/blob/master/CHANGELOG.md) - [Commits](https://github.com/spf13/cobra/compare/v1.1.0...v1.1.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8c5c73cf01..bb5dd3361b 100644 --- a/go.mod +++ b/go.mod @@ -37,7 +37,7 @@ require ( github.com/regen-network/cosmos-proto v0.3.0 github.com/spf13/afero v1.2.2 // indirect github.com/spf13/cast v1.3.1 - github.com/spf13/cobra v1.1.0 + github.com/spf13/cobra v1.1.1 github.com/spf13/jwalterweatherman v1.1.0 // indirect; indirects github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.7.1 diff --git a/go.sum b/go.sum index b457369995..54ae3d7569 100644 --- a/go.sum +++ b/go.sum @@ -559,8 +559,8 @@ github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3 github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.0 h1:aq3wCKjTPmzcNWLVGnsFVN4rflK7Uzn10F8/aw8MhdQ= -github.com/spf13/cobra v1.1.0/go.mod h1:yk5b0mALVusDL5fMM6Rd1wgnoO5jUPhwsQ6LQAJTidQ= +github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= +github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= 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= @@ -872,6 +872,7 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= From 8138605aedf71a65a5c84007d4aa92a2c2e6b607 Mon Sep 17 00:00:00 2001 From: Cory Date: Mon, 19 Oct 2020 02:22:56 -0700 Subject: [PATCH 49/84] Refactor x/auth/vesting to use ADR-031 (#7551) * update auth/vesting module to use proto msg services * rm accidental tmp files * Update x/auth/vesting/msg_server.go Co-authored-by: Marie Gauthier * golangci-lint fix Co-authored-by: Marie Gauthier Co-authored-by: Aaron Craelius Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- proto/cosmos/vesting/v1beta1/tx.proto | 12 + types/tx/tx.pb.go | 7 +- x/auth/vesting/handler.go | 77 +---- x/auth/vesting/msg_server.go | 100 +++++++ x/auth/vesting/types/tx.pb.go | 264 ++++++++++++++++-- x/distribution/types/tx.pb.go | 10 +- .../07-tendermint/types/tendermint.pb.go | 9 +- 7 files changed, 368 insertions(+), 111 deletions(-) create mode 100644 x/auth/vesting/msg_server.go diff --git a/proto/cosmos/vesting/v1beta1/tx.proto b/proto/cosmos/vesting/v1beta1/tx.proto index 0c5ce53ac8..41873315c0 100644 --- a/proto/cosmos/vesting/v1beta1/tx.proto +++ b/proto/cosmos/vesting/v1beta1/tx.proto @@ -6,6 +6,15 @@ import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; + +// Msg defines the bank Msg service. +service Msg { + // CreateVestingAccount defines a method that enables creating a vesting + // account. + rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); +} + + // MsgCreateVestingAccount defines a message that enables creating a vesting // account. message MsgCreateVestingAccount { @@ -19,3 +28,6 @@ message MsgCreateVestingAccount { int64 end_time = 4 [(gogoproto.moretags) = "yaml:\"end_time\""]; bool delayed = 5; } + +// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. +message MsgCreateVestingAccountResponse { } \ No newline at end of file diff --git a/types/tx/tx.pb.go b/types/tx/tx.pb.go index aef71a802f..996ed527cb 100644 --- a/types/tx/tx.pb.go +++ b/types/tx/tx.pb.go @@ -5,10 +5,6 @@ package tx import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - types "github.com/cosmos/cosmos-sdk/codec/types" types1 "github.com/cosmos/cosmos-sdk/crypto/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -16,6 +12,9 @@ import ( signing "github.com/cosmos/cosmos-sdk/types/tx/signing" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/auth/vesting/handler.go b/x/auth/vesting/handler.go index eef8787bda..1d32e9969b 100644 --- a/x/auth/vesting/handler.go +++ b/x/auth/vesting/handler.go @@ -1,95 +1,26 @@ package vesting import ( - "github.com/armon/go-metrics" - - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" ) // NewHandler returns a handler for x/auth message types. func NewHandler(ak keeper.AccountKeeper, bk types.BankKeeper) sdk.Handler { + msgServer := NewMsgServerImpl(ak, bk) + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { case *types.MsgCreateVestingAccount: - return handleMsgCreateVestingAccount(ctx, ak, bk, msg) + res, err := msgServer.CreateVestingAccount(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } } } - -func handleMsgCreateVestingAccount(ctx sdk.Context, ak keeper.AccountKeeper, bk types.BankKeeper, msg *types.MsgCreateVestingAccount) (*sdk.Result, error) { - if err := bk.SendEnabledCoins(ctx, msg.Amount...); err != nil { - return nil, err - } - - from, err := sdk.AccAddressFromBech32(msg.FromAddress) - if err != nil { - return nil, err - } - to, err := sdk.AccAddressFromBech32(msg.ToAddress) - if err != nil { - return nil, err - } - - if bk.BlockedAddr(to) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) - } - - if acc := ak.GetAccount(ctx, to); acc != nil { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress) - } - - baseAccount := ak.NewAccountWithAddress(ctx, to) - if _, ok := baseAccount.(*authtypes.BaseAccount); !ok { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid account type; expected: BaseAccount, got: %T", baseAccount) - } - - baseVestingAccount := types.NewBaseVestingAccount(baseAccount.(*authtypes.BaseAccount), msg.Amount.Sort(), msg.EndTime) - - var acc authtypes.AccountI - - if msg.Delayed { - acc = types.NewDelayedVestingAccountRaw(baseVestingAccount) - } else { - acc = types.NewContinuousVestingAccountRaw(baseVestingAccount, ctx.BlockTime().Unix()) - } - - ak.SetAccount(ctx, acc) - - defer func() { - telemetry.IncrCounter(1, "new", "account") - - for _, a := range msg.Amount { - if a.Amount.IsInt64() { - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", "create_vesting_account"}, - float32(a.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, - ) - } - } - }() - - err = bk.SendCoins(ctx, from, to, msg.Amount) - if err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} diff --git a/x/auth/vesting/msg_server.go b/x/auth/vesting/msg_server.go new file mode 100644 index 0000000000..dadd65dbcf --- /dev/null +++ b/x/auth/vesting/msg_server.go @@ -0,0 +1,100 @@ +package vesting + +import ( + "context" + + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + "github.com/armon/go-metrics" + + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/auth/keeper" + "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" +) + +type msgServer struct { + keeper.AccountKeeper + types.BankKeeper +} + +// NewMsgServerImpl returns an implementation of the vesting MsgServer interface, +// wrapping the corresponding AccountKeeper and BankKeeper. +func NewMsgServerImpl(k keeper.AccountKeeper, bk types.BankKeeper) types.MsgServer { + return &msgServer{AccountKeeper: k, BankKeeper: bk} +} + +var _ types.MsgServer = msgServer{} + +func (s msgServer) CreateVestingAccount(goCtx context.Context, msg *types.MsgCreateVestingAccount) (*types.MsgCreateVestingAccountResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + ak := s.AccountKeeper + bk := s.BankKeeper + + if err := bk.SendEnabledCoins(ctx, msg.Amount...); err != nil { + return nil, err + } + + from, err := sdk.AccAddressFromBech32(msg.FromAddress) + if err != nil { + return nil, err + } + to, err := sdk.AccAddressFromBech32(msg.ToAddress) + if err != nil { + return nil, err + } + + if bk.BlockedAddr(to) { + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) + } + + if acc := ak.GetAccount(ctx, to); acc != nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress) + } + + baseAccount := ak.NewAccountWithAddress(ctx, to) + if _, ok := baseAccount.(*authtypes.BaseAccount); !ok { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid account type; expected: BaseAccount, got: %T", baseAccount) + } + + baseVestingAccount := types.NewBaseVestingAccount(baseAccount.(*authtypes.BaseAccount), msg.Amount.Sort(), msg.EndTime) + + var acc authtypes.AccountI + + if msg.Delayed { + acc = types.NewDelayedVestingAccountRaw(baseVestingAccount) + } else { + acc = types.NewContinuousVestingAccountRaw(baseVestingAccount, ctx.BlockTime().Unix()) + } + + ak.SetAccount(ctx, acc) + + defer func() { + telemetry.IncrCounter(1, "new", "account") + + for _, a := range msg.Amount { + if a.Amount.IsInt64() { + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", "create_vesting_account"}, + float32(a.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, + ) + } + } + }() + + err = bk.SendCoins(ctx, from, to, msg.Amount) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + ), + ) + + return &types.MsgCreateVestingAccountResponse{}, nil +} diff --git a/x/auth/vesting/types/tx.pb.go b/x/auth/vesting/types/tx.pb.go index b277f3518f..ab3283c238 100644 --- a/x/auth/vesting/types/tx.pb.go +++ b/x/auth/vesting/types/tx.pb.go @@ -4,11 +4,16 @@ package types import ( + context "context" 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" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -103,37 +108,78 @@ func (m *MsgCreateVestingAccount) GetDelayed() bool { return false } +// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. +type MsgCreateVestingAccountResponse struct { +} + +func (m *MsgCreateVestingAccountResponse) Reset() { *m = MsgCreateVestingAccountResponse{} } +func (m *MsgCreateVestingAccountResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateVestingAccountResponse) ProtoMessage() {} +func (*MsgCreateVestingAccountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5338ca97811f9792, []int{1} +} +func (m *MsgCreateVestingAccountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateVestingAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateVestingAccountResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateVestingAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateVestingAccountResponse.Merge(m, src) +} +func (m *MsgCreateVestingAccountResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateVestingAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateVestingAccountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateVestingAccountResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgCreateVestingAccount)(nil), "cosmos.vesting.v1beta1.MsgCreateVestingAccount") + proto.RegisterType((*MsgCreateVestingAccountResponse)(nil), "cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse") } func init() { proto.RegisterFile("cosmos/vesting/v1beta1/tx.proto", fileDescriptor_5338ca97811f9792) } var fileDescriptor_5338ca97811f9792 = []byte{ - // 365 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x51, 0x3f, 0x4f, 0xf2, 0x40, - 0x1c, 0xee, 0x01, 0x2f, 0x7f, 0x8e, 0x37, 0x79, 0xf3, 0x16, 0x95, 0xca, 0xd0, 0x36, 0x9d, 0xba, - 0xd8, 0x8a, 0x3a, 0xb1, 0x51, 0x46, 0xe3, 0xd2, 0x18, 0x07, 0x17, 0x72, 0x6d, 0xcf, 0xd2, 0xc8, - 0xf5, 0x48, 0xef, 0x20, 0xf0, 0x2d, 0xfc, 0x08, 0xce, 0x7e, 0x0a, 0x47, 0x46, 0x46, 0xa7, 0x6a, - 0x60, 0x71, 0xe6, 0x13, 0x98, 0xf6, 0x5a, 0x74, 0x72, 0x6a, 0x9f, 0x3c, 0x7f, 0xee, 0x79, 0xf2, - 0x83, 0x9a, 0x4f, 0x19, 0xa1, 0xcc, 0x5e, 0x60, 0xc6, 0xa3, 0x38, 0xb4, 0x17, 0x7d, 0x0f, 0x73, - 0xd4, 0xb7, 0xf9, 0xd2, 0x9a, 0x25, 0x94, 0x53, 0xf9, 0x44, 0x08, 0xac, 0x42, 0x60, 0x15, 0x82, - 0xde, 0x51, 0x48, 0x43, 0x9a, 0x4b, 0xec, 0xec, 0x4f, 0xa8, 0x7b, 0x6a, 0x11, 0xe7, 0x21, 0x86, - 0x0f, 0x59, 0x3e, 0x8d, 0x62, 0xc1, 0x1b, 0xaf, 0x15, 0xd8, 0xbd, 0x61, 0xe1, 0x28, 0xc1, 0x88, - 0xe3, 0x3b, 0x11, 0x39, 0xf4, 0x7d, 0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3b, 0x55, 0xba, 0xef, 0xff, - 0xda, 0x6d, 0x69, 0xa3, 0x39, 0x9f, 0x1c, 0x0e, 0x9d, 0x57, 0xf5, 0xea, 0xf9, 0x59, 0x2e, 0xbf, - 0x02, 0x00, 0x00, 0xff, 0xff, 0x22, 0x3f, 0x4e, 0xe2, 0x07, 0x02, 0x00, 0x00, + // 410 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xbd, 0xae, 0xd3, 0x30, + 0x14, 0x8e, 0x6f, 0x2e, 0xf7, 0xc7, 0x17, 0x09, 0x91, 0x16, 0x1a, 0x3a, 0xc4, 0x21, 0x53, 0x16, + 0x6c, 0x5a, 0x90, 0x90, 0xba, 0x35, 0x1d, 0x51, 0x97, 0x08, 0x31, 0xb0, 0x54, 0x4e, 0x62, 0xd2, + 0x88, 0x26, 0xae, 0x62, 0xb7, 0x6a, 0x37, 0x46, 0x46, 0x1e, 0x81, 0x99, 0xa7, 0x60, 0xec, 0xd8, + 0x91, 0x29, 0xa0, 0x76, 0x61, 0xee, 0x13, 0xa0, 0xc4, 0x49, 0x61, 0x68, 0x91, 0x98, 0xec, 0xa3, + 0xef, 0xc7, 0xe7, 0x7c, 0x3e, 0x10, 0x85, 0x5c, 0xa4, 0x5c, 0x90, 0x25, 0x13, 0x32, 0xc9, 0x62, + 0xb2, 0xec, 0x05, 0x4c, 0xd2, 0x1e, 0x91, 0x2b, 0x3c, 0xcf, 0xb9, 0xe4, 0xc6, 0x63, 0x45, 0xc0, + 0x35, 0x01, 0xd7, 0x84, 0x6e, 0x3b, 0xe6, 0x31, 0xaf, 0x28, 0xa4, 0xbc, 0x29, 0x76, 0xd7, 0xaa, + 0xed, 0x02, 0x2a, 0xd8, 0xd1, 0x2b, 0xe4, 0x49, 0xa6, 0x70, 0xe7, 0xdb, 0x05, 0xec, 0x8c, 0x45, + 0x3c, 0xca, 0x19, 0x95, 0xec, 0xad, 0xb2, 0x1c, 0x86, 0x21, 0x5f, 0x64, 0xd2, 0x18, 0xc0, 0xfb, + 0xef, 0x73, 0x9e, 0x4e, 0x68, 0x14, 0xe5, 0x4c, 0x08, 0x13, 0xd8, 0xc0, 0xbd, 0xf5, 0x3a, 0x87, + 0x02, 0xb5, 0xd6, 0x34, 0x9d, 0x0d, 0x9c, 0xbf, 0x51, 0xc7, 0xbf, 0x2b, 0xcb, 0xa1, 0xaa, 0x8c, + 0x97, 0x10, 0x4a, 0x7e, 0x54, 0x5e, 0x54, 0xca, 0x47, 0x87, 0x02, 0x3d, 0x54, 0xca, 0x3f, 0x98, + 0xe3, 0xdf, 0x4a, 0xde, 0xa8, 0x42, 0x78, 0x45, 0xd3, 0xf2, 0x6d, 0x53, 0xb7, 0x75, 0xf7, 0xae, + 0xff, 0x04, 0xd7, 0xc3, 0x96, 0xed, 0x37, 0x93, 0xe2, 0x11, 0x4f, 0x32, 0xef, 0xf9, 0xa6, 0x40, + 0xda, 0xd7, 0x1f, 0xc8, 0x8d, 0x13, 0x39, 0x5d, 0x04, 0x38, 0xe4, 0x29, 0xa9, 0x67, 0x55, 0xc7, + 0x33, 0x11, 0x7d, 0x20, 0x72, 0x3d, 0x67, 0xa2, 0x12, 0x08, 0xbf, 0xb6, 0x36, 0x30, 0xbc, 0x61, + 0x59, 0x34, 0x91, 0x49, 0xca, 0xcc, 0x4b, 0x1b, 0xb8, 0xba, 0xd7, 0x3a, 0x14, 0xe8, 0x81, 0x6a, + 0xac, 0x41, 0x1c, 0xff, 0x9a, 0x65, 0xd1, 0x9b, 0x24, 0x65, 0x86, 0x09, 0xaf, 0x23, 0x36, 0xa3, + 0x6b, 0x16, 0x99, 0xf7, 0x6c, 0xe0, 0xde, 0xf8, 0x4d, 0x39, 0xb8, 0xfc, 0xf5, 0x05, 0x01, 0xe7, + 0x29, 0x44, 0x67, 0x12, 0xf4, 0x99, 0x98, 0xf3, 0x4c, 0xb0, 0xfe, 0x27, 0x00, 0xf5, 0xb1, 0x88, + 0x8d, 0x8f, 0x00, 0xb6, 0x4f, 0x46, 0x4d, 0xf0, 0xe9, 0x5f, 0xc5, 0x67, 0x9c, 0xbb, 0xaf, 0xfe, + 0x53, 0xd0, 0xb4, 0xe2, 0xbd, 0xde, 0xec, 0x2c, 0xb0, 0xdd, 0x59, 0xe0, 0xe7, 0xce, 0x02, 0x9f, + 0xf7, 0x96, 0xb6, 0xdd, 0x5b, 0xda, 0xf7, 0xbd, 0xa5, 0xbd, 0xeb, 0xfd, 0x33, 0xc9, 0x15, 0xa1, + 0x0b, 0x39, 0x3d, 0xae, 0x65, 0x15, 0x6c, 0x70, 0x55, 0x2d, 0xd1, 0x8b, 0xdf, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xe7, 0x28, 0xaf, 0xe5, 0xb5, 0x02, 0x00, 0x00, } func (this *MsgCreateVestingAccount) Equal(that interface{}) bool { @@ -177,6 +223,91 @@ func (this *MsgCreateVestingAccount) Equal(that interface{}) bool { } return true } + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // CreateVestingAccount defines a method that enables creating a vesting + // account. + CreateVestingAccount(ctx context.Context, in *MsgCreateVestingAccount, opts ...grpc.CallOption) (*MsgCreateVestingAccountResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateVestingAccount(ctx context.Context, in *MsgCreateVestingAccount, opts ...grpc.CallOption) (*MsgCreateVestingAccountResponse, error) { + out := new(MsgCreateVestingAccountResponse) + err := c.cc.Invoke(ctx, "/cosmos.vesting.v1beta1.Msg/CreateVestingAccount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // CreateVestingAccount defines a method that enables creating a vesting + // account. + CreateVestingAccount(context.Context, *MsgCreateVestingAccount) (*MsgCreateVestingAccountResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreateVestingAccount(ctx context.Context, req *MsgCreateVestingAccount) (*MsgCreateVestingAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateVestingAccount not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreateVestingAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateVestingAccount) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateVestingAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.vesting.v1beta1.Msg/CreateVestingAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateVestingAccount(ctx, req.(*MsgCreateVestingAccount)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.vesting.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateVestingAccount", + Handler: _Msg_CreateVestingAccount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/vesting/v1beta1/tx.proto", +} + func (m *MsgCreateVestingAccount) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -243,6 +374,29 @@ func (m *MsgCreateVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgCreateVestingAccountResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateVestingAccountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateVestingAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -283,6 +437,15 @@ func (m *MsgCreateVestingAccount) Size() (n int) { return n } +func (m *MsgCreateVestingAccountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -479,6 +642,59 @@ func (m *MsgCreateVestingAccount) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgCreateVestingAccountResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateVestingAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateVestingAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/distribution/types/tx.pb.go b/x/distribution/types/tx.pb.go index 5d7d761de9..7748badacf 100644 --- a/x/distribution/types/tx.pb.go +++ b/x/distribution/types/tx.pb.go @@ -7,9 +7,9 @@ import ( context "context" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - grpc1 "github.com/gogo/protobuf/grpc" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -490,14 +490,14 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // ModifyWithdrawAddress defines a method to change the withdraw address + // SetWithdrawAddress defines a method to change the withdraw address // for a delegator (or validator self-delegation). SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAddress, opts ...grpc.CallOption) (*MsgSetWithdrawAddressResponse, error) // WithdrawDelegatorReward defines a method to withdraw rewards of delegator // from a single validator. WithdrawDelegatorReward(ctx context.Context, in *MsgWithdrawDelegatorReward, opts ...grpc.CallOption) (*MsgWithdrawDelegatorRewardResponse, error) // WithdrawValidatorCommission defines a method to withdraw the - // full commission to the validator address + // full commission to the validator address. WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) // FundCommunityPool defines a method to allow an account to directly // fund the community pool. @@ -550,14 +550,14 @@ func (c *msgClient) FundCommunityPool(ctx context.Context, in *MsgFundCommunityP // MsgServer is the server API for Msg service. type MsgServer interface { - // ModifyWithdrawAddress defines a method to change the withdraw address + // SetWithdrawAddress defines a method to change the withdraw address // for a delegator (or validator self-delegation). SetWithdrawAddress(context.Context, *MsgSetWithdrawAddress) (*MsgSetWithdrawAddressResponse, error) // WithdrawDelegatorReward defines a method to withdraw rewards of delegator // from a single validator. WithdrawDelegatorReward(context.Context, *MsgWithdrawDelegatorReward) (*MsgWithdrawDelegatorRewardResponse, error) // WithdrawValidatorCommission defines a method to withdraw the - // full commission to the validator address + // full commission to the validator address. WithdrawValidatorCommission(context.Context, *MsgWithdrawValidatorCommission) (*MsgWithdrawValidatorCommissionResponse, error) // FundCommunityPool defines a method to allow an account to directly // fund the community pool. diff --git a/x/ibc/light-clients/07-tendermint/types/tendermint.pb.go b/x/ibc/light-clients/07-tendermint/types/tendermint.pb.go index 1db3eef309..f4b26ae3c0 100644 --- a/x/ibc/light-clients/07-tendermint/types/tendermint.pb.go +++ b/x/ibc/light-clients/07-tendermint/types/tendermint.pb.go @@ -5,11 +5,6 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - time "time" - _go "github.com/confio/ics23/go" types "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" types2 "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types" @@ -21,6 +16,10 @@ import ( types1 "github.com/tendermint/tendermint/abci/types" github_com_tendermint_tendermint_libs_bytes "github.com/tendermint/tendermint/libs/bytes" types3 "github.com/tendermint/tendermint/proto/tendermint/types" + io "io" + math "math" + math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. From 6fa73998bd26cd7030c0595b638c2756c81ae28d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Mon, 19 Oct 2020 11:40:29 +0200 Subject: [PATCH 50/84] Fix solomachine cmds (#7581) * fix solo machine cli cmds * polish Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .../06-solomachine/client/cli/tx.go | 49 ++++++++----------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/x/ibc/light-clients/06-solomachine/client/cli/tx.go b/x/ibc/light-clients/06-solomachine/client/cli/tx.go index dc791f4a58..37db768a30 100644 --- a/x/ibc/light-clients/06-solomachine/client/cli/tx.go +++ b/x/ibc/light-clients/06-solomachine/client/cli/tx.go @@ -12,7 +12,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/version" clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/06-solomachine/types" @@ -25,11 +24,12 @@ const ( // NewCreateClientCmd defines the command to create a new solo machine client. func NewCreateClientCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "create [client-id] [sequence] [path/to/public-key.json] [diversifier] [timestamp]", - Short: "create new solo machine client", - Long: "create a new solo machine client with the specified identifier and public key", - Example: fmt.Sprintf("%s tx ibc %s create [client-id] [sequence] [public-key] [diversifier] [timestamp] --from node0 --home ../node0/cli --chain-id $CID", version.AppName, types.SubModuleName), - Args: cobra.ExactArgs(5), + Use: "create [client-id] [sequence] [path/to/consensus_state.json]", + Short: "create new solo machine client", + Long: `create a new solo machine client with the specified identifier and public key + - ConsensusState json example: {"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A/3SXL2ONYaOkxpdR5P8tHTlSlPv1AwQwSFxKRee5JQW"},"diversifier":"diversifier","timestamp":"10"}`, + Example: fmt.Sprintf("%s tx ibc %s create [client-id] [sequence] [path/to/consensus_state] --from node0 --home ../node0/cli --chain-id $CID", version.AppName, types.SubModuleName), + Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) clientCtx, err := client.ReadTxCommandFlags(clientCtx, cmd.Flags()) @@ -38,42 +38,29 @@ func NewCreateClientCmd() *cobra.Command { } clientID := args[0] - diversifier := args[3] sequence, err := strconv.ParseUint(args[1], 10, 64) if err != nil { return err } - timestamp, err := strconv.ParseUint(args[4], 10, 64) - if err != nil { - return err - } - cdc := codec.NewProtoCodec(clientCtx.InterfaceRegistry) - var publicKey *codectypes.Any - - // attempt to unmarshal public key argument - if err := cdc.UnmarshalJSON([]byte(args[2]), publicKey); err != nil { + // attempt to unmarshal consensus state argument + consensusState := &types.ConsensusState{} + if err := cdc.UnmarshalJSON([]byte(args[2]), consensusState); err != nil { // check for file path if JSON input is not provided contents, err := ioutil.ReadFile(args[2]) if err != nil { - return errors.New("neither JSON input nor path to .json file for public key were provided") + return errors.Wrap(err, "neither JSON input nor path to .json file for consensus state were provided") } - if err := cdc.UnmarshalJSON(contents, publicKey); err != nil { - return errors.Wrap(err, "error unmarshalling public key file") + if err := cdc.UnmarshalJSON(contents, consensusState); err != nil { + return errors.Wrap(err, "error unmarshalling consensus state file") } } - consensusState := &types.ConsensusState{ - PublicKey: publicKey, - Diversifier: diversifier, - Timestamp: timestamp, - } - allowUpdateAfterProposal, _ := cmd.Flags().GetBool(flagAllowUpdateAfterProposal) clientState := types.NewClientState(sequence, consensusState, allowUpdateAfterProposal) @@ -115,13 +102,15 @@ func NewUpdateClientCmd() *cobra.Command { cdc := codec.NewProtoCodec(clientCtx.InterfaceRegistry) - var header *types.Header + header := &types.Header{} if err := cdc.UnmarshalJSON([]byte(args[1]), header); err != nil { + // check for file path if JSON input is not provided contents, err := ioutil.ReadFile(args[1]) if err != nil { - return errors.New("neither JSON input nor path to .json file were provided") + return errors.Wrap(err, "neither JSON input nor path to .json file for header were provided") } + if err := cdc.UnmarshalJSON(contents, header); err != nil { return errors.Wrap(err, "error unmarshalling header file") } @@ -159,13 +148,15 @@ func NewSubmitMisbehaviourCmd() *cobra.Command { cdc := codec.NewProtoCodec(clientCtx.InterfaceRegistry) - var m *types.Misbehaviour + m := &types.Misbehaviour{} if err := cdc.UnmarshalJSON([]byte(args[0]), m); err != nil { + // check for file path if JSON input is not provided contents, err := ioutil.ReadFile(args[0]) if err != nil { - return errors.New("neither JSON input nor path to .json file were provided") + return errors.Wrap(err, "neither JSON input nor path to .json file for misbehaviour were provided") } + if err := cdc.UnmarshalJSON(contents, m); err != nil { return errors.Wrap(err, "error unmarshalling misbehaviour file") } From 0f8fdf60dfee893a7c5edfa444293b62e2ada7d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Mon, 19 Oct 2020 11:59:31 +0200 Subject: [PATCH 51/84] Remove ClientType func and update consensus state path (#7573) * update paths and remove unused func * fix bug Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Christopher Goes Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- x/ibc/core/02-client/keeper/grpc_query.go | 3 ++- x/ibc/core/02-client/keeper/keeper.go | 4 ++-- x/ibc/core/02-client/simulation/decoder.go | 3 --- .../core/02-client/simulation/decoder_test.go | 6 ------ x/ibc/core/24-host/keys.go | 18 ++++-------------- x/ibc/core/spec/02_state.md | 4 ++-- 6 files changed, 10 insertions(+), 28 deletions(-) diff --git a/x/ibc/core/02-client/keeper/grpc_query.go b/x/ibc/core/02-client/keeper/grpc_query.go index ba9429264e..eeb3c10b8f 100644 --- a/x/ibc/core/02-client/keeper/grpc_query.go +++ b/x/ibc/core/02-client/keeper/grpc_query.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" "strings" "google.golang.org/grpc/codes" @@ -151,7 +152,7 @@ func (q Keeper) ConsensusStates(c context.Context, req *types.QueryConsensusStat ctx := sdk.UnwrapSDKContext(c) consensusStates := []types.ConsensusStateWithHeight{} - store := prefix.NewStore(ctx.KVStore(q.storeKey), host.FullKeyClientPath(req.ClientId, []byte("consensusState/"))) + store := prefix.NewStore(ctx.KVStore(q.storeKey), host.FullKeyClientPath(req.ClientId, []byte(fmt.Sprintf("%s/", host.KeyConsensusStatesPrefix)))) pageRes, err := query.Paginate(store, req.Pagination, func(key, value []byte) error { height, err := types.ParseHeight(string(key)) diff --git a/x/ibc/core/02-client/keeper/keeper.go b/x/ibc/core/02-client/keeper/keeper.go index 2b03b7622d..68220db8af 100644 --- a/x/ibc/core/02-client/keeper/keeper.go +++ b/x/ibc/core/02-client/keeper/keeper.go @@ -90,8 +90,8 @@ func (k Keeper) IterateConsensusStates(ctx sdk.Context, cb func(clientID string, defer iterator.Close() for ; iterator.Valid(); iterator.Next() { keySplit := strings.Split(string(iterator.Key()), "/") - // consensus key is in the format "clients//consensusState/" - if len(keySplit) != 4 || keySplit[2] != "consensusState" { + // consensus key is in the format "clients//consensusStates/" + if len(keySplit) != 4 || keySplit[2] != string(host.KeyConsensusStatesPrefix) { continue } clientID := keySplit[1] diff --git a/x/ibc/core/02-client/simulation/decoder.go b/x/ibc/core/02-client/simulation/decoder.go index c5c1f72fe9..a5cff11d42 100644 --- a/x/ibc/core/02-client/simulation/decoder.go +++ b/x/ibc/core/02-client/simulation/decoder.go @@ -27,9 +27,6 @@ func NewDecodeStore(cdc ClientUnmarshaler, kvA, kvB kv.Pair) (string, bool) { clientStateB := cdc.MustUnmarshalClientState(kvB.Value) return fmt.Sprintf("ClientState A: %v\nClientState B: %v", clientStateA, clientStateB), true - case bytes.HasPrefix(kvA.Key, host.KeyClientStorePrefix) && bytes.HasSuffix(kvA.Key, host.KeyClientType()): - return fmt.Sprintf("Client type A: %s\nClient type B: %s", string(kvA.Value), string(kvB.Value)), true - case bytes.HasPrefix(kvA.Key, host.KeyClientStorePrefix) && bytes.Contains(kvA.Key, []byte("consensusState")): consensusStateA := cdc.MustUnmarshalConsensusState(kvA.Value) consensusStateB := cdc.MustUnmarshalConsensusState(kvB.Value) diff --git a/x/ibc/core/02-client/simulation/decoder_test.go b/x/ibc/core/02-client/simulation/decoder_test.go index e3b80549f4..6ee442eabf 100644 --- a/x/ibc/core/02-client/simulation/decoder_test.go +++ b/x/ibc/core/02-client/simulation/decoder_test.go @@ -13,7 +13,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" host "github.com/cosmos/cosmos-sdk/x/ibc/core/24-host" ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" - ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" ) func TestDecodeStore(t *testing.T) { @@ -36,10 +35,6 @@ func TestDecodeStore(t *testing.T) { Key: host.FullKeyClientPath(clientID, host.KeyClientState()), Value: app.IBCKeeper.ClientKeeper.MustMarshalClientState(clientState), }, - { - Key: host.FullKeyClientPath(clientID, host.KeyClientType()), - Value: []byte(ibctesting.Tendermint), - }, { Key: host.FullKeyClientPath(clientID, host.KeyConsensusState(height)), Value: app.IBCKeeper.ClientKeeper.MustMarshalConsensusState(consState), @@ -55,7 +50,6 @@ func TestDecodeStore(t *testing.T) { expectedLog string }{ {"ClientState", fmt.Sprintf("ClientState A: %v\nClientState B: %v", clientState, clientState)}, - {"client type", fmt.Sprintf("Client type A: %s\nClient type B: %s", ibctesting.Tendermint, ibctesting.Tendermint)}, {"ConsensusState", fmt.Sprintf("ConsensusState A: %v\nConsensusState B: %v", consState, consState)}, {"other", ""}, } diff --git a/x/ibc/core/24-host/keys.go b/x/ibc/core/24-host/keys.go index d266d25161..50249552c0 100644 --- a/x/ibc/core/24-host/keys.go +++ b/x/ibc/core/24-host/keys.go @@ -22,8 +22,9 @@ const ( // KVStore key prefixes for IBC var ( - KeyClientStorePrefix = []byte("clients") - KeyConnectionPrefix = []byte("connections") + KeyClientStorePrefix = []byte("clients") + KeyConsensusStatesPrefix = []byte("consensusStates") + KeyConnectionPrefix = []byte("connections") ) // KVStore key prefixes for IBC @@ -64,16 +65,10 @@ func ClientStatePath() string { return "clientState" } -// ClientTypePath takes an Identifier and returns Path under which to store the -// type of a particular client. -func ClientTypePath() string { - return "clientType" -} - // ConsensusStatePath takes an Identifier and returns a Path under which to // store the consensus state of a client. func ConsensusStatePath(height exported.Height) string { - return fmt.Sprintf("consensusState/%s", height) + return fmt.Sprintf("%s/%s", KeyConsensusStatesPrefix, height) } // KeyClientState returns the store key for a particular client state @@ -81,11 +76,6 @@ func KeyClientState() []byte { return []byte(ClientStatePath()) } -// KeyClientType returns the store key for type of a particular client -func KeyClientType() []byte { - return []byte(ClientTypePath()) -} - // KeyConsensusState returns the store key for the consensus state of a particular // client func KeyConsensusState(height exported.Height) []byte { diff --git a/x/ibc/core/spec/02_state.md b/x/ibc/core/spec/02_state.md index 4f4b5a1a39..a5381a735c 100644 --- a/x/ibc/core/spec/02_state.md +++ b/x/ibc/core/spec/02_state.md @@ -9,8 +9,8 @@ a prefix to the path to be able to aggregate the values for querying purposes. | Prefix | Path | Value type | |--------|------------------------------------------------------------------------|----------------| -| "0/" | "clients/{identifier}" | ClientState | -| "0/" | "clients/{identifier}/consensusState/{height}" | ConsensusState | +| "0/" | "clients/{identifier}/clientState" | ClientState | +| "0/" | "clients/{identifier}/consensusStates/{height}" | ConsensusState | | "0/" | "clients/{identifier}/type" | ClientType | | "0/" | "connections/{identifier}" | ConnectionEnd | | "0/" | "ports/{identifier}" | CapabilityKey | From 8eaf2ececcdee0ae0108b80bb68b11c9650320dd Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Mon, 19 Oct 2020 15:04:55 +0200 Subject: [PATCH 52/84] Refactor x/staking Validation and Delegation tests based on MsgCreateValidator.Pubkey type change. (#7526) * testing: refactore Validation and Delegation handling of x/staking This Changeset introduces set of improvements for writing tests. The idea is to create a testing subpackage which will provide functions to make tests more dev-friendly and wrap higher level use-cases. Here is a show-up of of creating a service for staking module for tests. This PR also changes the `x/staking/types.MsgCreateValidator.Pubkey` from string to types.Any. This change motivated the other change to show the pattern I'm describing here. * add validator checks * type change fixes * use deprecated * adding test slashing * new network comment update * working on tests * Fix TestMsgPkDecode test * Add UnpackInterfaces to MsgCreateValidator * Fix tests * Convert bech32 pubkey to proto * Fix test * fix v039/migrate_test/TestMigrate * fix tests * testslashing: rename Service to Helper * file rename * update TestMsgDecode Co-authored-by: blushi Co-authored-by: Amaury Martiny Co-authored-by: Cory Levinson --- codec/any_test.go | 3 +- codec/types/any.go | 18 + proto/cosmos/staking/v1beta1/tx.proto | 3 +- simapp/simd/cmd/testnet.go | 5 +- testutil/network/network.go | 4 +- types/address.go | 27 +- x/auth/types/account.go | 20 +- x/distribution/keeper/allocation_test.go | 67 +-- x/distribution/keeper/delegation_test.go | 151 ++--- x/distribution/keeper/grpc_query_test.go | 13 +- x/distribution/keeper/querier_test.go | 13 +- x/evidence/keeper/infraction_test.go | 33 +- x/evidence/keeper/init_test.go | 11 + x/evidence/keeper/keeper_test.go | 10 +- x/genutil/gentx_test.go | 23 +- x/genutil/types/genesis_state_test.go | 9 +- x/gov/abci_test.go | 10 +- x/gov/common_test.go | 13 +- x/slashing/abci_test.go | 13 +- x/slashing/app_test.go | 5 +- x/slashing/genesis_test.go | 6 +- x/slashing/handler_test.go | 102 ++-- x/slashing/init_test.go | 9 + x/slashing/keeper/grpc_query_test.go | 6 +- x/slashing/keeper/keeper_test.go | 107 ++-- x/slashing/keeper/querier_test.go | 5 +- x/slashing/keeper/test_common.go | 41 -- x/slashing/testslashing/params.go | 16 + x/staking/app_test.go | 5 +- x/staking/client/cli/tx.go | 11 +- x/staking/common_test.go | 12 - x/staking/handler_test.go | 690 ++++++----------------- x/staking/keeper/msg_server.go | 7 +- x/staking/simulation/operations.go | 5 +- x/staking/simulation/operations_test.go | 2 +- x/staking/teststaking/helper.go | 133 +++++ x/staking/types/msg.go | 34 +- x/staking/types/msg_test.go | 41 +- x/staking/types/tx.pb.go | 187 +++--- 39 files changed, 778 insertions(+), 1092 deletions(-) create mode 100644 x/evidence/keeper/init_test.go create mode 100644 x/slashing/init_test.go delete mode 100644 x/slashing/keeper/test_common.go create mode 100644 x/slashing/testslashing/params.go create mode 100644 x/staking/teststaking/helper.go diff --git a/codec/any_test.go b/codec/any_test.go index fff902c3d9..d9ea888c49 100644 --- a/codec/any_test.go +++ b/codec/any_test.go @@ -4,10 +4,9 @@ import ( "errors" "testing" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" ) diff --git a/codec/types/any.go b/codec/types/any.go index b879180481..38fe4b42aa 100644 --- a/codec/types/any.go +++ b/codec/types/any.go @@ -1,6 +1,7 @@ package types import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/gogo/protobuf/proto" ) @@ -98,6 +99,23 @@ func UnsafePackAny(x interface{}) *Any { return &Any{cachedValue: x} } +// PackAny is a checked and safe version of UnsafePackAny. It assures that +// `x` implements the proto.Message interface and uses it to serialize `x`. +// [DEPRECATED]: should be moved away: https://github.com/cosmos/cosmos-sdk/issues/7479 +func PackAny(x interface{}) (*Any, error) { + if x == nil { + return nil, nil + } + if intoany, ok := x.(IntoAny); ok { + return intoany.AsAny(), nil + } + protoMsg, ok := x.(proto.Message) + if !ok { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "Expecting %T to implement proto.Message", x) + } + return NewAnyWithValue(protoMsg) +} + // GetCachedValue returns the cached value from the Any if present func (any *Any) GetCachedValue() interface{} { return any.cachedValue diff --git a/proto/cosmos/staking/v1beta1/tx.proto b/proto/cosmos/staking/v1beta1/tx.proto index c68e037dca..60aecd9513 100644 --- a/proto/cosmos/staking/v1beta1/tx.proto +++ b/proto/cosmos/staking/v1beta1/tx.proto @@ -5,6 +5,7 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/staking/v1beta1/staking.proto"; +import "google/protobuf/any.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; @@ -43,7 +44,7 @@ message MsgCreateValidator { ]; string delegator_address = 4 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; string validator_address = 5 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - string pubkey = 6; + google.protobuf.Any pubkey = 6; cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false]; } diff --git a/simapp/simd/cmd/testnet.go b/simapp/simd/cmd/testnet.go index d93953e1f4..d17e57fb95 100644 --- a/simapp/simd/cmd/testnet.go +++ b/simapp/simd/cmd/testnet.go @@ -204,7 +204,7 @@ func InitTestnet( genAccounts = append(genAccounts, authtypes.NewBaseAccount(addr, nil, 0, 0)) valTokens := sdk.TokensFromConsensusPower(100) - createValMsg := stakingtypes.NewMsgCreateValidator( + createValMsg, err := stakingtypes.NewMsgCreateValidator( sdk.ValAddress(addr), valPubKeys[i], sdk.NewCoin(sdk.DefaultBondDenom, valTokens), @@ -212,6 +212,9 @@ func InitTestnet( stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()), sdk.OneInt(), ) + if err != nil { + return err + } txBuilder := clientCtx.TxConfig.NewTxBuilder() if err := txBuilder.SetMsgs(createValMsg); err != nil { diff --git a/testutil/network/network.go b/testutil/network/network.go index 914ed792dc..1ab9006f8e 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -162,6 +162,7 @@ type ( } ) +// New creates a new Network for integration tests. func New(t *testing.T, cfg Config) *Network { // only one caller/test can create and use a network at a time t.Log("acquiring test network lock") @@ -293,7 +294,7 @@ func New(t *testing.T, cfg Config) *Network { commission, err := sdk.NewDecFromStr("0.5") require.NoError(t, err) - createValMsg := stakingtypes.NewMsgCreateValidator( + createValMsg, err := stakingtypes.NewMsgCreateValidator( sdk.ValAddress(addr), valPubKeys[i], sdk.NewCoin(sdk.DefaultBondDenom, cfg.BondedTokens), @@ -301,6 +302,7 @@ func New(t *testing.T, cfg Config) *Network { stakingtypes.NewCommissionRates(commission, sdk.OneDec(), sdk.OneDec()), sdk.OneInt(), ) + require.NoError(t, err) p2pURL, err := url.Parse(p2pAddr) require.NoError(t, err) diff --git a/types/address.go b/types/address.go index 8683a50fe3..345c44fa8e 100644 --- a/types/address.go +++ b/types/address.go @@ -9,12 +9,15 @@ import ( "strings" "github.com/tendermint/tendermint/crypto" + tmed25519 "github.com/tendermint/tendermint/crypto/ed25519" yaml "gopkg.in/yaml.v2" "github.com/cosmos/cosmos-sdk/codec/legacy" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/types/bech32" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) const ( @@ -674,12 +677,32 @@ func GetPubKeyFromBech32(pkt Bech32PubKeyType, pubkeyStr string) (crypto.PubKey, return nil, err } - pk, err := cryptocodec.PubKeyFromBytes(bz) + aminoPk, err := cryptocodec.PubKeyFromBytes(bz) if err != nil { return nil, err } - return pk, nil + var protoPk crypto.PubKey + switch aminoPk.(type) { + + // We are bech32ifying some secp256k1 keys in tests. + case *secp256k1.PubKey: + protoPk = aminoPk + case *ed25519.PubKey: + protoPk = aminoPk + + // Real-life case. + case tmed25519.PubKey: + protoPk = &ed25519.PubKey{ + Key: aminoPk.Bytes(), + } + + default: + // We only allow ed25519 pubkeys to be bech32-ed right now. + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "bech32 pubkey does not support %T", aminoPk) + } + + return protoPk, nil } // MustGetPubKeyFromBech32 calls GetPubKeyFromBech32 except it panics on error. diff --git a/x/auth/types/account.go b/x/auth/types/account.go index 301a5af9e7..476e607c42 100644 --- a/x/auth/types/account.go +++ b/x/auth/types/account.go @@ -14,7 +14,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) var ( @@ -84,22 +83,11 @@ func (acc BaseAccount) GetPubKey() (pk crypto.PubKey) { // SetPubKey - Implements sdk.AccountI. func (acc *BaseAccount) SetPubKey(pubKey crypto.PubKey) error { - if pubKey == nil { - acc.PubKey = nil - } else { - protoMsg, ok := pubKey.(proto.Message) - if !ok { - return sdkerrors.ErrInvalidPubKey - } - - any, err := codectypes.NewAnyWithValue(protoMsg) - if err != nil { - return err - } - - acc.PubKey = any + any, err := codectypes.PackAny(pubKey) + if err != nil { + return err } - + acc.PubKey = any return nil } diff --git a/x/distribution/keeper/allocation_test.go b/x/distribution/keeper/allocation_test.go index 617cf1d4e5..bcb9e62aa2 100644 --- a/x/distribution/keeper/allocation_test.go +++ b/x/distribution/keeper/allocation_test.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/staking" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -20,20 +20,11 @@ func TestAllocateTokensToValidatorWithCommission(t *testing.T) { addrs := simapp.AddTestAddrs(app, ctx, 3, sdk.NewInt(1234)) valAddrs := simapp.ConvertAddrsToValAddrs(addrs) - - sh := staking.NewHandler(app.StakingKeeper) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // create validator with 50% commission - commission := stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) - msg := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(addrs[0]), valConsPk1, - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)), stakingtypes.Description{}, commission, sdk.OneInt(), - ) - - res, err := sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) - + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + tstaking.CreateValidator(sdk.ValAddress(addrs[0]), valConsPk1, 100, true) val := app.StakingKeeper.Validator(ctx, valAddrs[0]) // allocate tokens @@ -56,27 +47,17 @@ func TestAllocateTokensToManyValidators(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - sh := staking.NewHandler(app.StakingKeeper) addrs := simapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(1234)) valAddrs := simapp.ConvertAddrsToValAddrs(addrs) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // create validator with 50% commission - commission := stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) - msg := stakingtypes.NewMsgCreateValidator(valAddrs[0], valConsPk1, - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)), stakingtypes.Description{}, commission, sdk.OneInt()) - - res, err := sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + tstaking.CreateValidator(valAddrs[0], valConsPk1, 100, true) // create second validator with 0% commission - commission = stakingtypes.NewCommissionRates(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)) - msg = stakingtypes.NewMsgCreateValidator(valAddrs[1], valConsPk2, - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)), stakingtypes.Description{}, commission, sdk.OneInt()) - - res, err = sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)) + tstaking.CreateValidator(valAddrs[1], valConsPk2, 100, true) abciValA := abci.Validator{ Address: valConsPk1.Address(), @@ -101,7 +82,7 @@ func TestAllocateTokensToManyValidators(t *testing.T) { feeCollector := app.AccountKeeper.GetModuleAccount(ctx, types.FeeCollectorName) require.NotNil(t, feeCollector) - err = app.BankKeeper.SetBalances(ctx, feeCollector.GetAddress(), fees) + err := app.BankKeeper.SetBalances(ctx, feeCollector.GetAddress(), fees) require.NoError(t, err) app.AccountKeeper.SetAccount(ctx, feeCollector) @@ -138,31 +119,19 @@ func TestAllocateTokensTruncation(t *testing.T) { addrs := simapp.AddTestAddrs(app, ctx, 3, sdk.NewInt(1234)) valAddrs := simapp.ConvertAddrsToValAddrs(addrs) - sh := staking.NewHandler(app.StakingKeeper) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // create validator with 10% commission - commission := stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1), sdk.NewDec(0)) - msg := stakingtypes.NewMsgCreateValidator(valAddrs[0], valConsPk1, - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(110)), stakingtypes.Description{}, commission, sdk.OneInt()) - res, err := sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1), sdk.NewDec(0)) + tstaking.CreateValidator(valAddrs[0], valConsPk1, 110, true) // create second validator with 10% commission - commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1), sdk.NewDec(0)) - msg = stakingtypes.NewMsgCreateValidator(valAddrs[1], valConsPk2, - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)), stakingtypes.Description{}, commission, sdk.OneInt()) - res, err = sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1), sdk.NewDec(0)) + tstaking.CreateValidator(valAddrs[1], valConsPk2, 100, true) // create third validator with 10% commission - commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1), sdk.NewDec(0)) - msg = stakingtypes.NewMsgCreateValidator(valAddrs[2], valConsPk3, - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)), stakingtypes.Description{}, commission, sdk.OneInt()) - res, err = sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1), sdk.NewDec(0)) + tstaking.CreateValidator(valAddrs[2], valConsPk3, 100, true) abciValA := abci.Validator{ Address: valConsPk1.Address(), @@ -193,7 +162,7 @@ func TestAllocateTokensTruncation(t *testing.T) { feeCollector := app.AccountKeeper.GetModuleAccount(ctx, types.FeeCollectorName) require.NotNil(t, feeCollector) - err = app.BankKeeper.SetBalances(ctx, feeCollector.GetAddress(), fees) + err := app.BankKeeper.SetBalances(ctx, feeCollector.GetAddress(), fees) require.NoError(t, err) app.AccountKeeper.SetAccount(ctx, feeCollector) diff --git a/x/distribution/keeper/delegation_test.go b/x/distribution/keeper/delegation_test.go index 44135ce10f..e55acbe091 100644 --- a/x/distribution/keeper/delegation_test.go +++ b/x/distribution/keeper/delegation_test.go @@ -9,33 +9,26 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) func TestCalculateRewardsBasic(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - - sh := staking.NewHandler(app.StakingKeeper) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) addr := simapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(1000)) valAddrs := simapp.ConvertAddrsToValAddrs(addr) // create validator with 50% commission - commission := stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) - msg := stakingtypes.NewMsgCreateValidator( - valAddrs[0], valConsPk1, sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)), stakingtypes.Description{}, commission, sdk.OneInt(), - ) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + tstaking.CreateValidator(valAddrs[0], valConsPk1, 100, true) - res, err := sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) - - // end block to bond validator + // end block to bond validator and start new block staking.EndBlocker(ctx, app.StakingKeeper) - - // next block ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) + tstaking.Ctx = ctx // fetch validator and delegation val := app.StakingKeeper.Validator(ctx, valAddrs[0]) @@ -80,19 +73,12 @@ func TestCalculateRewardsAfterSlash(t *testing.T) { addr := simapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(100000000)) valAddrs := simapp.ConvertAddrsToValAddrs(addr) - - sh := staking.NewHandler(app.StakingKeeper) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // create validator with 50% commission - commission := stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) valPower := int64(100) - valTokens := sdk.TokensFromConsensusPower(valPower) - msg := stakingtypes.NewMsgCreateValidator(valAddrs[0], valConsPk1, - sdk.NewCoin(sdk.DefaultBondDenom, valTokens), stakingtypes.Description{}, commission, sdk.OneInt()) - - res, err := sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, true) // end block to bond validator staking.EndBlocker(ctx, app.StakingKeeper) @@ -148,20 +134,14 @@ func TestCalculateRewardsAfterManySlashes(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - sh := staking.NewHandler(app.StakingKeeper) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) addr := simapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(100000000)) valAddrs := simapp.ConvertAddrsToValAddrs(addr) // create validator with 50% commission - power := int64(100) - valTokens := sdk.TokensFromConsensusPower(power) - commission := stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) - msg := stakingtypes.NewMsgCreateValidator(valAddrs[0], valConsPk1, - sdk.NewCoin(sdk.DefaultBondDenom, valTokens), stakingtypes.Description{}, commission, sdk.OneInt()) - - res, err := sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) + valPower := int64(100) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, true) // end block to bond validator staking.EndBlocker(ctx, app.StakingKeeper) @@ -186,7 +166,7 @@ func TestCalculateRewardsAfterManySlashes(t *testing.T) { ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 3) // slash the validator by 50% - app.StakingKeeper.Slash(ctx, valConsAddr1, ctx.BlockHeight(), power, sdk.NewDecWithPrec(5, 1)) + app.StakingKeeper.Slash(ctx, valConsAddr1, ctx.BlockHeight(), valPower, sdk.NewDecWithPrec(5, 1)) // fetch the validator again val = app.StakingKeeper.Validator(ctx, valAddrs[0]) @@ -200,7 +180,7 @@ func TestCalculateRewardsAfterManySlashes(t *testing.T) { app.DistrKeeper.AllocateTokensToValidator(ctx, val, tokens) // slash the validator by 50% again - app.StakingKeeper.Slash(ctx, valConsAddr1, ctx.BlockHeight(), power/2, sdk.NewDecWithPrec(5, 1)) + app.StakingKeeper.Slash(ctx, valConsAddr1, ctx.BlockHeight(), valPower/2, sdk.NewDecWithPrec(5, 1)) // fetch the validator again val = app.StakingKeeper.Validator(ctx, valAddrs[0]) @@ -229,19 +209,13 @@ func TestCalculateRewardsMultiDelegator(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - sh := staking.NewHandler(app.StakingKeeper) - + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) addr := simapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(100000000)) valAddrs := simapp.ConvertAddrsToValAddrs(addr) // create validator with 50% commission - commission := stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) - msg := stakingtypes.NewMsgCreateValidator(valAddrs[0], valConsPk1, - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)), stakingtypes.Description{}, commission, sdk.OneInt()) - - res, err := sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + tstaking.CreateValidator(valAddrs[0], valConsPk1, 100, true) // end block to bond validator staking.EndBlocker(ctx, app.StakingKeeper) @@ -259,12 +233,8 @@ func TestCalculateRewardsMultiDelegator(t *testing.T) { app.DistrKeeper.AllocateTokensToValidator(ctx, val, tokens) // second delegation - msg2 := stakingtypes.NewMsgDelegate(sdk.AccAddress(valAddrs[1]), valAddrs[0], sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))) - - res, err = sh(ctx, msg2) - require.NoError(t, err) - require.NotNil(t, res) - + tstaking.Ctx = ctx + tstaking.Delegate(sdk.AccAddress(valAddrs[1]), valAddrs[0], 100) del2 := app.StakingKeeper.Delegation(ctx, sdk.AccAddress(valAddrs[1]), valAddrs[0]) // fetch updated validator @@ -306,8 +276,7 @@ func TestWithdrawDelegationRewardsBasic(t *testing.T) { addr := simapp.AddTestAddrs(app, ctx, 1, sdk.NewInt(1000000000)) valAddrs := simapp.ConvertAddrsToValAddrs(addr) - - sh := staking.NewHandler(app.StakingKeeper) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // set module account coins distrAcc := app.DistrKeeper.GetDistributionAccount(ctx) @@ -316,17 +285,8 @@ func TestWithdrawDelegationRewardsBasic(t *testing.T) { // create validator with 50% commission power := int64(100) - valTokens := sdk.TokensFromConsensusPower(power) - commission := stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) - msg := stakingtypes.NewMsgCreateValidator( - valAddrs[0], valConsPk1, - sdk.NewCoin(sdk.DefaultBondDenom, valTokens), - stakingtypes.Description{}, commission, sdk.OneInt(), - ) - - res, err := sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + valTokens := tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, power, true) // assert correct initial balance expTokens := balanceTokens.Sub(valTokens) @@ -354,7 +314,7 @@ func TestWithdrawDelegationRewardsBasic(t *testing.T) { require.Equal(t, uint64(2), app.DistrKeeper.GetValidatorHistoricalReferenceCount(ctx)) // withdraw rewards - _, err = app.DistrKeeper.WithdrawDelegationRewards(ctx, sdk.AccAddress(valAddrs[0]), valAddrs[0]) + _, err := app.DistrKeeper.WithdrawDelegationRewards(ctx, sdk.AccAddress(valAddrs[0]), valAddrs[0]) require.Nil(t, err) // historical count should still be 2 (added one record, cleared one) @@ -385,19 +345,12 @@ func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) { addr := simapp.AddTestAddrs(app, ctx, 1, sdk.NewInt(1000000000)) valAddrs := simapp.ConvertAddrsToValAddrs(addr) - - sh := staking.NewHandler(app.StakingKeeper) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // create validator with 50% commission - power := int64(100) - valTokens := sdk.TokensFromConsensusPower(power) - commission := stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) - msg := stakingtypes.NewMsgCreateValidator(valAddrs[0], valConsPk1, - sdk.NewCoin(sdk.DefaultBondDenom, valTokens), stakingtypes.Description{}, commission, sdk.OneInt()) - - res, err := sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) + valPower := int64(100) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, true) // end block to bond validator staking.EndBlocker(ctx, app.StakingKeeper) @@ -427,10 +380,10 @@ func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) { app.DistrKeeper.AllocateTokensToValidator(ctx, val, tokens) // slash the validator by 50% - app.StakingKeeper.Slash(ctx, valConsAddr1, ctx.BlockHeight(), power, sdk.NewDecWithPrec(5, 1)) + app.StakingKeeper.Slash(ctx, valConsAddr1, ctx.BlockHeight(), valPower, sdk.NewDecWithPrec(5, 1)) // slash the validator by 50% again - app.StakingKeeper.Slash(ctx, valConsAddr1, ctx.BlockHeight(), power/2, sdk.NewDecWithPrec(5, 1)) + app.StakingKeeper.Slash(ctx, valConsAddr1, ctx.BlockHeight(), valPower/2, sdk.NewDecWithPrec(5, 1)) // fetch the validator again val = app.StakingKeeper.Validator(ctx, valAddrs[0]) @@ -457,21 +410,15 @@ func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) { func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - sh := staking.NewHandler(app.StakingKeeper) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) addr := simapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(1000000000)) valAddrs := simapp.ConvertAddrsToValAddrs(addr) // create validator with 50% commission - commission := stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) - power := int64(100) - valTokens := sdk.TokensFromConsensusPower(power) - msg := stakingtypes.NewMsgCreateValidator(valAddrs[0], valConsPk1, - sdk.NewCoin(sdk.DefaultBondDenom, valTokens), stakingtypes.Description{}, commission, sdk.OneInt()) - - res, err := sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + valPower := int64(100) + tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, true) // end block to bond validator staking.EndBlocker(ctx, app.StakingKeeper) @@ -490,17 +437,11 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { // slash the validator ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 3) - app.StakingKeeper.Slash(ctx, valConsAddr1, ctx.BlockHeight(), power, sdk.NewDecWithPrec(5, 1)) + app.StakingKeeper.Slash(ctx, valConsAddr1, ctx.BlockHeight(), valPower, sdk.NewDecWithPrec(5, 1)) ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 3) // second delegation - delTokens := sdk.TokensFromConsensusPower(100) - msg2 := stakingtypes.NewMsgDelegate(sdk.AccAddress(valAddrs[1]), valAddrs[0], - sdk.NewCoin(sdk.DefaultBondDenom, delTokens)) - - res, err = sh(ctx, msg2) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.DelegateWithPower(sdk.AccAddress(valAddrs[1]), valAddrs[0], 100) del2 := app.StakingKeeper.Delegation(ctx, sdk.AccAddress(valAddrs[1]), valAddrs[0]) @@ -515,7 +456,7 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { // slash the validator again ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 3) - app.StakingKeeper.Slash(ctx, valConsAddr1, ctx.BlockHeight(), power, sdk.NewDecWithPrec(5, 1)) + app.StakingKeeper.Slash(ctx, valConsAddr1, ctx.BlockHeight(), valPower, sdk.NewDecWithPrec(5, 1)) ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 3) // fetch updated validator @@ -544,11 +485,9 @@ func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - sh := staking.NewHandler(app.StakingKeeper) - + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) addr := simapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(1000000000)) valAddrs := simapp.ConvertAddrsToValAddrs(addr) - initial := int64(20) // set module account coins @@ -560,13 +499,8 @@ func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) { tokens := sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, sdk.NewDec(initial))} // create validator with 50% commission - commission := stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) - msg := stakingtypes.NewMsgCreateValidator(valAddrs[0], valConsPk1, - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)), stakingtypes.Description{}, commission, sdk.OneInt()) - - res, err := sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + tstaking.CreateValidator(valAddrs[0], valConsPk1, 100, true) // end block to bond validator staking.EndBlocker(ctx, app.StakingKeeper) @@ -585,10 +519,7 @@ func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) { require.Equal(t, uint64(2), app.DistrKeeper.GetValidatorHistoricalReferenceCount(ctx)) // second delegation - msg2 := stakingtypes.NewMsgDelegate(sdk.AccAddress(valAddrs[1]), valAddrs[0], sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))) - res, err = sh(ctx, msg2) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Delegate(sdk.AccAddress(valAddrs[1]), valAddrs[0], 100) // historical count should be 3 (second delegation init) require.Equal(t, uint64(3), app.DistrKeeper.GetValidatorHistoricalReferenceCount(ctx)) diff --git a/x/distribution/keeper/grpc_query_test.go b/x/distribution/keeper/grpc_query_test.go index 92a9f3abb4..a101896fea 100644 --- a/x/distribution/keeper/grpc_query_test.go +++ b/x/distribution/keeper/grpc_query_test.go @@ -14,6 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/staking" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -340,15 +341,9 @@ func (suite *KeeperTestSuite) TestGRPCValidatorSlashes() { func (suite *KeeperTestSuite) TestGRPCDelegationRewards() { app, ctx, addrs, valAddrs := suite.app, suite.ctx, suite.addrs, suite.valAddrs - sh := staking.NewHandler(app.StakingKeeper) - comm := stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) - msg := stakingtypes.NewMsgCreateValidator( - valAddrs[0], valConsPk1, sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)), stakingtypes.Description{}, comm, sdk.OneInt(), - ) - - res, err := sh(ctx, msg) - suite.Require().NoError(err) - suite.Require().NotNil(res) + tstaking := teststaking.NewHelper(suite.T(), ctx, app.StakingKeeper) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + tstaking.CreateValidator(valAddrs[0], valConsPk1, 100, true) staking.EndBlocker(ctx, app.StakingKeeper) ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) diff --git a/x/distribution/keeper/querier_test.go b/x/distribution/keeper/querier_test.go index e801a4311d..c749bf7742 100644 --- a/x/distribution/keeper/querier_test.go +++ b/x/distribution/keeper/querier_test.go @@ -15,6 +15,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/distribution/keeper" "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/staking" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -169,15 +170,9 @@ func TestQueries(t *testing.T) { require.Equal(t, []types.ValidatorSlashEvent{slashOne, slashTwo}, slashes) // test delegation rewards query - sh := staking.NewHandler(app.StakingKeeper) - comm := stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) - msg := stakingtypes.NewMsgCreateValidator( - valOpAddr1, valConsPk1, sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)), stakingtypes.Description{}, comm, sdk.OneInt(), - ) - - res, err := sh(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + tstaking.CreateValidator(valOpAddr1, valConsPk1, 100, true) staking.EndBlocker(ctx, app.StakingKeeper) diff --git a/x/evidence/keeper/infraction_test.go b/x/evidence/keeper/infraction_test.go index 88f275c82d..0f1adee14f 100644 --- a/x/evidence/keeper/infraction_test.go +++ b/x/evidence/keeper/infraction_test.go @@ -6,32 +6,19 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/evidence/types" "github.com/cosmos/cosmos-sdk/x/staking" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - "github.com/tendermint/tendermint/crypto" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" ) -func newTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) *stakingtypes.MsgCreateValidator { - commission := stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) - return stakingtypes.NewMsgCreateValidator( - address, pubKey, sdk.NewCoin(sdk.DefaultBondDenom, amt), - stakingtypes.Description{}, commission, sdk.OneInt(), - ) -} - func (suite *KeeperTestSuite) TestHandleDoubleSign() { ctx := suite.ctx.WithIsCheckTx(false).WithBlockHeight(1) suite.populateValidators(ctx) power := int64(100) stakingParams := suite.app.StakingKeeper.GetParams(ctx) - selfDelegation := sdk.TokensFromConsensusPower(power) operatorAddr, val := valAddresses[0], pubkeys[0] + tstaking := teststaking.NewHelper(suite.T(), ctx, suite.app.StakingKeeper) - // create validator - res, err := staking.NewHandler(suite.app.StakingKeeper)(ctx, newTestMsgCreateValidator(operatorAddr, val, selfDelegation)) - suite.NoError(err) - suite.NotNil(res) + selfDelegation := tstaking.CreateValidatorWithValPower(operatorAddr, val, power, true) // execute end-blocker and verify validator attributes staking.EndBlocker(ctx, suite.app.StakingKeeper) @@ -79,10 +66,9 @@ func (suite *KeeperTestSuite) TestHandleDoubleSign() { del, _ := suite.app.StakingKeeper.GetDelegation(ctx, sdk.AccAddress(operatorAddr), operatorAddr) validator, _ := suite.app.StakingKeeper.GetValidator(ctx, operatorAddr) totalBond := validator.TokensFromShares(del.GetShares()).TruncateInt() - msgUnbond := stakingtypes.NewMsgUndelegate(sdk.AccAddress(operatorAddr), operatorAddr, sdk.NewCoin(stakingParams.BondDenom, totalBond)) - res, err = staking.NewHandler(suite.app.StakingKeeper)(ctx, msgUnbond) - suite.NoError(err) - suite.NotNil(res) + tstaking.Ctx = ctx + tstaking.Denom = stakingParams.BondDenom + tstaking.Undelegate(sdk.AccAddress(operatorAddr), operatorAddr, totalBond, true) } func (suite *KeeperTestSuite) TestHandleDoubleSign_TooOld() { @@ -91,13 +77,10 @@ func (suite *KeeperTestSuite) TestHandleDoubleSign_TooOld() { power := int64(100) stakingParams := suite.app.StakingKeeper.GetParams(ctx) - amt := sdk.TokensFromConsensusPower(power) operatorAddr, val := valAddresses[0], pubkeys[0] + tstaking := teststaking.NewHelper(suite.T(), ctx, suite.app.StakingKeeper) - // create validator - res, err := staking.NewHandler(suite.app.StakingKeeper)(ctx, newTestMsgCreateValidator(operatorAddr, val, amt)) - suite.NoError(err) - suite.NotNil(res) + amt := tstaking.CreateValidatorWithValPower(operatorAddr, val, power, true) // execute end-blocker and verify validator attributes staking.EndBlocker(ctx, suite.app.StakingKeeper) diff --git a/x/evidence/keeper/init_test.go b/x/evidence/keeper/init_test.go new file mode 100644 index 0000000000..d5854aab46 --- /dev/null +++ b/x/evidence/keeper/init_test.go @@ -0,0 +1,11 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/suite" +) + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} diff --git a/x/evidence/keeper/keeper_test.go b/x/evidence/keeper/keeper_test.go index 0017f12f25..65e52b30ed 100644 --- a/x/evidence/keeper/keeper_test.go +++ b/x/evidence/keeper/keeper_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "encoding/hex" "fmt" - "testing" "time" "github.com/stretchr/testify/suite" @@ -19,6 +18,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/evidence/exported" "github.com/cosmos/cosmos-sdk/x/evidence/keeper" "github.com/cosmos/cosmos-sdk/x/evidence/types" + "github.com/cosmos/cosmos-sdk/x/staking" ) var ( @@ -49,7 +49,7 @@ func newPubKey(pk string) (res crypto.PubKey) { return pubkey } -func testEquivocationHandler(k interface{}) types.Handler { +func testEquivocationHandler(_ interface{}) types.Handler { return func(ctx sdk.Context, e exported.Evidence) error { if err := e.ValidateBasic(); err != nil { return err @@ -75,6 +75,7 @@ type KeeperTestSuite struct { app *simapp.SimApp queryClient types.QueryClient + stakingHdl sdk.Handler } func (suite *KeeperTestSuite) SetupTest() { @@ -103,6 +104,7 @@ func (suite *KeeperTestSuite) SetupTest() { queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, app.InterfaceRegistry()) types.RegisterQueryServer(queryHelper, app.EvidenceKeeper) suite.queryClient = types.NewQueryClient(queryHelper) + suite.stakingHdl = staking.NewHandler(app.StakingKeeper) } func (suite *KeeperTestSuite) populateEvidence(ctx sdk.Context, numEvidence int) []exported.Evidence { @@ -208,7 +210,3 @@ func (suite *KeeperTestSuite) TestGetEvidenceHandler() { suite.Error(err) suite.Nil(handler) } - -func TestKeeperTestSuite(t *testing.T) { - suite.Run(t, new(KeeperTestSuite)) -} diff --git a/x/genutil/gentx_test.go b/x/genutil/gentx_test.go index c88d33fef9..671431ed9e 100644 --- a/x/genutil/gentx_test.go +++ b/x/genutil/gentx_test.go @@ -29,10 +29,6 @@ var ( addr2 = sdk.AccAddress(pk2.Address()) desc = stakingtypes.NewDescription("testname", "", "", "", "") comm = stakingtypes.CommissionRates{} - msg1 = stakingtypes.NewMsgCreateValidator(sdk.ValAddress(pk1.Address()), pk1, - sdk.NewInt64Coin(sdk.DefaultBondDenom, 50), desc, comm, sdk.OneInt()) - msg2 = stakingtypes.NewMsgCreateValidator(sdk.ValAddress(pk2.Address()), pk1, - sdk.NewInt64Coin(sdk.DefaultBondDenom, 50), desc, comm, sdk.OneInt()) ) // GenTxTestSuite is a test suite to be used with gentx tests. @@ -42,6 +38,8 @@ type GenTxTestSuite struct { ctx sdk.Context app *simapp.SimApp encodingConfig simappparams.EncodingConfig + + msg1, msg2 *stakingtypes.MsgCreateValidator } func (suite *GenTxTestSuite) SetupTest() { @@ -49,8 +47,17 @@ func (suite *GenTxTestSuite) SetupTest() { app := simapp.Setup(checkTx) suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{}) suite.app = app - suite.encodingConfig = simapp.MakeEncodingConfig() + + var err error + amount := sdk.NewInt64Coin(sdk.DefaultBondDenom, 50) + one := sdk.OneInt() + suite.msg1, err = stakingtypes.NewMsgCreateValidator( + sdk.ValAddress(pk1.Address()), pk1, amount, desc, comm, one) + suite.NoError(err) + suite.msg2, err = stakingtypes.NewMsgCreateValidator( + sdk.ValAddress(pk2.Address()), pk1, amount, desc, comm, one) + suite.NoError(err) } func (suite *GenTxTestSuite) setAccountBalance(addr sdk.AccAddress, amount int64) json.RawMessage { @@ -83,7 +90,7 @@ func (suite *GenTxTestSuite) TestSetGenTxsInAppGenesisState() { { "one genesis transaction", func() { - err := txBuilder.SetMsgs(msg1) + err := txBuilder.SetMsgs(suite.msg1) suite.Require().NoError(err) tx := txBuilder.GetTx() genTxs = []sdk.Tx{tx} @@ -93,7 +100,7 @@ func (suite *GenTxTestSuite) TestSetGenTxsInAppGenesisState() { { "two genesis transactions", func() { - err := txBuilder.SetMsgs(msg1, msg2) + err := txBuilder.SetMsgs(suite.msg1, suite.msg2) suite.Require().NoError(err) tx := txBuilder.GetTx() genTxs = []sdk.Tx{tx} @@ -211,7 +218,7 @@ func (suite *GenTxTestSuite) TestDeliverGenTxs() { { "no signature supplied", func() { - err := txBuilder.SetMsgs(msg1) + err := txBuilder.SetMsgs(suite.msg1) suite.Require().NoError(err) genTxs = make([]json.RawMessage, 1) diff --git a/x/genutil/types/genesis_state_test.go b/x/genutil/types/genesis_state_test.go index 475a9478f2..ce0015420d 100644 --- a/x/genutil/types/genesis_state_test.go +++ b/x/genutil/types/genesis_state_test.go @@ -37,16 +37,17 @@ func TestValidateGenesisMultipleMessages(t *testing.T) { desc := stakingtypes.NewDescription("testname", "", "", "", "") comm := stakingtypes.CommissionRates{} - msg1 := stakingtypes.NewMsgCreateValidator(sdk.ValAddress(pk1.Address()), pk1, + msg1, err := stakingtypes.NewMsgCreateValidator(sdk.ValAddress(pk1.Address()), pk1, sdk.NewInt64Coin(sdk.DefaultBondDenom, 50), desc, comm, sdk.OneInt()) + require.NoError(t, err) - msg2 := stakingtypes.NewMsgCreateValidator(sdk.ValAddress(pk2.Address()), pk2, + msg2, err := stakingtypes.NewMsgCreateValidator(sdk.ValAddress(pk2.Address()), pk2, sdk.NewInt64Coin(sdk.DefaultBondDenom, 50), desc, comm, sdk.OneInt()) + require.NoError(t, err) txGen := simapp.MakeEncodingConfig().TxConfig txBuilder := txGen.NewTxBuilder() - err := txBuilder.SetMsgs(msg1, msg2) - require.NoError(t, err) + require.NoError(t, txBuilder.SetMsgs(msg1, msg2)) tx := txBuilder.GetTx() genesisState := types.NewGenesisStateFromTx(txGen.TxJSONEncoder(), []sdk.Tx{tx}) diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 70a172ee1b..bfda1b3590 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -298,9 +298,7 @@ func TestProposalPassedEndblocker(t *testing.T) { proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromConsensusPower(10))} newDepositMsg := types.NewMsgDeposit(addrs[0], proposal.ProposalId, proposalCoins) - res, err := handler(ctx, newDepositMsg) - require.NoError(t, err) - require.NotNil(t, res) + handleAndCheck(t, handler, ctx, newDepositMsg) macc = app.GovKeeper.GetGovernanceAccount(ctx) require.NotNil(t, macc) @@ -330,9 +328,7 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { SortAddresses(addrs) - handler := gov.NewHandler(app.GovKeeper) stakingHandler := staking.NewHandler(app.StakingKeeper) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) @@ -350,9 +346,7 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { proposalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromConsensusPower(10))) newDepositMsg := types.NewMsgDeposit(addrs[0], proposal.ProposalId, proposalCoins) - res, err := handler(ctx, newDepositMsg) - require.NoError(t, err) - require.NotNil(t, res) + handleAndCheck(t, gov.NewHandler(app.GovKeeper), ctx, newDepositMsg) err = app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], types.OptionYes) require.NoError(t, err) diff --git a/x/gov/common_test.go b/x/gov/common_test.go index aef391d794..d8648b478a 100644 --- a/x/gov/common_test.go +++ b/x/gov/common_test.go @@ -82,15 +82,18 @@ func createValidators(t *testing.T, stakingHandler sdk.Handler, ctx sdk.Context, require.True(t, len(addrs) <= len(pubkeys), "Not enough pubkeys specified at top of file.") for i := 0; i < len(addrs); i++ { - valTokens := sdk.TokensFromConsensusPower(powerAmt[i]) - valCreateMsg := stakingtypes.NewMsgCreateValidator( + valCreateMsg, err := stakingtypes.NewMsgCreateValidator( addrs[i], pubkeys[i], sdk.NewCoin(sdk.DefaultBondDenom, valTokens), TestDescription, TestCommissionRates, sdk.OneInt(), ) - - res, err := stakingHandler(ctx, valCreateMsg) require.NoError(t, err) - require.NotNil(t, res) + handleAndCheck(t, stakingHandler, ctx, valCreateMsg) } } + +func handleAndCheck(t *testing.T, h sdk.Handler, ctx sdk.Context, msg sdk.Msg) { + res, err := h(ctx, msg) + require.NoError(t, err) + require.NotNil(t, res) +} diff --git a/x/slashing/abci_test.go b/x/slashing/abci_test.go index 484870719b..2d5430700c 100644 --- a/x/slashing/abci_test.go +++ b/x/slashing/abci_test.go @@ -11,8 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing" - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" "github.com/cosmos/cosmos-sdk/x/staking" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -22,20 +22,15 @@ func TestBeginBlocker(t *testing.T) { pks := simapp.CreateTestPubKeys(1) simapp.AddTestAddrsFromPubKeys(app, ctx, pks, sdk.TokensFromConsensusPower(200)) - - power := int64(100) - amt := sdk.TokensFromConsensusPower(power) addr, pk := sdk.ValAddress(pks[0].Address()), pks[0] + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // bond the validator - res, err := staking.NewHandler(app.StakingKeeper)(ctx, slashingkeeper.NewTestMsgCreateValidator(addr, pk, amt)) - require.NoError(t, err) - require.NotNil(t, res) - + amt := tstaking.CreateValidatorWithValPower(addr, pk, 100, true) staking.EndBlocker(ctx, app.StakingKeeper) require.Equal( t, app.BankKeeper.GetAllBalances(ctx, sdk.AccAddress(addr)), - sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.GetParams(ctx).BondDenom, slashingkeeper.InitTokens.Sub(amt))), + sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.GetParams(ctx).BondDenom, InitTokens.Sub(amt))), ) require.Equal(t, amt, app.StakingKeeper.Validator(ctx, addr).GetBondedTokens()) diff --git a/x/slashing/app_test.go b/x/slashing/app_test.go index 3e4735e43a..f16bfb36f1 100644 --- a/x/slashing/app_test.go +++ b/x/slashing/app_test.go @@ -63,13 +63,14 @@ func TestSlashingMsgs(t *testing.T) { description := stakingtypes.NewDescription("foo_moniker", "", "", "", "") commission := stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) - createValidatorMsg := stakingtypes.NewMsgCreateValidator( + createValidatorMsg, err := stakingtypes.NewMsgCreateValidator( sdk.ValAddress(addr1), valKey.PubKey(), bondCoin, description, commission, sdk.OneInt(), ) + require.NoError(t, err) header := tmproto.Header{Height: app.LastBlockHeight() + 1} txGen := simapp.MakeEncodingConfig().TxConfig - _, _, err := simapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{createValidatorMsg}, "", []uint64{0}, []uint64{0}, true, true, priv1) + _, _, err = simapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{createValidatorMsg}, "", []uint64{0}, []uint64{0}, true, true, priv1) require.NoError(t, err) simapp.CheckBalance(t, app, addr1, sdk.Coins{genCoin.Sub(bondCoin)}) diff --git a/x/slashing/genesis_test.go b/x/slashing/genesis_test.go index 8b9b9a4639..b9241f0246 100644 --- a/x/slashing/genesis_test.go +++ b/x/slashing/genesis_test.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing" - "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + "github.com/cosmos/cosmos-sdk/x/slashing/testslashing" "github.com/cosmos/cosmos-sdk/x/slashing/types" ) @@ -18,7 +18,7 @@ func TestExportAndInitGenesis(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - app.SlashingKeeper.SetParams(ctx, keeper.TestParams()) + app.SlashingKeeper.SetParams(ctx, testslashing.TestParams()) addrDels := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.TokensFromConsensusPower(200)) @@ -31,7 +31,7 @@ func TestExportAndInitGenesis(t *testing.T) { app.SlashingKeeper.SetValidatorSigningInfo(ctx, sdk.ConsAddress(addrDels[1]), info2) genesisState := slashing.ExportGenesis(ctx, app.SlashingKeeper) - require.Equal(t, genesisState.Params, keeper.TestParams()) + require.Equal(t, genesisState.Params, testslashing.TestParams()) require.Len(t, genesisState.SigningInfos, 2) require.Equal(t, genesisState.SigningInfos[0].ValidatorSigningInfo, info1) diff --git a/x/slashing/handler_test.go b/x/slashing/handler_test.go index 3e5bba742c..c392bde585 100644 --- a/x/slashing/handler_test.go +++ b/x/slashing/handler_test.go @@ -6,18 +6,18 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/testutil/testdata" - - "github.com/stretchr/testify/require" - "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + "github.com/cosmos/cosmos-sdk/x/slashing/testslashing" "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -25,29 +25,23 @@ func TestCannotUnjailUnlessJailed(t *testing.T) { // initial setup app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - pks := simapp.CreateTestPubKeys(1) simapp.AddTestAddrsFromPubKeys(app, ctx, pks, sdk.TokensFromConsensusPower(200)) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) slh := slashing.NewHandler(app.SlashingKeeper) - amt := sdk.TokensFromConsensusPower(100) addr, val := sdk.ValAddress(pks[0].Address()), pks[0] - msg := keeper.NewTestMsgCreateValidator(addr, val, amt) - res, err := staking.NewHandler(app.StakingKeeper)(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) - + amt := tstaking.CreateValidatorWithValPower(addr, val, 100, true) staking.EndBlocker(ctx, app.StakingKeeper) - require.Equal( t, app.BankKeeper.GetAllBalances(ctx, sdk.AccAddress(addr)), - sdk.Coins{sdk.NewCoin(app.StakingKeeper.GetParams(ctx).BondDenom, keeper.InitTokens.Sub(amt))}, + sdk.Coins{sdk.NewCoin(app.StakingKeeper.GetParams(ctx).BondDenom, InitTokens.Sub(amt))}, ) require.Equal(t, amt, app.StakingKeeper.Validator(ctx, addr).GetBondedTokens()) // assert non-jailed validator can't be unjailed - res, err = slh(ctx, types.NewMsgUnjail(addr)) + res, err := slh(ctx, types.NewMsgUnjail(addr)) require.Error(t, err) require.Nil(t, res) require.True(t, errors.Is(types.ErrValidatorNotJailed, err)) @@ -60,33 +54,25 @@ func TestCannotUnjailUnlessMeetMinSelfDelegation(t *testing.T) { pks := simapp.CreateTestPubKeys(1) simapp.AddTestAddrsFromPubKeys(app, ctx, pks, sdk.TokensFromConsensusPower(200)) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) slh := slashing.NewHandler(app.SlashingKeeper) - amtInt := int64(100) - addr, val, amt := sdk.ValAddress(pks[0].Address()), pks[0], sdk.TokensFromConsensusPower(amtInt) - msg := keeper.NewTestMsgCreateValidator(addr, val, amt) + addr, val := sdk.ValAddress(pks[0].Address()), pks[0] + amt := sdk.TokensFromConsensusPower(100) + msg := tstaking.CreateValidatorMsg(addr, val, amt.Int64()) msg.MinSelfDelegation = amt - - res, err := staking.NewHandler(app.StakingKeeper)(ctx, msg) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Handle(msg, true) staking.EndBlocker(ctx, app.StakingKeeper) - require.Equal( t, app.BankKeeper.GetAllBalances(ctx, sdk.AccAddress(addr)), - sdk.Coins{sdk.NewCoin(app.StakingKeeper.GetParams(ctx).BondDenom, keeper.InitTokens.Sub(amt))}, + sdk.Coins{sdk.NewCoin(app.StakingKeeper.GetParams(ctx).BondDenom, InitTokens.Sub(amt))}, ) - unbondAmt := sdk.NewCoin(app.StakingKeeper.GetParams(ctx).BondDenom, sdk.OneInt()) - undelegateMsg := stakingtypes.NewMsgUndelegate(sdk.AccAddress(addr), addr, unbondAmt) - res, err = staking.NewHandler(app.StakingKeeper)(ctx, undelegateMsg) - require.NoError(t, err) - require.NotNil(t, res) - + tstaking.Undelegate(sdk.AccAddress(addr), addr, sdk.OneInt(), true) require.True(t, app.StakingKeeper.Validator(ctx, addr).IsJailed()) // assert non-jailed validator can't be unjailed - res, err = slh(ctx, types.NewMsgUnjail(addr)) + res, err := slh(ctx, types.NewMsgUnjail(addr)) require.Error(t, err) require.Nil(t, res) require.True(t, errors.Is(types.ErrSelfDelegationTooLowToUnjail, err)) @@ -96,25 +82,17 @@ func TestJailedValidatorDelegations(t *testing.T) { // initial setup app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{Time: time.Unix(0, 0)}) - pks := simapp.CreateTestPubKeys(3) - simapp.AddTestAddrsFromPubKeys(app, ctx, pks, sdk.TokensFromConsensusPower(20)) - app.SlashingKeeper.SetParams(ctx, keeper.TestParams()) + simapp.AddTestAddrsFromPubKeys(app, ctx, pks, sdk.TokensFromConsensusPower(20)) + app.SlashingKeeper.SetParams(ctx, testslashing.TestParams()) + + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) stakingParams := app.StakingKeeper.GetParams(ctx) app.StakingKeeper.SetParams(ctx, stakingParams) - - // create a validator - bondAmount := sdk.TokensFromConsensusPower(10) - valPubKey := pks[1] valAddr, consAddr := sdk.ValAddress(pks[1].Address()), sdk.ConsAddress(pks[0].Address()) - msgCreateVal := keeper.NewTestMsgCreateValidator(valAddr, valPubKey, bondAmount) - res, err := staking.NewHandler(app.StakingKeeper)(ctx, msgCreateVal) - require.NoError(t, err) - require.NotNil(t, res) - - // end block + amt := tstaking.CreateValidatorWithValPower(valAddr, pks[1], 10, true) staking.EndBlocker(ctx, app.StakingKeeper) // set dummy signing info @@ -123,20 +101,12 @@ func TestJailedValidatorDelegations(t *testing.T) { // delegate tokens to the validator delAddr := sdk.AccAddress(pks[2].Address()) - msgDelegate := keeper.NewTestMsgDelegate(delAddr, valAddr, bondAmount) - res, err = staking.NewHandler(app.StakingKeeper)(ctx, msgDelegate) - require.NoError(t, err) - require.NotNil(t, res) - - unbondAmt := sdk.NewCoin(app.StakingKeeper.GetParams(ctx).BondDenom, bondAmount) + tstaking.Delegate(delAddr, valAddr, amt.Int64()) // unbond validator total self-delegations (which should jail the validator) - msgUndelegate := stakingtypes.NewMsgUndelegate(sdk.AccAddress(valAddr), valAddr, unbondAmt) - res, err = staking.NewHandler(app.StakingKeeper)(ctx, msgUndelegate) - require.NoError(t, err) - require.NotNil(t, res) - - _, err = app.StakingKeeper.CompleteUnbonding(ctx, sdk.AccAddress(valAddr), valAddr) + valAcc := sdk.AccAddress(valAddr) + tstaking.Undelegate(valAcc, valAddr, amt, true) + _, err := app.StakingKeeper.CompleteUnbonding(ctx, sdk.AccAddress(valAddr), valAddr) require.Nil(t, err, "expected complete unbonding validator to be ok, got: %v", err) // verify validator still exists and is jailed @@ -145,15 +115,12 @@ func TestJailedValidatorDelegations(t *testing.T) { require.True(t, validator.IsJailed()) // verify the validator cannot unjail itself - res, err = slashing.NewHandler(app.SlashingKeeper)(ctx, types.NewMsgUnjail(valAddr)) + res, err := slashing.NewHandler(app.SlashingKeeper)(ctx, types.NewMsgUnjail(valAddr)) require.Error(t, err) require.Nil(t, res) // self-delegate to validator - msgSelfDelegate := keeper.NewTestMsgDelegate(sdk.AccAddress(valAddr), valAddr, bondAmount) - res, err = staking.NewHandler(app.StakingKeeper)(ctx, msgSelfDelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Delegate(valAcc, valAddr, amt.Int64()) // verify the validator can now unjail itself res, err = slashing.NewHandler(app.SlashingKeeper)(ctx, types.NewMsgUnjail(valAddr)) @@ -177,26 +144,21 @@ func TestHandleAbsentValidator(t *testing.T) { // initial setup app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{Time: time.Unix(0, 0)}) - pks := simapp.CreateTestPubKeys(1) simapp.AddTestAddrsFromPubKeys(app, ctx, pks, sdk.TokensFromConsensusPower(200)) - app.SlashingKeeper.SetParams(ctx, keeper.TestParams()) + app.SlashingKeeper.SetParams(ctx, testslashing.TestParams()) power := int64(100) - amt := sdk.TokensFromConsensusPower(power) addr, val := sdk.ValAddress(pks[0].Address()), pks[0] - sh := staking.NewHandler(app.StakingKeeper) slh := slashing.NewHandler(app.SlashingKeeper) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) - res, err := sh(ctx, keeper.NewTestMsgCreateValidator(addr, val, amt)) - require.NoError(t, err) - require.NotNil(t, res) - + amt := tstaking.CreateValidatorWithValPower(addr, val, power, true) staking.EndBlocker(ctx, app.StakingKeeper) require.Equal( t, app.BankKeeper.GetAllBalances(ctx, sdk.AccAddress(addr)), - sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.GetParams(ctx).BondDenom, keeper.InitTokens.Sub(amt))), + sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.GetParams(ctx).BondDenom, InitTokens.Sub(amt))), ) require.Equal(t, amt, app.StakingKeeper.Validator(ctx, addr).GetBondedTokens()) @@ -274,7 +236,7 @@ func TestHandleAbsentValidator(t *testing.T) { require.Equal(t, amt.Int64()-slashAmt, validator.GetTokens().Int64()) // unrevocation should fail prior to jail expiration - res, err = slh(ctx, types.NewMsgUnjail(addr)) + res, err := slh(ctx, types.NewMsgUnjail(addr)) require.Error(t, err) require.Nil(t, res) diff --git a/x/slashing/init_test.go b/x/slashing/init_test.go new file mode 100644 index 0000000000..25a38a2d5e --- /dev/null +++ b/x/slashing/init_test.go @@ -0,0 +1,9 @@ +package slashing_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + InitTokens = sdk.TokensFromConsensusPower(200) +) diff --git a/x/slashing/keeper/grpc_query_test.go b/x/slashing/keeper/grpc_query_test.go index 199fd9b05e..d923b822c7 100644 --- a/x/slashing/keeper/grpc_query_test.go +++ b/x/slashing/keeper/grpc_query_test.go @@ -14,7 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + "github.com/cosmos/cosmos-sdk/x/slashing/testslashing" "github.com/cosmos/cosmos-sdk/x/slashing/types" ) @@ -33,7 +33,7 @@ func (suite *SlashingTestSuite) SetupTest() { app.AccountKeeper.SetParams(ctx, authtypes.DefaultParams()) app.BankKeeper.SetParams(ctx, banktypes.DefaultParams()) - app.SlashingKeeper.SetParams(ctx, keeper.TestParams()) + app.SlashingKeeper.SetParams(ctx, testslashing.TestParams()) addrDels := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.TokensFromConsensusPower(200)) @@ -60,7 +60,7 @@ func (suite *SlashingTestSuite) TestGRPCQueryParams() { paramsResp, err := queryClient.Params(gocontext.Background(), &types.QueryParamsRequest{}) suite.NoError(err) - suite.Equal(keeper.TestParams(), paramsResp.Params) + suite.Equal(testslashing.TestParams(), paramsResp.Params) } func (suite *SlashingTestSuite) TestGRPCSigningInfo() { diff --git a/x/slashing/keeper/keeper_test.go b/x/slashing/keeper/keeper_test.go index d8e49a11c5..035090341c 100644 --- a/x/slashing/keeper/keeper_test.go +++ b/x/slashing/keeper/keeper_test.go @@ -9,8 +9,9 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + "github.com/cosmos/cosmos-sdk/x/slashing/testslashing" "github.com/cosmos/cosmos-sdk/x/staking" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -22,19 +23,15 @@ func TestUnJailNotBonded(t *testing.T) { p.MaxValidators = 5 app.StakingKeeper.SetParams(ctx, p) - amt := sdk.TokensFromConsensusPower(100) - sh := staking.NewHandler(app.StakingKeeper) - addrDels := simapp.AddTestAddrsIncremental(app, ctx, 6, sdk.TokensFromConsensusPower(200)) valAddrs := simapp.ConvertAddrsToValAddrs(addrDels) pks := simapp.CreateTestPubKeys(6) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // create max (5) validators all with the same power for i := uint32(0); i < p.MaxValidators; i++ { addr, val := valAddrs[i], pks[i] - res, err := sh(ctx, keeper.NewTestMsgCreateValidator(addr, val, amt)) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.CreateValidatorWithValPower(addr, val, 100, true) } staking.EndBlocker(ctx, app.StakingKeeper) @@ -42,45 +39,33 @@ func TestUnJailNotBonded(t *testing.T) { // create a 6th validator with less power than the cliff validator (won't be bonded) addr, val := valAddrs[5], pks[5] - createValMsg := keeper.NewTestMsgCreateValidator(addr, val, sdk.TokensFromConsensusPower(50)) - createValMsg.MinSelfDelegation = sdk.TokensFromConsensusPower(50) - res, err := sh(ctx, createValMsg) - require.NoError(t, err) - require.NotNil(t, res) + amt := sdk.TokensFromConsensusPower(50) + msg := tstaking.CreateValidatorMsg(addr, val, amt.Int64()) + msg.MinSelfDelegation = amt + tstaking.Handle(msg, true) staking.EndBlocker(ctx, app.StakingKeeper) ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - validator, ok := app.StakingKeeper.GetValidator(ctx, addr) - require.True(t, ok) - require.False(t, validator.Jailed) - require.Equal(t, stakingtypes.BondStatusUnbonded, validator.GetStatus().String()) + tstaking.CheckValidator(addr, stakingtypes.Unbonded, false) // unbond below minimum self-delegation - msgUnbond := stakingtypes.NewMsgUndelegate(sdk.AccAddress(addr), addr, sdk.NewCoin(p.BondDenom, sdk.TokensFromConsensusPower(1))) - res, err = sh(ctx, msgUnbond) - require.NoError(t, err) - require.NotNil(t, res) + require.Equal(t, p.BondDenom, tstaking.Denom) + tstaking.Undelegate(sdk.AccAddress(addr), addr, sdk.TokensFromConsensusPower(1), true) staking.EndBlocker(ctx, app.StakingKeeper) ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) // verify that validator is jailed - validator, ok = app.StakingKeeper.GetValidator(ctx, addr) - require.True(t, ok) - require.True(t, validator.Jailed) + tstaking.CheckValidator(addr, -1, true) // verify we cannot unjail (yet) require.Error(t, app.SlashingKeeper.Unjail(ctx, addr)) staking.EndBlocker(ctx, app.StakingKeeper) ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - // bond to meet minimum self-delegation - msgBond := stakingtypes.NewMsgDelegate(sdk.AccAddress(addr), addr, sdk.NewCoin(p.BondDenom, sdk.TokensFromConsensusPower(1))) - res, err = sh(ctx, msgBond) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.DelegateWithPower(sdk.AccAddress(addr), addr, 1) staking.EndBlocker(ctx, app.StakingKeeper) ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) @@ -88,9 +73,7 @@ func TestUnJailNotBonded(t *testing.T) { // verify we can immediately unjail require.NoError(t, app.SlashingKeeper.Unjail(ctx, addr)) - validator, ok = app.StakingKeeper.GetValidator(ctx, addr) - require.True(t, ok) - require.False(t, validator.Jailed) + tstaking.CheckValidator(addr, -1, false) } // Test a new validator entering the validator set @@ -103,20 +86,14 @@ func TestHandleNewValidator(t *testing.T) { addrDels := simapp.AddTestAddrsIncremental(app, ctx, 1, sdk.TokensFromConsensusPower(200)) valAddrs := simapp.ConvertAddrsToValAddrs(addrDels) pks := simapp.CreateTestPubKeys(1) - addr, val := valAddrs[0], pks[0] - amt := sdk.TokensFromConsensusPower(100) - sh := staking.NewHandler(app.StakingKeeper) - + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) ctx = ctx.WithBlockHeight(app.SlashingKeeper.SignedBlocksWindow(ctx) + 1) // Validator created - res, err := sh(ctx, keeper.NewTestMsgCreateValidator(addr, val, amt)) - require.NoError(t, err) - require.NotNil(t, res) + amt := tstaking.CreateValidatorWithValPower(addr, val, 100, true) staking.EndBlocker(ctx, app.StakingKeeper) - require.Equal( t, app.BankKeeper.GetAllBalances(ctx, sdk.AccAddress(addr)), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.GetParams(ctx).BondDenom, InitTokens.Sub(amt))), @@ -149,18 +126,15 @@ func TestHandleAlreadyJailed(t *testing.T) { // initial setup app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - power := int64(100) - amt := sdk.TokensFromConsensusPower(power) addrDels := simapp.AddTestAddrsIncremental(app, ctx, 1, sdk.TokensFromConsensusPower(200)) valAddrs := simapp.ConvertAddrsToValAddrs(addrDels) pks := simapp.CreateTestPubKeys(1) - addr, val := valAddrs[0], pks[0] - sh := staking.NewHandler(app.StakingKeeper) - res, err := sh(ctx, keeper.NewTestMsgCreateValidator(addr, val, amt)) - require.NoError(t, err) - require.NotNil(t, res) + power := int64(100) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) + + amt := tstaking.CreateValidatorWithValPower(addr, val, power, true) staking.EndBlocker(ctx, app.StakingKeeper) @@ -206,7 +180,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { // TestParams set the SignedBlocksWindow to 1000 and MaxMissedBlocksPerWindow to 500 app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - app.SlashingKeeper.SetParams(ctx, keeper.TestParams()) + app.SlashingKeeper.SetParams(ctx, testslashing.TestParams()) params := app.StakingKeeper.GetParams(ctx) params.MaxValidators = 1 @@ -216,14 +190,12 @@ func TestValidatorDippingInAndOut(t *testing.T) { pks := simapp.CreateTestPubKeys(3) simapp.AddTestAddrsFromPubKeys(app, ctx, pks, sdk.TokensFromConsensusPower(200)) - amt := sdk.TokensFromConsensusPower(power) addr, val := pks[0].Address(), pks[0] consAddr := sdk.ConsAddress(addr) - sh := staking.NewHandler(app.StakingKeeper) - res, err := sh(ctx, keeper.NewTestMsgCreateValidator(sdk.ValAddress(addr), val, amt)) - require.NoError(t, err) - require.NotNil(t, res) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) + valAddr := sdk.ValAddress(addr) + tstaking.CreateValidatorWithValPower(valAddr, val, power, true) staking.EndBlocker(ctx, app.StakingKeeper) // 100 first blocks OK @@ -234,30 +206,21 @@ func TestValidatorDippingInAndOut(t *testing.T) { } // kick first validator out of validator set - newAmt := sdk.TokensFromConsensusPower(101) - res, err = sh(ctx, keeper.NewTestMsgCreateValidator(sdk.ValAddress(pks[1].Address()), pks[1], newAmt)) - require.NoError(t, err) - require.NotNil(t, res) - + tstaking.CreateValidatorWithValPower(sdk.ValAddress(pks[1].Address()), pks[1], 101, true) validatorUpdates := staking.EndBlocker(ctx, app.StakingKeeper) require.Equal(t, 2, len(validatorUpdates)) - validator, _ := app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addr)) - require.Equal(t, stakingtypes.Unbonding, validator.Status) + tstaking.CheckValidator(valAddr, stakingtypes.Unbonding, false) // 600 more blocks happened - height = int64(700) + height = 700 ctx = ctx.WithBlockHeight(height) // validator added back in - delTokens := sdk.TokensFromConsensusPower(50) - res, err = sh(ctx, keeper.NewTestMsgDelegate(sdk.AccAddress(pks[2].Address()), sdk.ValAddress(pks[0].Address()), delTokens)) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.DelegateWithPower(sdk.AccAddress(pks[2].Address()), sdk.ValAddress(pks[0].Address()), 50) validatorUpdates = staking.EndBlocker(ctx, app.StakingKeeper) require.Equal(t, 2, len(validatorUpdates)) - validator, _ = app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addr)) - require.Equal(t, stakingtypes.Bonded, validator.Status) + tstaking.CheckValidator(valAddr, stakingtypes.Bonded, false) newPower := int64(150) // validator misses a block @@ -265,8 +228,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { height++ // shouldn't be jailed/kicked yet - validator, _ = app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addr)) - require.Equal(t, stakingtypes.Bonded, validator.Status) + tstaking.CheckValidator(valAddr, stakingtypes.Bonded, false) // validator misses 500 more blocks, 501 total latest := height @@ -277,8 +239,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { // should now be jailed & kicked staking.EndBlocker(ctx, app.StakingKeeper) - validator, _ = app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addr)) - require.Equal(t, stakingtypes.Unbonding, validator.Status) + tstaking.CheckValidator(valAddr, stakingtypes.Unbonding, true) // check all the signing information signInfo, found := app.SlashingKeeper.GetValidatorSigningInfo(ctx, consAddr) @@ -302,8 +263,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { // validator should not be kicked since we reset counter/array when it was jailed staking.EndBlocker(ctx, app.StakingKeeper) - validator, _ = app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addr)) - require.Equal(t, stakingtypes.Bonded, validator.Status) + tstaking.CheckValidator(valAddr, stakingtypes.Bonded, false) // validator misses 501 blocks latest = height @@ -314,6 +274,5 @@ func TestValidatorDippingInAndOut(t *testing.T) { // validator should now be jailed & kicked staking.EndBlocker(ctx, app.StakingKeeper) - validator, _ = app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addr)) - require.Equal(t, stakingtypes.Unbonding, validator.Status) + tstaking.CheckValidator(valAddr, stakingtypes.Unbonding, true) } diff --git a/x/slashing/keeper/querier_test.go b/x/slashing/keeper/querier_test.go index 004ae1e854..bda5fe4bc5 100644 --- a/x/slashing/keeper/querier_test.go +++ b/x/slashing/keeper/querier_test.go @@ -11,13 +11,14 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + "github.com/cosmos/cosmos-sdk/x/slashing/testslashing" "github.com/cosmos/cosmos-sdk/x/slashing/types" ) func TestNewQuerier(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - app.SlashingKeeper.SetParams(ctx, keeper.TestParams()) + app.SlashingKeeper.SetParams(ctx, testslashing.TestParams()) legacyQuerierCdc := codec.NewAminoCodec(app.LegacyAmino()) querier := keeper.NewQuerier(app.SlashingKeeper, legacyQuerierCdc.LegacyAmino) @@ -35,7 +36,7 @@ func TestQueryParams(t *testing.T) { legacyQuerierCdc := codec.NewAminoCodec(cdc) app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - app.SlashingKeeper.SetParams(ctx, keeper.TestParams()) + app.SlashingKeeper.SetParams(ctx, testslashing.TestParams()) querier := keeper.NewQuerier(app.SlashingKeeper, legacyQuerierCdc.LegacyAmino) diff --git a/x/slashing/keeper/test_common.go b/x/slashing/keeper/test_common.go deleted file mode 100644 index f9edb4febe..0000000000 --- a/x/slashing/keeper/test_common.go +++ /dev/null @@ -1,41 +0,0 @@ -package keeper - -// DONTCOVER - -import ( - "github.com/tendermint/tendermint/crypto" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/slashing/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -// TODO remove dependencies on staking (should only refer to validator set type from sdk) - -var ( - InitTokens = sdk.TokensFromConsensusPower(200) -) - -// Have to change these parameters for tests -// lest the tests take forever -func TestParams() types.Params { - params := types.DefaultParams() - params.SignedBlocksWindow = 1000 - params.DowntimeJailDuration = 60 * 60 - - return params -} - -func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) *stakingtypes.MsgCreateValidator { - commission := stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) - - return stakingtypes.NewMsgCreateValidator( - address, pubKey, sdk.NewCoin(sdk.DefaultBondDenom, amt), - stakingtypes.Description{}, commission, sdk.OneInt(), - ) -} - -func NewTestMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, delAmount sdk.Int) *stakingtypes.MsgDelegate { - amount := sdk.NewCoin(sdk.DefaultBondDenom, delAmount) - return stakingtypes.NewMsgDelegate(delAddr, valAddr, amount) -} diff --git a/x/slashing/testslashing/params.go b/x/slashing/testslashing/params.go new file mode 100644 index 0000000000..dac3f23c5c --- /dev/null +++ b/x/slashing/testslashing/params.go @@ -0,0 +1,16 @@ +package testslashing + +import ( + "github.com/cosmos/cosmos-sdk/x/slashing/types" +) + +// TestParams construct default slashing params for tests. +// Have to change these parameters for tests +// lest the tests take forever +func TestParams() types.Params { + params := types.DefaultParams() + params.SignedBlocksWindow = 1000 + params.DowntimeJailDuration = 60 * 60 + + return params +} diff --git a/x/staking/app_test.go b/x/staking/app_test.go index 2f33961021..1c60ec5027 100644 --- a/x/staking/app_test.go +++ b/x/staking/app_test.go @@ -65,13 +65,14 @@ func TestStakingMsgs(t *testing.T) { // create validator description := types.NewDescription("foo_moniker", "", "", "", "") - createValidatorMsg := types.NewMsgCreateValidator( + createValidatorMsg, err := types.NewMsgCreateValidator( sdk.ValAddress(addr1), valKey.PubKey(), bondCoin, description, commissionRates, sdk.OneInt(), ) + require.NoError(t, err) header := tmproto.Header{Height: app.LastBlockHeight() + 1} txGen := simapp.MakeEncodingConfig().TxConfig - _, _, err := simapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{createValidatorMsg}, "", []uint64{0}, []uint64{0}, true, true, priv1) + _, _, err = simapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{createValidatorMsg}, "", []uint64{0}, []uint64{0}, true, true, priv1) require.NoError(t, err) simapp.CheckBalance(t, app, addr1, sdk.Coins{genCoin.Sub(bondCoin)}) diff --git a/x/staking/client/cli/tx.go b/x/staking/client/cli/tx.go index fcd76ca8ff..ab486c5a98 100644 --- a/x/staking/client/cli/tx.go +++ b/x/staking/client/cli/tx.go @@ -343,9 +343,12 @@ func NewBuildCreateValidatorMsg(clientCtx client.Context, txf tx.Factory, fs *fl return txf, nil, types.ErrMinSelfDelegationInvalid } - msg := types.NewMsgCreateValidator( + msg, err := types.NewMsgCreateValidator( sdk.ValAddress(valAddr), pk, amount, description, commissionRates, minSelfDelegation, ) + if err != nil { + return txf, nil, err + } if err := msg.ValidateBasic(); err != nil { return txf, nil, err } @@ -550,10 +553,12 @@ func BuildCreateValidatorMsg(clientCtx client.Context, config TxCreateValidatorC return txBldr, nil, types.ErrMinSelfDelegationInvalid } - msg := types.NewMsgCreateValidator( + msg, err := types.NewMsgCreateValidator( sdk.ValAddress(valAddr), pk, amount, description, commissionRates, minSelfDelegation, ) - + if err != nil { + return txBldr, msg, err + } if generateOnly { ip := config.IP nodeID := config.NodeID diff --git a/x/staking/common_test.go b/x/staking/common_test.go index f7bca291b8..30072c7b58 100644 --- a/x/staking/common_test.go +++ b/x/staking/common_test.go @@ -1,7 +1,6 @@ package staking_test import ( - "github.com/tendermint/tendermint/crypto" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" @@ -28,17 +27,6 @@ var ( PKs = simapp.CreateTestPubKeys(500) ) -func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) *types.MsgCreateValidator { - return types.NewMsgCreateValidator( - address, pubKey, sdk.NewCoin(sdk.DefaultBondDenom, amt), types.Description{}, commissionRates, sdk.OneInt(), - ) -} - -func NewTestMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt sdk.Int) *types.MsgDelegate { - amount := sdk.NewCoin(sdk.DefaultBondDenom, amt) - return types.NewMsgDelegate(delAddr, valAddr, amount) -} - // getBaseSimappWithCustomKeeper Returns a simapp with custom StakingKeeper // to avoid messing with the hooks. func getBaseSimappWithCustomKeeper() (*codec.LegacyAmino, *simapp.SimApp, sdk.Context) { diff --git a/x/staking/handler_test.go b/x/staking/handler_test.go index 51a7323ca0..22c7733391 100644 --- a/x/staking/handler_test.go +++ b/x/staking/handler_test.go @@ -19,6 +19,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/golang/protobuf/proto" ) @@ -43,19 +44,12 @@ func bootstrapHandlerGenesisTest(t *testing.T, power int64, numAddrs int, accAmo func TestValidatorByPowerIndex(t *testing.T) { initPower := int64(1000000) - initBond := sdk.TokensFromConsensusPower(initPower) - app, ctx, _, valAddrs := bootstrapHandlerGenesisTest(t, initPower, 10, 10000000000000) - validatorAddr, validatorAddr3 := valAddrs[0], valAddrs[1] - - handler := staking.NewHandler(app.StakingKeeper) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // create validator - msgCreateValidator := NewTestMsgCreateValidator(validatorAddr, PKs[0], initBond) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + initBond := tstaking.CreateValidatorWithValPower(validatorAddr, PKs[0], initPower, true) // must end-block updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) @@ -74,10 +68,7 @@ func TestValidatorByPowerIndex(t *testing.T) { require.True(t, keeper.ValidatorByPowerIndexExists(ctx, app.StakingKeeper, power)) // create a second validator keep it bonded - msgCreateValidator = NewTestMsgCreateValidator(validatorAddr3, PKs[2], initBond) - res, err = handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.CreateValidatorWithValPower(validatorAddr3, PKs[2], initPower, true) // must end-block updates = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) @@ -110,15 +101,10 @@ func TestValidatorByPowerIndex(t *testing.T) { // unbond self-delegation totalBond := validator.TokensFromShares(bond.GetShares()).TruncateInt() - unbondAmt := sdk.NewCoin(sdk.DefaultBondDenom, totalBond) - msgUndelegate := types.NewMsgUndelegate(sdk.AccAddress(validatorAddr), validatorAddr, unbondAmt) - - res, err = handler(ctx, msgUndelegate) - require.NoError(t, err) - require.NotNil(t, res) + res := tstaking.Undelegate(sdk.AccAddress(validatorAddr), validatorAddr, totalBond, true) var resData types.MsgUndelegateResponse - err = proto.Unmarshal(res.Data, &resData) + err := proto.Unmarshal(res.Data, &resData) require.NoError(t, err) ctx = ctx.WithBlockTime(resData.CompletionTime) @@ -135,22 +121,14 @@ func TestDuplicatesMsgCreateValidator(t *testing.T) { initPower := int64(1000000) app, ctx, _, valAddrs := bootstrapHandlerGenesisTest(t, initPower, 10, 10000000000000) - handler := staking.NewHandler(app.StakingKeeper) - addr1, addr2 := valAddrs[0], valAddrs[1] pk1, pk2 := PKs[0], PKs[1] + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) - valTokens := sdk.TokensFromConsensusPower(10) - msgCreateValidator1 := NewTestMsgCreateValidator(addr1, pk1, valTokens) - res, err := handler(ctx, msgCreateValidator1) - require.NoError(t, err) - require.NotNil(t, res) - + valTokens := tstaking.CreateValidatorWithValPower(addr1, pk1, 10, true) app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - validator, found := app.StakingKeeper.GetValidator(ctx, addr1) - require.True(t, found) - assert.Equal(t, types.Bonded, validator.Status) + validator := tstaking.CheckValidator(addr1, types.Bonded, false) assert.Equal(t, addr1.String(), validator.OperatorAddress) assert.Equal(t, pk1.(cryptotypes.IntoTmPubKey).AsTmPubKey(), validator.GetConsPubKey()) assert.Equal(t, valTokens, validator.BondedTokens()) @@ -158,31 +136,19 @@ func TestDuplicatesMsgCreateValidator(t *testing.T) { assert.Equal(t, types.Description{}, validator.Description) // two validators can't have the same operator address - msgCreateValidator2 := NewTestMsgCreateValidator(addr1, pk2, valTokens) - res, err = handler(ctx, msgCreateValidator2) - require.Error(t, err) - require.Nil(t, res) + tstaking.CreateValidator(addr1, pk2, valTokens.Int64(), false) // two validators can't have the same pubkey - msgCreateValidator3 := NewTestMsgCreateValidator(addr2, pk1, valTokens) - res, err = handler(ctx, msgCreateValidator3) - require.Error(t, err) - require.Nil(t, res) + tstaking.CreateValidator(addr2, pk1, valTokens.Int64(), false) // must have different pubkey and operator - msgCreateValidator4 := NewTestMsgCreateValidator(addr2, pk2, valTokens) - res, err = handler(ctx, msgCreateValidator4) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.CreateValidator(addr2, pk2, valTokens.Int64(), true) // must end-block updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) require.Equal(t, 1, len(updates)) - validator, found = app.StakingKeeper.GetValidator(ctx, addr2) - - require.True(t, found) - assert.Equal(t, types.Bonded, validator.Status) + validator = tstaking.CheckValidator(addr2, types.Bonded, false) assert.Equal(t, addr2.String(), validator.OperatorAddress) assert.Equal(t, pk2.(cryptotypes.IntoTmPubKey).AsTmPubKey(), validator.GetConsPubKey()) assert.True(sdk.IntEq(t, valTokens, validator.Tokens)) @@ -192,78 +158,59 @@ func TestDuplicatesMsgCreateValidator(t *testing.T) { func TestInvalidPubKeyTypeMsgCreateValidator(t *testing.T) { app, ctx, _, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 1, 1000) - handler := staking.NewHandler(app.StakingKeeper) ctx = ctx.WithConsensusParams(&abci.ConsensusParams{ Validator: &tmproto.ValidatorParams{PubKeyTypes: []string{tmtypes.ABCIPubKeyTypeEd25519}}, }) addr := valAddrs[0] invalidPk := secp256k1.GenPrivKey().PubKey() + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // invalid pukKey type should not be allowed - msgCreateValidator := NewTestMsgCreateValidator(addr, invalidPk, sdk.NewInt(10)) - res, err := handler(ctx, msgCreateValidator) - require.Error(t, err) - require.Nil(t, res) + tstaking.CreateValidator(addr, invalidPk, 10, false) } func TestLegacyValidatorDelegations(t *testing.T) { app, ctx, delAddrs, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 2, 100000000) - handler := staking.NewHandler(app.StakingKeeper) - bondAmount := sdk.TokensFromConsensusPower(10) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) valAddr := valAddrs[0] valConsPubKey, valConsAddr := PKs[0], sdk.ConsAddress(PKs[0].Address()) delAddr := delAddrs[1] // create validator - msgCreateVal := NewTestMsgCreateValidator(valAddr, valConsPubKey, bondAmount) - res, err := handler(ctx, msgCreateVal) - require.NoError(t, err) - require.NotNil(t, res) + bondAmount := tstaking.CreateValidatorWithValPower(valAddr, valConsPubKey, 10, true) // must end-block updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) require.Equal(t, 1, len(updates)) // verify the validator exists and has the correct attributes - validator, found := app.StakingKeeper.GetValidator(ctx, valAddr) - require.True(t, found) - require.Equal(t, types.Bonded, validator.Status) + validator := tstaking.CheckValidator(valAddr, types.Bonded, false) require.Equal(t, bondAmount, validator.DelegatorShares.RoundInt()) require.Equal(t, bondAmount, validator.BondedTokens()) // delegate tokens to the validator - msgDelegate := NewTestMsgDelegate(delAddr, valAddr, bondAmount) - res, err = handler(ctx, msgDelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Delegate(delAddr, valAddr, bondAmount.Int64()) // verify validator bonded shares - validator, found = app.StakingKeeper.GetValidator(ctx, valAddr) - require.True(t, found) + validator = tstaking.CheckValidator(valAddr, types.Bonded, false) require.Equal(t, bondAmount.MulRaw(2), validator.DelegatorShares.RoundInt()) require.Equal(t, bondAmount.MulRaw(2), validator.BondedTokens()) // unbond validator total self-delegations (which should jail the validator) - unbondAmt := sdk.NewCoin(sdk.DefaultBondDenom, bondAmount) - msgUndelegate := types.NewMsgUndelegate(sdk.AccAddress(valAddr), valAddr, unbondAmt) - - res, err = handler(ctx, msgUndelegate) - require.NoError(t, err) - require.NotNil(t, res) + res := tstaking.Undelegate(sdk.AccAddress(valAddr), valAddr, bondAmount, true) var resData types.MsgUndelegateResponse - err = proto.Unmarshal(res.Data, &resData) + err := proto.Unmarshal(res.Data, &resData) require.NoError(t, err) ctx = ctx.WithBlockTime(resData.CompletionTime) + tstaking.Ctx = ctx staking.EndBlocker(ctx, app.StakingKeeper) // verify the validator record still exists, is jailed, and has correct tokens - validator, found = app.StakingKeeper.GetValidator(ctx, valAddr) - require.True(t, found) - require.True(t, validator.Jailed) + validator = tstaking.CheckValidator(valAddr, -1, true) require.Equal(t, bondAmount, validator.Tokens) // verify delegation still exists @@ -273,10 +220,7 @@ func TestLegacyValidatorDelegations(t *testing.T) { require.Equal(t, bondAmount, validator.DelegatorShares.RoundInt()) // verify the validator can still self-delegate - msgSelfDelegate := NewTestMsgDelegate(sdk.AccAddress(valAddr), valAddr, bondAmount) - res, err = handler(ctx, msgSelfDelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Delegate(sdk.AccAddress(valAddr), valAddr, bondAmount.Int64()) // verify validator bonded shares validator, found = app.StakingKeeper.GetValidator(ctx, valAddr) @@ -288,10 +232,7 @@ func TestLegacyValidatorDelegations(t *testing.T) { app.StakingKeeper.Unjail(ctx, valConsAddr) // verify the validator can now accept delegations - msgDelegate = NewTestMsgDelegate(delAddr, valAddr, bondAmount) - res, err = handler(ctx, msgDelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Delegate(delAddr, valAddr, bondAmount.Int64()) // verify validator bonded shares validator, found = app.StakingKeeper.GetValidator(ctx, valAddr) @@ -310,30 +251,22 @@ func TestIncrementsMsgDelegate(t *testing.T) { initPower := int64(1000) initBond := sdk.TokensFromConsensusPower(initPower) app, ctx, delAddrs, valAddrs := bootstrapHandlerGenesisTest(t, initPower, 2, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) params := app.StakingKeeper.GetParams(ctx) - - bondAmount := sdk.TokensFromConsensusPower(10) validatorAddr, delegatorAddr := valAddrs[0], delAddrs[1] + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // first create validator - msgCreateValidator := NewTestMsgCreateValidator(validatorAddr, PKs[0], bondAmount) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + bondAmount := tstaking.CreateValidatorWithValPower(validatorAddr, PKs[0], 10, true) // apply TM updates app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddr) - require.True(t, found) - require.Equal(t, types.Bonded, validator.Status) + validator := tstaking.CheckValidator(validatorAddr, types.Bonded, false) require.Equal(t, bondAmount, validator.DelegatorShares.RoundInt()) require.Equal(t, bondAmount, validator.BondedTokens(), "validator: %v", validator) - _, found = app.StakingKeeper.GetDelegation(ctx, delegatorAddr, validatorAddr) - require.False(t, found) + tstaking.CheckDelegator(delegatorAddr, validatorAddr, false) bond, found := app.StakingKeeper.GetDelegation(ctx, sdk.AccAddress(validatorAddr), validatorAddr) require.True(t, found) @@ -342,15 +275,10 @@ func TestIncrementsMsgDelegate(t *testing.T) { bondedTokens := app.StakingKeeper.TotalBondedTokens(ctx) require.Equal(t, bondAmount.Int64(), bondedTokens.Int64()) - // just send the same msgbond multiple times - msgDelegate := NewTestMsgDelegate(delegatorAddr, validatorAddr, bondAmount) - for i := int64(0); i < 5; i++ { ctx = ctx.WithBlockHeight(i) - - res, err := handler(ctx, msgDelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Ctx = ctx + tstaking.Delegate(delegatorAddr, validatorAddr, bondAmount.Int64()) //Check that the accounts and the bond account have the appropriate values validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddr) @@ -384,14 +312,12 @@ func TestEditValidatorDecreaseMinSelfDelegation(t *testing.T) { app, ctx, _, valAddrs := bootstrapHandlerGenesisTest(t, initPower, 1, 1000000000) validatorAddr := valAddrs[0] - handler := staking.NewHandler(app.StakingKeeper) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // create validator - msgCreateValidator := NewTestMsgCreateValidator(validatorAddr, PKs[0], initBond) + msgCreateValidator := tstaking.CreateValidatorMsg(validatorAddr, PKs[0], initBond.Int64()) msgCreateValidator.MinSelfDelegation = sdk.NewInt(2) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Handle(msgCreateValidator, true) // must end-block updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) @@ -407,9 +333,7 @@ func TestEditValidatorDecreaseMinSelfDelegation(t *testing.T) { newMinSelfDelegation := sdk.OneInt() msgEditValidator := types.NewMsgEditValidator(validatorAddr, types.Description{}, nil, &newMinSelfDelegation) - res, err = handler(ctx, msgEditValidator) - require.Error(t, err) - require.Nil(t, res) + tstaking.Handle(msgEditValidator, false) } func TestEditValidatorIncreaseMinSelfDelegationBeyondCurrentBond(t *testing.T) { @@ -418,15 +342,12 @@ func TestEditValidatorIncreaseMinSelfDelegationBeyondCurrentBond(t *testing.T) { app, ctx, _, valAddrs := bootstrapHandlerGenesisTest(t, initPower, 2, 1000000000) validatorAddr := valAddrs[0] - - handler := staking.NewHandler(app.StakingKeeper) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // create validator - msgCreateValidator := NewTestMsgCreateValidator(validatorAddr, PKs[0], initBond) + msgCreateValidator := tstaking.CreateValidatorMsg(validatorAddr, PKs[0], initBond.Int64()) msgCreateValidator.MinSelfDelegation = sdk.NewInt(2) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Handle(msgCreateValidator, true) // must end-block updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) @@ -442,36 +363,25 @@ func TestEditValidatorIncreaseMinSelfDelegationBeyondCurrentBond(t *testing.T) { newMinSelfDelegation := initBond.Add(sdk.OneInt()) msgEditValidator := types.NewMsgEditValidator(validatorAddr, types.Description{}, nil, &newMinSelfDelegation) - res, err = handler(ctx, msgEditValidator) - require.Error(t, err) - require.Nil(t, res) + tstaking.Handle(msgEditValidator, false) } func TestIncrementsMsgUnbond(t *testing.T) { initPower := int64(1000) - initBond := sdk.TokensFromConsensusPower(initPower) app, ctx, delAddrs, valAddrs := bootstrapHandlerGenesisTest(t, initPower, 2, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) - + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) params := app.StakingKeeper.GetParams(ctx) denom := params.BondDenom // create validator, delegate validatorAddr, delegatorAddr := valAddrs[0], delAddrs[1] - - msgCreateValidator := NewTestMsgCreateValidator(validatorAddr, PKs[0], initBond) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + initBond := tstaking.CreateValidatorWithValPower(validatorAddr, PKs[0], initPower, true) // initial balance amt1 := app.BankKeeper.GetBalance(ctx, delegatorAddr, denom).Amount - msgDelegate := NewTestMsgDelegate(delegatorAddr, validatorAddr, initBond) - res, err = handler(ctx, msgDelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Delegate(delegatorAddr, validatorAddr, initBond.Int64()) // balance should have been subtracted after delegation amt2 := app.BankKeeper.GetBalance(ctx, delegatorAddr, denom).Amount @@ -492,15 +402,14 @@ func TestIncrementsMsgUnbond(t *testing.T) { numUnbonds := int64(5) for i := int64(0); i < numUnbonds; i++ { - res, err := handler(ctx, msgUndelegate) - require.NoError(t, err) - require.NotNil(t, res) + res := tstaking.Handle(msgUndelegate, true) var resData types.MsgUndelegateResponse - err = proto.Unmarshal(res.Data, &resData) + err := proto.Unmarshal(res.Data, &resData) require.NoError(t, err) ctx = ctx.WithBlockTime(resData.CompletionTime) + tstaking.Ctx = ctx staking.EndBlocker(ctx, app.StakingKeeper) // check that the accounts and the bond account have the appropriate values @@ -538,21 +447,12 @@ func TestIncrementsMsgUnbond(t *testing.T) { } for _, c := range errorCases { - unbondAmt := sdk.NewCoin(sdk.DefaultBondDenom, c) - msgUndelegate := types.NewMsgUndelegate(delegatorAddr, validatorAddr, unbondAmt) - res, err = handler(ctx, msgUndelegate) - require.Error(t, err) - require.Nil(t, res) + tstaking.Undelegate(delegatorAddr, validatorAddr, c, false) } - leftBonded := initBond.Sub(unbondAmt.Amount.Mul(sdk.NewInt(numUnbonds))) - // should be able to unbond remaining - unbondAmt = sdk.NewCoin(sdk.DefaultBondDenom, leftBonded) - msgUndelegate = types.NewMsgUndelegate(delegatorAddr, validatorAddr, unbondAmt) - res, err = handler(ctx, msgUndelegate) - require.NoError(t, err, "msgUnbond: %v\nshares: %s\nleftBonded: %s\n", msgUndelegate, unbondAmt, leftBonded) - require.NotNil(t, res, "msgUnbond: %v\nshares: %s\nleftBonded: %s\n", msgUndelegate, unbondAmt, leftBonded) + leftBonded := initBond.Sub(unbondAmt.Amount.Mul(sdk.NewInt(numUnbonds))) + tstaking.Undelegate(delegatorAddr, validatorAddr, leftBonded, true) } func TestMultipleMsgCreateValidator(t *testing.T) { @@ -560,11 +460,10 @@ func TestMultipleMsgCreateValidator(t *testing.T) { initTokens := sdk.TokensFromConsensusPower(initPower) app, ctx, delAddrs, valAddrs := bootstrapHandlerGenesisTest(t, initPower, 3, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) - params := app.StakingKeeper.GetParams(ctx) blockTime := time.Now().UTC() ctx = ctx.WithBlockTime(blockTime) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) validatorAddrs := []sdk.ValAddress{ valAddrs[0], @@ -578,24 +477,19 @@ func TestMultipleMsgCreateValidator(t *testing.T) { } // bond them all + amt := sdk.TokensFromConsensusPower(10) for i, validatorAddr := range validatorAddrs { - valTokens := sdk.TokensFromConsensusPower(10) - msgCreateValidatorOnBehalfOf := NewTestMsgCreateValidator(validatorAddr, PKs[i], valTokens) - - res, err := handler(ctx, msgCreateValidatorOnBehalfOf) - require.NoError(t, err) - require.NotNil(t, res) - + tstaking.CreateValidator(validatorAddr, PKs[i], amt.Int64(), true) // verify that the account is bonded validators := app.StakingKeeper.GetValidators(ctx, 100) require.Equal(t, (i + 1), len(validators)) val := validators[i] - balanceExpd := initTokens.Sub(valTokens) + balanceExpd := initTokens.Sub(amt) balanceGot := app.BankKeeper.GetBalance(ctx, delegatorAddrs[i], params.BondDenom).Amount require.Equal(t, i+1, len(validators), "expected %d validators got %d, validators: %v", i+1, len(validators), validators) - require.Equal(t, valTokens, val.DelegatorShares.RoundInt(), "expected %d shares, got %d", 10, val.DelegatorShares) + require.Equal(t, amt, val.DelegatorShares.RoundInt(), "expected %d shares, got %d", 10, val.DelegatorShares) require.Equal(t, balanceExpd, balanceGot, "expected account to have %d, got %d", balanceExpd, balanceGot) } @@ -606,14 +500,10 @@ func TestMultipleMsgCreateValidator(t *testing.T) { _, found := app.StakingKeeper.GetValidator(ctx, validatorAddr) require.True(t, found) - unbondAmt := sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromConsensusPower(10)) - msgUndelegate := types.NewMsgUndelegate(delegatorAddrs[i], validatorAddr, unbondAmt) // remove delegation - res, err := handler(ctx, msgUndelegate) - require.NoError(t, err) - require.NotNil(t, res) + res := tstaking.Undelegate(delegatorAddrs[i], validatorAddr, amt, true) var resData types.MsgUndelegateResponse - err = proto.Unmarshal(res.Data, &resData) + err := proto.Unmarshal(res.Data, &resData) require.NoError(t, err) // adds validator into unbonding queue @@ -637,43 +527,30 @@ func TestMultipleMsgCreateValidator(t *testing.T) { func TestMultipleMsgDelegate(t *testing.T) { app, ctx, delAddrs, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 50, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) validatorAddr, delegatorAddrs := valAddrs[0], delAddrs[1:] + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) + var amount int64 = 10 // first make a validator - msgCreateValidator := NewTestMsgCreateValidator(validatorAddr, PKs[0], sdk.NewInt(10)) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.CreateValidator(validatorAddr, PKs[0], amount, true) // delegate multiple parties for _, delegatorAddr := range delegatorAddrs { - msgDelegate := NewTestMsgDelegate(delegatorAddr, validatorAddr, sdk.NewInt(10)) - res, err := handler(ctx, msgDelegate) - require.NoError(t, err) - require.NotNil(t, res) - - // check that the account is bonded - bond, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddr, validatorAddr) - require.True(t, found) - require.NotNil(t, bond, "expected delegatee bond %d to exist", bond) + tstaking.Delegate(delegatorAddr, validatorAddr, 10) + tstaking.CheckDelegator(delegatorAddr, validatorAddr, true) } // unbond them all for _, delegatorAddr := range delegatorAddrs { - unbondAmt := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10)) - msgUndelegate := types.NewMsgUndelegate(delegatorAddr, validatorAddr, unbondAmt) - - res, err := handler(ctx, msgUndelegate) - require.NoError(t, err) - require.NotNil(t, res) + res := tstaking.Undelegate(delegatorAddr, validatorAddr, sdk.NewInt(amount), true) var resData types.MsgUndelegateResponse - err = proto.Unmarshal(res.Data, &resData) + err := proto.Unmarshal(res.Data, &resData) require.NoError(t, err) ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) + tstaking.Ctx = ctx // check that the account is unbonded _, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddr, validatorAddr) @@ -683,98 +560,67 @@ func TestMultipleMsgDelegate(t *testing.T) { func TestJailValidator(t *testing.T) { app, ctx, delAddrs, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 2, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) validatorAddr, delegatorAddr := valAddrs[0], delAddrs[1] + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) + var amt int64 = 10 - // create the validator - msgCreateValidator := NewTestMsgCreateValidator(validatorAddr, PKs[0], sdk.NewInt(10)) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) - - // bond a delegator - msgDelegate := NewTestMsgDelegate(delegatorAddr, validatorAddr, sdk.NewInt(10)) - res, err = handler(ctx, msgDelegate) - require.NoError(t, err) - require.NotNil(t, res) + // create the validator and delegate + tstaking.CreateValidator(validatorAddr, PKs[0], amt, true) + tstaking.Delegate(delegatorAddr, validatorAddr, amt) // unbond the validators bond portion - unbondAmt := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10)) - msgUndelegateValidator := types.NewMsgUndelegate(sdk.AccAddress(validatorAddr), validatorAddr, unbondAmt) - res, err = handler(ctx, msgUndelegateValidator) - require.NoError(t, err) - require.NotNil(t, res) + unamt := sdk.NewInt(amt) + res := tstaking.Undelegate(sdk.AccAddress(validatorAddr), validatorAddr, unamt, true) var resData types.MsgUndelegateResponse - err = proto.Unmarshal(res.Data, &resData) + err := proto.Unmarshal(res.Data, &resData) require.NoError(t, err) ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) + tstaking.Ctx = ctx - validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddr) - require.True(t, found) - require.True(t, validator.Jailed, "%v", validator) + tstaking.CheckValidator(validatorAddr, -1, true) // test that the delegator can still withdraw their bonds - msgUndelegateDelegator := types.NewMsgUndelegate(delegatorAddr, validatorAddr, unbondAmt) - - res, err = handler(ctx, msgUndelegateDelegator) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Undelegate(delegatorAddr, validatorAddr, unamt, true) err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) + tstaking.Ctx = ctx // verify that the pubkey can now be reused - res, err = handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.CreateValidator(validatorAddr, PKs[0], amt, true) } func TestValidatorQueue(t *testing.T) { app, ctx, delAddrs, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 2, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) validatorAddr, delegatorAddr := valAddrs[0], delAddrs[1] + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // set the unbonding time params := app.StakingKeeper.GetParams(ctx) params.UnbondingTime = 7 * time.Second app.StakingKeeper.SetParams(ctx, params) - // create the validator - valTokens := sdk.TokensFromConsensusPower(10) - msgCreateValidator := NewTestMsgCreateValidator(validatorAddr, PKs[0], valTokens) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) - - // bond a delegator - delTokens := sdk.TokensFromConsensusPower(10) - msgDelegate := NewTestMsgDelegate(delegatorAddr, validatorAddr, delTokens) - res, err = handler(ctx, msgDelegate) - require.NoError(t, err) - require.NotNil(t, res) - + // create the validator and make a bond + amt := tstaking.CreateValidatorWithValPower(validatorAddr, PKs[0], 10, true) + tstaking.Delegate(delegatorAddr, validatorAddr, amt.Int64()) staking.EndBlocker(ctx, app.StakingKeeper) // unbond the all self-delegation to put validator in unbonding state - unbondAmt := sdk.NewCoin(sdk.DefaultBondDenom, delTokens) - msgUndelegateValidator := types.NewMsgUndelegate(sdk.AccAddress(validatorAddr), validatorAddr, unbondAmt) - res, err = handler(ctx, msgUndelegateValidator) - require.NoError(t, err) - require.NotNil(t, res) + res := tstaking.Undelegate(sdk.AccAddress(validatorAddr), validatorAddr, amt, true) var resData types.MsgUndelegateResponse - err = proto.Unmarshal(res.Data, &resData) + err := proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(resData.CompletionTime) - staking.EndBlocker(ctx, app.StakingKeeper) + finishTime := resData.CompletionTime + ctx = tstaking.TurnBlock(finishTime) origHeader := ctx.BlockHeader() validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddr) @@ -782,16 +628,14 @@ func TestValidatorQueue(t *testing.T) { require.True(t, validator.IsUnbonding(), "%v", validator) // should still be unbonding at time 6 seconds later - ctx = ctx.WithBlockTime(origHeader.Time.Add(time.Second * 6)) - staking.EndBlocker(ctx, app.StakingKeeper) + ctx = tstaking.TurnBlock(origHeader.Time.Add(time.Second * 6)) validator, found = app.StakingKeeper.GetValidator(ctx, validatorAddr) require.True(t, found) require.True(t, validator.IsUnbonding(), "%v", validator) // should be in unbonded state at time 7 seconds later - ctx = ctx.WithBlockTime(origHeader.Time.Add(time.Second * 7)) - staking.EndBlocker(ctx, app.StakingKeeper) + ctx = tstaking.TurnBlock(origHeader.Time.Add(time.Second * 7)) validator, found = app.StakingKeeper.GetValidator(ctx, validatorAddr) require.True(t, found) @@ -800,8 +644,8 @@ func TestValidatorQueue(t *testing.T) { func TestUnbondingPeriod(t *testing.T) { app, ctx, _, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 1, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) validatorAddr := valAddrs[0] + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // set the unbonding time params := app.StakingKeeper.GetParams(ctx) @@ -809,20 +653,11 @@ func TestUnbondingPeriod(t *testing.T) { app.StakingKeeper.SetParams(ctx, params) // create the validator - valTokens := sdk.TokensFromConsensusPower(10) - msgCreateValidator := NewTestMsgCreateValidator(validatorAddr, PKs[0], valTokens) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) - + amt := tstaking.CreateValidatorWithValPower(validatorAddr, PKs[0], 10, true) staking.EndBlocker(ctx, app.StakingKeeper) // begin unbonding - unbondAmt := sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromConsensusPower(10)) - msgUndelegate := types.NewMsgUndelegate(sdk.AccAddress(validatorAddr), validatorAddr, unbondAmt) - res, err = handler(ctx, msgUndelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Undelegate(sdk.AccAddress(validatorAddr), validatorAddr, amt, true) origHeader := ctx.BlockHeader() @@ -835,59 +670,41 @@ func TestUnbondingPeriod(t *testing.T) { require.True(t, found, "should not have unbonded") // cannot complete unbonding at time 6 seconds later - ctx = ctx.WithBlockTime(origHeader.Time.Add(time.Second * 6)) - staking.EndBlocker(ctx, app.StakingKeeper) + ctx = tstaking.TurnBlock(origHeader.Time.Add(time.Second * 6)) _, found = app.StakingKeeper.GetUnbondingDelegation(ctx, sdk.AccAddress(validatorAddr), validatorAddr) require.True(t, found, "should not have unbonded") // can complete unbonding at time 7 seconds later - ctx = ctx.WithBlockTime(origHeader.Time.Add(time.Second * 7)) - staking.EndBlocker(ctx, app.StakingKeeper) + ctx = tstaking.TurnBlock(origHeader.Time.Add(time.Second * 7)) _, found = app.StakingKeeper.GetUnbondingDelegation(ctx, sdk.AccAddress(validatorAddr), validatorAddr) require.False(t, found, "should have unbonded") } func TestUnbondingFromUnbondingValidator(t *testing.T) { app, ctx, delAddrs, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 2, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) validatorAddr, delegatorAddr := valAddrs[0], delAddrs[1] + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) - // create the validator - msgCreateValidator := NewTestMsgCreateValidator(validatorAddr, PKs[0], sdk.NewInt(10)) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) - - // bond a delegator - msgDelegate := NewTestMsgDelegate(delegatorAddr, validatorAddr, sdk.NewInt(10)) - res, err = handler(ctx, msgDelegate) - require.NoError(t, err) - require.NotNil(t, res) + // create the validator and delegate + tstaking.CreateValidator(validatorAddr, PKs[0], 10, true) + tstaking.Delegate(delegatorAddr, validatorAddr, 10) // unbond the validators bond portion - unbondAmt := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10)) - msgUndelegateValidator := types.NewMsgUndelegate(sdk.AccAddress(validatorAddr), validatorAddr, unbondAmt) - res, err = handler(ctx, msgUndelegateValidator) - require.NoError(t, err) - require.NotNil(t, res) + unbondAmt := sdk.NewInt(10) + res := tstaking.Undelegate(sdk.AccAddress(validatorAddr), validatorAddr, unbondAmt, true) // change the ctx to Block Time one second before the validator would have unbonded var resData types.MsgUndelegateResponse - err = proto.Unmarshal(res.Data, &resData) + err := proto.Unmarshal(res.Data, &resData) require.NoError(t, err) ctx = ctx.WithBlockTime(resData.CompletionTime.Add(time.Second * -1)) // unbond the delegator from the validator - msgUndelegateDelegator := types.NewMsgUndelegate(delegatorAddr, validatorAddr, unbondAmt) - res, err = handler(ctx, msgUndelegateDelegator) - require.NoError(t, err) - require.NotNil(t, res) + res = tstaking.Undelegate(delegatorAddr, validatorAddr, unbondAmt, true) - ctx = ctx.WithBlockTime(ctx.BlockHeader().Time.Add(app.StakingKeeper.UnbondingTime(ctx))) - - // Run the EndBlocker - staking.EndBlocker(ctx, app.StakingKeeper) + ctx = tstaking.TurnBlockTimeDiff(app.StakingKeeper.UnbondingTime(ctx)) + tstaking.Ctx = ctx // Check to make sure that the unbonding delegation is no longer in state // (meaning it was deleted in the above EndBlocker) @@ -897,42 +714,31 @@ func TestUnbondingFromUnbondingValidator(t *testing.T) { func TestRedelegationPeriod(t *testing.T) { app, ctx, _, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 2, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) validatorAddr, validatorAddr2 := valAddrs[0], valAddrs[1] denom := app.StakingKeeper.GetParams(ctx).BondDenom + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // set the unbonding time params := app.StakingKeeper.GetParams(ctx) params.UnbondingTime = 7 * time.Second app.StakingKeeper.SetParams(ctx, params) - - // create the validators - msgCreateValidator := NewTestMsgCreateValidator(validatorAddr, PKs[0], sdk.NewInt(10)) - // initial balance amt1 := app.BankKeeper.GetBalance(ctx, sdk.AccAddress(validatorAddr), denom).Amount - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + // create the validators + tstaking.CreateValidator(validatorAddr, PKs[0], 10, true) // balance should have been subtracted after creation amt2 := app.BankKeeper.GetBalance(ctx, sdk.AccAddress(validatorAddr), denom).Amount require.Equal(t, amt1.Sub(sdk.NewInt(10)).Int64(), amt2.Int64(), "expected coins to be subtracted") - msgCreateValidator = NewTestMsgCreateValidator(validatorAddr2, PKs[1], sdk.NewInt(10)) - res, err = handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) - + tstaking.CreateValidator(validatorAddr2, PKs[1], 10, true) bal1 := app.BankKeeper.GetAllBalances(ctx, sdk.AccAddress(validatorAddr)) // begin redelegate redAmt := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10)) msgBeginRedelegate := types.NewMsgBeginRedelegate(sdk.AccAddress(validatorAddr), validatorAddr, validatorAddr2, redAmt) - res, err = handler(ctx, msgBeginRedelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Handle(msgBeginRedelegate, true) // origin account should not lose tokens as with a regular delegation bal2 := app.BankKeeper.GetAllBalances(ctx, sdk.AccAddress(validatorAddr)) @@ -946,76 +752,54 @@ func TestRedelegationPeriod(t *testing.T) { require.True(t, found, "should not have unbonded") // cannot complete redelegation at time 6 seconds later - ctx = ctx.WithBlockTime(origHeader.Time.Add(time.Second * 6)) - staking.EndBlocker(ctx, app.StakingKeeper) + ctx = tstaking.TurnBlock(origHeader.Time.Add(time.Second * 6)) _, found = app.StakingKeeper.GetRedelegation(ctx, sdk.AccAddress(validatorAddr), validatorAddr, validatorAddr2) require.True(t, found, "should not have unbonded") // can complete redelegation at time 7 seconds later - ctx = ctx.WithBlockTime(origHeader.Time.Add(time.Second * 7)) - staking.EndBlocker(ctx, app.StakingKeeper) + ctx = tstaking.TurnBlock(origHeader.Time.Add(time.Second * 7)) _, found = app.StakingKeeper.GetRedelegation(ctx, sdk.AccAddress(validatorAddr), validatorAddr, validatorAddr2) require.False(t, found, "should have unbonded") } func TestTransitiveRedelegation(t *testing.T) { app, ctx, _, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 3, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) - - validatorAddr := valAddrs[0] - validatorAddr2 := valAddrs[1] - validatorAddr3 := valAddrs[2] + val1, val2, val3 := valAddrs[0], valAddrs[1], valAddrs[2] blockTime := time.Now().UTC() ctx = ctx.WithBlockTime(blockTime) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // create the validators - msgCreateValidator := NewTestMsgCreateValidator(validatorAddr, PKs[0], sdk.NewInt(10)) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) - - msgCreateValidator = NewTestMsgCreateValidator(validatorAddr2, PKs[1], sdk.NewInt(10)) - res, err = handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) - - msgCreateValidator = NewTestMsgCreateValidator(validatorAddr3, PKs[2], sdk.NewInt(10)) - res, err = handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.CreateValidator(val1, PKs[0], 10, true) + tstaking.CreateValidator(val2, PKs[1], 10, true) + tstaking.CreateValidator(val3, PKs[2], 10, true) // begin redelegate redAmt := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10)) - msgBeginRedelegate := types.NewMsgBeginRedelegate(sdk.AccAddress(validatorAddr), validatorAddr, validatorAddr2, redAmt) - res, err = handler(ctx, msgBeginRedelegate) - require.NoError(t, err) - require.NotNil(t, res) + msgBeginRedelegate := types.NewMsgBeginRedelegate(sdk.AccAddress(val1), val1, val2, redAmt) + tstaking.Handle(msgBeginRedelegate, true) // cannot redelegation to next validator while first delegation exists - msgBeginRedelegate = types.NewMsgBeginRedelegate(sdk.AccAddress(validatorAddr), validatorAddr2, validatorAddr3, redAmt) - res, err = handler(ctx, msgBeginRedelegate) - require.Error(t, err) - require.Nil(t, res) + msgBeginRedelegate = types.NewMsgBeginRedelegate(sdk.AccAddress(val1), val2, val3, redAmt) + tstaking.Handle(msgBeginRedelegate, false) params := app.StakingKeeper.GetParams(ctx) ctx = ctx.WithBlockTime(blockTime.Add(params.UnbondingTime)) + tstaking.Ctx = ctx // complete first redelegation staking.EndBlocker(ctx, app.StakingKeeper) // now should be able to redelegate from the second validator to the third - res, err = handler(ctx, msgBeginRedelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Handle(msgBeginRedelegate, true) } func TestMultipleRedelegationAtSameTime(t *testing.T) { app, ctx, _, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 2, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) - valAddr := valAddrs[0] valAddr2 := valAddrs[1] + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // set the unbonding time params := app.StakingKeeper.GetParams(ctx) @@ -1023,16 +807,8 @@ func TestMultipleRedelegationAtSameTime(t *testing.T) { app.StakingKeeper.SetParams(ctx, params) // create the validators - valTokens := sdk.TokensFromConsensusPower(10) - msgCreateValidator := NewTestMsgCreateValidator(valAddr, PKs[0], valTokens) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) - - msgCreateValidator = NewTestMsgCreateValidator(valAddr2, PKs[1], valTokens) - res, err = handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + valTokens := tstaking.CreateValidatorWithValPower(valAddr, PKs[0], 10, true) + tstaking.CreateValidator(valAddr2, PKs[1], valTokens.Int64(), true) // end block to bond them staking.EndBlocker(ctx, app.StakingKeeper) @@ -1041,9 +817,7 @@ func TestMultipleRedelegationAtSameTime(t *testing.T) { selfDelAddr := sdk.AccAddress(valAddr) // (the validator is it's own delegator) redAmt := sdk.NewCoin(sdk.DefaultBondDenom, valTokens.QuoRaw(2)) msgBeginRedelegate := types.NewMsgBeginRedelegate(selfDelAddr, valAddr, valAddr2, redAmt) - res, err = handler(ctx, msgBeginRedelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Handle(msgBeginRedelegate, true) // there should only be one entry in the redelegation object rd, found := app.StakingKeeper.GetRedelegation(ctx, selfDelAddr, valAddr, valAddr2) @@ -1051,9 +825,7 @@ func TestMultipleRedelegationAtSameTime(t *testing.T) { require.Len(t, rd.Entries, 1) // start a second redelegation at this same time as the first - res, err = handler(ctx, msgBeginRedelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Handle(msgBeginRedelegate, true) // now there should be two entries rd, found = app.StakingKeeper.GetRedelegation(ctx, selfDelAddr, valAddr, valAddr2) @@ -1061,19 +833,16 @@ func TestMultipleRedelegationAtSameTime(t *testing.T) { require.Len(t, rd.Entries, 2) // move forward in time, should complete both redelegations - ctx = ctx.WithBlockTime(ctx.BlockHeader().Time.Add(1 * time.Second)) - staking.EndBlocker(ctx, app.StakingKeeper) - + ctx = tstaking.TurnBlockTimeDiff(1 * time.Second) rd, found = app.StakingKeeper.GetRedelegation(ctx, selfDelAddr, valAddr, valAddr2) require.False(t, found) } func TestMultipleRedelegationAtUniqueTimes(t *testing.T) { app, ctx, _, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 2, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) - valAddr := valAddrs[0] valAddr2 := valAddrs[1] + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // set the unbonding time params := app.StakingKeeper.GetParams(ctx) @@ -1081,16 +850,8 @@ func TestMultipleRedelegationAtUniqueTimes(t *testing.T) { app.StakingKeeper.SetParams(ctx, params) // create the validators - valTokens := sdk.TokensFromConsensusPower(10) - msgCreateValidator := NewTestMsgCreateValidator(valAddr, PKs[0], valTokens) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) - - msgCreateValidator = NewTestMsgCreateValidator(valAddr2, PKs[1], valTokens) - res, err = handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + valTokens := tstaking.CreateValidatorWithValPower(valAddr, PKs[0], 10, true) + tstaking.CreateValidator(valAddr2, PKs[1], valTokens.Int64(), true) // end block to bond them staking.EndBlocker(ctx, app.StakingKeeper) @@ -1099,15 +860,12 @@ func TestMultipleRedelegationAtUniqueTimes(t *testing.T) { selfDelAddr := sdk.AccAddress(valAddr) // (the validator is it's own delegator) redAmt := sdk.NewCoin(sdk.DefaultBondDenom, valTokens.QuoRaw(2)) msgBeginRedelegate := types.NewMsgBeginRedelegate(selfDelAddr, valAddr, valAddr2, redAmt) - res, err = handler(ctx, msgBeginRedelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Handle(msgBeginRedelegate, true) // move forward in time and start a second redelegation ctx = ctx.WithBlockTime(ctx.BlockHeader().Time.Add(5 * time.Second)) - res, err = handler(ctx, msgBeginRedelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Ctx = ctx + tstaking.Handle(msgBeginRedelegate, true) // now there should be two entries rd, found := app.StakingKeeper.GetRedelegation(ctx, selfDelAddr, valAddr, valAddr2) @@ -1115,47 +873,36 @@ func TestMultipleRedelegationAtUniqueTimes(t *testing.T) { require.Len(t, rd.Entries, 2) // move forward in time, should complete the first redelegation, but not the second - ctx = ctx.WithBlockTime(ctx.BlockHeader().Time.Add(5 * time.Second)) - staking.EndBlocker(ctx, app.StakingKeeper) + ctx = tstaking.TurnBlockTimeDiff(5 * time.Second) rd, found = app.StakingKeeper.GetRedelegation(ctx, selfDelAddr, valAddr, valAddr2) require.True(t, found) require.Len(t, rd.Entries, 1) // move forward in time, should complete the second redelegation - ctx = ctx.WithBlockTime(ctx.BlockHeader().Time.Add(5 * time.Second)) - staking.EndBlocker(ctx, app.StakingKeeper) + ctx = tstaking.TurnBlockTimeDiff(5 * time.Second) rd, found = app.StakingKeeper.GetRedelegation(ctx, selfDelAddr, valAddr, valAddr2) require.False(t, found) } func TestMultipleUnbondingDelegationAtSameTime(t *testing.T) { app, ctx, _, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 1, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) - valAddr := valAddrs[0] + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // set the unbonding time params := app.StakingKeeper.GetParams(ctx) params.UnbondingTime = 1 * time.Second app.StakingKeeper.SetParams(ctx, params) - // create the validator - valTokens := sdk.TokensFromConsensusPower(10) - msgCreateValidator := NewTestMsgCreateValidator(valAddr, PKs[0], valTokens) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + // create the validators + valTokens := tstaking.CreateValidatorWithValPower(valAddr, PKs[0], 10, true) // end block to bond staking.EndBlocker(ctx, app.StakingKeeper) // begin an unbonding delegation selfDelAddr := sdk.AccAddress(valAddr) // (the validator is it's own delegator) - unbondAmt := sdk.NewCoin(sdk.DefaultBondDenom, valTokens.QuoRaw(2)) - msgUndelegate := types.NewMsgUndelegate(selfDelAddr, valAddr, unbondAmt) - res, err = handler(ctx, msgUndelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Undelegate(selfDelAddr, valAddr, valTokens.QuoRaw(2), true) // there should only be one entry in the ubd object ubd, found := app.StakingKeeper.GetUnbondingDelegation(ctx, selfDelAddr, valAddr) @@ -1163,9 +910,7 @@ func TestMultipleUnbondingDelegationAtSameTime(t *testing.T) { require.Len(t, ubd.Entries, 1) // start a second ubd at this same time as the first - res, err = handler(ctx, msgUndelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Undelegate(selfDelAddr, valAddr, valTokens.QuoRaw(2), true) // now there should be two entries ubd, found = app.StakingKeeper.GetUnbondingDelegation(ctx, selfDelAddr, valAddr) @@ -1173,17 +918,15 @@ func TestMultipleUnbondingDelegationAtSameTime(t *testing.T) { require.Len(t, ubd.Entries, 2) // move forwaubd in time, should complete both ubds - ctx = ctx.WithBlockTime(ctx.BlockHeader().Time.Add(1 * time.Second)) - staking.EndBlocker(ctx, app.StakingKeeper) - + ctx = tstaking.TurnBlockTimeDiff(1 * time.Second) ubd, found = app.StakingKeeper.GetUnbondingDelegation(ctx, selfDelAddr, valAddr) require.False(t, found) } func TestMultipleUnbondingDelegationAtUniqueTimes(t *testing.T) { app, ctx, _, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 1, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) valAddr := valAddrs[0] + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // set the unbonding time params := app.StakingKeeper.GetParams(ctx) @@ -1191,22 +934,14 @@ func TestMultipleUnbondingDelegationAtUniqueTimes(t *testing.T) { app.StakingKeeper.SetParams(ctx, params) // create the validator - valTokens := sdk.TokensFromConsensusPower(10) - msgCreateValidator := NewTestMsgCreateValidator(valAddr, PKs[0], valTokens) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + valTokens := tstaking.CreateValidatorWithValPower(valAddr, PKs[0], 10, true) // end block to bond staking.EndBlocker(ctx, app.StakingKeeper) // begin an unbonding delegation selfDelAddr := sdk.AccAddress(valAddr) // (the validator is it's own delegator) - unbondAmt := sdk.NewCoin(sdk.DefaultBondDenom, valTokens.QuoRaw(2)) - msgUndelegate := types.NewMsgUndelegate(selfDelAddr, valAddr, unbondAmt) - res, err = handler(ctx, msgUndelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Undelegate(selfDelAddr, valAddr, valTokens.QuoRaw(2), true) // there should only be one entry in the ubd object ubd, found := app.StakingKeeper.GetUnbondingDelegation(ctx, selfDelAddr, valAddr) @@ -1215,9 +950,8 @@ func TestMultipleUnbondingDelegationAtUniqueTimes(t *testing.T) { // move forwaubd in time and start a second redelegation ctx = ctx.WithBlockTime(ctx.BlockHeader().Time.Add(5 * time.Second)) - res, err = handler(ctx, msgUndelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Ctx = ctx + tstaking.Undelegate(selfDelAddr, valAddr, valTokens.QuoRaw(2), true) // now there should be two entries ubd, found = app.StakingKeeper.GetUnbondingDelegation(ctx, selfDelAddr, valAddr) @@ -1225,26 +959,23 @@ func TestMultipleUnbondingDelegationAtUniqueTimes(t *testing.T) { require.Len(t, ubd.Entries, 2) // move forwaubd in time, should complete the first redelegation, but not the second - ctx = ctx.WithBlockTime(ctx.BlockHeader().Time.Add(5 * time.Second)) - staking.EndBlocker(ctx, app.StakingKeeper) + ctx = tstaking.TurnBlockTimeDiff(5 * time.Second) ubd, found = app.StakingKeeper.GetUnbondingDelegation(ctx, selfDelAddr, valAddr) require.True(t, found) require.Len(t, ubd.Entries, 1) // move forwaubd in time, should complete the second redelegation - ctx = ctx.WithBlockTime(ctx.BlockHeader().Time.Add(5 * time.Second)) - staking.EndBlocker(ctx, app.StakingKeeper) + ctx = tstaking.TurnBlockTimeDiff(5 * time.Second) ubd, found = app.StakingKeeper.GetUnbondingDelegation(ctx, selfDelAddr, valAddr) require.False(t, found) } func TestUnbondingWhenExcessValidators(t *testing.T) { app, ctx, _, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 3, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) - - validatorAddr1 := valAddrs[0] - validatorAddr2 := valAddrs[1] - validatorAddr3 := valAddrs[2] + val1 := valAddrs[0] + val2 := valAddrs[1] + val3 := valAddrs[2] + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) // set the unbonding time params := app.StakingKeeper.GetParams(ctx) @@ -1252,43 +983,21 @@ func TestUnbondingWhenExcessValidators(t *testing.T) { app.StakingKeeper.SetParams(ctx, params) // add three validators - valTokens1 := sdk.TokensFromConsensusPower(50) - msgCreateValidator := NewTestMsgCreateValidator(validatorAddr1, PKs[0], valTokens1) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) - + tstaking.CreateValidatorWithValPower(val1, PKs[0], 50, true) // apply TM updates app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) require.Equal(t, 1, len(app.StakingKeeper.GetLastValidators(ctx))) - valTokens2 := sdk.TokensFromConsensusPower(30) - msgCreateValidator = NewTestMsgCreateValidator(validatorAddr2, PKs[1], valTokens2) - res, err = handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) - - // apply TM updates + valTokens2 := tstaking.CreateValidatorWithValPower(val2, PKs[1], 30, true) app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) require.Equal(t, 2, len(app.StakingKeeper.GetLastValidators(ctx))) - valTokens3 := sdk.TokensFromConsensusPower(10) - msgCreateValidator = NewTestMsgCreateValidator(validatorAddr3, PKs[2], valTokens3) - res, err = handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) - - // apply TM updates + tstaking.CreateValidatorWithValPower(val3, PKs[2], 10, true) app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) require.Equal(t, 2, len(app.StakingKeeper.GetLastValidators(ctx))) // unbond the validator-2 - unbondAmt := sdk.NewCoin(sdk.DefaultBondDenom, valTokens2) - msgUndelegate := types.NewMsgUndelegate(sdk.AccAddress(validatorAddr2), validatorAddr2, unbondAmt) - res, err = handler(ctx, msgUndelegate) - require.NoError(t, err) - require.NotNil(t, res) - + tstaking.Undelegate(sdk.AccAddress(val2), val2, valTokens2, true) // apply TM updates app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) @@ -1297,35 +1006,20 @@ func TestUnbondingWhenExcessValidators(t *testing.T) { // the total number of validators should stay the same vals := app.StakingKeeper.GetLastValidators(ctx) require.Equal(t, 2, len(vals), "vals %v", vals) - val1, found := app.StakingKeeper.GetValidator(ctx, validatorAddr1) - require.True(t, found) - require.Equal(t, types.Bonded, val1.Status, "%v", val1) + tstaking.CheckValidator(val1, types.Bonded, false) } func TestBondUnbondRedelegateSlashTwice(t *testing.T) { app, ctx, delAddrs, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 3, 1000000000) - - handler := staking.NewHandler(app.StakingKeeper) - valA, valB, del := valAddrs[0], valAddrs[1], delAddrs[2] consAddr0 := sdk.ConsAddress(PKs[0].Address()) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) - valTokens := sdk.TokensFromConsensusPower(10) - msgCreateValidator := NewTestMsgCreateValidator(valA, PKs[0], valTokens) - res, err := handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) - - msgCreateValidator = NewTestMsgCreateValidator(valB, PKs[1], valTokens) - res, err = handler(ctx, msgCreateValidator) - require.NoError(t, err) - require.NotNil(t, res) + valTokens := tstaking.CreateValidatorWithValPower(valA, PKs[0], 10, true) + tstaking.CreateValidator(valB, PKs[1], valTokens.Int64(), true) // delegate 10 stake - msgDelegate := NewTestMsgDelegate(del, valA, valTokens) - res, err = handler(ctx, msgDelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Delegate(del, valA, valTokens.Int64()) // apply Tendermint updates updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) @@ -1333,20 +1027,16 @@ func TestBondUnbondRedelegateSlashTwice(t *testing.T) { // a block passes ctx = ctx.WithBlockHeight(1) + tstaking.Ctx = ctx // begin unbonding 4 stake - unbondAmt := sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromConsensusPower(4)) - msgUndelegate := types.NewMsgUndelegate(del, valA, unbondAmt) - res, err = handler(ctx, msgUndelegate) - require.NoError(t, err) - require.NotNil(t, res) + unbondAmt := sdk.TokensFromConsensusPower(4) + tstaking.Undelegate(del, valA, unbondAmt, true) // begin redelegate 6 stake redAmt := sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromConsensusPower(6)) msgBeginRedelegate := types.NewMsgBeginRedelegate(del, valA, valB, redAmt) - res, err = handler(ctx, msgBeginRedelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Handle(msgBeginRedelegate, true) // destination delegation should have 6 shares delegation, found := app.StakingKeeper.GetDelegation(ctx, del, valB) @@ -1364,7 +1054,7 @@ func TestBondUnbondRedelegateSlashTwice(t *testing.T) { ubd, found := app.StakingKeeper.GetUnbondingDelegation(ctx, del, valA) require.True(t, found) require.Len(t, ubd.Entries, 1) - require.Equal(t, unbondAmt.Amount.QuoRaw(2), ubd.Entries[0].Balance) + require.Equal(t, unbondAmt.QuoRaw(2), ubd.Entries[0].Balance) // redelegation should have been slashed by half redelegation, found := app.StakingKeeper.GetRedelegation(ctx, del, valA, valB) @@ -1384,12 +1074,13 @@ func TestBondUnbondRedelegateSlashTwice(t *testing.T) { // slash the validator for an infraction committed after the unbonding and redelegation begin ctx = ctx.WithBlockHeight(3) app.StakingKeeper.Slash(ctx, consAddr0, 2, 10, sdk.NewDecWithPrec(5, 1)) + tstaking.Ctx = ctx // unbonding delegation should be unchanged ubd, found = app.StakingKeeper.GetUnbondingDelegation(ctx, del, valA) require.True(t, found) require.Len(t, ubd.Entries, 1) - require.Equal(t, unbondAmt.Amount.QuoRaw(2), ubd.Entries[0].Balance) + require.Equal(t, unbondAmt.QuoRaw(2), ubd.Entries[0].Balance) // redelegation should be unchanged redelegation, found = app.StakingKeeper.GetRedelegation(ctx, del, valA, valB) @@ -1422,9 +1113,8 @@ func TestInvalidMsg(t *testing.T) { func TestInvalidCoinDenom(t *testing.T) { app, ctx, delAddrs, valAddrs := bootstrapHandlerGenesisTest(t, 1000, 3, 1000000000) - handler := staking.NewHandler(app.StakingKeeper) - valA, valB, delAddr := valAddrs[0], valAddrs[1], delAddrs[2] + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) valTokens := sdk.TokensFromConsensusPower(100) invalidCoin := sdk.NewCoin("churros", valTokens) @@ -1432,49 +1122,33 @@ func TestInvalidCoinDenom(t *testing.T) { oneCoin := sdk.NewCoin(sdk.DefaultBondDenom, sdk.OneInt()) commission := types.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.ZeroDec()) - - msgCreate := types.NewMsgCreateValidator(valA, PKs[0], invalidCoin, types.Description{}, commission, sdk.OneInt()) - res, err := handler(ctx, msgCreate) - require.Error(t, err) - require.Nil(t, res) - - msgCreate = types.NewMsgCreateValidator(valA, PKs[0], validCoin, types.Description{}, commission, sdk.OneInt()) - res, err = handler(ctx, msgCreate) + msgCreate, err := types.NewMsgCreateValidator(valA, PKs[0], invalidCoin, types.Description{}, commission, sdk.OneInt()) require.NoError(t, err) - require.NotNil(t, res) + tstaking.Handle(msgCreate, false) - msgCreate = types.NewMsgCreateValidator(valB, PKs[1], validCoin, types.Description{}, commission, sdk.OneInt()) - res, err = handler(ctx, msgCreate) + msgCreate, err = types.NewMsgCreateValidator(valA, PKs[0], validCoin, types.Description{}, commission, sdk.OneInt()) require.NoError(t, err) - require.NotNil(t, res) + tstaking.Handle(msgCreate, true) + + msgCreate, err = types.NewMsgCreateValidator(valB, PKs[1], validCoin, types.Description{}, commission, sdk.OneInt()) + require.NoError(t, err) + tstaking.Handle(msgCreate, true) msgDelegate := types.NewMsgDelegate(delAddr, valA, invalidCoin) - res, err = handler(ctx, msgDelegate) - require.Error(t, err) - require.Nil(t, res) + tstaking.Handle(msgDelegate, false) msgDelegate = types.NewMsgDelegate(delAddr, valA, validCoin) - res, err = handler(ctx, msgDelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Handle(msgDelegate, true) msgUndelegate := types.NewMsgUndelegate(delAddr, valA, invalidCoin) - res, err = handler(ctx, msgUndelegate) - require.Error(t, err) - require.Nil(t, res) + tstaking.Handle(msgUndelegate, false) msgUndelegate = types.NewMsgUndelegate(delAddr, valA, oneCoin) - res, err = handler(ctx, msgUndelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Handle(msgUndelegate, true) msgRedelegate := types.NewMsgBeginRedelegate(delAddr, valA, valB, invalidCoin) - res, err = handler(ctx, msgRedelegate) - require.Error(t, err) - require.Nil(t, res) + tstaking.Handle(msgRedelegate, false) msgRedelegate = types.NewMsgBeginRedelegate(delAddr, valA, valB, oneCoin) - res, err = handler(ctx, msgRedelegate) - require.NoError(t, err) - require.NotNil(t, res) + tstaking.Handle(msgRedelegate, true) } diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index d408440226..f5e859f04e 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -7,6 +7,7 @@ import ( metrics "github.com/armon/go-metrics" tmstrings "github.com/tendermint/tendermint/libs/strings" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -38,9 +39,9 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa return nil, types.ErrValidatorOwnerExists } - pk, err := sdk.GetPubKeyFromBech32(sdk.Bech32PubKeyTypeConsPub, msg.Pubkey) - if err != nil { - return nil, err + pk, ok := msg.Pubkey.GetCachedValue().(cryptotypes.PubKey) + if !ok { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "Expecting crypto.PubKey, got %T", pk) } if _, found := k.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pk)); found { diff --git a/x/staking/simulation/operations.go b/x/staking/simulation/operations.go index ff54822aa3..131c4251fd 100644 --- a/x/staking/simulation/operations.go +++ b/x/staking/simulation/operations.go @@ -148,7 +148,10 @@ func SimulateMsgCreateValidator(ak types.AccountKeeper, bk types.BankKeeper, k k simtypes.RandomDecAmount(r, maxCommission), ) - msg := types.NewMsgCreateValidator(address, simAccount.ConsKey.PubKey(), selfDelegation, description, commission, sdk.OneInt()) + msg, err := types.NewMsgCreateValidator(address, simAccount.ConsKey.PubKey(), selfDelegation, description, commission, sdk.OneInt()) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to create CreateValidator message"), nil, err + } txGen := simappparams.MakeEncodingConfig().TxConfig tx, err := helpers.GenTx( diff --git a/x/staking/simulation/operations_test.go b/x/staking/simulation/operations_test.go index f077a4e50c..ff9d104368 100644 --- a/x/staking/simulation/operations_test.go +++ b/x/staking/simulation/operations_test.go @@ -85,7 +85,7 @@ func TestSimulateMsgCreateValidator(t *testing.T) { require.Equal(t, "0.660000000000000000", msg.Commission.MaxRate.String()) require.Equal(t, "0.047464127245687382", msg.Commission.Rate.String()) require.Equal(t, types.TypeMsgCreateValidator, msg.Type()) - require.Equal(t, "cosmosvalconspub1zcjduepq280tm686ma80cva9z620dmknd9a858pd2zmq9ackfenfllecjxds0hg9n7", msg.Pubkey) + require.Equal(t, []byte{0xa, 0x20, 0x51, 0xde, 0xbd, 0xe8, 0xfa, 0xdf, 0x4e, 0xfc, 0x33, 0xa5, 0x16, 0x94, 0xf6, 0xee, 0xd3, 0x69, 0x7a, 0x7a, 0x1c, 0x2d, 0x50, 0xb6, 0x2, 0xf7, 0x16, 0x4e, 0x66, 0x9f, 0xff, 0x38, 0x91, 0x9b}, msg.Pubkey.Value) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.DelegatorAddress) require.Equal(t, "cosmosvaloper1ghekyjucln7y67ntx7cf27m9dpuxxemnsvnaes", msg.ValidatorAddress) require.Len(t, futureOperations, 0) diff --git a/x/staking/teststaking/helper.go b/x/staking/teststaking/helper.go new file mode 100644 index 0000000000..c0ba45bb1a --- /dev/null +++ b/x/staking/teststaking/helper.go @@ -0,0 +1,133 @@ +package teststaking + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/crypto" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/staking" + "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +// Helper is a structure which wraps the staking handler +// and provides methods useful in tests +type Helper struct { + t *testing.T + h sdk.Handler + k keeper.Keeper + + Ctx sdk.Context + Commission stakingtypes.CommissionRates + // Coin Denomination + Denom string +} + +// NewHelper creates staking Handler wrapper for tests +func NewHelper(t *testing.T, ctx sdk.Context, k keeper.Keeper) *Helper { + return &Helper{t, staking.NewHandler(k), k, ctx, ZeroCommission(), sdk.DefaultBondDenom} +} + +// CreateValidator calls handler to create a new staking validator +func (sh *Helper) CreateValidator(addr sdk.ValAddress, pk crypto.PubKey, stakeAmount int64, ok bool) { + coin := sdk.NewCoin(sh.Denom, sdk.NewInt(stakeAmount)) + sh.createValidator(addr, pk, coin, ok) +} + +// CreateValidatorWithValPower calls handler to create a new staking validator with zero +// commission +func (sh *Helper) CreateValidatorWithValPower(addr sdk.ValAddress, pk crypto.PubKey, valPower int64, ok bool) sdk.Int { + amount := sdk.TokensFromConsensusPower(valPower) + coin := sdk.NewCoin(sh.Denom, amount) + sh.createValidator(addr, pk, coin, ok) + return amount +} + +// CreateValidatorMsg returns a message used to create validator in this service. +func (sh *Helper) CreateValidatorMsg(addr sdk.ValAddress, pk crypto.PubKey, stakeAmount int64) *stakingtypes.MsgCreateValidator { + coin := sdk.NewCoin(sh.Denom, sdk.NewInt(stakeAmount)) + msg, err := stakingtypes.NewMsgCreateValidator(addr, pk, coin, stakingtypes.Description{}, sh.Commission, sdk.OneInt()) + require.NoError(sh.t, err) + return msg +} + +func (sh *Helper) createValidator(addr sdk.ValAddress, pk crypto.PubKey, coin sdk.Coin, ok bool) { + msg, err := stakingtypes.NewMsgCreateValidator(addr, pk, coin, stakingtypes.Description{}, sh.Commission, sdk.OneInt()) + require.NoError(sh.t, err) + sh.Handle(msg, ok) +} + +// Delegate calls handler to delegate stake for a validator +func (sh *Helper) Delegate(delegator sdk.AccAddress, val sdk.ValAddress, amount int64) { + coin := sdk.NewCoin(sh.Denom, sdk.NewInt(amount)) + msg := stakingtypes.NewMsgDelegate(delegator, val, coin) + sh.Handle(msg, true) +} + +// DelegateWithPower calls handler to delegate stake for a validator +func (sh *Helper) DelegateWithPower(delegator sdk.AccAddress, val sdk.ValAddress, power int64) { + coin := sdk.NewCoin(sh.Denom, sdk.TokensFromConsensusPower(power)) + msg := stakingtypes.NewMsgDelegate(delegator, val, coin) + sh.Handle(msg, true) +} + +// Undelegate calls handler to unbound some stake from a validator. +func (sh *Helper) Undelegate(delegator sdk.AccAddress, val sdk.ValAddress, amount sdk.Int, ok bool) *sdk.Result { + unbondAmt := sdk.NewCoin(sh.Denom, amount) + msg := stakingtypes.NewMsgUndelegate(delegator, val, unbondAmt) + return sh.Handle(msg, ok) +} + +// Handle calls staking handler on a given message +func (sh *Helper) Handle(msg sdk.Msg, ok bool) *sdk.Result { + res, err := sh.h(sh.Ctx, msg) + if ok { + require.NoError(sh.t, err) + require.NotNil(sh.t, res) + } else { + require.Error(sh.t, err) + require.Nil(sh.t, res) + } + return res +} + +// CheckValidator asserts that a validor exists and has a given status (if status!="") +// and if has a right jailed flag. +func (sh *Helper) CheckValidator(addr sdk.ValAddress, status stakingtypes.BondStatus, jailed bool) stakingtypes.Validator { + v, ok := sh.k.GetValidator(sh.Ctx, addr) + require.True(sh.t, ok) + require.Equal(sh.t, jailed, v.Jailed, "wrong Jalied status") + if status >= 0 { + require.Equal(sh.t, status, v.Status) + } + return v +} + +// CheckDelegator asserts that a delegator exists +func (sh *Helper) CheckDelegator(delegator sdk.AccAddress, val sdk.ValAddress, found bool) { + _, ok := sh.k.GetDelegation(sh.Ctx, delegator, val) + require.Equal(sh.t, ok, found) +} + +// TurnBlock calls EndBlocker and updates the block time +func (sh *Helper) TurnBlock(newTime time.Time) sdk.Context { + sh.Ctx = sh.Ctx.WithBlockTime(newTime) + staking.EndBlocker(sh.Ctx, sh.k) + return sh.Ctx +} + +// TurnBlockTimeDiff calls EndBlocker and updates the block time by adding the +// duration to the current block time +func (sh *Helper) TurnBlockTimeDiff(diff time.Duration) sdk.Context { + sh.Ctx = sh.Ctx.WithBlockTime(sh.Ctx.BlockHeader().Time.Add(diff)) + staking.EndBlocker(sh.Ctx, sh.k) + return sh.Ctx +} + +// ZeroCommission constructs a commission rates with all zeros. +func ZeroCommission() stakingtypes.CommissionRates { + return stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) +} diff --git a/x/staking/types/msg.go b/x/staking/types/msg.go index e7e8305ea0..51e19ac263 100644 --- a/x/staking/types/msg.go +++ b/x/staking/types/msg.go @@ -5,6 +5,7 @@ import ( "github.com/tendermint/tendermint/crypto" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -19,11 +20,13 @@ const ( ) var ( - _ sdk.Msg = &MsgCreateValidator{} - _ sdk.Msg = &MsgEditValidator{} - _ sdk.Msg = &MsgDelegate{} - _ sdk.Msg = &MsgUndelegate{} - _ sdk.Msg = &MsgBeginRedelegate{} + _ sdk.Msg = &MsgCreateValidator{} + _ codectypes.UnpackInterfacesMessage = (*MsgCreateValidator)(nil) + _ sdk.Msg = &MsgCreateValidator{} + _ sdk.Msg = &MsgEditValidator{} + _ sdk.Msg = &MsgDelegate{} + _ sdk.Msg = &MsgUndelegate{} + _ sdk.Msg = &MsgBeginRedelegate{} ) // NewMsgCreateValidator creates a new MsgCreateValidator instance. @@ -31,21 +34,20 @@ var ( func NewMsgCreateValidator( valAddr sdk.ValAddress, pubKey crypto.PubKey, selfDelegation sdk.Coin, description Description, commission CommissionRates, minSelfDelegation sdk.Int, -) *MsgCreateValidator { - var pkStr string - if pubKey != nil { - pkStr = sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, pubKey) +) (*MsgCreateValidator, error) { + pkAny, err := codectypes.PackAny(pubKey) + if err != nil { + return nil, err } - return &MsgCreateValidator{ Description: description, DelegatorAddress: sdk.AccAddress(valAddr).String(), ValidatorAddress: valAddr.String(), - Pubkey: pkStr, + Pubkey: pkAny, Value: selfDelegation, Commission: commission, MinSelfDelegation: minSelfDelegation, - } + }, nil } // Route implements the sdk.Msg interface. @@ -105,7 +107,7 @@ func (msg MsgCreateValidator) ValidateBasic() error { return ErrBadValidatorAddr } - if msg.Pubkey == "" { + if msg.Pubkey == nil { return ErrEmptyValidatorPubKey } @@ -136,6 +138,12 @@ func (msg MsgCreateValidator) ValidateBasic() error { return nil } +// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces +func (msg MsgCreateValidator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + var pubKey crypto.PubKey + return unpacker.UnpackAny(msg.Pubkey, &pubKey) +} + // NewMsgEditValidator creates a new MsgEditValidator instance //nolint:interfacer func NewMsgEditValidator(valAddr sdk.ValAddress, description Description, newRate *sdk.Dec, newMinSelfDelegation *sdk.Int) *MsgEditValidator { diff --git a/x/staking/types/msg_test.go b/x/staking/types/msg_test.go index 127e80549b..eb83b33162 100644 --- a/x/staking/types/msg_test.go +++ b/x/staking/types/msg_test.go @@ -6,6 +6,11 @@ import ( "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/crypto" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -14,6 +19,38 @@ var ( coinZero = sdk.NewInt64Coin(sdk.DefaultBondDenom, 0) ) +func TestMsgDecode(t *testing.T) { + registry := codectypes.NewInterfaceRegistry() + cryptocodec.RegisterInterfaces(registry) + RegisterInterfaces(registry) + cdc := codec.NewProtoCodec(registry) + + // firstly we start testing the pubkey serialization + + pk1bz, err := codec.MarshalAny(cdc, pk1) + require.NoError(t, err) + var pkUnmarshaled cryptotypes.PubKey + err = codec.UnmarshalAny(cdc, &pkUnmarshaled, pk1bz) + require.NoError(t, err) + require.True(t, pk1.Equals(pkUnmarshaled.(*ed25519.PubKey))) + + // now let's try to serialize the whole message + + commission1 := NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) + msg, err := NewMsgCreateValidator(valAddr1, pk1, coinPos, Description{}, commission1, sdk.OneInt()) + require.NoError(t, err) + msgSerialized, err := codec.MarshalAny(cdc, msg) + require.NoError(t, err) + + var msgUnmarshaled sdk.Msg + err = codec.UnmarshalAny(cdc, &msgUnmarshaled, msgSerialized) + require.NoError(t, err) + msg2, ok := msgUnmarshaled.(*MsgCreateValidator) + require.True(t, ok) + require.True(t, msg.Value.IsEqual(msg2.Value)) + require.True(t, msg.Pubkey.Equal(msg2.Pubkey)) +} + // test ValidateBasic for MsgCreateValidator func TestMsgCreateValidator(t *testing.T) { commission1 := NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) @@ -41,8 +78,10 @@ func TestMsgCreateValidator(t *testing.T) { } for _, tc := range tests { + t.Logf("Test: %s, pk=%t", tc.name, tc.pubkey) description := NewDescription(tc.moniker, tc.identity, tc.website, tc.securityContact, tc.details) - msg := NewMsgCreateValidator(tc.validatorAddr, tc.pubkey, tc.bond, description, tc.CommissionRates, tc.minSelfDelegation) + msg, err := NewMsgCreateValidator(tc.validatorAddr, tc.pubkey, tc.bond, description, tc.CommissionRates, tc.minSelfDelegation) + require.NoError(t, err) if tc.expectPass { require.Nil(t, msg.ValidateBasic(), "test: %v", tc.name) } else { diff --git a/x/staking/types/tx.pb.go b/x/staking/types/tx.pb.go index d2d26bd251..f49c42ecdb 100644 --- a/x/staking/types/tx.pb.go +++ b/x/staking/types/tx.pb.go @@ -6,10 +6,11 @@ package types import ( context "context" fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - grpc1 "github.com/gogo/protobuf/grpc" - types "github.com/cosmos/cosmos-sdk/types" + types1 "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/golang/protobuf/ptypes/timestamp" @@ -41,8 +42,8 @@ type MsgCreateValidator struct { MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation" yaml:"min_self_delegation"` DelegatorAddress string `protobuf:"bytes,4,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` ValidatorAddress string `protobuf:"bytes,5,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` - Pubkey string `protobuf:"bytes,6,opt,name=pubkey,proto3" json:"pubkey,omitempty"` - Value types.Coin `protobuf:"bytes,7,opt,name=value,proto3" json:"value"` + Pubkey *types.Any `protobuf:"bytes,6,opt,name=pubkey,proto3" json:"pubkey,omitempty"` + Value types1.Coin `protobuf:"bytes,7,opt,name=value,proto3" json:"value"` } func (m *MsgCreateValidator) Reset() { *m = MsgCreateValidator{} } @@ -201,9 +202,9 @@ var xxx_messageInfo_MsgEditValidatorResponse proto.InternalMessageInfo // MsgDelegate defines a SDK message for performing a delegation of coins // from a delegator to a validator. type MsgDelegate struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` - Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` + Amount types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` } func (m *MsgDelegate) Reset() { *m = MsgDelegate{} } @@ -279,10 +280,10 @@ var xxx_messageInfo_MsgDelegateResponse proto.InternalMessageInfo // MsgBeginRedelegate defines a SDK message for performing a redelegation // of coins from a delegator and source validator to a destination validator. type MsgBeginRedelegate struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` - ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty" yaml:"validator_src_address"` - ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty" yaml:"validator_dst_address"` - Amount types.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty" yaml:"validator_src_address"` + ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty" yaml:"validator_dst_address"` + Amount types1.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"` } func (m *MsgBeginRedelegate) Reset() { *m = MsgBeginRedelegate{} } @@ -366,9 +367,9 @@ func (m *MsgBeginRedelegateResponse) GetCompletionTime() time.Time { // MsgUndelegate defines a SDK message for performing an undelegation from a // delegate and a validator. type MsgUndelegate struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` - Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` + Amount types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` } func (m *MsgUndelegate) Reset() { *m = MsgUndelegate{} } @@ -465,58 +466,59 @@ func init() { func init() { proto.RegisterFile("cosmos/staking/v1beta1/tx.proto", fileDescriptor_0926ef28816b35ab) } var fileDescriptor_0926ef28816b35ab = []byte{ - // 815 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x96, 0x4f, 0x6b, 0xdb, 0x48, - 0x18, 0xc6, 0x2d, 0xdb, 0xf1, 0x66, 0x27, 0xe4, 0x9f, 0xb2, 0x09, 0x5e, 0x11, 0xac, 0xa0, 0xec, - 0xb6, 0xa1, 0x6d,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9d, 0x5f, 0x96, 0xb8, 0x8b, - 0xcb, 0x12, 0xf7, 0xe3, 0xb2, 0xc4, 0x9d, 0x5e, 0x95, 0x32, 0x17, 0x57, 0xa5, 0xcc, 0xd7, 0xab, - 0x52, 0xe6, 0xcd, 0xbd, 0xd4, 0x36, 0x76, 0xcc, 0xbe, 0x3a, 0x69, 0x43, 0xab, 0x17, 0x68, 0x24, - 0x1f, 0xfc, 0x0a, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x72, 0xf7, 0x1e, 0x24, 0x0b, 0x00, 0x00, + // 829 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x96, 0xcb, 0x4e, 0xdb, 0x4a, + 0x1c, 0xc6, 0xe3, 0x24, 0xe4, 0x70, 0x06, 0x71, 0x33, 0x17, 0x05, 0x0b, 0xc5, 0xc8, 0x9c, 0x0b, + 0x3a, 0x07, 0xec, 0x03, 0x47, 0x55, 0x25, 0x36, 0x15, 0x21, 0xad, 0x8a, 0xda, 0x6c, 0x0c, 0xed, + 0xa2, 0xaa, 0x14, 0x39, 0xf6, 0xc4, 0xb5, 0x62, 0x7b, 0x82, 0x67, 0x82, 0x88, 0xd4, 0x07, 0xe8, + 0x12, 0xa9, 0xbb, 0xae, 0x78, 0x87, 0xbe, 0x04, 0xab, 0x8a, 0x65, 0xd5, 0x45, 0x5a, 0x81, 0x54, + 0xb1, 0xce, 0x13, 0x54, 0x1e, 0xdb, 0x13, 0xc7, 0xb9, 0x28, 0x42, 0xcd, 0xa6, 0x2b, 0xc8, 0xf8, + 0x37, 0xdf, 0x78, 0xbe, 0xff, 0x37, 0xff, 0x31, 0x10, 0x75, 0x84, 0x1d, 0x84, 0x15, 0x4c, 0xb4, + 0xba, 0xe5, 0x9a, 0xca, 0xd9, 0x6e, 0x15, 0x12, 0x6d, 0x57, 0x21, 0xe7, 0x72, 0xc3, 0x43, 0x04, + 0xf1, 0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x7c, 0xe1, 0x1a, 0xbf, 0x7c, 0x7e, 0x6b, 0x60, 0xa5, 0x67, 0xa7, 0x13, 0xb2, + 0x74, 0xef, 0x43, 0x16, 0x64, 0xca, 0xd8, 0xe4, 0x4f, 0xc1, 0x7c, 0xf2, 0xd3, 0xe0, 0x9f, 0x61, + 0x3d, 0xbb, 0xff, 0x46, 0x10, 0xf6, 0xc6, 0x67, 0xd9, 0x4e, 0xea, 0x60, 0xb6, 0xf7, 0xe6, 0xd8, + 0x1a, 0x21, 0xd2, 0x43, 0x0a, 0xff, 0x8d, 0x4b, 0xb2, 0xc5, 0x5e, 0x83, 0x69, 0xd6, 0xf4, 0x36, + 0x47, 0xcc, 0x8e, 0x20, 0xe1, 0xdf, 0x31, 0x20, 0xa6, 0x7e, 0x0a, 0xe6, 0x93, 0x2d, 0x65, 0x94, + 0x7b, 0x09, 0x76, 0xa4, 0x7b, 0xc3, 0x8e, 0x56, 0x15, 0x80, 0xd8, 0x39, 0xf8, 0x73, 0x84, 0x42, + 0x17, 0x13, 0x76, 0xc6, 0xc2, 0xa2, 0x35, 0x8a, 0x4f, 0xae, 0x6e, 0x0a, 0xdc, 0xf5, 0x4d, 0x81, + 0xfb, 0x76, 0x53, 0xe0, 0x2e, 0x6e, 0x0b, 0xa9, 0xeb, 0xdb, 0x42, 0xea, 0xf3, 0x6d, 0x21, 0xf5, + 0x6a, 0x7b, 0xe4, 0x35, 0x76, 0xce, 0x3e, 0x53, 0xe9, 0x85, 0x56, 0xcd, 0xd1, 0x48, 0xfe, 0xff, + 0x23, 0x00, 0x00, 0xff, 0xff, 0x9f, 0x9d, 0x50, 0xee, 0x55, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -789,10 +791,15 @@ func (m *MsgCreateValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x3a - if len(m.Pubkey) > 0 { - i -= len(m.Pubkey) - copy(dAtA[i:], m.Pubkey) - i = encodeVarintTx(dAtA, i, uint64(len(m.Pubkey))) + if m.Pubkey != nil { + { + size, err := m.Pubkey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x32 } @@ -1097,12 +1104,12 @@ func (m *MsgBeginRedelegateResponse) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l - n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) - if err7 != nil { - return 0, err7 + n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) + if err8 != nil { + return 0, err8 } - i -= n7 - i = encodeVarintTx(dAtA, i, uint64(n7)) + i -= n8 + i = encodeVarintTx(dAtA, i, uint64(n8)) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -1175,12 +1182,12 @@ func (m *MsgUndelegateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) - if err9 != nil { - return 0, err9 + n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) + if err10 != nil { + return 0, err10 } - i -= n9 - i = encodeVarintTx(dAtA, i, uint64(n9)) + i -= n10 + i = encodeVarintTx(dAtA, i, uint64(n10)) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -1217,8 +1224,8 @@ func (m *MsgCreateValidator) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Pubkey) - if l > 0 { + if m.Pubkey != nil { + l = m.Pubkey.Size() n += 1 + l + sovTx(uint64(l)) } l = m.Value.Size() @@ -1562,7 +1569,7 @@ func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pubkey", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1572,23 +1579,27 @@ func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Pubkey = string(dAtA[iNdEx:postIndex]) + if m.Pubkey == nil { + m.Pubkey = &types.Any{} + } + if err := m.Pubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 7: if wireType != 2 { From ba2799ec6deccbe17094a4478cdf0228f1f668e2 Mon Sep 17 00:00:00 2001 From: Jun Kimura Date: Mon, 19 Oct 2020 22:35:52 +0900 Subject: [PATCH 53/84] fix sequence checks in solomachine (#7586) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> --- x/ibc/light-clients/06-solomachine/types/client_state.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/ibc/light-clients/06-solomachine/types/client_state.go b/x/ibc/light-clients/06-solomachine/types/client_state.go index 76371f85d7..401235f9ad 100644 --- a/x/ibc/light-clients/06-solomachine/types/client_state.go +++ b/x/ibc/light-clients/06-solomachine/types/client_state.go @@ -439,10 +439,10 @@ func produceVerificationArgs( } latestSequence := cs.GetLatestHeight().GetVersionHeight() - if latestSequence < sequence { + if latestSequence != sequence { return nil, 0, 0, sdkerrors.Wrapf( sdkerrors.ErrInvalidHeight, - "client state sequence < proof sequence (%d < %d)", latestSequence, sequence, + "client state sequence != proof sequence (%d != %d)", latestSequence, sequence, ) } From 9e7eb0da00f01722313dcada1dcdd6a587f40b6e Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Mon, 19 Oct 2020 13:46:10 -0400 Subject: [PATCH 54/84] Add MsgServer to Configurator for ADR 031 wiring (#7584) * Add MsgServer to Configurator for ADR 031 wiring * Add docs, wire up evidence & staking * Add integration test * Add comments * Doc strings * Update types/module/configurator.go Co-authored-by: Aleksandr Bezobchuk * Update types/module/configurator.go Co-authored-by: Cory * Wire up vesting * Update CHANGELOG.md Co-authored-by: Aleksandr Bezobchuk Co-authored-by: Amaury Martiny Co-authored-by: Cory Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- CHANGELOG.md | 2 +- simapp/app.go | 2 +- tests/mocks/account_retriever.go | 111 ++++++++++++++++++++++++ types/module/configurator.go | 17 +++- types/module/module_test.go | 3 +- x/auth/vesting/module.go | 6 +- x/bank/client/cli/cli_test.go | 142 +++++++++++++++++++++++++++++++ x/bank/module.go | 4 +- x/crisis/module.go | 7 +- x/distribution/module.go | 4 +- x/evidence/module.go | 4 +- x/gov/module.go | 4 +- x/slashing/module.go | 4 +- x/staking/module.go | 4 +- 14 files changed, 292 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b09bc01d73..8dcf673cba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking -* (AppModule) [\#7518](https://github.com/cosmos/cosmos-sdk/pull/7518) Rename `AppModule.RegisterQueryServices` to `AppModule.RegisterServices`, as this method now registers multiple services (the gRPC query service and the protobuf Msg service). A `Configurator` struct is used to hold the different services. +* (AppModule) [\#7518](https://github.com/cosmos/cosmos-sdk/pull/7518) [\#7584](https://github.com/cosmos/cosmos-sdk/pull/7584) Rename `AppModule.RegisterQueryServices` to `AppModule.RegisterServices`, as this method now registers multiple services (the gRPC query service and the protobuf Msg service). A `Configurator` struct is used to hold the different services. ### Features diff --git a/simapp/app.go b/simapp/app.go index aa1375ea7a..5c3412f360 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -360,7 +360,7 @@ func NewSimApp( app.mm.RegisterInvariants(&app.CrisisKeeper) app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) - app.mm.RegisterServices(module.NewConfigurator(app.GRPCQueryRouter())) + app.mm.RegisterServices(module.NewConfigurator(app.MsgServiceRouter(), app.GRPCQueryRouter())) // add test gRPC service for testing gRPC queries in isolation testdata.RegisterQueryServer(app.GRPCQueryRouter(), testdata.QueryImpl{}) diff --git a/tests/mocks/account_retriever.go b/tests/mocks/account_retriever.go index f571fcbd15..23b02b7dce 100644 --- a/tests/mocks/account_retriever.go +++ b/tests/mocks/account_retriever.go @@ -8,9 +8,89 @@ import ( client "github.com/cosmos/cosmos-sdk/client" types "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" + crypto "github.com/tendermint/tendermint/crypto" reflect "reflect" ) +// MockAccount is a mock of Account interface +type MockAccount struct { + ctrl *gomock.Controller + recorder *MockAccountMockRecorder +} + +// MockAccountMockRecorder is the mock recorder for MockAccount +type MockAccountMockRecorder struct { + mock *MockAccount +} + +// NewMockAccount creates a new mock instance +func NewMockAccount(ctrl *gomock.Controller) *MockAccount { + mock := &MockAccount{ctrl: ctrl} + mock.recorder = &MockAccountMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockAccount) EXPECT() *MockAccountMockRecorder { + return m.recorder +} + +// GetAddress mocks base method +func (m *MockAccount) GetAddress() types.AccAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAddress") + ret0, _ := ret[0].(types.AccAddress) + return ret0 +} + +// GetAddress indicates an expected call of GetAddress +func (mr *MockAccountMockRecorder) GetAddress() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAddress", reflect.TypeOf((*MockAccount)(nil).GetAddress)) +} + +// GetPubKey mocks base method +func (m *MockAccount) GetPubKey() crypto.PubKey { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPubKey") + ret0, _ := ret[0].(crypto.PubKey) + return ret0 +} + +// GetPubKey indicates an expected call of GetPubKey +func (mr *MockAccountMockRecorder) GetPubKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPubKey", reflect.TypeOf((*MockAccount)(nil).GetPubKey)) +} + +// GetAccountNumber mocks base method +func (m *MockAccount) GetAccountNumber() uint64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccountNumber") + ret0, _ := ret[0].(uint64) + return ret0 +} + +// GetAccountNumber indicates an expected call of GetAccountNumber +func (mr *MockAccountMockRecorder) GetAccountNumber() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccountNumber", reflect.TypeOf((*MockAccount)(nil).GetAccountNumber)) +} + +// GetSequence mocks base method +func (m *MockAccount) GetSequence() uint64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSequence") + ret0, _ := ret[0].(uint64) + return ret0 +} + +// GetSequence indicates an expected call of GetSequence +func (mr *MockAccountMockRecorder) GetSequence() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSequence", reflect.TypeOf((*MockAccount)(nil).GetSequence)) +} + // MockAccountRetriever is a mock of AccountRetriever interface type MockAccountRetriever struct { ctrl *gomock.Controller @@ -34,6 +114,37 @@ func (m *MockAccountRetriever) EXPECT() *MockAccountRetrieverMockRecorder { return m.recorder } +// GetAccount mocks base method +func (m *MockAccountRetriever) GetAccount(clientCtx client.Context, addr types.AccAddress) (client.Account, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccount", clientCtx, addr) + ret0, _ := ret[0].(client.Account) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAccount indicates an expected call of GetAccount +func (mr *MockAccountRetrieverMockRecorder) GetAccount(clientCtx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountRetriever)(nil).GetAccount), clientCtx, addr) +} + +// GetAccountWithHeight mocks base method +func (m *MockAccountRetriever) GetAccountWithHeight(clientCtx client.Context, addr types.AccAddress) (client.Account, int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccountWithHeight", clientCtx, addr) + ret0, _ := ret[0].(client.Account) + ret1, _ := ret[1].(int64) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// GetAccountWithHeight indicates an expected call of GetAccountWithHeight +func (mr *MockAccountRetrieverMockRecorder) GetAccountWithHeight(clientCtx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccountWithHeight", reflect.TypeOf((*MockAccountRetriever)(nil).GetAccountWithHeight), clientCtx, addr) +} + // EnsureExists mocks base method func (m *MockAccountRetriever) EnsureExists(clientCtx client.Context, addr types.AccAddress) error { m.ctrl.T.Helper() diff --git a/types/module/configurator.go b/types/module/configurator.go index efa83607de..d561dd9eef 100644 --- a/types/module/configurator.go +++ b/types/module/configurator.go @@ -7,20 +7,33 @@ import "github.com/gogo/protobuf/grpc" // support module object capabilities isolation as described in // https://github.com/cosmos/cosmos-sdk/issues/7093 type Configurator interface { + // MsgServer returns a grpc.Server instance which allows registering services + // that will handle TxBody.messages in transactions. These Msg's WILL NOT + // be exposed as gRPC services. + MsgServer() grpc.Server + + // QueryServer returns a grpc.Server instance which allows registering services + // that will be exposed as gRPC services as well as ABCI query handlers. QueryServer() grpc.Server } type configurator struct { + msgServer grpc.Server queryServer grpc.Server } // NewConfigurator returns a new Configurator instance -func NewConfigurator(queryServer grpc.Server) Configurator { - return configurator{queryServer: queryServer} +func NewConfigurator(msgServer grpc.Server, queryServer grpc.Server) Configurator { + return configurator{msgServer: msgServer, queryServer: queryServer} } var _ Configurator = configurator{} +// MsgServer implements the Configurator.MsgServer method +func (c configurator) MsgServer() grpc.Server { + return c.msgServer +} + // QueryServer implements the Configurator.QueryServer method func (c configurator) QueryServer() grpc.Server { return c.queryServer diff --git a/types/module/module_test.go b/types/module/module_test.go index 67eac16955..cc331cf58f 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -181,8 +181,9 @@ func TestManager_RegisterQueryServices(t *testing.T) { require.NotNil(t, mm) require.Equal(t, 2, len(mm.Modules)) + msgRouter := mocks.NewMockServer(mockCtrl) queryRouter := mocks.NewMockServer(mockCtrl) - cfg := module.NewConfigurator(queryRouter) + cfg := module.NewConfigurator(msgRouter, queryRouter) mockAppModule1.EXPECT().RegisterServices(cfg).Times(1) mockAppModule2.EXPECT().RegisterServices(cfg).Times(1) diff --git a/x/auth/vesting/module.go b/x/auth/vesting/module.go index b4997d60e4..7afab8d34b 100644 --- a/x/auth/vesting/module.go +++ b/x/auth/vesting/module.go @@ -100,8 +100,10 @@ func (am AppModule) Route() sdk.Route { // functionality. func (AppModule) QuerierRoute() string { return "" } -// RegisterQueryService performs a no-op. -func (am AppModule) RegisterServices(_ module.Configurator) {} +// RegisterServices registers module services. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), NewMsgServerImpl(am.accountKeeper, am.bankKeeper)) +} // LegacyQuerierHandler performs a no-op. func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { diff --git a/x/bank/client/cli/cli_test.go b/x/bank/client/cli/cli_test.go index 67f967b44a..c68be4ccd3 100644 --- a/x/bank/client/cli/cli_test.go +++ b/x/bank/client/cli/cli_test.go @@ -5,6 +5,13 @@ import ( "fmt" "testing" + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client/tx" + + "github.com/gogo/protobuf/grpc" + grpc2 "google.golang.org/grpc" + "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/suite" tmcli "github.com/tendermint/tendermint/libs/cli" @@ -295,6 +302,141 @@ func (s *IntegrationTestSuite) TestNewSendTxCmd() { } } +// serviceMsgClientConn is an instance of grpc.ClientConn that is used to test building +// transactions with MsgClient's. It is intended to be replaced by the work in +// https://github.com/cosmos/cosmos-sdk/issues/7541 when that is ready. +type serviceMsgClientConn struct { + msgs []sdk.Msg +} + +func (t *serviceMsgClientConn) Invoke(_ context.Context, method string, args, _ interface{}, _ ...grpc2.CallOption) error { + req, ok := args.(sdk.MsgRequest) + if !ok { + return fmt.Errorf("%T should implement %T", args, (*sdk.MsgRequest)(nil)) + } + + err := req.ValidateBasic() + if err != nil { + return err + } + + t.msgs = append(t.msgs, sdk.ServiceMsg{ + MethodName: method, + Request: req, + }) + + return nil +} + +func (t *serviceMsgClientConn) NewStream(context.Context, *grpc2.StreamDesc, string, ...grpc2.CallOption) (grpc2.ClientStream, error) { + return nil, fmt.Errorf("not supported") +} + +var _ grpc.ClientConn = &serviceMsgClientConn{} + +// newSendTxMsgServiceCmd is just for the purpose of testing ServiceMsg's in an end-to-end case. It is effectively +// NewSendTxCmd but using MsgClient. +func newSendTxMsgServiceCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "send [from_key_or_address] [to_address] [amount]", + Short: `Send funds from one account to another. Note, the'--from' flag is +ignored as it is implied from [from_key_or_address].`, + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + cmd.Flags().Set(flags.FlagFrom, args[0]) + + clientCtx := client.GetClientContextFromCmd(cmd) + clientCtx, err := client.ReadTxCommandFlags(clientCtx, cmd.Flags()) + if err != nil { + return err + } + + toAddr, err := sdk.AccAddressFromBech32(args[1]) + if err != nil { + return err + } + + coins, err := sdk.ParseCoins(args[2]) + if err != nil { + return err + } + + msg := types.NewMsgSend(clientCtx.GetFromAddress(), toAddr, coins) + svcMsgClientConn := &serviceMsgClientConn{} + bankMsgClient := types.NewMsgClient(svcMsgClientConn) + _, err = bankMsgClient.Send(context.Background(), msg) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), svcMsgClientConn.msgs...) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// TestBankMsgService does a basic test of whether or not service Msg's as defined +// in ADR 031 work in the most basic end-to-end case. +func (s *IntegrationTestSuite) TestBankMsgService() { + val := s.network.Validators[0] + + testCases := []struct { + name string + from, to sdk.AccAddress + amount sdk.Coins + args []string + expectErr bool + respType proto.Message + expectedCode uint32 + rawLogContains string + }{ + { + "valid transaction", + val.Address, + val.Address, + sdk.NewCoins( + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + ), + []string{ + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + false, + &sdk.TxResponse{}, + 0, + "/cosmos.bank.v1beta1.Msg/Send", // indicates we are using ServiceMsg and not a regular Msg + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + clientCtx := val.ClientCtx + + args := []string{tc.from.String(), tc.to.String(), tc.amount.String()} + args = append(args, tc.args...) + + bz, err := clitestutil.ExecTestCLICmd(clientCtx, newSendTxMsgServiceCmd(), args) + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + + s.Require().NoError(clientCtx.JSONMarshaler.UnmarshalJSON(bz.Bytes(), tc.respType), bz.String()) + txResp := tc.respType.(*sdk.TxResponse) + s.Require().Equal(tc.expectedCode, txResp.Code) + s.Require().Contains(txResp.RawLog, tc.rawLogContains) + } + }) + } +} + func TestIntegrationTestSuite(t *testing.T) { suite.Run(t, new(IntegrationTestSuite)) } diff --git a/x/bank/module.go b/x/bank/module.go index 1b3d68f460..9712636133 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -94,9 +94,9 @@ type AppModule struct { accountKeeper types.AccountKeeper } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/crisis/module.go b/x/crisis/module.go index fdc2ffb03d..4066cb2ef9 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -112,9 +112,10 @@ func (AppModule) QuerierRoute() string { return "" } // LegacyQuerierHandler returns no sdk.Querier. func (AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. -func (am AppModule) RegisterServices(module.Configurator) {} +// RegisterServices registers module services. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), am.keeper) +} // InitGenesis performs genesis initialization for the crisis module. It returns // no validator updates. diff --git a/x/distribution/module.go b/x/distribution/module.go index 9c53d56191..c32bcbc1ed 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -139,9 +139,9 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/evidence/module.go b/x/evidence/module.go index 1ac32c2148..7ff49aabd5 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -148,9 +148,9 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/gov/module.go b/x/gov/module.go index 31c0e5c05d..1183f6060e 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -155,9 +155,9 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/slashing/module.go b/x/slashing/module.go index f74c4a84df..3698bb6987 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -137,9 +137,9 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/staking/module.go b/x/staking/module.go index 6a344265b7..4fa17d4d45 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -133,9 +133,9 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) querier := keeper.Querier{Keeper: am.keeper} types.RegisterQueryServer(cfg.QueryServer(), querier) } From eba4c8a264aac27f63d491bc16826fc20996d845 Mon Sep 17 00:00:00 2001 From: Marie Gauthier Date: Mon, 19 Oct 2020 20:04:44 +0200 Subject: [PATCH 55/84] Handle nil *Any in UnpackAny and add panic handler for tx decoding (#7594) * Handle nil any in UnpackAny * Add test * Add flag back * Update runTx signature * Update Simulate signature * Update calls to Simulate * Add txEncoder in baseapp * Fix TestTxWithoutPublicKey * Wrap errors * Use amino in baseapp tests * Add txEncoder arg to Check & Deliver * Fix gas in test * Fix remaining base app tests * Rename to amionTxEncoder * Update codec/types/interface_registry.go Co-authored-by: Aaron Craelius * golangci-lint fix Co-authored-by: Amaury Martiny Co-authored-by: Aaron Craelius Co-authored-by: Cory Levinson Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- baseapp/abci.go | 21 ++------- baseapp/baseapp.go | 7 ++- baseapp/baseapp_test.go | 41 +++++++++------- baseapp/helpers.go | 33 ------------- baseapp/test_helpers.go | 46 ++++++++++++++++++ client/grpc/simulate/simulate.go | 6 +-- codec/types/interface_registry.go | 5 ++ simapp/test_helpers.go | 10 ++-- x/auth/client/cli/cli_test.go | 62 +++++++++++++++++++++++++ x/bank/bench_test.go | 8 ++-- x/bank/simulation/operations.go | 4 +- x/distribution/simulation/operations.go | 8 ++-- x/gov/simulation/operations.go | 6 +-- x/slashing/simulation/operations.go | 2 +- x/staking/simulation/operations.go | 10 ++-- 15 files changed, 173 insertions(+), 96 deletions(-) delete mode 100644 baseapp/helpers.go create mode 100644 baseapp/test_helpers.go diff --git a/baseapp/abci.go b/baseapp/abci.go index 07c6be72b2..5b16156b72 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -213,11 +213,6 @@ func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBloc func (app *BaseApp) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx { defer telemetry.MeasureSince(time.Now(), "abci", "check_tx") - tx, err := app.txDecoder(req.Tx) - if err != nil { - return sdkerrors.ResponseCheckTx(err, 0, 0, app.trace) - } - var mode runTxMode switch { @@ -231,7 +226,7 @@ func (app *BaseApp) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx { panic(fmt.Sprintf("unknown RequestCheckTx type: %s", req.Type)) } - gInfo, result, err := app.runTx(mode, req.Tx, tx) + gInfo, result, err := app.runTx(mode, req.Tx) if err != nil { return sdkerrors.ResponseCheckTx(err, gInfo.GasWanted, gInfo.GasUsed, app.trace) } @@ -253,11 +248,6 @@ func (app *BaseApp) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx { func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { defer telemetry.MeasureSince(time.Now(), "abci", "deliver_tx") - tx, err := app.txDecoder(req.Tx) - if err != nil { - return sdkerrors.ResponseDeliverTx(err, 0, 0, app.trace) - } - gInfo := sdk.GasInfo{} resultStr := "successful" @@ -268,7 +258,7 @@ func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx telemetry.SetGauge(float32(gInfo.GasWanted), "tx", "gas", "wanted") }() - gInfo, result, err := app.runTx(runTxModeDeliver, req.Tx, tx) + gInfo, result, err := app.runTx(runTxModeDeliver, req.Tx) if err != nil { resultStr = "failed" return sdkerrors.ResponseDeliverTx(err, gInfo.GasWanted, gInfo.GasUsed, app.trace) @@ -673,12 +663,7 @@ func handleQueryApp(app *BaseApp, path []string, req abci.RequestQuery) abci.Res case "simulate": txBytes := req.Data - tx, err := app.txDecoder(txBytes) - if err != nil { - return sdkerrors.QueryResult(sdkerrors.Wrap(err, "failed to decode tx")) - } - - gInfo, res, err := app.Simulate(txBytes, tx) + gInfo, res, err := app.Simulate(txBytes) if err != nil { return sdkerrors.QueryResult(sdkerrors.Wrap(err, "failed to simulate tx")) } diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index f215868654..ebd67408c9 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -557,7 +557,7 @@ func (app *BaseApp) cacheTxContext(ctx sdk.Context, txBytes []byte) (sdk.Context // Note, gas execution info is always returned. A reference to a Result is // returned if the tx does not run out of gas and if all the messages are valid // and execute successfully. An error is returned otherwise. -func (app *BaseApp) runTx(mode runTxMode, txBytes []byte, tx sdk.Tx) (gInfo sdk.GasInfo, result *sdk.Result, err error) { +func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, result *sdk.Result, err error) { // NOTE: GasWanted should be returned by the AnteHandler. GasUsed is // determined by the GasMeter. We need access to the context to get the gas // meter so we initialize upfront. @@ -603,6 +603,11 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte, tx sdk.Tx) (gInfo sdk. } }() + tx, err := app.txDecoder(txBytes) + if err != nil { + return sdk.GasInfo{}, nil, err + } + msgs := tx.GetMsgs() if err := validateBasicTxMsgs(msgs); err != nil { return sdk.GasInfo{}, nil, err diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index 32c1ce2395..b0eace4d32 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -29,6 +29,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" ) var ( @@ -97,6 +98,14 @@ func registerTestCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&msgNoRoute{}, "cosmos-sdk/baseapp/msgNoRoute", nil) } +// aminoTxEncoder creates a amino TxEncoder for testing purposes. +func aminoTxEncoder() sdk.TxEncoder { + cdc := codec.NewLegacyAmino() + registerTestCodec(cdc) + + return legacytx.StdTxConfig{Cdc: cdc}.TxEncoder() +} + // simple one store baseapp func setupBaseApp(t *testing.T, options ...func(*BaseApp)) *BaseApp { app := newBaseApp(t.Name(), options...) @@ -1118,13 +1127,13 @@ func TestSimulateTx(t *testing.T) { require.Nil(t, err) // simulate a message, check gas reported - gInfo, result, err := app.Simulate(txBytes, tx) + gInfo, result, err := app.Simulate(txBytes) require.NoError(t, err) require.NotNil(t, result) require.Equal(t, gasConsumed, gInfo.GasUsed) // simulate again, same result - gInfo, result, err = app.Simulate(txBytes, tx) + gInfo, result, err = app.Simulate(txBytes) require.NoError(t, err) require.NotNil(t, result) require.Equal(t, gasConsumed, gInfo.GasUsed) @@ -1171,7 +1180,7 @@ func TestRunInvalidTransaction(t *testing.T) { // transaction with no messages { emptyTx := &txTest{} - _, result, err := app.Deliver(emptyTx) + _, result, err := app.Deliver(aminoTxEncoder(), emptyTx) require.Error(t, err) require.Nil(t, result) @@ -1198,7 +1207,7 @@ func TestRunInvalidTransaction(t *testing.T) { for _, testCase := range testCases { tx := testCase.tx - _, result, err := app.Deliver(tx) + _, result, err := app.Deliver(aminoTxEncoder(), tx) if testCase.fail { require.Error(t, err) @@ -1215,7 +1224,7 @@ func TestRunInvalidTransaction(t *testing.T) { // transaction with no known route { unknownRouteTx := txTest{[]sdk.Msg{msgNoRoute{}}, 0, false} - _, result, err := app.Deliver(unknownRouteTx) + _, result, err := app.Deliver(aminoTxEncoder(), unknownRouteTx) require.Error(t, err) require.Nil(t, result) @@ -1224,7 +1233,7 @@ func TestRunInvalidTransaction(t *testing.T) { require.EqualValues(t, sdkerrors.ErrUnknownRequest.ABCICode(), code, err) unknownRouteTx = txTest{[]sdk.Msg{msgCounter{}, msgNoRoute{}}, 0, false} - _, result, err = app.Deliver(unknownRouteTx) + _, result, err = app.Deliver(aminoTxEncoder(), unknownRouteTx) require.Error(t, err) require.Nil(t, result) @@ -1274,7 +1283,7 @@ func TestTxGasLimits(t *testing.T) { } }() - count := tx.(*txTest).Counter + count := tx.(txTest).Counter newCtx.GasMeter().ConsumeGas(uint64(count), "counter-ante") return newCtx, nil @@ -1284,7 +1293,7 @@ func TestTxGasLimits(t *testing.T) { routerOpt := func(bapp *BaseApp) { r := sdk.NewRoute(routeMsgCounter, func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - count := msg.(msgCounter).Counter + count := msg.(*msgCounter).Counter ctx.GasMeter().ConsumeGas(uint64(count), "counter-handler") return &sdk.Result{}, nil }) @@ -1322,7 +1331,7 @@ func TestTxGasLimits(t *testing.T) { for i, tc := range testCases { tx := tc.tx - gInfo, result, err := app.Deliver(tx) + gInfo, result, err := app.Deliver(aminoTxEncoder(), tx) // check gas used and wanted require.Equal(t, tc.gasUsed, gInfo.GasUsed, fmt.Sprintf("tc #%d; gas: %v, result: %v, err: %s", i, gInfo, result, err)) @@ -1359,7 +1368,7 @@ func TestMaxBlockGasLimits(t *testing.T) { } }() - count := tx.(*txTest).Counter + count := tx.(txTest).Counter newCtx.GasMeter().ConsumeGas(uint64(count), "counter-ante") return @@ -1368,7 +1377,7 @@ func TestMaxBlockGasLimits(t *testing.T) { routerOpt := func(bapp *BaseApp) { r := sdk.NewRoute(routeMsgCounter, func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - count := msg.(msgCounter).Counter + count := msg.(*msgCounter).Counter ctx.GasMeter().ConsumeGas(uint64(count), "counter-handler") return &sdk.Result{}, nil }) @@ -1412,7 +1421,7 @@ func TestMaxBlockGasLimits(t *testing.T) { // execute the transaction multiple times for j := 0; j < tc.numDelivers; j++ { - _, result, err := app.Deliver(tx) + _, result, err := app.Deliver(aminoTxEncoder(), tx) ctx := app.getState(runTxModeDeliver).ctx @@ -1480,7 +1489,7 @@ func TestCustomRunTxPanicHandler(t *testing.T) { { tx := newTxCounter(0, 0) - require.PanicsWithValue(t, customPanicMsg, func() { app.Deliver(tx) }) + require.PanicsWithValue(t, customPanicMsg, func() { app.Deliver(aminoTxEncoder(), tx) }) } } @@ -1589,7 +1598,7 @@ func TestGasConsumptionBadTx(t *testing.T) { routerOpt := func(bapp *BaseApp) { r := sdk.NewRoute(routeMsgCounter, func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - count := msg.(msgCounter).Counter + count := msg.(*msgCounter).Counter ctx.GasMeter().ConsumeGas(uint64(count), "counter-handler") return &sdk.Result{}, nil }) @@ -1668,7 +1677,7 @@ func TestQuery(t *testing.T) { require.Equal(t, 0, len(res.Value)) // query is still empty after a CheckTx - _, resTx, err := app.Check(tx) + _, resTx, err := app.Check(aminoTxEncoder(), tx) require.NoError(t, err) require.NotNil(t, resTx) res = app.Query(query) @@ -1678,7 +1687,7 @@ func TestQuery(t *testing.T) { header := tmproto.Header{Height: app.LastBlockHeight() + 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) - _, resTx, err = app.Deliver(tx) + _, resTx, err = app.Deliver(aminoTxEncoder(), tx) require.NoError(t, err) require.NotNil(t, resTx) res = app.Query(query) diff --git a/baseapp/helpers.go b/baseapp/helpers.go deleted file mode 100644 index 2fb7cc041a..0000000000 --- a/baseapp/helpers.go +++ /dev/null @@ -1,33 +0,0 @@ -package baseapp - -import ( - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func (app *BaseApp) Check(tx sdk.Tx) (sdk.GasInfo, *sdk.Result, error) { - return app.runTx(runTxModeCheck, nil, tx) -} - -func (app *BaseApp) Simulate(txBytes []byte, tx sdk.Tx) (sdk.GasInfo, *sdk.Result, error) { - return app.runTx(runTxModeSimulate, txBytes, tx) -} - -func (app *BaseApp) Deliver(tx sdk.Tx) (sdk.GasInfo, *sdk.Result, error) { - return app.runTx(runTxModeDeliver, nil, tx) -} - -// Context with current {check, deliver}State of the app used by tests. -func (app *BaseApp) NewContext(isCheckTx bool, header tmproto.Header) sdk.Context { - if isCheckTx { - return sdk.NewContext(app.checkState.ms, header, true, app.logger). - WithMinGasPrices(app.minGasPrices) - } - - return sdk.NewContext(app.deliverState.ms, header, false, app.logger) -} - -func (app *BaseApp) NewUncachedContext(isCheckTx bool, header tmproto.Header) sdk.Context { - return sdk.NewContext(app.cms, header, isCheckTx, app.logger) -} diff --git a/baseapp/test_helpers.go b/baseapp/test_helpers.go new file mode 100644 index 0000000000..407ebd9a7c --- /dev/null +++ b/baseapp/test_helpers.go @@ -0,0 +1,46 @@ +package baseapp + +import ( + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +func (app *BaseApp) Check(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo, *sdk.Result, error) { + // runTx expects tx bytes as argument, so we encode the tx argument into + // bytes. Note that runTx will actually decode those bytes again. But since + // this helper is only used in tests/simulation, it's fine. + bz, err := txEncoder(tx) + if err != nil { + return sdk.GasInfo{}, nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "%s", err) + } + return app.runTx(runTxModeCheck, bz) +} + +func (app *BaseApp) Simulate(txBytes []byte) (sdk.GasInfo, *sdk.Result, error) { + return app.runTx(runTxModeSimulate, txBytes) +} + +func (app *BaseApp) Deliver(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo, *sdk.Result, error) { + // See comment for Check(). + bz, err := txEncoder(tx) + if err != nil { + return sdk.GasInfo{}, nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "%s", err) + } + return app.runTx(runTxModeDeliver, bz) +} + +// Context with current {check, deliver}State of the app used by tests. +func (app *BaseApp) NewContext(isCheckTx bool, header tmproto.Header) sdk.Context { + if isCheckTx { + return sdk.NewContext(app.checkState.ms, header, true, app.logger). + WithMinGasPrices(app.minGasPrices) + } + + return sdk.NewContext(app.deliverState.ms, header, false, app.logger) +} + +func (app *BaseApp) NewUncachedContext(isCheckTx bool, header tmproto.Header) sdk.Context { + return sdk.NewContext(app.cms, header, isCheckTx, app.logger) +} diff --git a/client/grpc/simulate/simulate.go b/client/grpc/simulate/simulate.go index eee54583cb..9eed3e30a1 100644 --- a/client/grpc/simulate/simulate.go +++ b/client/grpc/simulate/simulate.go @@ -8,11 +8,10 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" ) // BaseAppSimulateFn is the signature of the Baseapp#Simulate function. -type BaseAppSimulateFn func(txBytes []byte, txtypes sdk.Tx) (sdk.GasInfo, *sdk.Result, error) +type BaseAppSimulateFn func(txBytes []byte) (sdk.GasInfo, *sdk.Result, error) type simulateServer struct { simulate BaseAppSimulateFn @@ -39,13 +38,12 @@ func (s simulateServer) Simulate(ctx context.Context, req *SimulateRequest) (*Si if err != nil { return nil, err } - txBuilder := authtx.WrapTx(req.Tx) txBytes, err := req.Tx.Marshal() if err != nil { return nil, err } - gasInfo, result, err := s.simulate(txBytes, txBuilder.GetTx()) + gasInfo, result, err := s.simulate(txBytes) if err != nil { return nil, err } diff --git a/codec/types/interface_registry.go b/codec/types/interface_registry.go index 966e935692..57650af61d 100644 --- a/codec/types/interface_registry.go +++ b/codec/types/interface_registry.go @@ -172,6 +172,11 @@ func (registry *interfaceRegistry) ListImplementations(ifaceName string) []strin } func (registry *interfaceRegistry) UnpackAny(any *Any, iface interface{}) error { + // here we gracefully handle the case in which `any` itself is `nil`, which may occur in message decoding + if any == nil { + return nil + } + if any.TypeUrl == "" { // if TypeUrl is empty return nil because without it we can't actually unpack anything return nil diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index 6c9d146204..e795394000 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -320,12 +320,12 @@ func CheckBalance(t *testing.T, app *SimApp, addr sdk.AccAddress, balances sdk.C // the parameter 'expPass' against the result. A corresponding result is // returned. func SignCheckDeliver( - t *testing.T, txGen client.TxConfig, app *bam.BaseApp, header tmproto.Header, msgs []sdk.Msg, + t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header tmproto.Header, msgs []sdk.Msg, chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...crypto.PrivKey, ) (sdk.GasInfo, *sdk.Result, error) { tx, err := helpers.GenTx( - txGen, + txCfg, msgs, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)}, helpers.DefaultGenTxGas, @@ -335,11 +335,11 @@ func SignCheckDeliver( priv..., ) require.NoError(t, err) - txBytes, err := txGen.TxEncoder()(tx) + txBytes, err := txCfg.TxEncoder()(tx) require.Nil(t, err) // Must simulate now as CheckTx doesn't run Msgs anymore - _, res, err := app.Simulate(txBytes, tx) + _, res, err := app.Simulate(txBytes) if expSimPass { require.NoError(t, err) @@ -351,7 +351,7 @@ func SignCheckDeliver( // Simulate a sending a transaction and committing a block app.BeginBlock(abci.RequestBeginBlock{Header: header}) - gInfo, res, err := app.Deliver(tx) + gInfo, res, err := app.Deliver(txCfg.TxEncoder(), tx) if expPass { require.NoError(t, err) diff --git a/x/auth/client/cli/cli_test.go b/x/auth/client/cli/cli_test.go index 996b458ffc..72e53a97a4 100644 --- a/x/auth/client/cli/cli_test.go +++ b/x/auth/client/cli/cli_test.go @@ -28,6 +28,8 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/network" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx" + "github.com/cosmos/cosmos-sdk/types/tx/signing" authcli "github.com/cosmos/cosmos-sdk/x/auth/client/cli" authtest "github.com/cosmos/cosmos-sdk/x/auth/client/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -833,6 +835,66 @@ func (s *IntegrationTestSuite) TestQueryParamsCmd() { } } +// TestTxWithoutPublicKey makes sure sending a proto tx message without the +// public key doesn't cause any error in the RPC layer (broadcast). +// See https://github.com/cosmos/cosmos-sdk/issues/7585 for more details. +func (s *IntegrationTestSuite) TestTxWithoutPublicKey() { + val1 := s.network.Validators[0] + txCfg := val1.ClientCtx.TxConfig + + // Create a txBuilder with an unsigned tx. + txBuilder := txCfg.NewTxBuilder() + msg := banktypes.NewMsgSend(val1.Address, val1.Address, sdk.NewCoins( + sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + )) + err := txBuilder.SetMsgs(msg) + s.Require().NoError(err) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(150)))) + txBuilder.SetGasLimit(testdata.NewTestGasLimit()) + // Set empty signature to set signer infos. + sigV2 := signing.SignatureV2{ + PubKey: val1.PubKey, + Data: &signing.SingleSignatureData{ + SignMode: txCfg.SignModeHandler().DefaultMode(), + Signature: nil, + }, + } + err = txBuilder.SetSignatures(sigV2) + s.Require().NoError(err) + + // Create a file with the unsigned tx. + txJSON, err := txCfg.TxJSONEncoder()(txBuilder.GetTx()) + s.Require().NoError(err) + unsignedTxFile, cleanup := testutil.WriteToNewTempFile(s.T(), string(txJSON)) + defer cleanup() + + // Sign the file with the unsignedTx. + signedTx, err := authtest.TxSignExec(val1.ClientCtx, val1.Address, unsignedTxFile.Name()) + s.Require().NoError(err) + + // Remove the signerInfo's `public_key` field manually from the signedTx. + // Note: this method is only used for test purposes! In general, one should + // use txBuilder and TxEncoder/TxDecoder to manipulate txs. + var tx tx.Tx + err = val1.ClientCtx.JSONMarshaler.UnmarshalJSON(signedTx.Bytes(), &tx) + s.Require().NoError(err) + tx.AuthInfo.SignerInfos[0].PublicKey = nil + // Re-encode the tx again, to another file. + txJSON, err = val1.ClientCtx.JSONMarshaler.MarshalJSON(&tx) + s.Require().NoError(err) + signedTxFile, cleanup2 := testutil.WriteToNewTempFile(s.T(), string(txJSON)) + s.Require().True(strings.Contains(string(txJSON), "\"public_key\":null")) + defer cleanup2() + + // Broadcast tx, test that it shouldn't panic. + val1.ClientCtx.BroadcastMode = flags.BroadcastSync + out, err := authtest.TxBroadcastExec(val1.ClientCtx, signedTxFile.Name()) + var res sdk.TxResponse + s.Require().NoError(val1.ClientCtx.JSONMarshaler.UnmarshalJSON(out.Bytes(), &res)) + s.Require().NotEqual(0, res.Code) + s.Require().NoError(err) +} + func TestIntegrationTestSuite(t *testing.T) { suite.Run(t, new(IntegrationTestSuite)) } diff --git a/x/bank/bench_test.go b/x/bank/bench_test.go index a5cc84bd15..58761365b7 100644 --- a/x/bank/bench_test.go +++ b/x/bank/bench_test.go @@ -46,12 +46,12 @@ func BenchmarkOneBankSendTxPerBlock(b *testing.B) { // Committing, and what time comes from Check/Deliver Tx. for i := 0; i < b.N; i++ { benchmarkApp.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: height}}) - _, _, err := benchmarkApp.Check(txs[i]) + _, _, err := benchmarkApp.Check(txGen.TxEncoder(), txs[i]) if err != nil { panic("something is broken in checking transaction") } - _, _, err = benchmarkApp.Deliver(txs[i]) + _, _, err = benchmarkApp.Deliver(txGen.TxEncoder(), txs[i]) require.NoError(b, err) benchmarkApp.EndBlock(abci.RequestEndBlock{Height: height}) benchmarkApp.Commit() @@ -88,12 +88,12 @@ func BenchmarkOneBankMultiSendTxPerBlock(b *testing.B) { // Committing, and what time comes from Check/Deliver Tx. for i := 0; i < b.N; i++ { benchmarkApp.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: height}}) - _, _, err := benchmarkApp.Check(txs[i]) + _, _, err := benchmarkApp.Check(txGen.TxEncoder(), txs[i]) if err != nil { panic("something is broken in checking transaction") } - _, _, err = benchmarkApp.Deliver(txs[i]) + _, _, err = benchmarkApp.Deliver(txGen.TxEncoder(), txs[i]) require.NoError(b, err) benchmarkApp.EndBlock(abci.RequestEndBlock{Height: height}) benchmarkApp.Commit() diff --git a/x/bank/simulation/operations.go b/x/bank/simulation/operations.go index 286dcc3fdb..0f7d119498 100644 --- a/x/bank/simulation/operations.go +++ b/x/bank/simulation/operations.go @@ -123,7 +123,7 @@ func sendMsgSend( return err } - _, _, err = app.Deliver(tx) + _, _, err = app.Deliver(txGen.TxEncoder(), tx) if err != nil { return err } @@ -280,7 +280,7 @@ func sendMsgMultiSend( return err } - _, _, err = app.Deliver(tx) + _, _, err = app.Deliver(txGen.TxEncoder(), tx) if err != nil { return err } diff --git a/x/distribution/simulation/operations.go b/x/distribution/simulation/operations.go index 812982e1ea..ff0d0d4ef5 100644 --- a/x/distribution/simulation/operations.go +++ b/x/distribution/simulation/operations.go @@ -115,7 +115,7 @@ func SimulateMsgSetWithdrawAddress(ak types.AccountKeeper, bk types.BankKeeper, return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } - _, _, err = app.Deliver(tx) + _, _, err = app.Deliver(txGen.TxEncoder(), tx) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } @@ -167,7 +167,7 @@ func SimulateMsgWithdrawDelegatorReward(ak types.AccountKeeper, bk types.BankKee return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } - _, _, err = app.Deliver(tx) + _, _, err = app.Deliver(txGen.TxEncoder(), tx) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } @@ -222,7 +222,7 @@ func SimulateMsgWithdrawValidatorCommission(ak types.AccountKeeper, bk types.Ban return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } - _, _, err = app.Deliver(tx) + _, _, err = app.Deliver(txGen.TxEncoder(), tx) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } @@ -277,7 +277,7 @@ func SimulateMsgFundCommunityPool(ak types.AccountKeeper, bk types.BankKeeper, k return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } - _, _, err = app.Deliver(tx) + _, _, err = app.Deliver(txGen.TxEncoder(), tx) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 13c8bbab4a..0dedf64888 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -157,7 +157,7 @@ func SimulateMsgSubmitProposal( return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } - _, _, err = app.Deliver(tx) + _, _, err = app.Deliver(txGen.TxEncoder(), tx) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } @@ -243,7 +243,7 @@ func SimulateMsgDeposit(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Ke if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } - _, _, err = app.Deliver(tx) + _, _, err = app.Deliver(txGen.TxEncoder(), tx) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } @@ -306,7 +306,7 @@ func operationSimulateMsgVote(ak types.AccountKeeper, bk types.BankKeeper, k kee return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } - _, _, err = app.Deliver(tx) + _, _, err = app.Deliver(txGen.TxEncoder(), tx) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } diff --git a/x/slashing/simulation/operations.go b/x/slashing/simulation/operations.go index 447cb86aad..e30dd900ed 100644 --- a/x/slashing/simulation/operations.go +++ b/x/slashing/simulation/operations.go @@ -101,7 +101,7 @@ func SimulateMsgUnjail(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Kee return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } - _, res, err := app.Deliver(tx) + _, res, err := app.Deliver(txGen.TxEncoder(), tx) // result should fail if: // - validator cannot be unjailed due to tombstone diff --git a/x/staking/simulation/operations.go b/x/staking/simulation/operations.go index 131c4251fd..a153b26307 100644 --- a/x/staking/simulation/operations.go +++ b/x/staking/simulation/operations.go @@ -168,7 +168,7 @@ func SimulateMsgCreateValidator(ak types.AccountKeeper, bk types.BankKeeper, k k return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } - _, _, err = app.Deliver(tx) + _, _, err = app.Deliver(txGen.TxEncoder(), tx) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } @@ -239,7 +239,7 @@ func SimulateMsgEditValidator(ak types.AccountKeeper, bk types.BankKeeper, k kee return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } - _, _, err = app.Deliver(tx) + _, _, err = app.Deliver(txGen.TxEncoder(), tx) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } @@ -312,7 +312,7 @@ func SimulateMsgDelegate(ak types.AccountKeeper, bk types.BankKeeper, k keeper.K return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } - _, _, err = app.Deliver(tx) + _, _, err = app.Deliver(txGen.TxEncoder(), tx) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } @@ -402,7 +402,7 @@ func SimulateMsgUndelegate(ak types.AccountKeeper, bk types.BankKeeper, k keeper return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } - _, _, err = app.Deliver(tx) + _, _, err = app.Deliver(txGen.TxEncoder(), tx) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } @@ -515,7 +515,7 @@ func SimulateMsgBeginRedelegate(ak types.AccountKeeper, bk types.BankKeeper, k k return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } - _, _, err = app.Deliver(tx) + _, _, err = app.Deliver(txGen.TxEncoder(), tx) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } From 155a6ad7fd41671cc849b55a0d5dd00d8ec09048 Mon Sep 17 00:00:00 2001 From: atheeshp <59333759+atheeshp@users.noreply.github.com> Date: Mon, 19 Oct 2020 23:51:53 +0530 Subject: [PATCH 56/84] Refactor x/ibc to ADR 031 (#7576) * WIP: Refactor x/ibc to ADR 031 * updated handler * removed unsued * fix * Add proto service for ibc/transfer * lint * remove old upgrade handler * added doc * review changes * fix tests * formatter * Add MsgServer wiring in RegisterServices Co-authored-by: Aaron Craelius Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .../applications/transfer/v1/transfer.proto | 9 + proto/ibc/core/channel/v1/channel.proto | 67 +- proto/ibc/core/client/v1/client.proto | 143 +- proto/ibc/core/connection/v1/connection.proto | 27 + x/ibc/applications/transfer/handler.go | 38 +- .../transfer/keeper/msg_server.go | 43 + x/ibc/applications/transfer/module.go | 4 +- .../transfer/types/transfer.pb.go | 296 +- x/ibc/core/02-client/handler.go | 132 - x/ibc/core/02-client/handler_test.go | 220 -- x/ibc/core/02-client/proposal_handler.go | 22 + x/ibc/core/02-client/proposal_handler_test.go | 75 + x/ibc/core/02-client/types/client.pb.go | 3320 ++++++++++------- x/ibc/core/03-connection/handler.go | 135 - .../core/03-connection/types/connection.pb.go | 860 ++++- x/ibc/core/04-channel/types/channel.pb.go | 1892 +++++++++- x/ibc/core/genesis_test.go | 38 + x/ibc/core/handler.go | 340 +- x/ibc/core/keeper/msg_server.go | 622 +++ .../msg_server_test.go} | 201 +- x/ibc/core/module.go | 5 +- 21 files changed, 6018 insertions(+), 2471 deletions(-) create mode 100644 x/ibc/applications/transfer/keeper/msg_server.go delete mode 100644 x/ibc/core/02-client/handler.go delete mode 100644 x/ibc/core/02-client/handler_test.go create mode 100644 x/ibc/core/02-client/proposal_handler.go create mode 100644 x/ibc/core/02-client/proposal_handler_test.go delete mode 100644 x/ibc/core/03-connection/handler.go create mode 100644 x/ibc/core/keeper/msg_server.go rename x/ibc/core/{handler_test.go => keeper/msg_server_test.go} (76%) diff --git a/proto/ibc/applications/transfer/v1/transfer.proto b/proto/ibc/applications/transfer/v1/transfer.proto index 28b7f96704..1ebc884542 100644 --- a/proto/ibc/applications/transfer/v1/transfer.proto +++ b/proto/ibc/applications/transfer/v1/transfer.proto @@ -7,6 +7,12 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "ibc/core/client/v1/client.proto"; +// Msg defines the ibc/transfer Msg service. +service Msg { + // Transfer defines a rpc handler method for MsgTransfer. + rpc Transfer(MsgTransfer) returns (MsgTransferResponse); +} + // MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between // ICS20 enabled chains. See ICS Spec here: // https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures @@ -33,6 +39,9 @@ message MsgTransfer { uint64 timeout_timestamp = 7 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; } +// MsgTransferResponse defines the Msg/Transfer response type. +message MsgTransferResponse { } + // FungibleTokenPacketData defines a struct for the packet payload // See FungibleTokenPacketData spec: // https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures diff --git a/proto/ibc/core/channel/v1/channel.proto b/proto/ibc/core/channel/v1/channel.proto index 342f4d32e7..41414e8c23 100644 --- a/proto/ibc/core/channel/v1/channel.proto +++ b/proto/ibc/core/channel/v1/channel.proto @@ -6,6 +6,39 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; +// Msg defines the ibc/channel Msg service. +service Msg { + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + rpc ChannelOpenInit(MsgChannelOpenInit) returns (MsgChannelOpenInitResponse); + + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + rpc ChannelOpenTry(MsgChannelOpenTry) returns (MsgChannelOpenTryResponse); + + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + rpc ChannelOpenAck(MsgChannelOpenAck) returns (MsgChannelOpenAckResponse); + + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + rpc ChannelOpenConfirm(MsgChannelOpenConfirm) returns (MsgChannelOpenConfirmResponse); + + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + rpc ChannelCloseInit(MsgChannelCloseInit) returns (MsgChannelCloseInitResponse); + + // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. + rpc ChannelCloseConfirm(MsgChannelCloseConfirm) returns (MsgChannelCloseConfirmResponse); + + // RecvPacket defines a rpc handler method for MsgRecvPacket. + rpc RecvPacket(MsgRecvPacket) returns (MsgRecvPacketResponse); + + // Timeout defines a rpc handler method for MsgTimeout. + rpc Timeout(MsgTimeout) returns (MsgTimeoutResponse); + + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + rpc TimeoutOnClose(MsgTimeoutOnClose) returns (MsgTimeoutOnCloseResponse); + + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); +} + // MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It // is called by a relayer on Chain A. message MsgChannelOpenInit { @@ -18,7 +51,10 @@ message MsgChannelOpenInit { string signer = 4; } -// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +message MsgChannelOpenInitResponse {} + +// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel // on Chain B. message MsgChannelOpenTry { option (gogoproto.equal) = false; @@ -35,6 +71,9 @@ message MsgChannelOpenTry { string signer = 8; } +// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +message MsgChannelOpenTryResponse {} + // MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge // the change of channel state to TRYOPEN on Chain B. message MsgChannelOpenAck { @@ -51,6 +90,9 @@ message MsgChannelOpenAck { string signer = 7; } +// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. +message MsgChannelOpenAckResponse {} + // MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of channel state to OPEN on Chain A. message MsgChannelOpenConfirm { @@ -65,6 +107,9 @@ message MsgChannelOpenConfirm { string signer = 5; } +// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response type. +message MsgChannelOpenConfirmResponse {} + // MsgChannelCloseInit defines a msg sent by a Relayer to Chain A // to close a channel with Chain B. message MsgChannelCloseInit { @@ -76,6 +121,9 @@ message MsgChannelCloseInit { string signer = 3; } +// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +message MsgChannelCloseInitResponse {} + // MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B // to acknowledge the change of channel state to CLOSED on Chain A. message MsgChannelCloseConfirm { @@ -90,6 +138,9 @@ message MsgChannelCloseConfirm { string signer = 5; } +// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response type. +message MsgChannelCloseConfirmResponse {} + // MsgRecvPacket receives incoming IBC packet message MsgRecvPacket { option (gogoproto.equal) = false; @@ -102,6 +153,9 @@ message MsgRecvPacket { string signer = 4; } +// MsgRecvPacketResponse defines the Msg/RecvPacket response type. +message MsgRecvPacketResponse {} + // MsgTimeout receives timed-out packet message MsgTimeout { option (gogoproto.equal) = false; @@ -115,6 +169,9 @@ message MsgTimeout { string signer = 5; } +// MsgTimeoutResponse defines the Msg/Timeout response type. +message MsgTimeoutResponse {} + // MsgTimeoutOnClose timed-out packet upon counterparty channel closure. message MsgTimeoutOnClose { option (gogoproto.equal) = false; @@ -129,6 +186,9 @@ message MsgTimeoutOnClose { string signer = 6; } +// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. +message MsgTimeoutOnCloseResponse {} + // MsgAcknowledgement receives incoming IBC acknowledgement message MsgAcknowledgement { option (gogoproto.equal) = false; @@ -142,6 +202,9 @@ message MsgAcknowledgement { string signer = 5; } +// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +message MsgAcknowledgementResponse {} + // Channel defines pipeline for exactly-once packet delivery between specific // modules on separate blockchains, which has at least one end capable of // sending packets and one end capable of receiving packets. @@ -278,4 +341,4 @@ message Acknowledgement { bytes result = 21; string error = 22; } -} +} \ No newline at end of file diff --git a/proto/ibc/core/client/v1/client.proto b/proto/ibc/core/client/v1/client.proto index 4a6f8320e8..118318c246 100644 --- a/proto/ibc/core/client/v1/client.proto +++ b/proto/ibc/core/client/v1/client.proto @@ -6,6 +6,91 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; +// Msg defines the ibc/client Msg service. +service Msg { + // CreateClient defines a rpc handler method for MsgCreateClient. + rpc CreateClient(MsgCreateClient) returns (MsgCreateClientResponse); + + // UpdateClient defines a rpc handler method for MsgUpdateClient. + rpc UpdateClient(MsgUpdateClient) returns (MsgUpdateClientResponse); + + // UpgradeClient defines a rpc handler method for MsgUpgradeClient. + rpc UpgradeClient(MsgUpgradeClient) returns (MsgUpgradeClientResponse); + + // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. + rpc SubmitMisbehaviour(MsgSubmitMisbehaviour) returns (MsgSubmitMisbehaviourResponse); +} + +// MsgCreateClient defines a message to create an IBC client +message MsgCreateClient { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // client unique identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // light client state + google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; + // consensus state associated with the client that corresponds to a given + // height. + google.protobuf.Any consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; + // signer address + string signer = 4; +} + +// MsgCreateClientResponse defines the Msg/CreateClient response type. +message MsgCreateClientResponse { } + +// MsgUpdateClient defines an sdk.Msg to update a IBC client state using +// the given header. +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; + // signer address + string signer = 3; +} + +// MsgUpdateClientResponse defines the Msg/UpdateClient response type. +message MsgUpdateClientResponse { } + +// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state +message MsgUpgradeClient { + // client unique identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // upgraded client state + google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; + // height at which old chain halts and upgrades (i.e last block executed) + Height upgrade_height = 3 [(gogoproto.moretags) = "yaml:\"upgrade_height\""]; + // proof that old chain committed to new client + bytes proof_upgrade = 4 [(gogoproto.moretags) = "yaml:\"proof_upgrade\""]; + // signer address + string signer = 5; +} + +// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. +message MsgUpgradeClientResponse { } + +// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for +// light client misbehaviour. +message MsgSubmitMisbehaviour { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // client unique identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // misbehaviour used for freezing the light client + google.protobuf.Any misbehaviour = 2; + // signer address + string signer = 3; +} + +// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response type. +message MsgSubmitMisbehaviourResponse { } + // IdentifiedClientState defines a client state with an additional client // identifier field. message IdentifiedClientState { @@ -48,64 +133,6 @@ message ClientUpdateProposal { google.protobuf.Any header = 4; } -// MsgCreateClient defines a message to create an IBC client -message MsgCreateClient { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // light client state - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; - // consensus state associated with the client that corresponds to a given - // height. - google.protobuf.Any consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; - // signer address - string signer = 4; -} - -// MsgUpdateClient defines an sdk.Msg to update a IBC client state using -// the given header. -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; - // signer address - string signer = 3; -} - -// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state -message MsgUpgradeClient { - // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // upgraded client state - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; - // height at which old chain halts and upgrades (i.e last block executed) - Height upgrade_height = 3 [(gogoproto.moretags) = "yaml:\"upgrade_height\""]; - // proof that old chain committed to new client - bytes proof_upgrade = 4 [(gogoproto.moretags) = "yaml:\"proof_upgrade\""]; - // signer address - string signer = 5; -} - -// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for -// light client misbehaviour. -message MsgSubmitMisbehaviour { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // misbehaviour used for freezing the light client - google.protobuf.Any misbehaviour = 2; - // signer address - string signer = 3; -} - // Height is a monotonically increasing data type // that can be compared against another Height for the purposes of updating and // freezing clients diff --git a/proto/ibc/core/connection/v1/connection.proto b/proto/ibc/core/connection/v1/connection.proto index 368859d3b9..5b0dd2fe5d 100644 --- a/proto/ibc/core/connection/v1/connection.proto +++ b/proto/ibc/core/connection/v1/connection.proto @@ -8,6 +8,21 @@ import "google/protobuf/any.proto"; import "ibc/core/commitment/v1/commitment.proto"; import "ibc/core/client/v1/client.proto"; +// Msg defines the ibc/connection Msg service. +service Msg { + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + rpc ConnectionOpenInit(MsgConnectionOpenInit) returns (MsgConnectionOpenInitResponse); + + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + rpc ConnectionOpenTry(MsgConnectionOpenTry) returns (MsgConnectionOpenTryResponse); + + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + rpc ConnectionOpenAck(MsgConnectionOpenAck) returns (MsgConnectionOpenAckResponse); + + // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. + rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse); +} + // MsgConnectionOpenInit defines the msg sent by an account on Chain A to // initialize a connection with Chain B. message MsgConnectionOpenInit { @@ -21,6 +36,9 @@ message MsgConnectionOpenInit { string signer = 5; } +// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response type. +message MsgConnectionOpenInitResponse { } + // MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a // connection on Chain B. message MsgConnectionOpenTry { @@ -47,6 +65,9 @@ message MsgConnectionOpenTry { string signer = 12; } +// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +message MsgConnectionOpenTryResponse { } + // MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to // acknowledge the change of connection state to TRYOPEN on Chain B. message MsgConnectionOpenAck { @@ -71,6 +92,9 @@ message MsgConnectionOpenAck { string signer = 10; } +// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. +message MsgConnectionOpenAckResponse { } + // MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of connection state to OPEN on Chain A. message MsgConnectionOpenConfirm { @@ -85,6 +109,9 @@ message MsgConnectionOpenConfirm { string signer = 4; } +// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm response type. +message MsgConnectionOpenConfirmResponse { } + // ICS03 - Connection Data Structures as defined in // https://github.com/cosmos/ics/tree/master/spec/ics-003-connection-semantics#data-structures diff --git a/x/ibc/applications/transfer/handler.go b/x/ibc/applications/transfer/handler.go index 81d9d62d86..7c992c920e 100644 --- a/x/ibc/applications/transfer/handler.go +++ b/x/ibc/applications/transfer/handler.go @@ -3,51 +3,21 @@ package transfer import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/keeper" "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/types" ) // NewHandler returns sdk.Handler for IBC token transfer module messages -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k types.MsgServer) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { case *types.MsgTransfer: - return handleMsgTransfer(ctx, k, msg) + res, err := k.Transfer(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized ICS-20 transfer message type: %T", msg) } } } - -// See createOutgoingPacket in spec:https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#packet-relay -func handleMsgTransfer(ctx sdk.Context, k keeper.Keeper, msg *types.MsgTransfer) (*sdk.Result, error) { - sender, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return nil, err - } - if err := k.SendTransfer( - ctx, msg.SourcePort, msg.SourceChannel, msg.Token, sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp, - ); err != nil { - return nil, err - } - - k.Logger(ctx).Info("IBC fungible token transfer", "token", msg.Token.Denom, "amount", msg.Token.Amount.String(), "sender", msg.Sender, "receiver", msg.Receiver) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeTransfer, - sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), - sdk.NewAttribute(types.AttributeKeyReceiver, msg.Receiver), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} diff --git a/x/ibc/applications/transfer/keeper/msg_server.go b/x/ibc/applications/transfer/keeper/msg_server.go new file mode 100644 index 0000000000..dd2999af34 --- /dev/null +++ b/x/ibc/applications/transfer/keeper/msg_server.go @@ -0,0 +1,43 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/types" +) + +var _ types.MsgServer = Keeper{} + +// See createOutgoingPacket in spec:https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#packet-relay + +// Transfer defines a rpc handler method for MsgTransfer. +func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, err + } + if err := k.SendTransfer( + ctx, msg.SourcePort, msg.SourceChannel, msg.Token, sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp, + ); err != nil { + return nil, err + } + + k.Logger(ctx).Info("IBC fungible token transfer", "token", msg.Token.Denom, "amount", msg.Token.Amount.String(), "sender", msg.Sender, "receiver", msg.Receiver) + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeTransfer, + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + sdk.NewAttribute(types.AttributeKeyReceiver, msg.Receiver), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + ), + }) + + return &types.MsgTransferResponse{}, nil +} diff --git a/x/ibc/applications/transfer/module.go b/x/ibc/applications/transfer/module.go index 4d73f693cd..9947828809 100644 --- a/x/ibc/applications/transfer/module.go +++ b/x/ibc/applications/transfer/module.go @@ -120,9 +120,9 @@ func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), am.keeper) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/ibc/applications/transfer/types/transfer.pb.go b/x/ibc/applications/transfer/types/transfer.pb.go index 281b1fc9f6..db4e10f45c 100644 --- a/x/ibc/applications/transfer/types/transfer.pb.go +++ b/x/ibc/applications/transfer/types/transfer.pb.go @@ -4,11 +4,16 @@ package types import ( + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/types" + grpc1 "github.com/gogo/protobuf/grpc" types1 "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -80,6 +85,43 @@ func (m *MsgTransfer) XXX_DiscardUnknown() { var xxx_messageInfo_MsgTransfer proto.InternalMessageInfo +// MsgTransferResponse defines the Msg/Transfer response type. +type MsgTransferResponse struct { +} + +func (m *MsgTransferResponse) Reset() { *m = MsgTransferResponse{} } +func (m *MsgTransferResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTransferResponse) ProtoMessage() {} +func (*MsgTransferResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5041673e96e97901, []int{1} +} +func (m *MsgTransferResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgTransferResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferResponse.Merge(m, src) +} +func (m *MsgTransferResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferResponse proto.InternalMessageInfo + // FungibleTokenPacketData defines a struct for the packet payload // See FungibleTokenPacketData spec: // https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures @@ -98,7 +140,7 @@ func (m *FungibleTokenPacketData) Reset() { *m = FungibleTokenPacketData func (m *FungibleTokenPacketData) String() string { return proto.CompactTextString(m) } func (*FungibleTokenPacketData) ProtoMessage() {} func (*FungibleTokenPacketData) Descriptor() ([]byte, []int) { - return fileDescriptor_5041673e96e97901, []int{1} + return fileDescriptor_5041673e96e97901, []int{2} } func (m *FungibleTokenPacketData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -169,7 +211,7 @@ func (m *DenomTrace) Reset() { *m = DenomTrace{} } func (m *DenomTrace) String() string { return proto.CompactTextString(m) } func (*DenomTrace) ProtoMessage() {} func (*DenomTrace) Descriptor() ([]byte, []int) { - return fileDescriptor_5041673e96e97901, []int{2} + return fileDescriptor_5041673e96e97901, []int{3} } func (m *DenomTrace) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -229,7 +271,7 @@ func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_5041673e96e97901, []int{3} + return fileDescriptor_5041673e96e97901, []int{4} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -274,6 +316,7 @@ func (m *Params) GetReceiveEnabled() bool { func init() { proto.RegisterType((*MsgTransfer)(nil), "ibc.applications.transfer.v1.MsgTransfer") + proto.RegisterType((*MsgTransferResponse)(nil), "ibc.applications.transfer.v1.MsgTransferResponse") proto.RegisterType((*FungibleTokenPacketData)(nil), "ibc.applications.transfer.v1.FungibleTokenPacketData") proto.RegisterType((*DenomTrace)(nil), "ibc.applications.transfer.v1.DenomTrace") proto.RegisterType((*Params)(nil), "ibc.applications.transfer.v1.Params") @@ -284,45 +327,129 @@ func init() { } var fileDescriptor_5041673e96e97901 = []byte{ - // 601 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x8d, 0xdb, 0x34, 0x5f, 0x3b, 0xf9, 0x5a, 0x60, 0x28, 0xad, 0x1b, 0xb5, 0x76, 0xe5, 0x55, - 0x25, 0x84, 0xad, 0x80, 0x10, 0x52, 0x17, 0x80, 0xd2, 0x82, 0x60, 0x81, 0x54, 0x59, 0x59, 0x20, - 0x36, 0x61, 0x3c, 0x19, 0x9c, 0x51, 0xed, 0x19, 0x6b, 0x66, 0x12, 0x51, 0xf1, 0x02, 0xb0, 0xe3, - 0x11, 0xba, 0xe6, 0x49, 0xba, 0xec, 0x92, 0x95, 0x85, 0xda, 0x0d, 0xeb, 0x3c, 0x01, 0x9a, 0x9f, - 0x86, 0x04, 0xa9, 0x2b, 0xcf, 0xb9, 0xf7, 0x9c, 0x7b, 0xe6, 0xde, 0xeb, 0x01, 0x0f, 0x69, 0x86, - 0x13, 0x54, 0x55, 0x05, 0xc5, 0x48, 0x51, 0xce, 0x64, 0xa2, 0x04, 0x62, 0xf2, 0x13, 0x11, 0xc9, - 0xa4, 0x3b, 0x3b, 0xc7, 0x95, 0xe0, 0x8a, 0xc3, 0x5d, 0x9a, 0xe1, 0x78, 0x9e, 0x1c, 0xcf, 0x08, - 0x93, 0x6e, 0x67, 0x33, 0xe7, 0x39, 0x37, 0xc4, 0x44, 0x9f, 0xac, 0xa6, 0x13, 0x60, 0x2e, 0x4b, - 0x2e, 0x93, 0x0c, 0x49, 0x92, 0x4c, 0xba, 0x19, 0x51, 0xa8, 0x9b, 0x60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x5a, 0x87, 0x5b, 0x56, 0xfe, 0x0f, 0x21, 0x4a, 0x37, - 0x5c, 0xc4, 0x15, 0xe9, 0xbd, 0xbf, 0xb8, 0x0a, 0xbc, 0xcb, 0xab, 0xc0, 0xfb, 0x75, 0x15, 0x78, - 0xdf, 0xaf, 0x83, 0xc6, 0xe5, 0x75, 0xd0, 0xf8, 0x79, 0x1d, 0x34, 0x3e, 0x3c, 0xcf, 0xa9, 0x1a, - 0x8d, 0xb3, 0x18, 0xf3, 0x32, 0x71, 0x8f, 0xcb, 0x7e, 0x1e, 0xc9, 0xe1, 0x69, 0xf2, 0x39, 0xb9, - 0xfd, 0x45, 0xab, 0xb3, 0x8a, 0xc8, 0xac, 0x65, 0xde, 0xd5, 0x93, 0x3f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0xed, 0xa5, 0xb5, 0x3a, 0xfb, 0x03, 0x00, 0x00, + // 638 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0x8e, 0x9b, 0x34, 0xa4, 0x1b, 0x5a, 0x60, 0xfb, 0xe7, 0x46, 0xad, 0x5d, 0xf9, 0x54, 0x84, + 0x58, 0x2b, 0x45, 0x08, 0xa9, 0x07, 0x40, 0x69, 0x41, 0x70, 0xa8, 0x54, 0x59, 0x39, 0x20, 0x2e, + 0x61, 0xbd, 0x59, 0x1c, 0xab, 0xf1, 0xae, 0xe5, 0xdd, 0x44, 0x54, 0xbc, 0x00, 0xdc, 0x78, 0x84, + 0x9e, 0x79, 0x92, 0x1e, 0x7b, 0xe4, 0x14, 0xa1, 0xf6, 0xc2, 0x39, 0x4f, 0x80, 0xf6, 0xa7, 0xc1, + 0x41, 0x2a, 0xe2, 0xe4, 0xfd, 0x66, 0xbe, 0x6f, 0x66, 0x67, 0x66, 0xc7, 0xe0, 0x51, 0x1a, 0x93, + 0x10, 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 0x1c, 0xd8, 0x74, 0xfa, 0x0c, 0x77, 0x00, 0x50, 0x23, 0xec, 0x99, 0x8b, 0xe8, 0x57, 0x11, 0x2d, + 0x29, 0x8b, 0xd6, 0x05, 0x5f, 0x1d, 0x50, 0x3f, 0xc1, 0x05, 0xce, 0x04, 0x3c, 0x00, 0x77, 0x55, + 0xc6, 0x1e, 0x65, 0x38, 0x1e, 0xd2, 0xbe, 0x8e, 0xd2, 0xe8, 0x6c, 0x4e, 0x27, 0xfe, 0xaa, 0x7d, + 0x41, 0x25, 0x6f, 0x10, 0x35, 0x15, 0x7c, 0x65, 0x10, 0x3c, 0x04, 0xf7, 0xec, 0x9d, 0x66, 0xf2, + 0x05, 0x2d, 0x6f, 0x4d, 0x27, 0xfe, 0x86, 0x91, 0xff, 0x45, 0x08, 0xa2, 0x15, 0x6b, 0xb1, 0x41, + 0xf6, 0x39, 0xa8, 0x1e, 0x8b, 0x04, 0x0e, 0x40, 0x63, 0xb6, 0x10, 0x0f, 0xd1, 0xbf, 0xd6, 0x12, + 0x95, 0xe6, 0xd1, 0x6a, 0xff, 0x37, 0xf5, 0x66, 0x74, 0x9d, 0x77, 0x17, 0x57, 0x9e, 0x73, 0x79, + 0xe5, 0x39, 0x3f, 0xaf, 0x3c, 0xe7, 0xdb, 0xb5, 0x57, 0xb9, 0xbc, 0xf6, 0x2a, 0x3f, 0xae, 0xbd, + 0xca, 0xfb, 0xe7, 0x49, 0x2a, 0x07, 0xa3, 0x18, 0x11, 0x9e, 0x85, 0x76, 0xc9, 0xcd, 0xe7, 0xb1, + 0xe8, 0x9f, 0x86, 0x9f, 0xc2, 0xdb, 0xff, 0x2c, 0xf2, 0x2c, 0xa7, 0x22, 0xae, 0xeb, 0xfd, 0x7e, + 0xf2, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x34, 0x4e, 0x38, 0x40, 0x83, 0x04, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // Transfer defines a rpc handler method for MsgTransfer. + Transfer(ctx context.Context, in *MsgTransfer, opts ...grpc.CallOption) (*MsgTransferResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Transfer(ctx context.Context, in *MsgTransfer, opts ...grpc.CallOption) (*MsgTransferResponse, error) { + out := new(MsgTransferResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.transfer.v1.Msg/Transfer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Transfer defines a rpc handler method for MsgTransfer. + Transfer(context.Context, *MsgTransfer) (*MsgTransferResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) Transfer(ctx context.Context, req *MsgTransfer) (*MsgTransferResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Transfer not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_Transfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTransfer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Transfer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.transfer.v1.Msg/Transfer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Transfer(ctx, req.(*MsgTransfer)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.applications.transfer.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Transfer", + Handler: _Msg_Transfer_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/applications/transfer/v1/transfer.proto", } func (m *MsgTransfer) Marshal() (dAtA []byte, err error) { @@ -401,6 +528,29 @@ func (m *MsgTransfer) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgTransferResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgTransferResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *FungibleTokenPacketData) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -573,6 +723,15 @@ func (m *MsgTransfer) Size() (n int) { return n } +func (m *MsgTransferResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *FungibleTokenPacketData) Size() (n int) { if m == nil { return 0 @@ -901,6 +1060,59 @@ func (m *MsgTransfer) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgTransferResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransfer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTransferResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTransfer(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTransfer + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTransfer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *FungibleTokenPacketData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ibc/core/02-client/handler.go b/x/ibc/core/02-client/handler.go deleted file mode 100644 index 55cf0862f8..0000000000 --- a/x/ibc/core/02-client/handler.go +++ /dev/null @@ -1,132 +0,0 @@ -package client - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/keeper" - "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" -) - -// HandleMsgCreateClient defines the sdk.Handler for MsgCreateClient -func HandleMsgCreateClient(ctx sdk.Context, k keeper.Keeper, msg *types.MsgCreateClient) (*sdk.Result, error) { - clientState, err := types.UnpackClientState(msg.ClientState) - if err != nil { - return nil, err - } - - consensusState, err := types.UnpackConsensusState(msg.ConsensusState) - if err != nil { - return nil, err - } - - if err = k.CreateClient(ctx, msg.ClientId, clientState, consensusState); err != nil { - return nil, err - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeCreateClient, - sdk.NewAttribute(types.AttributeKeyClientID, msg.ClientId), - sdk.NewAttribute(types.AttributeKeyClientType, clientState.ClientType()), - sdk.NewAttribute(types.AttributeKeyConsensusHeight, clientState.GetLatestHeight().String()), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgUpdateClient defines the sdk.Handler for MsgUpdateClient -func HandleMsgUpdateClient(ctx sdk.Context, k keeper.Keeper, msg *types.MsgUpdateClient) (*sdk.Result, error) { - header, err := types.UnpackHeader(msg.Header) - if err != nil { - return nil, err - } - - if err = k.UpdateClient(ctx, msg.ClientId, header); err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - ) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgUpgradeClient defines the sdk.Handler for MsgUpgradeClient -func HandleMsgUpgradeClient(ctx sdk.Context, k keeper.Keeper, msg *types.MsgUpgradeClient) (*sdk.Result, error) { - upgradedClient, err := types.UnpackClientState(msg.ClientState) - if err != nil { - return nil, err - } - - if err := upgradedClient.Validate(); err != nil { - return nil, err - } - - if err = k.UpgradeClient(ctx, msg.ClientId, upgradedClient, msg.UpgradeHeight, msg.ProofUpgrade); err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - ) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgSubmitMisbehaviour defines the Evidence module handler for submitting a -// light client misbehaviour. -func HandleMsgSubmitMisbehaviour(ctx sdk.Context, k keeper.Keeper, msg *types.MsgSubmitMisbehaviour) (*sdk.Result, error) { - misbehaviour, err := types.UnpackMisbehaviour(msg.Misbehaviour) - if err != nil { - return nil, err - } - - if err := k.CheckMisbehaviourAndUpdateState(ctx, misbehaviour); err != nil { - return nil, sdkerrors.Wrap(err, "failed to process misbehaviour for IBC client") - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeSubmitMisbehaviour, - sdk.NewAttribute(types.AttributeKeyClientID, msg.ClientId), - sdk.NewAttribute(types.AttributeKeyClientType, misbehaviour.ClientType()), - sdk.NewAttribute(types.AttributeKeyConsensusHeight, misbehaviour.GetHeight().String()), - ), - ) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// NewClientUpdateProposalHandler defines the client update proposal handler -func NewClientUpdateProposalHandler(k keeper.Keeper) govtypes.Handler { - return func(ctx sdk.Context, content govtypes.Content) error { - switch c := content.(type) { - case *types.ClientUpdateProposal: - return k.ClientUpdateProposal(ctx, c) - - default: - return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized ibc proposal content type: %T", c) - } - } -} diff --git a/x/ibc/core/02-client/handler_test.go b/x/ibc/core/02-client/handler_test.go deleted file mode 100644 index 7aa7d5e7b8..0000000000 --- a/x/ibc/core/02-client/handler_test.go +++ /dev/null @@ -1,220 +0,0 @@ -package client_test - -import ( - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - client "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client" - "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types" - "github.com/cosmos/cosmos-sdk/x/ibc/core/exported" - ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" - ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func (suite *ClientTestSuite) TestNewClientUpdateProposalHandler() { - var ( - content govtypes.Content - err error - ) - - testCases := []struct { - name string - malleate func() - expPass bool - }{ - { - "valid update client proposal", func() { - clientA, _ := suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) - clientState := suite.chainA.GetClientState(clientA) - - tmClientState, ok := clientState.(*ibctmtypes.ClientState) - suite.Require().True(ok) - tmClientState.AllowUpdateAfterMisbehaviour = true - tmClientState.FrozenHeight = tmClientState.LatestHeight - suite.chainA.App.IBCKeeper.ClientKeeper.SetClientState(suite.chainA.GetContext(), clientA, tmClientState) - - // use next header for chainB to update the client on chainA - header, err := suite.chainA.ConstructUpdateTMClientHeader(suite.chainB, clientA) - suite.Require().NoError(err) - - content, err = clienttypes.NewClientUpdateProposal(ibctesting.Title, ibctesting.Description, clientA, header) - suite.Require().NoError(err) - }, true, - }, - { - "nil proposal", func() { - content = nil - }, false, - }, - { - "unsupported proposal type", func() { - content = distributiontypes.NewCommunityPoolSpendProposal(ibctesting.Title, ibctesting.Description, suite.chainA.SenderAccount.GetAddress(), sdk.NewCoins(sdk.NewCoin("communityfunds", sdk.NewInt(10)))) - }, false, - }, - } - - for _, tc := range testCases { - tc := tc - - suite.Run(tc.name, func() { - suite.SetupTest() // reset - - tc.malleate() - - proposalHandler := client.NewClientUpdateProposalHandler(suite.chainA.App.IBCKeeper.ClientKeeper) - - err = proposalHandler(suite.chainA.GetContext(), content) - - if tc.expPass { - suite.Require().NoError(err) - } else { - suite.Require().Error(err) - } - }) - } - -} - -func (suite *ClientTestSuite) TestUpgradeClient() { - var ( - clientA string - upgradedClient exported.ClientState - upgradeHeight exported.Height - msg *clienttypes.MsgUpgradeClient - ) - - newClientHeight := clienttypes.NewHeight(1, 1) - - cases := []struct { - name string - setup func() - expPass bool - }{ - { - name: "successful upgrade", - setup: func() { - - upgradedClient = ibctmtypes.NewClientState("newChainId", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) - - // upgrade Height is at next block - upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) - - // zero custom fields and store in upgrade store - suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) - - // commit upgrade store changes and update clients - - suite.coordinator.CommitBlock(suite.chainB) - err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) - suite.Require().NoError(err) - - cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) - suite.Require().True(found) - - proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) - - msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, proofUpgrade, suite.chainA.SenderAccount.GetAddress()) - suite.Require().NoError(err) - }, - expPass: true, - }, - { - name: "invalid upgrade: msg.ClientState does not contain valid clientstate", - setup: func() { - - cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) - suite.Require().True(found) - - // upgrade Height is at next block - upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) - - proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) - - consState := ibctmtypes.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("app_hash")), []byte("next_vals_hash")) - consAny, err := clienttypes.PackConsensusState(consState) - suite.Require().NoError(err) - - height, _ := upgradeHeight.(types.Height) - - msg = &types.MsgUpgradeClient{ClientId: clientA, ClientState: consAny, UpgradeHeight: &height, ProofUpgrade: proofUpgrade, Signer: suite.chainA.SenderAccount.GetAddress().String()} - }, - expPass: false, - }, - { - name: "invalid clientstate", - setup: func() { - - upgradedClient = ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) - - // upgrade Height is at next block - upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) - - // zero custom fields and store in upgrade store - suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) - - // commit upgrade store changes and update clients - - suite.coordinator.CommitBlock(suite.chainB) - err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) - suite.Require().NoError(err) - - cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) - suite.Require().True(found) - - proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) - - msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, proofUpgrade, suite.chainA.SenderAccount.GetAddress()) - suite.Require().NoError(err) - }, - expPass: false, - }, - { - name: "VerifyUpgrade fails", - setup: func() { - - upgradedClient = ibctmtypes.NewClientState("newChainId", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) - - // upgrade Height is at next block - upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) - - // zero custom fields and store in upgrade store - suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) - - // commit upgrade store changes and update clients - - suite.coordinator.CommitBlock(suite.chainB) - err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) - suite.Require().NoError(err) - - msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, nil, suite.chainA.SenderAccount.GetAddress()) - suite.Require().NoError(err) - }, - expPass: false, - }, - } - - for _, tc := range cases { - tc := tc - clientA, _ = suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) - - tc.setup() - - _, err := client.HandleMsgUpgradeClient( - suite.chainA.GetContext(), suite.chainA.App.IBCKeeper.ClientKeeper, msg, - ) - - if tc.expPass { - suite.Require().NoError(err, "upgrade handler failed on valid case: %s", tc.name) - newClient, ok := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) - suite.Require().True(ok) - suite.Require().Equal(upgradedClient, newClient) - } else { - suite.Require().Error(err, "upgrade handler passed on invalid case: %s", tc.name) - } - } -} diff --git a/x/ibc/core/02-client/proposal_handler.go b/x/ibc/core/02-client/proposal_handler.go new file mode 100644 index 0000000000..befa95df64 --- /dev/null +++ b/x/ibc/core/02-client/proposal_handler.go @@ -0,0 +1,22 @@ +package client + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/keeper" + "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" +) + +// NewClientUpdateProposalHandler defines the client update proposal handler +func NewClientUpdateProposalHandler(k keeper.Keeper) govtypes.Handler { + return func(ctx sdk.Context, content govtypes.Content) error { + switch c := content.(type) { + case *types.ClientUpdateProposal: + return k.ClientUpdateProposal(ctx, c) + + default: + return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized ibc proposal content type: %T", c) + } + } +} diff --git a/x/ibc/core/02-client/proposal_handler_test.go b/x/ibc/core/02-client/proposal_handler_test.go new file mode 100644 index 0000000000..839dd2e532 --- /dev/null +++ b/x/ibc/core/02-client/proposal_handler_test.go @@ -0,0 +1,75 @@ +package client_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + client "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client" + clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" + ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" + ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" +) + +func (suite *ClientTestSuite) TestNewClientUpdateProposalHandler() { + var ( + content govtypes.Content + err error + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "valid update client proposal", func() { + clientA, _ := suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) + clientState := suite.chainA.GetClientState(clientA) + + tmClientState, ok := clientState.(*ibctmtypes.ClientState) + suite.Require().True(ok) + tmClientState.AllowUpdateAfterMisbehaviour = true + tmClientState.FrozenHeight = tmClientState.LatestHeight + suite.chainA.App.IBCKeeper.ClientKeeper.SetClientState(suite.chainA.GetContext(), clientA, tmClientState) + + // use next header for chainB to update the client on chainA + header, err := suite.chainA.ConstructUpdateTMClientHeader(suite.chainB, clientA) + suite.Require().NoError(err) + + content, err = clienttypes.NewClientUpdateProposal(ibctesting.Title, ibctesting.Description, clientA, header) + suite.Require().NoError(err) + }, true, + }, + { + "nil proposal", func() { + content = nil + }, false, + }, + { + "unsupported proposal type", func() { + content = distributiontypes.NewCommunityPoolSpendProposal(ibctesting.Title, ibctesting.Description, suite.chainA.SenderAccount.GetAddress(), sdk.NewCoins(sdk.NewCoin("communityfunds", sdk.NewInt(10)))) + }, false, + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + tc.malleate() + + proposalHandler := client.NewClientUpdateProposalHandler(suite.chainA.App.IBCKeeper.ClientKeeper) + + err = proposalHandler(suite.chainA.GetContext(), content) + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) + } + +} diff --git a/x/ibc/core/02-client/types/client.pb.go b/x/ibc/core/02-client/types/client.pb.go index f70ceca58c..601a1d7686 100644 --- a/x/ibc/core/02-client/types/client.pb.go +++ b/x/ibc/core/02-client/types/client.pb.go @@ -4,10 +4,15 @@ package types import ( + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" + grpc1 "github.com/gogo/protobuf/grpc" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -24,220 +29,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// IdentifiedClientState defines a client state with an additional client -// identifier field. -type IdentifiedClientState struct { - // client identifier - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` - // client state - ClientState *types.Any `protobuf:"bytes,2,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` -} - -func (m *IdentifiedClientState) Reset() { *m = IdentifiedClientState{} } -func (m *IdentifiedClientState) String() string { return proto.CompactTextString(m) } -func (*IdentifiedClientState) ProtoMessage() {} -func (*IdentifiedClientState) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{0} -} -func (m *IdentifiedClientState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IdentifiedClientState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IdentifiedClientState.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *IdentifiedClientState) XXX_Merge(src proto.Message) { - xxx_messageInfo_IdentifiedClientState.Merge(m, src) -} -func (m *IdentifiedClientState) XXX_Size() int { - return m.Size() -} -func (m *IdentifiedClientState) XXX_DiscardUnknown() { - xxx_messageInfo_IdentifiedClientState.DiscardUnknown(m) -} - -var xxx_messageInfo_IdentifiedClientState proto.InternalMessageInfo - -func (m *IdentifiedClientState) GetClientId() string { - if m != nil { - return m.ClientId - } - return "" -} - -func (m *IdentifiedClientState) GetClientState() *types.Any { - if m != nil { - return m.ClientState - } - return nil -} - -// ConsensusStateWithHeight defines a consensus state with an additional height field. -type ConsensusStateWithHeight struct { - // consensus state height - Height Height `protobuf:"bytes,1,opt,name=height,proto3" json:"height"` - // consensus state - ConsensusState *types.Any `protobuf:"bytes,2,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty" yaml"consensus_state"` -} - -func (m *ConsensusStateWithHeight) Reset() { *m = ConsensusStateWithHeight{} } -func (m *ConsensusStateWithHeight) String() string { return proto.CompactTextString(m) } -func (*ConsensusStateWithHeight) ProtoMessage() {} -func (*ConsensusStateWithHeight) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{1} -} -func (m *ConsensusStateWithHeight) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConsensusStateWithHeight) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConsensusStateWithHeight.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ConsensusStateWithHeight) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsensusStateWithHeight.Merge(m, src) -} -func (m *ConsensusStateWithHeight) XXX_Size() int { - return m.Size() -} -func (m *ConsensusStateWithHeight) XXX_DiscardUnknown() { - xxx_messageInfo_ConsensusStateWithHeight.DiscardUnknown(m) -} - -var xxx_messageInfo_ConsensusStateWithHeight proto.InternalMessageInfo - -func (m *ConsensusStateWithHeight) GetHeight() Height { - if m != nil { - return m.Height - } - return Height{} -} - -func (m *ConsensusStateWithHeight) GetConsensusState() *types.Any { - if m != nil { - return m.ConsensusState - } - return nil -} - -// ClientConsensusStates defines all the stored consensus states for a given -// client. -type ClientConsensusStates struct { - // client identifier - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` - // consensus states and their heights associated with the client - ConsensusStates []ConsensusStateWithHeight `protobuf:"bytes,2,rep,name=consensus_states,json=consensusStates,proto3" json:"consensus_states" yaml:"consensus_states"` -} - -func (m *ClientConsensusStates) Reset() { *m = ClientConsensusStates{} } -func (m *ClientConsensusStates) String() string { return proto.CompactTextString(m) } -func (*ClientConsensusStates) ProtoMessage() {} -func (*ClientConsensusStates) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{2} -} -func (m *ClientConsensusStates) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ClientConsensusStates) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ClientConsensusStates.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ClientConsensusStates) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClientConsensusStates.Merge(m, src) -} -func (m *ClientConsensusStates) XXX_Size() int { - return m.Size() -} -func (m *ClientConsensusStates) XXX_DiscardUnknown() { - xxx_messageInfo_ClientConsensusStates.DiscardUnknown(m) -} - -var xxx_messageInfo_ClientConsensusStates proto.InternalMessageInfo - -func (m *ClientConsensusStates) GetClientId() string { - if m != nil { - return m.ClientId - } - return "" -} - -func (m *ClientConsensusStates) GetConsensusStates() []ConsensusStateWithHeight { - if m != nil { - return m.ConsensusStates - } - return nil -} - -// ClientUpdateProposal is a governance proposal. If it passes, the client is -// updated with the provided header. The update may fail if the header is not -// valid given certain conditions specified by the client implementation. -type ClientUpdateProposal struct { - // the title of the update proposal - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - // the description of the proposal - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // the client identifier for the client to be updated if the proposal passes - ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` - // the header used to update the client if the proposal passes - Header *types.Any `protobuf:"bytes,4,opt,name=header,proto3" json:"header,omitempty"` -} - -func (m *ClientUpdateProposal) Reset() { *m = ClientUpdateProposal{} } -func (m *ClientUpdateProposal) String() string { return proto.CompactTextString(m) } -func (*ClientUpdateProposal) ProtoMessage() {} -func (*ClientUpdateProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{3} -} -func (m *ClientUpdateProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ClientUpdateProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ClientUpdateProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ClientUpdateProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClientUpdateProposal.Merge(m, src) -} -func (m *ClientUpdateProposal) XXX_Size() int { - return m.Size() -} -func (m *ClientUpdateProposal) XXX_DiscardUnknown() { - xxx_messageInfo_ClientUpdateProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_ClientUpdateProposal proto.InternalMessageInfo - // MsgCreateClient defines a message to create an IBC client type MsgCreateClient struct { // client unique identifier @@ -255,7 +46,7 @@ func (m *MsgCreateClient) Reset() { *m = MsgCreateClient{} } func (m *MsgCreateClient) String() string { return proto.CompactTextString(m) } func (*MsgCreateClient) ProtoMessage() {} func (*MsgCreateClient) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{4} + return fileDescriptor_b6bc4c8185546947, []int{0} } func (m *MsgCreateClient) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -284,6 +75,43 @@ func (m *MsgCreateClient) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreateClient proto.InternalMessageInfo +// MsgCreateClientResponse defines the Msg/CreateClient response type. +type MsgCreateClientResponse struct { +} + +func (m *MsgCreateClientResponse) Reset() { *m = MsgCreateClientResponse{} } +func (m *MsgCreateClientResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateClientResponse) ProtoMessage() {} +func (*MsgCreateClientResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{1} +} +func (m *MsgCreateClientResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateClientResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateClientResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateClientResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateClientResponse.Merge(m, src) +} +func (m *MsgCreateClientResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateClientResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateClientResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateClientResponse proto.InternalMessageInfo + // MsgUpdateClient defines an sdk.Msg to update a IBC client state using // the given header. type MsgUpdateClient struct { @@ -299,7 +127,7 @@ func (m *MsgUpdateClient) Reset() { *m = MsgUpdateClient{} } func (m *MsgUpdateClient) String() string { return proto.CompactTextString(m) } func (*MsgUpdateClient) ProtoMessage() {} func (*MsgUpdateClient) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{5} + return fileDescriptor_b6bc4c8185546947, []int{2} } func (m *MsgUpdateClient) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -328,6 +156,43 @@ func (m *MsgUpdateClient) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateClient proto.InternalMessageInfo +// MsgUpdateClientResponse defines the Msg/UpdateClient response type. +type MsgUpdateClientResponse struct { +} + +func (m *MsgUpdateClientResponse) Reset() { *m = MsgUpdateClientResponse{} } +func (m *MsgUpdateClientResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateClientResponse) ProtoMessage() {} +func (*MsgUpdateClientResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{3} +} +func (m *MsgUpdateClientResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateClientResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateClientResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateClientResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateClientResponse.Merge(m, src) +} +func (m *MsgUpdateClientResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateClientResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateClientResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateClientResponse proto.InternalMessageInfo + // MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state type MsgUpgradeClient struct { // client unique identifier @@ -346,7 +211,7 @@ func (m *MsgUpgradeClient) Reset() { *m = MsgUpgradeClient{} } func (m *MsgUpgradeClient) String() string { return proto.CompactTextString(m) } func (*MsgUpgradeClient) ProtoMessage() {} func (*MsgUpgradeClient) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{6} + return fileDescriptor_b6bc4c8185546947, []int{4} } func (m *MsgUpgradeClient) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -410,6 +275,43 @@ func (m *MsgUpgradeClient) GetSigner() string { return "" } +// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. +type MsgUpgradeClientResponse struct { +} + +func (m *MsgUpgradeClientResponse) Reset() { *m = MsgUpgradeClientResponse{} } +func (m *MsgUpgradeClientResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpgradeClientResponse) ProtoMessage() {} +func (*MsgUpgradeClientResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{5} +} +func (m *MsgUpgradeClientResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpgradeClientResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpgradeClientResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpgradeClientResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpgradeClientResponse.Merge(m, src) +} +func (m *MsgUpgradeClientResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpgradeClientResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpgradeClientResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpgradeClientResponse proto.InternalMessageInfo + // MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for // light client misbehaviour. type MsgSubmitMisbehaviour struct { @@ -425,7 +327,7 @@ func (m *MsgSubmitMisbehaviour) Reset() { *m = MsgSubmitMisbehaviour{} } func (m *MsgSubmitMisbehaviour) String() string { return proto.CompactTextString(m) } func (*MsgSubmitMisbehaviour) ProtoMessage() {} func (*MsgSubmitMisbehaviour) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{7} + return fileDescriptor_b6bc4c8185546947, []int{6} } func (m *MsgSubmitMisbehaviour) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -454,6 +356,257 @@ func (m *MsgSubmitMisbehaviour) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitMisbehaviour proto.InternalMessageInfo +// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response type. +type MsgSubmitMisbehaviourResponse struct { +} + +func (m *MsgSubmitMisbehaviourResponse) Reset() { *m = MsgSubmitMisbehaviourResponse{} } +func (m *MsgSubmitMisbehaviourResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitMisbehaviourResponse) ProtoMessage() {} +func (*MsgSubmitMisbehaviourResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{7} +} +func (m *MsgSubmitMisbehaviourResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitMisbehaviourResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitMisbehaviourResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSubmitMisbehaviourResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitMisbehaviourResponse.Merge(m, src) +} +func (m *MsgSubmitMisbehaviourResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitMisbehaviourResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitMisbehaviourResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitMisbehaviourResponse proto.InternalMessageInfo + +// IdentifiedClientState defines a client state with an additional client +// identifier field. +type IdentifiedClientState struct { + // client identifier + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + // client state + ClientState *types.Any `protobuf:"bytes,2,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` +} + +func (m *IdentifiedClientState) Reset() { *m = IdentifiedClientState{} } +func (m *IdentifiedClientState) String() string { return proto.CompactTextString(m) } +func (*IdentifiedClientState) ProtoMessage() {} +func (*IdentifiedClientState) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{8} +} +func (m *IdentifiedClientState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IdentifiedClientState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IdentifiedClientState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IdentifiedClientState) XXX_Merge(src proto.Message) { + xxx_messageInfo_IdentifiedClientState.Merge(m, src) +} +func (m *IdentifiedClientState) XXX_Size() int { + return m.Size() +} +func (m *IdentifiedClientState) XXX_DiscardUnknown() { + xxx_messageInfo_IdentifiedClientState.DiscardUnknown(m) +} + +var xxx_messageInfo_IdentifiedClientState proto.InternalMessageInfo + +func (m *IdentifiedClientState) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *IdentifiedClientState) GetClientState() *types.Any { + if m != nil { + return m.ClientState + } + return nil +} + +// ConsensusStateWithHeight defines a consensus state with an additional height field. +type ConsensusStateWithHeight struct { + // consensus state height + Height Height `protobuf:"bytes,1,opt,name=height,proto3" json:"height"` + // consensus state + ConsensusState *types.Any `protobuf:"bytes,2,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty" yaml"consensus_state"` +} + +func (m *ConsensusStateWithHeight) Reset() { *m = ConsensusStateWithHeight{} } +func (m *ConsensusStateWithHeight) String() string { return proto.CompactTextString(m) } +func (*ConsensusStateWithHeight) ProtoMessage() {} +func (*ConsensusStateWithHeight) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{9} +} +func (m *ConsensusStateWithHeight) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsensusStateWithHeight) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsensusStateWithHeight.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConsensusStateWithHeight) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusStateWithHeight.Merge(m, src) +} +func (m *ConsensusStateWithHeight) XXX_Size() int { + return m.Size() +} +func (m *ConsensusStateWithHeight) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusStateWithHeight.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusStateWithHeight proto.InternalMessageInfo + +func (m *ConsensusStateWithHeight) GetHeight() Height { + if m != nil { + return m.Height + } + return Height{} +} + +func (m *ConsensusStateWithHeight) GetConsensusState() *types.Any { + if m != nil { + return m.ConsensusState + } + return nil +} + +// ClientConsensusStates defines all the stored consensus states for a given +// client. +type ClientConsensusStates struct { + // client identifier + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + // consensus states and their heights associated with the client + ConsensusStates []ConsensusStateWithHeight `protobuf:"bytes,2,rep,name=consensus_states,json=consensusStates,proto3" json:"consensus_states" yaml:"consensus_states"` +} + +func (m *ClientConsensusStates) Reset() { *m = ClientConsensusStates{} } +func (m *ClientConsensusStates) String() string { return proto.CompactTextString(m) } +func (*ClientConsensusStates) ProtoMessage() {} +func (*ClientConsensusStates) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{10} +} +func (m *ClientConsensusStates) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClientConsensusStates) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClientConsensusStates.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ClientConsensusStates) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientConsensusStates.Merge(m, src) +} +func (m *ClientConsensusStates) XXX_Size() int { + return m.Size() +} +func (m *ClientConsensusStates) XXX_DiscardUnknown() { + xxx_messageInfo_ClientConsensusStates.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientConsensusStates proto.InternalMessageInfo + +func (m *ClientConsensusStates) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *ClientConsensusStates) GetConsensusStates() []ConsensusStateWithHeight { + if m != nil { + return m.ConsensusStates + } + return nil +} + +// ClientUpdateProposal is a governance proposal. If it passes, the client is +// updated with the provided header. The update may fail if the header is not +// valid given certain conditions specified by the client implementation. +type ClientUpdateProposal struct { + // the title of the update proposal + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // the description of the proposal + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // the client identifier for the client to be updated if the proposal passes + ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + // the header used to update the client if the proposal passes + Header *types.Any `protobuf:"bytes,4,opt,name=header,proto3" json:"header,omitempty"` +} + +func (m *ClientUpdateProposal) Reset() { *m = ClientUpdateProposal{} } +func (m *ClientUpdateProposal) String() string { return proto.CompactTextString(m) } +func (*ClientUpdateProposal) ProtoMessage() {} +func (*ClientUpdateProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{11} +} +func (m *ClientUpdateProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClientUpdateProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClientUpdateProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ClientUpdateProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientUpdateProposal.Merge(m, src) +} +func (m *ClientUpdateProposal) XXX_Size() int { + return m.Size() +} +func (m *ClientUpdateProposal) XXX_DiscardUnknown() { + xxx_messageInfo_ClientUpdateProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientUpdateProposal proto.InternalMessageInfo + // Height is a monotonically increasing data type // that can be compared against another Height for the purposes of updating and // freezing clients @@ -473,7 +626,7 @@ type Height struct { func (m *Height) Reset() { *m = Height{} } func (*Height) ProtoMessage() {} func (*Height) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{8} + return fileDescriptor_b6bc4c8185546947, []int{12} } func (m *Height) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -503,66 +656,592 @@ func (m *Height) XXX_DiscardUnknown() { var xxx_messageInfo_Height proto.InternalMessageInfo func init() { + proto.RegisterType((*MsgCreateClient)(nil), "ibc.core.client.v1.MsgCreateClient") + proto.RegisterType((*MsgCreateClientResponse)(nil), "ibc.core.client.v1.MsgCreateClientResponse") + proto.RegisterType((*MsgUpdateClient)(nil), "ibc.core.client.v1.MsgUpdateClient") + proto.RegisterType((*MsgUpdateClientResponse)(nil), "ibc.core.client.v1.MsgUpdateClientResponse") + proto.RegisterType((*MsgUpgradeClient)(nil), "ibc.core.client.v1.MsgUpgradeClient") + proto.RegisterType((*MsgUpgradeClientResponse)(nil), "ibc.core.client.v1.MsgUpgradeClientResponse") + proto.RegisterType((*MsgSubmitMisbehaviour)(nil), "ibc.core.client.v1.MsgSubmitMisbehaviour") + proto.RegisterType((*MsgSubmitMisbehaviourResponse)(nil), "ibc.core.client.v1.MsgSubmitMisbehaviourResponse") proto.RegisterType((*IdentifiedClientState)(nil), "ibc.core.client.v1.IdentifiedClientState") proto.RegisterType((*ConsensusStateWithHeight)(nil), "ibc.core.client.v1.ConsensusStateWithHeight") proto.RegisterType((*ClientConsensusStates)(nil), "ibc.core.client.v1.ClientConsensusStates") proto.RegisterType((*ClientUpdateProposal)(nil), "ibc.core.client.v1.ClientUpdateProposal") - proto.RegisterType((*MsgCreateClient)(nil), "ibc.core.client.v1.MsgCreateClient") - proto.RegisterType((*MsgUpdateClient)(nil), "ibc.core.client.v1.MsgUpdateClient") - proto.RegisterType((*MsgUpgradeClient)(nil), "ibc.core.client.v1.MsgUpgradeClient") - proto.RegisterType((*MsgSubmitMisbehaviour)(nil), "ibc.core.client.v1.MsgSubmitMisbehaviour") proto.RegisterType((*Height)(nil), "ibc.core.client.v1.Height") } func init() { proto.RegisterFile("ibc/core/client/v1/client.proto", fileDescriptor_b6bc4c8185546947) } var fileDescriptor_b6bc4c8185546947 = []byte{ - // 718 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x3d, 0x4f, 0xdb, 0x4e, - 0x1c, 0x8e, 0x93, 0x10, 0x91, 0x4b, 0x78, 0x91, 0xff, 0x09, 0x84, 0x0c, 0x71, 0x74, 0x13, 0x03, - 0xd8, 0x7f, 0xd2, 0xa1, 0x28, 0x52, 0xa5, 0x36, 0x2c, 0x65, 0xa0, 0xa2, 0x46, 0x55, 0x5f, 0x54, - 0x29, 0xf2, 0xcb, 0xe1, 0x9c, 0x9a, 0xf8, 0x22, 0xdf, 0x25, 0x22, 0xdf, 0xa0, 0x63, 0xa5, 0x56, - 0x55, 0x87, 0x0e, 0x4c, 0x1d, 0xbb, 0xf5, 0x1b, 0x74, 0x60, 0xe8, 0xc0, 0xd8, 0xc9, 0xaa, 0x60, - 0xe9, 0x9c, 0x4f, 0x50, 0xf9, 0xee, 0x08, 0x36, 0x10, 0x40, 0x4c, 0x4c, 0xbe, 0xdf, 0xcb, 0x3d, - 0xf7, 0xfc, 0x9e, 0xe7, 0x74, 0x06, 0x1a, 0xb6, 0x1d, 0xc3, 0x21, 0x01, 0x32, 0x9c, 0x2e, 0x46, - 0x3e, 0x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a, 0xea, 0xf7, 0x69, 0x2d, 0xf5, 0xe6, 0xa1, 0x87, 0x59, 0x67, 0x60, - 0xeb, 0x0e, 0xe9, 0x19, 0x0e, 0xa1, 0x3d, 0x42, 0xe5, 0x67, 0x9d, 0xba, 0xef, 0x8c, 0x03, 0x63, - 0xf2, 0xaf, 0xfe, 0xbf, 0xb1, 0x2e, 0x7f, 0xd7, 0x6c, 0xd4, 0x47, 0xd4, 0xce, 0x71, 0xa5, 0x1e, - 0xfc, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x1c, 0xf5, 0xf4, 0xce, 0x07, 0x00, 0x00, + // 827 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x3f, 0x6f, 0x1a, 0x49, + 0x14, 0x67, 0x01, 0x23, 0x7b, 0x00, 0xdb, 0xda, 0x03, 0x1b, 0xaf, 0x74, 0x2c, 0x9a, 0xbb, 0xc2, + 0xa7, 0xb3, 0x77, 0x0f, 0xae, 0x38, 0xcb, 0xd2, 0x49, 0x77, 0xd0, 0x9c, 0x0b, 0x4e, 0xbe, 0xb5, + 0x4e, 0xf9, 0xa3, 0x48, 0x64, 0xff, 0x8c, 0x97, 0x51, 0x60, 0x07, 0xed, 0x2c, 0xc8, 0x7c, 0x83, + 0x94, 0x91, 0x12, 0x45, 0x29, 0x52, 0x58, 0x29, 0x52, 0xa6, 0xcb, 0x37, 0x48, 0xe1, 0x22, 0x85, + 0xcb, 0x54, 0x28, 0xb2, 0x9b, 0xd4, 0x7c, 0x82, 0x68, 0x77, 0xc6, 0xab, 0x5d, 0x0c, 0x98, 0x38, + 0x8d, 0x2b, 0xf6, 0xbd, 0xf9, 0xcd, 0xef, 0xbd, 0xf7, 0x9b, 0x37, 0x6f, 0x00, 0x32, 0x36, 0x4c, + 0xd5, 0x24, 0x2e, 0x52, 0xcd, 0x0e, 0x46, 0x8e, 0xa7, 0x0e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, 0x47, 0x13, 0x77, 0xb0, 0x1c, 0xd8, 0x45, + 0x7c, 0x75, 0x2a, 0x27, 0x6a, 0x6f, 0x52, 0x20, 0xd5, 0xa4, 0xb6, 0xf8, 0x18, 0xe4, 0x62, 0x6f, + 0xf0, 0x4f, 0xd3, 0x0e, 0x72, 0xe2, 0x4d, 0x92, 0x7e, 0x5d, 0x00, 0x74, 0x75, 0xa3, 0xfd, 0x08, + 0xb1, 0x47, 0x6b, 0x56, 0x84, 0x28, 0x68, 0x66, 0x84, 0x69, 0x0f, 0x8d, 0x68, 0x82, 0x7c, 0xfc, + 0x91, 0xf9, 0x79, 0xe6, 0xee, 0x08, 0x4a, 0xda, 0x59, 0x04, 0x15, 0x06, 0x71, 0x81, 0x38, 0x65, + 0xbc, 0xfe, 0x32, 0x83, 0xe3, 0x3a, 0x54, 0xaa, 0x2e, 0x0c, 0xbd, 0x8a, 0x59, 0xff, 0xef, 0xec, + 0xa2, 0x2c, 0x9c, 0x5f, 0x94, 0x85, 0xcf, 0x17, 0x65, 0xe1, 0xd9, 0x65, 0x39, 0x71, 0x7e, 0x59, + 0x4e, 0x7c, 0xba, 0x2c, 0x27, 0x1e, 0xfe, 0x61, 0x63, 0xaf, 0xdd, 0x37, 0x14, 0x93, 0x74, 0x55, + 0x93, 0xd0, 0x2e, 0xa1, 0xfc, 0x67, 0x97, 0x5a, 0x4f, 0xd4, 0x13, 0x35, 0xfc, 0x0f, 0xf7, 0x5b, + 0x6d, 0x97, 0xff, 0x8d, 0xf3, 0x86, 0x3d, 0x44, 0x8d, 0x4c, 0xd0, 0xac, 0xbf, 0x7f, 0x0d, 0x00, + 0x00, 0xff, 0xff, 0x06, 0xa7, 0xa2, 0x16, 0xe6, 0x09, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // CreateClient defines a rpc handler method for MsgCreateClient. + CreateClient(ctx context.Context, in *MsgCreateClient, opts ...grpc.CallOption) (*MsgCreateClientResponse, error) + // UpdateClient defines a rpc handler method for MsgUpdateClient. + UpdateClient(ctx context.Context, in *MsgUpdateClient, opts ...grpc.CallOption) (*MsgUpdateClientResponse, error) + // UpgradeClient defines a rpc handler method for MsgUpgradeClient. + UpgradeClient(ctx context.Context, in *MsgUpgradeClient, opts ...grpc.CallOption) (*MsgUpgradeClientResponse, error) + // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. + SubmitMisbehaviour(ctx context.Context, in *MsgSubmitMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitMisbehaviourResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateClient(ctx context.Context, in *MsgCreateClient, opts ...grpc.CallOption) (*MsgCreateClientResponse, error) { + out := new(MsgCreateClientResponse) + err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Msg/CreateClient", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateClient(ctx context.Context, in *MsgUpdateClient, opts ...grpc.CallOption) (*MsgUpdateClientResponse, error) { + out := new(MsgUpdateClientResponse) + err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Msg/UpdateClient", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpgradeClient(ctx context.Context, in *MsgUpgradeClient, opts ...grpc.CallOption) (*MsgUpgradeClientResponse, error) { + out := new(MsgUpgradeClientResponse) + err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Msg/UpgradeClient", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SubmitMisbehaviour(ctx context.Context, in *MsgSubmitMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitMisbehaviourResponse, error) { + out := new(MsgSubmitMisbehaviourResponse) + err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Msg/SubmitMisbehaviour", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // CreateClient defines a rpc handler method for MsgCreateClient. + CreateClient(context.Context, *MsgCreateClient) (*MsgCreateClientResponse, error) + // UpdateClient defines a rpc handler method for MsgUpdateClient. + UpdateClient(context.Context, *MsgUpdateClient) (*MsgUpdateClientResponse, error) + // UpgradeClient defines a rpc handler method for MsgUpgradeClient. + UpgradeClient(context.Context, *MsgUpgradeClient) (*MsgUpgradeClientResponse, error) + // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. + SubmitMisbehaviour(context.Context, *MsgSubmitMisbehaviour) (*MsgSubmitMisbehaviourResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreateClient(ctx context.Context, req *MsgCreateClient) (*MsgCreateClientResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateClient not implemented") +} +func (*UnimplementedMsgServer) UpdateClient(ctx context.Context, req *MsgUpdateClient) (*MsgUpdateClientResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateClient not implemented") +} +func (*UnimplementedMsgServer) UpgradeClient(ctx context.Context, req *MsgUpgradeClient) (*MsgUpgradeClientResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpgradeClient not implemented") +} +func (*UnimplementedMsgServer) SubmitMisbehaviour(ctx context.Context, req *MsgSubmitMisbehaviour) (*MsgSubmitMisbehaviourResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitMisbehaviour not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateClient) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateClient(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.client.v1.Msg/CreateClient", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateClient(ctx, req.(*MsgCreateClient)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateClient) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateClient(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.client.v1.Msg/UpdateClient", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateClient(ctx, req.(*MsgUpdateClient)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpgradeClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpgradeClient) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpgradeClient(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.client.v1.Msg/UpgradeClient", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpgradeClient(ctx, req.(*MsgUpgradeClient)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SubmitMisbehaviour_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitMisbehaviour) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitMisbehaviour(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.client.v1.Msg/SubmitMisbehaviour", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitMisbehaviour(ctx, req.(*MsgSubmitMisbehaviour)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.core.client.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateClient", + Handler: _Msg_CreateClient_Handler, + }, + { + MethodName: "UpdateClient", + Handler: _Msg_UpdateClient_Handler, + }, + { + MethodName: "UpgradeClient", + Handler: _Msg_UpgradeClient_Handler, + }, + { + MethodName: "SubmitMisbehaviour", + Handler: _Msg_SubmitMisbehaviour_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/core/client/v1/client.proto", +} + +func (m *MsgCreateClient) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateClient) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x22 + } + if m.ConsensusState != nil { + { + size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.ClientState != nil { + { + size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateClientResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateClientResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateClient) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateClient) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateClientResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateClientResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpgradeClient) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpgradeClient) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpgradeClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x2a + } + if len(m.ProofUpgrade) > 0 { + i -= len(m.ProofUpgrade) + copy(dAtA[i:], m.ProofUpgrade) + i = encodeVarintClient(dAtA, i, uint64(len(m.ProofUpgrade))) + i-- + dAtA[i] = 0x22 + } + if m.UpgradeHeight != nil { + { + size, err := m.UpgradeHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.ClientState != nil { + { + size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpgradeClientResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpgradeClientResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpgradeClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgSubmitMisbehaviour) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSubmitMisbehaviour) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if m.Misbehaviour != nil { + { + size, err := m.Misbehaviour.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSubmitMisbehaviourResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSubmitMisbehaviourResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitMisbehaviourResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil } func (m *IdentifiedClientState) Marshal() (dAtA []byte, err error) { @@ -752,233 +1431,6 @@ func (m *ClientUpdateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgCreateClient) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgCreateClient) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x22 - } - if m.ConsensusState != nil { - { - size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.ClientState != nil { - { - size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateClient) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUpdateClient) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x1a - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpgradeClient) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUpgradeClient) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpgradeClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x2a - } - if len(m.ProofUpgrade) > 0 { - i -= len(m.ProofUpgrade) - copy(dAtA[i:], m.ProofUpgrade) - i = encodeVarintClient(dAtA, i, uint64(len(m.ProofUpgrade))) - i-- - dAtA[i] = 0x22 - } - if m.UpgradeHeight != nil { - { - size, err := m.UpgradeHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.ClientState != nil { - { - size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgSubmitMisbehaviour) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgSubmitMisbehaviour) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x1a - } - if m.Misbehaviour != nil { - { - size, err := m.Misbehaviour.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *Height) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1023,6 +1475,138 @@ func encodeVarintClient(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *MsgCreateClient) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + if m.ClientState != nil { + l = m.ClientState.Size() + n += 1 + l + sovClient(uint64(l)) + } + if m.ConsensusState != nil { + l = m.ConsensusState.Size() + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + return n +} + +func (m *MsgCreateClientResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateClient) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + return n +} + +func (m *MsgUpdateClientResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpgradeClient) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + if m.ClientState != nil { + l = m.ClientState.Size() + n += 1 + l + sovClient(uint64(l)) + } + if m.UpgradeHeight != nil { + l = m.UpgradeHeight.Size() + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.ProofUpgrade) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + return n +} + +func (m *MsgUpgradeClientResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSubmitMisbehaviour) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + if m.Misbehaviour != nil { + l = m.Misbehaviour.Size() + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + return n +} + +func (m *MsgSubmitMisbehaviourResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *IdentifiedClientState) Size() (n int) { if m == nil { return 0 @@ -1099,102 +1683,6 @@ func (m *ClientUpdateProposal) Size() (n int) { return n } -func (m *MsgCreateClient) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovClient(uint64(l)) - } - if m.ClientState != nil { - l = m.ClientState.Size() - n += 1 + l + sovClient(uint64(l)) - } - if m.ConsensusState != nil { - l = m.ConsensusState.Size() - n += 1 + l + sovClient(uint64(l)) - } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovClient(uint64(l)) - } - return n -} - -func (m *MsgUpdateClient) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovClient(uint64(l)) - } - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovClient(uint64(l)) - } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovClient(uint64(l)) - } - return n -} - -func (m *MsgUpgradeClient) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovClient(uint64(l)) - } - if m.ClientState != nil { - l = m.ClientState.Size() - n += 1 + l + sovClient(uint64(l)) - } - if m.UpgradeHeight != nil { - l = m.UpgradeHeight.Size() - n += 1 + l + sovClient(uint64(l)) - } - l = len(m.ProofUpgrade) - if l > 0 { - n += 1 + l + sovClient(uint64(l)) - } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovClient(uint64(l)) - } - return n -} - -func (m *MsgSubmitMisbehaviour) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovClient(uint64(l)) - } - if m.Misbehaviour != nil { - l = m.Misbehaviour.Size() - n += 1 + l + sovClient(uint64(l)) - } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovClient(uint64(l)) - } - return n -} - func (m *Height) Size() (n int) { if m == nil { return 0 @@ -1216,6 +1704,936 @@ func sovClient(x uint64) (n int) { func sozClient(x uint64) (n int) { return sovClient(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *MsgCreateClient) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateClient: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateClient: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClientState == nil { + m.ClientState = &types.Any{} + } + if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsensusState == nil { + m.ConsensusState = &types.Any{} + } + if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateClientResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateClientResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateClientResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateClient) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateClient: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateClient: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &types.Any{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateClientResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateClientResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateClientResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpgradeClient: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpgradeClient: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClientState == nil { + m.ClientState = &types.Any{} + } + if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UpgradeHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UpgradeHeight == nil { + m.UpgradeHeight = &Height{} + } + if err := m.UpgradeHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofUpgrade", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofUpgrade = append(m.ProofUpgrade[:0], dAtA[iNdEx:postIndex]...) + if m.ProofUpgrade == nil { + m.ProofUpgrade = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpgradeClientResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpgradeClientResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpgradeClientResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitMisbehaviour) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitMisbehaviour: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitMisbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Misbehaviour", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Misbehaviour == nil { + m.Misbehaviour = &types.Any{} + } + if err := m.Misbehaviour.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitMisbehaviourResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitMisbehaviourResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitMisbehaviourResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *IdentifiedClientState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1763,724 +3181,6 @@ func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreateClient) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgCreateClient: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateClient: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ClientState == nil { - m.ClientState = &types.Any{} - } - if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ConsensusState == nil { - m.ConsensusState = &types.Any{} - } - if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipClient(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthClient - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthClient - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateClient) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateClient: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateClient: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &types.Any{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipClient(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthClient - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthClient - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpgradeClient: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpgradeClient: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ClientState == nil { - m.ClientState = &types.Any{} - } - if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpgradeHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.UpgradeHeight == nil { - m.UpgradeHeight = &Height{} - } - if err := m.UpgradeHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofUpgrade", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProofUpgrade = append(m.ProofUpgrade[:0], dAtA[iNdEx:postIndex]...) - if m.ProofUpgrade == nil { - m.ProofUpgrade = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipClient(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthClient - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthClient - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgSubmitMisbehaviour) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitMisbehaviour: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitMisbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Misbehaviour", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Misbehaviour == nil { - m.Misbehaviour = &types.Any{} - } - if err := m.Misbehaviour.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipClient(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthClient - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthClient - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Height) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ibc/core/03-connection/handler.go b/x/ibc/core/03-connection/handler.go deleted file mode 100644 index da298038d7..0000000000 --- a/x/ibc/core/03-connection/handler.go +++ /dev/null @@ -1,135 +0,0 @@ -package connection - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/keeper" - "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types" -) - -// HandleMsgConnectionOpenInit defines the sdk.Handler for MsgConnectionOpenInit -func HandleMsgConnectionOpenInit(ctx sdk.Context, k keeper.Keeper, msg *types.MsgConnectionOpenInit) (*sdk.Result, error) { - if err := k.ConnOpenInit( - ctx, msg.ConnectionId, msg.ClientId, msg.Counterparty, msg.Version, - ); err != nil { - return nil, sdkerrors.Wrap(err, "connection handshake open init failed") - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeConnectionOpenInit, - sdk.NewAttribute(types.AttributeKeyConnectionID, msg.ConnectionId), - sdk.NewAttribute(types.AttributeKeyClientID, msg.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, msg.Counterparty.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, msg.Counterparty.ConnectionId), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgConnectionOpenTry defines the sdk.Handler for MsgConnectionOpenTry -func HandleMsgConnectionOpenTry(ctx sdk.Context, k keeper.Keeper, msg *types.MsgConnectionOpenTry) (*sdk.Result, error) { - targetClient, err := clienttypes.UnpackClientState(msg.ClientState) - if err != nil { - return nil, sdkerrors.Wrapf(err, "client in msg is not exported.ClientState. invalid client: %v.", targetClient) - } - - if err := k.ConnOpenTry( - ctx, msg.DesiredConnectionId, msg.CounterpartyChosenConnectionId, msg.Counterparty, msg.ClientId, targetClient, - msg.CounterpartyVersions, msg.ProofInit, msg.ProofClient, msg.ProofConsensus, - msg.ProofHeight, msg.ConsensusHeight, - ); err != nil { - return nil, sdkerrors.Wrap(err, "connection handshake open try failed") - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeConnectionOpenTry, - sdk.NewAttribute(types.AttributeKeyConnectionID, msg.DesiredConnectionId), - sdk.NewAttribute(types.AttributeKeyClientID, msg.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, msg.Counterparty.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, msg.Counterparty.ConnectionId), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgConnectionOpenAck defines the sdk.Handler for MsgConnectionOpenAck -func HandleMsgConnectionOpenAck(ctx sdk.Context, k keeper.Keeper, msg *types.MsgConnectionOpenAck) (*sdk.Result, error) { - targetClient, err := clienttypes.UnpackClientState(msg.ClientState) - if err != nil { - return nil, sdkerrors.Wrapf(err, "client in msg is not exported.ClientState. invalid client: %v", targetClient) - } - - if err := k.ConnOpenAck( - ctx, msg.ConnectionId, targetClient, msg.Version, msg.CounterpartyConnectionId, - msg.ProofTry, msg.ProofClient, msg.ProofConsensus, - msg.ProofHeight, msg.ConsensusHeight, - ); err != nil { - return nil, sdkerrors.Wrap(err, "connection handshake open ack failed") - } - - connectionEnd, _ := k.GetConnection(ctx, msg.ConnectionId) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeConnectionOpenAck, - sdk.NewAttribute(types.AttributeKeyConnectionID, msg.ConnectionId), - sdk.NewAttribute(types.AttributeKeyClientID, connectionEnd.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, connectionEnd.Counterparty.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, connectionEnd.Counterparty.ConnectionId), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgConnectionOpenConfirm defines the sdk.Handler for MsgConnectionOpenConfirm -func HandleMsgConnectionOpenConfirm(ctx sdk.Context, k keeper.Keeper, msg *types.MsgConnectionOpenConfirm) (*sdk.Result, error) { - if err := k.ConnOpenConfirm( - ctx, msg.ConnectionId, msg.ProofAck, msg.ProofHeight, - ); err != nil { - return nil, sdkerrors.Wrap(err, "connection handshake open confirm failed") - } - - connectionEnd, _ := k.GetConnection(ctx, msg.ConnectionId) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeConnectionOpenConfirm, - sdk.NewAttribute(types.AttributeKeyConnectionID, msg.ConnectionId), - sdk.NewAttribute(types.AttributeKeyClientID, connectionEnd.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, connectionEnd.Counterparty.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, connectionEnd.Counterparty.ConnectionId), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} diff --git a/x/ibc/core/03-connection/types/connection.pb.go b/x/ibc/core/03-connection/types/connection.pb.go index deae3b8967..79efbee5d0 100644 --- a/x/ibc/core/03-connection/types/connection.pb.go +++ b/x/ibc/core/03-connection/types/connection.pb.go @@ -4,12 +4,17 @@ package types import ( + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" + grpc1 "github.com/gogo/protobuf/grpc" types1 "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" types2 "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -107,6 +112,43 @@ func (m *MsgConnectionOpenInit) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConnectionOpenInit proto.InternalMessageInfo +// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response type. +type MsgConnectionOpenInitResponse struct { +} + +func (m *MsgConnectionOpenInitResponse) Reset() { *m = MsgConnectionOpenInitResponse{} } +func (m *MsgConnectionOpenInitResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenInitResponse) ProtoMessage() {} +func (*MsgConnectionOpenInitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_90572467c054e43a, []int{1} +} +func (m *MsgConnectionOpenInitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenInitResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConnectionOpenInitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenInitResponse.Merge(m, src) +} +func (m *MsgConnectionOpenInitResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenInitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenInitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenInitResponse proto.InternalMessageInfo + // MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a // connection on Chain B. type MsgConnectionOpenTry struct { @@ -132,7 +174,7 @@ func (m *MsgConnectionOpenTry) Reset() { *m = MsgConnectionOpenTry{} } func (m *MsgConnectionOpenTry) String() string { return proto.CompactTextString(m) } func (*MsgConnectionOpenTry) ProtoMessage() {} func (*MsgConnectionOpenTry) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{1} + return fileDescriptor_90572467c054e43a, []int{2} } func (m *MsgConnectionOpenTry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -161,6 +203,43 @@ func (m *MsgConnectionOpenTry) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConnectionOpenTry proto.InternalMessageInfo +// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +type MsgConnectionOpenTryResponse struct { +} + +func (m *MsgConnectionOpenTryResponse) Reset() { *m = MsgConnectionOpenTryResponse{} } +func (m *MsgConnectionOpenTryResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenTryResponse) ProtoMessage() {} +func (*MsgConnectionOpenTryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_90572467c054e43a, []int{3} +} +func (m *MsgConnectionOpenTryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenTryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenTryResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConnectionOpenTryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenTryResponse.Merge(m, src) +} +func (m *MsgConnectionOpenTryResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenTryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenTryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenTryResponse proto.InternalMessageInfo + // MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to // acknowledge the change of connection state to TRYOPEN on Chain B. type MsgConnectionOpenAck struct { @@ -184,7 +263,7 @@ func (m *MsgConnectionOpenAck) Reset() { *m = MsgConnectionOpenAck{} } func (m *MsgConnectionOpenAck) String() string { return proto.CompactTextString(m) } func (*MsgConnectionOpenAck) ProtoMessage() {} func (*MsgConnectionOpenAck) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{2} + return fileDescriptor_90572467c054e43a, []int{4} } func (m *MsgConnectionOpenAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -213,6 +292,43 @@ func (m *MsgConnectionOpenAck) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConnectionOpenAck proto.InternalMessageInfo +// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. +type MsgConnectionOpenAckResponse struct { +} + +func (m *MsgConnectionOpenAckResponse) Reset() { *m = MsgConnectionOpenAckResponse{} } +func (m *MsgConnectionOpenAckResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenAckResponse) ProtoMessage() {} +func (*MsgConnectionOpenAckResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_90572467c054e43a, []int{5} +} +func (m *MsgConnectionOpenAckResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenAckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenAckResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConnectionOpenAckResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenAckResponse.Merge(m, src) +} +func (m *MsgConnectionOpenAckResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenAckResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenAckResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenAckResponse proto.InternalMessageInfo + // MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of connection state to OPEN on Chain A. type MsgConnectionOpenConfirm struct { @@ -227,7 +343,7 @@ func (m *MsgConnectionOpenConfirm) Reset() { *m = MsgConnectionOpenConfi func (m *MsgConnectionOpenConfirm) String() string { return proto.CompactTextString(m) } func (*MsgConnectionOpenConfirm) ProtoMessage() {} func (*MsgConnectionOpenConfirm) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{3} + return fileDescriptor_90572467c054e43a, []int{6} } func (m *MsgConnectionOpenConfirm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -256,6 +372,43 @@ func (m *MsgConnectionOpenConfirm) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConnectionOpenConfirm proto.InternalMessageInfo +// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm response type. +type MsgConnectionOpenConfirmResponse struct { +} + +func (m *MsgConnectionOpenConfirmResponse) Reset() { *m = MsgConnectionOpenConfirmResponse{} } +func (m *MsgConnectionOpenConfirmResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenConfirmResponse) ProtoMessage() {} +func (*MsgConnectionOpenConfirmResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_90572467c054e43a, []int{7} +} +func (m *MsgConnectionOpenConfirmResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenConfirmResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConnectionOpenConfirmResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenConfirmResponse.Merge(m, src) +} +func (m *MsgConnectionOpenConfirmResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenConfirmResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenConfirmResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenConfirmResponse proto.InternalMessageInfo + // ConnectionEnd defines a stateful object on a chain connected to another // separate one. NOTE: there must only be 2 defined ConnectionEnds to establish // a connection between two chains. @@ -275,7 +428,7 @@ func (m *ConnectionEnd) Reset() { *m = ConnectionEnd{} } func (m *ConnectionEnd) String() string { return proto.CompactTextString(m) } func (*ConnectionEnd) ProtoMessage() {} func (*ConnectionEnd) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{4} + return fileDescriptor_90572467c054e43a, []int{8} } func (m *ConnectionEnd) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -324,7 +477,7 @@ func (m *IdentifiedConnection) Reset() { *m = IdentifiedConnection{} } func (m *IdentifiedConnection) String() string { return proto.CompactTextString(m) } func (*IdentifiedConnection) ProtoMessage() {} func (*IdentifiedConnection) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{5} + return fileDescriptor_90572467c054e43a, []int{9} } func (m *IdentifiedConnection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -369,7 +522,7 @@ func (m *Counterparty) Reset() { *m = Counterparty{} } func (m *Counterparty) String() string { return proto.CompactTextString(m) } func (*Counterparty) ProtoMessage() {} func (*Counterparty) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{6} + return fileDescriptor_90572467c054e43a, []int{10} } func (m *Counterparty) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -408,7 +561,7 @@ func (m *ClientPaths) Reset() { *m = ClientPaths{} } func (m *ClientPaths) String() string { return proto.CompactTextString(m) } func (*ClientPaths) ProtoMessage() {} func (*ClientPaths) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{7} + return fileDescriptor_90572467c054e43a, []int{11} } func (m *ClientPaths) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -456,7 +609,7 @@ func (m *ConnectionPaths) Reset() { *m = ConnectionPaths{} } func (m *ConnectionPaths) String() string { return proto.CompactTextString(m) } func (*ConnectionPaths) ProtoMessage() {} func (*ConnectionPaths) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{8} + return fileDescriptor_90572467c054e43a, []int{12} } func (m *ConnectionPaths) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -512,7 +665,7 @@ func (m *Version) Reset() { *m = Version{} } func (m *Version) String() string { return proto.CompactTextString(m) } func (*Version) ProtoMessage() {} func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{9} + return fileDescriptor_90572467c054e43a, []int{13} } func (m *Version) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -544,9 +697,13 @@ var xxx_messageInfo_Version proto.InternalMessageInfo func init() { proto.RegisterEnum("ibc.core.connection.v1.State", State_name, State_value) proto.RegisterType((*MsgConnectionOpenInit)(nil), "ibc.core.connection.v1.MsgConnectionOpenInit") + proto.RegisterType((*MsgConnectionOpenInitResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenInitResponse") proto.RegisterType((*MsgConnectionOpenTry)(nil), "ibc.core.connection.v1.MsgConnectionOpenTry") + proto.RegisterType((*MsgConnectionOpenTryResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenTryResponse") proto.RegisterType((*MsgConnectionOpenAck)(nil), "ibc.core.connection.v1.MsgConnectionOpenAck") + proto.RegisterType((*MsgConnectionOpenAckResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenAckResponse") proto.RegisterType((*MsgConnectionOpenConfirm)(nil), "ibc.core.connection.v1.MsgConnectionOpenConfirm") + proto.RegisterType((*MsgConnectionOpenConfirmResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenConfirmResponse") proto.RegisterType((*ConnectionEnd)(nil), "ibc.core.connection.v1.ConnectionEnd") proto.RegisterType((*IdentifiedConnection)(nil), "ibc.core.connection.v1.IdentifiedConnection") proto.RegisterType((*Counterparty)(nil), "ibc.core.connection.v1.Counterparty") @@ -560,77 +717,280 @@ func init() { } var fileDescriptor_90572467c054e43a = []byte{ - // 1110 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0x41, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0x9d, 0xa4, 0x49, 0x5e, 0xd2, 0x6d, 0xd7, 0x9b, 0xb6, 0xc6, 0xb0, 0x76, 0xd6, 0x80, - 0xa8, 0x10, 0xeb, 0x90, 0x16, 0x71, 0x28, 0xe2, 0xd0, 0x64, 0x83, 0xb0, 0x60, 0xbb, 0x95, 0x9b, - 0x22, 0xd1, 0x4b, 0x94, 0x3a, 0x93, 0x74, 0xd4, 0xc6, 0x8e, 0x6c, 0xb7, 0x6c, 0xfe, 0xc1, 0xaa, - 0x17, 0xb8, 0x70, 0xe0, 0x50, 0x69, 0x25, 0xee, 0xfc, 0x06, 0x8e, 0x2b, 0x4e, 0x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0xf1, 0xe2, 0xf7, 0x61, 0x25, - 0x91, 0x67, 0x78, 0xed, 0xae, 0xb8, 0x50, 0x49, 0x27, 0x09, 0x9f, 0x09, 0x53, 0x8d, 0x32, 0x3b, - 0xff, 0x5d, 0x38, 0x2d, 0x1c, 0x40, 0x69, 0xe8, 0xd8, 0x76, 0xaf, 0x7d, 0x84, 0x70, 0xff, 0xc8, - 0x13, 0x73, 0xe4, 0x98, 0x12, 0x73, 0x4c, 0x5a, 0x59, 0x67, 0x35, 0xed, 0x6b, 0x82, 0xa8, 0xbf, - 0x1b, 0x1c, 0x6e, 0x42, 0x01, 0x1b, 0xad, 0x1a, 0x45, 0x62, 0x52, 0xa4, 0xf0, 0x19, 0x00, 0xf5, - 0x62, 0x0b, 0x7b, 0x62, 0xbe, 0xc2, 0xad, 0x97, 0xea, 0x2b, 0x63, 0x5f, 0xb9, 0xcf, 0x46, 0x06, - 0x3e, 0xd5, 0x28, 0x10, 0x83, 0xd4, 0xe8, 0x56, 0x74, 0x22, 0xba, 0xb3, 0x58, 0x20, 0x71, 0x6b, - 0xd3, 0x3b, 0x52, 0x6f, 0xb4, 0x63, 0x83, 0x58, 0x42, 0x03, 0x96, 0x42, 0xaf, 0x6d, 0xb9, 0xc8, - 0x72, 0x4f, 0x5d, 0x11, 0x48, 0xb8, 0x34, 0xf6, 0x95, 0xd5, 0x44, 0x78, 0x04, 0x50, 0x8d, 0x7b, - 0x74, 0x85, 0x68, 0x42, 0xe8, 0xc1, 0x72, 0xec, 0x8d, 0x68, 0x29, 0xbe, 0x91, 0x16, 0x25, 0xa4, - 0x65, 0x2d, 0x6e, 0x0a, 0x89, 0x15, 0x54, 0x63, 0x29, 0x9e, 0x0a, 0xe9, 0x99, 0x14, 0x6c, 0xe9, - 0x86, 0x82, 0xfd, 0x3d, 0x3b, 0xa3, 0x60, 0xb7, 0xcd, 0xe3, 0xeb, 0x4d, 0x89, 0x7b, 0xab, 0xa6, - 0x64, 0x82, 0x94, 0xac, 0x99, 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x4c, 0x30, 0x16, 0x64, 0x58, 0xa4, 0x9e, 0x96, 0xf1, 0xfd, 0xb3, 0xdd, 0xe6, 0xce, - 0x32, 0x2f, 0x15, 0xcf, 0x2f, 0x2a, 0xb9, 0xd0, 0x9c, 0x44, 0x12, 0x67, 0x9a, 0x46, 0x06, 0x63, - 0x29, 0xf3, 0xe2, 0x57, 0x39, 0x55, 0xdf, 0x7f, 0x75, 0x29, 0x73, 0xaf, 0x2f, 0x65, 0xee, 0xaf, - 0x4b, 0x99, 0xfb, 0xe9, 0x4a, 0x4e, 0xbd, 0xbe, 0x92, 0x53, 0x7f, 0x5e, 0xc9, 0xa9, 0x83, 0x2f, - 0xfa, 0xd8, 0x3b, 0x3a, 0x3d, 0x0c, 0xae, 0xae, 0x6a, 0xda, 0xee, 0xc0, 0x76, 0xc3, 0x9f, 0xc7, - 0x6e, 0xf7, 0xb8, 0xfa, 0xbc, 0x1a, 0xff, 0x4f, 0xfa, 0x74, 0xf3, 0x31, 0xf3, 0x2f, 0xce, 0x1b, - 0x0d, 0x91, 0x7b, 0xb8, 0x40, 0x9e, 0xd9, 0xcd, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x62, 0x66, - 0x42, 0x8b, 0xe9, 0x0d, 0x00, 0x00, + // 1219 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0x8e, 0xf3, 0xa3, 0x49, 0x5e, 0xd2, 0x6d, 0xeb, 0x4d, 0x5b, 0x63, 0xb6, 0x76, 0xd6, 0x80, + 0xa8, 0xd0, 0x36, 0xd9, 0xb4, 0x0b, 0x42, 0x45, 0x1c, 0x92, 0x6c, 0x10, 0x11, 0xb4, 0x5b, 0xb9, + 0x29, 0x12, 0xbd, 0x44, 0xa9, 0x33, 0x49, 0xad, 0x34, 0x76, 0x64, 0xbb, 0xdd, 0x0d, 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, 0xe8, 0xcd, 0x95, 0x10, 0xfa, 0xe3, 0x4a, 0x08, 0x1d, 0x7e, 0xd6, 0x56, 0xad, + 0xe3, 0xd3, 0x23, 0xbb, 0x6d, 0xf3, 0x8a, 0x6e, 0x76, 0x75, 0xd3, 0xf9, 0xb3, 0x61, 0x36, 0x3b, + 0xf9, 0x17, 0x79, 0xef, 0x87, 0xfa, 0xe3, 0xad, 0x0d, 0xea, 0xdf, 0x08, 0x56, 0xbf, 0x87, 0xcc, + 0xa3, 0x39, 0xfc, 0x4c, 0xdb, 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0x85, 0x21, 0x71, 0xfb, 0x6a, + 0x10, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + ConnectionOpenInit(ctx context.Context, in *MsgConnectionOpenInit, opts ...grpc.CallOption) (*MsgConnectionOpenInitResponse, error) + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + ConnectionOpenTry(ctx context.Context, in *MsgConnectionOpenTry, opts ...grpc.CallOption) (*MsgConnectionOpenTryResponse, error) + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + ConnectionOpenAck(ctx context.Context, in *MsgConnectionOpenAck, opts ...grpc.CallOption) (*MsgConnectionOpenAckResponse, error) + // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. + ConnectionOpenConfirm(ctx context.Context, in *MsgConnectionOpenConfirm, opts ...grpc.CallOption) (*MsgConnectionOpenConfirmResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) ConnectionOpenInit(ctx context.Context, in *MsgConnectionOpenInit, opts ...grpc.CallOption) (*MsgConnectionOpenInitResponse, error) { + out := new(MsgConnectionOpenInitResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenInit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConnectionOpenTry(ctx context.Context, in *MsgConnectionOpenTry, opts ...grpc.CallOption) (*MsgConnectionOpenTryResponse, error) { + out := new(MsgConnectionOpenTryResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenTry", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConnectionOpenAck(ctx context.Context, in *MsgConnectionOpenAck, opts ...grpc.CallOption) (*MsgConnectionOpenAckResponse, error) { + out := new(MsgConnectionOpenAckResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenAck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConnectionOpenConfirm(ctx context.Context, in *MsgConnectionOpenConfirm, opts ...grpc.CallOption) (*MsgConnectionOpenConfirmResponse, error) { + out := new(MsgConnectionOpenConfirmResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + ConnectionOpenInit(context.Context, *MsgConnectionOpenInit) (*MsgConnectionOpenInitResponse, error) + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + ConnectionOpenTry(context.Context, *MsgConnectionOpenTry) (*MsgConnectionOpenTryResponse, error) + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + ConnectionOpenAck(context.Context, *MsgConnectionOpenAck) (*MsgConnectionOpenAckResponse, error) + // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. + ConnectionOpenConfirm(context.Context, *MsgConnectionOpenConfirm) (*MsgConnectionOpenConfirmResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) ConnectionOpenInit(ctx context.Context, req *MsgConnectionOpenInit) (*MsgConnectionOpenInitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenInit not implemented") +} +func (*UnimplementedMsgServer) ConnectionOpenTry(ctx context.Context, req *MsgConnectionOpenTry) (*MsgConnectionOpenTryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenTry not implemented") +} +func (*UnimplementedMsgServer) ConnectionOpenAck(ctx context.Context, req *MsgConnectionOpenAck) (*MsgConnectionOpenAckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenAck not implemented") +} +func (*UnimplementedMsgServer) ConnectionOpenConfirm(ctx context.Context, req *MsgConnectionOpenConfirm) (*MsgConnectionOpenConfirmResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenConfirm not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_ConnectionOpenInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenInit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenInit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenInit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenInit(ctx, req.(*MsgConnectionOpenInit)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConnectionOpenTry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenTry) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenTry(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenTry", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenTry(ctx, req.(*MsgConnectionOpenTry)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConnectionOpenAck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenAck) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenAck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenAck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenAck(ctx, req.(*MsgConnectionOpenAck)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConnectionOpenConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenConfirm) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenConfirm(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenConfirm(ctx, req.(*MsgConnectionOpenConfirm)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.core.connection.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ConnectionOpenInit", + Handler: _Msg_ConnectionOpenInit_Handler, + }, + { + MethodName: "ConnectionOpenTry", + Handler: _Msg_ConnectionOpenTry_Handler, + }, + { + MethodName: "ConnectionOpenAck", + Handler: _Msg_ConnectionOpenAck_Handler, + }, + { + MethodName: "ConnectionOpenConfirm", + Handler: _Msg_ConnectionOpenConfirm_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/core/connection/v1/connection.proto", } func (m *MsgConnectionOpenInit) Marshal() (dAtA []byte, err error) { @@ -694,6 +1054,29 @@ func (m *MsgConnectionOpenInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgConnectionOpenInitResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConnectionOpenInitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgConnectionOpenTry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -817,6 +1200,29 @@ func (m *MsgConnectionOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgConnectionOpenTryResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConnectionOpenTryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenTryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgConnectionOpenAck) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -921,6 +1327,29 @@ func (m *MsgConnectionOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgConnectionOpenAckResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConnectionOpenAckResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenAckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgConnectionOpenConfirm) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -975,6 +1404,29 @@ func (m *MsgConnectionOpenConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *MsgConnectionOpenConfirmResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConnectionOpenConfirmResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *ConnectionEnd) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1285,6 +1737,15 @@ func (m *MsgConnectionOpenInit) Size() (n int) { return n } +func (m *MsgConnectionOpenInitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgConnectionOpenTry) Size() (n int) { if m == nil { return 0 @@ -1338,6 +1799,15 @@ func (m *MsgConnectionOpenTry) Size() (n int) { return n } +func (m *MsgConnectionOpenTryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgConnectionOpenAck) Size() (n int) { if m == nil { return 0 @@ -1383,6 +1853,15 @@ func (m *MsgConnectionOpenAck) Size() (n int) { return n } +func (m *MsgConnectionOpenAckResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgConnectionOpenConfirm) Size() (n int) { if m == nil { return 0 @@ -1406,6 +1885,15 @@ func (m *MsgConnectionOpenConfirm) Size() (n int) { return n } +func (m *MsgConnectionOpenConfirmResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *ConnectionEnd) Size() (n int) { if m == nil { return 0 @@ -1750,6 +2238,59 @@ func (m *MsgConnectionOpenInit) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgConnectionOpenInitResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConnection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConnectionOpenInitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipConnection(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgConnectionOpenTry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2200,6 +2741,59 @@ func (m *MsgConnectionOpenTry) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgConnectionOpenTryResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConnection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConnectionOpenTryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenTryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipConnection(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgConnectionOpenAck) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2585,6 +3179,59 @@ func (m *MsgConnectionOpenAck) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgConnectionOpenAckResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConnection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConnectionOpenAckResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenAckResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipConnection(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgConnectionOpenConfirm) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2769,6 +3416,59 @@ func (m *MsgConnectionOpenConfirm) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgConnectionOpenConfirmResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConnection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConnectionOpenConfirmResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipConnection(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ConnectionEnd) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ibc/core/04-channel/types/channel.pb.go b/x/ibc/core/04-channel/types/channel.pb.go index dc69ed0b5f..e06a7ed7ec 100644 --- a/x/ibc/core/04-channel/types/channel.pb.go +++ b/x/ibc/core/04-channel/types/channel.pb.go @@ -4,10 +4,15 @@ package types import ( + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" + grpc1 "github.com/gogo/protobuf/grpc" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -142,7 +147,44 @@ func (m *MsgChannelOpenInit) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelOpenInit proto.InternalMessageInfo -// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +type MsgChannelOpenInitResponse struct { +} + +func (m *MsgChannelOpenInitResponse) Reset() { *m = MsgChannelOpenInitResponse{} } +func (m *MsgChannelOpenInitResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenInitResponse) ProtoMessage() {} +func (*MsgChannelOpenInitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{1} +} +func (m *MsgChannelOpenInitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenInitResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelOpenInitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenInitResponse.Merge(m, src) +} +func (m *MsgChannelOpenInitResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenInitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenInitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenInitResponse proto.InternalMessageInfo + +// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel // on Chain B. type MsgChannelOpenTry struct { PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` @@ -159,7 +201,7 @@ func (m *MsgChannelOpenTry) Reset() { *m = MsgChannelOpenTry{} } func (m *MsgChannelOpenTry) String() string { return proto.CompactTextString(m) } func (*MsgChannelOpenTry) ProtoMessage() {} func (*MsgChannelOpenTry) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{1} + return fileDescriptor_c3a07336710636a0, []int{2} } func (m *MsgChannelOpenTry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -188,6 +230,43 @@ func (m *MsgChannelOpenTry) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelOpenTry proto.InternalMessageInfo +// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +type MsgChannelOpenTryResponse struct { +} + +func (m *MsgChannelOpenTryResponse) Reset() { *m = MsgChannelOpenTryResponse{} } +func (m *MsgChannelOpenTryResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenTryResponse) ProtoMessage() {} +func (*MsgChannelOpenTryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{3} +} +func (m *MsgChannelOpenTryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenTryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenTryResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelOpenTryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenTryResponse.Merge(m, src) +} +func (m *MsgChannelOpenTryResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenTryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenTryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenTryResponse proto.InternalMessageInfo + // MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge // the change of channel state to TRYOPEN on Chain B. type MsgChannelOpenAck struct { @@ -204,7 +283,7 @@ func (m *MsgChannelOpenAck) Reset() { *m = MsgChannelOpenAck{} } func (m *MsgChannelOpenAck) String() string { return proto.CompactTextString(m) } func (*MsgChannelOpenAck) ProtoMessage() {} func (*MsgChannelOpenAck) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{2} + return fileDescriptor_c3a07336710636a0, []int{4} } func (m *MsgChannelOpenAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -233,6 +312,43 @@ func (m *MsgChannelOpenAck) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelOpenAck proto.InternalMessageInfo +// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. +type MsgChannelOpenAckResponse struct { +} + +func (m *MsgChannelOpenAckResponse) Reset() { *m = MsgChannelOpenAckResponse{} } +func (m *MsgChannelOpenAckResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenAckResponse) ProtoMessage() {} +func (*MsgChannelOpenAckResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{5} +} +func (m *MsgChannelOpenAckResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenAckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenAckResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelOpenAckResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenAckResponse.Merge(m, src) +} +func (m *MsgChannelOpenAckResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenAckResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenAckResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenAckResponse proto.InternalMessageInfo + // MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of channel state to OPEN on Chain A. type MsgChannelOpenConfirm struct { @@ -247,7 +363,7 @@ func (m *MsgChannelOpenConfirm) Reset() { *m = MsgChannelOpenConfirm{} } func (m *MsgChannelOpenConfirm) String() string { return proto.CompactTextString(m) } func (*MsgChannelOpenConfirm) ProtoMessage() {} func (*MsgChannelOpenConfirm) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{3} + return fileDescriptor_c3a07336710636a0, []int{6} } func (m *MsgChannelOpenConfirm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -276,6 +392,43 @@ func (m *MsgChannelOpenConfirm) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelOpenConfirm proto.InternalMessageInfo +// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response type. +type MsgChannelOpenConfirmResponse struct { +} + +func (m *MsgChannelOpenConfirmResponse) Reset() { *m = MsgChannelOpenConfirmResponse{} } +func (m *MsgChannelOpenConfirmResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenConfirmResponse) ProtoMessage() {} +func (*MsgChannelOpenConfirmResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{7} +} +func (m *MsgChannelOpenConfirmResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenConfirmResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelOpenConfirmResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenConfirmResponse.Merge(m, src) +} +func (m *MsgChannelOpenConfirmResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenConfirmResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenConfirmResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenConfirmResponse proto.InternalMessageInfo + // MsgChannelCloseInit defines a msg sent by a Relayer to Chain A // to close a channel with Chain B. type MsgChannelCloseInit struct { @@ -288,7 +441,7 @@ func (m *MsgChannelCloseInit) Reset() { *m = MsgChannelCloseInit{} } func (m *MsgChannelCloseInit) String() string { return proto.CompactTextString(m) } func (*MsgChannelCloseInit) ProtoMessage() {} func (*MsgChannelCloseInit) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{4} + return fileDescriptor_c3a07336710636a0, []int{8} } func (m *MsgChannelCloseInit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -317,6 +470,43 @@ func (m *MsgChannelCloseInit) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelCloseInit proto.InternalMessageInfo +// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +type MsgChannelCloseInitResponse struct { +} + +func (m *MsgChannelCloseInitResponse) Reset() { *m = MsgChannelCloseInitResponse{} } +func (m *MsgChannelCloseInitResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelCloseInitResponse) ProtoMessage() {} +func (*MsgChannelCloseInitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{9} +} +func (m *MsgChannelCloseInitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelCloseInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelCloseInitResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelCloseInitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelCloseInitResponse.Merge(m, src) +} +func (m *MsgChannelCloseInitResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelCloseInitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelCloseInitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelCloseInitResponse proto.InternalMessageInfo + // MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B // to acknowledge the change of channel state to CLOSED on Chain A. type MsgChannelCloseConfirm struct { @@ -331,7 +521,7 @@ func (m *MsgChannelCloseConfirm) Reset() { *m = MsgChannelCloseConfirm{} func (m *MsgChannelCloseConfirm) String() string { return proto.CompactTextString(m) } func (*MsgChannelCloseConfirm) ProtoMessage() {} func (*MsgChannelCloseConfirm) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{5} + return fileDescriptor_c3a07336710636a0, []int{10} } func (m *MsgChannelCloseConfirm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -360,6 +550,43 @@ func (m *MsgChannelCloseConfirm) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelCloseConfirm proto.InternalMessageInfo +// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response type. +type MsgChannelCloseConfirmResponse struct { +} + +func (m *MsgChannelCloseConfirmResponse) Reset() { *m = MsgChannelCloseConfirmResponse{} } +func (m *MsgChannelCloseConfirmResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelCloseConfirmResponse) ProtoMessage() {} +func (*MsgChannelCloseConfirmResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{11} +} +func (m *MsgChannelCloseConfirmResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelCloseConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelCloseConfirmResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelCloseConfirmResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelCloseConfirmResponse.Merge(m, src) +} +func (m *MsgChannelCloseConfirmResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelCloseConfirmResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelCloseConfirmResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelCloseConfirmResponse proto.InternalMessageInfo + // MsgRecvPacket receives incoming IBC packet type MsgRecvPacket struct { Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` @@ -372,7 +599,7 @@ func (m *MsgRecvPacket) Reset() { *m = MsgRecvPacket{} } func (m *MsgRecvPacket) String() string { return proto.CompactTextString(m) } func (*MsgRecvPacket) ProtoMessage() {} func (*MsgRecvPacket) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{6} + return fileDescriptor_c3a07336710636a0, []int{12} } func (m *MsgRecvPacket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -401,6 +628,43 @@ func (m *MsgRecvPacket) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRecvPacket proto.InternalMessageInfo +// MsgRecvPacketResponse defines the Msg/RecvPacket response type. +type MsgRecvPacketResponse struct { +} + +func (m *MsgRecvPacketResponse) Reset() { *m = MsgRecvPacketResponse{} } +func (m *MsgRecvPacketResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRecvPacketResponse) ProtoMessage() {} +func (*MsgRecvPacketResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{13} +} +func (m *MsgRecvPacketResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRecvPacketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRecvPacketResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRecvPacketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRecvPacketResponse.Merge(m, src) +} +func (m *MsgRecvPacketResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRecvPacketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRecvPacketResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRecvPacketResponse proto.InternalMessageInfo + // MsgTimeout receives timed-out packet type MsgTimeout struct { Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` @@ -414,7 +678,7 @@ func (m *MsgTimeout) Reset() { *m = MsgTimeout{} } func (m *MsgTimeout) String() string { return proto.CompactTextString(m) } func (*MsgTimeout) ProtoMessage() {} func (*MsgTimeout) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{7} + return fileDescriptor_c3a07336710636a0, []int{14} } func (m *MsgTimeout) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -443,6 +707,43 @@ func (m *MsgTimeout) XXX_DiscardUnknown() { var xxx_messageInfo_MsgTimeout proto.InternalMessageInfo +// MsgTimeoutResponse defines the Msg/Timeout response type. +type MsgTimeoutResponse struct { +} + +func (m *MsgTimeoutResponse) Reset() { *m = MsgTimeoutResponse{} } +func (m *MsgTimeoutResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTimeoutResponse) ProtoMessage() {} +func (*MsgTimeoutResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{15} +} +func (m *MsgTimeoutResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTimeoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTimeoutResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgTimeoutResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTimeoutResponse.Merge(m, src) +} +func (m *MsgTimeoutResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTimeoutResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTimeoutResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTimeoutResponse proto.InternalMessageInfo + // MsgTimeoutOnClose timed-out packet upon counterparty channel closure. type MsgTimeoutOnClose struct { Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` @@ -457,7 +758,7 @@ func (m *MsgTimeoutOnClose) Reset() { *m = MsgTimeoutOnClose{} } func (m *MsgTimeoutOnClose) String() string { return proto.CompactTextString(m) } func (*MsgTimeoutOnClose) ProtoMessage() {} func (*MsgTimeoutOnClose) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{8} + return fileDescriptor_c3a07336710636a0, []int{16} } func (m *MsgTimeoutOnClose) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -486,6 +787,43 @@ func (m *MsgTimeoutOnClose) XXX_DiscardUnknown() { var xxx_messageInfo_MsgTimeoutOnClose proto.InternalMessageInfo +// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. +type MsgTimeoutOnCloseResponse struct { +} + +func (m *MsgTimeoutOnCloseResponse) Reset() { *m = MsgTimeoutOnCloseResponse{} } +func (m *MsgTimeoutOnCloseResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTimeoutOnCloseResponse) ProtoMessage() {} +func (*MsgTimeoutOnCloseResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{17} +} +func (m *MsgTimeoutOnCloseResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTimeoutOnCloseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTimeoutOnCloseResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgTimeoutOnCloseResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTimeoutOnCloseResponse.Merge(m, src) +} +func (m *MsgTimeoutOnCloseResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTimeoutOnCloseResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTimeoutOnCloseResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTimeoutOnCloseResponse proto.InternalMessageInfo + // MsgAcknowledgement receives incoming IBC acknowledgement type MsgAcknowledgement struct { Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` @@ -499,7 +837,7 @@ func (m *MsgAcknowledgement) Reset() { *m = MsgAcknowledgement{} } func (m *MsgAcknowledgement) String() string { return proto.CompactTextString(m) } func (*MsgAcknowledgement) ProtoMessage() {} func (*MsgAcknowledgement) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{9} + return fileDescriptor_c3a07336710636a0, []int{18} } func (m *MsgAcknowledgement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -528,6 +866,43 @@ func (m *MsgAcknowledgement) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAcknowledgement proto.InternalMessageInfo +// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +type MsgAcknowledgementResponse struct { +} + +func (m *MsgAcknowledgementResponse) Reset() { *m = MsgAcknowledgementResponse{} } +func (m *MsgAcknowledgementResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAcknowledgementResponse) ProtoMessage() {} +func (*MsgAcknowledgementResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{19} +} +func (m *MsgAcknowledgementResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAcknowledgementResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAcknowledgementResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAcknowledgementResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAcknowledgementResponse.Merge(m, src) +} +func (m *MsgAcknowledgementResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAcknowledgementResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAcknowledgementResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAcknowledgementResponse proto.InternalMessageInfo + // Channel defines pipeline for exactly-once packet delivery between specific // modules on separate blockchains, which has at least one end capable of // sending packets and one end capable of receiving packets. @@ -549,7 +924,7 @@ func (m *Channel) Reset() { *m = Channel{} } func (m *Channel) String() string { return proto.CompactTextString(m) } func (*Channel) ProtoMessage() {} func (*Channel) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{10} + return fileDescriptor_c3a07336710636a0, []int{20} } func (m *Channel) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -602,7 +977,7 @@ func (m *IdentifiedChannel) Reset() { *m = IdentifiedChannel{} } func (m *IdentifiedChannel) String() string { return proto.CompactTextString(m) } func (*IdentifiedChannel) ProtoMessage() {} func (*IdentifiedChannel) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{11} + return fileDescriptor_c3a07336710636a0, []int{21} } func (m *IdentifiedChannel) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -643,7 +1018,7 @@ func (m *Counterparty) Reset() { *m = Counterparty{} } func (m *Counterparty) String() string { return proto.CompactTextString(m) } func (*Counterparty) ProtoMessage() {} func (*Counterparty) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{12} + return fileDescriptor_c3a07336710636a0, []int{22} } func (m *Counterparty) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -698,7 +1073,7 @@ func (m *Packet) Reset() { *m = Packet{} } func (m *Packet) String() string { return proto.CompactTextString(m) } func (*Packet) ProtoMessage() {} func (*Packet) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{13} + return fileDescriptor_c3a07336710636a0, []int{23} } func (m *Packet) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -744,7 +1119,7 @@ func (m *PacketAckCommitment) Reset() { *m = PacketAckCommitment{} } func (m *PacketAckCommitment) String() string { return proto.CompactTextString(m) } func (*PacketAckCommitment) ProtoMessage() {} func (*PacketAckCommitment) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{14} + return fileDescriptor_c3a07336710636a0, []int{24} } func (m *PacketAckCommitment) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -793,7 +1168,7 @@ func (m *Acknowledgement) Reset() { *m = Acknowledgement{} } func (m *Acknowledgement) String() string { return proto.CompactTextString(m) } func (*Acknowledgement) ProtoMessage() {} func (*Acknowledgement) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{15} + return fileDescriptor_c3a07336710636a0, []int{25} } func (m *Acknowledgement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -871,15 +1246,25 @@ func init() { proto.RegisterEnum("ibc.core.channel.v1.State", State_name, State_value) proto.RegisterEnum("ibc.core.channel.v1.Order", Order_name, Order_value) proto.RegisterType((*MsgChannelOpenInit)(nil), "ibc.core.channel.v1.MsgChannelOpenInit") + proto.RegisterType((*MsgChannelOpenInitResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenInitResponse") proto.RegisterType((*MsgChannelOpenTry)(nil), "ibc.core.channel.v1.MsgChannelOpenTry") + proto.RegisterType((*MsgChannelOpenTryResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenTryResponse") proto.RegisterType((*MsgChannelOpenAck)(nil), "ibc.core.channel.v1.MsgChannelOpenAck") + proto.RegisterType((*MsgChannelOpenAckResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenAckResponse") proto.RegisterType((*MsgChannelOpenConfirm)(nil), "ibc.core.channel.v1.MsgChannelOpenConfirm") + proto.RegisterType((*MsgChannelOpenConfirmResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenConfirmResponse") proto.RegisterType((*MsgChannelCloseInit)(nil), "ibc.core.channel.v1.MsgChannelCloseInit") + proto.RegisterType((*MsgChannelCloseInitResponse)(nil), "ibc.core.channel.v1.MsgChannelCloseInitResponse") proto.RegisterType((*MsgChannelCloseConfirm)(nil), "ibc.core.channel.v1.MsgChannelCloseConfirm") + proto.RegisterType((*MsgChannelCloseConfirmResponse)(nil), "ibc.core.channel.v1.MsgChannelCloseConfirmResponse") proto.RegisterType((*MsgRecvPacket)(nil), "ibc.core.channel.v1.MsgRecvPacket") + proto.RegisterType((*MsgRecvPacketResponse)(nil), "ibc.core.channel.v1.MsgRecvPacketResponse") proto.RegisterType((*MsgTimeout)(nil), "ibc.core.channel.v1.MsgTimeout") + proto.RegisterType((*MsgTimeoutResponse)(nil), "ibc.core.channel.v1.MsgTimeoutResponse") proto.RegisterType((*MsgTimeoutOnClose)(nil), "ibc.core.channel.v1.MsgTimeoutOnClose") + proto.RegisterType((*MsgTimeoutOnCloseResponse)(nil), "ibc.core.channel.v1.MsgTimeoutOnCloseResponse") proto.RegisterType((*MsgAcknowledgement)(nil), "ibc.core.channel.v1.MsgAcknowledgement") + proto.RegisterType((*MsgAcknowledgementResponse)(nil), "ibc.core.channel.v1.MsgAcknowledgementResponse") proto.RegisterType((*Channel)(nil), "ibc.core.channel.v1.Channel") proto.RegisterType((*IdentifiedChannel)(nil), "ibc.core.channel.v1.IdentifiedChannel") proto.RegisterType((*Counterparty)(nil), "ibc.core.channel.v1.Counterparty") @@ -891,99 +1276,538 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v1/channel.proto", fileDescriptor_c3a07336710636a0) } var fileDescriptor_c3a07336710636a0 = []byte{ - // 1465 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcf, 0x6b, 0x1b, 0xc7, - 0x17, 0xd7, 0x4a, 0x2b, 0xd9, 0x7e, 0x96, 0x6d, 0x79, 0xfc, 0x23, 0x8a, 0x9c, 0x68, 0x95, 0xe5, - 0xfb, 0x05, 0x37, 0x25, 0x76, 0x9c, 0x86, 0xfe, 0x08, 0x3d, 0xd4, 0x92, 0x15, 0x2c, 0x92, 0x48, - 0x66, 0xac, 0x14, 0xea, 0x8b, 0x2a, 0xaf, 0x26, 0xd2, 0x22, 0x6b, 0x47, 0xdd, 0x5d, 0x3b, 0xf1, - 0x7f, 0x10, 0x0c, 0x85, 0x9e, 0x0b, 0x86, 0x40, 0x29, 0x14, 0x0a, 0xed, 0xb1, 0x7f, 0x40, 0x2f, - 0x39, 0xe6, 0x96, 0x9e, 0x96, 0x92, 0x1c, 0x9a, 0xf3, 0xfe, 0x03, 0x2d, 0x3b, 0x33, 0x2b, 0xed, - 0xca, 0x52, 0x48, 0x9a, 0x5a, 0x50, 0xe8, 0x69, 0xe7, 0xbd, 0xf7, 0x99, 0x99, 0xf7, 0x3e, 0xef, - 0xcd, 0xaf, 0x85, 0x2b, 0xfa, 0xbe, 0xb6, 0xae, 0x51, 0x93, 0xac, 0x6b, 0xad, 0xba, 0x61, 0x90, - 0x83, 0xf5, 0xa3, 0x0d, 0xbf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0x85, 0xde, 0x5b, 0x38, 0x84, 0x50, 0xf1, 0x5c, 0x40, 0xc5, 0x3c, 0xa9, 0xc0, 0x42, 0x10, - 0xe5, 0xbb, 0xc3, 0x5f, 0x96, 0x59, 0xd7, 0x51, 0x32, 0x67, 0x87, 0xea, 0xf9, 0x84, 0x02, 0x5a, - 0xdf, 0x31, 0x04, 0x72, 0xa3, 0x6e, 0xd7, 0xf9, 0x8b, 0x12, 0xb3, 0x36, 0xfa, 0x12, 0x66, 0x6d, - 0x7e, 0xa0, 0xbd, 0xf9, 0xbb, 0xf1, 0xb2, 0xd8, 0xd9, 0x04, 0x1d, 0xe1, 0xfe, 0x2a, 0x9e, 0x11, - 0x0a, 0xb1, 0xbb, 0x95, 0x60, 0xde, 0x47, 0x78, 0x5f, 0xcb, 0xae, 0x77, 0xba, 0xec, 0x19, 0x29, - 0xe7, 0x2f, 0xb9, 0x8e, 0x92, 0x0e, 0x0f, 0xd2, 0x83, 0xa8, 0x38, 0x25, 0x74, 0x55, 0x5f, 0x25, - 0x2a, 0xe0, 0x27, 0x09, 0x16, 0x78, 0x05, 0x6c, 0x6a, 0xed, 0x02, 0xed, 0x74, 0x74, 0x9b, 0x6d, - 0xdc, 0x63, 0xb8, 0xc2, 0x06, 0x2b, 0x2e, 0x36, 0x50, 0x71, 0x08, 0xe4, 0x56, 0xdd, 0x6a, 0xb1, - 0x54, 0x27, 0x31, 0x6b, 0x0b, 0x87, 0x2b, 0x30, 0x37, 0x78, 0x92, 0xa5, 0x21, 0x61, 0x12, 0xeb, - 0xf0, 0xc0, 0x4e, 0x2f, 0x79, 0xf0, 0xed, 0x08, 0x16, 0x32, 0x5a, 0x86, 0x38, 0x31, 0x4d, 0x6a, - 0xa6, 0x97, 0x3d, 0x9f, 0xb6, 0x23, 0x98, 0x8b, 0x79, 0x80, 0x49, 0x93, 0x58, 0x5d, 0x6a, 0x58, - 0xe4, 0xea, 0x2f, 0x12, 0xc4, 0x77, 0xc5, 0x46, 0xa5, 0x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0xf7, 0x71, 0x53, 0xb7, 0x5b, 0x87, 0xfb, 0x6b, 0x1a, 0xed, 0xac, 0x6b, 0xd4, 0xea, 0x50, 0x4b, - 0x7c, 0xae, 0x59, 0x8d, 0xf6, 0xfa, 0xa3, 0xf5, 0xde, 0x9f, 0xc1, 0xeb, 0x37, 0xaf, 0xf9, 0xbf, - 0x1a, 0xed, 0xe3, 0x2e, 0xb1, 0xf6, 0x13, 0xec, 0xd7, 0xe0, 0x07, 0x7f, 0x05, 0x00, 0x00, 0xff, - 0xff, 0x7f, 0x85, 0xc2, 0xbb, 0x8b, 0x14, 0x00, 0x00, + // 1708 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xcd, 0x6f, 0xdb, 0xc8, + 0x15, 0xd7, 0x07, 0xf5, 0xe1, 0x17, 0xd9, 0x96, 0xc7, 0x1f, 0x51, 0xe8, 0x58, 0xd4, 0x12, 0xed, + 0xae, 0x9b, 0x62, 0xa5, 0x24, 0xbb, 0xe8, 0x47, 0xd0, 0x43, 0x2d, 0x59, 0x8b, 0x08, 0xd9, 0x58, + 0xc6, 0x58, 0x29, 0x50, 0xa3, 0x80, 0x2a, 0x53, 0x13, 0x89, 0x90, 0x45, 0xaa, 0x24, 0x6d, 0xaf, + 0xff, 0x83, 0x85, 0x81, 0x02, 0x3d, 0x17, 0x30, 0xb0, 0x40, 0x51, 0xa0, 0x40, 0x81, 0xee, 0xb1, + 0x7f, 0x40, 0x2f, 0x7b, 0xdc, 0xdb, 0xf6, 0x44, 0x14, 0xc9, 0xa1, 0x39, 0xeb, 0x1f, 0x68, 0xc1, + 0x99, 0x21, 0x45, 0x52, 0x54, 0xac, 0x34, 0xb5, 0x80, 0x02, 0x3d, 0x89, 0xf3, 0xde, 0x6f, 0xde, + 0xbc, 0xf9, 0xbd, 0xc7, 0x37, 0xf3, 0x28, 0xf8, 0x40, 0x3d, 0x51, 0x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 0x94, 0x74, 0x7b, 0x64, 0x48, 0xb4, 0xf7, 0x4a, 0xe8, 0x5d, 0x58, 0xed, 0x04, 0xad, 0xf1, 0x90, + 0x84, 0xc5, 0x93, 0x90, 0x25, 0xdf, 0x96, 0xfa, 0x8b, 0x2d, 0x7a, 0xac, 0x53, 0x09, 0xd1, 0xe1, + 0xb1, 0xf5, 0xc7, 0x04, 0x64, 0x78, 0x41, 0x44, 0x0f, 0x21, 0x65, 0x5a, 0x1d, 0x8b, 0x50, 0x86, + 0x56, 0x02, 0x0e, 0x4e, 0x18, 0x3a, 0x72, 0x10, 0x98, 0x01, 0xd1, 0x8f, 0x20, 0xab, 0x1b, 0x5d, + 0x62, 0xa8, 0x5a, 0x8f, 0x52, 0x32, 0x6b, 0x52, 0xd3, 0x01, 0x61, 0x0f, 0x8b, 0x9e, 0x41, 0xce, + 0x7f, 0x55, 0xe3, 0xc5, 0xe0, 0x83, 0xe8, 0x26, 0xc1, 0x07, 0xe4, 0x81, 0x09, 0x4c, 0x46, 0x35, + 0x58, 0x55, 0x74, 0x4d, 0x23, 0x8a, 0xa5, 0xea, 0x5a, 0xbb, 0xaf, 0x8f, 0xcc, 0x82, 0x50, 0x4a, + 0xee, 0x2e, 0x55, 0xc5, 0xb1, 0x2d, 0x6d, 0xb9, 0xf7, 0xc5, 0x00, 0x40, 0xc6, 0x2b, 0x13, 0xc9, + 0x53, 0x7d, 0x64, 0xa2, 0x02, 0x64, 0x02, 0x6d, 0x06, 0x76, 0x87, 0x4f, 0x04, 0x87, 0x49, 0xf9, + 0x9f, 0x09, 0x58, 0x6b, 0x74, 0x89, 0x66, 0xa9, 0x2f, 0x55, 0xaf, 0xb3, 0xfa, 0x3f, 0x63, 0x51, + 0x8c, 0xa1, 0xbb, 0x93, 0xdb, 0x07, 0x7f, 0x83, 0xf9, 0x4d, 0x63, 0x27, 0x70, 0xd3, 0x60, 0xf7, + 0xdf, 0xc9, 0x95, 0x82, 0x33, 0x7d, 0x01, 0x39, 0x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eb, 0x47, 0x90, 0x71, 0x5b, 0x47, + 0x69, 0xd6, 0x34, 0x0e, 0x10, 0x3f, 0xba, 0x01, 0xe0, 0xcf, 0xbd, 0x50, 0x3b, 0xf5, 0xe1, 0x0d, + 0x53, 0x39, 0x6e, 0x76, 0xee, 0x45, 0x37, 0x0d, 0xce, 0xcb, 0x1b, 0x2e, 0xa4, 0x33, 0xbd, 0x0c, + 0x01, 0x67, 0xbf, 0xbc, 0x33, 0xee, 0xdc, 0x55, 0xfc, 0xcd, 0xab, 0x62, 0xfc, 0xdb, 0x57, 0xc5, + 0xf8, 0x3f, 0x5e, 0x15, 0xe3, 0xbf, 0x7b, 0x5d, 0x8c, 0x7d, 0xfb, 0xba, 0x18, 0xfb, 0xfb, 0xeb, + 0x62, 0xec, 0xf8, 0x27, 0x3d, 0xd5, 0xea, 0x9f, 0x9d, 0x94, 0x15, 0x7d, 0x58, 0x51, 0x74, 0x73, + 0xa8, 0x9b, 0xfc, 0xe7, 0x63, 0xb3, 0x3b, 0xa8, 0x7c, 0x51, 0xf1, 0xfe, 0x6f, 0x79, 0xf8, 0xe9, + 0xc7, 0xee, 0x1f, 0x38, 0xd6, 0xe5, 0x88, 0x98, 0x27, 0x69, 0xfa, 0x87, 0xcb, 0x27, 0xff, 0x0e, + 0x00, 0x00, 0xff, 0xff, 0xdf, 0x36, 0x4a, 0x13, 0xe1, 0x19, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + ChannelOpenInit(ctx context.Context, in *MsgChannelOpenInit, opts ...grpc.CallOption) (*MsgChannelOpenInitResponse, error) + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + ChannelOpenTry(ctx context.Context, in *MsgChannelOpenTry, opts ...grpc.CallOption) (*MsgChannelOpenTryResponse, error) + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + ChannelOpenAck(ctx context.Context, in *MsgChannelOpenAck, opts ...grpc.CallOption) (*MsgChannelOpenAckResponse, error) + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + ChannelOpenConfirm(ctx context.Context, in *MsgChannelOpenConfirm, opts ...grpc.CallOption) (*MsgChannelOpenConfirmResponse, error) + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + ChannelCloseInit(ctx context.Context, in *MsgChannelCloseInit, opts ...grpc.CallOption) (*MsgChannelCloseInitResponse, error) + // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. + ChannelCloseConfirm(ctx context.Context, in *MsgChannelCloseConfirm, opts ...grpc.CallOption) (*MsgChannelCloseConfirmResponse, error) + // RecvPacket defines a rpc handler method for MsgRecvPacket. + RecvPacket(ctx context.Context, in *MsgRecvPacket, opts ...grpc.CallOption) (*MsgRecvPacketResponse, error) + // Timeout defines a rpc handler method for MsgTimeout. + Timeout(ctx context.Context, in *MsgTimeout, opts ...grpc.CallOption) (*MsgTimeoutResponse, error) + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + TimeoutOnClose(ctx context.Context, in *MsgTimeoutOnClose, opts ...grpc.CallOption) (*MsgTimeoutOnCloseResponse, error) + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + Acknowledgement(ctx context.Context, in *MsgAcknowledgement, opts ...grpc.CallOption) (*MsgAcknowledgementResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) ChannelOpenInit(ctx context.Context, in *MsgChannelOpenInit, opts ...grpc.CallOption) (*MsgChannelOpenInitResponse, error) { + out := new(MsgChannelOpenInitResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenInit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelOpenTry(ctx context.Context, in *MsgChannelOpenTry, opts ...grpc.CallOption) (*MsgChannelOpenTryResponse, error) { + out := new(MsgChannelOpenTryResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenTry", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelOpenAck(ctx context.Context, in *MsgChannelOpenAck, opts ...grpc.CallOption) (*MsgChannelOpenAckResponse, error) { + out := new(MsgChannelOpenAckResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenAck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelOpenConfirm(ctx context.Context, in *MsgChannelOpenConfirm, opts ...grpc.CallOption) (*MsgChannelOpenConfirmResponse, error) { + out := new(MsgChannelOpenConfirmResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenConfirm", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelCloseInit(ctx context.Context, in *MsgChannelCloseInit, opts ...grpc.CallOption) (*MsgChannelCloseInitResponse, error) { + out := new(MsgChannelCloseInitResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelCloseInit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelCloseConfirm(ctx context.Context, in *MsgChannelCloseConfirm, opts ...grpc.CallOption) (*MsgChannelCloseConfirmResponse, error) { + out := new(MsgChannelCloseConfirmResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelCloseConfirm", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RecvPacket(ctx context.Context, in *MsgRecvPacket, opts ...grpc.CallOption) (*MsgRecvPacketResponse, error) { + out := new(MsgRecvPacketResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/RecvPacket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Timeout(ctx context.Context, in *MsgTimeout, opts ...grpc.CallOption) (*MsgTimeoutResponse, error) { + out := new(MsgTimeoutResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/Timeout", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) TimeoutOnClose(ctx context.Context, in *MsgTimeoutOnClose, opts ...grpc.CallOption) (*MsgTimeoutOnCloseResponse, error) { + out := new(MsgTimeoutOnCloseResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/TimeoutOnClose", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Acknowledgement(ctx context.Context, in *MsgAcknowledgement, opts ...grpc.CallOption) (*MsgAcknowledgementResponse, error) { + out := new(MsgAcknowledgementResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/Acknowledgement", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + ChannelOpenInit(context.Context, *MsgChannelOpenInit) (*MsgChannelOpenInitResponse, error) + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + ChannelOpenTry(context.Context, *MsgChannelOpenTry) (*MsgChannelOpenTryResponse, error) + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + ChannelOpenAck(context.Context, *MsgChannelOpenAck) (*MsgChannelOpenAckResponse, error) + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + ChannelOpenConfirm(context.Context, *MsgChannelOpenConfirm) (*MsgChannelOpenConfirmResponse, error) + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + ChannelCloseInit(context.Context, *MsgChannelCloseInit) (*MsgChannelCloseInitResponse, error) + // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. + ChannelCloseConfirm(context.Context, *MsgChannelCloseConfirm) (*MsgChannelCloseConfirmResponse, error) + // RecvPacket defines a rpc handler method for MsgRecvPacket. + RecvPacket(context.Context, *MsgRecvPacket) (*MsgRecvPacketResponse, error) + // Timeout defines a rpc handler method for MsgTimeout. + Timeout(context.Context, *MsgTimeout) (*MsgTimeoutResponse, error) + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + TimeoutOnClose(context.Context, *MsgTimeoutOnClose) (*MsgTimeoutOnCloseResponse, error) + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + Acknowledgement(context.Context, *MsgAcknowledgement) (*MsgAcknowledgementResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) ChannelOpenInit(ctx context.Context, req *MsgChannelOpenInit) (*MsgChannelOpenInitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenInit not implemented") +} +func (*UnimplementedMsgServer) ChannelOpenTry(ctx context.Context, req *MsgChannelOpenTry) (*MsgChannelOpenTryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenTry not implemented") +} +func (*UnimplementedMsgServer) ChannelOpenAck(ctx context.Context, req *MsgChannelOpenAck) (*MsgChannelOpenAckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenAck not implemented") +} +func (*UnimplementedMsgServer) ChannelOpenConfirm(ctx context.Context, req *MsgChannelOpenConfirm) (*MsgChannelOpenConfirmResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenConfirm not implemented") +} +func (*UnimplementedMsgServer) ChannelCloseInit(ctx context.Context, req *MsgChannelCloseInit) (*MsgChannelCloseInitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelCloseInit not implemented") +} +func (*UnimplementedMsgServer) ChannelCloseConfirm(ctx context.Context, req *MsgChannelCloseConfirm) (*MsgChannelCloseConfirmResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelCloseConfirm not implemented") +} +func (*UnimplementedMsgServer) RecvPacket(ctx context.Context, req *MsgRecvPacket) (*MsgRecvPacketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecvPacket not implemented") +} +func (*UnimplementedMsgServer) Timeout(ctx context.Context, req *MsgTimeout) (*MsgTimeoutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Timeout not implemented") +} +func (*UnimplementedMsgServer) TimeoutOnClose(ctx context.Context, req *MsgTimeoutOnClose) (*MsgTimeoutOnCloseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TimeoutOnClose not implemented") +} +func (*UnimplementedMsgServer) Acknowledgement(ctx context.Context, req *MsgAcknowledgement) (*MsgAcknowledgementResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Acknowledgement not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_ChannelOpenInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenInit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenInit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenInit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenInit(ctx, req.(*MsgChannelOpenInit)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelOpenTry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenTry) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenTry(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenTry", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenTry(ctx, req.(*MsgChannelOpenTry)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelOpenAck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenAck) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenAck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenAck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenAck(ctx, req.(*MsgChannelOpenAck)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelOpenConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenConfirm) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenConfirm(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenConfirm", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenConfirm(ctx, req.(*MsgChannelOpenConfirm)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelCloseInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelCloseInit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelCloseInit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelCloseInit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelCloseInit(ctx, req.(*MsgChannelCloseInit)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelCloseConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelCloseConfirm) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelCloseConfirm(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelCloseConfirm", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelCloseConfirm(ctx, req.(*MsgChannelCloseConfirm)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RecvPacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRecvPacket) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RecvPacket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/RecvPacket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RecvPacket(ctx, req.(*MsgRecvPacket)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Timeout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTimeout) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Timeout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/Timeout", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Timeout(ctx, req.(*MsgTimeout)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_TimeoutOnClose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTimeoutOnClose) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).TimeoutOnClose(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/TimeoutOnClose", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).TimeoutOnClose(ctx, req.(*MsgTimeoutOnClose)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Acknowledgement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAcknowledgement) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Acknowledgement(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/Acknowledgement", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Acknowledgement(ctx, req.(*MsgAcknowledgement)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.core.channel.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ChannelOpenInit", + Handler: _Msg_ChannelOpenInit_Handler, + }, + { + MethodName: "ChannelOpenTry", + Handler: _Msg_ChannelOpenTry_Handler, + }, + { + MethodName: "ChannelOpenAck", + Handler: _Msg_ChannelOpenAck_Handler, + }, + { + MethodName: "ChannelOpenConfirm", + Handler: _Msg_ChannelOpenConfirm_Handler, + }, + { + MethodName: "ChannelCloseInit", + Handler: _Msg_ChannelCloseInit_Handler, + }, + { + MethodName: "ChannelCloseConfirm", + Handler: _Msg_ChannelCloseConfirm_Handler, + }, + { + MethodName: "RecvPacket", + Handler: _Msg_RecvPacket_Handler, + }, + { + MethodName: "Timeout", + Handler: _Msg_Timeout_Handler, + }, + { + MethodName: "TimeoutOnClose", + Handler: _Msg_TimeoutOnClose_Handler, + }, + { + MethodName: "Acknowledgement", + Handler: _Msg_Acknowledgement_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/core/channel/v1/channel.proto", } func (m *MsgChannelOpenInit) Marshal() (dAtA []byte, err error) { @@ -1040,6 +1864,29 @@ func (m *MsgChannelOpenInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelOpenInitResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelOpenInitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelOpenTry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1125,6 +1972,29 @@ func (m *MsgChannelOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelOpenTryResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelOpenTryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenTryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelOpenAck) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1200,6 +2070,29 @@ func (m *MsgChannelOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelOpenAckResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelOpenAckResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenAckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelOpenConfirm) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1261,6 +2154,29 @@ func (m *MsgChannelOpenConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelOpenConfirmResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelOpenConfirmResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelCloseInit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1305,6 +2221,29 @@ func (m *MsgChannelCloseInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelCloseInitResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelCloseInitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelCloseInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelCloseConfirm) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1366,6 +2305,29 @@ func (m *MsgChannelCloseConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgChannelCloseConfirmResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelCloseConfirmResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelCloseConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgRecvPacket) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1423,6 +2385,29 @@ func (m *MsgRecvPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgRecvPacketResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRecvPacketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRecvPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgTimeout) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1485,6 +2470,29 @@ func (m *MsgTimeout) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgTimeoutResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgTimeoutResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTimeoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgTimeoutOnClose) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1554,6 +2562,29 @@ func (m *MsgTimeoutOnClose) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgTimeoutOnCloseResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgTimeoutOnCloseResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTimeoutOnCloseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgAcknowledgement) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1618,6 +2649,29 @@ func (m *MsgAcknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgAcknowledgementResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAcknowledgementResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAcknowledgementResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *Channel) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2014,6 +3068,15 @@ func (m *MsgChannelOpenInit) Size() (n int) { return n } +func (m *MsgChannelOpenInitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelOpenTry) Size() (n int) { if m == nil { return 0 @@ -2051,6 +3114,15 @@ func (m *MsgChannelOpenTry) Size() (n int) { return n } +func (m *MsgChannelOpenTryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelOpenAck) Size() (n int) { if m == nil { return 0 @@ -2086,6 +3158,15 @@ func (m *MsgChannelOpenAck) Size() (n int) { return n } +func (m *MsgChannelOpenAckResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelOpenConfirm) Size() (n int) { if m == nil { return 0 @@ -2113,6 +3194,15 @@ func (m *MsgChannelOpenConfirm) Size() (n int) { return n } +func (m *MsgChannelOpenConfirmResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelCloseInit) Size() (n int) { if m == nil { return 0 @@ -2134,6 +3224,15 @@ func (m *MsgChannelCloseInit) Size() (n int) { return n } +func (m *MsgChannelCloseInitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelCloseConfirm) Size() (n int) { if m == nil { return 0 @@ -2161,6 +3260,15 @@ func (m *MsgChannelCloseConfirm) Size() (n int) { return n } +func (m *MsgChannelCloseConfirmResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgRecvPacket) Size() (n int) { if m == nil { return 0 @@ -2182,6 +3290,15 @@ func (m *MsgRecvPacket) Size() (n int) { return n } +func (m *MsgRecvPacketResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgTimeout) Size() (n int) { if m == nil { return 0 @@ -2206,6 +3323,15 @@ func (m *MsgTimeout) Size() (n int) { return n } +func (m *MsgTimeoutResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgTimeoutOnClose) Size() (n int) { if m == nil { return 0 @@ -2234,6 +3360,15 @@ func (m *MsgTimeoutOnClose) Size() (n int) { return n } +func (m *MsgTimeoutOnCloseResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgAcknowledgement) Size() (n int) { if m == nil { return 0 @@ -2259,6 +3394,15 @@ func (m *MsgAcknowledgement) Size() (n int) { return n } +func (m *MsgAcknowledgementResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *Channel) Size() (n int) { if m == nil { return 0 @@ -2622,6 +3766,59 @@ func (m *MsgChannelOpenInit) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelOpenInitResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelOpenInitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelOpenTry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2935,6 +4132,59 @@ func (m *MsgChannelOpenTry) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelOpenTryResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelOpenTryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenTryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelOpenAck) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3215,6 +4465,59 @@ func (m *MsgChannelOpenAck) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelOpenAckResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelOpenAckResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenAckResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelOpenConfirm) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3431,6 +4734,59 @@ func (m *MsgChannelOpenConfirm) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelOpenConfirmResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelOpenConfirmResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelCloseInit) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3580,6 +4936,59 @@ func (m *MsgChannelCloseInit) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelCloseInitResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelCloseInitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelCloseInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelCloseConfirm) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3796,6 +5205,59 @@ func (m *MsgChannelCloseConfirm) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelCloseConfirmResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelCloseConfirmResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelCloseConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgRecvPacket) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3981,6 +5443,59 @@ func (m *MsgRecvPacket) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgRecvPacketResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRecvPacketResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRecvPacketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgTimeout) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4185,6 +5700,59 @@ func (m *MsgTimeout) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgTimeoutResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTimeoutResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTimeoutResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgTimeoutOnClose) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4423,6 +5991,59 @@ func (m *MsgTimeoutOnClose) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgTimeoutOnCloseResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTimeoutOnCloseResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTimeoutOnCloseResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4642,6 +6263,59 @@ func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAcknowledgementResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAcknowledgementResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAcknowledgementResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Channel) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ibc/core/genesis_test.go b/x/ibc/core/genesis_test.go index ffc6912d20..6dc06a5de8 100644 --- a/x/ibc/core/genesis_test.go +++ b/x/ibc/core/genesis_test.go @@ -2,7 +2,9 @@ package ibc_test import ( "fmt" + "testing" + "github.com/stretchr/testify/suite" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" @@ -20,6 +22,42 @@ import ( ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" ) +const ( + connectionID = "connectionidone" + clientID = "clientidone" + connectionID2 = "connectionidtwo" + clientID2 = "clientidtwo" + + port1 = "firstport" + port2 = "secondport" + + channel1 = "firstchannel" + channel2 = "secondchannel" +) + +var clientHeight = clienttypes.NewHeight(0, 10) + +type IBCTestSuite struct { + suite.Suite + + coordinator *ibctesting.Coordinator + + chainA *ibctesting.TestChain + chainB *ibctesting.TestChain +} + +// SetupTest creates a coordinator with 2 test chains. +func (suite *IBCTestSuite) SetupTest() { + suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) + + suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0)) + suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(1)) +} + +func TestIBCTestSuite(t *testing.T) { + suite.Run(t, new(IBCTestSuite)) +} + func (suite *IBCTestSuite) TestValidateGenesis() { header := suite.chainA.CreateTMClientHeader(suite.chainA.ChainID, suite.chainA.CurrentHeader.Height, clienttypes.NewHeight(0, uint64(suite.chainA.CurrentHeader.Height-1)), suite.chainA.CurrentHeader.Time, suite.chainA.Vals, suite.chainA.Vals, suite.chainA.Signers) diff --git a/x/ibc/core/handler.go b/x/ibc/core/handler.go index 684a7c6a1c..d2ef7f7b61 100644 --- a/x/ibc/core/handler.go +++ b/x/ibc/core/handler.go @@ -1,18 +1,11 @@ package ibc import ( - "github.com/armon/go-metrics" - - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - client "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client" clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - connection "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection" connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types" - channel "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types" - porttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/05-port/types" "github.com/cosmos/cosmos-sdk/x/ibc/core/keeper" ) @@ -24,340 +17,75 @@ func NewHandler(k keeper.Keeper) sdk.Handler { switch msg := msg.(type) { // IBC client msg interface types case *clienttypes.MsgCreateClient: - return client.HandleMsgCreateClient(ctx, k.ClientKeeper, msg) + res, err := k.CreateClient(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *clienttypes.MsgUpdateClient: - return client.HandleMsgUpdateClient(ctx, k.ClientKeeper, msg) + res, err := k.UpdateClient(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *clienttypes.MsgSubmitMisbehaviour: - return client.HandleMsgSubmitMisbehaviour(ctx, k.ClientKeeper, msg) + res, err := k.SubmitMisbehaviour(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) // IBC connection msgs case *connectiontypes.MsgConnectionOpenInit: - return connection.HandleMsgConnectionOpenInit(ctx, k.ConnectionKeeper, msg) + res, err := k.ConnectionOpenInit(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *connectiontypes.MsgConnectionOpenTry: - return connection.HandleMsgConnectionOpenTry(ctx, k.ConnectionKeeper, msg) + res, err := k.ConnectionOpenTry(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *connectiontypes.MsgConnectionOpenAck: - return connection.HandleMsgConnectionOpenAck(ctx, k.ConnectionKeeper, msg) + res, err := k.ConnectionOpenAck(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *connectiontypes.MsgConnectionOpenConfirm: - return connection.HandleMsgConnectionOpenConfirm(ctx, k.ConnectionKeeper, msg) + res, err := k.ConnectionOpenConfirm(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) // IBC channel msgs case *channeltypes.MsgChannelOpenInit: - // Lookup module by port capability - module, portCap, err := k.PortKeeper.LookupModuleByPort(ctx, msg.PortId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - res, cap, err := channel.HandleMsgChannelOpenInit(ctx, k.ChannelKeeper, portCap, msg) - if err != nil { - return nil, err - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanOpenInit(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, msg.ChannelId, cap, msg.Channel.Counterparty, msg.Channel.Version); err != nil { - return nil, sdkerrors.Wrap(err, "channel open init callback failed") - } - - return res, nil + res, err := k.ChannelOpenInit(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelOpenTry: - // Lookup module by port capability - module, portCap, err := k.PortKeeper.LookupModuleByPort(ctx, msg.PortId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - res, cap, err := channel.HandleMsgChannelOpenTry(ctx, k.ChannelKeeper, portCap, msg) - if err != nil { - return nil, err - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanOpenTry(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, msg.DesiredChannelId, cap, msg.Channel.Counterparty, msg.Channel.Version, msg.CounterpartyVersion); err != nil { - return nil, sdkerrors.Wrap(err, "channel open try callback failed") - } - - return res, nil + res, err := k.ChannelOpenTry(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelOpenAck: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanOpenAck(ctx, msg.PortId, msg.ChannelId, msg.CounterpartyVersion); err != nil { - return nil, sdkerrors.Wrap(err, "channel open ack callback failed") - } - - return channel.HandleMsgChannelOpenAck(ctx, k.ChannelKeeper, cap, msg) + res, err := k.ChannelOpenAck(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelOpenConfirm: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanOpenConfirm(ctx, msg.PortId, msg.ChannelId); err != nil { - return nil, sdkerrors.Wrap(err, "channel open confirm callback failed") - } - - return channel.HandleMsgChannelOpenConfirm(ctx, k.ChannelKeeper, cap, msg) + res, err := k.ChannelOpenConfirm(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelCloseInit: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanCloseInit(ctx, msg.PortId, msg.ChannelId); err != nil { - return nil, sdkerrors.Wrap(err, "channel close init callback failed") - } - - return channel.HandleMsgChannelCloseInit(ctx, k.ChannelKeeper, cap, msg) + res, err := k.ChannelCloseInit(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelCloseConfirm: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanCloseConfirm(ctx, msg.PortId, msg.ChannelId); err != nil { - return nil, sdkerrors.Wrap(err, "channel close confirm callback failed") - } - - return channel.HandleMsgChannelCloseConfirm(ctx, k.ChannelKeeper, cap, msg) + res, err := k.ChannelCloseConfirm(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) // IBC packet msgs get routed to the appropriate module callback case *channeltypes.MsgRecvPacket: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.DestinationPort, msg.Packet.DestinationChannel) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - // Perform TAO verification - if err := k.ChannelKeeper.RecvPacket(ctx, msg.Packet, msg.Proof, msg.ProofHeight); err != nil { - return nil, sdkerrors.Wrap(err, "receive packet verification failed") - } - - // Perform application logic callback - res, ack, err := cbs.OnRecvPacket(ctx, msg.Packet) - if err != nil { - return nil, sdkerrors.Wrap(err, "receive packet callback failed") - } - - if err := k.ChannelKeeper.WriteReceipt(ctx, cap, msg.Packet); err != nil { - return nil, err - } - - // Set packet acknowledgement only if the acknowledgement is not nil. - // NOTE: IBC applications modules may call the WriteAcknowledgement asynchronously if the - // acknowledgement is nil. - if ack != nil { - if err := k.ChannelKeeper.WriteAcknowledgement(ctx, msg.Packet, ack); err != nil { - return nil, err - } - } - - defer func() { - telemetry.IncrCounterWithLabels( - []string{"tx", "msg", "ibc", msg.Type()}, - 1, - []metrics.Label{ - telemetry.NewLabel("source-port", msg.Packet.SourcePort), - telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), - telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), - telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), - }, - ) - }() - - return res, nil + res, err := k.RecvPacket(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgAcknowledgement: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - // Perform TAO verification - if err := k.ChannelKeeper.AcknowledgePacket(ctx, msg.Packet, msg.Acknowledgement, msg.Proof, msg.ProofHeight); err != nil { - return nil, sdkerrors.Wrap(err, "acknowledge packet verification failed") - } - - // Perform application logic callback - res, err := cbs.OnAcknowledgementPacket(ctx, msg.Packet, msg.Acknowledgement) - if err != nil { - return nil, sdkerrors.Wrap(err, "acknowledge packet callback failed") - } - - // Delete packet commitment - if err = k.ChannelKeeper.AcknowledgementExecuted(ctx, cap, msg.Packet); err != nil { - return nil, err - } - - defer func() { - telemetry.IncrCounterWithLabels( - []string{"tx", "msg", "ibc", msg.Type()}, - 1, - []metrics.Label{ - telemetry.NewLabel("source-port", msg.Packet.SourcePort), - telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), - telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), - telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), - }, - ) - }() - - return res, nil + res, err := k.Acknowledgement(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgTimeout: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - // Perform TAO verification - if err := k.ChannelKeeper.TimeoutPacket(ctx, msg.Packet, msg.Proof, msg.ProofHeight, msg.NextSequenceRecv); err != nil { - return nil, sdkerrors.Wrap(err, "timeout packet verification failed") - } - - // Perform application logic callback - res, err := cbs.OnTimeoutPacket(ctx, msg.Packet) - if err != nil { - return nil, sdkerrors.Wrap(err, "timeout packet callback failed") - } - - // Delete packet commitment - if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil { - return nil, err - } - - defer func() { - telemetry.IncrCounterWithLabels( - []string{"ibc", "timeout", "packet"}, - 1, - []metrics.Label{ - telemetry.NewLabel("source-port", msg.Packet.SourcePort), - telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), - telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), - telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), - telemetry.NewLabel("timeout-type", "height"), - }, - ) - }() - - return res, nil + res, err := k.Timeout(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgTimeoutOnClose: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - // Perform TAO verification - if err := k.ChannelKeeper.TimeoutOnClose(ctx, cap, msg.Packet, msg.Proof, msg.ProofClose, msg.ProofHeight, msg.NextSequenceRecv); err != nil { - return nil, sdkerrors.Wrap(err, "timeout on close packet verification failed") - } - - // Perform application logic callback - // NOTE: MsgTimeout and MsgTimeoutOnClose use the same "OnTimeoutPacket" - // application logic callback. - res, err := cbs.OnTimeoutPacket(ctx, msg.Packet) - if err != nil { - return nil, sdkerrors.Wrap(err, "timeout packet callback failed") - } - - // Delete packet commitment - if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil { - return nil, err - } - - defer func() { - telemetry.IncrCounterWithLabels( - []string{"ibc", "timeout", "packet"}, - 1, - []metrics.Label{ - telemetry.NewLabel("source-port", msg.Packet.SourcePort), - telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), - telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), - telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), - telemetry.NewLabel("timeout-type", "channel-closed"), - }, - ) - }() - - return res, nil + res, err := k.TimeoutOnClose(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized IBC message type: %T", msg) diff --git a/x/ibc/core/keeper/msg_server.go b/x/ibc/core/keeper/msg_server.go new file mode 100644 index 0000000000..15af734846 --- /dev/null +++ b/x/ibc/core/keeper/msg_server.go @@ -0,0 +1,622 @@ +package keeper + +import ( + "context" + + "github.com/armon/go-metrics" + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" + connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types" + channel "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel" + channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types" + porttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/05-port/types" +) + +var _ clienttypes.MsgServer = Keeper{} +var _ connectiontypes.MsgServer = Keeper{} +var _ channeltypes.MsgServer = Keeper{} + +// CreateClient defines a rpc handler method for MsgCreateClient. +func (k Keeper) CreateClient(goCtx context.Context, msg *clienttypes.MsgCreateClient) (*clienttypes.MsgCreateClientResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + clientState, err := clienttypes.UnpackClientState(msg.ClientState) + if err != nil { + return nil, err + } + + consensusState, err := clienttypes.UnpackConsensusState(msg.ConsensusState) + if err != nil { + return nil, err + } + + if err = k.ClientKeeper.CreateClient(ctx, msg.ClientId, clientState, consensusState); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + clienttypes.EventTypeCreateClient, + sdk.NewAttribute(clienttypes.AttributeKeyClientID, msg.ClientId), + sdk.NewAttribute(clienttypes.AttributeKeyClientType, clientState.ClientType()), + sdk.NewAttribute(clienttypes.AttributeKeyConsensusHeight, clientState.GetLatestHeight().String()), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, clienttypes.AttributeValueCategory), + ), + }) + + return &clienttypes.MsgCreateClientResponse{}, nil +} + +// UpdateClient defines a rpc handler method for MsgUpdateClient. +func (k Keeper) UpdateClient(goCtx context.Context, msg *clienttypes.MsgUpdateClient) (*clienttypes.MsgUpdateClientResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + header, err := clienttypes.UnpackHeader(msg.Header) + if err != nil { + return nil, err + } + + if err = k.ClientKeeper.UpdateClient(ctx, msg.ClientId, header); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, clienttypes.AttributeValueCategory), + ), + ) + + return &clienttypes.MsgUpdateClientResponse{}, nil +} + +// UpgradeClient defines a rpc handler method for MsgUpgradeClient. +func (k Keeper) UpgradeClient(goCtx context.Context, msg *clienttypes.MsgUpgradeClient) (*clienttypes.MsgUpgradeClientResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + upgradedClient, err := clienttypes.UnpackClientState(msg.ClientState) + if err != nil { + return nil, err + } + + if err := upgradedClient.Validate(); err != nil { + return nil, err + } + + if err = k.ClientKeeper.UpgradeClient(ctx, msg.ClientId, upgradedClient, msg.UpgradeHeight, msg.ProofUpgrade); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, clienttypes.AttributeValueCategory), + ), + ) + + return &clienttypes.MsgUpgradeClientResponse{}, nil +} + +// SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. +func (k Keeper) SubmitMisbehaviour(goCtx context.Context, msg *clienttypes.MsgSubmitMisbehaviour) (*clienttypes.MsgSubmitMisbehaviourResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + misbehaviour, err := clienttypes.UnpackMisbehaviour(msg.Misbehaviour) + if err != nil { + return nil, err + } + + if err := k.ClientKeeper.CheckMisbehaviourAndUpdateState(ctx, misbehaviour); err != nil { + return nil, sdkerrors.Wrap(err, "failed to process misbehaviour for IBC client") + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + clienttypes.EventTypeSubmitMisbehaviour, + sdk.NewAttribute(clienttypes.AttributeKeyClientID, msg.ClientId), + sdk.NewAttribute(clienttypes.AttributeKeyClientType, misbehaviour.ClientType()), + sdk.NewAttribute(clienttypes.AttributeKeyConsensusHeight, misbehaviour.GetHeight().String()), + ), + ) + + return &clienttypes.MsgSubmitMisbehaviourResponse{}, nil +} + +// ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. +func (k Keeper) ConnectionOpenInit(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenInit) (*connectiontypes.MsgConnectionOpenInitResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if err := k.ConnectionKeeper.ConnOpenInit( + ctx, msg.ConnectionId, msg.ClientId, msg.Counterparty, msg.Version, + ); err != nil { + return nil, sdkerrors.Wrap(err, "connection handshake open init failed") + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + connectiontypes.EventTypeConnectionOpenInit, + sdk.NewAttribute(connectiontypes.AttributeKeyConnectionID, msg.ConnectionId), + sdk.NewAttribute(connectiontypes.AttributeKeyClientID, msg.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyClientID, msg.Counterparty.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyConnectionID, msg.Counterparty.ConnectionId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, connectiontypes.AttributeValueCategory), + ), + }) + + return &connectiontypes.MsgConnectionOpenInitResponse{}, nil +} + +// ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. +func (k Keeper) ConnectionOpenTry(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenTry) (*connectiontypes.MsgConnectionOpenTryResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + targetClient, err := clienttypes.UnpackClientState(msg.ClientState) + if err != nil { + return nil, sdkerrors.Wrapf(err, "client in msg is not exported.ClientState. invalid client: %v.", targetClient) + } + + if err := k.ConnectionKeeper.ConnOpenTry( + ctx, msg.DesiredConnectionId, msg.CounterpartyChosenConnectionId, msg.Counterparty, msg.ClientId, targetClient, + msg.CounterpartyVersions, msg.ProofInit, msg.ProofClient, msg.ProofConsensus, + msg.ProofHeight, msg.ConsensusHeight, + ); err != nil { + return nil, sdkerrors.Wrap(err, "connection handshake open try failed") + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + connectiontypes.EventTypeConnectionOpenTry, + sdk.NewAttribute(connectiontypes.AttributeKeyConnectionID, msg.DesiredConnectionId), + sdk.NewAttribute(connectiontypes.AttributeKeyClientID, msg.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyClientID, msg.Counterparty.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyConnectionID, msg.Counterparty.ConnectionId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, connectiontypes.AttributeValueCategory), + ), + }) + + return &connectiontypes.MsgConnectionOpenTryResponse{}, nil +} + +// ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. +func (k Keeper) ConnectionOpenAck(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenAck) (*connectiontypes.MsgConnectionOpenAckResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + targetClient, err := clienttypes.UnpackClientState(msg.ClientState) + if err != nil { + return nil, sdkerrors.Wrapf(err, "client in msg is not exported.ClientState. invalid client: %v", targetClient) + } + + if err := k.ConnectionKeeper.ConnOpenAck( + ctx, msg.ConnectionId, targetClient, msg.Version, msg.CounterpartyConnectionId, + msg.ProofTry, msg.ProofClient, msg.ProofConsensus, + msg.ProofHeight, msg.ConsensusHeight, + ); err != nil { + return nil, sdkerrors.Wrap(err, "connection handshake open ack failed") + } + + connectionEnd, _ := k.ConnectionKeeper.GetConnection(ctx, msg.ConnectionId) + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + connectiontypes.EventTypeConnectionOpenAck, + sdk.NewAttribute(connectiontypes.AttributeKeyConnectionID, msg.ConnectionId), + sdk.NewAttribute(connectiontypes.AttributeKeyClientID, connectionEnd.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyClientID, connectionEnd.Counterparty.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyConnectionID, connectionEnd.Counterparty.ConnectionId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, connectiontypes.AttributeValueCategory), + ), + }) + + return &connectiontypes.MsgConnectionOpenAckResponse{}, nil +} + +// ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. +func (k Keeper) ConnectionOpenConfirm(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenConfirm) (*connectiontypes.MsgConnectionOpenConfirmResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if err := k.ConnectionKeeper.ConnOpenConfirm( + ctx, msg.ConnectionId, msg.ProofAck, msg.ProofHeight, + ); err != nil { + return nil, sdkerrors.Wrap(err, "connection handshake open confirm failed") + } + + connectionEnd, _ := k.ConnectionKeeper.GetConnection(ctx, msg.ConnectionId) + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + connectiontypes.EventTypeConnectionOpenConfirm, + sdk.NewAttribute(connectiontypes.AttributeKeyConnectionID, msg.ConnectionId), + sdk.NewAttribute(connectiontypes.AttributeKeyClientID, connectionEnd.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyClientID, connectionEnd.Counterparty.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyConnectionID, connectionEnd.Counterparty.ConnectionId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, connectiontypes.AttributeValueCategory), + ), + }) + + return &connectiontypes.MsgConnectionOpenConfirmResponse{}, nil +} + +// ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. +func (k Keeper) ChannelOpenInit(goCtx context.Context, msg *channeltypes.MsgChannelOpenInit) (*channeltypes.MsgChannelOpenInitResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by port capability + module, portCap, err := k.PortKeeper.LookupModuleByPort(ctx, msg.PortId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + _, cap, err := channel.HandleMsgChannelOpenInit(ctx, k.ChannelKeeper, portCap, msg) + if err != nil { + return nil, err + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanOpenInit(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, msg.ChannelId, cap, msg.Channel.Counterparty, msg.Channel.Version); err != nil { + return nil, sdkerrors.Wrap(err, "channel open init callback failed") + } + + return &channeltypes.MsgChannelOpenInitResponse{}, nil +} + +// ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. +func (k Keeper) ChannelOpenTry(goCtx context.Context, msg *channeltypes.MsgChannelOpenTry) (*channeltypes.MsgChannelOpenTryResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + // Lookup module by port capability + module, portCap, err := k.PortKeeper.LookupModuleByPort(ctx, msg.PortId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + _, cap, err := channel.HandleMsgChannelOpenTry(ctx, k.ChannelKeeper, portCap, msg) + if err != nil { + return nil, err + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanOpenTry(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, msg.DesiredChannelId, cap, msg.Channel.Counterparty, msg.Channel.Version, msg.CounterpartyVersion); err != nil { + return nil, sdkerrors.Wrap(err, "channel open try callback failed") + } + + return &channeltypes.MsgChannelOpenTryResponse{}, nil +} + +// ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. +func (k Keeper) ChannelOpenAck(goCtx context.Context, msg *channeltypes.MsgChannelOpenAck) (*channeltypes.MsgChannelOpenAckResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanOpenAck(ctx, msg.PortId, msg.ChannelId, msg.CounterpartyVersion); err != nil { + return nil, sdkerrors.Wrap(err, "channel open ack callback failed") + } + + _, err = channel.HandleMsgChannelOpenAck(ctx, k.ChannelKeeper, cap, msg) + if err != nil { + return nil, err + } + + return &channeltypes.MsgChannelOpenAckResponse{}, nil +} + +// ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. +func (k Keeper) ChannelOpenConfirm(goCtx context.Context, msg *channeltypes.MsgChannelOpenConfirm) (*channeltypes.MsgChannelOpenConfirmResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanOpenConfirm(ctx, msg.PortId, msg.ChannelId); err != nil { + return nil, sdkerrors.Wrap(err, "channel open confirm callback failed") + } + + _, err = channel.HandleMsgChannelOpenConfirm(ctx, k.ChannelKeeper, cap, msg) + if err != nil { + return nil, err + } + + return &channeltypes.MsgChannelOpenConfirmResponse{}, nil +} + +// ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. +func (k Keeper) ChannelCloseInit(goCtx context.Context, msg *channeltypes.MsgChannelCloseInit) (*channeltypes.MsgChannelCloseInitResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanCloseInit(ctx, msg.PortId, msg.ChannelId); err != nil { + return nil, sdkerrors.Wrap(err, "channel close init callback failed") + } + + _, err = channel.HandleMsgChannelCloseInit(ctx, k.ChannelKeeper, cap, msg) + if err != nil { + return nil, err + } + + return &channeltypes.MsgChannelCloseInitResponse{}, nil +} + +// ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. +func (k Keeper) ChannelCloseConfirm(goCtx context.Context, msg *channeltypes.MsgChannelCloseConfirm) (*channeltypes.MsgChannelCloseConfirmResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanCloseConfirm(ctx, msg.PortId, msg.ChannelId); err != nil { + return nil, sdkerrors.Wrap(err, "channel close confirm callback failed") + } + + _, err = channel.HandleMsgChannelCloseConfirm(ctx, k.ChannelKeeper, cap, msg) + if err != nil { + return nil, err + } + + return &channeltypes.MsgChannelCloseConfirmResponse{}, nil +} + +// RecvPacket defines a rpc handler method for MsgRecvPacket. +func (k Keeper) RecvPacket(goCtx context.Context, msg *channeltypes.MsgRecvPacket) (*channeltypes.MsgRecvPacketResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.DestinationPort, msg.Packet.DestinationChannel) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + // Perform TAO verification + if err := k.ChannelKeeper.RecvPacket(ctx, msg.Packet, msg.Proof, msg.ProofHeight); err != nil { + return nil, sdkerrors.Wrap(err, "receive packet verification failed") + } + + // Perform application logic callback + _, ack, err := cbs.OnRecvPacket(ctx, msg.Packet) + if err != nil { + return nil, sdkerrors.Wrap(err, "receive packet callback failed") + } + + if err := k.ChannelKeeper.WriteReceipt(ctx, cap, msg.Packet); err != nil { + return nil, err + } + + // Set packet acknowledgement only if the acknowledgement is not nil. + // NOTE: IBC applications modules may call the WriteAcknowledgement asynchronously if the + // acknowledgement is nil. + if ack != nil { + if err := k.ChannelKeeper.WriteAcknowledgement(ctx, msg.Packet, ack); err != nil { + return nil, err + } + } + + defer func() { + telemetry.IncrCounterWithLabels( + []string{"tx", "msg", "ibc", msg.Type()}, + 1, + []metrics.Label{ + telemetry.NewLabel("source-port", msg.Packet.SourcePort), + telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), + telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), + telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), + }, + ) + }() + + return &channeltypes.MsgRecvPacketResponse{}, nil +} + +// Timeout defines a rpc handler method for MsgTimeout. +func (k Keeper) Timeout(goCtx context.Context, msg *channeltypes.MsgTimeout) (*channeltypes.MsgTimeoutResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + // Perform TAO verification + if err := k.ChannelKeeper.TimeoutPacket(ctx, msg.Packet, msg.Proof, msg.ProofHeight, msg.NextSequenceRecv); err != nil { + return nil, sdkerrors.Wrap(err, "timeout packet verification failed") + } + + // Perform application logic callback + _, err = cbs.OnTimeoutPacket(ctx, msg.Packet) + if err != nil { + return nil, sdkerrors.Wrap(err, "timeout packet callback failed") + } + + // Delete packet commitment + if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounterWithLabels( + []string{"ibc", "timeout", "packet"}, + 1, + []metrics.Label{ + telemetry.NewLabel("source-port", msg.Packet.SourcePort), + telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), + telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), + telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), + telemetry.NewLabel("timeout-type", "height"), + }, + ) + }() + + return &channeltypes.MsgTimeoutResponse{}, nil +} + +// TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. +func (k Keeper) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTimeoutOnClose) (*channeltypes.MsgTimeoutOnCloseResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + // Perform TAO verification + if err := k.ChannelKeeper.TimeoutOnClose(ctx, cap, msg.Packet, msg.Proof, msg.ProofClose, msg.ProofHeight, msg.NextSequenceRecv); err != nil { + return nil, sdkerrors.Wrap(err, "timeout on close packet verification failed") + } + + // Perform application logic callback + // NOTE: MsgTimeout and MsgTimeoutOnClose use the same "OnTimeoutPacket" + // application logic callback. + _, err = cbs.OnTimeoutPacket(ctx, msg.Packet) + if err != nil { + return nil, sdkerrors.Wrap(err, "timeout packet callback failed") + } + + // Delete packet commitment + if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounterWithLabels( + []string{"ibc", "timeout", "packet"}, + 1, + []metrics.Label{ + telemetry.NewLabel("source-port", msg.Packet.SourcePort), + telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), + telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), + telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), + telemetry.NewLabel("timeout-type", "channel-closed"), + }, + ) + }() + + return &channeltypes.MsgTimeoutOnCloseResponse{}, nil +} + +// Acknowledgement defines a rpc handler method for MsgAcknowledgement. +func (k Keeper) Acknowledgement(goCtx context.Context, msg *channeltypes.MsgAcknowledgement) (*channeltypes.MsgAcknowledgementResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + // Perform TAO verification + if err := k.ChannelKeeper.AcknowledgePacket(ctx, msg.Packet, msg.Acknowledgement, msg.Proof, msg.ProofHeight); err != nil { + return nil, sdkerrors.Wrap(err, "acknowledge packet verification failed") + } + + // Perform application logic callback + _, err = cbs.OnAcknowledgementPacket(ctx, msg.Packet, msg.Acknowledgement) + if err != nil { + return nil, sdkerrors.Wrap(err, "acknowledge packet callback failed") + } + + // Delete packet commitment + if err = k.ChannelKeeper.AcknowledgementExecuted(ctx, cap, msg.Packet); err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounterWithLabels( + []string{"tx", "msg", "ibc", msg.Type()}, + 1, + []metrics.Label{ + telemetry.NewLabel("source-port", msg.Packet.SourcePort), + telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), + telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), + telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), + }, + ) + }() + + return &channeltypes.MsgAcknowledgementResponse{}, nil +} diff --git a/x/ibc/core/handler_test.go b/x/ibc/core/keeper/msg_server_test.go similarity index 76% rename from x/ibc/core/handler_test.go rename to x/ibc/core/keeper/msg_server_test.go index 712811dbe1..2f3910fe71 100644 --- a/x/ibc/core/handler_test.go +++ b/x/ibc/core/keeper/msg_server_test.go @@ -1,39 +1,31 @@ -package ibc_test +package keeper_test import ( "testing" + "time" "github.com/stretchr/testify/suite" - ibc "github.com/cosmos/cosmos-sdk/x/ibc/core" + sdk "github.com/cosmos/cosmos-sdk/types" clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types" + commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types" host "github.com/cosmos/cosmos-sdk/x/ibc/core/24-host" + "github.com/cosmos/cosmos-sdk/x/ibc/core/exported" + "github.com/cosmos/cosmos-sdk/x/ibc/core/keeper" + ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) -const ( - connectionID = "connectionidone" - clientID = "clientidone" - connectionID2 = "connectionidtwo" - clientID2 = "clientidtwo" - - port1 = "firstport" - port2 = "secondport" - - channel1 = "firstchannel" - channel2 = "secondchannel" - - height = 10 -) +const height = 10 var ( timeoutHeight = clienttypes.NewHeight(0, 10000) maxSequence = uint64(10) - clientHeight = clienttypes.NewHeight(0, 10) ) -type IBCTestSuite struct { +type KeeperTestSuite struct { suite.Suite coordinator *ibctesting.Coordinator @@ -43,7 +35,7 @@ type IBCTestSuite struct { } // SetupTest creates a coordinator with 2 test chains. -func (suite *IBCTestSuite) SetupTest() { +func (suite *KeeperTestSuite) SetupTest() { suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0)) @@ -51,7 +43,7 @@ func (suite *IBCTestSuite) SetupTest() { } func TestIBCTestSuite(t *testing.T) { - suite.Run(t, new(IBCTestSuite)) + suite.Run(t, new(KeeperTestSuite)) } // tests the IBC handler receiving a packet on ordered and unordered channels. @@ -59,7 +51,7 @@ func TestIBCTestSuite(t *testing.T) { // tests high level properties like ordering and basic sanity checks. More // rigorous testing of 'RecvPacket' and 'WriteReceipt' can be found in the // 04-channel/keeper/packet_test.go. -func (suite *IBCTestSuite) TestHandleRecvPacket() { +func (suite *KeeperTestSuite) TestHandleRecvPacket() { var ( packet channeltypes.Packet ) @@ -143,8 +135,6 @@ func (suite *IBCTestSuite) TestHandleRecvPacket() { suite.Run(tc.name, func() { suite.SetupTest() // reset - handler := ibc.NewHandler(*suite.chainB.App.IBCKeeper) - tc.malleate() // get proof of packet commitment from chainA @@ -154,13 +144,13 @@ func (suite *IBCTestSuite) TestHandleRecvPacket() { msg := channeltypes.NewMsgRecvPacket(packet, proof, proofHeight, suite.chainB.SenderAccount.GetAddress()) // ante-handle RecvPacket - _, err := handler(suite.chainB.GetContext(), msg) + _, err := keeper.Keeper.RecvPacket(*suite.chainB.App.IBCKeeper, sdk.WrapSDKContext(suite.chainB.GetContext()), msg) if tc.expPass { suite.Require().NoError(err) // replay should fail since state changes occur - _, err := handler(suite.chainB.GetContext(), msg) + _, err := keeper.Keeper.RecvPacket(*suite.chainB.App.IBCKeeper, sdk.WrapSDKContext(suite.chainB.GetContext()), msg) suite.Require().Error(err) // verify ack was written @@ -179,7 +169,7 @@ func (suite *IBCTestSuite) TestHandleRecvPacket() { // occurs. It test high level properties like ordering and basic sanity // checks. More rigorous testing of 'AcknowledgePacket' and 'AcknowledgementExecuted' // can be found in the 04-channel/keeper/packet_test.go. -func (suite *IBCTestSuite) TestHandleAcknowledgePacket() { +func (suite *KeeperTestSuite) TestHandleAcknowledgePacket() { var ( packet channeltypes.Packet ) @@ -303,8 +293,6 @@ func (suite *IBCTestSuite) TestHandleAcknowledgePacket() { suite.SetupTest() // reset ibctesting.TestHash = ibctesting.MockAcknowledgement - handler := ibc.NewHandler(*suite.chainA.App.IBCKeeper) - tc.malleate() packetKey := host.KeyPacketAcknowledgement(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence()) @@ -312,13 +300,13 @@ func (suite *IBCTestSuite) TestHandleAcknowledgePacket() { msg := channeltypes.NewMsgAcknowledgement(packet, ibctesting.MockAcknowledgement, proof, proofHeight, suite.chainA.SenderAccount.GetAddress()) - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.Acknowledgement(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) if tc.expPass { suite.Require().NoError(err) // replay should an error - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.Acknowledgement(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) suite.Require().Error(err) // verify packet commitment was deleted on source chain @@ -337,7 +325,7 @@ func (suite *IBCTestSuite) TestHandleAcknowledgePacket() { // high level properties like ordering and basic sanity checks. More // rigorous testing of 'TimeoutPacket' and 'TimeoutExecuted' can be found in // the 04-channel/keeper/timeout_test.go. -func (suite *IBCTestSuite) TestHandleTimeoutPacket() { +func (suite *KeeperTestSuite) TestHandleTimeoutPacket() { var ( packet channeltypes.Packet packetKey []byte @@ -427,21 +415,19 @@ func (suite *IBCTestSuite) TestHandleTimeoutPacket() { suite.Run(tc.name, func() { suite.SetupTest() // reset - handler := ibc.NewHandler(*suite.chainA.App.IBCKeeper) - tc.malleate() proof, proofHeight := suite.chainB.QueryProof(packetKey) msg := channeltypes.NewMsgTimeout(packet, 1, proof, proofHeight, suite.chainA.SenderAccount.GetAddress()) - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.Timeout(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) if tc.expPass { suite.Require().NoError(err) // replay should return an error - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.Timeout(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) suite.Require().Error(err) // verify packet commitment was deleted on source chain @@ -460,7 +446,7 @@ func (suite *IBCTestSuite) TestHandleTimeoutPacket() { // commitment occurs. It tests high level properties like ordering and basic // sanity checks. More rigorous testing of 'TimeoutOnClose' and //'TimeoutExecuted' can be found in the 04-channel/keeper/timeout_test.go. -func (suite *IBCTestSuite) TestHandleTimeoutOnClosePacket() { +func (suite *KeeperTestSuite) TestHandleTimeoutOnClosePacket() { var ( packet channeltypes.Packet packetKey []byte @@ -608,8 +594,6 @@ func (suite *IBCTestSuite) TestHandleTimeoutOnClosePacket() { suite.Run(tc.name, func() { suite.SetupTest() // reset - handler := ibc.NewHandler(*suite.chainA.App.IBCKeeper) - tc.malleate() proof, proofHeight := suite.chainB.QueryProof(packetKey) @@ -619,13 +603,13 @@ func (suite *IBCTestSuite) TestHandleTimeoutOnClosePacket() { msg := channeltypes.NewMsgTimeoutOnClose(packet, 1, proof, proofClosed, proofHeight, suite.chainA.SenderAccount.GetAddress()) - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.TimeoutOnClose(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) if tc.expPass { suite.Require().NoError(err) // replay should return an error - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.TimeoutOnClose(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) suite.Require().Error(err) // verify packet commitment was deleted on source chain @@ -638,3 +622,140 @@ func (suite *IBCTestSuite) TestHandleTimeoutOnClosePacket() { }) } } + +func (suite *KeeperTestSuite) TestUpgradeClient() { + var ( + clientA string + upgradedClient exported.ClientState + upgradeHeight exported.Height + msg *clienttypes.MsgUpgradeClient + ) + + newClientHeight := clienttypes.NewHeight(1, 1) + + cases := []struct { + name string + setup func() + expPass bool + }{ + { + name: "successful upgrade", + setup: func() { + + upgradedClient = ibctmtypes.NewClientState("newChainId", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) + + // upgrade Height is at next block + upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) + + // commit upgrade store changes and update clients + + suite.coordinator.CommitBlock(suite.chainB) + err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) + suite.Require().NoError(err) + + cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) + suite.Require().True(found) + + proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) + + msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, proofUpgrade, suite.chainA.SenderAccount.GetAddress()) + suite.Require().NoError(err) + }, + expPass: true, + }, + { + name: "invalid upgrade: msg.ClientState does not contain valid clientstate", + setup: func() { + + cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) + suite.Require().True(found) + + // upgrade Height is at next block + upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) + + consState := ibctmtypes.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("app_hash")), []byte("next_vals_hash")) + consAny, err := clienttypes.PackConsensusState(consState) + suite.Require().NoError(err) + + height, _ := upgradeHeight.(clienttypes.Height) + + msg = &clienttypes.MsgUpgradeClient{ClientId: clientA, ClientState: consAny, UpgradeHeight: &height, ProofUpgrade: proofUpgrade, Signer: suite.chainA.SenderAccount.GetAddress().String()} + }, + expPass: false, + }, + { + name: "invalid clientstate", + setup: func() { + + upgradedClient = ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) + + // upgrade Height is at next block + upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) + + // commit upgrade store changes and update clients + + suite.coordinator.CommitBlock(suite.chainB) + err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) + suite.Require().NoError(err) + + cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) + suite.Require().True(found) + + proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) + + msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, proofUpgrade, suite.chainA.SenderAccount.GetAddress()) + suite.Require().NoError(err) + }, + expPass: false, + }, + { + name: "VerifyUpgrade fails", + setup: func() { + + upgradedClient = ibctmtypes.NewClientState("newChainId", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) + + // upgrade Height is at next block + upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) + + // commit upgrade store changes and update clients + + suite.coordinator.CommitBlock(suite.chainB) + err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) + suite.Require().NoError(err) + + msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, nil, suite.chainA.SenderAccount.GetAddress()) + suite.Require().NoError(err) + }, + expPass: false, + }, + } + + for _, tc := range cases { + tc := tc + clientA, _ = suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) + + tc.setup() + + _, err := keeper.Keeper.UpgradeClient(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) + + if tc.expPass { + suite.Require().NoError(err, "upgrade handler failed on valid case: %s", tc.name) + newClient, ok := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) + suite.Require().True(ok) + suite.Require().Equal(upgradedClient, newClient) + } else { + suite.Require().Error(err, "upgrade handler passed on invalid case: %s", tc.name) + } + } +} diff --git a/x/ibc/core/module.go b/x/ibc/core/module.go index 35a734ccf9..4590556be9 100644 --- a/x/ibc/core/module.go +++ b/x/ibc/core/module.go @@ -130,8 +130,11 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return nil } -// RegisterQueryService registers the gRPC query service for the ibc module. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + clienttypes.RegisterMsgServer(cfg.MsgServer(), am.keeper) + connectiontypes.RegisterMsgServer(cfg.MsgServer(), am.keeper) + channeltypes.RegisterMsgServer(cfg.MsgServer(), am.keeper) types.RegisterQueryService(cfg.QueryServer(), am.keeper) } From 505d424a3bc33e089a0809494e11ff49020b54a2 Mon Sep 17 00:00:00 2001 From: Cory Date: Mon, 19 Oct 2020 11:38:17 -0700 Subject: [PATCH 57/84] [IAVL]: Bump to v0.15.0-rc4 (#7549) * iavl 0.15.0-rc4 version bump * update comments on error modes for store.LoadStore * update CONFIO_URL in makefile Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- Makefile | 2 +- go.mod | 10 +++++----- go.sum | 46 +++++++++++++++------------------------------ store/iavl/store.go | 7 ++++--- 4 files changed, 25 insertions(+), 40 deletions(-) diff --git a/Makefile b/Makefile index 01ca0a594f..bd667b1c08 100644 --- a/Makefile +++ b/Makefile @@ -392,7 +392,7 @@ proto-check-breaking-docker: TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0-rc5/proto/tendermint GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master -CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/v0.6.2 +CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/v0.6.3 TM_CRYPTO_TYPES = third_party/proto/tendermint/crypto TM_ABCI_TYPES = third_party/proto/tendermint/abci diff --git a/go.mod b/go.mod index bb5dd3361b..0dcda260b0 100644 --- a/go.mod +++ b/go.mod @@ -9,9 +9,9 @@ require ( github.com/bgentry/speakeasy v0.1.0 github.com/btcsuite/btcd v0.21.0-beta github.com/btcsuite/btcutil v1.0.2 - github.com/confio/ics23/go v0.0.0-20200817220745-f173e6211efb + github.com/confio/ics23/go v0.6.3 github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d - github.com/cosmos/iavl v0.15.0-rc3 + github.com/cosmos/iavl v0.15.0-rc4 github.com/cosmos/ledger-cosmos-go v0.11.1 github.com/dgraph-io/badger/v2 v2.2007.2 // indirect github.com/dgraph-io/ristretto v0.0.3 // indirect @@ -47,10 +47,10 @@ require ( github.com/tendermint/go-amino v0.16.0 github.com/tendermint/tendermint v0.34.0-rc5 github.com/tendermint/tm-db v0.6.2 - golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a + golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee golang.org/x/net v0.0.0-20200930145003-4acb6c075d10 // indirect - google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 - google.golang.org/grpc v1.32.0 + google.golang.org/genproto v0.0.0-20201014134559-03b6142f0dc9 + google.golang.org/grpc v1.33.0 google.golang.org/protobuf v1.25.0 gopkg.in/yaml.v2 v2.3.0 ) diff --git a/go.sum b/go.sum index 54ae3d7569..61fc2a908b 100644 --- a/go.sum +++ b/go.sum @@ -105,8 +105,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/confio/ics23/go v0.0.0-20200817220745-f173e6211efb h1:+7FsS1gZ1Km5LRjGV2hztpier/5i6ngNjvNpxbWP5I0= -github.com/confio/ics23/go v0.0.0-20200817220745-f173e6211efb/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= +github.com/confio/ics23/go v0.6.3 h1:PuGK2V1NJWZ8sSkNDq91jgT/cahFEW9RGp4Y5jxulf0= +github.com/confio/ics23/go v0.6.3/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -119,8 +119,8 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= -github.com/cosmos/iavl v0.15.0-rc3 h1:rSm60IFfDCD9qDfvXKEmaJhcv0rB5uCbVlBDKsynxqw= -github.com/cosmos/iavl v0.15.0-rc3/go.mod h1:rQ2zK/LuivThMjve3Yr6VkjvCqCXl+fgHCY7quiUA68= +github.com/cosmos/iavl v0.15.0-rc4 h1:P1wmET7BueqCzfxsn+BzVkDWDLY9ij2JNwkbIdM7RG8= +github.com/cosmos/iavl v0.15.0-rc4/go.mod h1:5CsecJdh44Uj4vZ6WSPeWq84hNW5BwRI36ZsAbfJvRw= github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= @@ -137,14 +137,10 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/lru v1.0.0 h1:Kbsb1SFDsIlaupWPwsPp+dkxiBY1frcS07PCPgotKz8= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/dgraph-io/badger/v2 v2.0.3 h1:inzdf6VF/NZ+tJ8RwwYMjJMvsOALTHYdozn0qSl6XJI= -github.com/dgraph-io/badger/v2 v2.0.3/go.mod h1:3KY8+bsP8wI0OEnQJAKpd4wIJW/Mm32yw2j/9FUVnIM= github.com/dgraph-io/badger/v2 v2.2007.1 h1:t36VcBCpo4SsmAD5M8wVv1ieVzcALyGfaJ92z4ccULM= github.com/dgraph-io/badger/v2 v2.2007.1/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= -github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3 h1:MQLRM35Pp0yAyBYksjbj1nZI/w6eyRY/mWoM1sFf4kU= -github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de h1:t0UHb5vdojIDUqktM6+xJAfScFBsVpXZmqC9dsgJmeA= 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 h1:jh22xisGBjrEVnRZ1DVTpBVQm0Xndu8sMl0CWDzSIBI= @@ -259,6 +255,7 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= @@ -277,14 +274,12 @@ github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0U github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.1/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= 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.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.14.7 h1:Nk5kuHrnWUTf/0GL1a/vchH/om9Ap2/HnVna+jYZgTY= -github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= github.com/grpc-ecosystem/grpc-gateway v1.15.2 h1:HC+hWRWf+v5zTMPyoaYTKIJih+4sd4XRWmj0qlG87Co= github.com/grpc-ecosystem/grpc-gateway v1.15.2/go.mod h1:vO11I9oWA+KsxmfFQPhLnnIb1VDE24M+pdxZFiuZcA8= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= @@ -389,8 +384,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/minio/highwayhash v1.0.0 h1:iMSDhgUILCr0TNm8LWlSjF8N0ZIj2qbO8WHp6Q/J2BA= -github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc= github.com/minio/highwayhash v1.0.1 h1:dZ6IIu8Z14VlC0VpfKofAhCy74wu/Qb5gcn52yWoz/0= github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -587,7 +580,6 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= @@ -598,12 +590,9 @@ github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RM github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= 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/tendermint/tendermint v0.34.0-rc3 h1:d7Fsd5rdbxq4GmJ0kRfx7l7LesQM7e70f0ytWLTQ/Go= -github.com/tendermint/tendermint v0.34.0-rc3/go.mod h1:BoHcEpjfpBHc1Be7RQz3AHaXFNObcDG7SNHCev6Or4g= +github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= github.com/tendermint/tendermint v0.34.0-rc5 h1:2bnQfWyOMfTCbol5pwB8CgM2nxi6/Kz6zqlS6Udm/Cg= github.com/tendermint/tendermint v0.34.0-rc5/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= -github.com/tendermint/tm-db v0.6.1 h1:w3X87itMPXopcRPlFiqspEKhw4FXihPk2rnFFkP0zGk= -github.com/tendermint/tm-db v0.6.1/go.mod h1:m3x9kRP4UFd7JODJL0yBAZqE7wTw+S37uAE90cTx7OA= github.com/tendermint/tm-db v0.6.2 h1:DOn8jwCdjJblrCFJbtonEIPD1IuJWpbRUUdR8GWE4RM= github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -646,12 +635,11 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200406173513-056763e48d71/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee h1:4yd7jl+vXjalO5ztz6Vc1VADv+S/80LGJmyl1ROJ2AI= +golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -698,7 +686,6 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc h1:zK/HqS5bZxDptfPJNq8v7vJfXtkU7r9TLIoSr1bXaP4= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200930145003-4acb6c075d10 h1:YfxMZzv3PjGonQYNUaeU2+DhAdqOxerQ30JFB6WgAXo= golang.org/x/net v0.0.0-20200930145003-4acb6c075d10/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -748,7 +735,6 @@ golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed h1:J22ig1FUekjjkmZUM7pTKixYm8DvrYsvrBZdunYeIuQ= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211 h1:9UQO31fZ+0aKQOFldThf7BKPMJTiBfWycGh/u3UoO88= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -784,7 +770,6 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200110213125-a7a6caa82ab2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa h1:5E4dL8+NgFOgjwbTKz+OOEGGhP+ectTmF842l6KjupQ= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 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= @@ -817,8 +802,8 @@ google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 h1:PDIOdWxZ8eRizhKa1AAvY53xsvLB1cWorMjslvY3VA8= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201014134559-03b6142f0dc9 h1:fG84H9C3EXfuDlzkG+VEPDYHHExklP6scH1QZ5gQTqU= +google.golang.org/genproto v0.0.0-20201014134559-03b6142f0dc9/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 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= @@ -834,11 +819,10 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.0 h1:IBKSUNL2uBS2DkJBncPP+TwT0sp9tgA8A75NjHt6umg= +google.golang.org/grpc v1.33.0/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= 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= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -854,8 +838,8 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= diff --git a/store/iavl/store.go b/store/iavl/store.go index cf7737d5d8..e3a3f897d7 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -41,14 +41,15 @@ type Store struct { // LoadStore returns an IAVL Store as a CommitKVStore. Internally, it will load the // store's version (id) from the provided DB. An error is returned if the version -// fails to load. +// fails to load, or if called with a positive version on an empty tree. func LoadStore(db dbm.DB, id types.CommitID, lazyLoading bool) (types.CommitKVStore, error) { return LoadStoreWithInitialVersion(db, id, lazyLoading, 0) } -// LoadStore returns an IAVL Store as a CommitKVStore setting its initialVersion +// LoadStoreWithInitialVersion returns an IAVL Store as a CommitKVStore setting its initialVersion // to the one given. Internally, it will load the store's version (id) from the -// provided DB. An error is returned if the version fails to load. +// provided DB. An error is returned if the version fails to load, or if called with a positive +// version on an empty tree. func LoadStoreWithInitialVersion(db dbm.DB, id types.CommitID, lazyLoading bool, initialVersion uint64) (types.CommitKVStore, error) { tree, err := iavl.NewMutableTreeWithOpts(db, defaultIAVLCacheSize, &iavl.Options{InitialVersion: initialVersion}) if err != nil { From c6558fbcb9bb30b7a2ec2b28a8d1e94b5afa2c5f Mon Sep 17 00:00:00 2001 From: Emmanuel T Odeke Date: Tue, 20 Oct 2020 05:41:44 -0700 Subject: [PATCH 58/84] server: catch and return unhandled errors in interceptConfigs (#7587) Catches and returns unhandled errors after stat-ing for the configFile, instead of assuming that we'd only encounter a non-existent error. Added a regression test to lock-in checks for unhandled errors like Permission errors, which is representative of all the errors that haven't been accounted for. Fixes #7578 Co-authored-by: Aleksandr Bezobchuk Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- server/util.go | 9 +++++++-- server/util_test.go | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/server/util.go b/server/util.go index 8407f9b492..b95f8ad505 100644 --- a/server/util.go +++ b/server/util.go @@ -146,7 +146,8 @@ func interceptConfigs(rootViper *viper.Viper) (*tmcfg.Config, error) { conf := tmcfg.DefaultConfig() - if _, err := os.Stat(configFile); os.IsNotExist(err) { + switch _, err := os.Stat(configFile); { + case os.IsNotExist(err): tmcfg.EnsureRoot(rootDir) if err = conf.ValidateBasic(); err != nil { @@ -158,7 +159,11 @@ func interceptConfigs(rootViper *viper.Viper) (*tmcfg.Config, error) { conf.P2P.SendRate = 5120000 conf.Consensus.TimeoutCommit = 5 * time.Second tmcfg.WriteConfigFile(configFile, conf) - } else { + + case err != nil: + return nil, err + + default: rootViper.SetConfigType("toml") rootViper.SetConfigName("config") rootViper.AddConfigPath(configPath) diff --git a/server/util_test.go b/server/util_test.go index 7cc10b3542..582fb4c089 100644 --- a/server/util_test.go +++ b/server/util_test.go @@ -6,6 +6,7 @@ import ( "fmt" "os" "path" + "path/filepath" "strings" "testing" @@ -444,3 +445,26 @@ func TestInterceptConfigsPreRunHandlerPrecedenceConfigDefault(t *testing.T) { t.Error("RPCListenAddress is not using default") } } + +// Ensure that if interceptConfigs encounters any error other than non-existen errors +// that we correctly return the offending error, for example a permission error. +// See https://github.com/cosmos/cosmos-sdk/issues/7578 +func TestInterceptConfigsWithBadPermissions(t *testing.T) { + tempDir := t.TempDir() + subDir := filepath.Join(tempDir, "nonPerms") + if err := os.Mkdir(subDir, 0600); err != nil { + t.Fatalf("Failed to create sub directory: %v", err) + } + cmd := StartCmd(nil, "/foobar") + if err := cmd.Flags().Set(flags.FlagHome, subDir); err != nil { + t.Fatalf("Could not set home flag [%T] %v", err, err) + } + + cmd.PreRunE = preRunETestImpl + + serverCtx := &Context{} + ctx := context.WithValue(context.Background(), ServerContextKey, serverCtx) + if err := cmd.ExecuteContext(ctx); !os.IsPermission(err) { + t.Fatalf("Failed to catch permissions error, got: [%T] %v", err, err) + } +} From 3c43370d0c78d1903c461d40ec557fe79e3b646d Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 20 Oct 2020 15:19:04 +0200 Subject: [PATCH 59/84] Add CommunitySpendProposals in migration (#7607) * Add CommunitySpendProposals in migration * Fix lint * Avoid double registration Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- x/distribution/legacy/v036/types.go | 66 ++++++++++++++ x/genutil/legacy/v036/migrate.go | 1 + x/genutil/legacy/v038/migrate.go | 5 ++ x/genutil/legacy/v039/migrate.go | 6 ++ x/genutil/legacy/v040/migrate.go | 17 ++-- x/gov/legacy/v040/migrate.go | 26 +++++- x/gov/legacy/v040/migrate_test.go | 128 ++++++++++++++++++++++++++++ 7 files changed, 240 insertions(+), 9 deletions(-) create mode 100644 x/gov/legacy/v040/migrate_test.go diff --git a/x/distribution/legacy/v036/types.go b/x/distribution/legacy/v036/types.go index ed96ce7707..1c43eb5acd 100644 --- a/x/distribution/legacy/v036/types.go +++ b/x/distribution/legacy/v036/types.go @@ -3,8 +3,14 @@ package v036 import ( + "fmt" + "strings" + + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" v034distr "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v034" + "github.com/cosmos/cosmos-sdk/x/distribution/types" + v036gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v036" ) // ---------------------------------------------------------------------------- @@ -13,6 +19,12 @@ import ( const ( ModuleName = "distribution" + + // RouterKey is the message route for distribution + RouterKey = ModuleName + + // ProposalTypeCommunityPoolSpend defines the type for a CommunityPoolSpendProposal + ProposalTypeCommunityPoolSpend = "CommunityPoolSpend" ) type ( @@ -40,6 +52,14 @@ type ( DelegatorStartingInfos []v034distr.DelegatorStartingInfoRecord `json:"delegator_starting_infos"` ValidatorSlashEvents []ValidatorSlashEventRecord `json:"validator_slash_events"` } + + // CommunityPoolSpendProposal spends from the community pool + CommunityPoolSpendProposal struct { + Title string `json:"title" yaml:"title"` + Description string `json:"description" yaml:"description"` + Recipient sdk.AccAddress `json:"recipient" yaml:"recipient"` + Amount sdk.Coins `json:"amount" yaml:"amount"` + } ) func NewGenesisState( @@ -66,3 +86,49 @@ func NewGenesisState( ValidatorSlashEvents: slashes, } } + +var _ v036gov.Content = CommunityPoolSpendProposal{} + +// GetTitle returns the title of a community pool spend proposal. +func (csp CommunityPoolSpendProposal) GetTitle() string { return csp.Title } + +// GetDescription returns the description of a community pool spend proposal. +func (csp CommunityPoolSpendProposal) GetDescription() string { return csp.Description } + +// GetDescription returns the routing key of a community pool spend proposal. +func (csp CommunityPoolSpendProposal) ProposalRoute() string { return RouterKey } + +// ProposalType returns the type of a community pool spend proposal. +func (csp CommunityPoolSpendProposal) ProposalType() string { return ProposalTypeCommunityPoolSpend } + +// ValidateBasic runs basic stateless validity checks +func (csp CommunityPoolSpendProposal) ValidateBasic() error { + err := v036gov.ValidateAbstract(csp) + if err != nil { + return err + } + if !csp.Amount.IsValid() { + return types.ErrInvalidProposalAmount + } + if csp.Recipient.Empty() { + return types.ErrEmptyProposalRecipient + } + + return nil +} + +// String implements the Stringer interface. +func (csp CommunityPoolSpendProposal) String() string { + var b strings.Builder + b.WriteString(fmt.Sprintf(`Community Pool Spend Proposal: + Title: %s + Description: %s + Recipient: %s + Amount: %s +`, csp.Title, csp.Description, csp.Recipient, csp.Amount)) + return b.String() +} + +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(CommunityPoolSpendProposal{}, "cosmos-sdk/CommunityPoolSpendProposal", nil) +} diff --git a/x/genutil/legacy/v036/migrate.go b/x/genutil/legacy/v036/migrate.go index ea576c41e7..8b71361596 100644 --- a/x/genutil/legacy/v036/migrate.go +++ b/x/genutil/legacy/v036/migrate.go @@ -27,6 +27,7 @@ func Migrate(appState types.AppMap, _ client.Context) types.AppMap { v036Codec := codec.NewLegacyAmino() cryptocodec.RegisterCrypto(v036Codec) v036gov.RegisterLegacyAminoCodec(v036Codec) + v036distr.RegisterLegacyAminoCodec(v036Codec) // migrate genesis accounts state if appState[v034genAccounts.ModuleName] != nil { diff --git a/x/genutil/legacy/v038/migrate.go b/x/genutil/legacy/v038/migrate.go index 267dccda02..cd71f57b11 100644 --- a/x/genutil/legacy/v038/migrate.go +++ b/x/genutil/legacy/v038/migrate.go @@ -10,6 +10,7 @@ import ( v038distr "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v038" v036genaccounts "github.com/cosmos/cosmos-sdk/x/genaccounts/legacy/v036" "github.com/cosmos/cosmos-sdk/x/genutil/types" + v036gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v036" v036staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v036" v038staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v038" ) @@ -18,10 +19,14 @@ import ( func Migrate(appState types.AppMap, _ client.Context) types.AppMap { v036Codec := codec.NewLegacyAmino() cryptocodec.RegisterCrypto(v036Codec) + v036gov.RegisterLegacyAminoCodec(v036Codec) + v036distr.RegisterLegacyAminoCodec(v036Codec) v038Codec := codec.NewLegacyAmino() cryptocodec.RegisterCrypto(v038Codec) v038auth.RegisterLegacyAminoCodec(v038Codec) + v036gov.RegisterLegacyAminoCodec(v038Codec) + v036distr.RegisterLegacyAminoCodec(v038Codec) if appState[v036genaccounts.ModuleName] != nil { // unmarshal relative source genesis application state diff --git a/x/genutil/legacy/v039/migrate.go b/x/genutil/legacy/v039/migrate.go index 3b427fd883..bf112c1526 100644 --- a/x/genutil/legacy/v039/migrate.go +++ b/x/genutil/legacy/v039/migrate.go @@ -6,7 +6,9 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" v038auth "github.com/cosmos/cosmos-sdk/x/auth/legacy/v038" v039auth "github.com/cosmos/cosmos-sdk/x/auth/legacy/v039" + v036distr "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v036" "github.com/cosmos/cosmos-sdk/x/genutil/types" + v036gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v036" ) // Migrate migrates exported state from v0.38 to a v0.39 genesis state. @@ -17,10 +19,14 @@ func Migrate(appState types.AppMap, _ client.Context) types.AppMap { v038Codec := codec.NewLegacyAmino() cryptocodec.RegisterCrypto(v038Codec) v038auth.RegisterLegacyAminoCodec(v038Codec) + v036gov.RegisterLegacyAminoCodec(v038Codec) + v036distr.RegisterLegacyAminoCodec(v038Codec) v039Codec := codec.NewLegacyAmino() cryptocodec.RegisterCrypto(v039Codec) v039auth.RegisterLegacyAminoCodec(v039Codec) + v036gov.RegisterLegacyAminoCodec(v039Codec) + v036distr.RegisterLegacyAminoCodec(v039Codec) // migrate x/auth state (JSON serialization only) if appState[v038auth.ModuleName] != nil { diff --git a/x/genutil/legacy/v040/migrate.go b/x/genutil/legacy/v040/migrate.go index c07bcdb742..ec71038680 100644 --- a/x/genutil/legacy/v040/migrate.go +++ b/x/genutil/legacy/v040/migrate.go @@ -11,8 +11,9 @@ import ( v040bank "github.com/cosmos/cosmos-sdk/x/bank/legacy/v040" v039crisis "github.com/cosmos/cosmos-sdk/x/crisis/legacy/v039" v040crisis "github.com/cosmos/cosmos-sdk/x/crisis/legacy/v040" - v038distribution "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v038" - v040distribution "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v040" + v036distr "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v036" + v038distr "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v038" + v040distr "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v040" v038evidence "github.com/cosmos/cosmos-sdk/x/evidence/legacy/v038" v040evidence "github.com/cosmos/cosmos-sdk/x/evidence/legacy/v040" v039genutil "github.com/cosmos/cosmos-sdk/x/genutil/legacy/v039" @@ -38,6 +39,8 @@ func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { v039Codec := codec.NewLegacyAmino() cryptocodec.RegisterCrypto(v039Codec) v039auth.RegisterLegacyAminoCodec(v039Codec) + v036gov.RegisterLegacyAminoCodec(v039Codec) + v036distr.RegisterLegacyAminoCodec(v039Codec) v040Codec := clientCtx.JSONMarshaler @@ -94,17 +97,17 @@ func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { } // Migrate x/distribution. - if appState[v038distribution.ModuleName] != nil { + if appState[v038distr.ModuleName] != nil { // unmarshal relative source genesis application state - var distributionGenState v038distribution.GenesisState - v039Codec.MustUnmarshalJSON(appState[v038distribution.ModuleName], &distributionGenState) + var distributionGenState v038distr.GenesisState + v039Codec.MustUnmarshalJSON(appState[v038distr.ModuleName], &distributionGenState) // delete deprecated x/distribution genesis state - delete(appState, v038distribution.ModuleName) + delete(appState, v038distr.ModuleName) // Migrate relative source genesis application state and marshal it into // the respective key. - appState[v040distribution.ModuleName] = v040Codec.MustMarshalJSON(v040distribution.Migrate(distributionGenState)) + appState[v040distr.ModuleName] = v040Codec.MustMarshalJSON(v040distr.Migrate(distributionGenState)) } // Migrate x/evidence. diff --git a/x/gov/legacy/v040/migrate.go b/x/gov/legacy/v040/migrate.go index 73ee066dd6..223eb6626c 100644 --- a/x/gov/legacy/v040/migrate.go +++ b/x/gov/legacy/v040/migrate.go @@ -4,6 +4,8 @@ import ( "fmt" codectypes "github.com/cosmos/cosmos-sdk/codec/types" + v036distr "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v036" + v040distr "github.com/cosmos/cosmos-sdk/x/distribution/types" v034gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v034" v036gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v036" v040gov "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -59,10 +61,30 @@ func migrateProposalStatus(oldProposalStatus v034gov.ProposalStatus) v040gov.Pro func migrateContent(oldContent v036gov.Content) *codectypes.Any { switch oldContent := oldContent.(type) { - case *v040gov.TextProposal: + case v036gov.TextProposal: { + protoProposal := &v040gov.TextProposal{ + Title: oldContent.Title, + Description: oldContent.Description, + } // Convert the content into Any. - contentAny, err := codectypes.NewAnyWithValue(oldContent) + contentAny, err := codectypes.NewAnyWithValue(protoProposal) + if err != nil { + panic(err) + } + + return contentAny + } + case v036distr.CommunityPoolSpendProposal: + { + protoProposal := &v040distr.CommunityPoolSpendProposal{ + Title: oldContent.Title, + Description: oldContent.Description, + Recipient: oldContent.Recipient.String(), + Amount: oldContent.Amount, + } + // Convert the content into Any. + contentAny, err := codectypes.NewAnyWithValue(protoProposal) if err != nil { panic(err) } diff --git a/x/gov/legacy/v040/migrate_test.go b/x/gov/legacy/v040/migrate_test.go new file mode 100644 index 0000000000..beefa9de57 --- /dev/null +++ b/x/gov/legacy/v040/migrate_test.go @@ -0,0 +1,128 @@ +package v040_test + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + v036distr "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v036" + v036gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v036" + v040gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v040" +) + +func TestMigrate(t *testing.T) { + encodingConfig := simapp.MakeEncodingConfig() + clientCtx := client.Context{}. + WithInterfaceRegistry(encodingConfig.InterfaceRegistry). + WithTxConfig(encodingConfig.TxConfig). + WithLegacyAmino(encodingConfig.Amino). + WithJSONMarshaler(encodingConfig.Marshaler) + + recipient, err := sdk.AccAddressFromBech32("cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh") + require.NoError(t, err) + govGenState := v036gov.GenesisState{ + Proposals: []v036gov.Proposal{ + { + Content: v036gov.TextProposal{ + Title: "foo_test", + Description: "bar_test", + }, + }, + { + Content: v036distr.CommunityPoolSpendProposal{ + Title: "foo_community", + Description: "bar_community", + Recipient: recipient, + Amount: sdk.NewCoins(sdk.NewCoin("footoken", sdk.NewInt(2))), + }, + }, + }, + } + + migrated := v040gov.Migrate(govGenState) + + bz, err := clientCtx.JSONMarshaler.MarshalJSON(migrated) + require.NoError(t, err) + + // Indent the JSON bz correctly. + var jsonObj map[string]interface{} + err = json.Unmarshal(bz, &jsonObj) + require.NoError(t, err) + indentedBz, err := json.MarshalIndent(jsonObj, "", " ") + require.NoError(t, err) + + // Make sure about: + // - TextProposal and CommunityPoolSpendProposal have correct any JSON. + expected := `{ + "deposit_params": { + "max_deposit_period": "0s", + "min_deposit": [] + }, + "deposits": [], + "proposals": [ + { + "content": { + "@type": "/cosmos.gov.v1beta1.TextProposal", + "description": "bar_test", + "title": "foo_test" + }, + "deposit_end_time": "0001-01-01T00:00:00Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "0" + }, + "proposal_id": "0", + "status": "PROPOSAL_STATUS_UNSPECIFIED", + "submit_time": "0001-01-01T00:00:00Z", + "total_deposit": [], + "voting_end_time": "0001-01-01T00:00:00Z", + "voting_start_time": "0001-01-01T00:00:00Z" + }, + { + "content": { + "@type": "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + "amount": [ + { + "amount": "2", + "denom": "footoken" + } + ], + "description": "bar_community", + "recipient": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh", + "title": "foo_community" + }, + "deposit_end_time": "0001-01-01T00:00:00Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "0" + }, + "proposal_id": "0", + "status": "PROPOSAL_STATUS_UNSPECIFIED", + "submit_time": "0001-01-01T00:00:00Z", + "total_deposit": [], + "voting_end_time": "0001-01-01T00:00:00Z", + "voting_start_time": "0001-01-01T00:00:00Z" + } + ], + "starting_proposal_id": "0", + "tally_params": { + "quorum": "0", + "threshold": "0", + "veto_threshold": "0" + }, + "votes": [], + "voting_params": { + "voting_period": "0s" + } +}` + + require.Equal(t, expected, string(indentedBz)) +} From 24e156bf620bd2e1acda9ddf41142ea5c2f5ee97 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Tue, 20 Oct 2020 19:18:20 +0200 Subject: [PATCH 60/84] gitignore: adding Emacs .dir-locals.el (#7610) --- .gitignore | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 912ca3e3c9..1755acca7e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,6 @@ *.swl *.swm *.swn -.vscode -.idea *.pyc # private files @@ -43,8 +41,10 @@ sim_log_file vagrant # IDE -.idea/ +.idea *.iml +.dir-locals.el +.vscode # Graphviz dependency-graph.png From 1542ecb18d5b1325cad82cca99bc80ae486cba35 Mon Sep 17 00:00:00 2001 From: yys Date: Wed, 21 Oct 2020 02:35:44 +0900 Subject: [PATCH 61/84] Bugfix gov votes querier to use votes params (#7589) * bugfix gov votes querier to use votes params * move partially used statement to the proper block Co-authored-by: Aleksandr Bezobchuk Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- x/gov/client/rest/query.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/x/gov/client/rest/query.go b/x/gov/client/rest/query.go index d526629be9..ffdbd8bc02 100644 --- a/x/gov/client/rest/query.go +++ b/x/gov/client/rest/query.go @@ -337,9 +337,7 @@ func queryVotesOnProposalHandlerFn(clientCtx client.Context) http.HandlerFunc { return } - params := types.NewQueryProposalVotesParams(proposalID, page, limit) - - bz, err := clientCtx.LegacyAmino.MarshalJSON(params) + bz, err := clientCtx.LegacyAmino.MarshalJSON(types.NewQueryProposalParams(proposalID)) if rest.CheckBadRequestError(w, err) { return } @@ -356,10 +354,17 @@ func queryVotesOnProposalHandlerFn(clientCtx client.Context) http.HandlerFunc { // For inactive proposals we must query the txs directly to get the votes // as they're no longer in state. + params := types.NewQueryProposalVotesParams(proposalID, page, limit) + propStatus := proposal.Status if !(propStatus == types.StatusVotingPeriod || propStatus == types.StatusDepositPeriod) { res, err = gcutils.QueryVotesByTxQuery(clientCtx, params) } else { + bz, err = clientCtx.LegacyAmino.MarshalJSON(params) + if rest.CheckBadRequestError(w, err) { + return + } + res, _, err = clientCtx.QueryWithData("custom/gov/votes", bz) } From c0122ad1b85555a305e681f8cd5fb86691136b4e Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Wed, 21 Oct 2020 10:08:20 +0200 Subject: [PATCH 62/84] update readme to link starport instead of scaffold (#7613) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3876341961..39904e8d51 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,9 @@ For more, please go to the [Cosmos SDK Docs](./docs/). The Cosmos Hub application, `gaia`, has moved to its [own repository](https://github.com/cosmos/gaia). Go there to join the Cosmos Hub mainnet and more. -## Scaffolding +## Starport -If you are starting a new app or a new module we provide a [scaffolding tool](https://github.com/cosmos/scaffold) to help you get started and speed up development. If you have any questions or find a bug, feel free to open an issue in the repo. +If you are starting a new app or a new module you can use [Starport](https://github.com/tendermint/starport) to help you get started and speed up development. If you have any questions or find a bug, feel free to open an issue in the repo. ## Disambiguation From 48bfd73aba8050565a757d651f312350a7716d9a Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Wed, 21 Oct 2020 16:47:31 +0200 Subject: [PATCH 63/84] Add background for sequence change in ADR-020 (#7616) --- docs/architecture/adr-020-protobuf-transaction-encoding.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture/adr-020-protobuf-transaction-encoding.md b/docs/architecture/adr-020-protobuf-transaction-encoding.md index 0e9a644a59..0c050c5d14 100644 --- a/docs/architecture/adr-020-protobuf-transaction-encoding.md +++ b/docs/architecture/adr-020-protobuf-transaction-encoding.md @@ -9,7 +9,7 @@ - 2020 May 14: Describe public key encoding - 2020 June 08: Store `TxBody` and `AuthInfo` as bytes in `SignDoc`; Document `TxRaw` as broadcast and storage type. - 2020 August 07: Use ADR 027 for serializing `SignDoc`. -- 2020 August 19: Move sequence field from `SignDoc` to `SignerInfo`. +- 2020 August 19: Move sequence field from `SignDoc` to `SignerInfo`, as discussed in [#6966](https://github.com/cosmos/cosmos-sdk/issues/6966). - 2020 September 25: Remove `PublicKey` type in favor of `secp256k1.PubKey`, `ed25519.PubKey` and `multisig.LegacyAminoPubKey`. - 2020 October 15: Add `GetAccount` and `GetAccountWithHeight` methods to the `AccountRetriever` interface. From f24ad5d00a463888baf6b4e5262e906a8cf03681 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Wed, 21 Oct 2020 12:03:18 -0400 Subject: [PATCH 64/84] ADR 028: Public Key Addresses (#7086) * ADR 028: Public Key Addresses * Cleanup * Address review comments * wording update. * Being more precise about nested addresses in multisig * Apply suggestions from code review Co-authored-by: Ethan Buchman * Address review comments * Address review comments * Address review comments * Describe sorting * Add abstract * Update status * Revert to sha256 Co-authored-by: Robert Zaremba Co-authored-by: Ethan Buchman Co-authored-by: Alessio Treglia --- docs/architecture/README.md | 2 +- .../adr-028-public-key-addresses.md | 168 ++++++++++++++++++ 2 files changed, 169 insertions(+), 1 deletion(-) create mode 100644 docs/architecture/adr-028-public-key-addresses.md diff --git a/docs/architecture/README.md b/docs/architecture/README.md index c4f3280053..9f17c094e1 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -54,7 +54,7 @@ Please add a entry below in your Pull Request for an ADR. - [ADR 025: IBC Passive Channels](./adr-025-ibc-passive-channels.md) - [ADR 026: IBC Client Recovery Mechanisms](./adr-026-ibc-client-recovery-mechanisms.md) - [ADR 027: Deterministic Protobuf Serialization](./adr-027-deterministic-protobuf-serialization.md) +- [ADR 028: Public Key Addresses](./adr-028-public-key-addresses.md) - [ADR 029: Fee Grant Module](./adr-029-fee-grant-module.md) - [ADR 031: Protobuf Msg Services](./adr-031-msg-service.md) - [ADR 032: Typed Events](./adr-032-typed-events.md) - diff --git a/docs/architecture/adr-028-public-key-addresses.md b/docs/architecture/adr-028-public-key-addresses.md new file mode 100644 index 0000000000..00c6dddc0b --- /dev/null +++ b/docs/architecture/adr-028-public-key-addresses.md @@ -0,0 +1,168 @@ +# ADR 028: Public Key Addresses + +## Changelog + +- 2020/08/18: Initial version + +## Status + +Proposed + +## Abstract + +This ADR defines a canonical 20-byte address format for new public key algorithms, multisig public keys, and module +accounts using string prefixes. + +## Context + +Issue [\#3685](https://github.com/cosmos/cosmos-sdk/issues/3685) identified that public key +address spaces are currently overlapping. One initial proposal was extending the address length and +adding prefixes for different types of addresses. + +@ethanfrey explained an alternate approach originally used in https://github.com/iov-one/weave: + +> I spent quite a bit of time thinking about this issue while building weave... The other cosmos Sdk. + +> Basically I define a condition to be a type and format as human readable string with some binary data appended. This condition is hashed into an Address (again at 20 bytes). The use of this prefix makes it impossible to find a preimage for a given address with a different condition (eg ed25519 vs secp256k1). + +> This is explained in depth here https://weave.readthedocs.io/en/latest/design/permissions.html + +> And the code is here, look mainly at the top where we process conditions. https://github.com/iov-one/weave/blob/master/conditions.go + +And explained how this approach should be sufficiently collision resistant: +> Yeah, AFAIK, 20 bytes should be collision resistance when the preimages are unique and not malleable. A space of 2^160 would expect some collision to be likely around 2^80 elements (birthday paradox). And if you want to find a collision for some existing element in the database, it is still 2^160. 2^80 only is if all these elements are written to state. + +> The good example you brought up was eg. a public key bytes being a valid public key on two algorithms supported by the codec. Meaning if either was broken, you would break accounts even if they were secured with the safer variant. This is only as the issue when no differentiating type info is present in the preimage (before hashing into an address). + +> I would like to hear an argument if the 20 bytes space is an actual issue for security, as I would be happy to increase my address sizes in weave. I just figured cosmos and ethereum and bitcoin all use 20 bytes, it should be good enough. And the arguments above which made me feel it was secure. But I have not done a deeper analysis. + +In discussions in [\#5694](https://github.com/cosmos/cosmos-sdk/issues/5694), we agreed to go with an +approach similar to this where essentially we take the first 20 bytes of the `sha256` hash of +the key type concatenated with the key bytes, summarized as `Sha256(KeyTypePrefix || Keybytes)[:20]`. + +## Decision + +### Legacy Public Key Addresses Don't Change + +`secp256k1` and multisig public keys are currently in use in existing Cosmos SDK zones. They use the following +address formats: + +- secp256k1: `ripemd160(sha256(pk_bytes))[:20]` +- legacy amino multisig: `sha256(aminoCdc.Marshal(pk))[:20]` + +We don't want to change existing addresses. So the addresses for these two key types will remain the same. + +The current multisig public keys use amino serialization to generate the address. We will retain +those public keys and their address formatting, and call them "legacy amino" multisig public keys +in protobuf. We will also create multisig public keys without amino addresses to be described below. + + +### Canonical Address Format + +We have three types of accounts we would like to create addresses for in the future: +- regular public key addresses for new signature algorithms (ex. `sr25519`). +- public key addresses for multisig public keys that don't use amino encoding +- module accounts: basically any accounts which cannot sign transactions and +which are managed internally by modules + +To address all of these use cases we propose the following basic `AddressHash` function, +based on the discussions in [\#5694](https://github.com/cosmos/cosmos-sdk/issues/5694): + +```go +func AddressHash(prefix string, contents []byte) []byte { + preImage := []byte(prefix) + if len(contents) != 0 { + preImage = append(preImage, 0) + preImage = append(preImage, contents...) + } + return sha256.Sum256(preImage)[:20] +} +``` + +`AddressHash` always take a string `prefix` as a starting point which should represent the +type of public key (ex. `sr25519`) or module account being used (ex. `staking` or `group`). +For public keys, the `contents` parameter is used to specify the binary contents of the public +key. For module accounts, `contents` can be left empty (for modules which don't manage "sub-accounts"), +or can be some module-specific content to specify different pools (ex. `bonded` or `not-bonded` for `staking`) +or managed accounts (ex. different accounts managed by the `group` module). + +In the `preImage`, the byte value `0` is used as the separator between `prefix` and `contents`. This is a logical +choice given that `0` is an invalid value for a string character and is commonly used as a null terminator. + +### Canonical Public Key Address Prefixes + +All public key types will have a unique protobuf message type such as: + +```proto +package cosmos.crypto.sr25519; + +message PubKey { + bytes key = 1; +} +``` + +All protobuf messages have unique fully qualified names, in this example `cosmos.crypto.sr25519.PubKey`. +These names are derived directly from .proto files in a standardized way and used +in other places such as the type URL in `Any`s. Since there is an easy and obvious +way to get this name for every protobuf type, we can use this message name as the +key type `prefix` when creating addresses. For all basic public keys, `contents` +should just be the raw unencoded public key bytes. + +Thus the canonical address for new public key types would be `AddressHash(proto.MessageName(pk), pk.Bytes)`. + +### Multisig Addresses + +For new multisig public keys, we define a custom address format not based on any encoding scheme +(amino or protobuf). This avoids issues with non-determinism in the encoding scheme. It also +ensures that multisig public keys which differ simply in the ordering of keys have the same +address by sorting child public keys first. + +First we define a proto message for multisig public keys: +```proto +package cosmos.crypto.multisig; + +message PubKey { + uint32 threshold = 1; + repeated google.protobuf.Any public_keys = 2; +} +``` + +We define the following `Address()` function for this public key: + +``` +func (multisig PubKey) Address() { + // first gather all the addresses of each nested public key + var addresses [][]byte + for key := range multisig.Keys { + addresses = append(joinedAddresses, key.Address()) + } + + // then sort them in ascending order + addresses = Sort(addresses) + + // then concatenate them together + var joinedAddresses []byte + for addr := range addresses { + joinedAddresses := append(joinedAddresses, addr...) + } + + // form the string prefix from the message name (cosmos.crypto.multisig.PubKey) and the threshold joined together + prefix := fmt.Sprintf("%s/%d", proto.MessageName(multisig), multisig.Threshold) + + // use the standard AddressHash function + return AddressHash(prefix, joinedAddresses) +} +``` + +## Consequences + +### Positive +- a simple algorithm for generating addresses for new public keys and module accounts + +### Negative +- addresses do not communicate key type, a prefixed approach would have done this + +### Neutral +- protobuf message names are used as key type prefixes + +## References From 55d7d0c9d11be8cb0425c03d42e37201855d5c67 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 21 Oct 2020 22:51:15 +0200 Subject: [PATCH 65/84] tests: add command to compile all test files (#7364) * tests: add command to compile all test files test-build-check will compile and use go cache mechanism to check if ALL files compiles without running any test. ref: 7362 * update comment * makefile: remove update-swagger-docs * Makefile: redoing the test check command * Update Makefile * Update Makefile Co-authored-by: Alessio Treglia --- Makefile | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index bd667b1c08..ab45bf98c2 100644 --- a/Makefile +++ b/Makefile @@ -175,16 +175,6 @@ go.sum: go.mod ### Documentation ### ############################################################################### -update-swagger-docs: statik - $(BINDIR)/statik -src=client/docs/swagger-ui -dest=client/docs -f -m - @if [ -n "$(git status --porcelain)" ]; then \ - echo "\033[91mSwagger docs are out of sync!!!\033[0m";\ - exit 1;\ - else \ - echo "\033[92mSwagger docs are in sync\033[0m";\ - fi -.PHONY: update-swagger-docs - godocs: @echo "--> Wait a few seconds and visit http://localhost:6060/pkg/github.com/cosmos/cosmos-sdk/types" godoc -http=:6060 @@ -222,21 +212,27 @@ TEST_TARGETS := test-unit test-unit-amino test-unit-proto test-ledger-mock test- # Test runs-specific rules. To add a new test target, just add # a new rule, customise ARGS or TEST_PACKAGES ad libitum, and # append the new rule to the TEST_TARGETS list. - test-unit: ARGS=-tags='cgo ledger test_ledger_mock norace' test-unit-amino: ARGS=-tags='ledger test_ledger_mock test_amino norace' test-ledger: ARGS=-tags='cgo ledger norace' test-ledger-mock: ARGS=-tags='ledger test_ledger_mock norace' test-race: ARGS=-race -tags='cgo ledger test_ledger_mock' test-race: TEST_PACKAGES=$(PACKAGES_NOSIMULATION) - $(TEST_TARGETS): run-tests +# check-* compiles and collects tests without running them +# note: go test -c doesn't support multiple packages yet (https://github.com/golang/go/issues/15513) +CHECK_TEST_TARGETS := test-unit test-unit-amino +check-test-unit: test-unit +check-test-unit-amino: test-unit-amino +$(CHECK_TEST_TARGETS): EXTRA_ARGS=-run=none +$(CHECK_TEST_TARGETS): run-tests + run-tests: ifneq (,$(shell which tparse 2>/dev/null)) - go test -mod=readonly -json $(ARGS) $(TEST_PACKAGES) | tparse + go test -mod=readonly -json $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES) | tparse else - go test -mod=readonly $(ARGS) $(TEST_PACKAGES) + go test -mod=readonly $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES) endif .PHONY: run-tests test test-all $(TEST_TARGETS) From 5bebf2bd39cd175ec8926804edf78d1084e3fe6f Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 23 Oct 2020 00:40:44 +0200 Subject: [PATCH 66/84] ADR: add a process proposal (#7621) * ADR: add a process proposal * wording update * Update docs/architecture/PROCESS.md Co-authored-by: Amaury Martiny * Update docs/architecture/PROCESS.md Co-authored-by: Amaury Martiny * Update docs/architecture/PROCESS.md Co-authored-by: Amaury Martiny * Add more details to status section and update the template * Update docs/architecture/PROCESS.md Co-authored-by: Aleksandr Bezobchuk * add a note about ADR pruning * use sequence numbers Co-authored-by: Amaury Martiny Co-authored-by: Aleksandr Bezobchuk Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- docs/architecture/PROCESS.md | 60 +++++++++++++++++++++++++++++++ docs/architecture/README.md | 29 ++++++++++----- docs/architecture/adr-template.md | 6 ++-- 3 files changed, 85 insertions(+), 10 deletions(-) create mode 100644 docs/architecture/PROCESS.md diff --git a/docs/architecture/PROCESS.md b/docs/architecture/PROCESS.md new file mode 100644 index 0000000000..4ed4621162 --- /dev/null +++ b/docs/architecture/PROCESS.md @@ -0,0 +1,60 @@ +# ADR Creation Process + +1. Copy the `adr-template.md` file. Use the following filename pattern: `adr-next_number-title.md` +2. Create a draft Pull Request if you want to get an early feedback. +3. Make sure the context and a solution is clear and well documented. +4. Add an entry to a list in the [README](./README.md) file. +5. Create a Pull Request to propose a new ADR. + + +## ADR life cycle + +ADR creation is an **iterative** process. Instead of trying to solve all decisions in a single ADR pull request, we MUST firstly understand the problem and collect feedback through a GitHub Issue. + +1. Every proposal SHOULD start with a new GitHub Issue or be a result of existing Issues. The Issue should contain just a brief proposal summary. + +2. Once the motivation is validated, a GitHub Pull Request (PR) is created with a new document based on the `adr-template.md`. + +3. An ADR doesn't have to arrive to `master` with an _accepted_ status in a single PR. If the motivation is clear and the solution is sound, we SHOULD be able to merge it and keep a _proposed_ status. It's preferable to have an iterative approach rather than long, not merged Pull Requests. + +4. If a _proposed_ ADR is merged, then it should clearly document outstanding issues either in ADR document notes or in a GitHub Issue. + +5. The PR SHOULD always be merged. In the case of a faulty ADR, we still prefer to merge it with a _rejected_ status. The only time the ADR SHOULD NOT be merged is if the author abandons it. + +6. Merged ADRs SHOULD NOT be pruned. + + +### ADR status + +Status has two components: + +``` +{CONSENSUS STATUS} {IMPLEMENTATION STATUS} +``` + +IMPLEMENTATION STATUS is either `Implemented` or `Not Implemented`. + +#### Consensus Status + +``` +DRAFT -> PROPOSED -> LAST CALL yyyy-mm-dd -> ACCEPTED | REJECTED -> SUPERSEEDED by ADR-xxx + \ | + \ | + v v + ABANDONED +``` + + ++ `DRAFT`: [optional] an ADR which is work in progress, not being ready for a general review. This is to present an early work and get an early feedback in a Draft Pull Request form. ++ `PROPOSED`: an ADR covering a full solution architecture and still in the review - project stakeholders haven't reached an agreed yet. ++ `LAST CALL `: [optional] clear notify that we are close to accept updates. Changing a status to `LAST CALL` means that social consensus (of Cosmos SDK maintainers) has been reached and we still want to give it a time to let the community react or analyze. ++ `ACCEPTED`: ADR which will represent a currently implemented or to be implemented architecture design. ++ `REJECTED`: ADR can go from PROPOSED or ACCEPTED to rejected if the consensus among project stakeholders will decide so. ++ `SUPERSEEDED by ADR-xxx`: ADR which has been superseded by a new ADR. ++ `ABANDONED`: the ADR is no longer pursued by the original authors. + + +## Language used in ADR + ++ The context/background should be written in the present tense. ++ Avoid using a first, personal form. diff --git a/docs/architecture/README.md b/docs/architecture/README.md index 9f17c094e1..6d4c2a2ac0 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -8,8 +8,15 @@ parent: This is a location to record all high-level architecture decisions in the Cosmos-SDK. +An Architectural Decision (**AD**) is a software design choice that addresses a functional or non-functional requirement that is architecturally significant. +An Architecturally Significant Requirement (**ASR**) is a requirement that has a measurable effect on a software system’s architecture and quality. +An Architectural Decision Record (**ADR**) captures a single AD, such as often done when writing personal notes or meeting minutes; the collection of ADRs created and maintained in a project constitute its decision log. All these are within the topic of Architectural Knowledge Management (AKM). + You can read more about the ADR concept in this [blog post](https://product.reverb.com/documenting-architecture-decisions-the-reverb-way-a3563bb24bd0#.78xhdix6t). +## Rationale + +ADRs are intended to be the primary mechanism for proposing new feature designs and new processes, for collecting community input on an issue, and for documenting the design decisions. An ADR should provide: - Context on the relevant goals and the current state @@ -25,19 +32,29 @@ it stands today. If recorded decisions turned out to be lacking, convene a discussion, record the new decisions here, and then modify the code to match. -Note the context/background should be written in the present tense. -Please add a entry below in your Pull Request for an ADR. +## Creating new ADR + +Read about the [PROCESS](./PROCESS.md). ## ADR Table of Contents +### Accepted + - [ADR 001: Coin Source Tracing](./adr-001-coin-source-tracing.md) - [ADR 002: SDK Documentation Structure](./adr-002-docs-structure.md) -- [ADR 003: Dynamic Capability Store](./adr-003-dynamic-capability-store.md) -- [ADR 004: Split Denomination Keys](./adr-004-split-denomination-keys.md) - [ADR 006: Secret Store Replacement](./adr-006-secret-store-replacement.md) - [ADR 009: Evidence Module](./adr-009-evidence-module.md) - [ADR 010: Modular AnteHandler](./adr-010-modular-antehandler.md) +- [ADR 019: Protocol Buffer State Encoding](./adr-019-protobuf-state-encoding.md) +- [ADR 020: Protocol Buffer Transaction Encoding](./adr-020-protobuf-transaction-encoding.md) +- [ADR 026: IBC Client Recovery Mechanisms](./adr-026-ibc-client-recovery-mechanisms.md) +- [ADR 029: Fee Grant Module](./adr-029-fee-grant-module.md) + +### Proposed + +- [ADR 003: Dynamic Capability Store](./adr-003-dynamic-capability-store.md) +- [ADR 004: Split Denomination Keys](./adr-004-split-denomination-keys.md) - [ADR 011: Generalize Genesis Accounts](./adr-011-generalize-genesis-accounts.md) - [ADR 012: State Accessors](./adr-012-state-accessors.md) - [ADR 013: Metrics](./adr-013-metrics.md) @@ -45,16 +62,12 @@ Please add a entry below in your Pull Request for an ADR. - [ADR 016: Validator Consensus Key Rotation](./adr-016-validator-consensus-key-rotation.md) - [ADR 017: Historical Header Module](./adr-017-historical-header-module.md) - [ADR 018: Extendable Voting Periods](./adr-018-extendable-voting-period.md) -- [ADR 019: Protocol Buffer State Encoding](./adr-019-protobuf-state-encoding.md) -- [ADR 020: Protocol Buffer Transaction Encoding](./adr-020-protobuf-transaction-encoding.md) - [ADR 021: Protocol Buffer Query Encoding](./adr-021-protobuf-query-encoding.md) - [ADR 022: Custom baseapp panic handling](./adr-022-custom-panic-handling.md) - [ADR 023: Protocol Buffer Naming and Versioning](./adr-023-protobuf-naming.md) - [ADR 024: Coin Metadata](./adr-024-coin-metadata.md) - [ADR 025: IBC Passive Channels](./adr-025-ibc-passive-channels.md) -- [ADR 026: IBC Client Recovery Mechanisms](./adr-026-ibc-client-recovery-mechanisms.md) - [ADR 027: Deterministic Protobuf Serialization](./adr-027-deterministic-protobuf-serialization.md) - [ADR 028: Public Key Addresses](./adr-028-public-key-addresses.md) -- [ADR 029: Fee Grant Module](./adr-029-fee-grant-module.md) - [ADR 031: Protobuf Msg Services](./adr-031-msg-service.md) - [ADR 032: Typed Events](./adr-032-typed-events.md) diff --git a/docs/architecture/adr-template.md b/docs/architecture/adr-template.md index 3d3a46a175..89e36847b3 100644 --- a/docs/architecture/adr-template.md +++ b/docs/architecture/adr-template.md @@ -6,8 +6,10 @@ ## Status -> A decision may be "proposed" if the project stakeholders haven't agreed with it yet, or "accepted" once it is agreed. If a later ADR changes or reverses a decision, it may be marked as "deprecated" or "superseded" with a reference to its replacement. -> {Deprecated|Proposed|Accepted} {Implemented|Not Implemented} +{DRAFT | PROPOSED} Not Implemented + +> Please have a look at the [PROCESS](./PROCESS.md#adr-status) page. +> Use DRAFT if the ADR is in a draft stage (draft PR) or PROPOSED if it's in review. ## Abstract From 6bc8ff2dfe3ee175a6659092eab6b2526099840a Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 23 Oct 2020 14:07:52 +0200 Subject: [PATCH 67/84] Use any as validator pubkey (#7597) * protobuf pubkey type update * wip2 * wip3 * solving types.NewValidator issues * remove bech32 from validator type assignment * update Validator interface * Changelog update * wip4 * update genutil * fix simapp & x/ibc/testing tests * update staking * changelog update * fix import cycle in tests * fix amino panic on TestValidatorMarshalUnmarshalJSON * fix TestValidatorMarshalUnmarshalJSON consensus_pubkey check * Add UnpackInterfaces to HistoricalInfo * fix TestHistoricalInfo * update todos * fix: Expecting ed25519.PubKey to implement proto.Message * fix linter issues * Fix migrate test * Update CHANGELOG.md Co-authored-by: Marie Gauthier * review comments * cosmetic changes * add UnpackInterfaces got GenesisRandomized test * Validator.Equal reuses Validator.MinEqual * fix test * use Validator.Equal in tests * Fix staking simulation TestRandomizedGenState * Remove TODO * use HistoricalInfo.Equal * use proto.Equal * rename Validator.GetConsPubKey to TmConsPubKey * prefer require.Equal over reflect.DeepEqual * SetHistoricalInfo using a pointer * Fix TestQueryDelegation test * Fix TestQueryValidators test * Fix TestSimulateMsgUnjail test * experiement with LegacyAmino instances * Register codecs in all simapp tests * Fix cli_test compilation problems * fix typo sdk -> std * fix typo * fix TestPlanStringer * Rename to MakeEncodingConfig * Remove RegisterCodecsTests * Use gRPC in GetCmdQueryValidators * Empty status * fix info log check * linter fixes * rename simapparams to simappparams * Update simapp/test_helpers.go Co-authored-by: Marie Gauthier * comments updates * use valAddr1 instead of sdk.ValAddress(pk1.Address().Bytes()) Co-authored-by: Cory Levinson Co-authored-by: Amaury Martiny Co-authored-by: Marie Gauthier --- CHANGELOG.md | 9 +- client/query.go | 13 - codec/amino.go | 2 + crypto/codec/proto.go | 4 +- proto/cosmos/staking/v1beta1/staking.proto | 17 +- proto/cosmos/staking/v1beta1/tx.proto | 16 +- simapp/encoding.go | 6 +- simapp/export.go | 9 +- simapp/params/proto.go | 9 +- simapp/sim_bench_test.go | 2 + simapp/sim_test.go | 5 + simapp/state.go | 6 +- simapp/test_helpers.go | 10 +- x/auth/module.go | 4 +- x/auth/simulation/genesis.go | 6 +- x/auth/simulation/params.go | 3 +- x/auth/types/genesis.go | 4 + x/distribution/simulation/operations_test.go | 10 +- x/evidence/types/tx.pb.go | 4 +- x/genutil/genesis.go | 9 +- x/genutil/gentx.go | 2 +- x/genutil/module.go | 6 +- x/genutil/types/expected_keepers.go | 2 +- x/gov/client/utils/query_test.go | 5 +- x/gov/keeper/common_test.go | 14 +- x/gov/keeper/grpc_query_test.go | 2 +- x/gov/keeper/tally_test.go | 36 +- x/gov/types/tx.pb.go | 2 +- x/ibc/core/02-client/keeper/keeper_test.go | 7 +- x/ibc/testing/chain.go | 7 +- x/simulation/params.go | 10 +- x/simulation/simulate.go | 8 +- x/slashing/genesis.go | 6 +- x/slashing/keeper/hooks.go | 13 +- x/slashing/keeper/unjail.go | 6 +- x/slashing/simulation/operations.go | 6 +- x/slashing/simulation/operations_test.go | 10 +- x/staking/client/cli/cli_test.go | 7 +- x/staking/client/cli/query.go | 19 +- x/staking/genesis.go | 37 +- x/staking/genesis_test.go | 18 +- x/staking/handler_test.go | 36 +- x/staking/keeper/common_test.go | 9 +- x/staking/keeper/delegation_test.go | 54 +- x/staking/keeper/grpc_query_test.go | 20 +- x/staking/keeper/historical_info.go | 11 +- x/staking/keeper/historical_info_test.go | 24 +- x/staking/keeper/keeper_test.go | 4 +- x/staking/keeper/msg_server.go | 5 +- x/staking/keeper/querier.go | 2 +- x/staking/keeper/querier_test.go | 48 +- x/staking/keeper/query_utils.go | 2 +- x/staking/keeper/slash_test.go | 19 +- x/staking/keeper/test_common.go | 20 +- x/staking/keeper/val_state_change.go | 52 +- x/staking/keeper/validator.go | 17 +- x/staking/keeper/validator_test.go | 182 +-- x/staking/legacy/v040/migrate.go | 8 +- x/staking/legacy/v040/migrate_test.go | 7 +- x/staking/simulation/decoder_test.go | 3 +- x/staking/simulation/genesis.go | 7 +- x/staking/simulation/genesis_test.go | 4 +- x/staking/simulation/operations_test.go | 3 +- x/staking/teststaking/validator.go | 18 + x/staking/types/data_test.go | 12 + x/staking/types/exported.go | 4 +- x/staking/types/genesis.go | 11 + x/staking/types/historical_info.go | 34 +- x/staking/types/historical_info_test.go | 32 +- x/staking/types/keys_test.go | 3 +- x/staking/types/staking.pb.go | 1472 +++++++++--------- x/staking/types/tx.pb.go | 109 +- x/staking/types/validator.go | 110 +- x/staking/types/validator_test.go | 122 +- x/upgrade/abci_test.go | 6 +- x/upgrade/types/plan.go | 2 +- x/upgrade/types/plan_test.go | 8 +- 77 files changed, 1547 insertions(+), 1304 deletions(-) create mode 100644 x/staking/teststaking/validator.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dcf673cba..8c60d7ed2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,11 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking * (AppModule) [\#7518](https://github.com/cosmos/cosmos-sdk/pull/7518) [\#7584](https://github.com/cosmos/cosmos-sdk/pull/7584) Rename `AppModule.RegisterQueryServices` to `AppModule.RegisterServices`, as this method now registers multiple services (the gRPC query service and the protobuf Msg service). A `Configurator` struct is used to hold the different services. +* (x/staking/types) [\#7447](https://github.com/cosmos/cosmos-sdk/issues/7447) Remove bech32 PubKey support: + * `ValidatorI` interface update. `GetConsPubKey` renamed to `TmConsPubKey` (consensus public key must be a tendermint key). `TmConsPubKey`, `GetConsAddr` methods return error. + * `Validator` update. Methods changed in `ValidatorI` (as described above) and `ToTmValidator` return error. + * `Validator.ConsensusPubkey` type changed from `string` to `codectypes.Any`. + * `MsgCreateValidator.Pubkey` type changed from `string` to `codectypes.Any`. ### Features @@ -165,7 +170,7 @@ of the Cosmos SDK since launch. Please read through this changelog and [release * `NewAnteHandler` and `NewSigVerificationDecorator` both now take a `SignModeHandler` parameter. * `SignatureVerificationGasConsumer` now has the signature: `func(meter sdk.GasMeter, sig signing.SignatureV2, params types.Params) error`. * The `SigVerifiableTx` interface now has a `GetSignaturesV2() ([]signing.SignatureV2, error)` method and no longer has the `GetSignBytes` method. - + ### State Machine Breaking * __General__ @@ -358,7 +363,7 @@ falling below their minimum self-delegation and never having been bonded. The va * (x/auth) [\#6861](https://github.com/cosmos/cosmos-sdk/pull/6861) Remove public key Bech32 encoding for all account types for JSON serialization, instead relying on direct Amino encoding. In addition, JSON serialization utilizes Amino instead of the Go stdlib, so integers are treated as strings. -### Improvements +### Improvements * (client) [\#6853](https://github.com/cosmos/cosmos-sdk/pull/6853) Add --unsafe-cors flag. diff --git a/client/query.go b/client/query.go index ac08da855c..18a5c3c2f4 100644 --- a/client/query.go +++ b/client/query.go @@ -52,19 +52,6 @@ func (ctx Context) QueryABCI(req abci.RequestQuery) (abci.ResponseQuery, error) return ctx.queryABCI(req) } -// QuerySubspace performs a query to a Tendermint node with the provided -// store name and subspace. It returns key value pair and height of the query -// upon success or an error if the query fails. -func (ctx Context) QuerySubspace(subspace []byte, storeName string) (res []sdk.KVPair, height int64, err error) { - resRaw, height, err := ctx.queryStore(subspace, storeName, "subspace") - if err != nil { - return res, height, err - } - - ctx.LegacyAmino.MustUnmarshalBinaryBare(resRaw, &res) - return -} - // GetFromAddress returns the from address from the context's name. func (ctx Context) GetFromAddress() sdk.AccAddress { return ctx.FromAddress diff --git a/codec/amino.go b/codec/amino.go index f34713a9b0..78fd650ca4 100644 --- a/codec/amino.go +++ b/codec/amino.go @@ -139,6 +139,7 @@ func (cdc *LegacyAmino) MustUnmarshalBinaryLengthPrefixed(bz []byte, ptr interfa } } +// MarshalJSON implements codec.Marshaler interface func (cdc *LegacyAmino) MarshalJSON(o interface{}) ([]byte, error) { err := cdc.jsonMarshalAnys(o) if err != nil { @@ -155,6 +156,7 @@ func (cdc *LegacyAmino) MustMarshalJSON(o interface{}) []byte { return bz } +// UnmarshalJSON implements codec.Marshaler interface func (cdc *LegacyAmino) UnmarshalJSON(bz []byte, ptr interface{}) error { err := cdc.Amino.UnmarshalJSON(bz, ptr) if err != nil { diff --git a/crypto/codec/proto.go b/crypto/codec/proto.go index 0afdc6c706..845e60bf82 100644 --- a/crypto/codec/proto.go +++ b/crypto/codec/proto.go @@ -15,12 +15,12 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { // TODO We now register both Tendermint's PubKey and our own PubKey. In the // long-term, we should move away from Tendermint's PubKey, and delete // these lines. - registry.RegisterInterface("tendermint.crypto.Pubkey", (*tmcrypto.PubKey)(nil)) + registry.RegisterInterface("tendermint.crypto.PubKey", (*tmcrypto.PubKey)(nil)) registry.RegisterImplementations((*tmcrypto.PubKey)(nil), &ed25519.PubKey{}) registry.RegisterImplementations((*tmcrypto.PubKey)(nil), &secp256k1.PubKey{}) registry.RegisterImplementations((*tmcrypto.PubKey)(nil), &multisig.LegacyAminoPubKey{}) - registry.RegisterInterface("cosmos.crypto.Pubkey", (*cryptotypes.PubKey)(nil)) + registry.RegisterInterface("cosmos.crypto.PubKey", (*cryptotypes.PubKey)(nil)) registry.RegisterImplementations((*cryptotypes.PubKey)(nil), &ed25519.PubKey{}) registry.RegisterImplementations((*cryptotypes.PubKey)(nil), &secp256k1.PubKey{}) registry.RegisterImplementations((*cryptotypes.PubKey)(nil), &multisig.LegacyAminoPubKey{}) diff --git a/proto/cosmos/staking/v1beta1/staking.proto b/proto/cosmos/staking/v1beta1/staking.proto index 7201b7fa01..ac68af05f4 100644 --- a/proto/cosmos/staking/v1beta1/staking.proto +++ b/proto/cosmos/staking/v1beta1/staking.proto @@ -2,10 +2,13 @@ syntax = "proto3"; package cosmos.staking.v1beta1; import "gogoproto/gogo.proto"; -import "tendermint/types/types.proto"; -import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "tendermint/types/types.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; @@ -73,10 +76,12 @@ message Validator { option (gogoproto.goproto_getters) = false; string operator_address = 1 [(gogoproto.moretags) = "yaml:\"operator_address\""]; - string consensus_pubkey = 2 [(gogoproto.moretags) = "yaml:\"consensus_pubkey\""]; - bool jailed = 3; - BondStatus status = 4; - string tokens = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + google.protobuf.Any consensus_pubkey = 2 [ + (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey", + (gogoproto.moretags) = "yaml:\"consensus_pubkey\""]; + bool jailed = 3; + BondStatus status = 4; + string tokens = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; string delegator_shares = 6 [ (gogoproto.moretags) = "yaml:\"delegator_shares\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", diff --git a/proto/cosmos/staking/v1beta1/tx.proto b/proto/cosmos/staking/v1beta1/tx.proto index 60aecd9513..389957091d 100644 --- a/proto/cosmos/staking/v1beta1/tx.proto +++ b/proto/cosmos/staking/v1beta1/tx.proto @@ -1,11 +1,13 @@ syntax = "proto3"; package cosmos.staking.v1beta1; -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "google/protobuf/timestamp.proto"; -import "cosmos/staking/v1beta1/staking.proto"; import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/staking/v1beta1/staking.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; @@ -44,7 +46,7 @@ message MsgCreateValidator { ]; string delegator_address = 4 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; string validator_address = 5 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - google.protobuf.Any pubkey = 6; + google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false]; } @@ -104,7 +106,7 @@ message MsgBeginRedelegate { } // MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. -message MsgBeginRedelegateResponse { +message MsgBeginRedelegateResponse { google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } @@ -120,6 +122,6 @@ message MsgUndelegate { } // MsgUndelegateResponse defines the Msg/Undelegate response type. -message MsgUndelegateResponse { +message MsgUndelegateResponse { google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } diff --git a/simapp/encoding.go b/simapp/encoding.go index 0ceb122743..2621d3e86d 100644 --- a/simapp/encoding.go +++ b/simapp/encoding.go @@ -1,13 +1,13 @@ package simapp import ( - "github.com/cosmos/cosmos-sdk/simapp/params" + simappparams "github.com/cosmos/cosmos-sdk/simapp/params" "github.com/cosmos/cosmos-sdk/std" ) // MakeEncodingConfig creates an EncodingConfig for testing -func MakeEncodingConfig() params.EncodingConfig { - encodingConfig := params.MakeEncodingConfig() +func MakeEncodingConfig() simappparams.EncodingConfig { + encodingConfig := simappparams.MakeEncodingConfig() std.RegisterLegacyAminoCodec(encodingConfig.Amino) std.RegisterInterfaces(encodingConfig.InterfaceRegistry) ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) diff --git a/simapp/export.go b/simapp/export.go index 7105eca7fc..887308d30a 100644 --- a/simapp/export.go +++ b/simapp/export.go @@ -35,13 +35,13 @@ func (app *SimApp) ExportAppStateAndValidators( return servertypes.ExportedApp{}, err } - validators := staking.WriteValidators(ctx, app.StakingKeeper) + validators, err := staking.WriteValidators(ctx, app.StakingKeeper) return servertypes.ExportedApp{ AppState: appState, Validators: validators, Height: height, ConsensusParams: app.BaseApp.GetConsensusParams(ctx), - }, nil + }, err } // prepare for fresh start at zero height @@ -174,7 +174,10 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] iter.Close() - _ = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + if err != nil { + log.Fatal(err) + } /* Handle slashing state. */ diff --git a/simapp/params/proto.go b/simapp/params/proto.go index 7bcdffe405..63ae791a4f 100644 --- a/simapp/params/proto.go +++ b/simapp/params/proto.go @@ -8,17 +8,16 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/tx" ) -// MakeEncodingConfig creates an EncodingConfig for an amino based test configuration. +// MakeEncodingConfig creates an EncodingConfig for a non-amino based test configuration. func MakeEncodingConfig() EncodingConfig { - amino := codec.NewLegacyAmino() + cdc := codec.NewLegacyAmino() interfaceRegistry := types.NewInterfaceRegistry() marshaler := codec.NewProtoCodec(interfaceRegistry) - txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes) return EncodingConfig{ InterfaceRegistry: interfaceRegistry, Marshaler: marshaler, - TxConfig: txCfg, - Amino: amino, + TxConfig: tx.NewTxConfig(marshaler, tx.DefaultSignModes), + Amino: cdc, } } diff --git a/simapp/sim_bench_test.go b/simapp/sim_bench_test.go index 97ab481358..660e0fb8f0 100644 --- a/simapp/sim_bench_test.go +++ b/simapp/sim_bench_test.go @@ -39,6 +39,7 @@ func BenchmarkFullAppSimulation(b *testing.B) { SimulationOperations(app, app.AppCodec(), config), app.ModuleAccountAddrs(), config, + app.AppCodec(), ) // export state and simParams before the simulation error is checked @@ -83,6 +84,7 @@ func BenchmarkInvariants(b *testing.B) { SimulationOperations(app, app.AppCodec(), config), app.ModuleAccountAddrs(), config, + app.AppCodec(), ) // export state and simParams before the simulation error is checked diff --git a/simapp/sim_test.go b/simapp/sim_test.go index b1b28a9c51..ad3633132d 100644 --- a/simapp/sim_test.go +++ b/simapp/sim_test.go @@ -81,6 +81,7 @@ func TestFullAppSimulation(t *testing.T) { SimulationOperations(app, app.AppCodec(), config), app.ModuleAccountAddrs(), config, + app.AppCodec(), ) // export state and simParams before the simulation error is checked @@ -118,6 +119,7 @@ func TestAppImportExport(t *testing.T) { SimulationOperations(app, app.AppCodec(), config), app.ModuleAccountAddrs(), config, + app.AppCodec(), ) // export state and simParams before the simulation error is checked @@ -214,6 +216,7 @@ func TestAppSimulationAfterImport(t *testing.T) { SimulationOperations(app, app.AppCodec(), config), app.ModuleAccountAddrs(), config, + app.AppCodec(), ) // export state and simParams before the simulation error is checked @@ -261,6 +264,7 @@ func TestAppSimulationAfterImport(t *testing.T) { SimulationOperations(newApp, newApp.AppCodec(), config), app.ModuleAccountAddrs(), config, + app.AppCodec(), ) require.NoError(t, err) } @@ -311,6 +315,7 @@ func TestAppStateDeterminism(t *testing.T) { SimulationOperations(app, app.AppCodec(), config), app.ModuleAccountAddrs(), config, + app.AppCodec(), ) require.NoError(t, err) diff --git a/simapp/state.go b/simapp/state.go index 62a19e7f64..3eb9afd375 100644 --- a/simapp/state.go +++ b/simapp/state.go @@ -13,7 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - simapparams "github.com/cosmos/cosmos-sdk/simapp/params" + simappparams "github.com/cosmos/cosmos-sdk/simapp/params" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -85,11 +85,11 @@ func AppStateRandomizedFn( // number of bonded accounts var initialStake, numInitiallyBonded int64 appParams.GetOrGenerate( - cdc, simapparams.StakePerAccount, &initialStake, r, + cdc, simappparams.StakePerAccount, &initialStake, r, func(r *rand.Rand) { initialStake = r.Int63n(1e12) }, ) appParams.GetOrGenerate( - cdc, simapparams.InitiallyBondedValidators, &numInitiallyBonded, r, + cdc, simappparams.InitiallyBondedValidators, &numInitiallyBonded, r, func(r *rand.Rand) { numInitiallyBonded = int64(r.Intn(300)) }, ) diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index e795394000..8da319b216 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -19,6 +19,7 @@ import ( bam "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/simapp/helpers" sdk "github.com/cosmos/cosmos-sdk/types" @@ -92,9 +93,16 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs bondAmt := sdk.NewInt(1000000) for _, val := range valSet.Validators { + // Currently validator requires tmcrypto.ed25519 keys, which don't support + // our Marshaling interfaces, so we need to pack them into our version of ed25519. + // There is ongoing work to add secp256k1 keys (https://github.com/cosmos/cosmos-sdk/pull/7604). + pk, err := ed25519.FromTmEd25519(val.PubKey) + require.NoError(t, err) + pkAny, err := codectypes.PackAny(pk) + require.NoError(t, err) validator := stakingtypes.Validator{ OperatorAddress: sdk.ValAddress(val.Address).String(), - ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, val.PubKey), + ConsensusPubkey: pkAny, Jailed: false, Status: stakingtypes.Bonded, Tokens: bondAmt, diff --git a/x/auth/module.go b/x/auth/module.go index 21e43bef26..55b5dc7fbb 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -92,11 +92,11 @@ type AppModule struct { AppModuleBasic accountKeeper keeper.AccountKeeper - randGenAccountsFn simulation.RandomGenesisAccountsFn + randGenAccountsFn types.RandomGenesisAccountsFn } // NewAppModule creates a new AppModule object -func NewAppModule(cdc codec.Marshaler, accountKeeper keeper.AccountKeeper, randGenAccountsFn simulation.RandomGenesisAccountsFn) AppModule { +func NewAppModule(cdc codec.Marshaler, accountKeeper keeper.AccountKeeper, randGenAccountsFn types.RandomGenesisAccountsFn) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{}, accountKeeper: accountKeeper, diff --git a/x/auth/simulation/genesis.go b/x/auth/simulation/genesis.go index f04ca34baf..2da36b54fa 100644 --- a/x/auth/simulation/genesis.go +++ b/x/auth/simulation/genesis.go @@ -21,10 +21,6 @@ const ( SigVerifyCostSECP256K1 = "sig_verify_cost_secp256k1" ) -// RandomGenesisAccountsFn defines the function required to generate custom account types -// on the auth module simulation. -type RandomGenesisAccountsFn func(simState *module.SimulationState) types.GenesisAccounts - // RandomGenesisAccounts defines the default RandomGenesisAccountsFn used on the SDK. // It creates a slice of BaseAccount, ContinuousVestingAccount and DelayedVestingAccount. func RandomGenesisAccounts(simState *module.SimulationState) types.GenesisAccounts { @@ -92,7 +88,7 @@ func GenSigVerifyCostSECP256K1(r *rand.Rand) uint64 { } // RandomizedGenState generates a random GenesisState for auth -func RandomizedGenState(simState *module.SimulationState, randGenAccountsFn RandomGenesisAccountsFn) { +func RandomizedGenState(simState *module.SimulationState, randGenAccountsFn types.RandomGenesisAccountsFn) { var maxMemoChars uint64 simState.AppParams.GetOrGenerate( simState.Cdc, MaxMemoChars, &maxMemoChars, simState.Rand, diff --git a/x/auth/simulation/params.go b/x/auth/simulation/params.go index a9240276ac..5ce9ac95fc 100644 --- a/x/auth/simulation/params.go +++ b/x/auth/simulation/params.go @@ -6,10 +6,9 @@ import ( "fmt" "math/rand" - "github.com/cosmos/cosmos-sdk/x/simulation" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/simulation" ) const ( diff --git a/x/auth/types/genesis.go b/x/auth/types/genesis.go index 9dc9e3323b..2b33aa3a5a 100644 --- a/x/auth/types/genesis.go +++ b/x/auth/types/genesis.go @@ -9,10 +9,14 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/types/module" ) var _ types.UnpackInterfacesMessage = GenesisState{} +// RandomGenesisAccountsFn defines the function required to generate custom account types +type RandomGenesisAccountsFn func(simState *module.SimulationState) GenesisAccounts + // NewGenesisState - Create a new genesis state func NewGenesisState(params Params, accounts GenesisAccounts) *GenesisState { genAccounts, err := PackAccounts(accounts) diff --git a/x/distribution/simulation/operations_test.go b/x/distribution/simulation/operations_test.go index 6c6903fbf8..4a3dff3087 100644 --- a/x/distribution/simulation/operations_test.go +++ b/x/distribution/simulation/operations_test.go @@ -243,13 +243,15 @@ func (suite *SimTestSuite) getTestingValidator0(accounts []simtypes.Account) sta } func (suite *SimTestSuite) getTestingValidator(accounts []simtypes.Account, commission stakingtypes.Commission, n int) stakingtypes.Validator { + require := suite.Require() account := accounts[n] valPubKey := account.PubKey valAddr := sdk.ValAddress(account.PubKey.Address().Bytes()) - validator := stakingtypes.NewValidator(valAddr, valPubKey, stakingtypes.Description{}) - validator, err := validator.SetInitialCommission(commission) - suite.Require().NoError(err) - + validator, err := stakingtypes.NewValidator(valAddr, valPubKey, stakingtypes. + Description{}) + require.NoError(err) + validator, err = validator.SetInitialCommission(commission) + require.NoError(err) validator.DelegatorShares = sdk.NewDec(100) validator.Tokens = sdk.NewInt(1000000) diff --git a/x/evidence/types/tx.pb.go b/x/evidence/types/tx.pb.go index 5dc9c0fb6c..d2a2f563e1 100644 --- a/x/evidence/types/tx.pb.go +++ b/x/evidence/types/tx.pb.go @@ -185,7 +185,7 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // Send submits an arbitrary Evidence of misbehavior such as equivocation or + // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or // counterfactual signing. SubmitEvidence(ctx context.Context, in *MsgSubmitEvidence, opts ...grpc.CallOption) (*MsgSubmitEvidenceResponse, error) } @@ -209,7 +209,7 @@ func (c *msgClient) SubmitEvidence(ctx context.Context, in *MsgSubmitEvidence, o // MsgServer is the server API for Msg service. type MsgServer interface { - // Send submits an arbitrary Evidence of misbehavior such as equivocation or + // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or // counterfactual signing. SubmitEvidence(context.Context, *MsgSubmitEvidence) (*MsgSubmitEvidenceResponse, error) } diff --git a/x/genutil/genesis.go b/x/genutil/genesis.go index 9a155cfa1e..c6d17edb8d 100644 --- a/x/genutil/genesis.go +++ b/x/genutil/genesis.go @@ -13,12 +13,9 @@ func InitGenesis( ctx sdk.Context, stakingKeeper types.StakingKeeper, deliverTx deliverTxfn, genesisState types.GenesisState, txEncodingConfig client.TxEncodingConfig, -) []abci.ValidatorUpdate { - - var validators []abci.ValidatorUpdate +) (validators []abci.ValidatorUpdate, err error) { if len(genesisState.GenTxs) > 0 { - validators = DeliverGenTxs(ctx, genesisState.GenTxs, stakingKeeper, deliverTx, txEncodingConfig) + validators, err = DeliverGenTxs(ctx, genesisState.GenTxs, stakingKeeper, deliverTx, txEncodingConfig) } - - return validators + return } diff --git a/x/genutil/gentx.go b/x/genutil/gentx.go index 10849bde78..b5415ffb31 100644 --- a/x/genutil/gentx.go +++ b/x/genutil/gentx.go @@ -95,7 +95,7 @@ func DeliverGenTxs( ctx sdk.Context, genTxs []json.RawMessage, stakingKeeper types.StakingKeeper, deliverTx deliverTxfn, txEncodingConfig client.TxEncodingConfig, -) []abci.ValidatorUpdate { +) ([]abci.ValidatorUpdate, error) { for _, genTx := range genTxs { tx, err := txEncodingConfig.TxJSONDecoder()(genTx) diff --git a/x/genutil/module.go b/x/genutil/module.go index 0280ffa3a3..711e5a6884 100644 --- a/x/genutil/module.go +++ b/x/genutil/module.go @@ -98,7 +98,11 @@ func NewAppModule(accountKeeper types.AccountKeeper, func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate { var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) - return InitGenesis(ctx, am.stakingKeeper, am.deliverTx, genesisState, am.txEncodingConfig) + validators, err := InitGenesis(ctx, am.stakingKeeper, am.deliverTx, genesisState, am.txEncodingConfig) + if err != nil { + panic(err) + } + return validators } // ExportGenesis returns the exported genesis state as raw bytes for the genutil diff --git a/x/genutil/types/expected_keepers.go b/x/genutil/types/expected_keepers.go index 62d8d48f15..341d2eb2c8 100644 --- a/x/genutil/types/expected_keepers.go +++ b/x/genutil/types/expected_keepers.go @@ -13,7 +13,7 @@ import ( // StakingKeeper defines the expected staking keeper (noalias) type StakingKeeper interface { - ApplyAndReturnValidatorSetUpdates(sdk.Context) (updates []abci.ValidatorUpdate) + ApplyAndReturnValidatorSetUpdates(sdk.Context) (updates []abci.ValidatorUpdate, err error) } // AccountKeeper defines the expected account keeper (noalias) diff --git a/x/gov/client/utils/query_test.go b/x/gov/client/utils/query_test.go index 57d36c5914..c6f999e86e 100644 --- a/x/gov/client/utils/query_test.go +++ b/x/gov/client/utils/query_test.go @@ -4,9 +4,6 @@ import ( "context" "testing" - "github.com/cosmos/cosmos-sdk/simapp" - "github.com/cosmos/cosmos-sdk/x/gov/client/utils" - "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/rpc/client/mock" ctypes "github.com/tendermint/tendermint/rpc/core/types" @@ -14,8 +11,10 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/gov/client/utils" "github.com/cosmos/cosmos-sdk/x/gov/types" ) diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index b9b8e2ba35..60eb8be598 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -1,19 +1,22 @@ package keeper_test import ( + "testing" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/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/require" ) var ( TestProposal = types.NewTextProposal("Test", "description") ) -func createValidators(ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sdk.AccAddress, []sdk.ValAddress) { +func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sdk.AccAddress, []sdk.ValAddress) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 5, sdk.NewInt(30000000)) valAddrs := simapp.ConvertAddrsToValAddrs(addrs) pks := simapp.CreateTestPubKeys(5) @@ -27,9 +30,12 @@ func createValidators(ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sd app.GetSubspace(stakingtypes.ModuleName), ) - val1 := stakingtypes.NewValidator(valAddrs[0], pks[0], stakingtypes.Description{}) - val2 := stakingtypes.NewValidator(valAddrs[1], pks[1], stakingtypes.Description{}) - val3 := stakingtypes.NewValidator(valAddrs[2], pks[2], stakingtypes.Description{}) + val1, err := stakingtypes.NewValidator(valAddrs[0], pks[0], stakingtypes.Description{}) + require.NoError(t, err) + val2, err := stakingtypes.NewValidator(valAddrs[1], pks[1], stakingtypes.Description{}) + require.NoError(t, err) + val3, err := stakingtypes.NewValidator(valAddrs[2], pks[2], stakingtypes.Description{}) + require.NoError(t, err) app.StakingKeeper.SetValidator(ctx, val1) app.StakingKeeper.SetValidator(ctx, val2) diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index ddea9b4f34..dc330d7348 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -713,7 +713,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { func (suite *KeeperTestSuite) TestGRPCQueryTally() { app, ctx, queryClient := suite.app, suite.ctx, suite.queryClient - addrs, _ := createValidators(ctx, app, []int64{5, 5, 5}) + addrs, _ := createValidators(suite.T(), ctx, app, []int64{5, 5, 5}) var ( req *types.QueryTallyResultRequest diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index e4f6547e90..6c23a510e9 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -17,7 +17,7 @@ func TestTallyNoOneVotes(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - createValidators(ctx, app, []int64{5, 5, 5}) + createValidators(t, ctx, app, []int64{5, 5, 5}) tp := TestProposal proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) @@ -39,7 +39,7 @@ func TestTallyNoQuorum(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - createValidators(ctx, app, []int64{2, 5, 0}) + createValidators(t, ctx, app, []int64{2, 5, 0}) addrs := simapp.AddTestAddrsIncremental(app, ctx, 1, sdk.NewInt(10000000)) @@ -64,7 +64,7 @@ func TestTallyOnlyValidatorsAllYes(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - addrs, _ := createValidators(ctx, app, []int64{5, 5, 5}) + addrs, _ := createValidators(t, ctx, app, []int64{5, 5, 5}) tp := TestProposal proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) @@ -90,7 +90,7 @@ func TestTallyOnlyValidators51No(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - valAccAddrs, _ := createValidators(ctx, app, []int64{5, 6, 0}) + valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 0}) tp := TestProposal proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) @@ -114,7 +114,7 @@ func TestTallyOnlyValidators51Yes(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - valAccAddrs, _ := createValidators(ctx, app, []int64{5, 6, 0}) + valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 0}) tp := TestProposal proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) @@ -139,7 +139,7 @@ func TestTallyOnlyValidatorsVetoed(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - valAccAddrs, _ := createValidators(ctx, app, []int64{6, 6, 7}) + valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) @@ -165,7 +165,7 @@ func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - valAccAddrs, _ := createValidators(ctx, app, []int64{6, 6, 7}) + valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) @@ -191,7 +191,7 @@ func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - valAccAddrs, _ := createValidators(ctx, app, []int64{6, 6, 7}) + valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) @@ -217,7 +217,7 @@ func TestTallyOnlyValidatorsNonVoter(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - valAccAddrs, _ := createValidators(ctx, app, []int64{5, 6, 7}) + valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 7}) valAccAddr1, valAccAddr2 := valAccAddrs[0], valAccAddrs[1] tp := TestProposal @@ -243,7 +243,7 @@ func TestTallyDelgatorOverride(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - addrs, valAddrs := createValidators(ctx, app, []int64{5, 6, 7}) + addrs, valAddrs := createValidators(t, ctx, app, []int64{5, 6, 7}) delTokens := sdk.TokensFromConsensusPower(30) val1, found := app.StakingKeeper.GetValidator(ctx, valAddrs[0]) @@ -279,7 +279,7 @@ func TestTallyDelgatorInherit(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - addrs, vals := createValidators(ctx, app, []int64{5, 6, 7}) + addrs, vals := createValidators(t, ctx, app, []int64{5, 6, 7}) delTokens := sdk.TokensFromConsensusPower(30) val3, found := app.StakingKeeper.GetValidator(ctx, vals[2]) @@ -314,7 +314,7 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - addrs, vals := createValidators(ctx, app, []int64{5, 6, 7}) + addrs, vals := createValidators(t, ctx, app, []int64{5, 6, 7}) delTokens := sdk.TokensFromConsensusPower(10) val1, found := app.StakingKeeper.GetValidator(ctx, vals[0]) @@ -354,9 +354,9 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - createValidators(ctx, app, []int64{25, 6, 7}) + createValidators(t, ctx, app, []int64{25, 6, 7}) - addrs, vals := createValidators(ctx, app, []int64{5, 6, 7}) + addrs, vals := createValidators(t, ctx, app, []int64{5, 6, 7}) delTokens := sdk.TokensFromConsensusPower(10) val2, found := app.StakingKeeper.GetValidator(ctx, vals[1]) @@ -395,7 +395,7 @@ func TestTallyJailedValidator(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - addrs, valAddrs := createValidators(ctx, app, []int64{25, 6, 7}) + addrs, valAddrs := createValidators(t, ctx, app, []int64{25, 6, 7}) delTokens := sdk.TokensFromConsensusPower(10) val2, found := app.StakingKeeper.GetValidator(ctx, valAddrs[1]) @@ -410,7 +410,9 @@ func TestTallyJailedValidator(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) - app.StakingKeeper.Jail(ctx, sdk.ConsAddress(val2.GetConsPubKey().Address())) + consKey, err := val2.TmConsPubKey() + require.NoError(t, err) + app.StakingKeeper.Jail(ctx, sdk.ConsAddress(consKey.Address())) tp := TestProposal proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) @@ -436,7 +438,7 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - addrs, valAddrs := createValidators(ctx, app, []int64{10, 10, 10}) + addrs, valAddrs := createValidators(t, ctx, app, []int64{10, 10, 10}) delTokens := sdk.TokensFromConsensusPower(10) val2, found := app.StakingKeeper.GetValidator(ctx, valAddrs[1]) diff --git a/x/gov/types/tx.pb.go b/x/gov/types/tx.pb.go index c1391e12ef..c4d9a96701 100644 --- a/x/gov/types/tx.pb.go +++ b/x/gov/types/tx.pb.go @@ -7,10 +7,10 @@ import ( context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" - grpc1 "github.com/gogo/protobuf/grpc" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types1 "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/regen-network/cosmos-proto" grpc "google.golang.org/grpc" diff --git a/x/ibc/core/02-client/keeper/keeper_test.go b/x/ibc/core/02-client/keeper/keeper_test.go index c2f18311be..9679353422 100644 --- a/x/ibc/core/02-client/keeper/keeper_test.go +++ b/x/ibc/core/02-client/keeper/keeper_test.go @@ -102,12 +102,15 @@ func (suite *KeeperTestSuite) SetupTest() { privVal := ibctestingmock.NewPV() pk, err := privVal.GetPubKey() suite.Require().NoError(err) - val := stakingtypes.NewValidator(sdk.ValAddress(pk.Address()), pk, stakingtypes.Description{}) + val, err := stakingtypes.NewValidator(sdk.ValAddress(pk.Address()), pk, stakingtypes.Description{}) + suite.Require().NoError(err) + val.Status = stakingtypes.Bonded val.Tokens = sdk.NewInt(rand.Int63()) validators = append(validators, val) - app.StakingKeeper.SetHistoricalInfo(suite.ctx, int64(i), stakingtypes.NewHistoricalInfo(suite.ctx.BlockHeader(), validators)) + hi := stakingtypes.NewHistoricalInfo(suite.ctx.BlockHeader(), validators) + app.StakingKeeper.SetHistoricalInfo(suite.ctx, int64(i), &hi) } queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, app.InterfaceRegistry()) diff --git a/x/ibc/testing/chain.go b/x/ibc/testing/chain.go index 9331ef405c..ef1628d73c 100644 --- a/x/ibc/testing/chain.go +++ b/x/ibc/testing/chain.go @@ -344,7 +344,12 @@ func (chain *TestChain) GetValsAtHeight(height int64) (*tmtypes.ValidatorSet, bo } valSet := stakingtypes.Validators(histInfo.Valset) - return tmtypes.NewValidatorSet(valSet.ToTmValidators()), true + + tmValidators, err := valSet.ToTmValidators() + if err != nil { + panic(err) + } + return tmtypes.NewValidatorSet(tmValidators), true } // GetConnection retrieves an IBC Connection for the provided TestConnection. The diff --git a/x/simulation/params.go b/x/simulation/params.go index f7fc798e65..12e8e09726 100644 --- a/x/simulation/params.go +++ b/x/simulation/params.go @@ -9,7 +9,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/tendermint/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp/params" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/simulation" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -153,19 +153,15 @@ func (w WeightedProposalContent) ContentSimulatorFn() simulation.ContentSimulato //----------------------------------------------------------------------------- // Param change proposals -// RandomParams returns random simulation consensus parameters, it extracts the Evidence from the Staking genesis state. -func RandomConsensusParams(r *rand.Rand, appState json.RawMessage) *abci.ConsensusParams { - cdc := params.MakeEncodingConfig().Marshaler - +// randomConsensusParams returns random simulation consensus parameters, it extracts the Evidence from the Staking genesis state. +func randomConsensusParams(r *rand.Rand, appState json.RawMessage, cdc codec.JSONMarshaler) *abci.ConsensusParams { var genesisState map[string]json.RawMessage - err := json.Unmarshal(appState, &genesisState) if err != nil { panic(err) } stakingGenesisState := stakingtypes.GetGenesisStateFromAppState(cdc, genesisState) - consensusParams := &abci.ConsensusParams{ Block: &abci.BlockParams{ MaxBytes: int64(simulation.RandIntBetween(r, 20000000, 30000000)), diff --git a/x/simulation/simulate.go b/x/simulation/simulate.go index 2b7feb92e4..7767cbbe50 100644 --- a/x/simulation/simulate.go +++ b/x/simulation/simulate.go @@ -14,6 +14,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/simulation" ) @@ -23,11 +24,11 @@ const AverageBlockTime = 6 * time.Second // initialize the chain for the simulation func initChain( r *rand.Rand, params Params, accounts []simulation.Account, app *baseapp.BaseApp, - appStateFn simulation.AppStateFn, config simulation.Config, + appStateFn simulation.AppStateFn, config simulation.Config, cdc codec.JSONMarshaler, ) (mockValidators, time.Time, []simulation.Account, string) { appState, accounts, chainID, genesisTimestamp := appStateFn(r, accounts, config) - consensusParams := RandomConsensusParams(r, appState) + consensusParams := randomConsensusParams(r, appState, cdc) req := abci.RequestInitChain{ AppStateBytes: appState, @@ -52,6 +53,7 @@ func SimulateFromSeed( ops WeightedOperations, blockedAddrs map[string]bool, config simulation.Config, + cdc codec.JSONMarshaler, ) (stopEarly bool, exportedParams Params, err error) { // in case we have to end early, don't os.Exit so that we can run cleanup code. testingMode, _, b := getTestingMode(tb) @@ -67,7 +69,7 @@ func SimulateFromSeed( // Second variable to keep pending validator set (delayed one block since // TM 0.24) Initially this is the same as the initial validator set - validators, genesisTimestamp, accs, chainID := initChain(r, params, accs, app, appStateFn, config) + validators, genesisTimestamp, accs, chainID := initChain(r, params, accs, app, appStateFn, config, cdc) if len(accs) == 0 { return true, params, fmt.Errorf("must have greater than zero genesis accounts") } diff --git a/x/slashing/genesis.go b/x/slashing/genesis.go index 87fa12237c..ae8f315553 100644 --- a/x/slashing/genesis.go +++ b/x/slashing/genesis.go @@ -12,7 +12,11 @@ import ( func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, stakingKeeper types.StakingKeeper, data *types.GenesisState) { stakingKeeper.IterateValidators(ctx, func(index int64, validator stakingtypes.ValidatorI) bool { - keeper.AddPubkey(ctx, validator.GetConsPubKey()) + consPk, err := validator.TmConsPubKey() + if err != nil { + panic(err) + } + keeper.AddPubkey(ctx, consPk) return false }, ) diff --git a/x/slashing/keeper/hooks.go b/x/slashing/keeper/hooks.go index ac1be5fae1..daf2e051e1 100644 --- a/x/slashing/keeper/hooks.go +++ b/x/slashing/keeper/hooks.go @@ -25,13 +25,18 @@ func (k Keeper) AfterValidatorBonded(ctx sdk.Context, address sdk.ConsAddress, _ } } -// When a validator is created, add the address-pubkey relation. -func (k Keeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) { +// AfterValidatorCreated adds the address-pubkey relation when a validator is created. +func (k Keeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error { validator := k.sk.Validator(ctx, valAddr) - k.AddPubkey(ctx, validator.GetConsPubKey()) + consPk, err := validator.TmConsPubKey() + if err != nil { + return err + } + k.AddPubkey(ctx, consPk) + return nil } -// When a validator is removed, delete the address-pubkey relation. +// AfterValidatorRemoved deletes the address-pubkey relation when a validator is removed, func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, address sdk.ConsAddress) { k.deleteAddrPubkeyRelation(ctx, crypto.Address(address)) } diff --git a/x/slashing/keeper/unjail.go b/x/slashing/keeper/unjail.go index a8dab94d25..23a9121e54 100644 --- a/x/slashing/keeper/unjail.go +++ b/x/slashing/keeper/unjail.go @@ -33,8 +33,10 @@ func (k Keeper) Unjail(ctx sdk.Context, validatorAddr sdk.ValAddress) error { return types.ErrValidatorNotJailed } - consAddr := sdk.ConsAddress(validator.GetConsPubKey().Address()) - + consAddr, err := validator.GetConsAddr() + if err != nil { + return err + } // If the validator has a ValidatorSigningInfo object that signals that the // validator was bonded and so we must check that the validator is not tombstoned // and can be unjailed at the current block. diff --git a/x/slashing/simulation/operations.go b/x/slashing/simulation/operations.go index e30dd900ed..de95c0136b 100644 --- a/x/slashing/simulation/operations.go +++ b/x/slashing/simulation/operations.go @@ -65,7 +65,11 @@ func SimulateMsgUnjail(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Kee return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUnjail, "validator is not jailed"), nil, nil } - consAddr := sdk.ConsAddress(validator.GetConsPubKey().Address()) + cons, err := validator.TmConsPubKey() + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUnjail, "unable to get validator consensus key"), nil, err + } + consAddr := sdk.ConsAddress(cons.Address()) info, found := k.GetValidatorSigningInfo(ctx, consAddr) if !found { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUnjail, "unable to find validator signing info"), nil, nil // skip diff --git a/x/slashing/simulation/operations_test.go b/x/slashing/simulation/operations_test.go index 71e5e85a4c..15764c631e 100644 --- a/x/slashing/simulation/operations_test.go +++ b/x/slashing/simulation/operations_test.go @@ -67,7 +67,8 @@ func TestSimulateMsgUnjail(t *testing.T) { // setup validator0 by consensus address app.StakingKeeper.SetValidatorByConsAddr(ctx, validator0) - val0ConsAddress := sdk.ConsAddress(validator0.GetConsPubKey().Address()) + val0ConsAddress, err := validator0.GetConsAddr() + require.NoError(t, err) info := types.NewValidatorSigningInfo(val0ConsAddress, int64(4), int64(3), time.Unix(2, 0), false, int64(10)) app.SlashingKeeper.SetValidatorSigningInfo(ctx, val0ConsAddress, info) @@ -136,10 +137,11 @@ func getTestingValidator0(t *testing.T, app *simapp.SimApp, ctx sdk.Context, acc func getTestingValidator(t *testing.T, app *simapp.SimApp, ctx sdk.Context, accounts []simtypes.Account, commission stakingtypes.Commission, n int) stakingtypes.Validator { account := accounts[n] - valPubKey := account.PubKey + valPubKey := account.ConsKey.PubKey() valAddr := sdk.ValAddress(account.PubKey.Address().Bytes()) - validator := stakingtypes.NewValidator(valAddr, valPubKey, stakingtypes.Description{}) - validator, err := validator.SetInitialCommission(commission) + validator, err := stakingtypes.NewValidator(valAddr, valPubKey, stakingtypes.Description{}) + require.NoError(t, err) + validator, err = validator.SetInitialCommission(commission) require.NoError(t, err) validator.DelegatorShares = sdk.NewDec(100) diff --git a/x/staking/client/cli/cli_test.go b/x/staking/client/cli/cli_test.go index 3ec0546665..2b66da867c 100644 --- a/x/staking/client/cli/cli_test.go +++ b/x/staking/client/cli/cli_test.go @@ -4,7 +4,6 @@ package cli_test import ( "context" - json "encoding/json" "fmt" "strings" "testing" @@ -277,9 +276,9 @@ func (s *IntegrationTestSuite) TestGetCmdQueryValidators() { out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) s.Require().NoError(err) - var result []types.Validator - s.Require().NoError(json.Unmarshal(out.Bytes(), &result)) - s.Require().Equal(len(s.network.Validators), len(result)) + var result types.QueryValidatorsResponse + s.Require().NoError(clientCtx.JSONMarshaler.UnmarshalJSON(out.Bytes(), &result)) + s.Require().Equal(len(s.network.Validators), len(result.Validators)) }) } } diff --git a/x/staking/client/cli/query.go b/x/staking/client/cli/query.go index eeb2bb95b0..ec99b6b57c 100644 --- a/x/staking/client/cli/query.go +++ b/x/staking/client/cli/query.go @@ -113,22 +113,21 @@ $ %s query staking validators return err } - resKVs, _, err := clientCtx.QuerySubspace(types.ValidatorsKey, types.StoreKey) + queryClient := types.NewQueryClient(clientCtx) + pageReq, err := client.ReadPageRequest(cmd.Flags()) if err != nil { return err } - var validators types.Validators - for _, kv := range resKVs { - validator, err := types.UnmarshalValidator(types.ModuleCdc, kv.Value) - if err != nil { - return err - } - - validators = append(validators, validator) + result, err := queryClient.Validators(context.Background(), &types.QueryValidatorsRequest{ + // Leaving status empty on purpose to query all validators. + Pagination: pageReq, + }) + if err != nil { + return err } - return clientCtx.PrintOutputLegacy(validators) + return clientCtx.PrintOutput(result) }, } diff --git a/x/staking/genesis.go b/x/staking/genesis.go index e55c32e551..1b646f2364 100644 --- a/x/staking/genesis.go +++ b/x/staking/genesis.go @@ -2,8 +2,10 @@ package staking import ( "fmt" + "log" abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/crypto" tmtypes "github.com/tendermint/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -146,7 +148,11 @@ func InitGenesis( res = append(res, update) } } else { - res = keeper.ApplyAndReturnValidatorSetUpdates(ctx) + var err error + res, err = keeper.ApplyAndReturnValidatorSetUpdates(ctx) + if err != nil { + log.Fatal(err) + } } return res @@ -190,11 +196,16 @@ func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) *types.GenesisState { } // WriteValidators returns a slice of bonded genesis validators. -func WriteValidators(ctx sdk.Context, keeper keeper.Keeper) (vals []tmtypes.GenesisValidator) { +func WriteValidators(ctx sdk.Context, keeper keeper.Keeper) (vals []tmtypes.GenesisValidator, err error) { keeper.IterateLastValidators(ctx, func(_ int64, validator types.ValidatorI) (stop bool) { + var consPk crypto.PubKey + consPk, err = validator.TmConsPubKey() + if err != nil { + return true + } vals = append(vals, tmtypes.GenesisValidator{ - Address: validator.GetConsAddr().Bytes(), - PubKey: validator.GetConsPubKey(), + Address: sdk.ConsAddress(consPk.Address()).Bytes(), + PubKey: consPk, Power: validator.GetConsensusPower(), Name: validator.GetMoniker(), }) @@ -215,19 +226,27 @@ func ValidateGenesis(data *types.GenesisState) error { return data.Params.Validate() } -func validateGenesisStateValidators(validators []types.Validator) (err error) { +func validateGenesisStateValidators(validators []types.Validator) error { addrMap := make(map[string]bool, len(validators)) for i := 0; i < len(validators); i++ { val := validators[i] - strKey := string(val.GetConsPubKey().Bytes()) + consPk, err := val.TmConsPubKey() + if err != nil { + return err + } + consAddr, err := val.GetConsAddr() + if err != nil { + return err + } + strKey := string(consPk.Bytes()) if _, ok := addrMap[strKey]; ok { - return fmt.Errorf("duplicate validator in genesis state: moniker %v, address %v", val.Description.Moniker, val.GetConsAddr()) + return fmt.Errorf("duplicate validator in genesis state: moniker %v, address %v", val.Description.Moniker, consAddr) } if val.Jailed && val.IsBonded() { - return fmt.Errorf("validator is bonded and jailed in genesis state: moniker %v, address %v", val.Description.Moniker, val.GetConsAddr()) + return fmt.Errorf("validator is bonded and jailed in genesis state: moniker %v, address %v", val.Description.Moniker, consAddr) } if val.DelegatorShares.IsZero() && !val.IsUnbonding() { @@ -237,5 +256,5 @@ func validateGenesisStateValidators(validators []types.Validator) (err error) { addrMap[strKey] = true } - return + return nil } diff --git a/x/staking/genesis_test.go b/x/staking/genesis_test.go index d9a08e219c..64306de276 100644 --- a/x/staking/genesis_test.go +++ b/x/staking/genesis_test.go @@ -8,11 +8,13 @@ import ( "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/staking" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -43,10 +45,10 @@ func TestInitGenesis(t *testing.T) { validators := make([]types.Validator, 2) var delegations []types.Delegation - pk0, err := sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, PKs[0]) + pk0, err := codectypes.PackAny(PKs[0]) require.NoError(t, err) - pk1, err := sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, PKs[1]) + pk1, err := codectypes.PackAny(PKs[1]) require.NoError(t, err) // initialize the validators @@ -72,7 +74,9 @@ func TestInitGenesis(t *testing.T) { require.EqualValues(t, app.StakingKeeper.GetAllValidators(ctx), actualGenesis.Validators) // Ensure validators have addresses. - for _, val := range staking.WriteValidators(ctx, app.StakingKeeper) { + vals2, err := staking.WriteValidators(ctx, app.StakingKeeper) + require.NoError(t, err) + for _, val := range vals2 { require.NotEmpty(t, val.Address) } @@ -102,11 +106,11 @@ func TestInitGenesisLargeValidatorSet(t *testing.T) { params := app.StakingKeeper.GetParams(ctx) delegations := []types.Delegation{} validators := make([]types.Validator, size) - + var err error for i := range validators { - validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), + validators[i], err = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.NewDescription(fmt.Sprintf("#%d", i), "", "", "", "")) - + require.NoError(t, err) validators[i].Status = types.Bonded tokens := sdk.TokensFromConsensusPower(1) @@ -131,7 +135,7 @@ func TestInitGenesisLargeValidatorSet(t *testing.T) { func TestValidateGenesis(t *testing.T) { genValidators1 := make([]types.Validator, 1, 5) pk := ed25519.GenPrivKey().PubKey() - genValidators1[0] = types.NewValidator(sdk.ValAddress(pk.Address()), pk, types.NewDescription("", "", "", "", "")) + genValidators1[0] = teststaking.NewValidator(t, sdk.ValAddress(pk.Address()), pk) genValidators1[0].Tokens = sdk.OneInt() genValidators1[0].DelegatorShares = sdk.OneDec() diff --git a/x/staking/handler_test.go b/x/staking/handler_test.go index 22c7733391..34a8cd78e7 100644 --- a/x/staking/handler_test.go +++ b/x/staking/handler_test.go @@ -52,7 +52,8 @@ func TestValidatorByPowerIndex(t *testing.T) { initBond := tstaking.CreateValidatorWithValPower(validatorAddr, PKs[0], initPower, true) // must end-block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + updates, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + require.NoError(t, err) require.Equal(t, 1, len(updates)) // verify the self-delegation exists @@ -71,7 +72,8 @@ func TestValidatorByPowerIndex(t *testing.T) { tstaking.CreateValidatorWithValPower(validatorAddr3, PKs[2], initPower, true) // must end-block - updates = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + updates, err = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + require.NoError(t, err) require.Equal(t, 1, len(updates)) // slash and jail the first validator @@ -104,7 +106,7 @@ func TestValidatorByPowerIndex(t *testing.T) { res := tstaking.Undelegate(sdk.AccAddress(validatorAddr), validatorAddr, totalBond, true) var resData types.MsgUndelegateResponse - err := proto.Unmarshal(res.Data, &resData) + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) ctx = ctx.WithBlockTime(resData.CompletionTime) @@ -130,7 +132,9 @@ func TestDuplicatesMsgCreateValidator(t *testing.T) { validator := tstaking.CheckValidator(addr1, types.Bonded, false) assert.Equal(t, addr1.String(), validator.OperatorAddress) - assert.Equal(t, pk1.(cryptotypes.IntoTmPubKey).AsTmPubKey(), validator.GetConsPubKey()) + consKey, err := validator.TmConsPubKey() + require.NoError(t, err) + assert.Equal(t, pk1.(cryptotypes.IntoTmPubKey).AsTmPubKey(), consKey) assert.Equal(t, valTokens, validator.BondedTokens()) assert.Equal(t, valTokens.ToDec(), validator.DelegatorShares) assert.Equal(t, types.Description{}, validator.Description) @@ -145,12 +149,15 @@ func TestDuplicatesMsgCreateValidator(t *testing.T) { tstaking.CreateValidator(addr2, pk2, valTokens.Int64(), true) // must end-block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + updates, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + require.NoError(t, err) require.Equal(t, 1, len(updates)) validator = tstaking.CheckValidator(addr2, types.Bonded, false) assert.Equal(t, addr2.String(), validator.OperatorAddress) - assert.Equal(t, pk2.(cryptotypes.IntoTmPubKey).AsTmPubKey(), validator.GetConsPubKey()) + consPk, err := validator.TmConsPubKey() + require.NoError(t, err) + assert.Equal(t, pk2.(cryptotypes.IntoTmPubKey).AsTmPubKey(), consPk) assert.True(sdk.IntEq(t, valTokens, validator.Tokens)) assert.True(sdk.DecEq(t, valTokens.ToDec(), validator.DelegatorShares)) assert.Equal(t, types.Description{}, validator.Description) @@ -182,7 +189,8 @@ func TestLegacyValidatorDelegations(t *testing.T) { bondAmount := tstaking.CreateValidatorWithValPower(valAddr, valConsPubKey, 10, true) // must end-block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + updates, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + require.NoError(t, err) require.Equal(t, 1, len(updates)) // verify the validator exists and has the correct attributes @@ -202,7 +210,7 @@ func TestLegacyValidatorDelegations(t *testing.T) { res := tstaking.Undelegate(sdk.AccAddress(valAddr), valAddr, bondAmount, true) var resData types.MsgUndelegateResponse - err := proto.Unmarshal(res.Data, &resData) + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) ctx = ctx.WithBlockTime(resData.CompletionTime) @@ -320,7 +328,8 @@ func TestEditValidatorDecreaseMinSelfDelegation(t *testing.T) { tstaking.Handle(msgCreateValidator, true) // must end-block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + updates, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + require.NoError(t, err) require.Equal(t, 1, len(updates)) // verify the self-delegation exists @@ -350,7 +359,8 @@ func TestEditValidatorIncreaseMinSelfDelegationBeyondCurrentBond(t *testing.T) { tstaking.Handle(msgCreateValidator, true) // must end-block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + updates, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + require.NoError(t, err) require.Equal(t, 1, len(updates)) // verify the self-delegation exists @@ -1022,7 +1032,8 @@ func TestBondUnbondRedelegateSlashTwice(t *testing.T) { tstaking.Delegate(del, valA, valTokens.Int64()) // apply Tendermint updates - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + updates, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + require.NoError(t, err) require.Equal(t, 2, len(updates)) // a block passes @@ -1044,7 +1055,8 @@ func TestBondUnbondRedelegateSlashTwice(t *testing.T) { require.Equal(t, sdk.NewDecFromInt(redAmt.Amount), delegation.Shares) // must apply validator updates - updates = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + updates, err = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + require.NoError(t, err) require.Equal(t, 2, len(updates)) // slash the validator by half diff --git a/x/staking/keeper/common_test.go b/x/staking/keeper/common_test.go index 065a0f52e8..1b96b4ce7d 100644 --- a/x/staking/keeper/common_test.go +++ b/x/staking/keeper/common_test.go @@ -22,22 +22,19 @@ func createTestInput() (*codec.LegacyAmino, *simapp.SimApp, sdk.Context) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - appCodec := app.AppCodec() - app.StakingKeeper = keeper.NewKeeper( - appCodec, + app.AppCodec(), app.GetKey(types.StoreKey), app.AccountKeeper, app.BankKeeper, app.GetSubspace(types.ModuleName), ) - - return codec.NewLegacyAmino(), app, ctx + return app.LegacyAmino(), app, ctx } // intended to be used with require/assert: require.True(ValEq(...)) func ValEq(t *testing.T, exp, got types.Validator) (*testing.T, bool, string, types.Validator, types.Validator) { - return t, exp.MinEqual(got), "expected:\n%v\ngot:\n%v", exp, got + return t, exp.MinEqual(&got), "expected:\n%v\ngot:\n%v", exp, got } // generateAddresses generates numAddrs of normal AccAddrs and ValAddrs diff --git a/x/staking/keeper/delegation_test.go b/x/staking/keeper/delegation_test.go index 03450614f1..77f4cb8e2c 100644 --- a/x/staking/keeper/delegation_test.go +++ b/x/staking/keeper/delegation_test.go @@ -10,6 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -24,7 +25,7 @@ func TestDelegation(t *testing.T) { amts := []sdk.Int{sdk.NewInt(9), sdk.NewInt(8), sdk.NewInt(7)} var validators [3]types.Validator for i, amt := range amts { - validators[i] = types.NewValidator(valAddrs[i], PKs[i], types.Description{}) + validators[i] = teststaking.NewValidator(t, valAddrs[i], PKs[i]) validators[i], _ = validators[i].AddTokensFromDel(amt) } @@ -196,7 +197,7 @@ func TestUnbondDelegation(t *testing.T) { // create a validator and a delegator to that validator // note this validator starts not-bonded - validator := types.NewValidator(valAddrs[0], PKs[0], types.Description{}) + validator := teststaking.NewValidator(t, valAddrs[0], PKs[0]) validator, issuedShares := validator.AddTokensFromDel(startTokens) require.Equal(t, startTokens, issuedShares.RoundInt()) @@ -237,7 +238,7 @@ func TestUnbondingDelegationsMaxEntries(t *testing.T) { app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) // create a validator and a delegator to that validator - validator := types.NewValidator(addrVals[0], PKs[0], types.Description{}) + validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) validator, issuedShares := validator.AddTokensFromDel(startTokens) require.Equal(t, startTokens, issuedShares.RoundInt()) @@ -313,7 +314,7 @@ func TestUndelegateSelfDelegationBelowMinSelfDelegation(t *testing.T) { delCoins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delTokens)) //create a validator with a self-delegation - validator := types.NewValidator(addrVals[0], PKs[0], types.Description{}) + validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) validator.MinSelfDelegation = delTokens validator, issuedShares := validator.AddTokensFromDel(delTokens) @@ -361,8 +362,7 @@ func TestUndelegateSelfDelegationBelowMinSelfDelegation(t *testing.T) { require.NoError(t, err) // end block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 1, len(updates)) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) require.True(t, found) @@ -380,7 +380,7 @@ func TestUndelegateFromUnbondingValidator(t *testing.T) { addrVals := simapp.ConvertAddrsToValAddrs(addrDels) //create a validator with a self-delegation - validator := types.NewValidator(addrVals[0], PKs[0], types.Description{}) + validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) validator, issuedShares := validator.AddTokensFromDel(delTokens) @@ -438,8 +438,7 @@ func TestUndelegateFromUnbondingValidator(t *testing.T) { require.NoError(t, err) // end block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 1, len(updates)) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) require.True(t, found) @@ -481,7 +480,7 @@ func TestUndelegateFromUnbondedValidator(t *testing.T) { app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) // create a validator with a self-delegation - validator := types.NewValidator(addrVals[0], PKs[0], types.Description{}) + validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) valTokens := sdk.TokensFromConsensusPower(10) @@ -517,8 +516,7 @@ func TestUndelegateFromUnbondedValidator(t *testing.T) { require.NoError(t, err) // end block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 1, len(updates)) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) require.True(t, found) @@ -566,7 +564,7 @@ func TestUnbondingAllDelegationFromValidator(t *testing.T) { app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) //create a validator with a self-delegation - validator := types.NewValidator(addrVals[0], PKs[0], types.Description{}) + validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) valTokens := sdk.TokensFromConsensusPower(10) @@ -605,8 +603,7 @@ func TestUnbondingAllDelegationFromValidator(t *testing.T) { require.NoError(t, err) // end block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 1, len(updates)) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) // unbond all the remaining delegation _, err = app.StakingKeeper.Undelegate(ctx, addrDels[1], addrVals[0], delTokens.ToDec()) @@ -734,7 +731,7 @@ func TestRedelegateToSameValidator(t *testing.T) { app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) // create a validator with a self-delegation - validator := types.NewValidator(addrVals[0], PKs[0], types.Description{}) + validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) validator, issuedShares := validator.AddTokensFromDel(valTokens) require.Equal(t, valTokens, issuedShares.RoundInt()) validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) @@ -765,7 +762,7 @@ func TestRedelegationMaxEntries(t *testing.T) { app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) // create a validator with a self-delegation - validator := types.NewValidator(addrVals[0], PKs[0], types.Description{}) + validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) valTokens := sdk.TokensFromConsensusPower(10) validator, issuedShares := validator.AddTokensFromDel(valTokens) require.Equal(t, valTokens, issuedShares.RoundInt()) @@ -775,7 +772,7 @@ func TestRedelegationMaxEntries(t *testing.T) { app.StakingKeeper.SetDelegation(ctx, selfDelegation) // create a second validator - validator2 := types.NewValidator(addrVals[1], PKs[1], types.Description{}) + validator2 := teststaking.NewValidator(t, addrVals[1], PKs[1]) validator2, issuedShares = validator2.AddTokensFromDel(valTokens) require.Equal(t, valTokens, issuedShares.RoundInt()) @@ -823,7 +820,7 @@ func TestRedelegateSelfDelegation(t *testing.T) { app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) //create a validator with a self-delegation - validator := types.NewValidator(addrVals[0], PKs[0], types.Description{}) + validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) valTokens := sdk.TokensFromConsensusPower(10) @@ -837,7 +834,7 @@ func TestRedelegateSelfDelegation(t *testing.T) { app.StakingKeeper.SetDelegation(ctx, selfDelegation) // create a second validator - validator2 := types.NewValidator(addrVals[1], PKs[1], types.Description{}) + validator2 := teststaking.NewValidator(t, addrVals[1], PKs[1]) validator2, issuedShares = validator2.AddTokensFromDel(valTokens) require.Equal(t, valTokens, issuedShares.RoundInt()) validator2 = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator2, true) @@ -856,8 +853,7 @@ func TestRedelegateSelfDelegation(t *testing.T) { require.NoError(t, err) // end block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 2, len(updates)) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 2) validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) require.True(t, found) @@ -882,7 +878,7 @@ func TestRedelegateFromUnbondingValidator(t *testing.T) { app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) //create a validator with a self-delegation - validator := types.NewValidator(addrVals[0], PKs[0], types.Description{}) + validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) valTokens := sdk.TokensFromConsensusPower(10) @@ -903,7 +899,7 @@ func TestRedelegateFromUnbondingValidator(t *testing.T) { app.StakingKeeper.SetDelegation(ctx, delegation) // create a second validator - validator2 := types.NewValidator(addrVals[1], PKs[1], types.Description{}) + validator2 := teststaking.NewValidator(t, addrVals[1], PKs[1]) validator2, issuedShares = validator2.AddTokensFromDel(valTokens) require.Equal(t, valTokens, issuedShares.RoundInt()) validator2 = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator2, true) @@ -920,8 +916,7 @@ func TestRedelegateFromUnbondingValidator(t *testing.T) { require.NoError(t, err) // end block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 1, len(updates)) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) require.True(t, found) @@ -967,7 +962,7 @@ func TestRedelegateFromUnbondedValidator(t *testing.T) { app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) //create a validator with a self-delegation - validator := types.NewValidator(addrVals[0], PKs[0], types.Description{}) + validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) valTokens := sdk.TokensFromConsensusPower(10) @@ -988,7 +983,7 @@ func TestRedelegateFromUnbondedValidator(t *testing.T) { app.StakingKeeper.SetDelegation(ctx, delegation) // create a second validator - validator2 := types.NewValidator(addrVals[1], PKs[1], types.Description{}) + validator2 := teststaking.NewValidator(t, addrVals[1], PKs[1]) validator2, issuedShares = validator2.AddTokensFromDel(valTokens) require.Equal(t, valTokens, issuedShares.RoundInt()) validator2 = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator2, true) @@ -1002,8 +997,7 @@ func TestRedelegateFromUnbondedValidator(t *testing.T) { require.NoError(t, err) // end block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 1, len(updates)) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) require.True(t, found) diff --git a/x/staking/keeper/grpc_query_test.go b/x/staking/keeper/grpc_query_test.go index fefa487749..e144668940 100644 --- a/x/staking/keeper/grpc_query_test.go +++ b/x/staking/keeper/grpc_query_test.go @@ -3,11 +3,13 @@ package keeper_test import ( gocontext "context" "fmt" + "testing" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -111,7 +113,7 @@ func (suite *KeeperTestSuite) TestGRPCValidator() { res, err := queryClient.Validator(gocontext.Background(), req) if tc.expPass { suite.NoError(err) - suite.Equal(validator, res.Validator) + suite.True(validator.Equal(&res.Validator)) } else { suite.Error(err) suite.Nil(res) @@ -573,7 +575,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryHistoricalInfo() { if tc.expPass { suite.NoError(err) suite.NotNil(res) - suite.Equal(&hi, res.Hist) + suite.True(hi.Equal(res.Hist)) } else { suite.Error(err) suite.Nil(res) @@ -591,12 +593,12 @@ func (suite *KeeperTestSuite) TestGRPCQueryRedelegation() { delAmount := sdk.TokensFromConsensusPower(1) _, err := app.StakingKeeper.Delegate(ctx, addrAcc1, delAmount, types.Unbonded, val1, true) suite.NoError(err) - _ = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + applyValidatorSetUpdates(suite.T(), ctx, app.StakingKeeper, -1) rdAmount := sdk.TokensFromConsensusPower(1) _, err = app.StakingKeeper.BeginRedelegation(ctx, addrAcc1, val1.GetOperator(), val2.GetOperator(), rdAmount.ToDec()) suite.NoError(err) - app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + applyValidatorSetUpdates(suite.T(), ctx, app.StakingKeeper, -1) redel, found := app.StakingKeeper.GetRedelegation(ctx, addrAcc1, val1.GetOperator(), val2.GetOperator()) suite.True(found) @@ -683,7 +685,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryValidatorUnbondingDelegations() { undelAmount := sdk.TokensFromConsensusPower(2) _, err := app.StakingKeeper.Undelegate(ctx, addrAcc1, val1.GetOperator(), undelAmount.ToDec()) suite.NoError(err) - app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + applyValidatorSetUpdates(suite.T(), ctx, app.StakingKeeper, -1) var req *types.QueryValidatorUnbondingDelegationsRequest testCases := []struct { @@ -724,7 +726,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryValidatorUnbondingDelegations() { } } -func createValidators(ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sdk.AccAddress, []sdk.ValAddress, []types.Validator) { +func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sdk.AccAddress, []sdk.ValAddress, []types.Validator) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 5, sdk.NewInt(300000000)) valAddrs := simapp.ConvertAddrsToValAddrs(addrs) pks := simapp.CreateTestPubKeys(5) @@ -738,8 +740,8 @@ func createValidators(ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sd app.GetSubspace(types.ModuleName), ) - val1 := types.NewValidator(valAddrs[0], pks[0], types.Description{}) - val2 := types.NewValidator(valAddrs[1], pks[1], types.Description{}) + val1 := teststaking.NewValidator(t, valAddrs[0], pks[0]) + val2 := teststaking.NewValidator(t, valAddrs[1], pks[1]) vals := []types.Validator{val1, val2} app.StakingKeeper.SetValidator(ctx, val1) @@ -752,7 +754,7 @@ func createValidators(ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sd _, _ = app.StakingKeeper.Delegate(ctx, addrs[0], sdk.TokensFromConsensusPower(powers[0]), types.Unbonded, val1, true) _, _ = app.StakingKeeper.Delegate(ctx, addrs[1], sdk.TokensFromConsensusPower(powers[1]), types.Unbonded, val2, true) _, _ = app.StakingKeeper.Delegate(ctx, addrs[0], sdk.TokensFromConsensusPower(powers[2]), types.Unbonded, val2, true) - app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) return addrs, valAddrs, vals } diff --git a/x/staking/keeper/historical_info.go b/x/staking/keeper/historical_info.go index a4fe7754da..20c5a8ce85 100644 --- a/x/staking/keeper/historical_info.go +++ b/x/staking/keeper/historical_info.go @@ -15,17 +15,14 @@ func (k Keeper) GetHistoricalInfo(ctx sdk.Context, height int64) (types.Historic return types.HistoricalInfo{}, false } - hi := types.MustUnmarshalHistoricalInfo(k.cdc, value) - - return hi, true + return types.MustUnmarshalHistoricalInfo(k.cdc, value), true } // SetHistoricalInfo sets the historical info at a given height -func (k Keeper) SetHistoricalInfo(ctx sdk.Context, height int64, hi types.HistoricalInfo) { +func (k Keeper) SetHistoricalInfo(ctx sdk.Context, height int64, hi *types.HistoricalInfo) { store := ctx.KVStore(k.storeKey) key := types.GetHistoricalInfoKey(height) - - value := types.MustMarshalHistoricalInfo(k.cdc, hi) + value := k.cdc.MustMarshalBinaryBare(hi) store.Set(key, value) } @@ -97,5 +94,5 @@ func (k Keeper) TrackHistoricalInfo(ctx sdk.Context) { historicalEntry := types.NewHistoricalInfo(ctx.BlockHeader(), lastVals) // Set latest HistoricalInfo at current height - k.SetHistoricalInfo(ctx, ctx.BlockHeight(), historicalEntry) + k.SetHistoricalInfo(ctx, ctx.BlockHeight(), &historicalEntry) } diff --git a/x/staking/keeper/historical_info_test.go b/x/staking/keeper/historical_info_test.go index 48d250a115..0ccdee9408 100644 --- a/x/staking/keeper/historical_info_test.go +++ b/x/staking/keeper/historical_info_test.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -21,12 +22,11 @@ func TestHistoricalInfo(t *testing.T) { validators := make([]types.Validator, len(addrVals)) for i, valAddr := range addrVals { - validators[i] = types.NewValidator(valAddr, PKs[i], types.Description{}) + validators[i] = teststaking.NewValidator(t, valAddr, PKs[i]) } hi := types.NewHistoricalInfo(ctx.BlockHeader(), validators) - - app.StakingKeeper.SetHistoricalInfo(ctx, 2, hi) + app.StakingKeeper.SetHistoricalInfo(ctx, 2, &hi) recv, found := app.StakingKeeper.GetHistoricalInfo(ctx, 2) require.True(t, found, "HistoricalInfo not found after set") @@ -62,13 +62,13 @@ func TestTrackHistoricalInfo(t *testing.T) { Height: 5, } valSet := []types.Validator{ - types.NewValidator(addrVals[0], PKs[0], types.Description{}), - types.NewValidator(addrVals[1], PKs[1], types.Description{}), + teststaking.NewValidator(t, addrVals[0], PKs[0]), + teststaking.NewValidator(t, addrVals[1], PKs[1]), } hi4 := types.NewHistoricalInfo(h4, valSet) hi5 := types.NewHistoricalInfo(h5, valSet) - app.StakingKeeper.SetHistoricalInfo(ctx, 4, hi4) - app.StakingKeeper.SetHistoricalInfo(ctx, 5, hi5) + app.StakingKeeper.SetHistoricalInfo(ctx, 4, &hi4) + app.StakingKeeper.SetHistoricalInfo(ctx, 5, &hi5) recv, found := app.StakingKeeper.GetHistoricalInfo(ctx, 4) require.True(t, found) require.Equal(t, hi4, recv) @@ -77,10 +77,10 @@ func TestTrackHistoricalInfo(t *testing.T) { require.Equal(t, hi5, recv) // Set last validators in keeper - val1 := types.NewValidator(addrVals[2], PKs[2], types.Description{}) + val1 := teststaking.NewValidator(t, addrVals[2], PKs[2]) app.StakingKeeper.SetValidator(ctx, val1) app.StakingKeeper.SetLastValidatorPower(ctx, val1.GetOperator(), 10) - val2 := types.NewValidator(addrVals[3], PKs[3], types.Description{}) + val2 := teststaking.NewValidator(t, addrVals[3], PKs[3]) vals := []types.Validator{val1, val2} sort.Sort(types.Validators(vals)) app.StakingKeeper.SetValidator(ctx, val2) @@ -120,8 +120,8 @@ func TestGetAllHistoricalInfo(t *testing.T) { addrVals := simapp.ConvertAddrsToValAddrs(addrDels) valSet := []types.Validator{ - types.NewValidator(addrVals[0], PKs[0], types.Description{}), - types.NewValidator(addrVals[1], PKs[1], types.Description{}), + teststaking.NewValidator(t, addrVals[0], PKs[0]), + teststaking.NewValidator(t, addrVals[1], PKs[1]), } header1 := tmproto.Header{ChainID: "HelloChain", Height: 10} @@ -135,7 +135,7 @@ func TestGetAllHistoricalInfo(t *testing.T) { expHistInfos := []types.HistoricalInfo{hist1, hist2, hist3} for i, hi := range expHistInfos { - app.StakingKeeper.SetHistoricalInfo(ctx, int64(10+i), hi) + app.StakingKeeper.SetHistoricalInfo(ctx, int64(10+i), &hi) } infos := app.StakingKeeper.GetAllHistoricalInfo(ctx) diff --git a/x/staking/keeper/keeper_test.go b/x/staking/keeper/keeper_test.go index 43b91e9ea3..0342dfea9b 100644 --- a/x/staking/keeper/keeper_test.go +++ b/x/staking/keeper/keeper_test.go @@ -35,14 +35,14 @@ func (suite *KeeperTestSuite) SetupTest() { types.RegisterQueryServer(queryHelper, querier) queryClient := types.NewQueryClient(queryHelper) - addrs, _, validators := createValidators(ctx, app, []int64{9, 8, 7}) + addrs, _, validators := createValidators(suite.T(), ctx, app, []int64{9, 8, 7}) header := tmproto.Header{ ChainID: "HelloChain", Height: 5, } hi := types.NewHistoricalInfo(header, validators) - app.StakingKeeper.SetHistoricalInfo(ctx, 5, hi) + app.StakingKeeper.SetHistoricalInfo(ctx, 5, &hi) suite.app, suite.ctx, suite.queryClient, suite.addrs, suite.vals = app, ctx, queryClient, addrs, validators } diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index f5e859f04e..472a96c485 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -67,7 +67,10 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa } } - validator := types.NewValidator(valAddr, pk, msg.Description) + validator, err := types.NewValidator(valAddr, pk, msg.Description) + if err != nil { + return nil, err + } commission := types.NewCommissionWithTime( msg.Commission.Rate, msg.Commission.MaxRate, msg.Commission.MaxChangeRate, ctx.BlockHeader().Time, diff --git a/x/staking/keeper/querier.go b/x/staking/keeper/querier.go index 2b8f0deb94..48272e2451 100644 --- a/x/staking/keeper/querier.go +++ b/x/staking/keeper/querier.go @@ -74,7 +74,7 @@ func queryValidators(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQue } validators := k.GetAllValidators(ctx) - filteredVals := make([]types.Validator, 0, len(validators)) + filteredVals := make(types.Validators, 0, len(validators)) for _, val := range validators { if strings.EqualFold(val.GetStatus().String(), params.Status) { diff --git a/x/staking/keeper/querier_test.go b/x/staking/keeper/querier_test.go index 4e7a94f06a..0b194bd6dc 100644 --- a/x/staking/keeper/querier_test.go +++ b/x/staking/keeper/querier_test.go @@ -12,6 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -26,7 +27,7 @@ func TestNewQuerier(t *testing.T) { amts := []sdk.Int{sdk.NewInt(9), sdk.NewInt(8)} var validators [2]types.Validator for i, amt := range amts { - validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{}) + validators[i] = teststaking.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) validators[i], _ = validators[i].AddTokensFromDel(amt) app.StakingKeeper.SetValidator(ctx, validators[i]) app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[i]) @@ -37,7 +38,7 @@ func TestNewQuerier(t *testing.T) { Height: 5, } hi := types.NewHistoricalInfo(header, validators[:]) - app.StakingKeeper.SetHistoricalInfo(ctx, 5, hi) + app.StakingKeeper.SetHistoricalInfo(ctx, 5, &hi) query := abci.RequestQuery{ Path: "", @@ -146,7 +147,7 @@ func TestQueryValidators(t *testing.T) { status := []types.BondStatus{types.Bonded, types.Unbonded, types.Unbonding} var validators [3]types.Validator for i, amt := range amts { - validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{}) + validators[i] = teststaking.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) validators[i], _ = validators[i].AddTokensFromDel(amt) validators[i] = validators[i].UpdateStatus(status[i]) } @@ -197,7 +198,7 @@ func TestQueryValidators(t *testing.T) { err = cdc.UnmarshalJSON(res, &queriedValidator) require.NoError(t, err) - require.Equal(t, validator, queriedValidator) + require.True(t, validator.Equal(&queriedValidator)) } } @@ -215,11 +216,11 @@ func TestQueryDelegation(t *testing.T) { pk1, pk2 := pubKeys[0], pubKeys[1] // Create Validators and Delegation - val1 := types.NewValidator(addrVal1, pk1, types.Description{}) + val1 := teststaking.NewValidator(t, addrVal1, pk1) app.StakingKeeper.SetValidator(ctx, val1) app.StakingKeeper.SetValidatorByPowerIndex(ctx, val1) - val2 := types.NewValidator(addrVal2, pk2, types.Description{}) + val2 := teststaking.NewValidator(t, addrVal2, pk2) app.StakingKeeper.SetValidator(ctx, val2) app.StakingKeeper.SetValidatorByPowerIndex(ctx, val2) @@ -228,7 +229,7 @@ func TestQueryDelegation(t *testing.T) { require.NoError(t, err) // apply TM updates - app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) // Query Delegator bonded validators queryParams := types.NewQueryDelegatorParams(addrAcc2) @@ -245,7 +246,7 @@ func TestQueryDelegation(t *testing.T) { res, err := querier(ctx, []string{types.QueryDelegatorValidators}, query) require.NoError(t, err) - var validatorsResp []types.Validator + var validatorsResp types.Validators errRes = cdc.UnmarshalJSON(res, &validatorsResp) require.NoError(t, errRes) @@ -274,8 +275,7 @@ func TestQueryDelegation(t *testing.T) { var validator types.Validator errRes = cdc.UnmarshalJSON(res, &validator) require.NoError(t, errRes) - - require.Equal(t, delValidators[0], validator) + require.True(t, validator.Equal(&delValidators[0])) // error unknown request query.Data = bz[:len(bz)-1] @@ -461,7 +461,7 @@ func TestQueryValidatorDelegations_Pagination(t *testing.T) { valAddress := sdk.ValAddress(addrs[0]) - val1 := types.NewValidator(valAddress, pubKeys[0], types.Description{}) + val1 := teststaking.NewValidator(t, valAddress, pubKeys[0]) app.StakingKeeper.SetValidator(ctx, val1) app.StakingKeeper.SetValidatorByPowerIndex(ctx, val1) @@ -478,7 +478,7 @@ func TestQueryValidatorDelegations_Pagination(t *testing.T) { } // apply TM updates - app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) for _, c := range cases { // Query Delegator bonded validators @@ -512,7 +512,7 @@ func TestQueryValidatorDelegations_Pagination(t *testing.T) { } // apply TM updates - app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) for _, c := range cases { // Query Unbonding delegations with pagination. @@ -546,20 +546,20 @@ func TestQueryRedelegations(t *testing.T) { addrVal1, addrVal2 := sdk.ValAddress(addrAcc1), sdk.ValAddress(addrAcc2) // Create Validators and Delegation - val1 := types.NewValidator(addrVal1, PKs[0], types.Description{}) - val2 := types.NewValidator(addrVal2, PKs[1], types.Description{}) + val1 := teststaking.NewValidator(t, addrVal1, PKs[0]) + val2 := teststaking.NewValidator(t, addrVal2, PKs[1]) app.StakingKeeper.SetValidator(ctx, val1) app.StakingKeeper.SetValidator(ctx, val2) delAmount := sdk.TokensFromConsensusPower(100) _, err := app.StakingKeeper.Delegate(ctx, addrAcc2, delAmount, types.Unbonded, val1, true) require.NoError(t, err) - _ = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) rdAmount := sdk.TokensFromConsensusPower(20) _, err = app.StakingKeeper.BeginRedelegation(ctx, addrAcc2, val1.GetOperator(), val2.GetOperator(), rdAmount.ToDec()) require.NoError(t, err) - app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) redel, found := app.StakingKeeper.GetRedelegation(ctx, addrAcc2, val1.GetOperator(), val2.GetOperator()) require.True(t, found) @@ -618,20 +618,20 @@ func TestQueryUnbondingDelegation(t *testing.T) { addrVal1 := sdk.ValAddress(addrAcc1) // Create Validators and Delegation - val1 := types.NewValidator(addrVal1, PKs[0], types.Description{}) + val1 := teststaking.NewValidator(t, addrVal1, PKs[0]) app.StakingKeeper.SetValidator(ctx, val1) // delegate delAmount := sdk.TokensFromConsensusPower(100) _, err := app.StakingKeeper.Delegate(ctx, addrAcc1, delAmount, types.Unbonded, val1, true) require.NoError(t, err) - _ = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) // undelegate undelAmount := sdk.TokensFromConsensusPower(20) _, err = app.StakingKeeper.Undelegate(ctx, addrAcc1, val1.GetOperator(), undelAmount.ToDec()) require.NoError(t, err) - app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) _, found := app.StakingKeeper.GetUnbondingDelegation(ctx, addrAcc1, val1.GetOperator()) require.True(t, found) @@ -706,7 +706,7 @@ func TestQueryUnbondingDelegation(t *testing.T) { func TestQueryHistoricalInfo(t *testing.T) { cdc, app, ctx := createTestInput() - legacyQuerierCdc := codec.NewAminoCodec(app.LegacyAmino()) + legacyQuerierCdc := codec.NewAminoCodec(cdc) querier := keeper.NewQuerier(app.StakingKeeper, legacyQuerierCdc.LegacyAmino) addrs := simapp.AddTestAddrs(app, ctx, 2, sdk.TokensFromConsensusPower(10000)) @@ -714,8 +714,8 @@ func TestQueryHistoricalInfo(t *testing.T) { addrVal1, addrVal2 := sdk.ValAddress(addrAcc1), sdk.ValAddress(addrAcc2) // Create Validators and Delegation - val1 := types.NewValidator(addrVal1, PKs[0], types.Description{}) - val2 := types.NewValidator(addrVal2, PKs[1], types.Description{}) + val1 := teststaking.NewValidator(t, addrVal1, PKs[0]) + val2 := teststaking.NewValidator(t, addrVal2, PKs[1]) vals := []types.Validator{val1, val2} app.StakingKeeper.SetValidator(ctx, val1) app.StakingKeeper.SetValidator(ctx, val2) @@ -725,7 +725,7 @@ func TestQueryHistoricalInfo(t *testing.T) { Height: 5, } hi := types.NewHistoricalInfo(header, vals) - app.StakingKeeper.SetHistoricalInfo(ctx, 5, hi) + app.StakingKeeper.SetHistoricalInfo(ctx, 5, &hi) queryHistoricalParams := types.QueryHistoricalInfoRequest{Height: 4} bz, errRes := cdc.MarshalJSON(queryHistoricalParams) diff --git a/x/staking/keeper/query_utils.go b/x/staking/keeper/query_utils.go index a530a86cbe..a6f323092a 100644 --- a/x/staking/keeper/query_utils.go +++ b/x/staking/keeper/query_utils.go @@ -8,7 +8,7 @@ import ( // Return all validators that a delegator is bonded to. If maxRetrieve is supplied, the respective amount will be returned. func (k Keeper) GetDelegatorValidators( ctx sdk.Context, delegatorAddr sdk.AccAddress, maxRetrieve uint32, -) []types.Validator { +) types.Validators { validators := make([]types.Validator, maxRetrieve) store := ctx.KVStore(k.storeKey) diff --git a/x/staking/keeper/slash_test.go b/x/staking/keeper/slash_test.go index 8aaba62a25..4bee623004 100644 --- a/x/staking/keeper/slash_test.go +++ b/x/staking/keeper/slash_test.go @@ -12,6 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -41,7 +42,7 @@ func bootstrapSlashTest(t *testing.T, power int64) (*simapp.SimApp, sdk.Context, app.BankKeeper.SetSupply(ctx, banktypes.NewSupply(totalSupply)) for i := int64(0); i < numVals; i++ { - validator := types.NewValidator(addrVals[i], PKs[i], types.Description{}) + validator := teststaking.NewValidator(t, addrVals[i], PKs[i]) validator, _ = validator.AddTokensFromDel(amt) validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) @@ -170,8 +171,7 @@ func TestSlashRedelegation(t *testing.T) { require.Len(t, rd.Entries, 1) // end block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 1, len(updates)) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) // initialbalance unchanged require.Equal(t, sdk.NewInt(10), rd.Entries[0].InitialBalance) @@ -214,8 +214,7 @@ func TestSlashAtNegativeHeight(t *testing.T) { require.True(t, found) // end block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 1, len(updates), "cons addr: %v, updates: %v", []byte(consAddr), updates) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) validator, found = app.StakingKeeper.GetValidator(ctx, validator.GetOperator()) require.True(t, found) @@ -246,8 +245,7 @@ func TestSlashValidatorAtCurrentHeight(t *testing.T) { require.True(t, found) // end block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 1, len(updates), "cons addr: %v, updates: %v", []byte(consAddr), updates) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) validator, found = app.StakingKeeper.GetValidator(ctx, validator.GetOperator()) assert.True(t, found) @@ -284,8 +282,7 @@ func TestSlashWithUnbondingDelegation(t *testing.T) { app.StakingKeeper.Slash(ctx, consAddr, 10, 10, fraction) // end block - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 1, len(updates)) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) // read updating unbonding delegation ubd, found = app.StakingKeeper.GetUnbondingDelegation(ctx, addrDels[0], addrVals[0]) @@ -379,7 +376,7 @@ func TestSlashWithUnbondingDelegation(t *testing.T) { require.Equal(t, sdk.TokensFromConsensusPower(10), diffTokens) // apply TM updates - app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) // read updated validator // power decreased by 1 again, validator is out of stake @@ -511,7 +508,7 @@ func TestSlashWithRedelegation(t *testing.T) { require.True(t, found) require.Len(t, rd.Entries, 1) // apply TM updates - app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) // read updated validator // validator decreased to zero power, should be in unbonding period validator, _ = app.StakingKeeper.GetValidatorByConsAddr(ctx, consAddr) diff --git a/x/staking/keeper/test_common.go b/x/staking/keeper/test_common.go index 8ded090ffe..42e94740d3 100644 --- a/x/staking/keeper/test_common.go +++ b/x/staking/keeper/test_common.go @@ -40,21 +40,15 @@ func TestingUpdateValidator(keeper Keeper, ctx sdk.Context, validator types.Vali keeper.SetValidatorByPowerIndex(ctx, validator) - if apply { - keeper.ApplyAndReturnValidatorSetUpdates(ctx) - - validator, found := keeper.GetValidator(ctx, validator.GetOperator()) - if !found { - panic("validator expected but not found") - } - - return validator + if !apply { + ctx, _ = ctx.CacheContext() + } + _, err := keeper.ApplyAndReturnValidatorSetUpdates(ctx) + if err != nil { + panic(err) } - cachectx, _ := ctx.CacheContext() - keeper.ApplyAndReturnValidatorSetUpdates(cachectx) - - validator, found := keeper.GetValidator(cachectx, validator.GetOperator()) + validator, found := keeper.GetValidator(ctx, validator.GetOperator()) if !found { panic("validator expected but not found") } diff --git a/x/staking/keeper/val_state_change.go b/x/staking/keeper/val_state_change.go index 083efb6940..f06994f44f 100644 --- a/x/staking/keeper/val_state_change.go +++ b/x/staking/keeper/val_state_change.go @@ -24,7 +24,10 @@ func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { // unbonded after the Endblocker (go from Bonded -> Unbonding during // ApplyAndReturnValidatorSetUpdates and then Unbonding -> Unbonded during // UnbondAllMatureValidatorQueue). - validatorUpdates := k.ApplyAndReturnValidatorSetUpdates(ctx) + validatorUpdates, err := k.ApplyAndReturnValidatorSetUpdates(ctx) + if err != nil { + panic(err) + } // unbond all mature validators from the unbonding queue k.UnbondAllMatureValidators(ctx) @@ -106,7 +109,7 @@ func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { // CONTRACT: Only validators with non-zero power or zero-power that were bonded // at the previous block height or were removed from the validator set entirely // are returned to Tendermint. -func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate) { +func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate, err error) { maxValidators := k.GetParams(ctx).MaxValidators totalPower := sdk.ZeroInt() amtFromBondedToNotBonded, amtFromNotBondedToBonded := sdk.ZeroInt(), sdk.ZeroInt() @@ -139,10 +142,16 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab // apply the appropriate state change if necessary switch { case validator.IsUnbonded(): - validator = k.unbondedToBonded(ctx, validator) + validator, err = k.unbondedToBonded(ctx, validator) + if err != nil { + return + } amtFromNotBondedToBonded = amtFromNotBondedToBonded.Add(validator.GetTokens()) case validator.IsUnbonding(): - validator = k.unbondingToBonded(ctx, validator) + validator, err = k.unbondingToBonded(ctx, validator) + if err != nil { + return + } amtFromNotBondedToBonded = amtFromNotBondedToBonded.Add(validator.GetTokens()) case validator.IsBonded(): // no state change @@ -174,7 +183,10 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab noLongerBonded := sortNoLongerBonded(last) for _, valAddrBytes := range noLongerBonded { validator := k.mustGetValidator(ctx, sdk.ValAddress(valAddrBytes)) - validator = k.bondedToUnbonding(ctx, validator) + validator, err = k.bondedToUnbonding(ctx, validator) + if err != nil { + return + } amtFromBondedToNotBonded = amtFromBondedToNotBonded.Add(validator.GetTokens()) k.DeleteLastValidatorPower(ctx, validator.GetOperator()) updates = append(updates, validator.ABCIValidatorUpdateZero()) @@ -200,12 +212,12 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab k.SetLastTotalPower(ctx, totalPower) } - return updates + return updates, err } // Validator state transitions -func (k Keeper) bondedToUnbonding(ctx sdk.Context, validator types.Validator) types.Validator { +func (k Keeper) bondedToUnbonding(ctx sdk.Context, validator types.Validator) (types.Validator, error) { if !validator.IsBonded() { panic(fmt.Sprintf("bad state transition bondedToUnbonding, validator: %v\n", validator)) } @@ -213,7 +225,7 @@ func (k Keeper) bondedToUnbonding(ctx sdk.Context, validator types.Validator) ty return k.beginUnbondingValidator(ctx, validator) } -func (k Keeper) unbondingToBonded(ctx sdk.Context, validator types.Validator) types.Validator { +func (k Keeper) unbondingToBonded(ctx sdk.Context, validator types.Validator) (types.Validator, error) { if !validator.IsUnbonding() { panic(fmt.Sprintf("bad state transition unbondingToBonded, validator: %v\n", validator)) } @@ -221,7 +233,7 @@ func (k Keeper) unbondingToBonded(ctx sdk.Context, validator types.Validator) ty return k.bondValidator(ctx, validator) } -func (k Keeper) unbondedToBonded(ctx sdk.Context, validator types.Validator) types.Validator { +func (k Keeper) unbondedToBonded(ctx sdk.Context, validator types.Validator) (types.Validator, error) { if !validator.IsUnbonded() { panic(fmt.Sprintf("bad state transition unbondedToBonded, validator: %v\n", validator)) } @@ -229,7 +241,7 @@ func (k Keeper) unbondedToBonded(ctx sdk.Context, validator types.Validator) typ return k.bondValidator(ctx, validator) } -// switches a validator from unbonding state to unbonded state +// UnbondingToUnbonded switches a validator from unbonding state to unbonded state func (k Keeper) UnbondingToUnbonded(ctx sdk.Context, validator types.Validator) types.Validator { if !validator.IsUnbonding() { panic(fmt.Sprintf("bad state transition unbondingToBonded, validator: %v\n", validator)) @@ -261,7 +273,7 @@ func (k Keeper) unjailValidator(ctx sdk.Context, validator types.Validator) { } // perform all the store operations for when a validator status becomes bonded -func (k Keeper) bondValidator(ctx sdk.Context, validator types.Validator) types.Validator { +func (k Keeper) bondValidator(ctx sdk.Context, validator types.Validator) (types.Validator, error) { // delete the validator by power index, as the key will change k.DeleteValidatorByPowerIndex(ctx, validator) @@ -275,13 +287,17 @@ func (k Keeper) bondValidator(ctx sdk.Context, validator types.Validator) types. k.DeleteValidatorQueue(ctx, validator) // trigger hook - k.AfterValidatorBonded(ctx, validator.GetConsAddr(), validator.GetOperator()) + consAddr, err := validator.GetConsAddr() + if err != nil { + return validator, err + } + k.AfterValidatorBonded(ctx, consAddr, validator.GetOperator()) - return validator + return validator, err } // perform all the store operations for when a validator begins unbonding -func (k Keeper) beginUnbondingValidator(ctx sdk.Context, validator types.Validator) types.Validator { +func (k Keeper) beginUnbondingValidator(ctx sdk.Context, validator types.Validator) (types.Validator, error) { params := k.GetParams(ctx) // delete the validator by power index, as the key will change @@ -306,9 +322,13 @@ func (k Keeper) beginUnbondingValidator(ctx sdk.Context, validator types.Validat k.InsertUnbondingValidatorQueue(ctx, validator) // trigger hook - k.AfterValidatorBeginUnbonding(ctx, validator.GetConsAddr(), validator.GetOperator()) + consAddr, err := validator.GetConsAddr() + if err != nil { + return validator, err + } + k.AfterValidatorBeginUnbonding(ctx, consAddr, validator.GetOperator()) - return validator + return validator, nil } // perform all the store operations for when a validator status becomes unbonded diff --git a/x/staking/keeper/validator.go b/x/staking/keeper/validator.go index 21353585ed..edb00ddba5 100644 --- a/x/staking/keeper/validator.go +++ b/x/staking/keeper/validator.go @@ -95,14 +95,19 @@ func (k Keeper) mustGetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAdd // set the main record holding validator details func (k Keeper) SetValidator(ctx sdk.Context, validator types.Validator) { store := ctx.KVStore(k.storeKey) - bz := types.MustMarshalValidator(k.cdc, validator) + bz := types.MustMarshalValidator(k.cdc, &validator) store.Set(types.GetValidatorKey(validator.GetOperator()), bz) } // validator index -func (k Keeper) SetValidatorByConsAddr(ctx sdk.Context, validator types.Validator) { +func (k Keeper) SetValidatorByConsAddr(ctx sdk.Context, validator types.Validator) error { + consPk, err := validator.GetConsAddr() + if err != nil { + return err + } store := ctx.KVStore(k.storeKey) - store.Set(types.GetValidatorByConsAddrKey(validator.GetConsAddr()), validator.GetOperator()) + store.Set(types.GetValidatorByConsAddrKey(consPk), validator.GetOperator()) + return nil } // validator index @@ -180,6 +185,7 @@ func (k Keeper) UpdateValidatorCommission(ctx sdk.Context, // remove the validator record and associated indexes // except for the bonded validator index which is only handled in ApplyAndReturnTendermintUpdates +// TODO, this function panics, and it's not good. func (k Keeper) RemoveValidator(ctx sdk.Context, address sdk.ValAddress) { // first retrieve the old validator record validator, found := k.GetValidator(ctx, address) @@ -195,7 +201,10 @@ func (k Keeper) RemoveValidator(ctx sdk.Context, address sdk.ValAddress) { panic("attempting to remove a validator which still contains tokens") } - valConsAddr := validator.GetConsAddr() + valConsAddr, err := validator.GetConsAddr() + if err != nil { + panic(err) + } // delete the old validator record store := ctx.KVStore(k.storeKey) diff --git a/x/staking/keeper/validator_test.go b/x/staking/keeper/validator_test.go index 26e894e27c..c28b6db358 100644 --- a/x/staking/keeper/validator_test.go +++ b/x/staking/keeper/validator_test.go @@ -7,15 +7,24 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/crypto" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" ) +func newMonikerValidator(t *testing.T, operator sdk.ValAddress, pubKey crypto.PubKey, moniker string) types.Validator { + v, err := types.NewValidator(operator, pubKey, types.Description{Moniker: moniker}) + require.NoError(t, err) + return v +} + func bootstrapValidatorTest(t *testing.T, power int64, numAddrs int) (*simapp.SimApp, sdk.Context, []sdk.AccAddress, []sdk.ValAddress) { _, app, ctx := createTestInput() @@ -34,6 +43,18 @@ func bootstrapValidatorTest(t *testing.T, power int64, numAddrs int) (*simapp.Si return app, ctx, addrDels, addrVals } +func initValidators(t *testing.T, power int64, numAddrs int, powers []int64) (*simapp.SimApp, sdk.Context, []sdk.AccAddress, []sdk.ValAddress, []types.Validator) { + app, ctx, addrs, valAddrs := bootstrapValidatorTest(t, 1000, 20) + + vs := make([]types.Validator, len(powers)) + for i, power := range powers { + vs[i] = teststaking.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) + tokens := sdk.TokensFromConsensusPower(power) + vs[i], _ = vs[i].AddTokensFromDel(tokens) + } + return app, ctx, addrs, valAddrs, vs +} + func TestSetValidator(t *testing.T) { app, ctx, _, _ := bootstrapValidatorTest(t, 10, 100) @@ -42,7 +63,7 @@ func TestSetValidator(t *testing.T) { valTokens := sdk.TokensFromConsensusPower(10) // test how the validator is set from a purely unbonbed pool - validator := types.NewValidator(valAddr, valPubKey, types.Description{}) + validator := teststaking.NewValidator(t, valAddr, valPubKey) validator, _ = validator.AddTokensFromDel(valTokens) require.Equal(t, types.Unbonded, validator.Status) assert.Equal(t, valTokens, validator.Tokens) @@ -51,10 +72,9 @@ func TestSetValidator(t *testing.T) { app.StakingKeeper.SetValidatorByPowerIndex(ctx, validator) // ensure update - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + updates := applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) validator, found := app.StakingKeeper.GetValidator(ctx, valAddr) require.True(t, found) - require.Equal(t, 1, len(updates)) require.Equal(t, validator.ABCIValidatorUpdate(), updates[0]) // after the save the validator should be bonded @@ -104,7 +124,7 @@ func TestUpdateValidatorByPowerIndex(t *testing.T) { app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) // add a validator - validator := types.NewValidator(addrVals[0], PKs[0], types.Description{}) + validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) validator, delSharesCreated := validator.AddTokensFromDel(sdk.TokensFromConsensusPower(100)) require.Equal(t, types.Unbonded, validator.Status) require.Equal(t, sdk.TokensFromConsensusPower(100), validator.Tokens) @@ -158,7 +178,7 @@ func TestUpdateBondedValidatorsDecreaseCliff(t *testing.T) { validators := make([]types.Validator, numVals) for i := 0; i < len(validators); i++ { moniker := fmt.Sprintf("val#%d", int64(i)) - val := types.NewValidator(valAddrs[i], PKs[i], types.Description{Moniker: moniker}) + val := newMonikerValidator(t, valAddrs[i], PKs[i], moniker) delTokens := sdk.TokensFromConsensusPower(int64((i + 1) * 10)) val, _ = val.AddTokensFromDel(delTokens) @@ -199,7 +219,7 @@ func TestSlashToZeroPowerRemoved(t *testing.T) { app, ctx, _, addrVals := bootstrapValidatorTest(t, 100, 20) // add a validator - validator := types.NewValidator(addrVals[0], PKs[0], types.Description{}) + validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) valTokens := sdk.TokensFromConsensusPower(100) bondedPool := app.StakingKeeper.GetBondedPool(ctx) @@ -219,7 +239,7 @@ func TestSlashToZeroPowerRemoved(t *testing.T) { // slash the validator by 100% app.StakingKeeper.Slash(ctx, sdk.ConsAddress(PKs[0].Address()), 0, 100, sdk.OneDec()) // apply TM updates - app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) // validator should be unbonding validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) require.Equal(t, validator.GetStatus(), types.Unbonding) @@ -233,7 +253,7 @@ func TestValidatorBasics(t *testing.T) { var validators [3]types.Validator powers := []int64{9, 8, 7} for i, power := range powers { - validators[i] = types.NewValidator(addrVals[i], PKs[i], types.Description{}) + validators[i] = teststaking.NewValidator(t, addrVals[i], PKs[i]) validators[i].Status = types.Unbonded validators[i].Tokens = sdk.ZeroInt() tokens := sdk.TokensFromConsensusPower(power) @@ -338,7 +358,7 @@ func TestGetValidatorSortingUnmixed(t *testing.T) { n := len(amts) var validators [5]types.Validator for i, amt := range amts { - validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{}) + validators[i] = teststaking.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) validators[i].Status = types.Bonded validators[i].Tokens = sdk.NewInt(amt) validators[i].DelegatorShares = sdk.NewDec(amt) @@ -434,7 +454,7 @@ func TestGetValidatorSortingMixed(t *testing.T) { var validators [5]types.Validator for i, amt := range amts { - validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{}) + validators[i] = teststaking.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) validators[i].DelegatorShares = sdk.NewDec(amt) validators[i].Status = types.Bonded validators[i].Tokens = sdk.NewInt(amt) @@ -482,7 +502,7 @@ func TestGetValidatorsEdgeCases(t *testing.T) { var validators [4]types.Validator for i, power := range powers { moniker := fmt.Sprintf("val#%d", int64(i)) - validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{Moniker: moniker}) + validators[i] = newMonikerValidator(t, sdk.ValAddress(addrs[i]), PKs[i], moniker) tokens := sdk.TokensFromConsensusPower(power) validators[i], _ = validators[i].AddTokensFromDel(tokens) @@ -596,9 +616,9 @@ func TestValidatorBondHeight(t *testing.T) { // initialize some validators into the state var validators [3]types.Validator - validators[0] = types.NewValidator(sdk.ValAddress(PKs[0].Address().Bytes()), PKs[0], types.Description{}) - validators[1] = types.NewValidator(sdk.ValAddress(addrs[1]), PKs[1], types.Description{}) - validators[2] = types.NewValidator(sdk.ValAddress(addrs[2]), PKs[2], types.Description{}) + validators[0] = teststaking.NewValidator(t, sdk.ValAddress(PKs[0].Address().Bytes()), PKs[0]) + validators[1] = teststaking.NewValidator(t, sdk.ValAddress(addrs[1]), PKs[1]) + validators[2] = teststaking.NewValidator(t, sdk.ValAddress(addrs[2]), PKs[2]) tokens0 := sdk.TokensFromConsensusPower(200) tokens1 := sdk.TokensFromConsensusPower(100) @@ -644,7 +664,7 @@ func TestFullValidatorSetPowerChange(t *testing.T) { powers := []int64{0, 100, 400, 400, 200} var validators [5]types.Validator for i, power := range powers { - validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{}) + validators[i] = teststaking.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) tokens := sdk.TokensFromConsensusPower(power) validators[i], _ = validators[i].AddTokensFromDel(tokens) keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[i], true) @@ -684,21 +704,20 @@ func TestApplyAndReturnValidatorSetUpdatesAllNone(t *testing.T) { valPubKey := PKs[i+1] valAddr := sdk.ValAddress(valPubKey.Address().Bytes()) - validators[i] = types.NewValidator(valAddr, valPubKey, types.Description{}) + validators[i] = teststaking.NewValidator(t, valAddr, valPubKey) tokens := sdk.TokensFromConsensusPower(power) validators[i], _ = validators[i].AddTokensFromDel(tokens) } // test from nothing to something // tendermintUpdate set: {} -> {c1, c3} - require.Equal(t, 0, len(app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx))) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 0) app.StakingKeeper.SetValidator(ctx, validators[0]) app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[0]) app.StakingKeeper.SetValidator(ctx, validators[1]) app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[1]) - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - assert.Equal(t, 2, len(updates)) + updates := applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 2) validators[0], _ = app.StakingKeeper.GetValidator(ctx, validators[0].GetOperator()) validators[1], _ = app.StakingKeeper.GetValidator(ctx, validators[1].GetOperator()) assert.Equal(t, validators[0].ABCIValidatorUpdate(), updates[1]) @@ -711,7 +730,7 @@ func TestApplyAndReturnValidatorSetUpdatesIdentical(t *testing.T) { powers := []int64{10, 20} var validators [2]types.Validator for i, power := range powers { - validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{}) + validators[i] = teststaking.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) tokens := sdk.TokensFromConsensusPower(power) validators[i], _ = validators[i].AddTokensFromDel(tokens) @@ -719,13 +738,13 @@ func TestApplyAndReturnValidatorSetUpdatesIdentical(t *testing.T) { } validators[0] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[0], false) validators[1] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[1], false) - require.Equal(t, 2, len(app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx))) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 2) // test identical, // tendermintUpdate set: {} -> {} validators[0] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[0], false) validators[1] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[1], false) - require.Equal(t, 0, len(app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx))) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 0) } func TestApplyAndReturnValidatorSetUpdatesSingleValueChange(t *testing.T) { @@ -734,8 +753,7 @@ func TestApplyAndReturnValidatorSetUpdatesSingleValueChange(t *testing.T) { powers := []int64{10, 20} var validators [2]types.Validator for i, power := range powers { - - validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{}) + validators[i] = teststaking.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) tokens := sdk.TokensFromConsensusPower(power) validators[i], _ = validators[i].AddTokensFromDel(tokens) @@ -743,7 +761,7 @@ func TestApplyAndReturnValidatorSetUpdatesSingleValueChange(t *testing.T) { } validators[0] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[0], false) validators[1] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[1], false) - require.Equal(t, 2, len(app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx))) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 2) // test single value change // tendermintUpdate set: {} -> {c1'} @@ -751,28 +769,18 @@ func TestApplyAndReturnValidatorSetUpdatesSingleValueChange(t *testing.T) { validators[0].Tokens = sdk.TokensFromConsensusPower(600) validators[0] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[0], false) - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - - require.Equal(t, 1, len(updates)) + updates := applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) require.Equal(t, validators[0].ABCIValidatorUpdate(), updates[0]) } func TestApplyAndReturnValidatorSetUpdatesMultipleValueChange(t *testing.T) { - app, ctx, addrs, _ := bootstrapValidatorTest(t, 1000, 20) - powers := []int64{10, 20} - var validators [2]types.Validator - for i, power := range powers { + // TODO: use it in other places + app, ctx, _, _, validators := initValidators(t, 1000, 20, powers) - validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{}) - - tokens := sdk.TokensFromConsensusPower(power) - validators[i], _ = validators[i].AddTokensFromDel(tokens) - - } validators[0] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[0], false) validators[1] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[1], false) - require.Equal(t, 2, len(app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx))) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 2) // test multiple value change // tendermintUpdate set: {c1, c3} -> {c1', c3'} @@ -783,55 +791,41 @@ func TestApplyAndReturnValidatorSetUpdatesMultipleValueChange(t *testing.T) { validators[0] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[0], false) validators[1] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[1], false) - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 2, len(updates)) + updates := applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 2) require.Equal(t, validators[0].ABCIValidatorUpdate(), updates[0]) require.Equal(t, validators[1].ABCIValidatorUpdate(), updates[1]) } func TestApplyAndReturnValidatorSetUpdatesInserted(t *testing.T) { - app, ctx, addrs, _ := bootstrapValidatorTest(t, 1000, 20) - powers := []int64{10, 20, 5, 15, 25} - var validators [5]types.Validator - for i, power := range powers { - - validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{}) - - tokens := sdk.TokensFromConsensusPower(power) - validators[i], _ = validators[i].AddTokensFromDel(tokens) - - } + app, ctx, _, _, validators := initValidators(t, 1000, 20, powers) validators[0] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[0], false) validators[1] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[1], false) - require.Equal(t, 2, len(app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx))) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 2) // test validtor added at the beginning // tendermintUpdate set: {} -> {c0} app.StakingKeeper.SetValidator(ctx, validators[2]) app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[2]) - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + updates := applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) validators[2], _ = app.StakingKeeper.GetValidator(ctx, validators[2].GetOperator()) - require.Equal(t, 1, len(updates)) require.Equal(t, validators[2].ABCIValidatorUpdate(), updates[0]) // test validtor added at the beginning // tendermintUpdate set: {} -> {c0} app.StakingKeeper.SetValidator(ctx, validators[3]) app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[3]) - updates = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + updates = applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) validators[3], _ = app.StakingKeeper.GetValidator(ctx, validators[3].GetOperator()) - require.Equal(t, 1, len(updates)) require.Equal(t, validators[3].ABCIValidatorUpdate(), updates[0]) // test validtor added at the end // tendermintUpdate set: {} -> {c0} app.StakingKeeper.SetValidator(ctx, validators[4]) app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[4]) - updates = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + updates = applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) validators[4], _ = app.StakingKeeper.GetValidator(ctx, validators[4].GetOperator()) - require.Equal(t, 1, len(updates)) require.Equal(t, validators[4].ABCIValidatorUpdate(), updates[0]) } @@ -844,34 +838,29 @@ func TestApplyAndReturnValidatorSetUpdatesWithCliffValidator(t *testing.T) { powers := []int64{10, 20, 5} var validators [5]types.Validator for i, power := range powers { - - validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{}) - + validators[i] = teststaking.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) tokens := sdk.TokensFromConsensusPower(power) validators[i], _ = validators[i].AddTokensFromDel(tokens) - } validators[0] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[0], false) validators[1] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[1], false) - require.Equal(t, 2, len(app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx))) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 2) // test validator added at the end but not inserted in the valset // tendermintUpdate set: {} -> {} keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[2], false) - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 0, len(updates)) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 0) // test validator change its power and become a gotValidator (pushing out an existing) // tendermintUpdate set: {} -> {c0, c4} - require.Equal(t, 0, len(app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx))) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 0) tokens := sdk.TokensFromConsensusPower(10) validators[2], _ = validators[2].AddTokensFromDel(tokens) app.StakingKeeper.SetValidator(ctx, validators[2]) app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[2]) - updates = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + updates := applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 2) validators[2], _ = app.StakingKeeper.GetValidator(ctx, validators[2].GetOperator()) - require.Equal(t, 2, len(updates), "%v", updates) require.Equal(t, validators[0].ABCIValidatorUpdateZero(), updates[1]) require.Equal(t, validators[2].ABCIValidatorUpdate(), updates[0]) } @@ -882,16 +871,13 @@ func TestApplyAndReturnValidatorSetUpdatesPowerDecrease(t *testing.T) { powers := []int64{100, 100} var validators [2]types.Validator for i, power := range powers { - - validators[i] = types.NewValidator(sdk.ValAddress(addrs[i]), PKs[i], types.Description{}) - + validators[i] = teststaking.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) tokens := sdk.TokensFromConsensusPower(power) validators[i], _ = validators[i].AddTokensFromDel(tokens) - } validators[0] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[0], false) validators[1] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[1], false) - require.Equal(t, 2, len(app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx))) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 2) // check initial power require.Equal(t, int64(100), validators[0].GetConsensusPower()) @@ -911,8 +897,7 @@ func TestApplyAndReturnValidatorSetUpdatesPowerDecrease(t *testing.T) { require.Equal(t, int64(70), validators[1].GetConsensusPower()) // Tendermint updates should reflect power change - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 2, len(updates)) + updates := applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 2) require.Equal(t, validators[0].ABCIValidatorUpdate(), updates[0]) require.Equal(t, validators[1].ABCIValidatorUpdate(), updates[1]) } @@ -929,11 +914,10 @@ func TestApplyAndReturnValidatorSetUpdatesNewValidator(t *testing.T) { // initialize some validators into the state for i, power := range powers { - valPubKey := PKs[i+1] valAddr := sdk.ValAddress(valPubKey.Address().Bytes()) - validators[i] = types.NewValidator(valAddr, valPubKey, types.Description{}) + validators[i] = teststaking.NewValidator(t, valAddr, valPubKey) tokens := sdk.TokensFromConsensusPower(power) validators[i], _ = validators[i].AddTokensFromDel(tokens) @@ -942,14 +926,13 @@ func TestApplyAndReturnValidatorSetUpdatesNewValidator(t *testing.T) { } // verify initial Tendermint updates are correct - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, len(validators), len(updates)) + updates := applyValidatorSetUpdates(t, ctx, app.StakingKeeper, len(validators)) validators[0], _ = app.StakingKeeper.GetValidator(ctx, validators[0].GetOperator()) validators[1], _ = app.StakingKeeper.GetValidator(ctx, validators[1].GetOperator()) require.Equal(t, validators[0].ABCIValidatorUpdate(), updates[0]) require.Equal(t, validators[1].ABCIValidatorUpdate(), updates[1]) - require.Equal(t, 0, len(app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx))) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 0) // update initial validator set for i, power := range powers { @@ -968,7 +951,7 @@ func TestApplyAndReturnValidatorSetUpdatesNewValidator(t *testing.T) { valAddr := sdk.ValAddress(valPubKey.Address().Bytes()) amt := sdk.NewInt(100) - validator := types.NewValidator(valAddr, valPubKey, types.Description{}) + validator := teststaking.NewValidator(t, valAddr, valPubKey) validator, _ = validator.AddTokensFromDel(amt) app.StakingKeeper.SetValidator(ctx, validator) @@ -981,18 +964,17 @@ func TestApplyAndReturnValidatorSetUpdatesNewValidator(t *testing.T) { valPubKey = PKs[len(validators)+2] valAddr = sdk.ValAddress(valPubKey.Address().Bytes()) - validator = types.NewValidator(valAddr, valPubKey, types.Description{}) + validator = teststaking.NewValidator(t, valAddr, valPubKey) tokens := sdk.TokensFromConsensusPower(500) validator, _ = validator.AddTokensFromDel(tokens) app.StakingKeeper.SetValidator(ctx, validator) app.StakingKeeper.SetValidatorByPowerIndex(ctx, validator) // verify initial Tendermint updates are correct - updates = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + updates = applyValidatorSetUpdates(t, ctx, app.StakingKeeper, len(validators)+1) validator, _ = app.StakingKeeper.GetValidator(ctx, validator.GetOperator()) validators[0], _ = app.StakingKeeper.GetValidator(ctx, validators[0].GetOperator()) validators[1], _ = app.StakingKeeper.GetValidator(ctx, validators[1].GetOperator()) - require.Equal(t, len(validators)+1, len(updates)) require.Equal(t, validator.ABCIValidatorUpdate(), updates[0]) require.Equal(t, validators[0].ABCIValidatorUpdate(), updates[1]) require.Equal(t, validators[1].ABCIValidatorUpdate(), updates[2]) @@ -1014,7 +996,7 @@ func TestApplyAndReturnValidatorSetUpdatesBondTransition(t *testing.T) { valPubKey := PKs[i+1] valAddr := sdk.ValAddress(valPubKey.Address().Bytes()) - validators[i] = types.NewValidator(valAddr, valPubKey, types.Description{Moniker: moniker}) + validators[i] = newMonikerValidator(t, valAddr, valPubKey, moniker) tokens := sdk.TokensFromConsensusPower(power) validators[i], _ = validators[i].AddTokensFromDel(tokens) app.StakingKeeper.SetValidator(ctx, validators[i]) @@ -1022,14 +1004,13 @@ func TestApplyAndReturnValidatorSetUpdatesBondTransition(t *testing.T) { } // verify initial Tendermint updates are correct - updates := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 2, len(updates)) + updates := applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 2) validators[2], _ = app.StakingKeeper.GetValidator(ctx, validators[2].GetOperator()) validators[1], _ = app.StakingKeeper.GetValidator(ctx, validators[1].GetOperator()) require.Equal(t, validators[2].ABCIValidatorUpdate(), updates[0]) require.Equal(t, validators[1].ABCIValidatorUpdate(), updates[1]) - require.Equal(t, 0, len(app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx))) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 0) // delegate to validator with lowest power but not enough to bond ctx = ctx.WithBlockHeight(1) @@ -1045,7 +1026,7 @@ func TestApplyAndReturnValidatorSetUpdatesBondTransition(t *testing.T) { app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[0]) // verify initial Tendermint updates are correct - require.Equal(t, 0, len(app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx))) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 0) // create a series of events that will bond and unbond the validator with // lowest power in a single block context (height) @@ -1058,8 +1039,7 @@ func TestApplyAndReturnValidatorSetUpdatesBondTransition(t *testing.T) { validators[0], _ = validators[0].RemoveDelShares(validators[0].DelegatorShares) app.StakingKeeper.SetValidator(ctx, validators[0]) app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[0]) - updates = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 0, len(updates)) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 0) app.StakingKeeper.DeleteValidatorByPowerIndex(ctx, validators[1]) tokens = sdk.TokensFromConsensusPower(250) @@ -1068,11 +1048,10 @@ func TestApplyAndReturnValidatorSetUpdatesBondTransition(t *testing.T) { app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[1]) // verify initial Tendermint updates are correct - updates = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) - require.Equal(t, 1, len(updates)) + updates = applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) require.Equal(t, validators[1].ABCIValidatorUpdate(), updates[0]) - require.Equal(t, 0, len(app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx))) + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 0) } func TestUpdateValidatorCommission(t *testing.T) { @@ -1085,8 +1064,8 @@ func TestUpdateValidatorCommission(t *testing.T) { ) commission2 := types.NewCommission(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(3, 1), sdk.NewDecWithPrec(1, 1)) - val1 := types.NewValidator(addrVals[0], PKs[0], types.Description{}) - val2 := types.NewValidator(addrVals[1], PKs[1], types.Description{}) + val1 := teststaking.NewValidator(t, addrVals[0], PKs[0]) + val2 := teststaking.NewValidator(t, addrVals[1], PKs[1]) val1, _ = val1.SetInitialCommission(commission1) val2, _ = val2.SetInitialCommission(commission2) @@ -1131,3 +1110,12 @@ func TestUpdateValidatorCommission(t *testing.T) { } } } + +func applyValidatorSetUpdates(t *testing.T, ctx sdk.Context, k keeper.Keeper, expectedUpdatesLen int) []abci.ValidatorUpdate { + updates, err := k.ApplyAndReturnValidatorSetUpdates(ctx) + require.NoError(t, err) + if expectedUpdatesLen >= 0 { + require.Equal(t, expectedUpdatesLen, len(updates), "%v", updates) + } + return updates +} diff --git a/x/staking/legacy/v040/migrate.go b/x/staking/legacy/v040/migrate.go index 2749c99d9c..689e5a6dae 100644 --- a/x/staking/legacy/v040/migrate.go +++ b/x/staking/legacy/v040/migrate.go @@ -3,7 +3,7 @@ package v040 import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" v034staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v034" v038staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v038" v040staking "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -42,9 +42,13 @@ func Migrate(stakingState v038staking.GenesisState) *v040staking.GenesisState { newValidators := make([]v040staking.Validator, len(stakingState.Validators)) for i, oldValidator := range stakingState.Validators { + pkAny, err := codectypes.PackAny(oldValidator.ConsPubKey) + if err != nil { + panic(fmt.Sprintf("Can't pack validator consensus PK as Any: %s", err)) + } newValidators[i] = v040staking.Validator{ OperatorAddress: oldValidator.OperatorAddress.String(), - ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, oldValidator.ConsPubKey), + ConsensusPubkey: pkAny, Jailed: oldValidator.Jailed, Status: migrateBondStatus(oldValidator.Status), Tokens: oldValidator.Tokens, diff --git a/x/staking/legacy/v040/migrate_test.go b/x/staking/legacy/v040/migrate_test.go index 626864a8ec..f54fec0e94 100644 --- a/x/staking/legacy/v040/migrate_test.go +++ b/x/staking/legacy/v040/migrate_test.go @@ -43,7 +43,7 @@ func TestMigrate(t *testing.T) { require.NoError(t, err) // Make sure about: - // - consensus_pubkey: should be bech32 pubkey + // - consensus_pubkey: should be an any // - validator's status should be 1 (new unbonded) expected := `{ "delegations": [], @@ -69,7 +69,10 @@ func TestMigrate(t *testing.T) { }, "update_time": "0001-01-01T00:00:00Z" }, - "consensus_pubkey": "cosmosvalconspub1zcjduepq9ymett3nlv6fytn7lqxzd3q3ckvd79eqlcf3wkhgamcl4rzghesq83ecpx", + "consensus_pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", + "key": "KTeVrjP7NJIufvgMJsQRxZjfFyD+Exda6O7x+oxIvmA=" + }, "delegator_shares": "0", "description": { "details": "", diff --git a/x/staking/simulation/decoder_test.go b/x/staking/simulation/decoder_test.go index dc5ddaf216..60210fa89b 100644 --- a/x/staking/simulation/decoder_test.go +++ b/x/staking/simulation/decoder_test.go @@ -37,7 +37,8 @@ func TestDecodeStore(t *testing.T) { bondTime := time.Now().UTC() - val := types.NewValidator(valAddr1, delPk1, types.NewDescription("test", "test", "test", "test", "test")) + val, err := types.NewValidator(valAddr1, delPk1, types.NewDescription("test", "test", "test", "test", "test")) + require.NoError(t, err) del := types.NewDelegation(delAddr1, valAddr1, sdk.OneDec()) ubd := types.NewUnbondingDelegation(delAddr1, valAddr1, 15, bondTime, sdk.OneInt()) red := types.NewRedelegation(delAddr1, valAddr1, valAddr1, 12, bondTime, sdk.OneInt(), sdk.OneDec()) diff --git a/x/staking/simulation/genesis.go b/x/staking/simulation/genesis.go index e4ed7d3483..0c33fa9ee2 100644 --- a/x/staking/simulation/genesis.go +++ b/x/staking/simulation/genesis.go @@ -84,7 +84,10 @@ func RandomizedGenState(simState *module.SimulationState) { simulation.RandomDecAmount(simState.Rand, maxCommission), ) - validator := types.NewValidator(valAddr, simState.Accounts[i].ConsKey.PubKey(), types.Description{}) + validator, err := types.NewValidator(valAddr, simState.Accounts[i].ConsKey.PubKey(), types.Description{}) + if err != nil { + panic(err) + } validator.Tokens = sdk.NewInt(simState.InitialStake) validator.DelegatorShares = sdk.NewDec(simState.InitialStake) validator.Commission = commission @@ -97,7 +100,7 @@ func RandomizedGenState(simState *module.SimulationState) { stakingGenesis := types.NewGenesisState(params, validators, delegations) - bz, err := json.MarshalIndent(&stakingGenesis, "", " ") + bz, err := json.MarshalIndent(&stakingGenesis.Params, "", " ") if err != nil { panic(err) } diff --git a/x/staking/simulation/genesis_test.go b/x/staking/simulation/genesis_test.go index ace2f0acb5..62926ba1f5 100644 --- a/x/staking/simulation/genesis_test.go +++ b/x/staking/simulation/genesis_test.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/staking/simulation" @@ -19,6 +20,7 @@ import ( // Abonormal scenarios are not tested here. func TestRandomizedGenState(t *testing.T) { interfaceRegistry := codectypes.NewInterfaceRegistry() + cryptocodec.RegisterInterfaces(interfaceRegistry) cdc := codec.NewProtoCodec(interfaceRegistry) s := rand.NewSource(1) @@ -53,7 +55,7 @@ func TestRandomizedGenState(t *testing.T) { require.Equal(t, "1000.000000000000000000", stakingGenesis.Delegations[0].Shares.String()) // check validators require.Equal(t, "cosmosvaloper1ghekyjucln7y67ntx7cf27m9dpuxxemnsvnaes", stakingGenesis.Validators[2].GetOperator().String()) - require.Equal(t, "cosmosvalconspub1zcjduepq280tm686ma80cva9z620dmknd9a858pd2zmq9ackfenfllecjxds0hg9n7", stakingGenesis.Validators[2].ConsensusPubkey) + require.Equal(t, []byte{0xa, 0x20, 0x51, 0xde, 0xbd, 0xe8, 0xfa, 0xdf, 0x4e, 0xfc, 0x33, 0xa5, 0x16, 0x94, 0xf6, 0xee, 0xd3, 0x69, 0x7a, 0x7a, 0x1c, 0x2d, 0x50, 0xb6, 0x2, 0xf7, 0x16, 0x4e, 0x66, 0x9f, 0xff, 0x38, 0x91, 0x9b}, stakingGenesis.Validators[2].ConsensusPubkey.Value) require.Equal(t, false, stakingGenesis.Validators[2].Jailed) require.Equal(t, "BOND_STATUS_UNBONDED", stakingGenesis.Validators[2].Status.String()) require.Equal(t, "1000", stakingGenesis.Validators[2].Tokens.String()) diff --git a/x/staking/simulation/operations_test.go b/x/staking/simulation/operations_test.go index ff9d104368..6e3f687393 100644 --- a/x/staking/simulation/operations_test.go +++ b/x/staking/simulation/operations_test.go @@ -16,6 +16,7 @@ import ( distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/staking/simulation" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -302,7 +303,7 @@ func getTestingValidator(t *testing.T, app *simapp.SimApp, ctx sdk.Context, acco account := accounts[n] valPubKey := account.PubKey valAddr := sdk.ValAddress(account.PubKey.Address().Bytes()) - validator := types.NewValidator(valAddr, valPubKey, types.Description{}) + validator := teststaking.NewValidator(t, valAddr, valPubKey) validator, err := validator.SetInitialCommission(commission) require.NoError(t, err) diff --git a/x/staking/teststaking/validator.go b/x/staking/teststaking/validator.go new file mode 100644 index 0000000000..90dd485999 --- /dev/null +++ b/x/staking/teststaking/validator.go @@ -0,0 +1,18 @@ +package teststaking + +import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/crypto" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +// NewValidator is a testing helper method to create validators in tests +func NewValidator(t *testing.T, operator sdk.ValAddress, pubKey crypto.PubKey) types.Validator { + v, err := types.NewValidator(operator, pubKey, types.Description{}) + require.NoError(t, err) + return v +} diff --git a/x/staking/types/data_test.go b/x/staking/types/data_test.go index 8a87c840be..5505b9d5ce 100644 --- a/x/staking/types/data_test.go +++ b/x/staking/types/data_test.go @@ -1,14 +1,18 @@ package types import ( + "fmt" + "github.com/tendermint/tendermint/crypto" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" ) var ( pk1 = ed25519.GenPrivKey().PubKey() + pk1Any *codectypes.Any pk2 = ed25519.GenPrivKey().PubKey() pk3 = ed25519.GenPrivKey().PubKey() addr1, _ = sdk.Bech32ifyAddressBytes(sdk.Bech32PrefixAccAddr, pk1.Address().Bytes()) @@ -21,3 +25,11 @@ var ( emptyAddr sdk.ValAddress emptyPubkey crypto.PubKey ) + +func init() { + var err error + pk1Any, err = codectypes.PackAny(pk1) + if err != nil { + panic(fmt.Sprintf("Can't pack pk1 %t as Any", pk1)) + } +} diff --git a/x/staking/types/exported.go b/x/staking/types/exported.go index 02f97dccea..f8cf8be99e 100644 --- a/x/staking/types/exported.go +++ b/x/staking/types/exported.go @@ -21,8 +21,8 @@ type ValidatorI interface { IsUnbonded() bool // check if has status unbonded IsUnbonding() bool // check if has status unbonding GetOperator() sdk.ValAddress // operator address to receive/return validators coins - GetConsPubKey() crypto.PubKey // validation consensus pubkey - GetConsAddr() sdk.ConsAddress // validation consensus address + TmConsPubKey() (crypto.PubKey, error) // validation consensus pubkey + GetConsAddr() (sdk.ConsAddress, error) // validation consensus address GetTokens() sdk.Int // validation tokens GetBondedTokens() sdk.Int // validator bonded tokens GetConsensusPower() int64 // validation power in tendermint diff --git a/x/staking/types/genesis.go b/x/staking/types/genesis.go index 8b00c4d89a..a0a510f6b4 100644 --- a/x/staking/types/genesis.go +++ b/x/staking/types/genesis.go @@ -4,6 +4,7 @@ import ( "encoding/json" "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" ) // NewGenesisState creates a new GenesisState instanc e @@ -33,3 +34,13 @@ func GetGenesisStateFromAppState(cdc codec.JSONMarshaler, appState map[string]js return &genesisState } + +// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces +func (g GenesisState) UnpackInterfaces(c codectypes.AnyUnpacker) error { + for i := range g.Validators { + if err := g.Validators[i].UnpackInterfaces(c); err != nil { + return err + } + } + return nil +} diff --git a/x/staking/types/historical_info.go b/x/staking/types/historical_info.go index fc4dc2906b..10df3ced02 100644 --- a/x/staking/types/historical_info.go +++ b/x/staking/types/historical_info.go @@ -3,9 +3,11 @@ package types import ( "sort" + "github.com/gogo/protobuf/proto" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -20,11 +22,6 @@ func NewHistoricalInfo(header tmproto.Header, valSet Validators) HistoricalInfo } } -// MustMarshalHistoricalInfo wll marshal historical info and panic on error -func MustMarshalHistoricalInfo(cdc codec.BinaryMarshaler, hi HistoricalInfo) []byte { - return cdc.MustMarshalBinaryBare(&hi) -} - // MustUnmarshalHistoricalInfo wll unmarshal historical info and panic on error func MustUnmarshalHistoricalInfo(cdc codec.BinaryMarshaler, value []byte) HistoricalInfo { hi, err := UnmarshalHistoricalInfo(cdc, value) @@ -38,7 +35,6 @@ func MustUnmarshalHistoricalInfo(cdc codec.BinaryMarshaler, value []byte) Histor // UnmarshalHistoricalInfo will unmarshal historical info and return any error func UnmarshalHistoricalInfo(cdc codec.BinaryMarshaler, value []byte) (hi HistoricalInfo, err error) { err = cdc.UnmarshalBinaryBare(value, &hi) - return hi, err } @@ -54,3 +50,29 @@ func ValidateBasic(hi HistoricalInfo) error { return nil } + +// Equal checks if receiver is equal to the parameter +func (hi *HistoricalInfo) Equal(hi2 *HistoricalInfo) bool { + if !proto.Equal(&hi.Header, &hi2.Header) { + return false + } + if len(hi.Valset) != len(hi2.Valset) { + return false + } + for i := range hi.Valset { + if !hi.Valset[i].Equal(&hi2.Valset[i]) { + return false + } + } + return true +} + +// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces +func (hi HistoricalInfo) UnpackInterfaces(c codectypes.AnyUnpacker) error { + for i := range hi.Valset { + if err := hi.Valset[i].UnpackInterfaces(c); err != nil { + return err + } + } + return nil +} diff --git a/x/staking/types/historical_info_test.go b/x/staking/types/historical_info_test.go index e37ca88218..f7f6f2a869 100644 --- a/x/staking/types/historical_info_test.go +++ b/x/staking/types/historical_info_test.go @@ -9,36 +9,41 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ) -var ( - validators = []Validator{ - NewValidator(valAddr1, pk1, Description{}), - NewValidator(valAddr2, pk2, Description{}), - NewValidator(valAddr3, pk3, Description{}), +var header = tmproto.Header{ + ChainID: "hello", + Height: 5, +} + +func createValidators(t *testing.T) []Validator { + return []Validator{ + newValidator(t, valAddr1, pk1), + newValidator(t, valAddr2, pk2), + newValidator(t, valAddr3, pk3), } - header = tmproto.Header{ - ChainID: "hello", - Height: 5, - } -) +} func TestHistoricalInfo(t *testing.T) { + validators := createValidators(t) hi := NewHistoricalInfo(header, validators) require.True(t, sort.IsSorted(Validators(hi.Valset)), "Validators are not sorted") var value []byte require.NotPanics(t, func() { - value = MustMarshalHistoricalInfo(ModuleCdc, hi) + value = ModuleCdc.MustMarshalBinaryBare(&hi) }) - require.NotNil(t, value, "Marshalled HistoricalInfo is nil") recv, err := UnmarshalHistoricalInfo(ModuleCdc, value) require.Nil(t, err, "Unmarshalling HistoricalInfo failed") - require.Equal(t, hi, recv, "Unmarshalled HistoricalInfo is different from original") + require.Equal(t, hi.Header, recv.Header) + for i := range hi.Valset { + require.True(t, hi.Valset[i].Equal(&recv.Valset[i])) + } require.True(t, sort.IsSorted(Validators(hi.Valset)), "Validators are not sorted") } func TestValidateBasic(t *testing.T) { + validators := createValidators(t) hi := HistoricalInfo{ Header: header, } @@ -53,7 +58,6 @@ func TestValidateBasic(t *testing.T) { validators[j] = it }) } - hi = HistoricalInfo{ Header: header, Valset: validators, diff --git a/x/staking/types/keys_test.go b/x/staking/types/keys_test.go index 725438707c..3569b126c1 100644 --- a/x/staking/types/keys_test.go +++ b/x/staking/types/keys_test.go @@ -24,8 +24,7 @@ var ( func TestGetValidatorPowerRank(t *testing.T) { valAddr1 := sdk.ValAddress(keysAddr1) - emptyDesc := Description{} - val1 := NewValidator(valAddr1, keysPK1, emptyDesc) + val1 := newValidator(t, valAddr1, keysPK1) val1.Tokens = sdk.ZeroInt() val2, val3, val4 := val1, val1, val1 val2.Tokens = sdk.TokensFromConsensusPower(1) diff --git a/x/staking/types/staking.pb.go b/x/staking/types/staking.pb.go index 1c743ca1cd..a5e7693f5d 100644 --- a/x/staking/types/staking.pb.go +++ b/x/staking/types/staking.pb.go @@ -7,8 +7,9 @@ import ( bytes "bytes" compress_gzip "compress/gzip" fmt "fmt" + types1 "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types1 "github.com/cosmos/cosmos-sdk/types" + types2 "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto" @@ -16,6 +17,7 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "github.com/golang/protobuf/ptypes/duration" _ "github.com/golang/protobuf/ptypes/timestamp" + _ "github.com/regen-network/cosmos-proto" types "github.com/tendermint/tendermint/proto/tendermint/types" io "io" io_ioutil "io/ioutil" @@ -301,7 +303,7 @@ func (m *Description) GetDetails() string { // multiplied by exchange rate. type Validator struct { OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty" yaml:"operator_address"` - ConsensusPubkey string `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty" yaml:"consensus_pubkey"` + ConsensusPubkey *types1.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty" yaml:"consensus_pubkey"` Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` Status BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"` Tokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokens"` @@ -871,7 +873,7 @@ func (m *Params) GetBondDenom() string { // balance in addition to shares which is more suitable for client responses. type DelegationResponse struct { Delegation Delegation `protobuf:"bytes,1,opt,name=delegation,proto3" json:"delegation"` - Balance types1.Coin `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance"` + Balance types2.Coin `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance"` } func (m *DelegationResponse) Reset() { *m = DelegationResponse{} } @@ -913,11 +915,11 @@ func (m *DelegationResponse) GetDelegation() Delegation { return Delegation{} } -func (m *DelegationResponse) GetBalance() types1.Coin { +func (m *DelegationResponse) GetBalance() types2.Coin { if m != nil { return m.Balance } - return types1.Coin{} + return types2.Coin{} } // RedelegationEntryResponse is equivalent to a RedelegationEntry except that it @@ -1092,117 +1094,119 @@ func init() { } var fileDescriptor_64c30c6cf92913c9 = []byte{ - // 1754 bytes of a gzipped FileDescriptorProto + // 1790 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4d, 0x6c, 0x23, 0x49, - 0x15, 0x76, 0xdb, 0x5e, 0xc7, 0x7e, 0x4e, 0xe2, 0xb8, 0xe6, 0x67, 0x3d, 0x66, 0x70, 0x7b, 0x9b, - 0xd5, 0x12, 0xd0, 0xe2, 0x30, 0x01, 0x2d, 0x22, 0x17, 0x18, 0xc7, 0x19, 0x62, 0xb1, 0x0c, 0xa1, - 0x9d, 0x09, 0x12, 0xac, 0xb0, 0xca, 0xdd, 0x15, 0xa7, 0x89, 0xbb, 0xdb, 0x74, 0x95, 0x87, 0x44, - 0xda, 0x03, 0xc7, 0x65, 0x10, 0x62, 0xb9, 0xed, 0x65, 0xa4, 0x91, 0xf6, 0x8a, 0xc4, 0x8d, 0x2b, - 0xd7, 0x45, 0x5c, 0x86, 0x1b, 0x42, 0xc8, 0xa0, 0x99, 0x0b, 0xe2, 0x84, 0x7c, 0x40, 0x9c, 0x00, - 0xd5, 0x4f, 0xff, 0xa4, 0x1d, 0xcf, 0x8c, 0x47, 0x7b, 0x58, 0x09, 0x2e, 0x89, 0xeb, 0xd5, 0x7b, - 0xdf, 0xab, 0xf7, 0x5b, 0xaf, 0x1a, 0x5e, 0xb7, 0x7c, 0xea, 0xfa, 0x74, 0x8b, 0x32, 0x7c, 0xea, - 0x78, 0xc3, 0xad, 0xfb, 0xb7, 0x06, 0x84, 0xe1, 0x5b, 0xe1, 0xba, 0x35, 0x0e, 0x7c, 0xe6, 0xa3, - 0xeb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bf, 0xc8, 0xcd, + 0x57, 0x7b, 0xad, 0x55, 0xad, 0xba, 0x74, 0xef, 0x7e, 0xbd, 0x20, 0x67, 0x31, 0x62, 0xa3, 0x4d, + 0xb8, 0x3a, 0xcd, 0xd7, 0xbe, 0xfd, 0x8d, 0xd5, 0x6c, 0x75, 0xf9, 0xde, 0xfd, 0x7a, 0x31, 0x1a, + 0xda, 0x90, 0x01, 0x28, 0xc9, 0xa9, 0xf4, 0x2d, 0x54, 0xe1, 0xde, 0xfd, 0x7a, 0x5e, 0x02, 0x58, + 0xcd, 0xbd, 0xf7, 0x61, 0x2d, 0xd3, 0xbc, 0xf5, 0xd1, 0xa3, 0x9a, 0xf6, 0xf0, 0x51, 0x4d, 0xfb, + 0xfb, 0xa3, 0x9a, 0xf6, 0xfe, 0xe3, 0x5a, 0xe6, 0xe1, 0xe3, 0x5a, 0xe6, 0xcf, 0x8f, 0x6b, 0x99, + 0xef, 0xbe, 0xfe, 0x44, 0xec, 0xce, 0xa3, 0xcf, 0xd8, 0x02, 0xc5, 0x6e, 0x5e, 0xb4, 0xe1, 0x2f, + 0xfd, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x42, 0xbc, 0xa2, 0xf2, 0xe5, 0x16, 0x00, 0x00, } func (this *Pool) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) { @@ -1211,582 +1215,605 @@ func (this *Pool) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_ func StakingDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) { d := &github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet{} var gzipped = []byte{ - // 9194 bytes of a gzipped FileDescriptorSet - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x7d, 0x6d, 0x70, 0x5c, 0xd7, - 0x75, 0x18, 0xdf, 0x7e, 0x00, 0xbb, 0x07, 0x0b, 0x60, 0x71, 0x01, 0x82, 0xcb, 0x25, 0x09, 0x40, - 0x4f, 0xb2, 0x44, 0x51, 0x12, 0x20, 0x51, 0x22, 0x45, 0x2e, 0x63, 0xc9, 0x58, 0xec, 0x12, 0x04, - 0x89, 0x2f, 0x3d, 0x00, 0x94, 0x3f, 0x92, 0xee, 0x3c, 0xbc, 0xbd, 0x58, 0x3c, 0x71, 0xf7, 0xbd, - 0xa7, 0xf7, 0xde, 0x92, 0x80, 0x6c, 0xcf, 0x28, 0xb1, 0xeb, 0xda, 0x4a, 0x53, 0xdb, 0x71, 0x26, - 0xb5, 0x65, 0xd3, 0x95, 0xe3, 0xb4, 0x4e, 0x9d, 0xb4, 0xf9, 0x70, 0xea, 0x36, 0x6d, 0x67, 0xea, - 0x74, 0x9a, 0xc6, 0x69, 0x67, 0x32, 0xd2, 0x34, 0x33, 0x4d, 0x33, 0x0d, 0x93, 0xca, 0x9a, 0x54, - 0x75, 0xdd, 0xc6, 0x61, 0xd5, 0x36, 0x1d, 0xcf, 0xb4, 0x9d, 0xfb, 0xf5, 0xbe, 0x76, 0x17, 0xbb, - 0x80, 0x48, 0xc9, 0x69, 0xfa, 0x0b, 0x7b, 0xcf, 0x3d, 0xe7, 0xdc, 0x73, 0xce, 0x3d, 0xf7, 0xdc, - 0x73, 0xcf, 0xbb, 0xef, 0x01, 0xbe, 0x78, 0x01, 0xa6, 0x6a, 0xa6, 0x59, 0xab, 0xe3, 0x19, 0xcb, - 0x36, 0x5d, 0x73, 0xb3, 0xb9, 0x35, 0x53, 0xc5, 0x8e, 0x66, 0xeb, 0x96, 0x6b, 0xda, 0xd3, 0x14, - 0x86, 0x86, 0x19, 0xc6, 0xb4, 0xc0, 0x90, 0x97, 0x60, 0xe4, 0xa2, 0x5e, 0xc7, 0x25, 0x0f, 0x71, - 0x0d, 0xbb, 0xe8, 0x1c, 0x24, 0xb6, 0xf4, 0x3a, 0xce, 0x49, 0x53, 0xf1, 0x93, 0x03, 0xa7, 0xef, - 0x9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x42, 0xa2, 0x30, 0x4a, 0xf4, 0x14, 0x24, 0x78, 0x88, 0x26, 0x1c, - 0x4e, 0xf5, 0xc6, 0x81, 0xac, 0x25, 0x85, 0xd2, 0xa1, 0x63, 0x90, 0x26, 0x7f, 0x99, 0x6f, 0xf4, - 0x51, 0x99, 0x53, 0x04, 0x40, 0xfc, 0x02, 0xe5, 0x21, 0x45, 0x97, 0x49, 0x15, 0x8b, 0xad, 0xcd, - 0x6b, 0x13, 0xc7, 0xaa, 0xe2, 0x2d, 0xb5, 0x59, 0x77, 0x2b, 0xd7, 0xd5, 0x7a, 0x13, 0x53, 0x87, - 0x4f, 0x2b, 0x19, 0x0e, 0xbc, 0x4a, 0x60, 0x68, 0x12, 0x06, 0xd8, 0xaa, 0xd2, 0x8d, 0x2a, 0xde, - 0xa1, 0xd1, 0x33, 0xa9, 0xb0, 0x85, 0xb6, 0x40, 0x20, 0x64, 0xf8, 0xe7, 0x1c, 0xd3, 0x10, 0xae, - 0x49, 0x87, 0x20, 0x00, 0x3a, 0xfc, 0x93, 0xd1, 0xc0, 0x7d, 0xa2, 0xbd, 0x7a, 0x51, 0x9f, 0x92, - 0xbf, 0x19, 0x83, 0x04, 0x8d, 0x17, 0xc3, 0x30, 0xb0, 0xfe, 0x81, 0xd5, 0x72, 0xa5, 0xb4, 0xb2, - 0x51, 0x5c, 0x2c, 0x67, 0x25, 0x34, 0x04, 0x40, 0x01, 0x17, 0x17, 0x57, 0x66, 0xd7, 0xb3, 0x31, - 0xaf, 0xbd, 0xb0, 0xbc, 0x7e, 0xf6, 0x89, 0x6c, 0xdc, 0x23, 0xd8, 0x60, 0x80, 0x44, 0x10, 0xe1, - 0xf1, 0xd3, 0xd9, 0x24, 0xca, 0x42, 0x86, 0x31, 0x58, 0x78, 0x7f, 0xb9, 0x74, 0xf6, 0x89, 0x6c, - 0x5f, 0x18, 0xf2, 0xf8, 0xe9, 0x6c, 0x3f, 0x1a, 0x84, 0x34, 0x85, 0x14, 0x57, 0x56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0xcb, 0x45, 0xd3, 0x26, 0x0e, 0x55, 0x33, 0x3d, 0x03, 0x0f, 0x30, 0x87, 0xaa, 0x99, - 0xc2, 0xbc, 0x67, 0x60, 0x54, 0xd3, 0x98, 0xce, 0xba, 0x56, 0xe1, 0x67, 0x2c, 0x27, 0x97, 0x0d, - 0x19, 0x4b, 0xd3, 0xe6, 0x19, 0x02, 0xf7, 0x71, 0x07, 0x9d, 0x87, 0xc3, 0xbe, 0xb1, 0x82, 0x84, - 0x23, 0x2d, 0x5a, 0x46, 0x49, 0xcf, 0xc0, 0xa8, 0xb5, 0xdb, 0x4a, 0x88, 0x42, 0x23, 0x5a, 0xbb, - 0x51, 0xb2, 0x27, 0x61, 0xcc, 0xda, 0xb6, 0x5a, 0xe9, 0x4e, 0x05, 0xe9, 0x90, 0xb5, 0x6d, 0x45, - 0x09, 0xdf, 0x43, 0x0f, 0xdc, 0x36, 0xd6, 0x54, 0x17, 0x57, 0x73, 0x47, 0x82, 0xe8, 0x81, 0x0e, - 0x34, 0x03, 0x59, 0x4d, 0xab, 0x60, 0x43, 0xdd, 0xac, 0xe3, 0x8a, 0x6a, 0x63, 0x43, 0x75, 0x72, - 0x93, 0x41, 0xe4, 0x21, 0x4d, 0x2b, 0xd3, 0xde, 0x59, 0xda, 0x89, 0x4e, 0xc1, 0x88, 0xb9, 0xf9, - 0x9c, 0xc6, 0x5c, 0xb2, 0x62, 0xd9, 0x78, 0x4b, 0xdf, 0xc9, 0xdd, 0x47, 0xed, 0x3b, 0x4c, 0x3a, - 0xa8, 0x43, 0xae, 0x52, 0x30, 0x7a, 0x10, 0xb2, 0x9a, 0xb3, 0xad, 0xda, 0x16, 0x8d, 0xc9, 0x8e, - 0xa5, 0x6a, 0x38, 0xf7, 0x1e, 0x86, 0xca, 0xe0, 0xcb, 0x02, 0x4c, 0x96, 0x84, 0x73, 0x43, 0xdf, - 0x72, 0x05, 0xc7, 0x07, 0xd8, 0x92, 0xa0, 0x30, 0xce, 0xed, 0x24, 0x64, 0x89, 0x29, 0x42, 0x03, - 0x9f, 0xa4, 0x68, 0x43, 0xd6, 0xb6, 0x15, 0x1c, 0xf7, 0x5e, 0x18, 0x24, 0x98, 0xfe, 0xa0, 0x0f, - 0xb2, 0x84, 0xcc, 0xda, 0x0e, 0x8c, 0xf8, 0x04, 0x8c, 0x13, 0xa4, 0x06, 0x76, 0xd5, 0xaa, 0xea, - 0xaa, 0x01, 0xec, 0x87, 0x29, 0x36, 0xb1, 0xfb, 0x12, 0xef, 0x0c, 0xc9, 0x69, 0x37, 0x37, 0x77, - 0x3d, 0xcf, 0x7a, 0x84, 0xc9, 0x49, 0x60, 0xc2, 0xb7, 0xee, 0x5a, 0xd2, 0x2d, 0x17, 0x20, 0x13, - 0x74, 0x7c, 0x94, 0x06, 0xe6, 0xfa, 0x59, 0x89, 0x64, 0x41, 0x73, 0x2b, 0x25, 0x92, 0xbf, 0x7c, - 0xb0, 0x9c, 0x8d, 0x91, 0x3c, 0x6a, 0x71, 0x61, 0xbd, 0x5c, 0x51, 0x36, 0x96, 0xd7, 0x17, 0x96, - 0xca, 0xd9, 0x78, 0x20, 0x61, 0xbf, 0x9c, 0x48, 0xdd, 0x9f, 0x7d, 0x40, 0x7e, 0x2d, 0x06, 0x43, - 0xe1, 0x13, 0x18, 0xfa, 0x11, 0x38, 0x22, 0xca, 0x25, 0x0e, 0x76, 0x2b, 0x37, 0x74, 0x9b, 0xae, - 0xc8, 0x86, 0xca, 0x76, 0x47, 0xcf, 0x27, 0xc6, 0x38, 0xd6, 0x1a, 0x76, 0x9f, 0xd5, 0x6d, 0xb2, - 0xde, 0x1a, 0xaa, 0x8b, 0x16, 0x61, 0xd2, 0x30, 0x2b, 0x8e, 0xab, 0x1a, 0x55, 0xd5, 0xae, 0x56, - 0xfc, 0x42, 0x55, 0x45, 0xd5, 0x34, 0xec, 0x38, 0x26, 0xdb, 0x09, 0x3d, 0x2e, 0xc7, 0x0d, 0x73, - 0x8d, 0x23, 0xfb, 0x5b,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, 0x5b, 0x24, 0xdf, 0x72, 0xe2, - 0xf0, 0xb2, 0xb8, 0x62, 0x8a, 0x0c, 0xfc, 0x99, 0x3f, 0x9a, 0x94, 0x14, 0x4a, 0x81, 0xe6, 0x60, - 0xb0, 0xae, 0x3a, 0x6e, 0x85, 0xee, 0x50, 0x64, 0xf8, 0x24, 0x65, 0x71, 0xb4, 0xd5, 0x20, 0xdc, - 0xb0, 0x5c, 0xf4, 0x01, 0x42, 0xc5, 0x40, 0x55, 0x74, 0x12, 0xb2, 0x94, 0x89, 0x66, 0x36, 0x1a, - 0xba, 0xcb, 0x72, 0xa7, 0x3e, 0x6a, 0xf7, 0x21, 0x02, 0x9f, 0xa3, 0x60, 0x9a, 0x41, 0x1d, 0x83, - 0x34, 0xbd, 0x9e, 0x4e, 0x51, 0xd8, 0x55, 0xac, 0x14, 0x01, 0xd0, 0xce, 0x07, 0x60, 0xd8, 0x8f, - 0x8f, 0x0c, 0x25, 0xc5, 0xb8, 0xf8, 0x60, 0x8a, 0xf8, 0x28, 0x8c, 0x19, 0x78, 0x87, 0x5e, 0x0e, - 0x0b, 0x61, 0xa7, 0x29, 0x36, 0x22, 0x7d, 0x57, 0xc3, 0x14, 0xef, 0x81, 0x21, 0x4d, 0x18, 0x9f, - 0xe1, 0x02, 0xc5, 0x1d, 0xf4, 0xa0, 0x14, 0xed, 0x28, 0xa4, 0x54, 0xcb, 0x62, 0x08, 0x03, 0x3c, - 0x3e, 0x5a, 0x16, 0xed, 0x3a, 0x05, 0x23, 0x54, 0x47, 0x1b, 0x3b, 0xcd, 0xba, 0xcb, 0x99, 0x64, - 0x28, 0xce, 0x30, 0xe9, 0x50, 0x18, 0x9c, 0xe2, 0xde, 0x0b, 0x83, 0xf8, 0xba, 0x5e, 0xc5, 0x86, - 0x86, 0x19, 0xde, 0x20, 0xc5, 0xcb, 0x08, 0x20, 0x45, 0x7a, 0x10, 0xbc, 0xb8, 0x57, 0x11, 0x31, - 0x79, 0x88, 0xf1, 0x13,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69, 0x55, 0x55, 0x17, 0x57, 0xe8, 0x01, 0x35, 0xd6, 0x35, 0x81, 0x99, 0x20, 0xbc, 0x6e, - 0xdf, 0x9a, 0x44, 0x4c, 0xad, 0x00, 0xb1, 0x4c, 0xd3, 0x1a, 0x60, 0x10, 0x42, 0x10, 0xd0, 0xe9, - 0x77, 0x24, 0x18, 0x28, 0x05, 0xae, 0xc5, 0xe4, 0xa0, 0xbf, 0x61, 0x1a, 0xfa, 0x35, 0xee, 0x8f, - 0x69, 0x45, 0x34, 0x51, 0x1e, 0x52, 0xec, 0x0d, 0x25, 0x77, 0x57, 0xd4, 0x70, 0x45, 0x9b, 0x50, - 0xdd, 0xc0, 0x9b, 0x8e, 0x2e, 0x66, 0x43, 0x11, 0x4d, 0x74, 0x11, 0xb2, 0x0e, 0xd6, 0x9a, 0xb6, - 0xee, 0xee, 0x56, 0x34, 0xd3, 0x70, 0x55, 0xcd, 0x65, 0xef, 0xba, 0x14, 0x8f, 0xdd, 0xbe, 0x35, - 0x79, 0x84, 0xc9, 0x1a, 0xc5, 0x90, 0x95, 0x61, 0x01, 0x9a, 0x63, 0x10, 0x32, 0x42, 0x15, 0xbb, - 0xaa, 0x5e, 0x77, 0x68, 0x4e, 0x98, 0x56, 0x44, 0x33, 0xa0, 0xcb, 0xff, 0xee, 0x0b, 0x56, 0xec, - 0x2e, 0x42, 0xd6, 0xb4, 0xb0, 0x1d, 0xca, 0xb0, 0xa5, 0xe8, 0xc8, 0x51, 0x0c, 0x59, 0x19, 0x16, - 0x20, 0x91, 0x7d, 0x5f, 0x24, 0xd3, 0x2c, 0x4e, 0xc0, 0x56, 0x73, 0x53, 0x14, 0xfa, 0x42, 0x7c, - 0xa2, 0x18, 0x32, 0x99, 0x50, 0x0e, 0x5a, 0xa5, 0x10, 0x92, 0x21, 0x3f, 0xa7, 0xea, 0x75, 0xf1, - 0x16, 0xa6, 0xc2, 0x5b, 0xa8, 0x00, 0x7d, 0x8e, 0xab, 0xba, 0x4d, 0x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0x48, 0xe1, 0x1d, 0xcb, 0xb4, 0x5d, 0x5c, 0xa5, 0x57, - 0x1e, 0x52, 0x8a, 0xd7, 0x96, 0x97, 0x01, 0xb5, 0x4e, 0x6e, 0xf4, 0x43, 0x8b, 0x69, 0xff, 0x43, - 0x8b, 0x63, 0x90, 0x0c, 0x7e, 0x8a, 0x90, 0x35, 0xee, 0xde, 0x6d, 0xa1, 0xff, 0x1b, 0x00, 0x00, - 0xff, 0xff, 0x08, 0x1f, 0x88, 0x9b, 0x77, 0x8d, 0x00, 0x00, + // 9554 bytes of a gzipped FileDescriptorSet + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x7d, 0x70, 0x24, 0xc7, + 0x75, 0x18, 0x7e, 0xb3, 0x1f, 0xc0, 0xee, 0xc3, 0x02, 0x58, 0x34, 0x70, 0xe0, 0xde, 0xf2, 0x08, + 0x80, 0xc3, 0xaf, 0xe3, 0x91, 0x04, 0xc8, 0x23, 0xef, 0x78, 0xb7, 0x27, 0x91, 0xc2, 0x02, 0x7b, + 0x38, 0xdc, 0xe1, 0x8b, 0x03, 0xe0, 0xa8, 0x2f, 0xff, 0xb6, 0x06, 0xbb, 0x8d, 0xc5, 0x10, 0xbb, + 0x33, 0xc3, 0x99, 0xd9, 0xbb, 0x03, 0x25, 0x55, 0xd1, 0x92, 0x7e, 0x8a, 0x44, 0xc7, 0x91, 0x64, + 0xb9, 0x1c, 0x89, 0xd2, 0x29, 0x92, 0xe5, 0x44, 0x8e, 0xec, 0xc4, 0x1f, 0x52, 0x94, 0x38, 0x49, + 0x95, 0xe5, 0x54, 0x1c, 0x4b, 0x4a, 0x95, 0x4b, 0xaa, 0xb8, 0x12, 0xc7, 0x15, 0x9f, 0x1d, 0x4a, + 0x71, 0x18, 0x45, 0x89, 0xe5, 0x8b, 0x9c, 0x38, 0xa5, 0x54, 0x25, 0xd5, 0x5f, 0xf3, 0xb5, 0x1f, + 0xb3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d, 0xb5, 0x86, 0xcb, 0xce, 0x81, 0x89, 0x73, 0x09, + 0xda, 0xfb, 0x99, 0x96, 0xde, 0x87, 0x7b, 0x3e, 0xc4, 0xa9, 0xb6, 0x0e, 0x4c, 0x8c, 0xe6, 0x21, + 0x8d, 0xf5, 0x66, 0x83, 0x71, 0x48, 0x76, 0xd0, 0x5f, 0x49, 0x6f, 0x36, 0xc2, 0x5c, 0x52, 0x84, + 0x8c, 0xb3, 0x18, 0xb4, 0xb1, 0x75, 0x55, 0xab, 0xe0, 0xdc, 0x00, 0x65, 0xf0, 0x50, 0x0b, 0x83, + 0x4d, 0x56, 0x1f, 0xe6, 0x21, 0xe8, 0xd0, 0x02, 0xa4, 0xf1, 0x75, 0x07, 0xeb, 0xb6, 0x66, 0xe8, + 0xb9, 0x41, 0xca, 0xe4, 0x81, 0x36, 0xa3, 0x88, 0xeb, 0xd5, 0x30, 0x0b, 0x8f, 0x0e, 0x9d, 0x81, + 0x41, 0xc3, 0x74, 0x34, 0x43, 0xb7, 0x73, 0xa9, 0x19, 0xe9, 0xc4, 0xd0, 0xa9, 0xe3, 0x6d, 0x0d, + 0x61, 0x9d, 0xe1, 0x28, 0x02, 0x19, 0x2d, 0x43, 0xd6, 0x36, 0x9a, 0x56, 0x05, 0x97, 0x2b, 0x46, + 0x15, 0x97, 0x35, 0x7d, 0xd7, 0xc8, 0xa5, 0x29, 0x83, 0xe9, 0xd6, 0x8e, 0x50, 0xc4, 0x05, 0xa3, + 0x8a, 0x97, 0xf5, 0x5d, 0x43, 0x19, 0xb1, 0x03, 0x65, 0x34, 0x09, 0x03, 0xf6, 0x81, 0xee, 0xa8, + 0xd7, 0x73, 0x19, 0x6a, 0x21, 0xbc, 0x24, 0xff, 0xc6, 0x00, 0x8c, 0xf6, 0x62, 0x62, 0xe7, 0x21, + 0xb9, 0x4b, 0x7a, 0x99, 0x8b, 0xf5, 0xa3, 0x03, 0x46, 0x13, 0x54, 0xe2, 0xc0, 0x21, 0x95, 0x38, + 0x0f, 0x43, 0x3a, 0xb6, 0x1d, 0x5c, 0x65, 0x16, 0x11, 0xef, 0xd1, 0xa6, 0x80, 0x11, 0xb5, 0x9a, + 0x54, 0xe2, 0x50, 0x26, 0xf5, 0x56, 0x18, 0x75, 0x45, 0x2a, 0x5b, 0xaa, 0x5e, 0x13, 0xb6, 0x39, + 0x17, 0x25, 0xc9, 0x6c, 0x49, 0xd0, 0x29, 0x84, 0x4c, 0x19, 0xc1, 0x81, 0x32, 0x5a, 0x04, 0x30, + 0x74, 0x6c, 0xec, 0x96, 0xab, 0xb8, 0x52, 0xcf, 0xa5, 0x3a, 0x68, 0x69, 0x9d, 0xa0, 0xb4, 0x68, + 0xc9, 0x60, 0xd0, 0x4a, 0x1d, 0x9d, 0xf3, 0x4c, 0x6d, 0xb0, 0x83, 0xa5, 0xac, 0xb2, 0x49, 0xd6, + 0x62, 0x6d, 0xdb, 0x30, 0x62, 0x61, 0x62, 0xf7, 0xb8, 0xca, 0x7b, 0x96, 0xa6, 0x42, 0xcc, 0x46, + 0xf6, 0x4c, 0xe1, 0x64, 0xac, 0x63, 0xc3, 0x96, 0xbf, 0x88, 0xee, 0x03, 0x17, 0x50, 0xa6, 0x66, + 0x05, 0xd4, 0x0b, 0x65, 0x04, 0x70, 0x4d, 0x6d, 0xe0, 0xfc, 0x4b, 0x30, 0x12, 0x54, 0x0f, 0x9a, + 0x80, 0xa4, 0xed, 0xa8, 0x96, 0x43, 0xad, 0x30, 0xa9, 0xb0, 0x02, 0xca, 0x42, 0x1c, 0xeb, 0x55, + 0xea, 0xe5, 0x92, 0x0a, 0xf9, 0x89, 0xde, 0xe2, 0x75, 0x38, 0x4e, 0x3b, 0xfc, 0x60, 0xeb, 0x88, + 0x06, 0x38, 0x87, 0xfb, 0x9d, 0x7f, 0x1a, 0x86, 0x03, 0x1d, 0xe8, 0xb5, 0x69, 0xf9, 0xdd, 0x70, + 0xb4, 0x2d, 0x6b, 0xf4, 0x56, 0x98, 0x68, 0xea,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0x50, 0xde, 0xf7, 0x77, 0xe7, 0x7d, 0x69, 0x93, 0x32, + 0x4f, 0x5f, 0xda, 0x2c, 0xaf, 0xad, 0x2b, 0xab, 0xf3, 0x2b, 0x0a, 0x27, 0x47, 0xc7, 0x20, 0x51, + 0x57, 0x5f, 0x3a, 0x08, 0xae, 0x7a, 0x14, 0xd4, 0xeb, 0x20, 0x1c, 0x83, 0xc4, 0x35, 0xac, 0xee, + 0x07, 0xd7, 0x1a, 0x0a, 0xba, 0x83, 0x93, 0x61, 0x0e, 0x92, 0x54, 0x5f, 0x08, 0x80, 0x6b, 0x2c, + 0x7b, 0x04, 0xa5, 0x20, 0xb1, 0xb0, 0xae, 0x90, 0x09, 0x91, 0x85, 0x0c, 0x83, 0x96, 0x37, 0x96, + 0x4b, 0x0b, 0xa5, 0x6c, 0x4c, 0x3e, 0x0d, 0x03, 0x4c, 0x09, 0x64, 0xb2, 0xb8, 0x6a, 0xc8, 0x1e, + 0xe1, 0x45, 0xce, 0x43, 0x12, 0xb5, 0xdb, 0xab, 0xc5, 0x92, 0x92, 0x8d, 0x05, 0x87, 0x3a, 0x91, + 0x4d, 0xca, 0x36, 0x64, 0xfc, 0x81, 0xf8, 0x8f, 0x66, 0x93, 0xfd, 0x15, 0x09, 0x86, 0x7c, 0x81, + 0x35, 0x89, 0x88, 0xd4, 0x7a, 0xdd, 0xb8, 0x56, 0x56, 0xeb, 0x9a, 0x6a, 0x73, 0xd3, 0x00, 0x0a, + 0x9a, 0x27, 0x90, 0x5e, 0x87, 0xee, 0x47, 0x34, 0x45, 0x92, 0xd9, 0x01, 0xf9, 0xd3, 0x12, 0x64, + 0xc3, 0x91, 0x6d, 0x48, 0x4c, 0xe9, 0x8d, 0x14, 0x53, 0xfe, 0x94, 0x04, 0x23, 0xc1, 0x70, 0x36, + 0x24, 0xde, 0xbd, 0x6f, 0xa8, 0x78, 0x7f, 0x1c, 0x83, 0xe1, 0x40, 0x10, 0xdb, 0xab, 0x74, 0x2f, + 0x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 0x24, 0xd8, 0x63, 0x78, 0x64, 0xed, 0x90, 0x94, 0x21, + 0x06, 0x73, 0x51, 0x78, 0x18, 0xef, 0x65, 0xb3, 0x32, 0xca, 0x10, 0x83, 0x31, 0x94, 0x87, 0x60, + 0x54, 0xad, 0xd5, 0x2c, 0xc2, 0x5c, 0x30, 0x62, 0x1b, 0x93, 0x11, 0x17, 0x4c, 0x11, 0xf3, 0x97, + 0x20, 0x25, 0xf4, 0x40, 0x96, 0x6a, 0xa2, 0x89, 0xb2, 0xc9, 0x76, 0xdb, 0xb1, 0x13, 0x69, 0x25, + 0xa5, 0x8b, 0xca, 0x7b, 0x21, 0xa3, 0xd9, 0x65, 0x2f, 0x39, 0x1f, 0x9b, 0x89, 0x9d, 0x48, 0x29, + 0x43, 0x9a, 0xed, 0x26, 0x36, 0xe5, 0xcf, 0xc7, 0x60, 0x24, 0x78, 0xb8, 0x80, 0x16, 0x21, 0x55, + 0x37, 0x2a, 0x2a, 0x35, 0x2d, 0x76, 0xb2, 0x75, 0x22, 0xe2, 0x3c, 0x62, 0x76, 0x85, 0xe3, 0x2b, + 0x2e, 0x65, 0xfe, 0x77, 0x25, 0x48, 0x09, 0x30, 0x9a, 0x84, 0x84, 0xa9, 0x3a, 0x7b, 0x94, 0x5d, + 0xb2, 0x18, 0xcb, 0x4a, 0x0a, 0x2d, 0x13, 0xb8, 0x6d, 0xaa, 0x3a, 0x35, 0x01, 0x0e, 0x27, 0x65, + 0x32, 0xae, 0x75, 0xac, 0x56, 0xe9, 0xae, 0xc7, 0x68, 0x34, 0xb0, 0xee, 0xd8, 0x62, 0x5c, 0x39, + 0x7c, 0x81, 0x83, 0xd1, 0x23, 0x30, 0xe6, 0x58, 0xaa, 0x56, 0x0f, 0xe0, 0x26, 0x28, 0x6e, 0x56, + 0x54, 0xb8, 0xc8, 0x05, 0x38, 0x26, 0xf8, 0x56, 0xb1, 0xa3, 0x56, 0xf6, 0x70, 0xd5, 0x23, 0x1a, + 0xa0, 0xd9,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71, 0x70, 0x12, 0xee, 0x38, 0x9c, 0x03, 0x13, 0x93, + 0xd5, 0xbe, 0x07, 0x0e, 0x5f, 0x16, 0x8e, 0x43, 0xd0, 0x70, 0x16, 0x22, 0x60, 0xe8, 0x81, 0xc5, + 0x3f, 0x14, 0x2c, 0x04, 0x0d, 0x61, 0xf1, 0x9c, 0xb7, 0xd0, 0x5a, 0xb8, 0xa6, 0xd9, 0x8e, 0xc5, + 0xc2, 0xe4, 0xee, 0xac, 0xfe, 0xd1, 0x77, 0x83, 0x41, 0x98, 0xe2, 0x23, 0x25, 0x9e, 0x88, 0xa7, + 0x5d, 0xe9, 0x2e, 0x2a, 0x5a, 0xb0, 0xdf, 0x10, 0x9e, 0xc8, 0x47, 0x46, 0x64, 0xf3, 0x45, 0x88, + 0x44, 0xed, 0x15, 0xb2, 0x77, 0xe8, 0x81, 0xdd, 0x3f, 0x0e, 0x09, 0xb7, 0x29, 0x68, 0x09, 0x4f, + 0x5f, 0xfc, 0xd3, 0xd4, 0xf7, 0xf1, 0x41, 0x4f, 0xd6, 0xf9, 0x4f, 0x42, 0xf1, 0xcf, 0x36, 0xa3, + 0x64, 0x3e, 0x64, 0x34, 0x14, 0x4f, 0xa1, 0xa8, 0xfb, 0x43, 0xb9, 0x9f, 0xfc, 0x3e, 0xef, 0x6f, + 0x30, 0x9c, 0x2a, 0xac, 0x10, 0x23, 0x0f, 0x06, 0x3d, 0xd1, 0xcc, 0xde, 0xf7, 0x7d, 0xd7, 0xce, + 0x03, 0x31, 0x4f, 0xe1, 0x02, 0x0c, 0x07, 0x02, 0x9e, 0x68, 0x56, 0xef, 0xe7, 0xac, 0x32, 0xfe, + 0x78, 0xa7, 0x70, 0x1a, 0x12, 0x24, 0x78, 0x89, 0x26, 0xff, 0xff, 0x39, 0x39, 0x45, 0x2f, 0xbc, + 0x19, 0x52, 0x22, 0x68, 0x89, 0x26, 0xfd, 0x00, 0x27, 0x75, 0x49, 0x08, 0xb9, 0x08, 0x58, 0xa2,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 0x43, 0xaf, 0xa1, 0x5b, 0x0d, 0x4d, 0x77, 0xe6, + 0x2a, 0xd6, 0x81, 0xe9, 0x50, 0x03, 0x36, 0x76, 0xb9, 0x42, 0xc6, 0xbc, 0xea, 0x59, 0x56, 0x9d, + 0x6f, 0x7b, 0x6c, 0x21, 0xef, 0x42, 0x72, 0x83, 0xd0, 0x11, 0x55, 0x38, 0x86, 0xa3, 0xd6, 0xb9, + 0x8a, 0x58, 0x81, 0x40, 0xd9, 0xd5, 0xf5, 0x18, 0x83, 0x6a, 0xe2, 0xd6, 0x7a, 0x1d, 0xab, 0xbb, + 0xec, 0xaa, 0x60, 0x9c, 0x9e, 0x14, 0xa6, 0x08, 0x80, 0xde, 0x0a, 0x9c, 0x80, 0xa4, 0xda, 0x64, + 0x87, 0x5c, 0xf1, 0x13, 0x19, 0x85, 0x15, 0xe4, 0xcb, 0x30, 0xc8, 0x13, 0xeb, 0x28, 0x0b, 0xf1, + 0x7d, 0x7c, 0x40, 0xdb, 0xc9, 0x28, 0xe4, 0x27, 0x9a, 0x85, 0x24, 0x15, 0x9e, 0xdf, 0x81, 0xce, + 0xcd, 0xb6, 0x48, 0x3f, 0x4b, 0x85, 0x54, 0x18, 0x9a, 0x7c, 0x09, 0x52, 0x8b, 0x46, 0x43, 0xd3, + 0x8d, 0x20, 0xb7, 0x34, 0xe3, 0x46, 0x65, 0x36, 0x9b, 0x0e, 0x3f, 0x77, 0x62, 0x05, 0x34, 0x09, + 0x03, 0xec, 0xea, 0x28, 0x3f, 0xa8, 0xe3, 0x25, 0x79, 0x01, 0x06, 0x29, 0xef, 0x75, 0x13, 0x21, + 0xfe, 0x96, 0x80, 0xdf, 0x51, 0xa5, 0x53, 0x94, 0xb3, 0x8f, 0x79, 0xc2, 0x22, 0x48, 0x54, 0x55, + 0x47, 0xe5, 0xfd, 0xa6, 0xbf, 0xe5, 0x67, 0x20, 0xc5, 0x99, 0xd8, 0xe8, 0x14, 0xc4, 0x0d, 0xd3, + 0xe6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ad, 0xd8, 0x74, 0x71, 0xe8, 0xb5, 0x9b, 0xd3, 0x83, 0x0b, 0x04, 0xb6, 0xbc, + 0xa8, 0x0c, 0xd2, 0xca, 0xe5, 0x2a, 0x59, 0xe9, 0xf7, 0xb0, 0x56, 0xdb, 0x73, 0xf8, 0x0c, 0xe3, + 0x25, 0x74, 0x16, 0x12, 0xc4, 0x20, 0xf8, 0x5b, 0x91, 0x7c, 0x4b, 0x60, 0xeb, 0x46, 0x71, 0xc5, + 0x14, 0x69, 0xf8, 0x23, 0x7f, 0x34, 0x2d, 0x29, 0x94, 0x02, 0x2d, 0xc0, 0x70, 0x5d, 0xb5, 0x9d, + 0x32, 0x5d, 0xa1, 0x48, 0xf3, 0x49, 0xca, 0xe2, 0x58, 0xab, 0x42, 0xb8, 0x62, 0xb9, 0xe8, 0x43, + 0x84, 0x8a, 0x81, 0xaa, 0xe8, 0x04, 0x64, 0x29, 0x93, 0x8a, 0xd1, 0x68, 0x68, 0x0e, 0x8b, 0x9d, + 0x06, 0xa8, 0xde, 0x47, 0x08, 0x7c, 0x81, 0x82, 0x69, 0x04, 0x75, 0x37, 0xa4, 0xe9, 0xe5, 0x74, + 0x8a, 0xc2, 0x2e, 0x62, 0xa5, 0x08, 0x80, 0x56, 0x3e, 0x04, 0xa3, 0x9e, 0x7f, 0x64, 0x28, 0x29, + 0xc6, 0xc5, 0x03, 0x53, 0xc4, 0xc7, 0x61, 0x42, 0xc7, 0xd7, 0xe9, 0xd5, 0xb0, 0x00, 0x76, 0x9a, + 0x62, 0x23, 0x52, 0x77, 0x25, 0x48, 0xf1, 0x00, 0x8c, 0x54, 0x84, 0xf2, 0x19, 0x2e, 0x50, 0xdc, + 0x61, 0x17, 0x4a, 0xd1, 0x8e, 0x41, 0x4a, 0x35, 0x4d, 0x86, 0x30, 0xc4, 0xfd, 0xa3, 0x69, 0xd2, + 0xaa, 0x93, 0x30, 0x46, 0xfb, 0x68, 0x61, 0xbb, 0x59, 0x77, 0x38, 0x93, 0x0c, 0xc5, 0x19, 0x25, + 0x15, 0x0a, 0x83, 0x53, 0xdc, 0xfb, 0x60, 0x18, 0x5f, 0xd5, 0xaa, 0x58, 0xaf, 0x60, 0x86, 0x37, + 0x4c, 0xf1, 0x32, 0x02, 0x48, 0x91, 0x1e, 0x06, 0xd7, 0xef, 0x95, 0x85, 0x4f, 0x1e, 0x61, 0xfc, + 0x04, 0x7c, 0x9e, 0x81, 0xe5, 0x1c, 0x24, 0x16, 0x55, 0x47, 0x25, 0x01, 0x84, 0x73, 0x9d, 0x2d, + 0x34, 0x19, 0x85, 0xfc, 0x94, 0x5f, 0x8f, 0x41, 0xe2, 0x8a, 0xe1, 0x60, 0xf4, 0xa4, 0x2f, 0xc0, + 0x1b, 0x69, 0x67, 0xcf, 0x9b, 0x5a, 0x4d, 0xc7, 0xd5, 0x55, 0xbb, 0xe6, 0x7b, 0x21, 0xea, 0x99, + 0x53, 0x2c, 0x60, 0x4e, 0x13, 0x90, 0xb4, 0x8c, 0xa6, 0x5e, 0x15, 0x77, 0x98, 0x68, 0x01, 0x95, + 0x20, 0xe5, 0x5a, 0x49, 0x22, 0xca, 0x4a, 0x46, 0x89, 0x95, 0x10, 0x1b, 0xe6, 0x00, 0x65, 0x70, + 0x87, 0x1b, 0x4b, 0x11, 0xd2, 0xae, 0xf3, 0xe2, 0xd6, 0xd6, 0x9b, 0xc1, 0x7a, 0x64, 0x64, 0x31, + 0x71, 0xc7, 0xde, 0x55, 0x1e, 0xb3, 0xb8, 0xac, 0x5b, 0xc1, 0xb5, 0x17, 0x30, 0x2b, 0xfe, 0x5a, + 0x75, 0x90, 0xf6, 0xcb, 0x33, 0x2b, 0xf6, 0x62, 0xf5, 0x38, 0xa4, 0x6d, 0xad, 0xa6, 0xab, 0x4e, + 0xd3, 0xc2, 0xdc, 0xf2, 0x3c, 0x80, 0xfc, 0x15, 0x09, 0x06, 0x98, 0x25, 0xfb, 0xf4, 0x26, 0xb5, + 0xd7, 0x5b, 0xac, 0x93,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, 0x27, 0x00, 0x31, 0x66, 0x34, 0x91, 0x2f, 0x9a, 0xd8, 0x84, + 0xf1, 0x00, 0x94, 0x37, 0xf2, 0x43, 0x1d, 0x12, 0x9c, 0xfa, 0xce, 0x51, 0x48, 0x52, 0xae, 0xe8, + 0x13, 0x12, 0x80, 0xef, 0x44, 0x78, 0xb6, 0x13, 0x9b, 0xf6, 0x7b, 0xe2, 0xfc, 0x5c, 0xcf, 0xf8, + 0x3c, 0x66, 0x3b, 0xf9, 0xde, 0x7f, 0xf5, 0xed, 0x8f, 0xc5, 0xee, 0x47, 0xf2, 0x5c, 0x87, 0xdd, + 0xb8, 0x6f, 0xbe, 0x7c, 0x3e, 0xf0, 0xed, 0x89, 0xc7, 0x7a, 0x6b, 0x4a, 0x48, 0x36, 0xdb, 0x2b, + 0x3a, 0x17, 0xec, 0x3c, 0x15, 0xec, 0x34, 0x7a, 0x32, 0x5a, 0xb0, 0xb9, 0x77, 0x05, 0x27, 0xcd, + 0x7b, 0xd0, 0xef, 0x49, 0x30, 0xd1, 0x6e, 0x4b, 0x87, 0xce, 0xf6, 0x26, 0x45, 0x6b, 0x48, 0x91, + 0x3f, 0x77, 0x08, 0x4a, 0xde, 0x95, 0x25, 0xda, 0x95, 0x79, 0xf4, 0xec, 0x21, 0xba, 0x32, 0xe7, + 0xcf, 0xef, 0xff, 0x4f, 0x09, 0xee, 0xe9, 0xba, 0x43, 0x42, 0xf3, 0xbd, 0x49, 0xd9, 0x25, 0x76, + 0xca, 0x17, 0x7f, 0x18, 0x16, 0xbc, 0xc7, 0xcf, 0xd1, 0x1e, 0x5f, 0x46, 0xcb, 0x87, 0xe9, 0x71, + 0xdb, 0x43, 0x14, 0xf4, 0x3b, 0xc1, 0x9b, 0x85, 0xdd, 0xcd, 0xa9, 0x65, 0xe3, 0x11, 0x31, 0x31, + 0x5a, 0x83, 0x5a, 0xf9, 0xad, 0xb4, 0x0b, 0x0a, 0xda, 0xf8, 0x21, 0x07, 0x6d, 0xee, 0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, 0xfe, 0x5f, 0x6f, 0xbf, 0xbb, + 0x70, 0x34, 0xd0, 0xd3, 0x3b, 0xa4, 0xd2, 0x53, 0xaf, 0x26, 0x20, 0xbe, 0x6a, 0xd7, 0xd0, 0x8b, + 0x30, 0x1a, 0x0e, 0x13, 0x3a, 0x46, 0x7f, 0xad, 0x2b, 0x42, 0xe7, 0x1d, 0x5a, 0xe7, 0xd5, 0x03, + 0xed, 0xc3, 0x70, 0x70, 0xe5, 0x38, 0xd1, 0x85, 0x49, 0x00, 0x33, 0xff, 0x78, 0xaf, 0x98, 0x6e, + 0x63, 0xef, 0x84, 0x94, 0xeb, 0xf4, 0xee, 0xeb, 0x42, 0x2d, 0x90, 0x3a, 0xc7, 0xb3, 0x6d, 0xdc, + 0x0a, 0xd1, 0x5e, 0xd8, 0xa5, 0x74, 0xd3, 0x5e, 0x08, 0xb7, 0xab, 0xf6, 0x3a, 0x4d, 0xad, 0x1d, + 0x00, 0xdf, 0x3c, 0x78, 0xa0, 0x0b, 0x07, 0x0f, 0x2d, 0xff, 0x58, 0x4f, 0x68, 0xee, 0x31, 0xd3, + 0x6d, 0x0e, 0xbf, 0xff, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x31, 0xf4, 0xff, 0xb5, 0x06, 0x94, + 0x00, 0x00, } r := bytes.NewReader(gzipped) gzipr, err := compress_gzip.NewReader(r) @@ -2348,10 +2375,15 @@ func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x18 } - if len(m.ConsensusPubkey) > 0 { - i -= len(m.ConsensusPubkey) - copy(dAtA[i:], m.ConsensusPubkey) - i = encodeVarintStaking(dAtA, i, uint64(len(m.ConsensusPubkey))) + if m.ConsensusPubkey != nil { + { + size, err := m.ConsensusPubkey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStaking(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x12 } @@ -2690,12 +2722,12 @@ func (m *UnbondingDelegationEntry) MarshalToSizedBuffer(dAtA []byte) (int, error } i-- dAtA[i] = 0x1a - n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) - if err7 != nil { - return 0, err7 + n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) + if err8 != nil { + return 0, err8 } - i -= n7 - i = encodeVarintStaking(dAtA, i, uint64(n7)) + i -= n8 + i = encodeVarintStaking(dAtA, i, uint64(n8)) i-- dAtA[i] = 0x12 if m.CreationHeight != 0 { @@ -2746,12 +2778,12 @@ func (m *RedelegationEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x1a - n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) - if err8 != nil { - return 0, err8 + n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) + if err9 != nil { + return 0, err9 } - i -= n8 - i = encodeVarintStaking(dAtA, i, uint64(n8)) + i -= n9 + i = encodeVarintStaking(dAtA, i, uint64(n9)) i-- dAtA[i] = 0x12 if m.CreationHeight != 0 { @@ -2862,12 +2894,12 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } - n9, err9 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.UnbondingTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.UnbondingTime):]) - if err9 != nil { - return 0, err9 + n10, err10 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.UnbondingTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.UnbondingTime):]) + if err10 != nil { + return 0, err10 } - i -= n9 - i = encodeVarintStaking(dAtA, i, uint64(n9)) + i -= n10 + i = encodeVarintStaking(dAtA, i, uint64(n10)) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -3144,8 +3176,8 @@ func (m *Validator) Size() (n int) { if l > 0 { n += 1 + l + sovStaking(uint64(l)) } - l = len(m.ConsensusPubkey) - if l > 0 { + if m.ConsensusPubkey != nil { + l = m.ConsensusPubkey.Size() n += 1 + l + sovStaking(uint64(l)) } if m.Jailed { @@ -4136,7 +4168,7 @@ func (m *Validator) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ConsensusPubkey", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowStaking @@ -4146,23 +4178,27 @@ func (m *Validator) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthStaking } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthStaking } if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsensusPubkey = string(dAtA[iNdEx:postIndex]) + if m.ConsensusPubkey == nil { + m.ConsensusPubkey = &types1.Any{} + } + if err := m.ConsensusPubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 0 { diff --git a/x/staking/types/tx.pb.go b/x/staking/types/tx.pb.go index f49c42ecdb..431e43a5b7 100644 --- a/x/staking/types/tx.pb.go +++ b/x/staking/types/tx.pb.go @@ -14,6 +14,7 @@ import ( proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "github.com/golang/protobuf/ptypes/timestamp" + _ "github.com/regen-network/cosmos-proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -466,59 +467,61 @@ func init() { func init() { proto.RegisterFile("cosmos/staking/v1beta1/tx.proto", fileDescriptor_0926ef28816b35ab) } var fileDescriptor_0926ef28816b35ab = []byte{ - // 829 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x96, 0xcb, 0x4e, 0xdb, 0x4a, - 0x1c, 0xc6, 0xe3, 0x24, 0xe4, 0x70, 0x06, 0x71, 0x33, 0x17, 0x05, 0x0b, 0xc5, 0xc8, 0x9c, 0x0b, - 0x3a, 0x07, 0xec, 0x03, 0x47, 0x55, 0x25, 0x36, 0x15, 0x21, 0xad, 0x8a, 0xda, 0x6c, 0x0c, 0xed, - 0xa2, 0xaa, 0x14, 0x39, 0xf6, 0xc4, 0xb5, 0x62, 0x7b, 0x82, 0x67, 0x82, 0x88, 0xd4, 0x07, 0xe8, - 0x12, 0xa9, 0xbb, 0xae, 0x78, 0x87, 0xbe, 0x04, 0xab, 0x8a, 0x65, 0xd5, 0x45, 0x5a, 0x81, 0x54, - 0xb1, 0xce, 0x13, 0x54, 0x1e, 0xdb, 0x13, 0xc7, 0xb9, 0x28, 0x42, 0xcd, 0xa6, 0x2b, 0xc8, 0xf8, - 0x37, 0xdf, 0x78, 0xbe, 0xff, 0x37, 0xff, 0x31, 0x10, 0x75, 0x84, 0x1d, 0x84, 0x15, 0x4c, 0xb4, - 0xba, 0xe5, 0x9a, 0xca, 0xd9, 0x6e, 0x15, 0x12, 0x6d, 0x57, 0x21, 0xe7, 0x72, 0xc3, 0x43, 0x04, - 0xf1, 0xab, 0x01, 0x20, 0x87, 0x80, 0x1c, 0x02, 0xc2, 0xb2, 0x89, 0x4c, 0x44, 0x11, 0xc5, 0xff, - 0x2f, 0xa0, 0x85, 0x42, 0x28, 0x57, 0xd5, 0x30, 0x64, 0x5a, 0x3a, 0xb2, 0xdc, 0xf0, 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 0x61, - 0x3d, 0xbb, 0xff, 0x46, 0x10, 0xf6, 0xc6, 0x67, 0xd9, 0x4e, 0xea, 0x60, 0xb6, 0xf7, 0xe6, 0xd8, - 0x1a, 0x21, 0xd2, 0x43, 0x0a, 0xff, 0x8d, 0x4b, 0xb2, 0xc5, 0x5e, 0x83, 0x69, 0xd6, 0xf4, 0x36, - 0x47, 0xcc, 0x8e, 0x20, 0xe1, 0xdf, 0x31, 0x20, 0xa6, 0x7e, 0x0a, 0xe6, 0x93, 0x2d, 0x65, 0x94, - 0x7b, 0x09, 0x76, 0xa4, 0x7b, 0xc3, 0x8e, 0x56, 0x15, 0x80, 0xd8, 0x39, 0xf8, 0x73, 0x84, 0x42, - 0x17, 0x13, 0x76, 0xc6, 0xc2, 0xa2, 0x35, 0x8a, 0x4f, 0xae, 0x6e, 0x0a, 0xdc, 0xf5, 0x4d, 0x81, - 0xfb, 0x76, 0x53, 0xe0, 0x2e, 0x6e, 0x0b, 0xa9, 0xeb, 0xdb, 0x42, 0xea, 0xf3, 0x6d, 0x21, 0xf5, - 0x6a, 0x7b, 0xe4, 0x35, 0x76, 0xce, 0x3e, 0x53, 0xe9, 0x85, 0x56, 0xcd, 0xd1, 0x48, 0xfe, 0xff, - 0x23, 0x00, 0x00, 0xff, 0xff, 0x9f, 0x9d, 0x50, 0xee, 0x55, 0x0b, 0x00, 0x00, + // 850 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x96, 0xcb, 0x6e, 0xd3, 0x4c, + 0x1c, 0xc5, 0xe3, 0x24, 0xcd, 0xd7, 0x6f, 0xaa, 0xde, 0xdc, 0x8b, 0x52, 0xab, 0x8a, 0x2b, 0x97, + 0x4b, 0x05, 0xd4, 0xa1, 0x45, 0x08, 0xd4, 0x0d, 0x6a, 0x1a, 0x10, 0x55, 0x89, 0x84, 0xdc, 0xc2, + 0x02, 0x21, 0x45, 0xbe, 0x4c, 0x8c, 0x15, 0xdb, 0x93, 0x7a, 0x26, 0x55, 0x23, 0xf1, 0x00, 0x2c, + 0x2b, 0xb1, 0x63, 0xd5, 0x87, 0x60, 0xcf, 0xb6, 0x62, 0x81, 0xba, 0x44, 0x2c, 0x02, 0x6a, 0x25, + 0xd4, 0x75, 0x9e, 0x00, 0xd9, 0x1e, 0x3b, 0x8e, 0x73, 0x51, 0x54, 0x91, 0x0d, 0xab, 0x36, 0x33, + 0xbf, 0x39, 0x33, 0x73, 0xfe, 0x67, 0x66, 0x0c, 0x78, 0x15, 0x61, 0x0b, 0xe1, 0x3c, 0x26, 0x72, + 0xd5, 0xb0, 0xf5, 0xfc, 0xd1, 0x86, 0x02, 0x89, 0xbc, 0x91, 0x27, 0xc7, 0x62, 0xcd, 0x41, 0x04, + 0xb1, 0x8b, 0x3e, 0x20, 0x52, 0x40, 0xa4, 0x00, 0x37, 0xaf, 0x23, 0x1d, 0x79, 0x48, 0xde, 0xfd, + 0xcf, 0xa7, 0xb9, 0x25, 0x9f, 0x2e, 0xfb, 0x1d, 0x74, 0xa8, 0xdf, 0x95, 0xa3, 0x33, 0x29, 0x32, + 0x86, 0xe1, 0x34, 0x2a, 0x32, 0x6c, 0xda, 0xcf, 0xeb, 0x08, 0xe9, 0x26, 0xcc, 0x7b, 0xbf, 0x94, + 0x7a, 0x25, 0x4f, 0x0c, 0x0b, 0x62, 0x22, 0x5b, 0x35, 0x0a, 0xdc, 0xe8, 0xb3, 0xd4, 0x60, 0x65, + 0x74, 0x05, 0x71, 0x19, 0xd9, 0x6e, 0xf8, 0x5d, 0xc2, 0x97, 0x34, 0x60, 0x4b, 0x58, 0xdf, 0x71, + 0xa0, 0x4c, 0xe0, 0x6b, 0xd9, 0x34, 0x34, 0x99, 0x20, 0x87, 0xdd, 0x03, 0x13, 0x1a, 0xc4, 0xaa, + 0x63, 0xd4, 0x88, 0x81, 0xec, 0x2c, 0xb3, 0xc2, 0xac, 0x4d, 0x6c, 0xae, 0x8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, + 0x70, 0x73, 0x80, 0x42, 0x1b, 0xe3, 0xd6, 0x87, 0xc2, 0x82, 0x39, 0x0a, 0xcf, 0xce, 0x2e, 0x72, + 0xcc, 0xf9, 0x45, 0x8e, 0xf9, 0x75, 0x91, 0x63, 0x4e, 0x2e, 0x73, 0x89, 0xf3, 0xcb, 0x5c, 0xe2, + 0xfb, 0x65, 0x2e, 0xf1, 0xe6, 0xde, 0xc0, 0x67, 0xec, 0x38, 0xfc, 0x64, 0xf5, 0x1e, 0x34, 0x25, + 0xe3, 0x45, 0xf2, 0xc1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3e, 0xb3, 0xef, 0xab, 0x7c, 0x0b, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index 3bac25fe79..8b5cfcdf14 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -14,6 +14,7 @@ import ( "gopkg.in/yaml.v2" "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -39,15 +40,15 @@ var _ ValidatorI = Validator{} // NewValidator constructs a new Validator //nolint:interfacer -func NewValidator(operator sdk.ValAddress, pubKey crypto.PubKey, description Description) Validator { - var pkStr string - if pubKey != nil { - pkStr = sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, pubKey) +func NewValidator(operator sdk.ValAddress, pubKey crypto.PubKey, description Description) (Validator, error) { + pkAny, err := codectypes.PackAny(pubKey) + if err != nil { + return Validator{}, err } return Validator{ OperatorAddress: operator.String(), - ConsensusPubkey: pkStr, + ConsensusPubkey: pkAny, Jailed: false, Status: Unbonded, Tokens: sdk.ZeroInt(), @@ -57,7 +58,7 @@ func NewValidator(operator sdk.ValAddress, pubKey crypto.PubKey, description Des UnbondingTime: time.Unix(0, 0).UTC(), Commission: NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()), MinSelfDelegation: sdk.OneInt(), - } + }, nil } // String implements the Stringer interface for a Validator object. @@ -87,13 +88,17 @@ func (v Validators) ToSDKValidators() (validators []ValidatorI) { } // ToTmValidators casts all validators to the corresponding tendermint type. -func (v Validators) ToTmValidators() []*tmtypes.Validator { +func (v Validators) ToTmValidators() ([]*tmtypes.Validator, error) { validators := make([]*tmtypes.Validator, len(v)) + var err error for i, val := range v { - validators[i] = val.ToTmValidator() + validators[i], err = val.ToTmValidator() + if err != nil { + return nil, err + } } - return validators + return validators, nil } // Sort Validators sorts validator array in ascending operator address order @@ -118,9 +123,19 @@ func (v Validators) Swap(i, j int) { v[j] = it } +// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces +func (v Validators) UnpackInterfaces(c codectypes.AnyUnpacker) error { + for i := range v { + if err := v[i].UnpackInterfaces(c); err != nil { + return err + } + } + return nil +} + // return the redelegation -func MustMarshalValidator(cdc codec.BinaryMarshaler, validator Validator) []byte { - return cdc.MustMarshalBinaryBare(&validator) +func MustMarshalValidator(cdc codec.BinaryMarshaler, validator *Validator) []byte { + return cdc.MustMarshalBinaryBare(validator) } // unmarshal a redelegation from a store value @@ -233,7 +248,11 @@ func (d Description) EnsureLength() (Description, error) { // ABCIValidatorUpdate returns an abci.ValidatorUpdate from a staking validator type // with the full validator power func (v Validator) ABCIValidatorUpdate() abci.ValidatorUpdate { - pk, err := encoding.PubKeyToProto(v.GetConsPubKey()) + consPk, err := v.TmConsPubKey() + if err != nil { + panic(err) + } + pk, err := encoding.PubKeyToProto(consPk) if err != nil { panic(err) } @@ -247,7 +266,11 @@ func (v Validator) ABCIValidatorUpdate() abci.ValidatorUpdate { // ABCIValidatorUpdateZero returns an abci.ValidatorUpdate from a staking validator type // with zero power used for validator updates. func (v Validator) ABCIValidatorUpdateZero() abci.ValidatorUpdate { - pk, err := encoding.PubKeyToProto(v.GetConsPubKey()) + consPk, err := v.TmConsPubKey() + if err != nil { + panic(err) + } + pk, err := encoding.PubKeyToProto(consPk) if err != nil { panic(err) } @@ -259,8 +282,12 @@ func (v Validator) ABCIValidatorUpdateZero() abci.ValidatorUpdate { } // ToTmValidator casts an SDK validator to a tendermint type Validator. -func (v Validator) ToTmValidator() *tmtypes.Validator { - return tmtypes.NewValidator(v.GetConsPubKey(), v.ConsensusPower()) +func (v Validator) ToTmValidator() (*tmtypes.Validator, error) { + consPk, err := v.TmConsPubKey() + if err != nil { + return nil, err + } + return tmtypes.NewValidator(consPk, v.ConsensusPower()), nil } // SetInitialCommission attempts to set a validator's initial commission. An @@ -415,14 +442,24 @@ func (v Validator) RemoveDelShares(delShares sdk.Dec) (Validator, sdk.Int) { // MinEqual defines a more minimum set of equality conditions when comparing two // validators. -func (v Validator) MinEqual(other Validator) bool { - return v.ConsensusPubkey == other.ConsensusPubkey && - (v.OperatorAddress == other.OperatorAddress) && +func (v *Validator) MinEqual(other *Validator) bool { + return v.OperatorAddress == other.OperatorAddress && v.Status == other.Status && v.Tokens.Equal(other.Tokens) && v.DelegatorShares.Equal(other.DelegatorShares) && - v.Description == other.Description && - v.Commission.Equal(other.Commission) + v.Description.Equal(other.Description) && + v.Commission.Equal(other.Commission) && + v.Jailed == other.Jailed && + v.MinSelfDelegation.Equal(other.MinSelfDelegation) && + v.ConsensusPubkey.Equal(other.ConsensusPubkey) + +} + +// Equal checks if the receiver equals the parameter +func (v *Validator) Equal(v2 *Validator) bool { + return v.MinEqual(v2) && + v.UnbondingHeight == v2.UnbondingHeight && + v.UnbondingTime.Equal(v2.UnbondingTime) } func (v Validator) IsJailed() bool { return v.Jailed } @@ -438,24 +475,43 @@ func (v Validator) GetOperator() sdk.ValAddress { } return addr } -func (v Validator) GetConsPubKey() crypto.PubKey { + +// TmConsPubKey casts Validator.ConsensusPubkey to crypto.PubKey +func (v Validator) TmConsPubKey() (crypto.PubKey, error) { + pk, ok := v.ConsensusPubkey.GetCachedValue().(cryptotypes.PubKey) + if !ok { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "Expecting crypto.PubKey, got %T", pk) + } + // The way things are refactored now, v.ConsensusPubkey is sometimes a TM // ed25519 pubkey, sometimes our own ed25519 pubkey. This is very ugly and // inconsistent. // Luckily, here we coerce it into a TM ed25519 pubkey always, as this // pubkey will be passed into TM (eg calling encoding.PubKeyToProto). - pk := sdk.MustGetPubKeyFromBech32(sdk.Bech32PubKeyTypeConsPub, v.ConsensusPubkey) - if intoTmPk, ok := pk.(cryptotypes.IntoTmPubKey); ok { - return intoTmPk.AsTmPubKey() + return intoTmPk.AsTmPubKey(), nil } - - return pk + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidPubKey, "Logic error: ConsensusPubkey must be an SDK key and SDK PubKey types must be convertible to tendermint PubKey; got: %T", pk) } -func (v Validator) GetConsAddr() sdk.ConsAddress { return sdk.ConsAddress(v.GetConsPubKey().Address()) } + +// GetConsAddr extracts Consensus key address +func (v Validator) GetConsAddr() (sdk.ConsAddress, error) { + pk, err := v.TmConsPubKey() + if err != nil { + return sdk.ConsAddress{}, err + } + return sdk.ConsAddress(pk.Address()), nil +} + func (v Validator) GetTokens() sdk.Int { return v.Tokens } func (v Validator) GetBondedTokens() sdk.Int { return v.BondedTokens() } func (v Validator) GetConsensusPower() int64 { return v.ConsensusPower() } func (v Validator) GetCommission() sdk.Dec { return v.Commission.Rate } func (v Validator) GetMinSelfDelegation() sdk.Int { return v.MinSelfDelegation } func (v Validator) GetDelegatorShares() sdk.Dec { return v.DelegatorShares } + +// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces +func (v Validator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + var pk crypto.PubKey + return unpacker.UnpackAny(v.ConsensusPubkey, &pk) +} diff --git a/x/staking/types/validator_test.go b/x/staking/types/validator_test.go index 00ad07ba58..2e9d961169 100644 --- a/x/staking/types/validator_test.go +++ b/x/staking/types/validator_test.go @@ -2,12 +2,12 @@ package types import ( "math/rand" - "reflect" "sort" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/encoding" tmtypes "github.com/tendermint/tendermint/types" @@ -18,16 +18,12 @@ import ( ) func TestValidatorTestEquivalent(t *testing.T) { - val1 := NewValidator(valAddr1, pk1, Description{}) - val2 := NewValidator(valAddr1, pk1, Description{}) + val1 := newValidator(t, valAddr1, pk1) + val2 := newValidator(t, valAddr1, pk1) + require.Equal(t, val1.String(), val2.String()) - ok := val1.String() == val2.String() - require.True(t, ok) - - val2 = NewValidator(valAddr2, pk2, Description{}) - - ok = val1.String() == val2.String() - require.False(t, ok) + val2 = newValidator(t, valAddr2, pk2) + require.NotEqual(t, val1.String(), val2.String()) } func TestUpdateDescription(t *testing.T) { @@ -60,33 +56,29 @@ func TestUpdateDescription(t *testing.T) { } func TestABCIValidatorUpdate(t *testing.T) { - validator := NewValidator(valAddr1, pk1, Description{}) - + validator := newValidator(t, valAddr1, pk1) abciVal := validator.ABCIValidatorUpdate() - pk, err := encoding.PubKeyToProto(validator.GetConsPubKey()) + consPk, err := validator.TmConsPubKey() + require.NoError(t, err) + pk, err := encoding.PubKeyToProto(consPk) require.NoError(t, err) require.Equal(t, pk, abciVal.PubKey) require.Equal(t, validator.BondedTokens().Int64(), abciVal.Power) } func TestABCIValidatorUpdateZero(t *testing.T) { - validator := NewValidator(valAddr1, pk1, Description{}) - + validator := newValidator(t, valAddr1, pk1) abciVal := validator.ABCIValidatorUpdateZero() - pk, err := encoding.PubKeyToProto(validator.GetConsPubKey()) + consPk, err := validator.TmConsPubKey() + require.NoError(t, err) + pk, err := encoding.PubKeyToProto(consPk) require.NoError(t, err) require.Equal(t, pk, abciVal.PubKey) require.Equal(t, int64(0), abciVal.Power) } func TestShareTokens(t *testing.T) { - validator := Validator{ - OperatorAddress: valAddr1.String(), - ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, pk1), - Status: Bonded, - Tokens: sdk.NewInt(100), - DelegatorShares: sdk.NewDec(100), - } + validator := mkValidator(100, sdk.NewDec(100)) assert.True(sdk.DecEq(t, sdk.NewDec(50), validator.TokensFromShares(sdk.NewDec(50)))) validator.Tokens = sdk.NewInt(50) @@ -95,16 +87,7 @@ func TestShareTokens(t *testing.T) { } func TestRemoveTokens(t *testing.T) { - valPubKey := pk1 - valAddr := sdk.ValAddress(valPubKey.Address().Bytes()) - - validator := Validator{ - OperatorAddress: valAddr.String(), - ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, valPubKey), - Status: Bonded, - Tokens: sdk.NewInt(100), - DelegatorShares: sdk.NewDec(100), - } + validator := mkValidator(100, sdk.NewDec(100)) // remove tokens and test check everything validator = validator.RemoveTokens(sdk.NewInt(10)) @@ -120,7 +103,7 @@ func TestRemoveTokens(t *testing.T) { } func TestAddTokensValidatorBonded(t *testing.T) { - validator := NewValidator(sdk.ValAddress(pk1.Address().Bytes()), pk1, Description{}) + validator := newValidator(t, valAddr1, pk1) validator = validator.UpdateStatus(Bonded) validator, delShares := validator.AddTokensFromDel(sdk.NewInt(10)) @@ -130,7 +113,7 @@ func TestAddTokensValidatorBonded(t *testing.T) { } func TestAddTokensValidatorUnbonding(t *testing.T) { - validator := NewValidator(sdk.ValAddress(pk1.Address().Bytes()), pk1, Description{}) + validator := newValidator(t, valAddr1, pk1) validator = validator.UpdateStatus(Unbonding) validator, delShares := validator.AddTokensFromDel(sdk.NewInt(10)) @@ -142,7 +125,7 @@ func TestAddTokensValidatorUnbonding(t *testing.T) { func TestAddTokensValidatorUnbonded(t *testing.T) { - validator := NewValidator(sdk.ValAddress(pk1.Address().Bytes()), pk1, Description{}) + validator := newValidator(t, valAddr1, pk1) validator = validator.UpdateStatus(Unbonded) validator, delShares := validator.AddTokensFromDel(sdk.NewInt(10)) @@ -155,8 +138,8 @@ func TestAddTokensValidatorUnbonded(t *testing.T) { // TODO refactor to make simpler like the AddToken tests above func TestRemoveDelShares(t *testing.T) { valA := Validator{ - OperatorAddress: sdk.ValAddress(pk1.Address().Bytes()).String(), - ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, pk1), + OperatorAddress: valAddr1.String(), + ConsensusPubkey: pk1Any, Status: Bonded, Tokens: sdk.NewInt(100), DelegatorShares: sdk.NewDec(100), @@ -169,24 +152,14 @@ func TestRemoveDelShares(t *testing.T) { require.Equal(t, int64(90), valB.BondedTokens().Int64()) // specific case from random tests - poolTokens := sdk.NewInt(5102) - delShares := sdk.NewDec(115) - validator := Validator{ - OperatorAddress: sdk.ValAddress(pk1.Address().Bytes()).String(), - ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, pk1), - Status: Bonded, - Tokens: poolTokens, - DelegatorShares: delShares, - } - - shares := sdk.NewDec(29) - _, tokens := validator.RemoveDelShares(shares) + validator := mkValidator(5102, sdk.NewDec(115)) + _, tokens := validator.RemoveDelShares(sdk.NewDec(29)) require.True(sdk.IntEq(t, sdk.NewInt(1286), tokens)) } func TestAddTokensFromDel(t *testing.T) { - validator := NewValidator(sdk.ValAddress(pk1.Address().Bytes()), pk1, Description{}) + validator := newValidator(t, valAddr1, pk1) validator, shares := validator.AddTokensFromDel(sdk.NewInt(6)) require.True(sdk.DecEq(t, sdk.NewDec(6), shares)) @@ -200,7 +173,7 @@ func TestAddTokensFromDel(t *testing.T) { } func TestUpdateStatus(t *testing.T) { - validator := NewValidator(sdk.ValAddress(pk1.Address().Bytes()), pk1, Description{}) + validator := newValidator(t, valAddr1, pk1) validator, _ = validator.AddTokensFromDel(sdk.NewInt(100)) require.Equal(t, Unbonded, validator.Status) require.Equal(t, int64(100), validator.Tokens.Int64()) @@ -220,14 +193,7 @@ func TestUpdateStatus(t *testing.T) { func TestPossibleOverflow(t *testing.T) { delShares := sdk.NewDec(391432570689183511).Quo(sdk.NewDec(40113011844664)) - validator := Validator{ - OperatorAddress: sdk.ValAddress(pk1.Address().Bytes()).String(), - ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, pk1), - Status: Bonded, - Tokens: sdk.NewInt(2159), - DelegatorShares: delShares, - } - + validator := mkValidator(2159, delShares) newValidator, _ := validator.AddTokensFromDel(sdk.NewInt(71)) require.False(t, newValidator.DelegatorShares.IsNegative()) @@ -235,19 +201,19 @@ func TestPossibleOverflow(t *testing.T) { } func TestValidatorMarshalUnmarshalJSON(t *testing.T) { - validator := NewValidator(valAddr1, pk1, Description{}) + validator := newValidator(t, valAddr1, pk1) js, err := legacy.Cdc.MarshalJSON(validator) require.NoError(t, err) require.NotEmpty(t, js) - require.Contains(t, string(js), "\"consensus_pubkey\":\"cosmosvalconspu") + require.Contains(t, string(js), "\"consensus_pubkey\":{\"type\":\"cosmos/PubKeyEd25519\"") got := &Validator{} err = legacy.Cdc.UnmarshalJSON(js, got) assert.NoError(t, err) - assert.Equal(t, validator, *got) + assert.True(t, validator.Equal(got)) } func TestValidatorSetInitialCommission(t *testing.T) { - val := NewValidator(valAddr1, pk1, Description{}) + val := newValidator(t, valAddr1, pk1) testCases := []struct { validator Validator commission Commission @@ -288,7 +254,7 @@ func TestValidatorsSortDeterminism(t *testing.T) { // Create random validator slice for i := range vals { pk := ed25519.GenPrivKey().PubKey() - vals[i] = NewValidator(sdk.ValAddress(pk.Address()), pk, Description{}) + vals[i] = newValidator(t, sdk.ValAddress(pk.Address()), pk) } // Save sorted copy @@ -304,7 +270,7 @@ func TestValidatorsSortDeterminism(t *testing.T) { }) Validators(vals).Sort() - require.True(t, reflect.DeepEqual(sortedVals, vals), "Validator sort returned different slices") + require.Equal(t, sortedVals, vals, "Validator sort returned different slices") } } @@ -314,14 +280,15 @@ func TestValidatorToTm(t *testing.T) { for i := range vals { pk := ed25519.GenPrivKey().PubKey() - val := NewValidator(sdk.ValAddress(pk.Address()), pk, Description{}) + val := newValidator(t, sdk.ValAddress(pk.Address()), pk) val.Status = Bonded val.Tokens = sdk.NewInt(rand.Int63()) vals[i] = val expected[i] = tmtypes.NewValidator(pk.(cryptotypes.IntoTmPubKey).AsTmPubKey(), val.ConsensusPower()) } - - require.Equal(t, expected, vals.ToTmValidators()) + vs, err := vals.ToTmValidators() + require.NoError(t, err) + require.Equal(t, expected, vs) } func TestBondStatus(t *testing.T) { @@ -334,3 +301,20 @@ func TestBondStatus(t *testing.T) { require.Equal(t, BondStatusBonded, Bonded.String()) require.Equal(t, BondStatusUnbonding, Unbonding.String()) } + +func mkValidator(tokens int64, shares sdk.Dec) Validator { + return Validator{ + OperatorAddress: valAddr1.String(), + ConsensusPubkey: pk1Any, + Status: Bonded, + Tokens: sdk.NewInt(tokens), + DelegatorShares: shares, + } +} + +// Creates a new validators and asserts the error check. +func newValidator(t *testing.T, operator sdk.ValAddress, pubKey crypto.PubKey) Validator { + v, err := NewValidator(operator, pubKey, Description{}) + require.NoError(t, err) + return v +} diff --git a/x/upgrade/abci_test.go b/x/upgrade/abci_test.go index 26c534a4d2..48ad99301e 100644 --- a/x/upgrade/abci_test.go +++ b/x/upgrade/abci_test.go @@ -236,17 +236,17 @@ func TestPlanStringer(t *testing.T) { require.Equal(t, `Upgrade Plan Name: test Time: 2020-01-01T00:00:00Z - Info: + Info: . Upgraded IBC Client: no upgraded client provided`, types.Plan{Name: "test", Time: ti}.String()) require.Equal(t, `Upgrade Plan Name: test Height: 100 - Info: + Info: . Upgraded IBC Client: no upgraded client provided`, types.Plan{Name: "test", Height: 100}.String()) require.Equal(t, fmt.Sprintf(`Upgrade Plan Name: test Height: 100 - Info: + Info: . Upgraded IBC Client: %s`, clientState), types.Plan{Name: "test", Height: 100, UpgradedClientState: cs}.String()) } diff --git a/x/upgrade/types/plan.go b/x/upgrade/types/plan.go index c930c2539c..e853ac6797 100644 --- a/x/upgrade/types/plan.go +++ b/x/upgrade/types/plan.go @@ -28,7 +28,7 @@ func (p Plan) String() string { return fmt.Sprintf(`Upgrade Plan Name: %s %s - Info: %s + Info: %s. Upgraded IBC Client: %s`, p.Name, dueUp, p.Info, upgradedClientStr) } diff --git a/x/upgrade/types/plan_test.go b/x/upgrade/types/plan_test.go index ffa2734cbf..881a1a3229 100644 --- a/x/upgrade/types/plan_test.go +++ b/x/upgrade/types/plan_test.go @@ -38,7 +38,7 @@ func TestPlanString(t *testing.T) { Info: "https://foo.bar", Time: mustParseTime("2019-07-08T11:33:55Z"), }, - expect: "Upgrade Plan\n Name: due_time\n Time: 2019-07-08T11:33:55Z\n Info: https://foo.bar\n Upgraded IBC Client: no upgraded client provided", + expect: "Upgrade Plan\n Name: due_time\n Time: 2019-07-08T11:33:55Z\n Info: https://foo.bar.\n Upgraded IBC Client: no upgraded client provided", }, "with height": { p: Plan{ @@ -46,7 +46,7 @@ func TestPlanString(t *testing.T) { Info: "https://foo.bar/baz", Height: 7890, }, - expect: "Upgrade Plan\n Name: by height\n Height: 7890\n Info: https://foo.bar/baz\n Upgraded IBC Client: no upgraded client provided", + expect: "Upgrade Plan\n Name: by height\n Height: 7890\n Info: https://foo.bar/baz.\n Upgraded IBC Client: no upgraded client provided", }, "with IBC client": { p: Plan{ @@ -55,14 +55,14 @@ func TestPlanString(t *testing.T) { Height: 7890, UpgradedClientState: cs, }, - expect: fmt.Sprintf("Upgrade Plan\n Name: by height\n Height: 7890\n Info: https://foo.bar/baz\n Upgraded IBC Client: %s", &ibctmtypes.ClientState{}), + expect: fmt.Sprintf("Upgrade Plan\n Name: by height\n Height: 7890\n Info: https://foo.bar/baz.\n Upgraded IBC Client: %s", &ibctmtypes.ClientState{}), }, "neither": { p: Plan{ Name: "almost-empty", }, - expect: "Upgrade Plan\n Name: almost-empty\n Height: 0\n Info: \n Upgraded IBC Client: no upgraded client provided", + expect: "Upgrade Plan\n Name: almost-empty\n Height: 0\n Info: .\n Upgraded IBC Client: no upgraded client provided", }, } From 73e7dad7139d44973f453a8808972a63ed7d3f60 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Fri, 23 Oct 2020 09:49:18 -0400 Subject: [PATCH 68/84] Use InterfaceRegistry as AnyResolver for grpc-gateway (#7646) --- server/api/server.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/api/server.go b/server/api/server.go index c1614d3d2b..5c037101c6 100644 --- a/server/api/server.go +++ b/server/api/server.go @@ -56,6 +56,7 @@ func New(clientCtx client.Context, logger log.Logger) *Server { EmitDefaults: true, Indent: " ", OrigName: true, + AnyResolver: clientCtx.InterfaceRegistry, } return &Server{ From c6cbe3a3dbf1727bbe87f213cbdd7dff8108d762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Fri, 23 Oct 2020 18:31:32 +0200 Subject: [PATCH 69/84] Fix IBC Query cmds (#7648) * fix query * update comment --- x/ibc/core/client/query.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/x/ibc/core/client/query.go b/x/ibc/core/client/query.go index 93eb458952..273e25583c 100644 --- a/x/ibc/core/client/query.go +++ b/x/ibc/core/client/query.go @@ -18,20 +18,25 @@ import ( // to perform the query should be set in the client context. The query will be // performed at one below this height (at the IAVL version) in order to obtain // the correct merkle proof. Proof queries at height less than or equal to 2 are -// not supported. +// not supported. Queries with a client context height of 0 will perform a query +// at the lastest state available. // Issue: https://github.com/cosmos/cosmos-sdk/issues/6567 func QueryTendermintProof(clientCtx client.Context, key []byte) ([]byte, []byte, clienttypes.Height, error) { height := clientCtx.Height - // ABCI queries at height less than or equal to 2 are not supported. + // ABCI queries at heights 1, 2 or less than or equal to 0 are not supported. // Base app does not support queries for height less than or equal to 1. - // Therefore, a query at height 2 would be equivalent to a query at height 3 - if clientCtx.Height <= 2 { + // Therefore, a query at height 2 would be equivalent to a query at height 3. + // A height of 0 will query with the lastest state. + if height != 0 && height <= 2 { return nil, nil, clienttypes.Height{}, fmt.Errorf("proof queries at height <= 2 are not supported") } // Use the IAVL height if a valid tendermint height is passed in. - height-- + // A height of 0 will query with the latest state. + if height != 0 { + height-- + } req := abci.RequestQuery{ Path: fmt.Sprintf("store/%s/key", host.StoreKey), From e4378e747dc40171573034a499d2e2a202de73a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Fri, 23 Oct 2020 19:14:12 +0200 Subject: [PATCH 70/84] IBC: panic on GetSignBytes and remove SubModuleCdc (#7645) * panic on GetSignBytes and remove SubModuleCdc where possible * fix build Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> --- x/ibc/applications/transfer/types/msgs.go | 5 +- .../applications/transfer/types/msgs_test.go | 10 ---- x/ibc/core/02-client/types/codec.go | 10 ---- x/ibc/core/02-client/types/msgs.go | 21 ++++---- x/ibc/core/03-connection/types/msgs.go | 20 +++++--- x/ibc/core/04-channel/types/msgs.go | 50 +++++++++++-------- x/ibc/core/04-channel/types/msgs_test.go | 12 ----- x/ibc/core/23-commitment/types/codec.go | 10 ---- .../06-solomachine/types/codec.go | 9 ---- .../07-tendermint/types/codec.go | 10 ---- .../light-clients/09-localhost/types/codec.go | 8 --- 11 files changed, 57 insertions(+), 108 deletions(-) diff --git a/x/ibc/applications/transfer/types/msgs.go b/x/ibc/applications/transfer/types/msgs.go index f5d31e0794..25ff69e715 100644 --- a/x/ibc/applications/transfer/types/msgs.go +++ b/x/ibc/applications/transfer/types/msgs.go @@ -64,9 +64,10 @@ func (msg MsgTransfer) ValidateBasic() error { return ValidateIBCDenom(msg.Token.Denom) } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgTransfer) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg diff --git a/x/ibc/applications/transfer/types/msgs_test.go b/x/ibc/applications/transfer/types/msgs_test.go index be3320ba43..4c9eb80acd 100644 --- a/x/ibc/applications/transfer/types/msgs_test.go +++ b/x/ibc/applications/transfer/types/msgs_test.go @@ -1,7 +1,6 @@ package types import ( - "fmt" "testing" "github.com/stretchr/testify/require" @@ -85,15 +84,6 @@ func TestMsgTransferValidation(t *testing.T) { } } -// TestMsgTransferGetSignBytes tests GetSignBytes for MsgTransfer -func TestMsgTransferGetSignBytes(t *testing.T) { - msg := NewMsgTransfer(validPort, validChannel, coin, addr1, addr2, clienttypes.NewHeight(0, 110), 10) - res := msg.GetSignBytes() - - expected := fmt.Sprintf(`{"receiver":"cosmos1w3jhxarpv3j8yvs7f9y7g","sender":"%s","source_channel":"testchannel","source_port":"testportid","timeout_height":{"version_height":"110","version_number":"0"},"timeout_timestamp":"10","token":{"amount":"100","denom":"atom"}}`, addr1.String()) - require.Equal(t, expected, string(res)) -} - // TestMsgTransferGetSigners tests GetSigners for MsgTransfer func TestMsgTransferGetSigners(t *testing.T) { msg := NewMsgTransfer(validPort, validChannel, coin, addr1, addr2, timeoutHeight, 0) diff --git a/x/ibc/core/02-client/types/codec.go b/x/ibc/core/02-client/types/codec.go index 5678c6bfd4..76402a1116 100644 --- a/x/ibc/core/02-client/types/codec.go +++ b/x/ibc/core/02-client/types/codec.go @@ -3,7 +3,6 @@ package types import ( proto "github.com/gogo/protobuf/proto" - "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -44,15 +43,6 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { ) } -var ( - // SubModuleCdc references the global x/ibc/core/02-client module codec. Note, the codec should - // ONLY be used in certain instances of tests and for JSON encoding. - // - // The actual codec used for serialization should be provided to x/ibc/core/02-client and - // defined at the application level. - SubModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) -) - // PackClientState constructs a new Any packed with the given client state value. It returns // an error if the client state can't be casted to a protobuf message or if the concrete // implemention is not registered to the protobuf codec. diff --git a/x/ibc/core/02-client/types/msgs.go b/x/ibc/core/02-client/types/msgs.go index 07738bfc27..7d3e4af219 100644 --- a/x/ibc/core/02-client/types/msgs.go +++ b/x/ibc/core/02-client/types/msgs.go @@ -87,9 +87,10 @@ func (msg MsgCreateClient) ValidateBasic() error { return host.ClientIdentifierValidator(msg.ClientId) } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgCreateClient) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg @@ -156,9 +157,10 @@ func (msg MsgUpdateClient) ValidateBasic() error { return host.ClientIdentifierValidator(msg.ClientId) } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgUpdateClient) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg @@ -233,9 +235,10 @@ func (msg MsgUpgradeClient) ValidateBasic() error { return host.ClientIdentifierValidator(msg.ClientId) } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgUpgradeClient) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg @@ -299,10 +302,10 @@ func (msg MsgSubmitMisbehaviour) ValidateBasic() error { return host.ClientIdentifierValidator(msg.ClientId) } -// GetSignBytes returns the raw bytes a signer is expected to sign when submitting -// a MsgSubmitMisbehaviour message. +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgSubmitMisbehaviour) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners returns the single expected signer for a MsgSubmitMisbehaviour. diff --git a/x/ibc/core/03-connection/types/msgs.go b/x/ibc/core/03-connection/types/msgs.go index 7974cf0244..a461dd1cca 100644 --- a/x/ibc/core/03-connection/types/msgs.go +++ b/x/ibc/core/03-connection/types/msgs.go @@ -58,9 +58,10 @@ func (msg MsgConnectionOpenInit) ValidateBasic() error { return msg.Counterparty.ValidateBasic() } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgConnectionOpenInit) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg @@ -172,9 +173,10 @@ func (msg MsgConnectionOpenTry) UnpackInterfaces(unpacker codectypes.AnyUnpacker return nil } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgConnectionOpenTry) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg @@ -268,9 +270,10 @@ func (msg MsgConnectionOpenAck) ValidateBasic() error { return nil } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgConnectionOpenAck) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg @@ -325,9 +328,10 @@ func (msg MsgConnectionOpenConfirm) ValidateBasic() error { return nil } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgConnectionOpenConfirm) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg diff --git a/x/ibc/core/04-channel/types/msgs.go b/x/ibc/core/04-channel/types/msgs.go index 2fb0a2b183..ebd9730e01 100644 --- a/x/ibc/core/04-channel/types/msgs.go +++ b/x/ibc/core/04-channel/types/msgs.go @@ -50,9 +50,10 @@ func (msg MsgChannelOpenInit) ValidateBasic() error { return msg.Channel.ValidateBasic() } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgChannelOpenInit) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg @@ -118,9 +119,10 @@ func (msg MsgChannelOpenTry) ValidateBasic() error { return msg.Channel.ValidateBasic() } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgChannelOpenTry) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg @@ -182,9 +184,10 @@ func (msg MsgChannelOpenAck) ValidateBasic() error { return nil } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgChannelOpenAck) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg @@ -241,9 +244,10 @@ func (msg MsgChannelOpenConfirm) ValidateBasic() error { return nil } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgChannelOpenConfirm) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg @@ -291,9 +295,10 @@ func (msg MsgChannelCloseInit) ValidateBasic() error { return nil } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgChannelCloseInit) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg @@ -350,9 +355,10 @@ func (msg MsgChannelCloseConfirm) ValidateBasic() error { return nil } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgChannelCloseConfirm) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg @@ -400,9 +406,10 @@ func (msg MsgRecvPacket) ValidateBasic() error { return msg.Packet.ValidateBasic() } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgRecvPacket) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetDataSignBytes returns the base64-encoded bytes used for the @@ -463,9 +470,10 @@ func (msg MsgTimeout) ValidateBasic() error { return msg.Packet.ValidateBasic() } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgTimeout) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg @@ -522,9 +530,10 @@ func (msg MsgTimeoutOnClose) ValidateBasic() error { return msg.Packet.ValidateBasic() } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgTimeoutOnClose) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg @@ -576,9 +585,10 @@ func (msg MsgAcknowledgement) ValidateBasic() error { return msg.Packet.ValidateBasic() } -// GetSignBytes implements sdk.Msg +// GetSignBytes implements sdk.Msg. The function will panic since it is used +// for amino transaction verification which IBC does not support. func (msg MsgAcknowledgement) GetSignBytes() []byte { - return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg)) + panic("IBC messages do not support amino") } // GetSigners implements sdk.Msg diff --git a/x/ibc/core/04-channel/types/msgs_test.go b/x/ibc/core/04-channel/types/msgs_test.go index 3edebb031b..c7c1bbb4ba 100644 --- a/x/ibc/core/04-channel/types/msgs_test.go +++ b/x/ibc/core/04-channel/types/msgs_test.go @@ -346,18 +346,6 @@ func (suite *TypesTestSuite) TestMsgRecvPacketValidateBasic() { } } -func (suite *TypesTestSuite) TestMsgRecvPacketGetSignBytes() { - msg := types.NewMsgRecvPacket(packet, suite.proof, height, addr) - res := msg.GetSignBytes() - - expected := fmt.Sprintf( - `{"packet":{"data":%s,"destination_channel":"testcpchannel","destination_port":"testcpport","sequence":"1","source_channel":"testchannel","source_port":"testportid","timeout_height":{"version_height":"100","version_number":"0"},"timeout_timestamp":"100"},"proof":"Co0BCi4KCmljczIzOmlhdmwSA0tFWRobChkKA0tFWRIFVkFMVUUaCwgBGAEgASoDAAICClsKDGljczIzOnNpbXBsZRIMaWF2bFN0b3JlS2V5Gj0KOwoMaWF2bFN0b3JlS2V5EiAcIiDXSHQRSvh/Wa07MYpTK0B4XtbaXtzxBED76xk0WhoJCAEYASABKgEA","proof_height":{"version_height":"1","version_number":"0"},"signer":"%s"}`, - string(msg.GetDataSignBytes()), - addr.String(), - ) - suite.Equal(expected, string(res)) -} - func (suite *TypesTestSuite) TestMsgRecvPacketGetSigners() { msg := types.NewMsgRecvPacket(packet, suite.proof, height, addr) res := msg.GetSigners() diff --git a/x/ibc/core/23-commitment/types/codec.go b/x/ibc/core/23-commitment/types/codec.go index 4d7312cd77..1195c7c26d 100644 --- a/x/ibc/core/23-commitment/types/codec.go +++ b/x/ibc/core/23-commitment/types/codec.go @@ -1,7 +1,6 @@ package types import ( - "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/x/ibc/core/exported" ) @@ -42,12 +41,3 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &MerkleProof{}, ) } - -var ( - // SubModuleCdc references the global x/ibc/core/23-commitmentl module codec. Note, the codec should - // ONLY be used in certain instances of tests and for JSON encoding. - // - // The actual codec used for serialization should be provided to x/ibc/core/23-commitmentl and - // defined at the application level. - SubModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) -) diff --git a/x/ibc/light-clients/06-solomachine/types/codec.go b/x/ibc/light-clients/06-solomachine/types/codec.go index 6907a93514..313a910ca9 100644 --- a/x/ibc/light-clients/06-solomachine/types/codec.go +++ b/x/ibc/light-clients/06-solomachine/types/codec.go @@ -30,15 +30,6 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { ) } -var ( - // SubModuleCdc references the global x/ibc/light-clients/06-solomachine module codec. Note, the codec - // should ONLY be used in certain instances of tests and for JSON encoding. - // - // The actual codec used for serialization should be provided to x/ibc/light-clients/06-solomachine and - // defined at the application level. - SubModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) -) - func UnmarshalSignatureData(cdc codec.BinaryMarshaler, data []byte) (signing.SignatureData, error) { protoSigData := &signing.SignatureDescriptor_Data{} if err := cdc.UnmarshalBinaryBare(data, protoSigData); err != nil { diff --git a/x/ibc/light-clients/07-tendermint/types/codec.go b/x/ibc/light-clients/07-tendermint/types/codec.go index c46aa0d795..f0ff8b2f56 100644 --- a/x/ibc/light-clients/07-tendermint/types/codec.go +++ b/x/ibc/light-clients/07-tendermint/types/codec.go @@ -1,7 +1,6 @@ package types import ( - "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/x/ibc/core/exported" ) @@ -30,12 +29,3 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &Header{}, ) } - -var ( - // SubModuleCdc references the global x/ibc/light-clients/07-tendermint module codec. Note, the codec should - // ONLY be used in certain instances of tests and for JSON encoding. - // - // The actual codec used for serialization should be provided to x/ibc/light-clients/07-tendermint and - // defined at the application level. - SubModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) -) diff --git a/x/ibc/light-clients/09-localhost/types/codec.go b/x/ibc/light-clients/09-localhost/types/codec.go index 009989bf1a..b338dfb699 100644 --- a/x/ibc/light-clients/09-localhost/types/codec.go +++ b/x/ibc/light-clients/09-localhost/types/codec.go @@ -1,7 +1,6 @@ package types import ( - "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/x/ibc/core/exported" ) @@ -14,10 +13,3 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &ClientState{}, ) } - -var ( - // SubModuleCdc references the global x/ibc/light-clients/09-localhost module codec. - // The actual codec used for serialization should be provided to x/ibc/light-clients/09-localhost and - // defined at the application level. - SubModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) -) From 93ec7bb785314d437865cde5f70162a9ed63903f Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Fri, 23 Oct 2020 15:20:02 -0400 Subject: [PATCH 71/84] Return an unsigned tx in legacy GET /tx endpoint when signature conversion fails (#7649) * Return an unsigned tx in legacy GET /tx endpoint when signature conversion fails * Add test * add comment * add comment * add comment --- client/tx/legacy.go | 18 +++++++++++++----- client/tx/legacy_test.go | 27 ++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/client/tx/legacy.go b/client/tx/legacy.go index 71f0fe8c4e..62cbf9b7b4 100644 --- a/client/tx/legacy.go +++ b/client/tx/legacy.go @@ -19,7 +19,7 @@ func ConvertTxToStdTx(codec *codec.LegacyAmino, tx signing.Tx) (legacytx.StdTx, aminoTxConfig := legacytx.StdTxConfig{Cdc: codec} builder := aminoTxConfig.NewTxBuilder() - err := CopyTx(tx, builder) + err := CopyTx(tx, builder, true) if err != nil { return legacytx.StdTx{}, err @@ -34,8 +34,9 @@ func ConvertTxToStdTx(codec *codec.LegacyAmino, tx signing.Tx) (legacytx.StdTx, } // CopyTx copies a Tx to a new TxBuilder, allowing conversion between -// different transaction formats. -func CopyTx(tx signing.Tx, builder client.TxBuilder) error { +// different transaction formats. If ignoreSignatureError is true, copying will continue +// tx even if the signature cannot be set in the target builder resulting in an unsigned tx. +func CopyTx(tx signing.Tx, builder client.TxBuilder, ignoreSignatureError bool) error { err := builder.SetMsgs(tx.GetMsgs()...) if err != nil { return err @@ -48,7 +49,13 @@ func CopyTx(tx signing.Tx, builder client.TxBuilder) error { err = builder.SetSignatures(sigs...) if err != nil { - return err + if ignoreSignatureError { + // we call SetSignatures() agan with no args to clear any signatures in case the + // previous call to SetSignatures() had any partial side-effects + _ = builder.SetSignatures() + } else { + return err + } } builder.SetMemo(tx.GetMemo()) @@ -58,6 +65,7 @@ func CopyTx(tx signing.Tx, builder client.TxBuilder) error { return nil } +// ConvertAndEncodeStdTx encodes the stdTx as a transaction in the format specified by txConfig func ConvertAndEncodeStdTx(txConfig client.TxConfig, stdTx legacytx.StdTx) ([]byte, error) { builder := txConfig.NewTxBuilder() @@ -67,7 +75,7 @@ func ConvertAndEncodeStdTx(txConfig client.TxConfig, stdTx legacytx.StdTx) ([]by if _, ok := builder.GetTx().(legacytx.StdTx); ok { theTx = stdTx } else { - err := CopyTx(stdTx, builder) + err := CopyTx(stdTx, builder, false) if err != nil { return nil, err } diff --git a/client/tx/legacy_test.go b/client/tx/legacy_test.go index 4884faa83c..704b3ac029 100644 --- a/client/tx/legacy_test.go +++ b/client/tx/legacy_test.go @@ -68,10 +68,10 @@ func (s *TestSuite) TestCopyTx() { protoBuilder := s.protoCfg.NewTxBuilder() buildTestTx(s.T(), protoBuilder) aminoBuilder := s.aminoCfg.NewTxBuilder() - err := tx2.CopyTx(protoBuilder.GetTx(), aminoBuilder) + err := tx2.CopyTx(protoBuilder.GetTx(), aminoBuilder, false) s.Require().NoError(err) protoBuilder2 := s.protoCfg.NewTxBuilder() - err = tx2.CopyTx(aminoBuilder.GetTx(), protoBuilder2) + err = tx2.CopyTx(aminoBuilder.GetTx(), protoBuilder2, false) s.Require().NoError(err) bz, err := s.protoCfg.TxEncoder()(protoBuilder.GetTx()) s.Require().NoError(err) @@ -83,10 +83,10 @@ func (s *TestSuite) TestCopyTx() { aminoBuilder = s.aminoCfg.NewTxBuilder() buildTestTx(s.T(), aminoBuilder) protoBuilder = s.protoCfg.NewTxBuilder() - err = tx2.CopyTx(aminoBuilder.GetTx(), protoBuilder) + err = tx2.CopyTx(aminoBuilder.GetTx(), protoBuilder, false) s.Require().NoError(err) aminoBuilder2 := s.aminoCfg.NewTxBuilder() - err = tx2.CopyTx(protoBuilder.GetTx(), aminoBuilder2) + err = tx2.CopyTx(protoBuilder.GetTx(), aminoBuilder2, false) s.Require().NoError(err) bz, err = s.aminoCfg.TxEncoder()(aminoBuilder.GetTx()) s.Require().NoError(err) @@ -108,6 +108,23 @@ func (s *TestSuite) TestConvertTxToStdTx() { s.Require().Equal(sig.PubKey, stdTx.Signatures[0].PubKey) s.Require().Equal(sig.Data.(*signing2.SingleSignatureData).Signature, stdTx.Signatures[0].Signature) + // SIGN_MODE_DIRECT should fall back to an unsigned tx + err = protoBuilder.SetSignatures(signing2.SignatureV2{ + PubKey: pub1, + Data: &signing2.SingleSignatureData{ + SignMode: signing2.SignMode_SIGN_MODE_DIRECT, + Signature: []byte("dummy"), + }, + }) + s.Require().NoError(err) + stdTx, err = tx2.ConvertTxToStdTx(s.encCfg.Amino, protoBuilder.GetTx()) + s.Require().NoError(err) + s.Require().Equal(memo, stdTx.Memo) + s.Require().Equal(gas, stdTx.Fee.Gas) + s.Require().Equal(fee, stdTx.Fee.Amount) + s.Require().Equal(msg, stdTx.Msgs[0]) + s.Require().Empty(stdTx.Signatures) + // std tx aminoBuilder := s.aminoCfg.NewTxBuilder() buildTestTx(s.T(), aminoBuilder) @@ -127,7 +144,7 @@ func (s *TestSuite) TestConvertAndEncodeStdTx() { decodedTx, err := s.protoCfg.TxDecoder()(txBz) s.Require().NoError(err) aminoBuilder2 := s.aminoCfg.NewTxBuilder() - s.Require().NoError(tx2.CopyTx(decodedTx.(signing.Tx), aminoBuilder2)) + s.Require().NoError(tx2.CopyTx(decodedTx.(signing.Tx), aminoBuilder2, false)) s.Require().Equal(stdTx, aminoBuilder2.GetTx()) // just use amino everywhere From d48d0001951f265d90b1d3c1502db3d28c7d3477 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Sat, 24 Oct 2020 10:17:07 +0500 Subject: [PATCH 72/84] Remove duplicate print message on keys add command (#7654) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- client/keys/add.go | 1 - 1 file changed, 1 deletion(-) diff --git a/client/keys/add.go b/client/keys/add.go index 57b37a5001..b2e267e83e 100644 --- a/client/keys/add.go +++ b/client/keys/add.go @@ -306,7 +306,6 @@ func printCreate(cmd *cobra.Command, info keyring.Info, showMnemonic bool, mnemo // print mnemonic unless requested not to. if showMnemonic { - fmt.Fprintln(cmd.ErrOrStderr(), "\n**Important** write this mnemonic phrase in a safe place.") fmt.Fprintln(cmd.ErrOrStderr(), "\n**Important** write this mnemonic phrase in a safe place.") fmt.Fprintln(cmd.ErrOrStderr(), "It is the only way to recover your account if you ever forget your password.") fmt.Fprintln(cmd.ErrOrStderr(), "") From fc46423fccff16439e9051d4e61be6e1363b122b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Oct 2020 07:44:22 -0300 Subject: [PATCH 73/84] build(deps): bump gaurav-nelson/github-action-markdown-link-check (#7612) Bumps [gaurav-nelson/github-action-markdown-link-check](https://github.com/gaurav-nelson/github-action-markdown-link-check) from 1.0.7 to 1.0.8. - [Release notes](https://github.com/gaurav-nelson/github-action-markdown-link-check/releases) - [Commits](https://github.com/gaurav-nelson/github-action-markdown-link-check/compare/1.0.7...e3c371c731b2f494f856dc5de7f61cea4d519907) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marko Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Amaury Martiny --- .github/workflows/linkchecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml index dfbee1085d..2fdf1ab9fe 100644 --- a/.github/workflows/linkchecker.yml +++ b/.github/workflows/linkchecker.yml @@ -7,6 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@master - - uses: gaurav-nelson/github-action-markdown-link-check@1.0.7 + - uses: gaurav-nelson/github-action-markdown-link-check@1.0.8 with: folder-path: "docs" From bd3a29bdc1b5aef2c051ee04d97c36bff1b9e5dc Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Mon, 26 Oct 2020 15:08:13 +0000 Subject: [PATCH 74/84] fix check-test-* targets (#7675) Closes: #7673 --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ab45bf98c2..b9f0beebca 100644 --- a/Makefile +++ b/Makefile @@ -222,9 +222,9 @@ $(TEST_TARGETS): run-tests # check-* compiles and collects tests without running them # note: go test -c doesn't support multiple packages yet (https://github.com/golang/go/issues/15513) -CHECK_TEST_TARGETS := test-unit test-unit-amino -check-test-unit: test-unit -check-test-unit-amino: test-unit-amino +CHECK_TEST_TARGETS := check-test-unit check-test-unit-amino +check-test-unit: ARGS=-tags='cgo ledger test_ledger_mock norace' +check-test-unit-amino: ARGS=-tags='ledger test_ledger_mock test_amino norace' $(CHECK_TEST_TARGETS): EXTRA_ARGS=-run=none $(CHECK_TEST_TARGETS): run-tests From 6688382f2ea70f5029887caa50e530a89e181d6e Mon Sep 17 00:00:00 2001 From: Marko Date: Tue, 27 Oct 2020 11:00:01 +0100 Subject: [PATCH 75/84] ci: add pushing of tags and master (#7617) --- .github/workflows/docker.yml | 39 +++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 34f41a11de..e519490d78 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,9 +1,13 @@ -name: Nightly Builds -# Nightly Builds rebuilds the simapp docker image Monday - Friday at midnight +name: Build & Push +# Build & Push builds the simapp docker image on every push to master and # and pushes the image to https://hub.docker.com/r/interchainio/simapp/tags on: - schedule: - - cron: "0 0 * * 1-5" # deploy at midnight Monday - Friday + push: + branches: + - master + tags: + - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 + - "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5 jobs: build: @@ -12,9 +16,26 @@ jobs: - uses: actions/checkout@master with: fetch-depth: 0 - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + + - name: Prepare + id: prep + run: | + DOCKER_IMAGE=interchainio/simapp + VERSION=noop + if [[ $GITHUB_REF == refs/tags/* ]]; then + VERSION=${GITHUB_REF#refs/tags/} + elif [[ $GITHUB_REF == refs/heads/* ]]; then + VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g') + if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; then + VERSION=latest + fi + fi + TAGS="${DOCKER_IMAGE}:${VERSION}" + if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + TAGS="$TAGS,${DOCKER_IMAGE}:${VERSION}" + echo ::set-output name=version::${VERSION} + echo ::set-output name=tags::${TAGS} + echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 @@ -28,5 +49,5 @@ jobs: - name: Publish to Docker Hub uses: docker/build-push-action@v2 with: - push: true - tags: interchainio/simapp:nightly-${{ steps.date.outputs.date }} + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.prep.outputs.tags }} From 8014fc688e40ad82ff5d6b1898c50d5ee7a8a592 Mon Sep 17 00:00:00 2001 From: Akhil Kumar P <36399231+akhilkumarpilli@users.noreply.github.com> Date: Tue, 27 Oct 2020 15:34:34 +0530 Subject: [PATCH 76/84] Fix clang-format to specific version (#7350) * Update clang-format install script * Address PR comments * Update clang-format install command * Format makefile * Use docker for formatting proto * Comment out delimiter config * Update contributing.md and .clang-format Co-authored-by: Alessio Treglia Co-authored-by: Marko --- .clang-format | 3 ++- CONTRIBUTING.md | 2 ++ Makefile | 4 ++++ contrib/devtools/proto-tools-installer.sh | 27 ----------------------- 4 files changed, 8 insertions(+), 28 deletions(-) diff --git a/.clang-format b/.clang-format index dec78f0f78..7f662a4fd9 100644 --- a/.clang-format +++ b/.clang-format @@ -91,7 +91,8 @@ PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Right RawStringFormats: - - Delimiter: pb + - Delimiters: + - pb Language: TextProto BasedOnStyle: google ReflowComments: true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 35e4705c04..e13dba1b85 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -142,6 +142,8 @@ build, in which case we can fall back on `go mod tidy -v`. We use [Protocol Buffers](https://developers.google.com/protocol-buffers) along with [gogoproto](https://github.com/gogo/protobuf) to generate code for use in Cosmos-SDK. +For formatting code in `.proto` files, you can run `make proto-format` command. + For linting and checking breaking changes, we use [buf](https://buf.build/). There are two options for linting and to check if your changes will cause a break. The first is that you can install [buf](https://buf.build/docs/installation) locally, the commands for running buf after installing are `make proto-lint` and the breaking changes check will be `make proto-check-breaking`. If you do not want to install buf and have docker installed already then you can use these commands `make proto-lint-docker` and `make proto-check-breaking-docker`. To generate the protobuf stubs you must have `protoc` and `protoc-gen-gocosmos` installed. To install these tools run `make proto-tools`. After this step you will be able to run `make proto-gen` to generate the protobuf stubs. diff --git a/Makefile b/Makefile index b9f0beebca..dd21bbf2da 100644 --- a/Makefile +++ b/Makefile @@ -362,7 +362,11 @@ proto-gen: @./scripts/protocgen.sh proto-format: + @echo "Formatting Protobuf files" + docker run -v $(shell pwd):/workspace \ + --workdir /workspace tendermintdev/docker-build-proto \ find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \; +.PHONY: proto-format # This generates the SDK's custom wrapper for google.protobuf.Any. It should only be run manually when needed proto-gen-any: diff --git a/contrib/devtools/proto-tools-installer.sh b/contrib/devtools/proto-tools-installer.sh index fd287ddd8d..f8bd2f621b 100755 --- a/contrib/devtools/proto-tools-installer.sh +++ b/contrib/devtools/proto-tools-installer.sh @@ -119,32 +119,6 @@ f_install_protoc_gen_swagger() { f_print_done } -f_install_clang_format() { - f_print_installing_with_padding clang-format - - if which clang-format &>/dev/null ; then - echo -e "\talready installed. Skipping." - return 0 - fi - - case "${UNAME_S}" in - Linux) - if [ -e /etc/debian_version ]; then - echo -e "\tRun: sudo apt-get install clang-format" >&2 - elif [ -e /etc/fedora-release ]; then - echo -e "\tRun: sudo dnf install clang" >&2 - else - echo -e "\tRun (as root): subscription-manager repos --enable rhel-7-server-devtools-rpms ; yum install llvm-toolset-7" >&2 - fi - ;; - Darwin) - echo "\tRun: brew install clang-format" >&2 - ;; - *) - echo "\tunknown operating system. Skipping." >&2 - esac -} - f_ensure_tools f_ensure_dirs f_install_protoc @@ -152,4 +126,3 @@ f_install_buf f_install_protoc_gen_gocosmos f_install_protoc_gen_grpc_gateway f_install_protoc_gen_swagger -f_install_clang_format From 9bd42ace6b84c5214c98c261e5b794d1f7cba8d0 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Tue, 27 Oct 2020 12:33:48 +0100 Subject: [PATCH 77/84] simapp: rename MakeEncodingConfig to MakeTestEncodingConfig (#7681) * simapp: rename MakeEncodingConfig to MakeTestEncodingConfig * Updating the Changelog + Adding DEPRECATED attribute. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- CHANGELOG.md | 1 + baseapp/msg_service_router_test.go | 2 +- client/grpc/simulate/simulate_test.go | 2 +- client/tx/legacy_test.go | 2 +- client/tx/tx_test.go | 2 +- server/README.md | 2 +- server/export_test.go | 4 ++-- simapp/app.go | 2 +- simapp/app_test.go | 6 +++--- simapp/encoding.go | 9 ++++++--- simapp/genesis.go | 2 +- simapp/params/amino.go | 7 +++++-- simapp/params/proto.go | 7 +++++-- simapp/sim_bench_test.go | 4 ++-- simapp/sim_test.go | 12 ++++++------ simapp/simd/cmd/root.go | 6 +++--- simapp/test_helpers.go | 6 +++--- testutil/network/network.go | 2 +- types/rest/rest_test.go | 2 +- x/auth/ante/testutil_test.go | 2 +- x/auth/client/cli/cli_test.go | 4 ++-- x/auth/client/cli/encode_test.go | 4 ++-- x/auth/client/tx_test.go | 4 ++-- x/auth/legacy/v040/migrate_test.go | 2 +- x/bank/app_test.go | 12 ++++++------ x/bank/bench_test.go | 4 ++-- x/bank/client/rest/tx_test.go | 2 +- x/bank/legacy/v040/migrate_test.go | 2 +- x/bank/simulation/operations.go | 4 ++-- x/crisis/handler_test.go | 2 +- x/distribution/client/cli/tx_test.go | 2 +- x/distribution/simulation/operations.go | 8 ++++---- x/evidence/legacy/v040/migrate_test.go | 2 +- x/genutil/gentx_test.go | 2 +- x/genutil/types/genesis_state_test.go | 8 ++++---- x/gov/client/utils/query_test.go | 2 +- x/gov/genesis_test.go | 2 +- x/gov/legacy/v040/migrate_test.go | 2 +- x/gov/simulation/operations.go | 6 +++--- x/ibc/testing/chain.go | 2 +- x/params/keeper/common_test.go | 2 +- x/params/proposal_handler_test.go | 2 +- x/params/types/subspace_test.go | 2 +- x/slashing/app_test.go | 2 +- x/slashing/legacy/v040/migrate_test.go | 2 +- x/slashing/simulation/operations.go | 2 +- x/staking/app_test.go | 2 +- x/staking/legacy/v040/migrate_test.go | 2 +- x/staking/simulation/operations.go | 10 +++++----- x/upgrade/abci_test.go | 2 +- 50 files changed, 98 insertions(+), 88 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c60d7ed2b..2c4e7d1f83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * `Validator` update. Methods changed in `ValidatorI` (as described above) and `ToTmValidator` return error. * `Validator.ConsensusPubkey` type changed from `string` to `codectypes.Any`. * `MsgCreateValidator.Pubkey` type changed from `string` to `codectypes.Any`. +* Deprecating and renaming `MakeEncodingConfig` to `MakeTestEncodingConfig` (both in `simapp` and `simapp/params` packages). ### Features diff --git a/baseapp/msg_service_router_test.go b/baseapp/msg_service_router_test.go index f0f9be57b4..d5e01acd17 100644 --- a/baseapp/msg_service_router_test.go +++ b/baseapp/msg_service_router_test.go @@ -22,7 +22,7 @@ import ( func TestMsgService(t *testing.T) { priv, _, _ := testdata.KeyTestPubAddr() - encCfg := simapp.MakeEncodingConfig() + encCfg := simapp.MakeTestEncodingConfig() db := dbm.NewMemDB() app := baseapp.NewBaseApp("test", log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, encCfg.TxConfig.TxDecoder()) app.SetInterfaceRegistry(encCfg.InterfaceRegistry) diff --git a/client/grpc/simulate/simulate_test.go b/client/grpc/simulate/simulate_test.go index 7e25c11232..11b58168a9 100644 --- a/client/grpc/simulate/simulate_test.go +++ b/client/grpc/simulate/simulate_test.go @@ -39,7 +39,7 @@ func (s *IntegrationTestSuite) SetupSuite() { app.BankKeeper.SetParams(sdkCtx, banktypes.DefaultParams()) // Set up TxConfig. - encodingConfig := simapp.MakeEncodingConfig() + encodingConfig := simapp.MakeTestEncodingConfig() clientCtx := client.Context{}.WithTxConfig(encodingConfig.TxConfig) // Create new simulation server. diff --git a/client/tx/legacy_test.go b/client/tx/legacy_test.go index 704b3ac029..59a7b95d7f 100644 --- a/client/tx/legacy_test.go +++ b/client/tx/legacy_test.go @@ -57,7 +57,7 @@ type TestSuite struct { } func (s *TestSuite) SetupSuite() { - encCfg := simapp.MakeEncodingConfig() + encCfg := simapp.MakeTestEncodingConfig() s.encCfg = encCfg s.protoCfg = tx.NewTxConfig(codec.NewProtoCodec(encCfg.InterfaceRegistry), tx.DefaultSignModes) s.aminoCfg = legacytx.StdTxConfig{Cdc: encCfg.Amino} diff --git a/client/tx/tx_test.go b/client/tx/tx_test.go index 41a021fef1..da4db5fc8b 100644 --- a/client/tx/tx_test.go +++ b/client/tx/tx_test.go @@ -18,7 +18,7 @@ import ( ) func NewTestTxConfig() client.TxConfig { - cfg := simapp.MakeEncodingConfig() + cfg := simapp.MakeTestEncodingConfig() return cfg.TxConfig } diff --git a/server/README.md b/server/README.md index 99ded0713b..3ee67d5c0c 100644 --- a/server/README.md +++ b/server/README.md @@ -34,7 +34,7 @@ var ( }, } - encodingConfig = simapp.MakeEncodingConfig() + encodingConfig = simapp.MakeTestEncodingConfig() initClientCtx = client.Context{}. WithJSONMarshaler(encodingConfig.Marshaler). WithTxConfig(encodingConfig.TxConfig). diff --git a/server/export_test.go b/server/export_test.go index ac0cf6b659..d804b7a151 100644 --- a/server/export_test.go +++ b/server/export_test.go @@ -128,7 +128,7 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, *t logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) db := dbm.NewMemDB() - encCfg := simapp.MakeEncodingConfig() + encCfg := simapp.MakeTestEncodingConfig() app := simapp.NewSimApp(logger, db, nil, true, map[int64]bool{}, tempDir, 0, encCfg) serverCtx := server.NewDefaultContext() @@ -149,7 +149,7 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, *t cmd := server.ExportCmd( func(_ log.Logger, _ dbm.DB, _ io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string) (types.ExportedApp, error) { - encCfg := simapp.MakeEncodingConfig() + encCfg := simapp.MakeTestEncodingConfig() var simApp *simapp.SimApp if height != -1 { diff --git a/simapp/app.go b/simapp/app.go index 5c3412f360..41683dff82 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -432,7 +432,7 @@ func NewSimApp( // simapp. It is useful for tests and clients who do not want to construct the // full simapp func MakeCodecs() (codec.Marshaler, *codec.LegacyAmino) { - config := MakeEncodingConfig() + config := MakeTestEncodingConfig() return config.Marshaler, config.Amino } diff --git a/simapp/app_test.go b/simapp/app_test.go index 4a87975622..fdc609677a 100644 --- a/simapp/app_test.go +++ b/simapp/app_test.go @@ -14,7 +14,7 @@ import ( func TestSimAppExport(t *testing.T) { db := dbm.NewMemDB() - app := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig()) + app := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeTestEncodingConfig()) genesisState := NewDefaultGenesisState() stateBytes, err := json.MarshalIndent(genesisState, "", " ") @@ -30,7 +30,7 @@ func TestSimAppExport(t *testing.T) { app.Commit() // Making a new app object with the db, so that initchain hasn't been called - app2 := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig()) + app2 := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeTestEncodingConfig()) _, err = app2.ExportAppStateAndValidators(false, []string{}) require.NoError(t, err, "ExportAppStateAndValidators should not have an error") } @@ -38,7 +38,7 @@ func TestSimAppExport(t *testing.T) { // ensure that blocked addresses are properly set in bank keeper func TestBlockedAddrs(t *testing.T) { db := dbm.NewMemDB() - app := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig()) + app := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeTestEncodingConfig()) for acc := range maccPerms { require.Equal(t, !allowedReceivingModAcc[acc], app.BankKeeper.BlockedAddr(app.AccountKeeper.GetModuleAddress(acc))) diff --git a/simapp/encoding.go b/simapp/encoding.go index 2621d3e86d..954f4a1175 100644 --- a/simapp/encoding.go +++ b/simapp/encoding.go @@ -5,9 +5,12 @@ import ( "github.com/cosmos/cosmos-sdk/std" ) -// MakeEncodingConfig creates an EncodingConfig for testing -func MakeEncodingConfig() simappparams.EncodingConfig { - encodingConfig := simappparams.MakeEncodingConfig() +// MakeTestEncodingConfig creates an EncodingConfig for testing. +// This function should be used only internally (in the SDK). +// App user should'nt create new codecs - use the app.AppCodec instead. +// [DEPRECATED] +func MakeTestEncodingConfig() simappparams.EncodingConfig { + encodingConfig := simappparams.MakeTestEncodingConfig() std.RegisterLegacyAminoCodec(encodingConfig.Amino) std.RegisterInterfaces(encodingConfig.InterfaceRegistry) ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) diff --git a/simapp/genesis.go b/simapp/genesis.go index 5a8f18b1aa..8fd7e83fd8 100644 --- a/simapp/genesis.go +++ b/simapp/genesis.go @@ -15,6 +15,6 @@ type GenesisState map[string]json.RawMessage // NewDefaultGenesisState generates the default state for the application. func NewDefaultGenesisState() GenesisState { - encCfg := MakeEncodingConfig() + encCfg := MakeTestEncodingConfig() return ModuleBasics.DefaultGenesis(encCfg.Marshaler) } diff --git a/simapp/params/amino.go b/simapp/params/amino.go index ff9b05a9fb..440c29f817 100644 --- a/simapp/params/amino.go +++ b/simapp/params/amino.go @@ -8,8 +8,11 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" ) -// MakeEncodingConfig creates an EncodingConfig for an amino based test configuration. -func MakeEncodingConfig() EncodingConfig { +// MakeTestEncodingConfig creates an EncodingConfig for an amino based test configuration. +// This function should be used only internally (in the SDK). +// App user should'nt create new codecs - use the app.AppCodec instead. +// [DEPRECATED] +func MakeTestEncodingConfig() EncodingConfig { cdc := codec.NewLegacyAmino() interfaceRegistry := types.NewInterfaceRegistry() marshaler := codec.NewAminoCodec(cdc) diff --git a/simapp/params/proto.go b/simapp/params/proto.go index 63ae791a4f..04aa524b90 100644 --- a/simapp/params/proto.go +++ b/simapp/params/proto.go @@ -8,8 +8,11 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/tx" ) -// MakeEncodingConfig creates an EncodingConfig for a non-amino based test configuration. -func MakeEncodingConfig() EncodingConfig { +// MakeTestEncodingConfig creates an EncodingConfig for a non-amino based test configuration. +// This function should be used only internally (in the SDK). +// App user should'nt create new codecs - use the app.AppCodec instead. +// [DEPRECATED] +func MakeTestEncodingConfig() EncodingConfig { cdc := codec.NewLegacyAmino() interfaceRegistry := types.NewInterfaceRegistry() marshaler := codec.NewProtoCodec(interfaceRegistry) diff --git a/simapp/sim_bench_test.go b/simapp/sim_bench_test.go index 660e0fb8f0..505150c450 100644 --- a/simapp/sim_bench_test.go +++ b/simapp/sim_bench_test.go @@ -27,7 +27,7 @@ func BenchmarkFullAppSimulation(b *testing.B) { } }() - app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), interBlockCacheOpt()) + app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), interBlockCacheOpt()) // run randomized simulation _, simParams, simErr := simulation.SimulateFromSeed( @@ -72,7 +72,7 @@ func BenchmarkInvariants(b *testing.B) { } }() - app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), interBlockCacheOpt()) + app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), interBlockCacheOpt()) // run randomized simulation _, simParams, simErr := simulation.SimulateFromSeed( diff --git a/simapp/sim_test.go b/simapp/sim_test.go index ad3633132d..d20a8267c1 100644 --- a/simapp/sim_test.go +++ b/simapp/sim_test.go @@ -68,7 +68,7 @@ func TestFullAppSimulation(t *testing.T) { require.NoError(t, os.RemoveAll(dir)) }() - app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt) + app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), fauxMerkleModeOpt) require.Equal(t, "SimApp", app.Name()) // run randomized simulation @@ -106,7 +106,7 @@ func TestAppImportExport(t *testing.T) { require.NoError(t, os.RemoveAll(dir)) }() - app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt) + app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), fauxMerkleModeOpt) require.Equal(t, "SimApp", app.Name()) // Run randomized simulation @@ -146,7 +146,7 @@ func TestAppImportExport(t *testing.T) { require.NoError(t, os.RemoveAll(newDir)) }() - newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt) + newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), fauxMerkleModeOpt) require.Equal(t, "SimApp", newApp.Name()) var genesisState GenesisState @@ -203,7 +203,7 @@ func TestAppSimulationAfterImport(t *testing.T) { require.NoError(t, os.RemoveAll(dir)) }() - app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt) + app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), fauxMerkleModeOpt) require.Equal(t, "SimApp", app.Name()) // Run randomized simulation @@ -248,7 +248,7 @@ func TestAppSimulationAfterImport(t *testing.T) { require.NoError(t, os.RemoveAll(newDir)) }() - newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt) + newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), fauxMerkleModeOpt) require.Equal(t, "SimApp", newApp.Name()) newApp.InitChain(abci.RequestInitChain{ @@ -299,7 +299,7 @@ func TestAppStateDeterminism(t *testing.T) { } db := dbm.NewMemDB() - app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), interBlockCacheOpt()) + app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), interBlockCacheOpt()) fmt.Printf( "running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n", diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index b01b170456..f4f6ca5897 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -38,7 +38,7 @@ import ( // NewRootCmd creates a new root command for simd. It is called once in the // main function. func NewRootCmd() (*cobra.Command, params.EncodingConfig) { - encodingConfig := simapp.MakeEncodingConfig() + encodingConfig := simapp.MakeTestEncodingConfig() initClientCtx := client.Context{}. WithJSONMarshaler(encodingConfig.Marshaler). WithInterfaceRegistry(encodingConfig.InterfaceRegistry). @@ -191,7 +191,7 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts serverty logger, db, traceStore, true, skipUpgradeHeights, cast.ToString(appOpts.Get(flags.FlagHome)), cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), - simapp.MakeEncodingConfig(), // Ideally, we would reuse the one created by NewRootCmd. + simapp.MakeTestEncodingConfig(), // Ideally, we would reuse the one created by NewRootCmd. baseapp.SetPruning(pruningOpts), baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))), baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))), @@ -211,7 +211,7 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts serverty func createSimappAndExport( logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error) { - encCfg := simapp.MakeEncodingConfig() // Ideally, we would reuse the one created by NewRootCmd. + encCfg := simapp.MakeTestEncodingConfig() // Ideally, we would reuse the one created by NewRootCmd. encCfg.Marshaler = codec.NewProtoCodec(encCfg.InterfaceRegistry) var simApp *simapp.SimApp if height != -1 { diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index 8da319b216..de871b7c5e 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -51,7 +51,7 @@ var DefaultConsensusParams = &abci.ConsensusParams{ // Setup initializes a new SimApp. A Nop logger is set in SimApp. func Setup(isCheckTx bool) *SimApp { db := dbm.NewMemDB() - app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeEncodingConfig()) + app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeTestEncodingConfig()) if !isCheckTx { // init chain must be called to stop deliverState from being nil genesisState := NewDefaultGenesisState() @@ -79,7 +79,7 @@ func Setup(isCheckTx bool) *SimApp { // account. A Nop logger is set in SimApp. func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *SimApp { db := dbm.NewMemDB() - app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeEncodingConfig()) + app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeTestEncodingConfig()) genesisState := NewDefaultGenesisState() @@ -160,7 +160,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs // accounts and possible balances. func SetupWithGenesisAccounts(genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *SimApp { db := dbm.NewMemDB() - app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig()) + app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeTestEncodingConfig()) // initialize the chain with the passed in genesis accounts genesisState := NewDefaultGenesisState() diff --git a/testutil/network/network.go b/testutil/network/network.go index 1ab9006f8e..fc50c9aa0c 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -94,7 +94,7 @@ type Config struct { // DefaultConfig returns a sane default configuration suitable for nearly all // testing requirements. func DefaultConfig() Config { - encCfg := simapp.MakeEncodingConfig() + encCfg := simapp.MakeTestEncodingConfig() return Config{ Codec: encCfg.Marshaler, diff --git a/types/rest/rest_test.go b/types/rest/rest_test.go index 9060bab09a..b4bf386117 100644 --- a/types/rest/rest_test.go +++ b/types/rest/rest_test.go @@ -307,7 +307,7 @@ func TestParseQueryParamBool(t *testing.T) { func TestPostProcessResponseBare(t *testing.T) { t.Parallel() - encodingConfig := simappparams.MakeEncodingConfig() + encodingConfig := simappparams.MakeTestEncodingConfig() clientCtx := client.Context{}. WithTxConfig(encodingConfig.TxConfig). WithLegacyAmino(encodingConfig.Amino) // amino used intentionally here diff --git a/x/auth/ante/testutil_test.go b/x/auth/ante/testutil_test.go index a6755d0c35..9d8924eea7 100644 --- a/x/auth/ante/testutil_test.go +++ b/x/auth/ante/testutil_test.go @@ -53,7 +53,7 @@ func (suite *AnteTestSuite) SetupTest(isCheckTx bool) { suite.ctx = suite.ctx.WithBlockHeight(1) // Set up TxConfig. - encodingConfig := simapp.MakeEncodingConfig() + encodingConfig := simapp.MakeTestEncodingConfig() // We're using TestMsg encoding in some tests, so register it here. encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) testdata.RegisterInterfaces(encodingConfig.InterfaceRegistry) diff --git a/x/auth/client/cli/cli_test.go b/x/auth/client/cli/cli_test.go index 72e53a97a4..0902501a79 100644 --- a/x/auth/client/cli/cli_test.go +++ b/x/auth/client/cli/cli_test.go @@ -756,7 +756,7 @@ func (s *IntegrationTestSuite) TestGetAccountCmd() { func TestGetBroadcastCommand_OfflineFlag(t *testing.T) { clientCtx := client.Context{}.WithOffline(true) - clientCtx = clientCtx.WithTxConfig(simapp.MakeEncodingConfig().TxConfig) + clientCtx = clientCtx.WithTxConfig(simapp.MakeTestEncodingConfig().TxConfig) cmd := authcli.GetBroadcastCommand() _ = testutil.ApplyMockIODiscardOutErr(cmd) @@ -767,7 +767,7 @@ func TestGetBroadcastCommand_OfflineFlag(t *testing.T) { func TestGetBroadcastCommand_WithoutOfflineFlag(t *testing.T) { clientCtx := client.Context{} - txCfg := simapp.MakeEncodingConfig().TxConfig + txCfg := simapp.MakeTestEncodingConfig().TxConfig clientCtx = clientCtx.WithTxConfig(txCfg) ctx := context.Background() diff --git a/x/auth/client/cli/encode_test.go b/x/auth/client/cli/encode_test.go index 61464bb951..3e5f616f5b 100644 --- a/x/auth/client/cli/encode_test.go +++ b/x/auth/client/cli/encode_test.go @@ -15,7 +15,7 @@ import ( ) func TestGetCommandEncode(t *testing.T) { - encodingConfig := simappparams.MakeEncodingConfig() + encodingConfig := simappparams.MakeTestEncodingConfig() cmd := GetEncodeCommand() _ = testutil.ApplyMockIODiscardOutErr(cmd) @@ -49,7 +49,7 @@ func TestGetCommandEncode(t *testing.T) { } func TestGetCommandDecode(t *testing.T) { - encodingConfig := simappparams.MakeEncodingConfig() + encodingConfig := simappparams.MakeTestEncodingConfig() clientCtx := client.Context{}. WithTxConfig(encodingConfig.TxConfig). diff --git a/x/auth/client/tx_test.go b/x/auth/client/tx_test.go index 7ab1597bc8..3f194d84ae 100644 --- a/x/auth/client/tx_test.go +++ b/x/auth/client/tx_test.go @@ -55,7 +55,7 @@ func TestDefaultTxEncoder(t *testing.T) { func TestReadTxFromFile(t *testing.T) { t.Parallel() - encodingConfig := simapp.MakeEncodingConfig() + encodingConfig := simapp.MakeTestEncodingConfig() txCfg := encodingConfig.TxConfig clientCtx := client.Context{} @@ -90,7 +90,7 @@ func TestReadTxFromFile(t *testing.T) { func TestBatchScanner_Scan(t *testing.T) { t.Parallel() - encodingConfig := simapp.MakeEncodingConfig() + encodingConfig := simapp.MakeTestEncodingConfig() txGen := encodingConfig.TxConfig clientCtx := client.Context{} diff --git a/x/auth/legacy/v040/migrate_test.go b/x/auth/legacy/v040/migrate_test.go index 519b3cb483..e241046095 100644 --- a/x/auth/legacy/v040/migrate_test.go +++ b/x/auth/legacy/v040/migrate_test.go @@ -17,7 +17,7 @@ import ( ) func TestMigrate(t *testing.T) { - encodingConfig := simapp.MakeEncodingConfig() + encodingConfig := simapp.MakeTestEncodingConfig() clientCtx := client.Context{}. WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). diff --git a/x/bank/app_test.go b/x/bank/app_test.go index c8a5c88985..713aa0999b 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -109,7 +109,7 @@ func TestSendNotEnoughBalance(t *testing.T) { sendMsg := types.NewMsgSend(addr1, addr2, sdk.Coins{sdk.NewInt64Coin("foocoin", 100)}) header := tmproto.Header{Height: app.LastBlockHeight() + 1} - txGen := simapp.MakeEncodingConfig().TxConfig + txGen := simapp.MakeTestEncodingConfig().TxConfig _, _, err = simapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{sendMsg}, "", []uint64{origAccNum}, []uint64{origSeq}, false, false, priv1) require.Error(t, err) @@ -182,7 +182,7 @@ func TestSendToModuleAcc(t *testing.T) { origSeq := res1.GetSequence() header := tmproto.Header{Height: app.LastBlockHeight() + 1} - txGen := simapp.MakeEncodingConfig().TxConfig + txGen := simapp.MakeTestEncodingConfig().TxConfig _, _, err = simapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{test.msg}, "", []uint64{origAccNum}, []uint64{origSeq}, test.expSimPass, test.expPass, priv1) if test.expPass { require.NoError(t, err) @@ -256,7 +256,7 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { for _, tc := range testCases { header := tmproto.Header{Height: app.LastBlockHeight() + 1} - txGen := simapp.MakeEncodingConfig().TxConfig + txGen := simapp.MakeTestEncodingConfig().TxConfig _, _, err := simapp.SignCheckDeliver(t, txGen, app.BaseApp, header, tc.msgs, "", tc.accNums, tc.accSeqs, tc.expSimPass, tc.expPass, tc.privKeys...) if tc.expPass { require.NoError(t, err) @@ -308,7 +308,7 @@ func TestMsgMultiSendMultipleOut(t *testing.T) { for _, tc := range testCases { header := tmproto.Header{Height: app.LastBlockHeight() + 1} - txGen := simapp.MakeEncodingConfig().TxConfig + txGen := simapp.MakeTestEncodingConfig().TxConfig _, _, err := simapp.SignCheckDeliver(t, txGen, app.BaseApp, header, tc.msgs, "", tc.accNums, tc.accSeqs, tc.expSimPass, tc.expPass, tc.privKeys...) require.NoError(t, err) @@ -363,7 +363,7 @@ func TestMsgMultiSendMultipleInOut(t *testing.T) { for _, tc := range testCases { header := tmproto.Header{Height: app.LastBlockHeight() + 1} - txGen := simapp.MakeEncodingConfig().TxConfig + txGen := simapp.MakeTestEncodingConfig().TxConfig _, _, err := simapp.SignCheckDeliver(t, txGen, app.BaseApp, header, tc.msgs, "", tc.accNums, tc.accSeqs, tc.expSimPass, tc.expPass, tc.privKeys...) require.NoError(t, err) @@ -416,7 +416,7 @@ func TestMsgMultiSendDependent(t *testing.T) { for _, tc := range testCases { header := tmproto.Header{Height: app.LastBlockHeight() + 1} - txGen := simapp.MakeEncodingConfig().TxConfig + txGen := simapp.MakeTestEncodingConfig().TxConfig _, _, err := simapp.SignCheckDeliver(t, txGen, app.BaseApp, header, tc.msgs, "", tc.accNums, tc.accSeqs, tc.expSimPass, tc.expPass, tc.privKeys...) require.NoError(t, err) diff --git a/x/bank/bench_test.go b/x/bank/bench_test.go index 58761365b7..f1affb9d99 100644 --- a/x/bank/bench_test.go +++ b/x/bank/bench_test.go @@ -33,7 +33,7 @@ func BenchmarkOneBankSendTxPerBlock(b *testing.B) { require.NoError(b, err) benchmarkApp.Commit() - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig // Precompute all txs txs, err := simapp.GenSequenceOfTxs(txGen, []sdk.Msg{sendMsg1}, []uint64{0}, []uint64{uint64(0)}, b.N, priv1) @@ -75,7 +75,7 @@ func BenchmarkOneBankMultiSendTxPerBlock(b *testing.B) { require.NoError(b, err) benchmarkApp.Commit() - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig // Precompute all txs txs, err := simapp.GenSequenceOfTxs(txGen, []sdk.Msg{multiSendMsg1}, []uint64{0}, []uint64{uint64(0)}, b.N, priv1) diff --git a/x/bank/client/rest/tx_test.go b/x/bank/client/rest/tx_test.go index 0e52408fed..d770ebec3d 100644 --- a/x/bank/client/rest/tx_test.go +++ b/x/bank/client/rest/tx_test.go @@ -18,7 +18,7 @@ import ( ) func (s *IntegrationTestSuite) TestCoinSend() { - encodingConfig := simapp.MakeEncodingConfig() + encodingConfig := simapp.MakeTestEncodingConfig() authclient.Codec = encodingConfig.Marshaler val := s.network.Validators[0] diff --git a/x/bank/legacy/v040/migrate_test.go b/x/bank/legacy/v040/migrate_test.go index 99ea461ff7..9b458e1209 100644 --- a/x/bank/legacy/v040/migrate_test.go +++ b/x/bank/legacy/v040/migrate_test.go @@ -16,7 +16,7 @@ import ( ) func TestMigrate(t *testing.T) { - encodingConfig := simapp.MakeEncodingConfig() + encodingConfig := simapp.MakeTestEncodingConfig() clientCtx := client.Context{}. WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). diff --git a/x/bank/simulation/operations.go b/x/bank/simulation/operations.go index 0f7d119498..c1e64d80d5 100644 --- a/x/bank/simulation/operations.go +++ b/x/bank/simulation/operations.go @@ -108,7 +108,7 @@ func sendMsgSend( return err } } - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, @@ -265,7 +265,7 @@ func sendMsgMultiSend( } } - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, diff --git a/x/crisis/handler_test.go b/x/crisis/handler_test.go index c533b01af6..6d65b87646 100644 --- a/x/crisis/handler_test.go +++ b/x/crisis/handler_test.go @@ -27,7 +27,7 @@ var ( func createTestApp() (*simapp.SimApp, sdk.Context, []sdk.AccAddress) { db := dbm.NewMemDB() - app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, simapp.DefaultNodeHome, 1, simapp.MakeEncodingConfig()) + app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, simapp.DefaultNodeHome, 1, simapp.MakeTestEncodingConfig()) ctx := app.NewContext(true, tmproto.Header{}) constantFee := sdk.NewInt64Coin(sdk.DefaultBondDenom, 10) diff --git a/x/distribution/client/cli/tx_test.go b/x/distribution/client/cli/tx_test.go index 550943e1c4..4a21a534e9 100644 --- a/x/distribution/client/cli/tx_test.go +++ b/x/distribution/client/cli/tx_test.go @@ -65,7 +65,7 @@ func Test_splitAndCall_Splitting(t *testing.T) { } func TestParseProposal(t *testing.T) { - encodingConfig := params.MakeEncodingConfig() + encodingConfig := params.MakeTestEncodingConfig() okJSON, cleanup := testutil.WriteToNewTempFile(t, ` { diff --git a/x/distribution/simulation/operations.go b/x/distribution/simulation/operations.go index ff0d0d4ef5..09090d1f64 100644 --- a/x/distribution/simulation/operations.go +++ b/x/distribution/simulation/operations.go @@ -100,7 +100,7 @@ func SimulateMsgSetWithdrawAddress(ak types.AccountKeeper, bk types.BankKeeper, msg := types.NewMsgSetWithdrawAddress(simAccount.Address, simToAccount.Address) - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, @@ -152,7 +152,7 @@ func SimulateMsgWithdrawDelegatorReward(ak types.AccountKeeper, bk types.BankKee msg := types.NewMsgWithdrawDelegatorReward(simAccount.Address, validator.GetOperator()) - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, @@ -207,7 +207,7 @@ func SimulateMsgWithdrawValidatorCommission(ak types.AccountKeeper, bk types.Ban msg := types.NewMsgWithdrawValidatorCommission(validator.GetOperator()) - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, @@ -262,7 +262,7 @@ func SimulateMsgFundCommunityPool(ak types.AccountKeeper, bk types.BankKeeper, k } msg := types.NewMsgFundCommunityPool(fundAmount, funder.Address) - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, diff --git a/x/evidence/legacy/v040/migrate_test.go b/x/evidence/legacy/v040/migrate_test.go index a9c23093f4..99260f0268 100644 --- a/x/evidence/legacy/v040/migrate_test.go +++ b/x/evidence/legacy/v040/migrate_test.go @@ -13,7 +13,7 @@ import ( ) func TestMigrate(t *testing.T) { - encodingConfig := simapp.MakeEncodingConfig() + encodingConfig := simapp.MakeTestEncodingConfig() clientCtx := client.Context{}. WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). diff --git a/x/genutil/gentx_test.go b/x/genutil/gentx_test.go index 671431ed9e..b4b843bc98 100644 --- a/x/genutil/gentx_test.go +++ b/x/genutil/gentx_test.go @@ -47,7 +47,7 @@ func (suite *GenTxTestSuite) SetupTest() { app := simapp.Setup(checkTx) suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{}) suite.app = app - suite.encodingConfig = simapp.MakeEncodingConfig() + suite.encodingConfig = simapp.MakeTestEncodingConfig() var err error amount := sdk.NewInt64Coin(sdk.DefaultBondDenom, 50) diff --git a/x/genutil/types/genesis_state_test.go b/x/genutil/types/genesis_state_test.go index ce0015420d..01e1db9fd3 100644 --- a/x/genutil/types/genesis_state_test.go +++ b/x/genutil/types/genesis_state_test.go @@ -45,14 +45,14 @@ func TestValidateGenesisMultipleMessages(t *testing.T) { sdk.NewInt64Coin(sdk.DefaultBondDenom, 50), desc, comm, sdk.OneInt()) require.NoError(t, err) - txGen := simapp.MakeEncodingConfig().TxConfig + txGen := simapp.MakeTestEncodingConfig().TxConfig txBuilder := txGen.NewTxBuilder() require.NoError(t, txBuilder.SetMsgs(msg1, msg2)) tx := txBuilder.GetTx() genesisState := types.NewGenesisStateFromTx(txGen.TxJSONEncoder(), []sdk.Tx{tx}) - err = types.ValidateGenesis(genesisState, simapp.MakeEncodingConfig().TxConfig.TxJSONDecoder()) + err = types.ValidateGenesis(genesisState, simapp.MakeTestEncodingConfig().TxConfig.TxJSONDecoder()) require.Error(t, err) } @@ -61,7 +61,7 @@ func TestValidateGenesisBadMessage(t *testing.T) { msg1 := stakingtypes.NewMsgEditValidator(sdk.ValAddress(pk1.Address()), desc, nil, nil) - txGen := simapp.MakeEncodingConfig().TxConfig + txGen := simapp.MakeTestEncodingConfig().TxConfig txBuilder := txGen.NewTxBuilder() err := txBuilder.SetMsgs(msg1) require.NoError(t, err) @@ -69,7 +69,7 @@ func TestValidateGenesisBadMessage(t *testing.T) { tx := txBuilder.GetTx() genesisState := types.NewGenesisStateFromTx(txGen.TxJSONEncoder(), []sdk.Tx{tx}) - err = types.ValidateGenesis(genesisState, simapp.MakeEncodingConfig().TxConfig.TxJSONDecoder()) + err = types.ValidateGenesis(genesisState, simapp.MakeTestEncodingConfig().TxConfig.TxJSONDecoder()) require.Error(t, err) } diff --git a/x/gov/client/utils/query_test.go b/x/gov/client/utils/query_test.go index c6f999e86e..81b15a457f 100644 --- a/x/gov/client/utils/query_test.go +++ b/x/gov/client/utils/query_test.go @@ -147,7 +147,7 @@ func TestGetPaginatedVotes(t *testing.T) { cdc = newTestCodec() ) - encodingConfig := simapp.MakeEncodingConfig() + encodingConfig := simapp.MakeTestEncodingConfig() cli := TxSearchMock{txs: marshalled} clientCtx := client.Context{}. WithLegacyAmino(cdc). diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index ca1655ecba..f4f548c26a 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -68,7 +68,7 @@ func TestImportExportQueues(t *testing.T) { } db := dbm.NewMemDB() - app2 := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, simapp.DefaultNodeHome, 0, simapp.MakeEncodingConfig()) + app2 := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, simapp.DefaultNodeHome, 0, simapp.MakeTestEncodingConfig()) app2.InitChain( abci.RequestInitChain{ diff --git a/x/gov/legacy/v040/migrate_test.go b/x/gov/legacy/v040/migrate_test.go index beefa9de57..84c6a554af 100644 --- a/x/gov/legacy/v040/migrate_test.go +++ b/x/gov/legacy/v040/migrate_test.go @@ -15,7 +15,7 @@ import ( ) func TestMigrate(t *testing.T) { - encodingConfig := simapp.MakeEncodingConfig() + encodingConfig := simapp.MakeTestEncodingConfig() clientCtx := client.Context{}. WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 0dedf64888..2ea89ca97b 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -142,7 +142,7 @@ func SimulateMsgSubmitProposal( } } - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, @@ -229,7 +229,7 @@ func SimulateMsgDeposit(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Ke } } - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, @@ -291,7 +291,7 @@ func operationSimulateMsgVote(ak types.AccountKeeper, bk types.BankKeeper, k kee return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate fees"), nil, err } - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, diff --git a/x/ibc/testing/chain.go b/x/ibc/testing/chain.go index ef1628d73c..923e6ae4eb 100644 --- a/x/ibc/testing/chain.go +++ b/x/ibc/testing/chain.go @@ -152,7 +152,7 @@ func NewTestChain(t *testing.T, chainID string) *TestChain { Time: globalStartTime, } - txConfig := simapp.MakeEncodingConfig().TxConfig + txConfig := simapp.MakeTestEncodingConfig().TxConfig // create an account to send transactions from chain := &TestChain{ diff --git a/x/params/keeper/common_test.go b/x/params/keeper/common_test.go index eb60d12b8b..f6d567db11 100644 --- a/x/params/keeper/common_test.go +++ b/x/params/keeper/common_test.go @@ -14,7 +14,7 @@ import ( ) func testComponents() (*codec.LegacyAmino, sdk.Context, sdk.StoreKey, sdk.StoreKey, paramskeeper.Keeper) { - marshaler := simapp.MakeEncodingConfig().Marshaler + marshaler := simapp.MakeTestEncodingConfig().Marshaler legacyAmino := createTestCodec() mkey := sdk.NewKVStoreKey("test") tkey := sdk.NewTransientStoreKey("transient_test") diff --git a/x/params/proposal_handler_test.go b/x/params/proposal_handler_test.go index b810a490cf..b4295d2e2d 100644 --- a/x/params/proposal_handler_test.go +++ b/x/params/proposal_handler_test.go @@ -76,7 +76,7 @@ func newTestInput(t *testing.T) testInput { err := cms.LoadLatestVersion() require.Nil(t, err) - encCfg := simapp.MakeEncodingConfig() + encCfg := simapp.MakeTestEncodingConfig() keeper := keeper.NewKeeper(encCfg.Marshaler, encCfg.Amino, keyParams, tKeyParams) ctx := sdk.NewContext(cms, tmproto.Header{}, false, log.NewNopLogger()) diff --git a/x/params/types/subspace_test.go b/x/params/types/subspace_test.go index f9a816641f..ed508d00e9 100644 --- a/x/params/types/subspace_test.go +++ b/x/params/types/subspace_test.go @@ -34,7 +34,7 @@ func (suite *SubspaceTestSuite) SetupTest() { ms.MountStoreWithDB(tkey, sdk.StoreTypeTransient, db) suite.NoError(ms.LoadLatestVersion()) - encCfg := simapp.MakeEncodingConfig() + encCfg := simapp.MakeTestEncodingConfig() ss := types.NewSubspace(encCfg.Marshaler, encCfg.Amino, key, tkey, "testsubspace") suite.cdc = encCfg.Marshaler diff --git a/x/slashing/app_test.go b/x/slashing/app_test.go index f16bfb36f1..5ee23b7cc5 100644 --- a/x/slashing/app_test.go +++ b/x/slashing/app_test.go @@ -69,7 +69,7 @@ func TestSlashingMsgs(t *testing.T) { require.NoError(t, err) header := tmproto.Header{Height: app.LastBlockHeight() + 1} - txGen := simapp.MakeEncodingConfig().TxConfig + txGen := simapp.MakeTestEncodingConfig().TxConfig _, _, err = simapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{createValidatorMsg}, "", []uint64{0}, []uint64{0}, true, true, priv1) require.NoError(t, err) simapp.CheckBalance(t, app, addr1, sdk.Coins{genCoin.Sub(bondCoin)}) diff --git a/x/slashing/legacy/v040/migrate_test.go b/x/slashing/legacy/v040/migrate_test.go index 513627659d..016f3f4d44 100644 --- a/x/slashing/legacy/v040/migrate_test.go +++ b/x/slashing/legacy/v040/migrate_test.go @@ -14,7 +14,7 @@ import ( ) func TestMigrate(t *testing.T) { - encodingConfig := simapp.MakeEncodingConfig() + encodingConfig := simapp.MakeTestEncodingConfig() clientCtx := client.Context{}. WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). diff --git a/x/slashing/simulation/operations.go b/x/slashing/simulation/operations.go index de95c0136b..d637007277 100644 --- a/x/slashing/simulation/operations.go +++ b/x/slashing/simulation/operations.go @@ -90,7 +90,7 @@ func SimulateMsgUnjail(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Kee msg := types.NewMsgUnjail(validator.GetOperator()) - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, diff --git a/x/staking/app_test.go b/x/staking/app_test.go index 1c60ec5027..207ac03e0c 100644 --- a/x/staking/app_test.go +++ b/x/staking/app_test.go @@ -71,7 +71,7 @@ func TestStakingMsgs(t *testing.T) { require.NoError(t, err) header := tmproto.Header{Height: app.LastBlockHeight() + 1} - txGen := simapp.MakeEncodingConfig().TxConfig + txGen := simapp.MakeTestEncodingConfig().TxConfig _, _, err = simapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{createValidatorMsg}, "", []uint64{0}, []uint64{0}, true, true, priv1) require.NoError(t, err) simapp.CheckBalance(t, app, addr1, sdk.Coins{genCoin.Sub(bondCoin)}) diff --git a/x/staking/legacy/v040/migrate_test.go b/x/staking/legacy/v040/migrate_test.go index f54fec0e94..2be5e80dbc 100644 --- a/x/staking/legacy/v040/migrate_test.go +++ b/x/staking/legacy/v040/migrate_test.go @@ -15,7 +15,7 @@ import ( ) func TestMigrate(t *testing.T) { - encodingConfig := simapp.MakeEncodingConfig() + encodingConfig := simapp.MakeTestEncodingConfig() clientCtx := client.Context{}. WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). diff --git a/x/staking/simulation/operations.go b/x/staking/simulation/operations.go index a153b26307..0bcb274ed7 100644 --- a/x/staking/simulation/operations.go +++ b/x/staking/simulation/operations.go @@ -153,7 +153,7 @@ func SimulateMsgCreateValidator(ak types.AccountKeeper, bk types.BankKeeper, k k return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to create CreateValidator message"), nil, err } - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, @@ -224,7 +224,7 @@ func SimulateMsgEditValidator(ak types.AccountKeeper, bk types.BankKeeper, k kee msg := types.NewMsgEditValidator(address, description, &newCommissionRate, nil) - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, @@ -297,7 +297,7 @@ func SimulateMsgDelegate(ak types.AccountKeeper, bk types.BankKeeper, k keeper.K msg := types.NewMsgDelegate(simAccount.Address, val.GetOperator(), bondAmt) - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, @@ -387,7 +387,7 @@ func SimulateMsgUndelegate(ak types.AccountKeeper, bk types.BankKeeper, k keeper return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate fees"), nil, err } - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, @@ -500,7 +500,7 @@ func SimulateMsgBeginRedelegate(ak types.AccountKeeper, bk types.BankKeeper, k k sdk.NewCoin(k.BondDenom(ctx), redAmt), ) - txGen := simappparams.MakeEncodingConfig().TxConfig + txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( txGen, []sdk.Msg{msg}, diff --git a/x/upgrade/abci_test.go b/x/upgrade/abci_test.go index 48ad99301e..a133cad5a2 100644 --- a/x/upgrade/abci_test.go +++ b/x/upgrade/abci_test.go @@ -40,7 +40,7 @@ var s TestSuite func setupTest(height int64, skip map[int64]bool) TestSuite { db := dbm.NewMemDB() - app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, skip, simapp.DefaultNodeHome, 0, simapp.MakeEncodingConfig()) + app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, skip, simapp.DefaultNodeHome, 0, simapp.MakeTestEncodingConfig()) genesisState := simapp.NewDefaultGenesisState() stateBytes, err := json.MarshalIndent(genesisState, "", " ") if err != nil { From 48c72230f0086f310b1fc5678737e3ade152e311 Mon Sep 17 00:00:00 2001 From: Aditya Date: Tue, 27 Oct 2020 11:48:28 +0000 Subject: [PATCH 78/84] Create separate Write-Ack Event (#7683) * use separate type for write ack * change event-type Co-authored-by: Christopher Goes Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- x/ibc/core/04-channel/keeper/packet.go | 10 +++++++++- x/ibc/core/04-channel/types/events.go | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/x/ibc/core/04-channel/keeper/packet.go b/x/ibc/core/04-channel/keeper/packet.go index 2f662c8021..d1d7b63920 100644 --- a/x/ibc/core/04-channel/keeper/packet.go +++ b/x/ibc/core/04-channel/keeper/packet.go @@ -367,7 +367,15 @@ func (k Keeper) WriteAcknowledgement( // emit an event that the relayer can query for ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( - types.EventTypeRecvPacket, + types.EventTypeWriteAck, + sdk.NewAttribute(types.AttributeKeyData, string(packet.GetData())), + sdk.NewAttribute(types.AttributeKeyTimeoutHeight, packet.GetTimeoutHeight().String()), + sdk.NewAttribute(types.AttributeKeyTimeoutTimestamp, fmt.Sprintf("%d", packet.GetTimeoutTimestamp())), + sdk.NewAttribute(types.AttributeKeySequence, fmt.Sprintf("%d", packet.GetSequence())), + sdk.NewAttribute(types.AttributeKeySrcPort, packet.GetSourcePort()), + sdk.NewAttribute(types.AttributeKeySrcChannel, packet.GetSourceChannel()), + sdk.NewAttribute(types.AttributeKeyDstPort, packet.GetDestPort()), + sdk.NewAttribute(types.AttributeKeyDstChannel, packet.GetDestChannel()), sdk.NewAttribute(types.AttributeKeyAck, string(acknowledgement)), ), sdk.NewEvent( diff --git a/x/ibc/core/04-channel/types/events.go b/x/ibc/core/04-channel/types/events.go index 66c1d078ee..923587d439 100644 --- a/x/ibc/core/04-channel/types/events.go +++ b/x/ibc/core/04-channel/types/events.go @@ -16,6 +16,7 @@ const ( EventTypeSendPacket = "send_packet" EventTypeRecvPacket = "recv_packet" + EventTypeWriteAck = "write_acknowledgement" EventTypeAcknowledgePacket = "acknowledge_packet" EventTypeTimeoutPacket = "timeout_packet" From 9befc6ced86398204381264901590ba7bf2e924f Mon Sep 17 00:00:00 2001 From: Jack Zampolin Date: Tue, 27 Oct 2020 06:53:54 -0700 Subject: [PATCH 79/84] Wrap ProtoCodec in interface (#7637) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * WIP encoding change * Add test that describes issue * WIP debugging * remove extra code * Update codec/proto_codec.go Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> --- codec/proto_codec.go | 8 ++++++++ x/auth/tx/config.go | 4 ++-- x/auth/tx/decoder.go | 4 ++-- x/auth/tx/encoder.go | 2 +- x/ibc/core/03-connection/types/codec.go | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/codec/proto_codec.go b/codec/proto_codec.go index c9123f5d75..e77409fe48 100644 --- a/codec/proto_codec.go +++ b/codec/proto_codec.go @@ -11,6 +11,13 @@ import ( "github.com/gogo/protobuf/proto" ) +// ProtoCodecMarshaler defines an interface for codecs that utilize Protobuf for both +// binary and JSON encoding. +type ProtoCodecMarshaler interface { + Marshaler + InterfaceRegistry() types.InterfaceRegistry +} + // ProtoCodec defines a codec that utilizes Protobuf for both binary and JSON // encoding. type ProtoCodec struct { @@ -18,6 +25,7 @@ type ProtoCodec struct { } var _ Marshaler = &ProtoCodec{} +var _ ProtoCodecMarshaler = &ProtoCodec{} // NewProtoCodec returns a reference to a new ProtoCodec func NewProtoCodec(interfaceRegistry types.InterfaceRegistry) *ProtoCodec { diff --git a/x/auth/tx/config.go b/x/auth/tx/config.go index b7ca179a84..8402423dbf 100644 --- a/x/auth/tx/config.go +++ b/x/auth/tx/config.go @@ -18,12 +18,12 @@ type config struct { encoder sdk.TxEncoder jsonDecoder sdk.TxDecoder jsonEncoder sdk.TxEncoder - protoCodec *codec.ProtoCodec + protoCodec codec.ProtoCodecMarshaler } // NewTxConfig returns a new protobuf TxConfig using the provided ProtoCodec and sign modes. The // first enabled sign mode will become the default sign mode. -func NewTxConfig(protoCodec *codec.ProtoCodec, enabledSignModes []signingtypes.SignMode) client.TxConfig { +func NewTxConfig(protoCodec codec.ProtoCodecMarshaler, enabledSignModes []signingtypes.SignMode) client.TxConfig { return &config{ handler: makeSignModeHandler(enabledSignModes), decoder: DefaultTxDecoder(protoCodec), diff --git a/x/auth/tx/decoder.go b/x/auth/tx/decoder.go index 59ba8467eb..5f48ddd3aa 100644 --- a/x/auth/tx/decoder.go +++ b/x/auth/tx/decoder.go @@ -9,7 +9,7 @@ import ( ) // DefaultTxDecoder returns a default protobuf TxDecoder using the provided Marshaler. -func DefaultTxDecoder(cdc *codec.ProtoCodec) sdk.TxDecoder { +func DefaultTxDecoder(cdc codec.ProtoCodecMarshaler) sdk.TxDecoder { return func(txBytes []byte) (sdk.Tx, error) { var raw tx.TxRaw @@ -66,7 +66,7 @@ func DefaultTxDecoder(cdc *codec.ProtoCodec) sdk.TxDecoder { } // DefaultJSONTxDecoder returns a default protobuf JSON TxDecoder using the provided Marshaler. -func DefaultJSONTxDecoder(cdc *codec.ProtoCodec) sdk.TxDecoder { +func DefaultJSONTxDecoder(cdc codec.ProtoCodecMarshaler) sdk.TxDecoder { return func(txBytes []byte) (sdk.Tx, error) { var theTx tx.Tx err := cdc.UnmarshalJSON(txBytes, &theTx) diff --git a/x/auth/tx/encoder.go b/x/auth/tx/encoder.go index 5655df7686..35cecac556 100644 --- a/x/auth/tx/encoder.go +++ b/x/auth/tx/encoder.go @@ -29,7 +29,7 @@ func DefaultTxEncoder() sdk.TxEncoder { } // DefaultJSONTxEncoder returns a default protobuf JSON TxEncoder using the provided Marshaler. -func DefaultJSONTxEncoder(cdc *codec.ProtoCodec) sdk.TxEncoder { +func DefaultJSONTxEncoder(cdc codec.ProtoCodecMarshaler) sdk.TxEncoder { return func(tx sdk.Tx) ([]byte, error) { txWrapper, ok := tx.(*wrapper) if ok { diff --git a/x/ibc/core/03-connection/types/codec.go b/x/ibc/core/03-connection/types/codec.go index dec4826210..9caa35332b 100644 --- a/x/ibc/core/03-connection/types/codec.go +++ b/x/ibc/core/03-connection/types/codec.go @@ -39,7 +39,7 @@ var ( // SubModuleCdc references the global x/ibc/core/03-connection module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // - // The actual codec used for serialization should be provided to x/ibc/core/03-connectionl and + // The actual codec used for serialization should be provided to x/ibc/core/03-connection and // defined at the application level. SubModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) ) From 7ccd2675d737e1ff88d017018f8fb54d711c6e93 Mon Sep 17 00:00:00 2001 From: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Date: Tue, 27 Oct 2020 15:14:07 +0100 Subject: [PATCH 80/84] ibc: refactor proto files (#7689) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .../applications/transfer/v1/transfer.proto | 37 - proto/ibc/applications/transfer/v1/tx.proto | 43 + proto/ibc/core/channel/v1/channel.proto | 199 - proto/ibc/core/channel/v1/tx.proto | 207 + proto/ibc/core/connection/v1/connection.proto | 106 - proto/ibc/core/connection/v1/tx.proto | 113 + .../transfer/types/transfer.pb.go | 713 +-- x/ibc/applications/transfer/types/tx.pb.go | 810 +++ x/ibc/core/02-client/types/client.pb.go | 2 +- .../core/03-connection/types/connection.pb.go | 2747 +-------- x/ibc/core/03-connection/types/tx.pb.go | 2806 +++++++++ x/ibc/core/04-channel/types/channel.pb.go | 5378 +--------------- x/ibc/core/04-channel/types/tx.pb.go | 5405 +++++++++++++++++ x/staking/types/staking.pb.go | 1421 ++--- x/staking/types/tx.pb.go | 110 +- 15 files changed, 10290 insertions(+), 9807 deletions(-) create mode 100644 proto/ibc/applications/transfer/v1/tx.proto create mode 100644 proto/ibc/core/channel/v1/tx.proto create mode 100644 proto/ibc/core/connection/v1/tx.proto create mode 100644 x/ibc/applications/transfer/types/tx.pb.go create mode 100644 x/ibc/core/03-connection/types/tx.pb.go create mode 100644 x/ibc/core/04-channel/types/tx.pb.go diff --git a/proto/ibc/applications/transfer/v1/transfer.proto b/proto/ibc/applications/transfer/v1/transfer.proto index 1ebc884542..b388c3b879 100644 --- a/proto/ibc/applications/transfer/v1/transfer.proto +++ b/proto/ibc/applications/transfer/v1/transfer.proto @@ -4,43 +4,6 @@ package ibc.applications.transfer.v1; option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/types"; import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "ibc/core/client/v1/client.proto"; - -// Msg defines the ibc/transfer Msg service. -service Msg { - // Transfer defines a rpc handler method for MsgTransfer. - rpc Transfer(MsgTransfer) returns (MsgTransferResponse); -} - -// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between -// ICS20 enabled chains. See ICS Spec here: -// https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures -message MsgTransfer { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // 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\""]; - // the tokens to be transferred - cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false]; - // the sender address - string sender = 4; - // the recipient address on the destination chain - string receiver = 5; - // Timeout height relative to the current block height. - // The timeout is disabled when set to 0. - ibc.core.client.v1.Height timeout_height = 6 - [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; - // Timeout timestamp (in nanoseconds) relative to the current block timestamp. - // The timeout is disabled when set to 0. - uint64 timeout_timestamp = 7 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; -} - -// MsgTransferResponse defines the Msg/Transfer response type. -message MsgTransferResponse { } // FungibleTokenPacketData defines a struct for the packet payload // See FungibleTokenPacketData spec: diff --git a/proto/ibc/applications/transfer/v1/tx.proto b/proto/ibc/applications/transfer/v1/tx.proto new file mode 100644 index 0000000000..eb2e12e5df --- /dev/null +++ b/proto/ibc/applications/transfer/v1/tx.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "ibc/core/client/v1/client.proto"; + +// Msg defines the ibc/transfer Msg service. +service Msg { + // Transfer defines a rpc handler method for MsgTransfer. + rpc Transfer(MsgTransfer) returns (MsgTransferResponse); +} + +// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between +// ICS20 enabled chains. See ICS Spec here: +// https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures +message MsgTransfer { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // 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\""]; + // the tokens to be transferred + cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false]; + // the sender address + string sender = 4; + // the recipient address on the destination chain + string receiver = 5; + // Timeout height relative to the current block height. + // The timeout is disabled when set to 0. + ibc.core.client.v1.Height timeout_height = 6 + [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + // Timeout timestamp (in nanoseconds) relative to the current block timestamp. + // The timeout is disabled when set to 0. + uint64 timeout_timestamp = 7 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; +} + +// MsgTransferResponse defines the Msg/Transfer response type. +message MsgTransferResponse { } diff --git a/proto/ibc/core/channel/v1/channel.proto b/proto/ibc/core/channel/v1/channel.proto index 41414e8c23..376ce9764e 100644 --- a/proto/ibc/core/channel/v1/channel.proto +++ b/proto/ibc/core/channel/v1/channel.proto @@ -6,205 +6,6 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; -// Msg defines the ibc/channel Msg service. -service Msg { - // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. - rpc ChannelOpenInit(MsgChannelOpenInit) returns (MsgChannelOpenInitResponse); - - // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. - rpc ChannelOpenTry(MsgChannelOpenTry) returns (MsgChannelOpenTryResponse); - - // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. - rpc ChannelOpenAck(MsgChannelOpenAck) returns (MsgChannelOpenAckResponse); - - // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. - rpc ChannelOpenConfirm(MsgChannelOpenConfirm) returns (MsgChannelOpenConfirmResponse); - - // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. - rpc ChannelCloseInit(MsgChannelCloseInit) returns (MsgChannelCloseInitResponse); - - // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. - rpc ChannelCloseConfirm(MsgChannelCloseConfirm) returns (MsgChannelCloseConfirmResponse); - - // RecvPacket defines a rpc handler method for MsgRecvPacket. - rpc RecvPacket(MsgRecvPacket) returns (MsgRecvPacketResponse); - - // Timeout defines a rpc handler method for MsgTimeout. - rpc Timeout(MsgTimeout) returns (MsgTimeoutResponse); - - // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. - rpc TimeoutOnClose(MsgTimeoutOnClose) returns (MsgTimeoutOnCloseResponse); - - // Acknowledgement defines a rpc handler method for MsgAcknowledgement. - rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); -} - -// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It -// is called by a relayer on Chain A. -message MsgChannelOpenInit { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - Channel channel = 3 [(gogoproto.nullable) = false]; - string signer = 4; -} - -// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. -message MsgChannelOpenInitResponse {} - -// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel -// on Chain B. -message MsgChannelOpenTry { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string desired_channel_id = 2 [(gogoproto.moretags) = "yaml:\"desired_channel_id\""]; - string counterparty_chosen_channel_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_chosen_channel_id\""]; - Channel channel = 4 [(gogoproto.nullable) = false]; - string counterparty_version = 5 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; - bytes proof_init = 6 [(gogoproto.moretags) = "yaml:\"proof_init\""]; - ibc.core.client.v1.Height proof_height = 7 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 8; -} - -// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. -message MsgChannelOpenTryResponse {} - -// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge -// the change of channel state to TRYOPEN on Chain B. -message MsgChannelOpenAck { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - string counterparty_channel_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; - string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; - bytes proof_try = 5 [(gogoproto.moretags) = "yaml:\"proof_try\""]; - ibc.core.client.v1.Height proof_height = 6 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 7; -} - -// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. -message MsgChannelOpenAckResponse {} - -// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to -// acknowledge the change of channel state to OPEN on Chain A. -message MsgChannelOpenConfirm { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - bytes proof_ack = 3 [(gogoproto.moretags) = "yaml:\"proof_ack\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; -} - -// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response type. -message MsgChannelOpenConfirmResponse {} - -// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A -// to close a channel with Chain B. -message MsgChannelCloseInit { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - string signer = 3; -} - -// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. -message MsgChannelCloseInitResponse {} - -// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B -// to acknowledge the change of channel state to CLOSED on Chain A. -message MsgChannelCloseConfirm { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - bytes proof_init = 3 [(gogoproto.moretags) = "yaml:\"proof_init\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; -} - -// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response type. -message MsgChannelCloseConfirmResponse {} - -// MsgRecvPacket receives incoming IBC packet -message MsgRecvPacket { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof = 2; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 4; -} - -// MsgRecvPacketResponse defines the Msg/RecvPacket response type. -message MsgRecvPacketResponse {} - -// MsgTimeout receives timed-out packet -message MsgTimeout { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof = 2; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - uint64 next_sequence_recv = 4 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""]; - string signer = 5; -} - -// MsgTimeoutResponse defines the Msg/Timeout response type. -message MsgTimeoutResponse {} - -// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. -message MsgTimeoutOnClose { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof = 2; - bytes proof_close = 3 [(gogoproto.moretags) = "yaml:\"proof_close\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - uint64 next_sequence_recv = 5 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""]; - string signer = 6; -} - -// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. -message MsgTimeoutOnCloseResponse {} - -// MsgAcknowledgement receives incoming IBC acknowledgement -message MsgAcknowledgement { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - Packet packet = 1 [(gogoproto.nullable) = false]; - bytes acknowledgement = 2; - bytes proof = 3; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; -} - -// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. -message MsgAcknowledgementResponse {} - // Channel defines pipeline for exactly-once packet delivery between specific // modules on separate blockchains, which has at least one end capable of // sending packets and one end capable of receiving packets. diff --git a/proto/ibc/core/channel/v1/tx.proto b/proto/ibc/core/channel/v1/tx.proto new file mode 100644 index 0000000000..0426c741b9 --- /dev/null +++ b/proto/ibc/core/channel/v1/tx.proto @@ -0,0 +1,207 @@ +syntax = "proto3"; +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// Msg defines the ibc/channel Msg service. +service Msg { + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + rpc ChannelOpenInit(MsgChannelOpenInit) returns (MsgChannelOpenInitResponse); + + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + rpc ChannelOpenTry(MsgChannelOpenTry) returns (MsgChannelOpenTryResponse); + + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + rpc ChannelOpenAck(MsgChannelOpenAck) returns (MsgChannelOpenAckResponse); + + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + rpc ChannelOpenConfirm(MsgChannelOpenConfirm) returns (MsgChannelOpenConfirmResponse); + + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + rpc ChannelCloseInit(MsgChannelCloseInit) returns (MsgChannelCloseInitResponse); + + // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. + rpc ChannelCloseConfirm(MsgChannelCloseConfirm) returns (MsgChannelCloseConfirmResponse); + + // RecvPacket defines a rpc handler method for MsgRecvPacket. + rpc RecvPacket(MsgRecvPacket) returns (MsgRecvPacketResponse); + + // Timeout defines a rpc handler method for MsgTimeout. + rpc Timeout(MsgTimeout) returns (MsgTimeoutResponse); + + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + rpc TimeoutOnClose(MsgTimeoutOnClose) returns (MsgTimeoutOnCloseResponse); + + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); +} + +// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It +// is called by a relayer on Chain A. +message MsgChannelOpenInit { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + Channel channel = 3 [(gogoproto.nullable) = false]; + string signer = 4; +} + +// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +message MsgChannelOpenInitResponse {} + +// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +// on Chain B. +message MsgChannelOpenTry { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string desired_channel_id = 2 [(gogoproto.moretags) = "yaml:\"desired_channel_id\""]; + string counterparty_chosen_channel_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_chosen_channel_id\""]; + Channel channel = 4 [(gogoproto.nullable) = false]; + string counterparty_version = 5 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; + bytes proof_init = 6 [(gogoproto.moretags) = "yaml:\"proof_init\""]; + ibc.core.client.v1.Height proof_height = 7 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string signer = 8; +} + +// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +message MsgChannelOpenTryResponse {} + +// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge +// the change of channel state to TRYOPEN on Chain B. +message MsgChannelOpenAck { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string counterparty_channel_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; + string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; + bytes proof_try = 5 [(gogoproto.moretags) = "yaml:\"proof_try\""]; + ibc.core.client.v1.Height proof_height = 6 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string signer = 7; +} + +// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. +message MsgChannelOpenAckResponse {} + +// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to +// acknowledge the change of channel state to OPEN on Chain A. +message MsgChannelOpenConfirm { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + bytes proof_ack = 3 [(gogoproto.moretags) = "yaml:\"proof_ack\""]; + ibc.core.client.v1.Height proof_height = 4 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string signer = 5; +} + +// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response type. +message MsgChannelOpenConfirmResponse {} + +// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A +// to close a channel with Chain B. +message MsgChannelCloseInit { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string signer = 3; +} + +// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +message MsgChannelCloseInitResponse {} + +// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B +// to acknowledge the change of channel state to CLOSED on Chain A. +message MsgChannelCloseConfirm { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + bytes proof_init = 3 [(gogoproto.moretags) = "yaml:\"proof_init\""]; + ibc.core.client.v1.Height proof_height = 4 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string signer = 5; +} + +// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response type. +message MsgChannelCloseConfirmResponse {} + +// MsgRecvPacket receives incoming IBC packet +message MsgRecvPacket { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof = 2; + ibc.core.client.v1.Height proof_height = 3 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string signer = 4; +} + +// MsgRecvPacketResponse defines the Msg/RecvPacket response type. +message MsgRecvPacketResponse {} + +// MsgTimeout receives timed-out packet +message MsgTimeout { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof = 2; + ibc.core.client.v1.Height proof_height = 3 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + uint64 next_sequence_recv = 4 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""]; + string signer = 5; +} + +// MsgTimeoutResponse defines the Msg/Timeout response type. +message MsgTimeoutResponse {} + +// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. +message MsgTimeoutOnClose { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof = 2; + bytes proof_close = 3 [(gogoproto.moretags) = "yaml:\"proof_close\""]; + ibc.core.client.v1.Height proof_height = 4 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + uint64 next_sequence_recv = 5 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""]; + string signer = 6; +} + +// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. +message MsgTimeoutOnCloseResponse {} + +// MsgAcknowledgement receives incoming IBC acknowledgement +message MsgAcknowledgement { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes acknowledgement = 2; + bytes proof = 3; + ibc.core.client.v1.Height proof_height = 4 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string signer = 5; +} + +// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +message MsgAcknowledgementResponse {} diff --git a/proto/ibc/core/connection/v1/connection.proto b/proto/ibc/core/connection/v1/connection.proto index 5b0dd2fe5d..37c7609c37 100644 --- a/proto/ibc/core/connection/v1/connection.proto +++ b/proto/ibc/core/connection/v1/connection.proto @@ -4,113 +4,7 @@ package ibc.core.connection.v1; option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types"; import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; import "ibc/core/commitment/v1/commitment.proto"; -import "ibc/core/client/v1/client.proto"; - -// Msg defines the ibc/connection Msg service. -service Msg { - // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. - rpc ConnectionOpenInit(MsgConnectionOpenInit) returns (MsgConnectionOpenInitResponse); - - // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. - rpc ConnectionOpenTry(MsgConnectionOpenTry) returns (MsgConnectionOpenTryResponse); - - // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. - rpc ConnectionOpenAck(MsgConnectionOpenAck) returns (MsgConnectionOpenAckResponse); - - // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. - rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse); -} - -// MsgConnectionOpenInit defines the msg sent by an account on Chain A to -// initialize a connection with Chain B. -message MsgConnectionOpenInit { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - Counterparty counterparty = 3 [(gogoproto.nullable) = false]; - string version = 4; - string signer = 5; -} - -// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response type. -message MsgConnectionOpenInitResponse { } - -// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a -// connection on Chain B. -message MsgConnectionOpenTry { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - string desired_connection_id = 2 [(gogoproto.moretags) = "yaml:\"desired_connection_id\""]; - string counterparty_chosen_connection_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_chosen_connection_id\""]; - google.protobuf.Any client_state = 4 [(gogoproto.moretags) = "yaml:\"client_state\""]; - Counterparty counterparty = 5 [(gogoproto.nullable) = false]; - repeated string counterparty_versions = 6 [(gogoproto.moretags) = "yaml:\"counterparty_versions\""]; - ibc.core.client.v1.Height proof_height = 7 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - // proof of the initialization the connection on Chain A: `UNITIALIZED -> - // INIT` - bytes proof_init = 8 [(gogoproto.moretags) = "yaml:\"proof_init\""]; - // proof of client state included in message - bytes proof_client = 9 [(gogoproto.moretags) = "yaml:\"proof_client\""]; - // proof of client consensus state - bytes proof_consensus = 10 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; - ibc.core.client.v1.Height consensus_height = 11 - [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; - string signer = 12; -} - -// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. -message MsgConnectionOpenTryResponse { } - -// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to -// acknowledge the change of connection state to TRYOPEN on Chain B. -message MsgConnectionOpenAck { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string counterparty_connection_id = 2 [(gogoproto.moretags) = "yaml:\"counterparty_connection_id\""]; - string version = 3; - google.protobuf.Any client_state = 4 [(gogoproto.moretags) = "yaml:\"client_state\""]; - ibc.core.client.v1.Height proof_height = 5 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - // proof of the initialization the connection on Chain B: `UNITIALIZED -> - // TRYOPEN` - bytes proof_try = 6 [(gogoproto.moretags) = "yaml:\"proof_try\""]; - // proof of client state included in message - bytes proof_client = 7 [(gogoproto.moretags) = "yaml:\"proof_client\""]; - // proof of client consensus state - bytes proof_consensus = 8 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; - ibc.core.client.v1.Height consensus_height = 9 - [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; - string signer = 10; -} - -// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. -message MsgConnectionOpenAckResponse { } - -// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to -// acknowledge the change of connection state to OPEN on Chain A. -message MsgConnectionOpenConfirm { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - // proof for the change of the connection state on Chain A: `INIT -> OPEN` - bytes proof_ack = 2 [(gogoproto.moretags) = "yaml:\"proof_ack\""]; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 4; -} - -// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm response type. -message MsgConnectionOpenConfirmResponse { } // ICS03 - Connection Data Structures as defined in // https://github.com/cosmos/ics/tree/master/spec/ics-003-connection-semantics#data-structures diff --git a/proto/ibc/core/connection/v1/tx.proto b/proto/ibc/core/connection/v1/tx.proto new file mode 100644 index 0000000000..86f87b53e7 --- /dev/null +++ b/proto/ibc/core/connection/v1/tx.proto @@ -0,0 +1,113 @@ +syntax = "proto3"; +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/core/connection/v1/connection.proto"; + +// Msg defines the ibc/connection Msg service. +service Msg { + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + rpc ConnectionOpenInit(MsgConnectionOpenInit) returns (MsgConnectionOpenInitResponse); + + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + rpc ConnectionOpenTry(MsgConnectionOpenTry) returns (MsgConnectionOpenTryResponse); + + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + rpc ConnectionOpenAck(MsgConnectionOpenAck) returns (MsgConnectionOpenAckResponse); + + // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. + rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse); +} + +// MsgConnectionOpenInit defines the msg sent by an account on Chain A to +// initialize a connection with Chain B. +message MsgConnectionOpenInit { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + Counterparty counterparty = 3 [(gogoproto.nullable) = false]; + string version = 4; + string signer = 5; +} + +// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response type. +message MsgConnectionOpenInitResponse { } + +// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a +// connection on Chain B. +message MsgConnectionOpenTry { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string desired_connection_id = 2 [(gogoproto.moretags) = "yaml:\"desired_connection_id\""]; + string counterparty_chosen_connection_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_chosen_connection_id\""]; + google.protobuf.Any client_state = 4 [(gogoproto.moretags) = "yaml:\"client_state\""]; + Counterparty counterparty = 5 [(gogoproto.nullable) = false]; + repeated string counterparty_versions = 6 [(gogoproto.moretags) = "yaml:\"counterparty_versions\""]; + ibc.core.client.v1.Height proof_height = 7 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + // proof of the initialization the connection on Chain A: `UNITIALIZED -> + // INIT` + bytes proof_init = 8 [(gogoproto.moretags) = "yaml:\"proof_init\""]; + // proof of client state included in message + bytes proof_client = 9 [(gogoproto.moretags) = "yaml:\"proof_client\""]; + // proof of client consensus state + bytes proof_consensus = 10 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; + ibc.core.client.v1.Height consensus_height = 11 + [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; + string signer = 12; +} + +// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +message MsgConnectionOpenTryResponse { } + +// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to +// acknowledge the change of connection state to TRYOPEN on Chain B. +message MsgConnectionOpenAck { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string counterparty_connection_id = 2 [(gogoproto.moretags) = "yaml:\"counterparty_connection_id\""]; + string version = 3; + google.protobuf.Any client_state = 4 [(gogoproto.moretags) = "yaml:\"client_state\""]; + ibc.core.client.v1.Height proof_height = 5 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + // proof of the initialization the connection on Chain B: `UNITIALIZED -> + // TRYOPEN` + bytes proof_try = 6 [(gogoproto.moretags) = "yaml:\"proof_try\""]; + // proof of client state included in message + bytes proof_client = 7 [(gogoproto.moretags) = "yaml:\"proof_client\""]; + // proof of client consensus state + bytes proof_consensus = 8 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; + ibc.core.client.v1.Height consensus_height = 9 + [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; + string signer = 10; +} + +// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. +message MsgConnectionOpenAckResponse { } + +// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to +// acknowledge the change of connection state to OPEN on Chain A. +message MsgConnectionOpenConfirm { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + // proof for the change of the connection state on Chain A: `INIT -> OPEN` + bytes proof_ack = 2 [(gogoproto.moretags) = "yaml:\"proof_ack\""]; + ibc.core.client.v1.Height proof_height = 3 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string signer = 4; +} + +// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm response type. +message MsgConnectionOpenConfirmResponse { } diff --git a/x/ibc/applications/transfer/types/transfer.pb.go b/x/ibc/applications/transfer/types/transfer.pb.go index db4e10f45c..c051db12a8 100644 --- a/x/ibc/applications/transfer/types/transfer.pb.go +++ b/x/ibc/applications/transfer/types/transfer.pb.go @@ -4,16 +4,9 @@ package types import ( - context "context" fmt "fmt" - types "github.com/cosmos/cosmos-sdk/types" - grpc1 "github.com/gogo/protobuf/grpc" - types1 "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -30,98 +23,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between -// ICS20 enabled chains. See ICS Spec here: -// https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures -type MsgTransfer struct { - // the port on which the packet will be sent - SourcePort string `protobuf:"bytes,1,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty" yaml:"source_port"` - // the channel by which the packet will be sent - SourceChannel string `protobuf:"bytes,2,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty" yaml:"source_channel"` - // the tokens to be transferred - Token types.Coin `protobuf:"bytes,3,opt,name=token,proto3" json:"token"` - // the sender address - Sender string `protobuf:"bytes,4,opt,name=sender,proto3" json:"sender,omitempty"` - // the recipient address on the destination chain - Receiver string `protobuf:"bytes,5,opt,name=receiver,proto3" json:"receiver,omitempty"` - // Timeout height relative to the current block height. - // The timeout is disabled when set to 0. - TimeoutHeight types1.Height `protobuf:"bytes,6,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"` - // Timeout timestamp (in nanoseconds) relative to the current block timestamp. - // The timeout is disabled when set to 0. - TimeoutTimestamp uint64 `protobuf:"varint,7,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty" yaml:"timeout_timestamp"` -} - -func (m *MsgTransfer) Reset() { *m = MsgTransfer{} } -func (m *MsgTransfer) String() string { return proto.CompactTextString(m) } -func (*MsgTransfer) ProtoMessage() {} -func (*MsgTransfer) Descriptor() ([]byte, []int) { - return fileDescriptor_5041673e96e97901, []int{0} -} -func (m *MsgTransfer) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgTransfer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgTransfer.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgTransfer) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgTransfer.Merge(m, src) -} -func (m *MsgTransfer) XXX_Size() int { - return m.Size() -} -func (m *MsgTransfer) XXX_DiscardUnknown() { - xxx_messageInfo_MsgTransfer.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgTransfer proto.InternalMessageInfo - -// MsgTransferResponse defines the Msg/Transfer response type. -type MsgTransferResponse struct { -} - -func (m *MsgTransferResponse) Reset() { *m = MsgTransferResponse{} } -func (m *MsgTransferResponse) String() string { return proto.CompactTextString(m) } -func (*MsgTransferResponse) ProtoMessage() {} -func (*MsgTransferResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5041673e96e97901, []int{1} -} -func (m *MsgTransferResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgTransferResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgTransferResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgTransferResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgTransferResponse.Merge(m, src) -} -func (m *MsgTransferResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgTransferResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgTransferResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgTransferResponse proto.InternalMessageInfo - // FungibleTokenPacketData defines a struct for the packet payload // See FungibleTokenPacketData spec: // https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures @@ -140,7 +41,7 @@ func (m *FungibleTokenPacketData) Reset() { *m = FungibleTokenPacketData func (m *FungibleTokenPacketData) String() string { return proto.CompactTextString(m) } func (*FungibleTokenPacketData) ProtoMessage() {} func (*FungibleTokenPacketData) Descriptor() ([]byte, []int) { - return fileDescriptor_5041673e96e97901, []int{2} + return fileDescriptor_5041673e96e97901, []int{0} } func (m *FungibleTokenPacketData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -211,7 +112,7 @@ func (m *DenomTrace) Reset() { *m = DenomTrace{} } func (m *DenomTrace) String() string { return proto.CompactTextString(m) } func (*DenomTrace) ProtoMessage() {} func (*DenomTrace) Descriptor() ([]byte, []int) { - return fileDescriptor_5041673e96e97901, []int{3} + return fileDescriptor_5041673e96e97901, []int{1} } func (m *DenomTrace) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -271,7 +172,7 @@ func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_5041673e96e97901, []int{4} + return fileDescriptor_5041673e96e97901, []int{2} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -315,8 +216,6 @@ func (m *Params) GetReceiveEnabled() bool { } func init() { - proto.RegisterType((*MsgTransfer)(nil), "ibc.applications.transfer.v1.MsgTransfer") - proto.RegisterType((*MsgTransferResponse)(nil), "ibc.applications.transfer.v1.MsgTransferResponse") proto.RegisterType((*FungibleTokenPacketData)(nil), "ibc.applications.transfer.v1.FungibleTokenPacketData") proto.RegisterType((*DenomTrace)(nil), "ibc.applications.transfer.v1.DenomTrace") proto.RegisterType((*Params)(nil), "ibc.applications.transfer.v1.Params") @@ -327,228 +226,30 @@ func init() { } var fileDescriptor_5041673e96e97901 = []byte{ - // 638 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0x8e, 0x9b, 0x34, 0xa4, 0x1b, 0x5a, 0x60, 0xfb, 0xe7, 0x46, 0xad, 0x5d, 0xf9, 0x54, 0x84, - 0x58, 0x2b, 0x45, 0x08, 0xa9, 0x07, 0x40, 0x69, 0x41, 0x70, 0xa8, 0x54, 0x59, 0x39, 0x20, 0x2e, - 0x61, 0xbd, 0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 0x11, 0x9e, 0x85, 0x76, 0xc9, 0xcd, 0xe7, 0xb1, - 0xe8, 0x9f, 0x86, 0x9f, 0xc2, 0xdb, 0xff, 0x2c, 0xf2, 0x2c, 0xa7, 0x22, 0xae, 0xeb, 0xfd, 0x7e, - 0xf2, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x34, 0x4e, 0x38, 0x40, 0x83, 0x04, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // Transfer defines a rpc handler method for MsgTransfer. - Transfer(ctx context.Context, in *MsgTransfer, opts ...grpc.CallOption) (*MsgTransferResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) Transfer(ctx context.Context, in *MsgTransfer, opts ...grpc.CallOption) (*MsgTransferResponse, error) { - out := new(MsgTransferResponse) - err := c.cc.Invoke(ctx, "/ibc.applications.transfer.v1.Msg/Transfer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // Transfer defines a rpc handler method for MsgTransfer. - Transfer(context.Context, *MsgTransfer) (*MsgTransferResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) Transfer(ctx context.Context, req *MsgTransfer) (*MsgTransferResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Transfer not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_Transfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgTransfer) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Transfer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.applications.transfer.v1.Msg/Transfer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Transfer(ctx, req.(*MsgTransfer)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "ibc.applications.transfer.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Transfer", - Handler: _Msg_Transfer_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "ibc/applications/transfer/v1/transfer.proto", -} - -func (m *MsgTransfer) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgTransfer) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgTransfer) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TimeoutTimestamp != 0 { - i = encodeVarintTransfer(dAtA, i, uint64(m.TimeoutTimestamp)) - i-- - dAtA[i] = 0x38 - } - { - size, err := m.TimeoutHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTransfer(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - if len(m.Receiver) > 0 { - i -= len(m.Receiver) - copy(dAtA[i:], m.Receiver) - i = encodeVarintTransfer(dAtA, i, uint64(len(m.Receiver))) - i-- - dAtA[i] = 0x2a - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTransfer(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTransfer(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.SourceChannel) > 0 { - i -= len(m.SourceChannel) - copy(dAtA[i:], m.SourceChannel) - i = encodeVarintTransfer(dAtA, i, uint64(len(m.SourceChannel))) - i-- - dAtA[i] = 0x12 - } - if len(m.SourcePort) > 0 { - i -= len(m.SourcePort) - copy(dAtA[i:], m.SourcePort) - i = encodeVarintTransfer(dAtA, i, uint64(len(m.SourcePort))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgTransferResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgTransferResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgTransferResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil + // 362 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0x41, 0x6b, 0xe2, 0x40, + 0x14, 0xc7, 0x8d, 0xeb, 0x8a, 0xce, 0x2e, 0xbb, 0x30, 0x2b, 0x1a, 0x64, 0x1b, 0x25, 0x27, 0xa1, + 0x34, 0x41, 0x7a, 0xf3, 0xd0, 0x82, 0xb5, 0x3d, 0x4b, 0xf0, 0x50, 0x7a, 0x91, 0xc9, 0xe4, 0x35, + 0x06, 0x93, 0x99, 0x30, 0x33, 0x4a, 0xa5, 0x9f, 0xa0, 0xb7, 0x7e, 0xac, 0x1e, 0x3d, 0xf6, 0x24, + 0x45, 0xbf, 0x81, 0x9f, 0xa0, 0x64, 0x12, 0x82, 0x14, 0x7a, 0x9a, 0xf7, 0x7b, 0xef, 0xff, 0xff, + 0xcf, 0x83, 0x87, 0xce, 0x23, 0x9f, 0xba, 0x24, 0x4d, 0xe3, 0x88, 0x12, 0x15, 0x71, 0x26, 0x5d, + 0x25, 0x08, 0x93, 0x8f, 0x20, 0xdc, 0xf5, 0xb0, 0xac, 0x9d, 0x54, 0x70, 0xc5, 0xf1, 0xff, 0xc8, + 0xa7, 0xce, 0xa9, 0xd8, 0x29, 0x05, 0xeb, 0x61, 0xb7, 0x15, 0xf2, 0x90, 0x6b, 0xa1, 0x9b, 0x55, + 0xb9, 0xc7, 0x7e, 0x46, 0x9d, 0xbb, 0x15, 0x0b, 0x23, 0x3f, 0x86, 0x19, 0x5f, 0x02, 0x9b, 0x12, + 0xba, 0x04, 0x35, 0x21, 0x8a, 0xe0, 0x16, 0xfa, 0x19, 0x00, 0xe3, 0x89, 0x69, 0xf4, 0x8d, 0x41, + 0xd3, 0xcb, 0x01, 0xb7, 0x51, 0x9d, 0x24, 0x7c, 0xc5, 0x94, 0x59, 0xed, 0x1b, 0x83, 0x9a, 0x57, + 0x50, 0xd6, 0x97, 0xc0, 0x02, 0x10, 0xe6, 0x0f, 0x2d, 0x2f, 0x08, 0x77, 0x51, 0x43, 0x00, 0x85, + 0x68, 0x0d, 0xc2, 0xac, 0xe9, 0x49, 0xc9, 0xf6, 0x35, 0x42, 0x93, 0x2c, 0x74, 0x26, 0x08, 0x05, + 0x8c, 0x51, 0x2d, 0x25, 0x6a, 0x51, 0x7c, 0xa7, 0x6b, 0x7c, 0x86, 0x90, 0x4f, 0x24, 0xcc, 0xf3, + 0x45, 0xaa, 0x7a, 0xd2, 0xcc, 0x3a, 0xda, 0x67, 0xbf, 0x18, 0xa8, 0x3e, 0x25, 0x82, 0x24, 0x12, + 0x8f, 0xd0, 0xef, 0xec, 0xc7, 0x39, 0x30, 0xe2, 0xc7, 0x10, 0xe8, 0x94, 0xc6, 0xb8, 0x73, 0xdc, + 0xf5, 0xfe, 0x6d, 0x48, 0x12, 0x8f, 0xec, 0xd3, 0xa9, 0xed, 0xfd, 0xca, 0xf0, 0x36, 0x27, 0x7c, + 0x83, 0xfe, 0x16, 0x3b, 0x95, 0xf6, 0xaa, 0xb6, 0x77, 0x8f, 0xbb, 0x5e, 0x3b, 0xb7, 0x7f, 0x11, + 0xd8, 0xde, 0x9f, 0xa2, 0x53, 0x84, 0x8c, 0xef, 0xdf, 0xf6, 0x96, 0xb1, 0xdd, 0x5b, 0xc6, 0xc7, + 0xde, 0x32, 0x5e, 0x0f, 0x56, 0x65, 0x7b, 0xb0, 0x2a, 0xef, 0x07, 0xab, 0xf2, 0x70, 0x15, 0x46, + 0x6a, 0xb1, 0xf2, 0x1d, 0xca, 0x13, 0x97, 0x72, 0x99, 0x70, 0x59, 0x3c, 0x17, 0x32, 0x58, 0xba, + 0x4f, 0xee, 0xf7, 0x37, 0x56, 0x9b, 0x14, 0xa4, 0x5f, 0xd7, 0xa7, 0xba, 0xfc, 0x0c, 0x00, 0x00, + 0xff, 0xff, 0x46, 0x73, 0x85, 0x0b, 0x0d, 0x02, 0x00, 0x00, } func (m *FungibleTokenPacketData) Marshal() (dAtA []byte, err error) { @@ -691,47 +392,6 @@ func encodeVarintTransfer(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgTransfer) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SourcePort) - if l > 0 { - n += 1 + l + sovTransfer(uint64(l)) - } - l = len(m.SourceChannel) - if l > 0 { - n += 1 + l + sovTransfer(uint64(l)) - } - l = m.Token.Size() - n += 1 + l + sovTransfer(uint64(l)) - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTransfer(uint64(l)) - } - l = len(m.Receiver) - if l > 0 { - n += 1 + l + sovTransfer(uint64(l)) - } - l = m.TimeoutHeight.Size() - n += 1 + l + sovTransfer(uint64(l)) - if m.TimeoutTimestamp != 0 { - n += 1 + sovTransfer(uint64(m.TimeoutTimestamp)) - } - return n -} - -func (m *MsgTransferResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *FungibleTokenPacketData) Size() (n int) { if m == nil { return 0 @@ -794,325 +454,6 @@ func sovTransfer(x uint64) (n int) { func sozTransfer(x uint64) (n int) { return sovTransfer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgTransfer) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTransfer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgTransfer: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTransfer: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourcePort", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTransfer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTransfer - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTransfer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SourcePort = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceChannel", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTransfer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTransfer - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTransfer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SourceChannel = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTransfer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTransfer - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTransfer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTransfer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTransfer - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTransfer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTransfer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTransfer - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTransfer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Receiver = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTransfer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTransfer - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTransfer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TimeoutHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) - } - m.TimeoutTimestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTransfer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeoutTimestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTransfer(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTransfer - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTransfer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgTransferResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTransfer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgTransferResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTransferResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTransfer(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTransfer - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTransfer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *FungibleTokenPacketData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ibc/applications/transfer/types/tx.pb.go b/x/ibc/applications/transfer/types/tx.pb.go new file mode 100644 index 0000000000..dd46dbe261 --- /dev/null +++ b/x/ibc/applications/transfer/types/tx.pb.go @@ -0,0 +1,810 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/applications/transfer/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between +// ICS20 enabled chains. See ICS Spec here: +// https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures +type MsgTransfer struct { + // the port on which the packet will be sent + SourcePort string `protobuf:"bytes,1,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty" yaml:"source_port"` + // the channel by which the packet will be sent + SourceChannel string `protobuf:"bytes,2,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty" yaml:"source_channel"` + // the tokens to be transferred + Token types.Coin `protobuf:"bytes,3,opt,name=token,proto3" json:"token"` + // the sender address + Sender string `protobuf:"bytes,4,opt,name=sender,proto3" json:"sender,omitempty"` + // the recipient address on the destination chain + Receiver string `protobuf:"bytes,5,opt,name=receiver,proto3" json:"receiver,omitempty"` + // Timeout height relative to the current block height. + // The timeout is disabled when set to 0. + TimeoutHeight types1.Height `protobuf:"bytes,6,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"` + // Timeout timestamp (in nanoseconds) relative to the current block timestamp. + // The timeout is disabled when set to 0. + TimeoutTimestamp uint64 `protobuf:"varint,7,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty" yaml:"timeout_timestamp"` +} + +func (m *MsgTransfer) Reset() { *m = MsgTransfer{} } +func (m *MsgTransfer) String() string { return proto.CompactTextString(m) } +func (*MsgTransfer) ProtoMessage() {} +func (*MsgTransfer) Descriptor() ([]byte, []int) { + return fileDescriptor_7401ed9bed2f8e09, []int{0} +} +func (m *MsgTransfer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransfer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransfer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgTransfer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransfer.Merge(m, src) +} +func (m *MsgTransfer) XXX_Size() int { + return m.Size() +} +func (m *MsgTransfer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransfer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransfer proto.InternalMessageInfo + +// MsgTransferResponse defines the Msg/Transfer response type. +type MsgTransferResponse struct { +} + +func (m *MsgTransferResponse) Reset() { *m = MsgTransferResponse{} } +func (m *MsgTransferResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTransferResponse) ProtoMessage() {} +func (*MsgTransferResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7401ed9bed2f8e09, []int{1} +} +func (m *MsgTransferResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgTransferResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferResponse.Merge(m, src) +} +func (m *MsgTransferResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgTransfer)(nil), "ibc.applications.transfer.v1.MsgTransfer") + proto.RegisterType((*MsgTransferResponse)(nil), "ibc.applications.transfer.v1.MsgTransferResponse") +} + +func init() { + proto.RegisterFile("ibc/applications/transfer/v1/tx.proto", fileDescriptor_7401ed9bed2f8e09) +} + +var fileDescriptor_7401ed9bed2f8e09 = []byte{ + // 488 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0xc7, 0x13, 0xd6, 0x95, 0xe2, 0x6a, 0x13, 0x18, 0x36, 0x65, 0xd5, 0x48, 0xaa, 0x48, 0x48, + 0xe5, 0x80, 0xad, 0x0c, 0x21, 0xa4, 0x1d, 0x10, 0xca, 0x2e, 0x70, 0x98, 0x84, 0xa2, 0x1d, 0x10, + 0x97, 0x91, 0x78, 0x26, 0xb1, 0xd6, 0xd8, 0x91, 0xed, 0x46, 0xdb, 0x37, 0xe0, 0xc8, 0x47, 0xd8, + 0x99, 0x4f, 0xb2, 0xe3, 0x8e, 0x9c, 0x2a, 0xd4, 0x5e, 0x38, 0xf7, 0x13, 0xa0, 0xc4, 0x6e, 0x69, + 0x0f, 0x20, 0x4e, 0xf1, 0x7b, 0xff, 0xdf, 0xf3, 0x5f, 0xcf, 0xef, 0x05, 0x3c, 0x63, 0x19, 0xc1, + 0x69, 0x55, 0x8d, 0x19, 0x49, 0x35, 0x13, 0x5c, 0x61, 0x2d, 0x53, 0xae, 0xbe, 0x50, 0x89, 0xeb, + 0x08, 0xeb, 0x2b, 0x54, 0x49, 0xa1, 0x05, 0x3c, 0x64, 0x19, 0x41, 0xeb, 0x18, 0x5a, 0x62, 0xa8, + 0x8e, 0x06, 0x4f, 0x72, 0x91, 0x8b, 0x16, 0xc4, 0xcd, 0xc9, 0xd4, 0x0c, 0x7c, 0x22, 0x54, 0x29, + 0x14, 0xce, 0x52, 0x45, 0x71, 0x1d, 0x65, 0x54, 0xa7, 0x11, 0x26, 0x82, 0x71, 0xab, 0x07, 0x8d, + 0x35, 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xc2, 0xd0, 0xf0, 0x3d, 0x78, 0xb4, 0x24, 0x9a, 0xaf, + 0xd2, 0x69, 0x59, 0x79, 0xf7, 0x87, 0xee, 0xa8, 0x13, 0x1f, 0x2e, 0xa6, 0x81, 0xb7, 0x79, 0xc9, + 0x0a, 0x09, 0x93, 0x87, 0x36, 0x77, 0xb6, 0x4c, 0x1d, 0xf7, 0xbe, 0xde, 0x04, 0xce, 0xaf, 0x9b, + 0xc0, 0x09, 0xf7, 0xc0, 0xe3, 0xb5, 0x59, 0x25, 0x54, 0x55, 0x82, 0x2b, 0x7a, 0x24, 0xc0, 0xd6, + 0xa9, 0xca, 0x61, 0x01, 0x7a, 0xab, 0x31, 0x3e, 0x47, 0xff, 0x5a, 0x26, 0xb4, 0x76, 0xcb, 0x20, + 0xfa, 0x6f, 0x74, 0x69, 0x18, 0x7f, 0xbc, 0x9d, 0xf9, 0xee, 0xdd, 0xcc, 0x77, 0x7f, 0xce, 0x7c, + 0xf7, 0xdb, 0xdc, 0x77, 0xee, 0xe6, 0xbe, 0xf3, 0x63, 0xee, 0x3b, 0x9f, 0xde, 0xe4, 0x4c, 0x17, + 0x93, 0x0c, 0x11, 0x51, 0x62, 0xbb, 0x9a, 0xe6, 0xf3, 0x42, 0x5d, 0x5c, 0xe2, 0x2b, 0xfc, 0xf7, + 0x3f, 0x41, 0x5f, 0x57, 0x54, 0x65, 0xdd, 0x76, 0x2b, 0x5f, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, + 0x26, 0x76, 0x5b, 0xfa, 0x33, 0x03, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // Transfer defines a rpc handler method for MsgTransfer. + Transfer(ctx context.Context, in *MsgTransfer, opts ...grpc.CallOption) (*MsgTransferResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Transfer(ctx context.Context, in *MsgTransfer, opts ...grpc.CallOption) (*MsgTransferResponse, error) { + out := new(MsgTransferResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.transfer.v1.Msg/Transfer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Transfer defines a rpc handler method for MsgTransfer. + Transfer(context.Context, *MsgTransfer) (*MsgTransferResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) Transfer(ctx context.Context, req *MsgTransfer) (*MsgTransferResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Transfer not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_Transfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTransfer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Transfer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.transfer.v1.Msg/Transfer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Transfer(ctx, req.(*MsgTransfer)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.applications.transfer.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Transfer", + Handler: _Msg_Transfer_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/applications/transfer/v1/tx.proto", +} + +func (m *MsgTransfer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgTransfer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransfer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TimeoutTimestamp != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TimeoutTimestamp)) + i-- + dAtA[i] = 0x38 + } + { + size, err := m.TimeoutHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintTx(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x2a + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.SourceChannel) > 0 { + i -= len(m.SourceChannel) + copy(dAtA[i:], m.SourceChannel) + i = encodeVarintTx(dAtA, i, uint64(len(m.SourceChannel))) + i-- + dAtA[i] = 0x12 + } + if len(m.SourcePort) > 0 { + i -= len(m.SourcePort) + copy(dAtA[i:], m.SourcePort) + i = encodeVarintTx(dAtA, i, uint64(len(m.SourcePort))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgTransferResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgTransferResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgTransfer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SourcePort) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SourceChannel) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Token.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Receiver) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.TimeoutHeight.Size() + n += 1 + l + sovTx(uint64(l)) + if m.TimeoutTimestamp != 0 { + n += 1 + sovTx(uint64(m.TimeoutTimestamp)) + } + return n +} + +func (m *MsgTransferResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgTransfer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTransfer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransfer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourcePort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourcePort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TimeoutHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) + } + m.TimeoutTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutTimestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTransferResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTransferResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ibc/core/02-client/types/client.pb.go b/x/ibc/core/02-client/types/client.pb.go index 601a1d7686..aa9bd5c3d3 100644 --- a/x/ibc/core/02-client/types/client.pb.go +++ b/x/ibc/core/02-client/types/client.pb.go @@ -7,8 +7,8 @@ import ( context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" - grpc1 "github.com/gogo/protobuf/grpc" _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/x/ibc/core/03-connection/types/connection.pb.go b/x/ibc/core/03-connection/types/connection.pb.go index 79efbee5d0..b2b51dd75a 100644 --- a/x/ibc/core/03-connection/types/connection.pb.go +++ b/x/ibc/core/03-connection/types/connection.pb.go @@ -4,17 +4,10 @@ package types import ( - context "context" fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" - grpc1 "github.com/gogo/protobuf/grpc" - types1 "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - types2 "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types" + types "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -69,346 +62,6 @@ func (State) EnumDescriptor() ([]byte, []int) { return fileDescriptor_90572467c054e43a, []int{0} } -// MsgConnectionOpenInit defines the msg sent by an account on Chain A to -// initialize a connection with Chain B. -type MsgConnectionOpenInit struct { - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` - ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` - Counterparty Counterparty `protobuf:"bytes,3,opt,name=counterparty,proto3" json:"counterparty"` - Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgConnectionOpenInit) Reset() { *m = MsgConnectionOpenInit{} } -func (m *MsgConnectionOpenInit) String() string { return proto.CompactTextString(m) } -func (*MsgConnectionOpenInit) ProtoMessage() {} -func (*MsgConnectionOpenInit) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{0} -} -func (m *MsgConnectionOpenInit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgConnectionOpenInit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgConnectionOpenInit.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgConnectionOpenInit) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConnectionOpenInit.Merge(m, src) -} -func (m *MsgConnectionOpenInit) XXX_Size() int { - return m.Size() -} -func (m *MsgConnectionOpenInit) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConnectionOpenInit.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgConnectionOpenInit proto.InternalMessageInfo - -// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response type. -type MsgConnectionOpenInitResponse struct { -} - -func (m *MsgConnectionOpenInitResponse) Reset() { *m = MsgConnectionOpenInitResponse{} } -func (m *MsgConnectionOpenInitResponse) String() string { return proto.CompactTextString(m) } -func (*MsgConnectionOpenInitResponse) ProtoMessage() {} -func (*MsgConnectionOpenInitResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{1} -} -func (m *MsgConnectionOpenInitResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgConnectionOpenInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgConnectionOpenInitResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgConnectionOpenInitResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConnectionOpenInitResponse.Merge(m, src) -} -func (m *MsgConnectionOpenInitResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgConnectionOpenInitResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConnectionOpenInitResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgConnectionOpenInitResponse proto.InternalMessageInfo - -// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a -// connection on Chain B. -type MsgConnectionOpenTry struct { - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` - DesiredConnectionId string `protobuf:"bytes,2,opt,name=desired_connection_id,json=desiredConnectionId,proto3" json:"desired_connection_id,omitempty" yaml:"desired_connection_id"` - CounterpartyChosenConnectionId string `protobuf:"bytes,3,opt,name=counterparty_chosen_connection_id,json=counterpartyChosenConnectionId,proto3" json:"counterparty_chosen_connection_id,omitempty" yaml:"counterparty_chosen_connection_id"` - ClientState *types.Any `protobuf:"bytes,4,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` - Counterparty Counterparty `protobuf:"bytes,5,opt,name=counterparty,proto3" json:"counterparty"` - CounterpartyVersions []string `protobuf:"bytes,6,rep,name=counterparty_versions,json=counterpartyVersions,proto3" json:"counterparty_versions,omitempty" yaml:"counterparty_versions"` - ProofHeight types1.Height `protobuf:"bytes,7,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` - // proof of the initialization the connection on Chain A: `UNITIALIZED -> - // INIT` - ProofInit []byte `protobuf:"bytes,8,opt,name=proof_init,json=proofInit,proto3" json:"proof_init,omitempty" yaml:"proof_init"` - // proof of client state included in message - ProofClient []byte `protobuf:"bytes,9,opt,name=proof_client,json=proofClient,proto3" json:"proof_client,omitempty" yaml:"proof_client"` - // proof of client consensus state - ProofConsensus []byte `protobuf:"bytes,10,opt,name=proof_consensus,json=proofConsensus,proto3" json:"proof_consensus,omitempty" yaml:"proof_consensus"` - ConsensusHeight types1.Height `protobuf:"bytes,11,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height" yaml:"consensus_height"` - Signer string `protobuf:"bytes,12,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgConnectionOpenTry) Reset() { *m = MsgConnectionOpenTry{} } -func (m *MsgConnectionOpenTry) String() string { return proto.CompactTextString(m) } -func (*MsgConnectionOpenTry) ProtoMessage() {} -func (*MsgConnectionOpenTry) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{2} -} -func (m *MsgConnectionOpenTry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgConnectionOpenTry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgConnectionOpenTry.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgConnectionOpenTry) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConnectionOpenTry.Merge(m, src) -} -func (m *MsgConnectionOpenTry) XXX_Size() int { - return m.Size() -} -func (m *MsgConnectionOpenTry) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConnectionOpenTry.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgConnectionOpenTry proto.InternalMessageInfo - -// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. -type MsgConnectionOpenTryResponse struct { -} - -func (m *MsgConnectionOpenTryResponse) Reset() { *m = MsgConnectionOpenTryResponse{} } -func (m *MsgConnectionOpenTryResponse) String() string { return proto.CompactTextString(m) } -func (*MsgConnectionOpenTryResponse) ProtoMessage() {} -func (*MsgConnectionOpenTryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{3} -} -func (m *MsgConnectionOpenTryResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgConnectionOpenTryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgConnectionOpenTryResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgConnectionOpenTryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConnectionOpenTryResponse.Merge(m, src) -} -func (m *MsgConnectionOpenTryResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgConnectionOpenTryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConnectionOpenTryResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgConnectionOpenTryResponse proto.InternalMessageInfo - -// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to -// acknowledge the change of connection state to TRYOPEN on Chain B. -type MsgConnectionOpenAck struct { - ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` - CounterpartyConnectionId string `protobuf:"bytes,2,opt,name=counterparty_connection_id,json=counterpartyConnectionId,proto3" json:"counterparty_connection_id,omitempty" yaml:"counterparty_connection_id"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - ClientState *types.Any `protobuf:"bytes,4,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` - ProofHeight types1.Height `protobuf:"bytes,5,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` - // proof of the initialization the connection on Chain B: `UNITIALIZED -> - // TRYOPEN` - ProofTry []byte `protobuf:"bytes,6,opt,name=proof_try,json=proofTry,proto3" json:"proof_try,omitempty" yaml:"proof_try"` - // proof of client state included in message - ProofClient []byte `protobuf:"bytes,7,opt,name=proof_client,json=proofClient,proto3" json:"proof_client,omitempty" yaml:"proof_client"` - // proof of client consensus state - ProofConsensus []byte `protobuf:"bytes,8,opt,name=proof_consensus,json=proofConsensus,proto3" json:"proof_consensus,omitempty" yaml:"proof_consensus"` - ConsensusHeight types1.Height `protobuf:"bytes,9,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height" yaml:"consensus_height"` - Signer string `protobuf:"bytes,10,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgConnectionOpenAck) Reset() { *m = MsgConnectionOpenAck{} } -func (m *MsgConnectionOpenAck) String() string { return proto.CompactTextString(m) } -func (*MsgConnectionOpenAck) ProtoMessage() {} -func (*MsgConnectionOpenAck) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{4} -} -func (m *MsgConnectionOpenAck) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgConnectionOpenAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgConnectionOpenAck.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgConnectionOpenAck) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConnectionOpenAck.Merge(m, src) -} -func (m *MsgConnectionOpenAck) XXX_Size() int { - return m.Size() -} -func (m *MsgConnectionOpenAck) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConnectionOpenAck.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgConnectionOpenAck proto.InternalMessageInfo - -// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. -type MsgConnectionOpenAckResponse struct { -} - -func (m *MsgConnectionOpenAckResponse) Reset() { *m = MsgConnectionOpenAckResponse{} } -func (m *MsgConnectionOpenAckResponse) String() string { return proto.CompactTextString(m) } -func (*MsgConnectionOpenAckResponse) ProtoMessage() {} -func (*MsgConnectionOpenAckResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{5} -} -func (m *MsgConnectionOpenAckResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgConnectionOpenAckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgConnectionOpenAckResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgConnectionOpenAckResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConnectionOpenAckResponse.Merge(m, src) -} -func (m *MsgConnectionOpenAckResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgConnectionOpenAckResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConnectionOpenAckResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgConnectionOpenAckResponse proto.InternalMessageInfo - -// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to -// acknowledge the change of connection state to OPEN on Chain A. -type MsgConnectionOpenConfirm struct { - ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` - // proof for the change of the connection state on Chain A: `INIT -> OPEN` - ProofAck []byte `protobuf:"bytes,2,opt,name=proof_ack,json=proofAck,proto3" json:"proof_ack,omitempty" yaml:"proof_ack"` - ProofHeight types1.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` - Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgConnectionOpenConfirm) Reset() { *m = MsgConnectionOpenConfirm{} } -func (m *MsgConnectionOpenConfirm) String() string { return proto.CompactTextString(m) } -func (*MsgConnectionOpenConfirm) ProtoMessage() {} -func (*MsgConnectionOpenConfirm) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{6} -} -func (m *MsgConnectionOpenConfirm) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgConnectionOpenConfirm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgConnectionOpenConfirm.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgConnectionOpenConfirm) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConnectionOpenConfirm.Merge(m, src) -} -func (m *MsgConnectionOpenConfirm) XXX_Size() int { - return m.Size() -} -func (m *MsgConnectionOpenConfirm) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConnectionOpenConfirm.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgConnectionOpenConfirm proto.InternalMessageInfo - -// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm response type. -type MsgConnectionOpenConfirmResponse struct { -} - -func (m *MsgConnectionOpenConfirmResponse) Reset() { *m = MsgConnectionOpenConfirmResponse{} } -func (m *MsgConnectionOpenConfirmResponse) String() string { return proto.CompactTextString(m) } -func (*MsgConnectionOpenConfirmResponse) ProtoMessage() {} -func (*MsgConnectionOpenConfirmResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{7} -} -func (m *MsgConnectionOpenConfirmResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgConnectionOpenConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgConnectionOpenConfirmResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgConnectionOpenConfirmResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConnectionOpenConfirmResponse.Merge(m, src) -} -func (m *MsgConnectionOpenConfirmResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgConnectionOpenConfirmResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConnectionOpenConfirmResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgConnectionOpenConfirmResponse proto.InternalMessageInfo - // ConnectionEnd defines a stateful object on a chain connected to another // separate one. NOTE: there must only be 2 defined ConnectionEnds to establish // a connection between two chains. @@ -428,7 +81,7 @@ func (m *ConnectionEnd) Reset() { *m = ConnectionEnd{} } func (m *ConnectionEnd) String() string { return proto.CompactTextString(m) } func (*ConnectionEnd) ProtoMessage() {} func (*ConnectionEnd) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{8} + return fileDescriptor_90572467c054e43a, []int{0} } func (m *ConnectionEnd) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -477,7 +130,7 @@ func (m *IdentifiedConnection) Reset() { *m = IdentifiedConnection{} } func (m *IdentifiedConnection) String() string { return proto.CompactTextString(m) } func (*IdentifiedConnection) ProtoMessage() {} func (*IdentifiedConnection) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{9} + return fileDescriptor_90572467c054e43a, []int{1} } func (m *IdentifiedConnection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -515,14 +168,14 @@ type Counterparty struct { // given connection. ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` // commitment merkle prefix of the counterparty chain - Prefix types2.MerklePrefix `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix"` + Prefix types.MerklePrefix `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix"` } func (m *Counterparty) Reset() { *m = Counterparty{} } func (m *Counterparty) String() string { return proto.CompactTextString(m) } func (*Counterparty) ProtoMessage() {} func (*Counterparty) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{10} + return fileDescriptor_90572467c054e43a, []int{2} } func (m *Counterparty) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -561,7 +214,7 @@ func (m *ClientPaths) Reset() { *m = ClientPaths{} } func (m *ClientPaths) String() string { return proto.CompactTextString(m) } func (*ClientPaths) ProtoMessage() {} func (*ClientPaths) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{11} + return fileDescriptor_90572467c054e43a, []int{3} } func (m *ClientPaths) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -609,7 +262,7 @@ func (m *ConnectionPaths) Reset() { *m = ConnectionPaths{} } func (m *ConnectionPaths) String() string { return proto.CompactTextString(m) } func (*ConnectionPaths) ProtoMessage() {} func (*ConnectionPaths) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{12} + return fileDescriptor_90572467c054e43a, []int{4} } func (m *ConnectionPaths) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -665,7 +318,7 @@ func (m *Version) Reset() { *m = Version{} } func (m *Version) String() string { return proto.CompactTextString(m) } func (*Version) ProtoMessage() {} func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{13} + return fileDescriptor_90572467c054e43a, []int{5} } func (m *Version) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -696,14 +349,6 @@ var xxx_messageInfo_Version proto.InternalMessageInfo func init() { proto.RegisterEnum("ibc.core.connection.v1.State", State_name, State_value) - proto.RegisterType((*MsgConnectionOpenInit)(nil), "ibc.core.connection.v1.MsgConnectionOpenInit") - proto.RegisterType((*MsgConnectionOpenInitResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenInitResponse") - proto.RegisterType((*MsgConnectionOpenTry)(nil), "ibc.core.connection.v1.MsgConnectionOpenTry") - proto.RegisterType((*MsgConnectionOpenTryResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenTryResponse") - proto.RegisterType((*MsgConnectionOpenAck)(nil), "ibc.core.connection.v1.MsgConnectionOpenAck") - proto.RegisterType((*MsgConnectionOpenAckResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenAckResponse") - proto.RegisterType((*MsgConnectionOpenConfirm)(nil), "ibc.core.connection.v1.MsgConnectionOpenConfirm") - proto.RegisterType((*MsgConnectionOpenConfirmResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenConfirmResponse") proto.RegisterType((*ConnectionEnd)(nil), "ibc.core.connection.v1.ConnectionEnd") proto.RegisterType((*IdentifiedConnection)(nil), "ibc.core.connection.v1.IdentifiedConnection") proto.RegisterType((*Counterparty)(nil), "ibc.core.connection.v1.Counterparty") @@ -717,714 +362,45 @@ func init() { } var fileDescriptor_90572467c054e43a = []byte{ - // 1219 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0xf3, 0xa3, 0x49, 0x5e, 0xd2, 0x6d, 0xeb, 0x4d, 0x5b, 0x63, 0xb6, 0x76, 0xd6, 0x80, - 0xa8, 0xd0, 0x36, 0xd9, 0xb4, 0x0b, 0x42, 0x45, 0x1c, 0x92, 0x6c, 0x10, 0x11, 0xb4, 0x5b, 0xb9, - 0x29, 0x12, 0xbd, 0x44, 0xa9, 0x33, 0x49, 0xad, 0x34, 0x76, 0x64, 0xbb, 0xdd, 0x0d, 0x57, 0x2e, - 0xab, 0x5e, 0xe0, 0xc2, 0x81, 0x43, 0xa5, 0x95, 0xb8, 0xf3, 0x37, 0x70, 0x5c, 0x71, 0xda, 0x23, - 0xa7, 0x08, 0xb5, 0x17, 0xb8, 0xe6, 0xc6, 0x0d, 0x79, 0xc6, 0x76, 0xc6, 0x89, 0xa3, 0x6d, 0xda, - 0x22, 0x4e, 0x9d, 0x37, 0xef, 0x7b, 0xf3, 0xe6, 0x7d, 0xfe, 0xde, 0xcc, 0xa4, 0xf0, 0xa1, 0x7a, - 0xa4, 0xe4, 0x15, 0xdd, 0x40, 0x79, 0x45, 0xd7, 0x34, 0xa4, 0x58, 0xaa, 0xae, 0xe5, 0xcf, 0x0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ppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. - ConnectionOpenInit(ctx context.Context, in *MsgConnectionOpenInit, opts ...grpc.CallOption) (*MsgConnectionOpenInitResponse, error) - // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. - ConnectionOpenTry(ctx context.Context, in *MsgConnectionOpenTry, opts ...grpc.CallOption) (*MsgConnectionOpenTryResponse, error) - // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. - ConnectionOpenAck(ctx context.Context, in *MsgConnectionOpenAck, opts ...grpc.CallOption) (*MsgConnectionOpenAckResponse, error) - // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. - ConnectionOpenConfirm(ctx context.Context, in *MsgConnectionOpenConfirm, opts ...grpc.CallOption) (*MsgConnectionOpenConfirmResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) ConnectionOpenInit(ctx context.Context, in *MsgConnectionOpenInit, opts ...grpc.CallOption) (*MsgConnectionOpenInitResponse, error) { - out := new(MsgConnectionOpenInitResponse) - err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenInit", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ConnectionOpenTry(ctx context.Context, in *MsgConnectionOpenTry, opts ...grpc.CallOption) (*MsgConnectionOpenTryResponse, error) { - out := new(MsgConnectionOpenTryResponse) - err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenTry", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ConnectionOpenAck(ctx context.Context, in *MsgConnectionOpenAck, opts ...grpc.CallOption) (*MsgConnectionOpenAckResponse, error) { - out := new(MsgConnectionOpenAckResponse) - err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenAck", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ConnectionOpenConfirm(ctx context.Context, in *MsgConnectionOpenConfirm, opts ...grpc.CallOption) (*MsgConnectionOpenConfirmResponse, error) { - out := new(MsgConnectionOpenConfirmResponse) - err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. - ConnectionOpenInit(context.Context, *MsgConnectionOpenInit) (*MsgConnectionOpenInitResponse, error) - // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. - ConnectionOpenTry(context.Context, *MsgConnectionOpenTry) (*MsgConnectionOpenTryResponse, error) - // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. - ConnectionOpenAck(context.Context, *MsgConnectionOpenAck) (*MsgConnectionOpenAckResponse, error) - // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. - ConnectionOpenConfirm(context.Context, *MsgConnectionOpenConfirm) (*MsgConnectionOpenConfirmResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) ConnectionOpenInit(ctx context.Context, req *MsgConnectionOpenInit) (*MsgConnectionOpenInitResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenInit not implemented") -} -func (*UnimplementedMsgServer) ConnectionOpenTry(ctx context.Context, req *MsgConnectionOpenTry) (*MsgConnectionOpenTryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenTry not implemented") -} -func (*UnimplementedMsgServer) ConnectionOpenAck(ctx context.Context, req *MsgConnectionOpenAck) (*MsgConnectionOpenAckResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenAck not implemented") -} -func (*UnimplementedMsgServer) ConnectionOpenConfirm(ctx context.Context, req *MsgConnectionOpenConfirm) (*MsgConnectionOpenConfirmResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenConfirm not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_ConnectionOpenInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgConnectionOpenInit) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ConnectionOpenInit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenInit", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ConnectionOpenInit(ctx, req.(*MsgConnectionOpenInit)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ConnectionOpenTry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgConnectionOpenTry) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ConnectionOpenTry(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenTry", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ConnectionOpenTry(ctx, req.(*MsgConnectionOpenTry)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ConnectionOpenAck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgConnectionOpenAck) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ConnectionOpenAck(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenAck", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ConnectionOpenAck(ctx, req.(*MsgConnectionOpenAck)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ConnectionOpenConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgConnectionOpenConfirm) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ConnectionOpenConfirm(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ConnectionOpenConfirm(ctx, req.(*MsgConnectionOpenConfirm)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "ibc.core.connection.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ConnectionOpenInit", - Handler: _Msg_ConnectionOpenInit_Handler, - }, - { - MethodName: "ConnectionOpenTry", - Handler: _Msg_ConnectionOpenTry_Handler, - }, - { - MethodName: "ConnectionOpenAck", - Handler: _Msg_ConnectionOpenAck_Handler, - }, - { - MethodName: "ConnectionOpenConfirm", - Handler: _Msg_ConnectionOpenConfirm_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "ibc/core/connection/v1/connection.proto", -} - -func (m *MsgConnectionOpenInit) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgConnectionOpenInit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgConnectionOpenInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintConnection(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x2a - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintConnection(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.Counterparty.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConnection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.ConnectionId) > 0 { - i -= len(m.ConnectionId) - copy(dAtA[i:], m.ConnectionId) - i = encodeVarintConnection(dAtA, i, uint64(len(m.ConnectionId))) - i-- - dAtA[i] = 0x12 - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintConnection(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgConnectionOpenInitResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgConnectionOpenInitResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgConnectionOpenInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgConnectionOpenTry) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgConnectionOpenTry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgConnectionOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintConnection(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x62 - } - { - size, err := m.ConsensusHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConnection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - if len(m.ProofConsensus) > 0 { - i -= len(m.ProofConsensus) - copy(dAtA[i:], m.ProofConsensus) - i = encodeVarintConnection(dAtA, i, uint64(len(m.ProofConsensus))) - i-- - dAtA[i] = 0x52 - } - if len(m.ProofClient) > 0 { - i -= len(m.ProofClient) - copy(dAtA[i:], m.ProofClient) - i = encodeVarintConnection(dAtA, i, uint64(len(m.ProofClient))) - i-- - dAtA[i] = 0x4a - } - if len(m.ProofInit) > 0 { - i -= len(m.ProofInit) - copy(dAtA[i:], m.ProofInit) - i = encodeVarintConnection(dAtA, i, uint64(len(m.ProofInit))) - i-- - dAtA[i] = 0x42 - } - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConnection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - if len(m.CounterpartyVersions) > 0 { - for iNdEx := len(m.CounterpartyVersions) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.CounterpartyVersions[iNdEx]) - copy(dAtA[i:], m.CounterpartyVersions[iNdEx]) - i = encodeVarintConnection(dAtA, i, uint64(len(m.CounterpartyVersions[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - { - size, err := m.Counterparty.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConnection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if m.ClientState != nil { - { - size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConnection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.CounterpartyChosenConnectionId) > 0 { - i -= len(m.CounterpartyChosenConnectionId) - copy(dAtA[i:], m.CounterpartyChosenConnectionId) - i = encodeVarintConnection(dAtA, i, uint64(len(m.CounterpartyChosenConnectionId))) - i-- - dAtA[i] = 0x1a - } - if len(m.DesiredConnectionId) > 0 { - i -= len(m.DesiredConnectionId) - copy(dAtA[i:], m.DesiredConnectionId) - i = encodeVarintConnection(dAtA, i, uint64(len(m.DesiredConnectionId))) - i-- - dAtA[i] = 0x12 - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintConnection(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgConnectionOpenTryResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgConnectionOpenTryResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgConnectionOpenTryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgConnectionOpenAck) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgConnectionOpenAck) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgConnectionOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintConnection(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x52 - } - { - size, err := m.ConsensusHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConnection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - if len(m.ProofConsensus) > 0 { - i -= len(m.ProofConsensus) - copy(dAtA[i:], m.ProofConsensus) - i = encodeVarintConnection(dAtA, i, uint64(len(m.ProofConsensus))) - i-- - dAtA[i] = 0x42 - } - if len(m.ProofClient) > 0 { - i -= len(m.ProofClient) - copy(dAtA[i:], m.ProofClient) - i = encodeVarintConnection(dAtA, i, uint64(len(m.ProofClient))) - i-- - dAtA[i] = 0x3a - } - if len(m.ProofTry) > 0 { - i -= len(m.ProofTry) - copy(dAtA[i:], m.ProofTry) - i = encodeVarintConnection(dAtA, i, uint64(len(m.ProofTry))) - i-- - dAtA[i] = 0x32 - } - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConnection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if m.ClientState != nil { - { - size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConnection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintConnection(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x1a - } - if len(m.CounterpartyConnectionId) > 0 { - i -= len(m.CounterpartyConnectionId) - copy(dAtA[i:], m.CounterpartyConnectionId) - i = encodeVarintConnection(dAtA, i, uint64(len(m.CounterpartyConnectionId))) - i-- - dAtA[i] = 0x12 - } - if len(m.ConnectionId) > 0 { - i -= len(m.ConnectionId) - copy(dAtA[i:], m.ConnectionId) - i = encodeVarintConnection(dAtA, i, uint64(len(m.ConnectionId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgConnectionOpenAckResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgConnectionOpenAckResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgConnectionOpenAckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgConnectionOpenConfirm) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgConnectionOpenConfirm) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgConnectionOpenConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintConnection(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConnection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.ProofAck) > 0 { - i -= len(m.ProofAck) - copy(dAtA[i:], m.ProofAck) - i = encodeVarintConnection(dAtA, i, uint64(len(m.ProofAck))) - i-- - dAtA[i] = 0x12 - } - if len(m.ConnectionId) > 0 { - i -= len(m.ConnectionId) - copy(dAtA[i:], m.ConnectionId) - i = encodeVarintConnection(dAtA, i, uint64(len(m.ConnectionId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgConnectionOpenConfirmResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgConnectionOpenConfirmResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgConnectionOpenConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil + // 608 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x41, 0x6b, 0xdb, 0x4c, + 0x10, 0xd5, 0xca, 0x72, 0x12, 0x6f, 0xe2, 0xef, 0x73, 0x17, 0x53, 0x84, 0x20, 0x92, 0x50, 0x0b, + 0x35, 0x85, 0x48, 0x75, 0x02, 0x3d, 0xa4, 0xf4, 0x10, 0x3b, 0x2a, 0x88, 0xb6, 0xae, 0x51, 0x9c, + 0x42, 0x73, 0x09, 0xb6, 0xb4, 0x49, 0x96, 0xc4, 0x92, 0x91, 0x36, 0x26, 0xfe, 0x07, 0xc1, 0x97, + 0xf6, 0xda, 0x83, 0xa1, 0xd0, 0x3f, 0x13, 0x7a, 0xca, 0xb1, 0x27, 0x53, 0xec, 0x53, 0xaf, 0xfe, + 0x05, 0x45, 0x5a, 0x59, 0x56, 0x42, 0x73, 0x68, 0xda, 0x93, 0x67, 0x76, 0xde, 0x1b, 0xef, 0x7b, + 0x33, 0x5a, 0xf8, 0x84, 0x74, 0x1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xee, 0x1e, 0xee, 0x37, 0xf6, 0x9a, 0x66, 0xdd, 0x7a, 0x65, 0x99, 0xbb, 0x25, 0x4e, + 0x7a, 0x30, 0x1c, 0xa9, 0xc5, 0x1b, 0x00, 0x24, 0x42, 0xc8, 0x78, 0xd1, 0x61, 0x09, 0x48, 0x2b, + 0xc3, 0x91, 0x2a, 0x44, 0x31, 0x92, 0x61, 0x91, 0x55, 0x5a, 0xf6, 0x87, 0x77, 0x4d, 0xb3, 0x51, + 0xe2, 0xa5, 0xd5, 0xe1, 0x48, 0x5d, 0x4e, 0xd2, 0x05, 0x33, 0x2e, 0xe6, 0x18, 0x33, 0x8a, 0x25, + 0xe1, 0xf2, 0xab, 0xcc, 0xd5, 0xf6, 0xaf, 0x26, 0x32, 0xb8, 0x9e, 0xc8, 0xe0, 0xc7, 0x44, 0x06, + 0x9f, 0xa6, 0x32, 0x77, 0x3d, 0x95, 0xb9, 0xef, 0x53, 0x99, 0x3b, 0x78, 0x71, 0x4c, 0xe8, 0xc9, + 0x79, 0x27, 0x1a, 0x9d, 0xe1, 0xf8, 0x61, 0xd7, 0x0f, 0x93, 0x9f, 0x8d, 0xd0, 0x3d, 0x35, 0x2e, + 0x8c, 0xf4, 0x59, 0x7a, 0xb6, 0xb5, 0x91, 0x79, 0xf0, 0xe8, 0xa0, 0x87, 0xc3, 0xce, 0x52, 0xfc, + 0x24, 0x6d, 0xfd, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x61, 0x3b, 0x7e, 0x26, 0x14, 0x05, 0x00, 0x00, } func (m *ConnectionEnd) Marshal() (dAtA []byte, err error) { @@ -1710,190 +686,6 @@ func encodeVarintConnection(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgConnectionOpenInit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = len(m.ConnectionId) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = m.Counterparty.Size() - n += 1 + l + sovConnection(uint64(l)) - l = len(m.Version) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - return n -} - -func (m *MsgConnectionOpenInitResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgConnectionOpenTry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = len(m.DesiredConnectionId) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = len(m.CounterpartyChosenConnectionId) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - if m.ClientState != nil { - l = m.ClientState.Size() - n += 1 + l + sovConnection(uint64(l)) - } - l = m.Counterparty.Size() - n += 1 + l + sovConnection(uint64(l)) - if len(m.CounterpartyVersions) > 0 { - for _, s := range m.CounterpartyVersions { - l = len(s) - n += 1 + l + sovConnection(uint64(l)) - } - } - l = m.ProofHeight.Size() - n += 1 + l + sovConnection(uint64(l)) - l = len(m.ProofInit) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = len(m.ProofClient) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = len(m.ProofConsensus) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = m.ConsensusHeight.Size() - n += 1 + l + sovConnection(uint64(l)) - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - return n -} - -func (m *MsgConnectionOpenTryResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgConnectionOpenAck) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConnectionId) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = len(m.CounterpartyConnectionId) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - if m.ClientState != nil { - l = m.ClientState.Size() - n += 1 + l + sovConnection(uint64(l)) - } - l = m.ProofHeight.Size() - n += 1 + l + sovConnection(uint64(l)) - l = len(m.ProofTry) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = len(m.ProofClient) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = len(m.ProofConsensus) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = m.ConsensusHeight.Size() - n += 1 + l + sovConnection(uint64(l)) - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - return n -} - -func (m *MsgConnectionOpenAckResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgConnectionOpenConfirm) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConnectionId) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = len(m.ProofAck) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - l = m.ProofHeight.Size() - n += 1 + l + sovConnection(uint64(l)) - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovConnection(uint64(l)) - } - return n -} - -func (m *MsgConnectionOpenConfirmResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *ConnectionEnd) Size() (n int) { if m == nil { return 0 @@ -2024,1451 +816,6 @@ func sovConnection(x uint64) (n int) { func sozConnection(x uint64) (n int) { return sovConnection(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgConnectionOpenInit) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgConnectionOpenInit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConnectionOpenInit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConnectionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Counterparty", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Counterparty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipConnection(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgConnectionOpenInitResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgConnectionOpenInitResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConnectionOpenInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipConnection(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgConnectionOpenTry) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgConnectionOpenTry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConnectionOpenTry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredConnectionId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DesiredConnectionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChosenConnectionId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CounterpartyChosenConnectionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ClientState == nil { - m.ClientState = &types.Any{} - } - if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Counterparty", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Counterparty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyVersions", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CounterpartyVersions = append(m.CounterpartyVersions, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofInit", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProofInit = append(m.ProofInit[:0], dAtA[iNdEx:postIndex]...) - if m.ProofInit == nil { - m.ProofInit = []byte{} - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofClient", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProofClient = append(m.ProofClient[:0], dAtA[iNdEx:postIndex]...) - if m.ProofClient == nil { - m.ProofClient = []byte{} - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofConsensus", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProofConsensus = append(m.ProofConsensus[:0], dAtA[iNdEx:postIndex]...) - if m.ProofConsensus == nil { - m.ProofConsensus = []byte{} - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ConsensusHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipConnection(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgConnectionOpenTryResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgConnectionOpenTryResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConnectionOpenTryResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipConnection(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgConnectionOpenAck) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgConnectionOpenAck: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConnectionOpenAck: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConnectionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyConnectionId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CounterpartyConnectionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ClientState == nil { - m.ClientState = &types.Any{} - } - if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofTry", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProofTry = append(m.ProofTry[:0], dAtA[iNdEx:postIndex]...) - if m.ProofTry == nil { - m.ProofTry = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofClient", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProofClient = append(m.ProofClient[:0], dAtA[iNdEx:postIndex]...) - if m.ProofClient == nil { - m.ProofClient = []byte{} - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofConsensus", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProofConsensus = append(m.ProofConsensus[:0], dAtA[iNdEx:postIndex]...) - if m.ProofConsensus == nil { - m.ProofConsensus = []byte{} - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ConsensusHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipConnection(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgConnectionOpenAckResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgConnectionOpenAckResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConnectionOpenAckResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipConnection(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgConnectionOpenConfirm) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgConnectionOpenConfirm: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConnectionOpenConfirm: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConnectionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofAck", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProofAck = append(m.ProofAck[:0], dAtA[iNdEx:postIndex]...) - if m.ProofAck == nil { - m.ProofAck = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthConnection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthConnection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipConnection(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgConnectionOpenConfirmResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConnection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgConnectionOpenConfirmResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConnectionOpenConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipConnection(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthConnection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *ConnectionEnd) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ibc/core/03-connection/types/tx.pb.go b/x/ibc/core/03-connection/types/tx.pb.go new file mode 100644 index 0000000000..af859b042c --- /dev/null +++ b/x/ibc/core/03-connection/types/tx.pb.go @@ -0,0 +1,2806 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/core/connection/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + types1 "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgConnectionOpenInit defines the msg sent by an account on Chain A to +// initialize a connection with Chain B. +type MsgConnectionOpenInit struct { + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` + Counterparty Counterparty `protobuf:"bytes,3,opt,name=counterparty,proto3" json:"counterparty"` + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgConnectionOpenInit) Reset() { *m = MsgConnectionOpenInit{} } +func (m *MsgConnectionOpenInit) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenInit) ProtoMessage() {} +func (*MsgConnectionOpenInit) Descriptor() ([]byte, []int) { + return fileDescriptor_5d00fde5fc97399e, []int{0} +} +func (m *MsgConnectionOpenInit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenInit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenInit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConnectionOpenInit) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenInit.Merge(m, src) +} +func (m *MsgConnectionOpenInit) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenInit) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenInit.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenInit proto.InternalMessageInfo + +// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response type. +type MsgConnectionOpenInitResponse struct { +} + +func (m *MsgConnectionOpenInitResponse) Reset() { *m = MsgConnectionOpenInitResponse{} } +func (m *MsgConnectionOpenInitResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenInitResponse) ProtoMessage() {} +func (*MsgConnectionOpenInitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5d00fde5fc97399e, []int{1} +} +func (m *MsgConnectionOpenInitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenInitResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConnectionOpenInitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenInitResponse.Merge(m, src) +} +func (m *MsgConnectionOpenInitResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenInitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenInitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenInitResponse proto.InternalMessageInfo + +// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a +// connection on Chain B. +type MsgConnectionOpenTry struct { + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + DesiredConnectionId string `protobuf:"bytes,2,opt,name=desired_connection_id,json=desiredConnectionId,proto3" json:"desired_connection_id,omitempty" yaml:"desired_connection_id"` + CounterpartyChosenConnectionId string `protobuf:"bytes,3,opt,name=counterparty_chosen_connection_id,json=counterpartyChosenConnectionId,proto3" json:"counterparty_chosen_connection_id,omitempty" yaml:"counterparty_chosen_connection_id"` + ClientState *types.Any `protobuf:"bytes,4,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` + Counterparty Counterparty `protobuf:"bytes,5,opt,name=counterparty,proto3" json:"counterparty"` + CounterpartyVersions []string `protobuf:"bytes,6,rep,name=counterparty_versions,json=counterpartyVersions,proto3" json:"counterparty_versions,omitempty" yaml:"counterparty_versions"` + ProofHeight types1.Height `protobuf:"bytes,7,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` + // proof of the initialization the connection on Chain A: `UNITIALIZED -> + // INIT` + ProofInit []byte `protobuf:"bytes,8,opt,name=proof_init,json=proofInit,proto3" json:"proof_init,omitempty" yaml:"proof_init"` + // proof of client state included in message + ProofClient []byte `protobuf:"bytes,9,opt,name=proof_client,json=proofClient,proto3" json:"proof_client,omitempty" yaml:"proof_client"` + // proof of client consensus state + ProofConsensus []byte `protobuf:"bytes,10,opt,name=proof_consensus,json=proofConsensus,proto3" json:"proof_consensus,omitempty" yaml:"proof_consensus"` + ConsensusHeight types1.Height `protobuf:"bytes,11,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height" yaml:"consensus_height"` + Signer string `protobuf:"bytes,12,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgConnectionOpenTry) Reset() { *m = MsgConnectionOpenTry{} } +func (m *MsgConnectionOpenTry) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenTry) ProtoMessage() {} +func (*MsgConnectionOpenTry) Descriptor() ([]byte, []int) { + return fileDescriptor_5d00fde5fc97399e, []int{2} +} +func (m *MsgConnectionOpenTry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenTry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenTry.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConnectionOpenTry) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenTry.Merge(m, src) +} +func (m *MsgConnectionOpenTry) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenTry) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenTry.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenTry proto.InternalMessageInfo + +// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +type MsgConnectionOpenTryResponse struct { +} + +func (m *MsgConnectionOpenTryResponse) Reset() { *m = MsgConnectionOpenTryResponse{} } +func (m *MsgConnectionOpenTryResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenTryResponse) ProtoMessage() {} +func (*MsgConnectionOpenTryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5d00fde5fc97399e, []int{3} +} +func (m *MsgConnectionOpenTryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenTryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenTryResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConnectionOpenTryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenTryResponse.Merge(m, src) +} +func (m *MsgConnectionOpenTryResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenTryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenTryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenTryResponse proto.InternalMessageInfo + +// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to +// acknowledge the change of connection state to TRYOPEN on Chain B. +type MsgConnectionOpenAck struct { + ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` + CounterpartyConnectionId string `protobuf:"bytes,2,opt,name=counterparty_connection_id,json=counterpartyConnectionId,proto3" json:"counterparty_connection_id,omitempty" yaml:"counterparty_connection_id"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + ClientState *types.Any `protobuf:"bytes,4,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` + ProofHeight types1.Height `protobuf:"bytes,5,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` + // proof of the initialization the connection on Chain B: `UNITIALIZED -> + // TRYOPEN` + ProofTry []byte `protobuf:"bytes,6,opt,name=proof_try,json=proofTry,proto3" json:"proof_try,omitempty" yaml:"proof_try"` + // proof of client state included in message + ProofClient []byte `protobuf:"bytes,7,opt,name=proof_client,json=proofClient,proto3" json:"proof_client,omitempty" yaml:"proof_client"` + // proof of client consensus state + ProofConsensus []byte `protobuf:"bytes,8,opt,name=proof_consensus,json=proofConsensus,proto3" json:"proof_consensus,omitempty" yaml:"proof_consensus"` + ConsensusHeight types1.Height `protobuf:"bytes,9,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height" yaml:"consensus_height"` + Signer string `protobuf:"bytes,10,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgConnectionOpenAck) Reset() { *m = MsgConnectionOpenAck{} } +func (m *MsgConnectionOpenAck) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenAck) ProtoMessage() {} +func (*MsgConnectionOpenAck) Descriptor() ([]byte, []int) { + return fileDescriptor_5d00fde5fc97399e, []int{4} +} +func (m *MsgConnectionOpenAck) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenAck.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConnectionOpenAck) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenAck.Merge(m, src) +} +func (m *MsgConnectionOpenAck) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenAck) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenAck.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenAck proto.InternalMessageInfo + +// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. +type MsgConnectionOpenAckResponse struct { +} + +func (m *MsgConnectionOpenAckResponse) Reset() { *m = MsgConnectionOpenAckResponse{} } +func (m *MsgConnectionOpenAckResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenAckResponse) ProtoMessage() {} +func (*MsgConnectionOpenAckResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5d00fde5fc97399e, []int{5} +} +func (m *MsgConnectionOpenAckResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenAckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenAckResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConnectionOpenAckResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenAckResponse.Merge(m, src) +} +func (m *MsgConnectionOpenAckResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenAckResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenAckResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenAckResponse proto.InternalMessageInfo + +// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to +// acknowledge the change of connection state to OPEN on Chain A. +type MsgConnectionOpenConfirm struct { + ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` + // proof for the change of the connection state on Chain A: `INIT -> OPEN` + ProofAck []byte `protobuf:"bytes,2,opt,name=proof_ack,json=proofAck,proto3" json:"proof_ack,omitempty" yaml:"proof_ack"` + ProofHeight types1.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` + Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgConnectionOpenConfirm) Reset() { *m = MsgConnectionOpenConfirm{} } +func (m *MsgConnectionOpenConfirm) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenConfirm) ProtoMessage() {} +func (*MsgConnectionOpenConfirm) Descriptor() ([]byte, []int) { + return fileDescriptor_5d00fde5fc97399e, []int{6} +} +func (m *MsgConnectionOpenConfirm) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenConfirm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenConfirm.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConnectionOpenConfirm) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenConfirm.Merge(m, src) +} +func (m *MsgConnectionOpenConfirm) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenConfirm) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenConfirm.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenConfirm proto.InternalMessageInfo + +// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm response type. +type MsgConnectionOpenConfirmResponse struct { +} + +func (m *MsgConnectionOpenConfirmResponse) Reset() { *m = MsgConnectionOpenConfirmResponse{} } +func (m *MsgConnectionOpenConfirmResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenConfirmResponse) ProtoMessage() {} +func (*MsgConnectionOpenConfirmResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5d00fde5fc97399e, []int{7} +} +func (m *MsgConnectionOpenConfirmResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenConfirmResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConnectionOpenConfirmResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenConfirmResponse.Merge(m, src) +} +func (m *MsgConnectionOpenConfirmResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenConfirmResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenConfirmResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenConfirmResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgConnectionOpenInit)(nil), "ibc.core.connection.v1.MsgConnectionOpenInit") + proto.RegisterType((*MsgConnectionOpenInitResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenInitResponse") + proto.RegisterType((*MsgConnectionOpenTry)(nil), "ibc.core.connection.v1.MsgConnectionOpenTry") + proto.RegisterType((*MsgConnectionOpenTryResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenTryResponse") + proto.RegisterType((*MsgConnectionOpenAck)(nil), "ibc.core.connection.v1.MsgConnectionOpenAck") + proto.RegisterType((*MsgConnectionOpenAckResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenAckResponse") + proto.RegisterType((*MsgConnectionOpenConfirm)(nil), "ibc.core.connection.v1.MsgConnectionOpenConfirm") + proto.RegisterType((*MsgConnectionOpenConfirmResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenConfirmResponse") +} + +func init() { proto.RegisterFile("ibc/core/connection/v1/tx.proto", fileDescriptor_5d00fde5fc97399e) } + +var fileDescriptor_5d00fde5fc97399e = []byte{ + // 909 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xbf, 0x93, 0xdb, 0x44, + 0x14, 0xb6, 0xce, 0xf7, 0xc3, 0x5e, 0x1b, 0x92, 0x28, 0xf6, 0x9d, 0x10, 0x41, 0x72, 0x76, 0x60, + 0xb8, 0x22, 0x27, 0xc5, 0x97, 0x30, 0xc3, 0x1c, 0x43, 0x61, 0xbb, 0xe1, 0x8a, 0x00, 0x23, 0x2e, + 0x14, 0x69, 0x3c, 0xb6, 0xbc, 0x96, 0x35, 0x3e, 0xef, 0x7a, 0xb4, 0xb2, 0x13, 0xd1, 0xd2, 0x30, + 0x54, 0x34, 0xf4, 0xf9, 0x0b, 0xf8, 0x1b, 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0e, 0xef, 0xec, 0xe6, 0x89, 0x5b, 0xe6, 0x78, 0x83, 0xc4, 0x9c, 0x4c, 0xc5, 0x9f, 0x05, 0x50, + 0xcf, 0xd7, 0xe8, 0xe3, 0x1b, 0x9f, 0x17, 0x47, 0xc8, 0x5f, 0x6e, 0x1a, 0x91, 0x54, 0xd1, 0x7e, + 0xfe, 0xe6, 0x4a, 0x11, 0xde, 0x5e, 0x29, 0xc2, 0xdf, 0x57, 0x8a, 0xf0, 0xdb, 0xb5, 0x52, 0x78, + 0x7b, 0xad, 0x14, 0xfe, 0xba, 0x56, 0x0a, 0x2f, 0xbe, 0xb2, 0x6c, 0x77, 0x34, 0xeb, 0x6b, 0x26, + 0x99, 0xe8, 0x26, 0xa1, 0x13, 0x42, 0xe3, 0x9f, 0x13, 0x3a, 0x18, 0xeb, 0xaf, 0xf4, 0xf4, 0xed, + 0xfd, 0xf8, 0xc9, 0x09, 0xf7, 0xfc, 0x76, 0xbd, 0x29, 0xa2, 0xfd, 0x7d, 0x36, 0x71, 0x9f, 0xfc, + 0x17, 0x00, 0x00, 0xff, 0xff, 0x93, 0xae, 0x01, 0xa9, 0x2d, 0x0c, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + ConnectionOpenInit(ctx context.Context, in *MsgConnectionOpenInit, opts ...grpc.CallOption) (*MsgConnectionOpenInitResponse, error) + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + ConnectionOpenTry(ctx context.Context, in *MsgConnectionOpenTry, opts ...grpc.CallOption) (*MsgConnectionOpenTryResponse, error) + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + ConnectionOpenAck(ctx context.Context, in *MsgConnectionOpenAck, opts ...grpc.CallOption) (*MsgConnectionOpenAckResponse, error) + // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. + ConnectionOpenConfirm(ctx context.Context, in *MsgConnectionOpenConfirm, opts ...grpc.CallOption) (*MsgConnectionOpenConfirmResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) ConnectionOpenInit(ctx context.Context, in *MsgConnectionOpenInit, opts ...grpc.CallOption) (*MsgConnectionOpenInitResponse, error) { + out := new(MsgConnectionOpenInitResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenInit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConnectionOpenTry(ctx context.Context, in *MsgConnectionOpenTry, opts ...grpc.CallOption) (*MsgConnectionOpenTryResponse, error) { + out := new(MsgConnectionOpenTryResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenTry", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConnectionOpenAck(ctx context.Context, in *MsgConnectionOpenAck, opts ...grpc.CallOption) (*MsgConnectionOpenAckResponse, error) { + out := new(MsgConnectionOpenAckResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenAck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConnectionOpenConfirm(ctx context.Context, in *MsgConnectionOpenConfirm, opts ...grpc.CallOption) (*MsgConnectionOpenConfirmResponse, error) { + out := new(MsgConnectionOpenConfirmResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + ConnectionOpenInit(context.Context, *MsgConnectionOpenInit) (*MsgConnectionOpenInitResponse, error) + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + ConnectionOpenTry(context.Context, *MsgConnectionOpenTry) (*MsgConnectionOpenTryResponse, error) + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + ConnectionOpenAck(context.Context, *MsgConnectionOpenAck) (*MsgConnectionOpenAckResponse, error) + // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. + ConnectionOpenConfirm(context.Context, *MsgConnectionOpenConfirm) (*MsgConnectionOpenConfirmResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) ConnectionOpenInit(ctx context.Context, req *MsgConnectionOpenInit) (*MsgConnectionOpenInitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenInit not implemented") +} +func (*UnimplementedMsgServer) ConnectionOpenTry(ctx context.Context, req *MsgConnectionOpenTry) (*MsgConnectionOpenTryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenTry not implemented") +} +func (*UnimplementedMsgServer) ConnectionOpenAck(ctx context.Context, req *MsgConnectionOpenAck) (*MsgConnectionOpenAckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenAck not implemented") +} +func (*UnimplementedMsgServer) ConnectionOpenConfirm(ctx context.Context, req *MsgConnectionOpenConfirm) (*MsgConnectionOpenConfirmResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenConfirm not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_ConnectionOpenInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenInit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenInit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenInit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenInit(ctx, req.(*MsgConnectionOpenInit)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConnectionOpenTry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenTry) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenTry(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenTry", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenTry(ctx, req.(*MsgConnectionOpenTry)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConnectionOpenAck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenAck) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenAck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenAck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenAck(ctx, req.(*MsgConnectionOpenAck)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConnectionOpenConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenConfirm) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenConfirm(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenConfirm(ctx, req.(*MsgConnectionOpenConfirm)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.core.connection.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ConnectionOpenInit", + Handler: _Msg_ConnectionOpenInit_Handler, + }, + { + MethodName: "ConnectionOpenTry", + Handler: _Msg_ConnectionOpenTry_Handler, + }, + { + MethodName: "ConnectionOpenAck", + Handler: _Msg_ConnectionOpenAck_Handler, + }, + { + MethodName: "ConnectionOpenConfirm", + Handler: _Msg_ConnectionOpenConfirm_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/core/connection/v1/tx.proto", +} + +func (m *MsgConnectionOpenInit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConnectionOpenInit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x2a + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintTx(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Counterparty.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0x12 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgConnectionOpenInitResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConnectionOpenInitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgConnectionOpenTry) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConnectionOpenTry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x62 + } + { + size, err := m.ConsensusHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + if len(m.ProofConsensus) > 0 { + i -= len(m.ProofConsensus) + copy(dAtA[i:], m.ProofConsensus) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofConsensus))) + i-- + dAtA[i] = 0x52 + } + if len(m.ProofClient) > 0 { + i -= len(m.ProofClient) + copy(dAtA[i:], m.ProofClient) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofClient))) + i-- + dAtA[i] = 0x4a + } + if len(m.ProofInit) > 0 { + i -= len(m.ProofInit) + copy(dAtA[i:], m.ProofInit) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofInit))) + i-- + dAtA[i] = 0x42 + } + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if len(m.CounterpartyVersions) > 0 { + for iNdEx := len(m.CounterpartyVersions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CounterpartyVersions[iNdEx]) + copy(dAtA[i:], m.CounterpartyVersions[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.CounterpartyVersions[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + { + size, err := m.Counterparty.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.ClientState != nil { + { + size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.CounterpartyChosenConnectionId) > 0 { + i -= len(m.CounterpartyChosenConnectionId) + copy(dAtA[i:], m.CounterpartyChosenConnectionId) + i = encodeVarintTx(dAtA, i, uint64(len(m.CounterpartyChosenConnectionId))) + i-- + dAtA[i] = 0x1a + } + if len(m.DesiredConnectionId) > 0 { + i -= len(m.DesiredConnectionId) + copy(dAtA[i:], m.DesiredConnectionId) + i = encodeVarintTx(dAtA, i, uint64(len(m.DesiredConnectionId))) + i-- + dAtA[i] = 0x12 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgConnectionOpenTryResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConnectionOpenTryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenTryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgConnectionOpenAck) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConnectionOpenAck) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x52 + } + { + size, err := m.ConsensusHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + if len(m.ProofConsensus) > 0 { + i -= len(m.ProofConsensus) + copy(dAtA[i:], m.ProofConsensus) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofConsensus))) + i-- + dAtA[i] = 0x42 + } + if len(m.ProofClient) > 0 { + i -= len(m.ProofClient) + copy(dAtA[i:], m.ProofClient) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofClient))) + i-- + dAtA[i] = 0x3a + } + if len(m.ProofTry) > 0 { + i -= len(m.ProofTry) + copy(dAtA[i:], m.ProofTry) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofTry))) + i-- + dAtA[i] = 0x32 + } + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.ClientState != nil { + { + size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintTx(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x1a + } + if len(m.CounterpartyConnectionId) > 0 { + i -= len(m.CounterpartyConnectionId) + copy(dAtA[i:], m.CounterpartyConnectionId) + i = encodeVarintTx(dAtA, i, uint64(len(m.CounterpartyConnectionId))) + i-- + dAtA[i] = 0x12 + } + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgConnectionOpenAckResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConnectionOpenAckResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenAckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgConnectionOpenConfirm) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConnectionOpenConfirm) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ProofAck) > 0 { + i -= len(m.ProofAck) + copy(dAtA[i:], m.ProofAck) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofAck))) + i-- + dAtA[i] = 0x12 + } + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgConnectionOpenConfirmResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConnectionOpenConfirmResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgConnectionOpenInit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Counterparty.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Version) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgConnectionOpenInitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgConnectionOpenTry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DesiredConnectionId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.CounterpartyChosenConnectionId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.ClientState != nil { + l = m.ClientState.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = m.Counterparty.Size() + n += 1 + l + sovTx(uint64(l)) + if len(m.CounterpartyVersions) > 0 { + for _, s := range m.CounterpartyVersions { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + l = m.ProofHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.ProofInit) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProofClient) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProofConsensus) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ConsensusHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgConnectionOpenTryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgConnectionOpenAck) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.CounterpartyConnectionId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.ClientState != nil { + l = m.ClientState.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = m.ProofHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.ProofTry) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProofClient) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProofConsensus) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ConsensusHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgConnectionOpenAckResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgConnectionOpenConfirm) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProofAck) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ProofHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgConnectionOpenConfirmResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgConnectionOpenInit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConnectionOpenInit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenInit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Counterparty", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Counterparty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgConnectionOpenInitResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConnectionOpenInitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgConnectionOpenTry) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConnectionOpenTry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenTry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DesiredConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DesiredConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChosenConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyChosenConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClientState == nil { + m.ClientState = &types.Any{} + } + if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Counterparty", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Counterparty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyVersions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyVersions = append(m.CounterpartyVersions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofInit", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofInit = append(m.ProofInit[:0], dAtA[iNdEx:postIndex]...) + if m.ProofInit == nil { + m.ProofInit = []byte{} + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofClient", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofClient = append(m.ProofClient[:0], dAtA[iNdEx:postIndex]...) + if m.ProofClient == nil { + m.ProofClient = []byte{} + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofConsensus", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofConsensus = append(m.ProofConsensus[:0], dAtA[iNdEx:postIndex]...) + if m.ProofConsensus == nil { + m.ProofConsensus = []byte{} + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ConsensusHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgConnectionOpenTryResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConnectionOpenTryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenTryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgConnectionOpenAck) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConnectionOpenAck: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenAck: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClientState == nil { + m.ClientState = &types.Any{} + } + if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofTry", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofTry = append(m.ProofTry[:0], dAtA[iNdEx:postIndex]...) + if m.ProofTry == nil { + m.ProofTry = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofClient", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofClient = append(m.ProofClient[:0], dAtA[iNdEx:postIndex]...) + if m.ProofClient == nil { + m.ProofClient = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofConsensus", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofConsensus = append(m.ProofConsensus[:0], dAtA[iNdEx:postIndex]...) + if m.ProofConsensus == nil { + m.ProofConsensus = []byte{} + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ConsensusHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgConnectionOpenAckResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConnectionOpenAckResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenAckResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgConnectionOpenConfirm) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConnectionOpenConfirm: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenConfirm: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofAck", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofAck = append(m.ProofAck[:0], dAtA[iNdEx:postIndex]...) + if m.ProofAck == nil { + m.ProofAck = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgConnectionOpenConfirmResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConnectionOpenConfirmResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ibc/core/04-channel/types/channel.pb.go b/x/ibc/core/04-channel/types/channel.pb.go index e06a7ed7ec..19ca87cdbc 100644 --- a/x/ibc/core/04-channel/types/channel.pb.go +++ b/x/ibc/core/04-channel/types/channel.pb.go @@ -4,15 +4,10 @@ package types import ( - context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - grpc1 "github.com/gogo/protobuf/grpc" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" @@ -105,804 +100,6 @@ func (Order) EnumDescriptor() ([]byte, []int) { return fileDescriptor_c3a07336710636a0, []int{1} } -// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It -// is called by a relayer on Chain A. -type MsgChannelOpenInit struct { - PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` - ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` - Channel Channel `protobuf:"bytes,3,opt,name=channel,proto3" json:"channel"` - Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgChannelOpenInit) Reset() { *m = MsgChannelOpenInit{} } -func (m *MsgChannelOpenInit) String() string { return proto.CompactTextString(m) } -func (*MsgChannelOpenInit) ProtoMessage() {} -func (*MsgChannelOpenInit) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{0} -} -func (m *MsgChannelOpenInit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgChannelOpenInit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChannelOpenInit.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgChannelOpenInit) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChannelOpenInit.Merge(m, src) -} -func (m *MsgChannelOpenInit) XXX_Size() int { - return m.Size() -} -func (m *MsgChannelOpenInit) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChannelOpenInit.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgChannelOpenInit proto.InternalMessageInfo - -// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. -type MsgChannelOpenInitResponse struct { -} - -func (m *MsgChannelOpenInitResponse) Reset() { *m = MsgChannelOpenInitResponse{} } -func (m *MsgChannelOpenInitResponse) String() string { return proto.CompactTextString(m) } -func (*MsgChannelOpenInitResponse) ProtoMessage() {} -func (*MsgChannelOpenInitResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{1} -} -func (m *MsgChannelOpenInitResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgChannelOpenInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChannelOpenInitResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgChannelOpenInitResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChannelOpenInitResponse.Merge(m, src) -} -func (m *MsgChannelOpenInitResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgChannelOpenInitResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChannelOpenInitResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgChannelOpenInitResponse proto.InternalMessageInfo - -// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel -// on Chain B. -type MsgChannelOpenTry struct { - PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` - DesiredChannelId string `protobuf:"bytes,2,opt,name=desired_channel_id,json=desiredChannelId,proto3" json:"desired_channel_id,omitempty" yaml:"desired_channel_id"` - CounterpartyChosenChannelId string `protobuf:"bytes,3,opt,name=counterparty_chosen_channel_id,json=counterpartyChosenChannelId,proto3" json:"counterparty_chosen_channel_id,omitempty" yaml:"counterparty_chosen_channel_id"` - Channel Channel `protobuf:"bytes,4,opt,name=channel,proto3" json:"channel"` - CounterpartyVersion string `protobuf:"bytes,5,opt,name=counterparty_version,json=counterpartyVersion,proto3" json:"counterparty_version,omitempty" yaml:"counterparty_version"` - ProofInit []byte `protobuf:"bytes,6,opt,name=proof_init,json=proofInit,proto3" json:"proof_init,omitempty" yaml:"proof_init"` - ProofHeight types.Height `protobuf:"bytes,7,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` - Signer string `protobuf:"bytes,8,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgChannelOpenTry) Reset() { *m = MsgChannelOpenTry{} } -func (m *MsgChannelOpenTry) String() string { return proto.CompactTextString(m) } -func (*MsgChannelOpenTry) ProtoMessage() {} -func (*MsgChannelOpenTry) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{2} -} -func (m *MsgChannelOpenTry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgChannelOpenTry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChannelOpenTry.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgChannelOpenTry) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChannelOpenTry.Merge(m, src) -} -func (m *MsgChannelOpenTry) XXX_Size() int { - return m.Size() -} -func (m *MsgChannelOpenTry) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChannelOpenTry.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgChannelOpenTry proto.InternalMessageInfo - -// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. -type MsgChannelOpenTryResponse struct { -} - -func (m *MsgChannelOpenTryResponse) Reset() { *m = MsgChannelOpenTryResponse{} } -func (m *MsgChannelOpenTryResponse) String() string { return proto.CompactTextString(m) } -func (*MsgChannelOpenTryResponse) ProtoMessage() {} -func (*MsgChannelOpenTryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{3} -} -func (m *MsgChannelOpenTryResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgChannelOpenTryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChannelOpenTryResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgChannelOpenTryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChannelOpenTryResponse.Merge(m, src) -} -func (m *MsgChannelOpenTryResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgChannelOpenTryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChannelOpenTryResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgChannelOpenTryResponse proto.InternalMessageInfo - -// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge -// the change of channel state to TRYOPEN on Chain B. -type MsgChannelOpenAck struct { - PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` - ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` - CounterpartyChannelId string `protobuf:"bytes,3,opt,name=counterparty_channel_id,json=counterpartyChannelId,proto3" json:"counterparty_channel_id,omitempty" yaml:"counterparty_channel_id"` - CounterpartyVersion string `protobuf:"bytes,4,opt,name=counterparty_version,json=counterpartyVersion,proto3" json:"counterparty_version,omitempty" yaml:"counterparty_version"` - ProofTry []byte `protobuf:"bytes,5,opt,name=proof_try,json=proofTry,proto3" json:"proof_try,omitempty" yaml:"proof_try"` - ProofHeight types.Height `protobuf:"bytes,6,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` - Signer string `protobuf:"bytes,7,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgChannelOpenAck) Reset() { *m = MsgChannelOpenAck{} } -func (m *MsgChannelOpenAck) String() string { return proto.CompactTextString(m) } -func (*MsgChannelOpenAck) ProtoMessage() {} -func (*MsgChannelOpenAck) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{4} -} -func (m *MsgChannelOpenAck) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgChannelOpenAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChannelOpenAck.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgChannelOpenAck) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChannelOpenAck.Merge(m, src) -} -func (m *MsgChannelOpenAck) XXX_Size() int { - return m.Size() -} -func (m *MsgChannelOpenAck) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChannelOpenAck.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgChannelOpenAck proto.InternalMessageInfo - -// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. -type MsgChannelOpenAckResponse struct { -} - -func (m *MsgChannelOpenAckResponse) Reset() { *m = MsgChannelOpenAckResponse{} } -func (m *MsgChannelOpenAckResponse) String() string { return proto.CompactTextString(m) } -func (*MsgChannelOpenAckResponse) ProtoMessage() {} -func (*MsgChannelOpenAckResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{5} -} -func (m *MsgChannelOpenAckResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgChannelOpenAckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChannelOpenAckResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgChannelOpenAckResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChannelOpenAckResponse.Merge(m, src) -} -func (m *MsgChannelOpenAckResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgChannelOpenAckResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChannelOpenAckResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgChannelOpenAckResponse proto.InternalMessageInfo - -// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to -// acknowledge the change of channel state to OPEN on Chain A. -type MsgChannelOpenConfirm struct { - PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` - ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` - ProofAck []byte `protobuf:"bytes,3,opt,name=proof_ack,json=proofAck,proto3" json:"proof_ack,omitempty" yaml:"proof_ack"` - ProofHeight types.Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` - Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgChannelOpenConfirm) Reset() { *m = MsgChannelOpenConfirm{} } -func (m *MsgChannelOpenConfirm) String() string { return proto.CompactTextString(m) } -func (*MsgChannelOpenConfirm) ProtoMessage() {} -func (*MsgChannelOpenConfirm) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{6} -} -func (m *MsgChannelOpenConfirm) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgChannelOpenConfirm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChannelOpenConfirm.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgChannelOpenConfirm) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChannelOpenConfirm.Merge(m, src) -} -func (m *MsgChannelOpenConfirm) XXX_Size() int { - return m.Size() -} -func (m *MsgChannelOpenConfirm) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChannelOpenConfirm.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgChannelOpenConfirm proto.InternalMessageInfo - -// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response type. -type MsgChannelOpenConfirmResponse struct { -} - -func (m *MsgChannelOpenConfirmResponse) Reset() { *m = MsgChannelOpenConfirmResponse{} } -func (m *MsgChannelOpenConfirmResponse) String() string { return proto.CompactTextString(m) } -func (*MsgChannelOpenConfirmResponse) ProtoMessage() {} -func (*MsgChannelOpenConfirmResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{7} -} -func (m *MsgChannelOpenConfirmResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgChannelOpenConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChannelOpenConfirmResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgChannelOpenConfirmResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChannelOpenConfirmResponse.Merge(m, src) -} -func (m *MsgChannelOpenConfirmResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgChannelOpenConfirmResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChannelOpenConfirmResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgChannelOpenConfirmResponse proto.InternalMessageInfo - -// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A -// to close a channel with Chain B. -type MsgChannelCloseInit struct { - PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` - ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` - Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgChannelCloseInit) Reset() { *m = MsgChannelCloseInit{} } -func (m *MsgChannelCloseInit) String() string { return proto.CompactTextString(m) } -func (*MsgChannelCloseInit) ProtoMessage() {} -func (*MsgChannelCloseInit) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{8} -} -func (m *MsgChannelCloseInit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgChannelCloseInit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChannelCloseInit.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgChannelCloseInit) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChannelCloseInit.Merge(m, src) -} -func (m *MsgChannelCloseInit) XXX_Size() int { - return m.Size() -} -func (m *MsgChannelCloseInit) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChannelCloseInit.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgChannelCloseInit proto.InternalMessageInfo - -// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. -type MsgChannelCloseInitResponse struct { -} - -func (m *MsgChannelCloseInitResponse) Reset() { *m = MsgChannelCloseInitResponse{} } -func (m *MsgChannelCloseInitResponse) String() string { return proto.CompactTextString(m) } -func (*MsgChannelCloseInitResponse) ProtoMessage() {} -func (*MsgChannelCloseInitResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{9} -} -func (m *MsgChannelCloseInitResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgChannelCloseInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChannelCloseInitResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgChannelCloseInitResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChannelCloseInitResponse.Merge(m, src) -} -func (m *MsgChannelCloseInitResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgChannelCloseInitResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChannelCloseInitResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgChannelCloseInitResponse proto.InternalMessageInfo - -// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B -// to acknowledge the change of channel state to CLOSED on Chain A. -type MsgChannelCloseConfirm struct { - PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` - ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` - ProofInit []byte `protobuf:"bytes,3,opt,name=proof_init,json=proofInit,proto3" json:"proof_init,omitempty" yaml:"proof_init"` - ProofHeight types.Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` - Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgChannelCloseConfirm) Reset() { *m = MsgChannelCloseConfirm{} } -func (m *MsgChannelCloseConfirm) String() string { return proto.CompactTextString(m) } -func (*MsgChannelCloseConfirm) ProtoMessage() {} -func (*MsgChannelCloseConfirm) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{10} -} -func (m *MsgChannelCloseConfirm) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgChannelCloseConfirm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChannelCloseConfirm.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgChannelCloseConfirm) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChannelCloseConfirm.Merge(m, src) -} -func (m *MsgChannelCloseConfirm) XXX_Size() int { - return m.Size() -} -func (m *MsgChannelCloseConfirm) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChannelCloseConfirm.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgChannelCloseConfirm proto.InternalMessageInfo - -// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response type. -type MsgChannelCloseConfirmResponse struct { -} - -func (m *MsgChannelCloseConfirmResponse) Reset() { *m = MsgChannelCloseConfirmResponse{} } -func (m *MsgChannelCloseConfirmResponse) String() string { return proto.CompactTextString(m) } -func (*MsgChannelCloseConfirmResponse) ProtoMessage() {} -func (*MsgChannelCloseConfirmResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{11} -} -func (m *MsgChannelCloseConfirmResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgChannelCloseConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChannelCloseConfirmResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgChannelCloseConfirmResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChannelCloseConfirmResponse.Merge(m, src) -} -func (m *MsgChannelCloseConfirmResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgChannelCloseConfirmResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChannelCloseConfirmResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgChannelCloseConfirmResponse proto.InternalMessageInfo - -// MsgRecvPacket receives incoming IBC packet -type MsgRecvPacket struct { - Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` - Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` - ProofHeight types.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` - Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgRecvPacket) Reset() { *m = MsgRecvPacket{} } -func (m *MsgRecvPacket) String() string { return proto.CompactTextString(m) } -func (*MsgRecvPacket) ProtoMessage() {} -func (*MsgRecvPacket) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{12} -} -func (m *MsgRecvPacket) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRecvPacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRecvPacket.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgRecvPacket) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRecvPacket.Merge(m, src) -} -func (m *MsgRecvPacket) XXX_Size() int { - return m.Size() -} -func (m *MsgRecvPacket) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRecvPacket.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRecvPacket proto.InternalMessageInfo - -// MsgRecvPacketResponse defines the Msg/RecvPacket response type. -type MsgRecvPacketResponse struct { -} - -func (m *MsgRecvPacketResponse) Reset() { *m = MsgRecvPacketResponse{} } -func (m *MsgRecvPacketResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRecvPacketResponse) ProtoMessage() {} -func (*MsgRecvPacketResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{13} -} -func (m *MsgRecvPacketResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRecvPacketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRecvPacketResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgRecvPacketResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRecvPacketResponse.Merge(m, src) -} -func (m *MsgRecvPacketResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRecvPacketResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRecvPacketResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRecvPacketResponse proto.InternalMessageInfo - -// MsgTimeout receives timed-out packet -type MsgTimeout struct { - Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` - Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` - ProofHeight types.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` - NextSequenceRecv uint64 `protobuf:"varint,4,opt,name=next_sequence_recv,json=nextSequenceRecv,proto3" json:"next_sequence_recv,omitempty" yaml:"next_sequence_recv"` - Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgTimeout) Reset() { *m = MsgTimeout{} } -func (m *MsgTimeout) String() string { return proto.CompactTextString(m) } -func (*MsgTimeout) ProtoMessage() {} -func (*MsgTimeout) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{14} -} -func (m *MsgTimeout) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgTimeout) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgTimeout.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgTimeout) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgTimeout.Merge(m, src) -} -func (m *MsgTimeout) XXX_Size() int { - return m.Size() -} -func (m *MsgTimeout) XXX_DiscardUnknown() { - xxx_messageInfo_MsgTimeout.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgTimeout proto.InternalMessageInfo - -// MsgTimeoutResponse defines the Msg/Timeout response type. -type MsgTimeoutResponse struct { -} - -func (m *MsgTimeoutResponse) Reset() { *m = MsgTimeoutResponse{} } -func (m *MsgTimeoutResponse) String() string { return proto.CompactTextString(m) } -func (*MsgTimeoutResponse) ProtoMessage() {} -func (*MsgTimeoutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{15} -} -func (m *MsgTimeoutResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgTimeoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgTimeoutResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgTimeoutResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgTimeoutResponse.Merge(m, src) -} -func (m *MsgTimeoutResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgTimeoutResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgTimeoutResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgTimeoutResponse proto.InternalMessageInfo - -// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. -type MsgTimeoutOnClose struct { - Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` - Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` - ProofClose []byte `protobuf:"bytes,3,opt,name=proof_close,json=proofClose,proto3" json:"proof_close,omitempty" yaml:"proof_close"` - ProofHeight types.Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` - NextSequenceRecv uint64 `protobuf:"varint,5,opt,name=next_sequence_recv,json=nextSequenceRecv,proto3" json:"next_sequence_recv,omitempty" yaml:"next_sequence_recv"` - Signer string `protobuf:"bytes,6,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgTimeoutOnClose) Reset() { *m = MsgTimeoutOnClose{} } -func (m *MsgTimeoutOnClose) String() string { return proto.CompactTextString(m) } -func (*MsgTimeoutOnClose) ProtoMessage() {} -func (*MsgTimeoutOnClose) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{16} -} -func (m *MsgTimeoutOnClose) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgTimeoutOnClose) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgTimeoutOnClose.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgTimeoutOnClose) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgTimeoutOnClose.Merge(m, src) -} -func (m *MsgTimeoutOnClose) XXX_Size() int { - return m.Size() -} -func (m *MsgTimeoutOnClose) XXX_DiscardUnknown() { - xxx_messageInfo_MsgTimeoutOnClose.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgTimeoutOnClose proto.InternalMessageInfo - -// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. -type MsgTimeoutOnCloseResponse struct { -} - -func (m *MsgTimeoutOnCloseResponse) Reset() { *m = MsgTimeoutOnCloseResponse{} } -func (m *MsgTimeoutOnCloseResponse) String() string { return proto.CompactTextString(m) } -func (*MsgTimeoutOnCloseResponse) ProtoMessage() {} -func (*MsgTimeoutOnCloseResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{17} -} -func (m *MsgTimeoutOnCloseResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgTimeoutOnCloseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgTimeoutOnCloseResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgTimeoutOnCloseResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgTimeoutOnCloseResponse.Merge(m, src) -} -func (m *MsgTimeoutOnCloseResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgTimeoutOnCloseResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgTimeoutOnCloseResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgTimeoutOnCloseResponse proto.InternalMessageInfo - -// MsgAcknowledgement receives incoming IBC acknowledgement -type MsgAcknowledgement struct { - Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` - Acknowledgement []byte `protobuf:"bytes,2,opt,name=acknowledgement,proto3" json:"acknowledgement,omitempty"` - Proof []byte `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` - ProofHeight types.Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` - Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgAcknowledgement) Reset() { *m = MsgAcknowledgement{} } -func (m *MsgAcknowledgement) String() string { return proto.CompactTextString(m) } -func (*MsgAcknowledgement) ProtoMessage() {} -func (*MsgAcknowledgement) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{18} -} -func (m *MsgAcknowledgement) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgAcknowledgement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgAcknowledgement.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgAcknowledgement) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAcknowledgement.Merge(m, src) -} -func (m *MsgAcknowledgement) XXX_Size() int { - return m.Size() -} -func (m *MsgAcknowledgement) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAcknowledgement.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgAcknowledgement proto.InternalMessageInfo - -// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. -type MsgAcknowledgementResponse struct { -} - -func (m *MsgAcknowledgementResponse) Reset() { *m = MsgAcknowledgementResponse{} } -func (m *MsgAcknowledgementResponse) String() string { return proto.CompactTextString(m) } -func (*MsgAcknowledgementResponse) ProtoMessage() {} -func (*MsgAcknowledgementResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{19} -} -func (m *MsgAcknowledgementResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgAcknowledgementResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgAcknowledgementResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgAcknowledgementResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAcknowledgementResponse.Merge(m, src) -} -func (m *MsgAcknowledgementResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgAcknowledgementResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAcknowledgementResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgAcknowledgementResponse proto.InternalMessageInfo - // Channel defines pipeline for exactly-once packet delivery between specific // modules on separate blockchains, which has at least one end capable of // sending packets and one end capable of receiving packets. @@ -924,7 +121,7 @@ func (m *Channel) Reset() { *m = Channel{} } func (m *Channel) String() string { return proto.CompactTextString(m) } func (*Channel) ProtoMessage() {} func (*Channel) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{20} + return fileDescriptor_c3a07336710636a0, []int{0} } func (m *Channel) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -977,7 +174,7 @@ func (m *IdentifiedChannel) Reset() { *m = IdentifiedChannel{} } func (m *IdentifiedChannel) String() string { return proto.CompactTextString(m) } func (*IdentifiedChannel) ProtoMessage() {} func (*IdentifiedChannel) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{21} + return fileDescriptor_c3a07336710636a0, []int{1} } func (m *IdentifiedChannel) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1018,7 +215,7 @@ func (m *Counterparty) Reset() { *m = Counterparty{} } func (m *Counterparty) String() string { return proto.CompactTextString(m) } func (*Counterparty) ProtoMessage() {} func (*Counterparty) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{22} + return fileDescriptor_c3a07336710636a0, []int{2} } func (m *Counterparty) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1073,7 +270,7 @@ func (m *Packet) Reset() { *m = Packet{} } func (m *Packet) String() string { return proto.CompactTextString(m) } func (*Packet) ProtoMessage() {} func (*Packet) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{23} + return fileDescriptor_c3a07336710636a0, []int{3} } func (m *Packet) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1119,7 +316,7 @@ func (m *PacketAckCommitment) Reset() { *m = PacketAckCommitment{} } func (m *PacketAckCommitment) String() string { return proto.CompactTextString(m) } func (*PacketAckCommitment) ProtoMessage() {} func (*PacketAckCommitment) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{24} + return fileDescriptor_c3a07336710636a0, []int{4} } func (m *PacketAckCommitment) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1168,7 +365,7 @@ func (m *Acknowledgement) Reset() { *m = Acknowledgement{} } func (m *Acknowledgement) String() string { return proto.CompactTextString(m) } func (*Acknowledgement) ProtoMessage() {} func (*Acknowledgement) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{25} + return fileDescriptor_c3a07336710636a0, []int{5} } func (m *Acknowledgement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1245,26 +442,6 @@ func (*Acknowledgement) XXX_OneofWrappers() []interface{} { func init() { proto.RegisterEnum("ibc.core.channel.v1.State", State_name, State_value) proto.RegisterEnum("ibc.core.channel.v1.Order", Order_name, Order_value) - proto.RegisterType((*MsgChannelOpenInit)(nil), "ibc.core.channel.v1.MsgChannelOpenInit") - proto.RegisterType((*MsgChannelOpenInitResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenInitResponse") - proto.RegisterType((*MsgChannelOpenTry)(nil), "ibc.core.channel.v1.MsgChannelOpenTry") - proto.RegisterType((*MsgChannelOpenTryResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenTryResponse") - proto.RegisterType((*MsgChannelOpenAck)(nil), "ibc.core.channel.v1.MsgChannelOpenAck") - proto.RegisterType((*MsgChannelOpenAckResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenAckResponse") - proto.RegisterType((*MsgChannelOpenConfirm)(nil), "ibc.core.channel.v1.MsgChannelOpenConfirm") - proto.RegisterType((*MsgChannelOpenConfirmResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenConfirmResponse") - proto.RegisterType((*MsgChannelCloseInit)(nil), "ibc.core.channel.v1.MsgChannelCloseInit") - proto.RegisterType((*MsgChannelCloseInitResponse)(nil), "ibc.core.channel.v1.MsgChannelCloseInitResponse") - proto.RegisterType((*MsgChannelCloseConfirm)(nil), "ibc.core.channel.v1.MsgChannelCloseConfirm") - proto.RegisterType((*MsgChannelCloseConfirmResponse)(nil), "ibc.core.channel.v1.MsgChannelCloseConfirmResponse") - proto.RegisterType((*MsgRecvPacket)(nil), "ibc.core.channel.v1.MsgRecvPacket") - proto.RegisterType((*MsgRecvPacketResponse)(nil), "ibc.core.channel.v1.MsgRecvPacketResponse") - proto.RegisterType((*MsgTimeout)(nil), "ibc.core.channel.v1.MsgTimeout") - proto.RegisterType((*MsgTimeoutResponse)(nil), "ibc.core.channel.v1.MsgTimeoutResponse") - proto.RegisterType((*MsgTimeoutOnClose)(nil), "ibc.core.channel.v1.MsgTimeoutOnClose") - proto.RegisterType((*MsgTimeoutOnCloseResponse)(nil), "ibc.core.channel.v1.MsgTimeoutOnCloseResponse") - proto.RegisterType((*MsgAcknowledgement)(nil), "ibc.core.channel.v1.MsgAcknowledgement") - proto.RegisterType((*MsgAcknowledgementResponse)(nil), "ibc.core.channel.v1.MsgAcknowledgementResponse") proto.RegisterType((*Channel)(nil), "ibc.core.channel.v1.Channel") proto.RegisterType((*IdentifiedChannel)(nil), "ibc.core.channel.v1.IdentifiedChannel") proto.RegisterType((*Counterparty)(nil), "ibc.core.channel.v1.Counterparty") @@ -1276,1400 +453,65 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v1/channel.proto", fileDescriptor_c3a07336710636a0) } var fileDescriptor_c3a07336710636a0 = []byte{ - // 1708 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xcd, 0x6f, 0xdb, 0xc8, - 0x15, 0xd7, 0x07, 0xf5, 0xe1, 0x17, 0xd9, 0x96, 0xc7, 0x1f, 0x51, 0xe8, 0x58, 0xd4, 0x12, 0xed, - 0xae, 0x9b, 0x62, 0xa5, 0x24, 0xbb, 0xe8, 0x47, 0xd0, 0x43, 0x2d, 0x59, 0x8b, 0x08, 0xd9, 0x58, - 0xc6, 0x58, 0x29, 0x50, 0xa3, 0x80, 0x2a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x27, 0xff, 0x0e, - 0x00, 0x00, 0xff, 0xff, 0xdf, 0x36, 0x4a, 0x13, 0xe1, 0x19, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. - ChannelOpenInit(ctx context.Context, in *MsgChannelOpenInit, opts ...grpc.CallOption) (*MsgChannelOpenInitResponse, error) - // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. - ChannelOpenTry(ctx context.Context, in *MsgChannelOpenTry, opts ...grpc.CallOption) (*MsgChannelOpenTryResponse, error) - // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. - ChannelOpenAck(ctx context.Context, in *MsgChannelOpenAck, opts ...grpc.CallOption) (*MsgChannelOpenAckResponse, error) - // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. - ChannelOpenConfirm(ctx context.Context, in *MsgChannelOpenConfirm, opts ...grpc.CallOption) (*MsgChannelOpenConfirmResponse, error) - // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. - ChannelCloseInit(ctx context.Context, in *MsgChannelCloseInit, opts ...grpc.CallOption) (*MsgChannelCloseInitResponse, error) - // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. - ChannelCloseConfirm(ctx context.Context, in *MsgChannelCloseConfirm, opts ...grpc.CallOption) (*MsgChannelCloseConfirmResponse, error) - // RecvPacket defines a rpc handler method for MsgRecvPacket. - RecvPacket(ctx context.Context, in *MsgRecvPacket, opts ...grpc.CallOption) (*MsgRecvPacketResponse, error) - // Timeout defines a rpc handler method for MsgTimeout. - Timeout(ctx context.Context, in *MsgTimeout, opts ...grpc.CallOption) (*MsgTimeoutResponse, error) - // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. - TimeoutOnClose(ctx context.Context, in *MsgTimeoutOnClose, opts ...grpc.CallOption) (*MsgTimeoutOnCloseResponse, error) - // Acknowledgement defines a rpc handler method for MsgAcknowledgement. - Acknowledgement(ctx context.Context, in *MsgAcknowledgement, opts ...grpc.CallOption) (*MsgAcknowledgementResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) ChannelOpenInit(ctx context.Context, in *MsgChannelOpenInit, opts ...grpc.CallOption) (*MsgChannelOpenInitResponse, error) { - out := new(MsgChannelOpenInitResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenInit", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ChannelOpenTry(ctx context.Context, in *MsgChannelOpenTry, opts ...grpc.CallOption) (*MsgChannelOpenTryResponse, error) { - out := new(MsgChannelOpenTryResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenTry", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ChannelOpenAck(ctx context.Context, in *MsgChannelOpenAck, opts ...grpc.CallOption) (*MsgChannelOpenAckResponse, error) { - out := new(MsgChannelOpenAckResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenAck", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ChannelOpenConfirm(ctx context.Context, in *MsgChannelOpenConfirm, opts ...grpc.CallOption) (*MsgChannelOpenConfirmResponse, error) { - out := new(MsgChannelOpenConfirmResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenConfirm", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ChannelCloseInit(ctx context.Context, in *MsgChannelCloseInit, opts ...grpc.CallOption) (*MsgChannelCloseInitResponse, error) { - out := new(MsgChannelCloseInitResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelCloseInit", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ChannelCloseConfirm(ctx context.Context, in *MsgChannelCloseConfirm, opts ...grpc.CallOption) (*MsgChannelCloseConfirmResponse, error) { - out := new(MsgChannelCloseConfirmResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelCloseConfirm", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) RecvPacket(ctx context.Context, in *MsgRecvPacket, opts ...grpc.CallOption) (*MsgRecvPacketResponse, error) { - out := new(MsgRecvPacketResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/RecvPacket", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Timeout(ctx context.Context, in *MsgTimeout, opts ...grpc.CallOption) (*MsgTimeoutResponse, error) { - out := new(MsgTimeoutResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/Timeout", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) TimeoutOnClose(ctx context.Context, in *MsgTimeoutOnClose, opts ...grpc.CallOption) (*MsgTimeoutOnCloseResponse, error) { - out := new(MsgTimeoutOnCloseResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/TimeoutOnClose", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Acknowledgement(ctx context.Context, in *MsgAcknowledgement, opts ...grpc.CallOption) (*MsgAcknowledgementResponse, error) { - out := new(MsgAcknowledgementResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/Acknowledgement", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. - ChannelOpenInit(context.Context, *MsgChannelOpenInit) (*MsgChannelOpenInitResponse, error) - // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. - ChannelOpenTry(context.Context, *MsgChannelOpenTry) (*MsgChannelOpenTryResponse, error) - // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. - ChannelOpenAck(context.Context, *MsgChannelOpenAck) (*MsgChannelOpenAckResponse, error) - // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. - ChannelOpenConfirm(context.Context, *MsgChannelOpenConfirm) (*MsgChannelOpenConfirmResponse, error) - // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. - ChannelCloseInit(context.Context, *MsgChannelCloseInit) (*MsgChannelCloseInitResponse, error) - // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. - ChannelCloseConfirm(context.Context, *MsgChannelCloseConfirm) (*MsgChannelCloseConfirmResponse, error) - // RecvPacket defines a rpc handler method for MsgRecvPacket. - RecvPacket(context.Context, *MsgRecvPacket) (*MsgRecvPacketResponse, error) - // Timeout defines a rpc handler method for MsgTimeout. - Timeout(context.Context, *MsgTimeout) (*MsgTimeoutResponse, error) - // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. - TimeoutOnClose(context.Context, *MsgTimeoutOnClose) (*MsgTimeoutOnCloseResponse, error) - // Acknowledgement defines a rpc handler method for MsgAcknowledgement. - Acknowledgement(context.Context, *MsgAcknowledgement) (*MsgAcknowledgementResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) ChannelOpenInit(ctx context.Context, req *MsgChannelOpenInit) (*MsgChannelOpenInitResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenInit not implemented") -} -func (*UnimplementedMsgServer) ChannelOpenTry(ctx context.Context, req *MsgChannelOpenTry) (*MsgChannelOpenTryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenTry not implemented") -} -func (*UnimplementedMsgServer) ChannelOpenAck(ctx context.Context, req *MsgChannelOpenAck) (*MsgChannelOpenAckResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenAck not implemented") -} -func (*UnimplementedMsgServer) ChannelOpenConfirm(ctx context.Context, req *MsgChannelOpenConfirm) (*MsgChannelOpenConfirmResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenConfirm not implemented") -} -func (*UnimplementedMsgServer) ChannelCloseInit(ctx context.Context, req *MsgChannelCloseInit) (*MsgChannelCloseInitResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChannelCloseInit not implemented") -} -func (*UnimplementedMsgServer) ChannelCloseConfirm(ctx context.Context, req *MsgChannelCloseConfirm) (*MsgChannelCloseConfirmResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChannelCloseConfirm not implemented") -} -func (*UnimplementedMsgServer) RecvPacket(ctx context.Context, req *MsgRecvPacket) (*MsgRecvPacketResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RecvPacket not implemented") -} -func (*UnimplementedMsgServer) Timeout(ctx context.Context, req *MsgTimeout) (*MsgTimeoutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Timeout not implemented") -} -func (*UnimplementedMsgServer) TimeoutOnClose(ctx context.Context, req *MsgTimeoutOnClose) (*MsgTimeoutOnCloseResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TimeoutOnClose not implemented") -} -func (*UnimplementedMsgServer) Acknowledgement(ctx context.Context, req *MsgAcknowledgement) (*MsgAcknowledgementResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Acknowledgement not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_ChannelOpenInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgChannelOpenInit) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ChannelOpenInit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenInit", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ChannelOpenInit(ctx, req.(*MsgChannelOpenInit)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ChannelOpenTry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgChannelOpenTry) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ChannelOpenTry(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenTry", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ChannelOpenTry(ctx, req.(*MsgChannelOpenTry)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ChannelOpenAck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgChannelOpenAck) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ChannelOpenAck(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenAck", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ChannelOpenAck(ctx, req.(*MsgChannelOpenAck)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ChannelOpenConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgChannelOpenConfirm) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ChannelOpenConfirm(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenConfirm", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ChannelOpenConfirm(ctx, req.(*MsgChannelOpenConfirm)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ChannelCloseInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgChannelCloseInit) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ChannelCloseInit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v1.Msg/ChannelCloseInit", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ChannelCloseInit(ctx, req.(*MsgChannelCloseInit)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ChannelCloseConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgChannelCloseConfirm) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ChannelCloseConfirm(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v1.Msg/ChannelCloseConfirm", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ChannelCloseConfirm(ctx, req.(*MsgChannelCloseConfirm)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_RecvPacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRecvPacket) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RecvPacket(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v1.Msg/RecvPacket", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RecvPacket(ctx, req.(*MsgRecvPacket)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Timeout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgTimeout) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Timeout(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v1.Msg/Timeout", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Timeout(ctx, req.(*MsgTimeout)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_TimeoutOnClose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgTimeoutOnClose) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).TimeoutOnClose(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v1.Msg/TimeoutOnClose", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).TimeoutOnClose(ctx, req.(*MsgTimeoutOnClose)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Acknowledgement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAcknowledgement) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Acknowledgement(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v1.Msg/Acknowledgement", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Acknowledgement(ctx, req.(*MsgAcknowledgement)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "ibc.core.channel.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ChannelOpenInit", - Handler: _Msg_ChannelOpenInit_Handler, - }, - { - MethodName: "ChannelOpenTry", - Handler: _Msg_ChannelOpenTry_Handler, - }, - { - MethodName: "ChannelOpenAck", - Handler: _Msg_ChannelOpenAck_Handler, - }, - { - MethodName: "ChannelOpenConfirm", - Handler: _Msg_ChannelOpenConfirm_Handler, - }, - { - MethodName: "ChannelCloseInit", - Handler: _Msg_ChannelCloseInit_Handler, - }, - { - MethodName: "ChannelCloseConfirm", - Handler: _Msg_ChannelCloseConfirm_Handler, - }, - { - MethodName: "RecvPacket", - Handler: _Msg_RecvPacket_Handler, - }, - { - MethodName: "Timeout", - Handler: _Msg_Timeout_Handler, - }, - { - MethodName: "TimeoutOnClose", - Handler: _Msg_TimeoutOnClose_Handler, - }, - { - MethodName: "Acknowledgement", - Handler: _Msg_Acknowledgement_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "ibc/core/channel/v1/channel.proto", -} - -func (m *MsgChannelOpenInit) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgChannelOpenInit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgChannelOpenInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.Channel.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.ChannelId) > 0 { - i -= len(m.ChannelId) - copy(dAtA[i:], m.ChannelId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.ChannelId))) - i-- - dAtA[i] = 0x12 - } - if len(m.PortId) > 0 { - i -= len(m.PortId) - copy(dAtA[i:], m.PortId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.PortId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgChannelOpenInitResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgChannelOpenInitResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgChannelOpenInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgChannelOpenTry) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgChannelOpenTry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgChannelOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x42 - } - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - if len(m.ProofInit) > 0 { - i -= len(m.ProofInit) - copy(dAtA[i:], m.ProofInit) - i = encodeVarintChannel(dAtA, i, uint64(len(m.ProofInit))) - i-- - dAtA[i] = 0x32 - } - if len(m.CounterpartyVersion) > 0 { - i -= len(m.CounterpartyVersion) - copy(dAtA[i:], m.CounterpartyVersion) - i = encodeVarintChannel(dAtA, i, uint64(len(m.CounterpartyVersion))) - i-- - dAtA[i] = 0x2a - } - { - size, err := m.Channel.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.CounterpartyChosenChannelId) > 0 { - i -= len(m.CounterpartyChosenChannelId) - copy(dAtA[i:], m.CounterpartyChosenChannelId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.CounterpartyChosenChannelId))) - i-- - dAtA[i] = 0x1a - } - if len(m.DesiredChannelId) > 0 { - i -= len(m.DesiredChannelId) - copy(dAtA[i:], m.DesiredChannelId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.DesiredChannelId))) - i-- - dAtA[i] = 0x12 - } - if len(m.PortId) > 0 { - i -= len(m.PortId) - copy(dAtA[i:], m.PortId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.PortId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgChannelOpenTryResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgChannelOpenTryResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgChannelOpenTryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgChannelOpenAck) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgChannelOpenAck) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgChannelOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x3a - } - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - if len(m.ProofTry) > 0 { - i -= len(m.ProofTry) - copy(dAtA[i:], m.ProofTry) - i = encodeVarintChannel(dAtA, i, uint64(len(m.ProofTry))) - i-- - dAtA[i] = 0x2a - } - if len(m.CounterpartyVersion) > 0 { - i -= len(m.CounterpartyVersion) - copy(dAtA[i:], m.CounterpartyVersion) - i = encodeVarintChannel(dAtA, i, uint64(len(m.CounterpartyVersion))) - i-- - dAtA[i] = 0x22 - } - if len(m.CounterpartyChannelId) > 0 { - i -= len(m.CounterpartyChannelId) - copy(dAtA[i:], m.CounterpartyChannelId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.CounterpartyChannelId))) - i-- - dAtA[i] = 0x1a - } - if len(m.ChannelId) > 0 { - i -= len(m.ChannelId) - copy(dAtA[i:], m.ChannelId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.ChannelId))) - i-- - dAtA[i] = 0x12 - } - if len(m.PortId) > 0 { - i -= len(m.PortId) - copy(dAtA[i:], m.PortId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.PortId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgChannelOpenAckResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgChannelOpenAckResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgChannelOpenAckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgChannelOpenConfirm) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgChannelOpenConfirm) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgChannelOpenConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x2a - } - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.ProofAck) > 0 { - i -= len(m.ProofAck) - copy(dAtA[i:], m.ProofAck) - i = encodeVarintChannel(dAtA, i, uint64(len(m.ProofAck))) - i-- - dAtA[i] = 0x1a - } - if len(m.ChannelId) > 0 { - i -= len(m.ChannelId) - copy(dAtA[i:], m.ChannelId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.ChannelId))) - i-- - dAtA[i] = 0x12 - } - if len(m.PortId) > 0 { - i -= len(m.PortId) - copy(dAtA[i:], m.PortId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.PortId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgChannelOpenConfirmResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgChannelOpenConfirmResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgChannelOpenConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgChannelCloseInit) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgChannelCloseInit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgChannelCloseInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x1a - } - if len(m.ChannelId) > 0 { - i -= len(m.ChannelId) - copy(dAtA[i:], m.ChannelId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.ChannelId))) - i-- - dAtA[i] = 0x12 - } - if len(m.PortId) > 0 { - i -= len(m.PortId) - copy(dAtA[i:], m.PortId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.PortId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgChannelCloseInitResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgChannelCloseInitResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgChannelCloseInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgChannelCloseConfirm) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgChannelCloseConfirm) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgChannelCloseConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x2a - } - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.ProofInit) > 0 { - i -= len(m.ProofInit) - copy(dAtA[i:], m.ProofInit) - i = encodeVarintChannel(dAtA, i, uint64(len(m.ProofInit))) - i-- - dAtA[i] = 0x1a - } - if len(m.ChannelId) > 0 { - i -= len(m.ChannelId) - copy(dAtA[i:], m.ChannelId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.ChannelId))) - i-- - dAtA[i] = 0x12 - } - if len(m.PortId) > 0 { - i -= len(m.PortId) - copy(dAtA[i:], m.PortId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.PortId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgChannelCloseConfirmResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgChannelCloseConfirmResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgChannelCloseConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgRecvPacket) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgRecvPacket) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRecvPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Proof) > 0 { - i -= len(m.Proof) - copy(dAtA[i:], m.Proof) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Proof))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Packet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *MsgRecvPacketResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgRecvPacketResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRecvPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgTimeout) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgTimeout) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgTimeout) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x2a - } - if m.NextSequenceRecv != 0 { - i = encodeVarintChannel(dAtA, i, uint64(m.NextSequenceRecv)) - i-- - dAtA[i] = 0x20 - } - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Proof) > 0 { - i -= len(m.Proof) - copy(dAtA[i:], m.Proof) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Proof))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Packet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *MsgTimeoutResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgTimeoutResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgTimeoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgTimeoutOnClose) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgTimeoutOnClose) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgTimeoutOnClose) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x32 - } - if m.NextSequenceRecv != 0 { - i = encodeVarintChannel(dAtA, i, uint64(m.NextSequenceRecv)) - i-- - dAtA[i] = 0x28 - } - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.ProofClose) > 0 { - i -= len(m.ProofClose) - copy(dAtA[i:], m.ProofClose) - i = encodeVarintChannel(dAtA, i, uint64(len(m.ProofClose))) - i-- - dAtA[i] = 0x1a - } - if len(m.Proof) > 0 { - i -= len(m.Proof) - copy(dAtA[i:], m.Proof) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Proof))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Packet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *MsgTimeoutOnCloseResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgTimeoutOnCloseResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgTimeoutOnCloseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgAcknowledgement) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgAcknowledgement) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgAcknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x2a - } - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.Proof) > 0 { - i -= len(m.Proof) - copy(dAtA[i:], m.Proof) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Proof))) - i-- - dAtA[i] = 0x1a - } - if len(m.Acknowledgement) > 0 { - i -= len(m.Acknowledgement) - copy(dAtA[i:], m.Acknowledgement) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Acknowledgement))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Packet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *MsgAcknowledgementResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgAcknowledgementResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgAcknowledgementResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil + // 916 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0x16, 0x25, 0xea, 0x6f, 0x2c, 0xc9, 0xf2, 0xba, 0x56, 0x58, 0x36, 0x11, 0x15, 0xa2, 0x07, + 0x23, 0x45, 0xa4, 0x38, 0x0d, 0xda, 0x22, 0xa7, 0x5a, 0x3f, 0x81, 0x89, 0x06, 0x92, 0x41, 0xc9, + 0x87, 0xe6, 0xa2, 0xd2, 0xe4, 0x56, 0x22, 0x2c, 0x71, 0x55, 0x72, 0x65, 0xd7, 0x6f, 0x10, 0xe8, + 0xd4, 0x17, 0x10, 0x50, 0xa0, 0xe8, 0xb5, 0xd7, 0xbe, 0x42, 0x8e, 0x39, 0xf6, 0x24, 0x14, 0xf6, + 0xa1, 0x77, 0xbd, 0x40, 0x0b, 0xee, 0x2e, 0xf5, 0xe3, 0x04, 0x39, 0xf6, 0x94, 0x13, 0x77, 0xbe, + 0xef, 0x9b, 0x99, 0x8f, 0x3b, 0x03, 0x12, 0x1e, 0xba, 0xe7, 0x76, 0xcd, 0x26, 0x3e, 0xae, 0xd9, + 0x43, 0xcb, 0xf3, 0xf0, 0xa8, 0x76, 0x79, 0x14, 0x1d, 0xab, 0x13, 0x9f, 0x50, 0x82, 0xf6, 0xdd, + 0x73, 0xbb, 0x1a, 0x4a, 0xaa, 0x11, 0x7e, 0x79, 0xa4, 0x7e, 0x32, 0x20, 0x03, 0xc2, 0xf8, 0x5a, + 0x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, 0x93, 0x60, 0x4c, 0x02, 0xf1, 0x78, 0x1c, 0x38, + 0x17, 0xb5, 0x9f, 0x6b, 0xab, 0x7f, 0xf3, 0x93, 0x67, 0x8f, 0xa3, 0x9f, 0x3d, 0xbd, 0x9e, 0xe0, + 0xe0, 0x3c, 0xc5, 0x7e, 0xce, 0x5f, 0xfe, 0x17, 0x00, 0x00, 0xff, 0xff, 0xfd, 0xef, 0x9f, 0xe3, + 0x0d, 0x08, 0x00, 0x00, } func (m *Channel) Marshal() (dAtA []byte, err error) { @@ -3045,364 +887,6 @@ func encodeVarintChannel(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgChannelOpenInit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PortId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.ChannelId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = m.Channel.Size() - n += 1 + l + sovChannel(uint64(l)) - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - return n -} - -func (m *MsgChannelOpenInitResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgChannelOpenTry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PortId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.DesiredChannelId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.CounterpartyChosenChannelId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = m.Channel.Size() - n += 1 + l + sovChannel(uint64(l)) - l = len(m.CounterpartyVersion) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.ProofInit) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = m.ProofHeight.Size() - n += 1 + l + sovChannel(uint64(l)) - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - return n -} - -func (m *MsgChannelOpenTryResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgChannelOpenAck) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PortId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.ChannelId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.CounterpartyChannelId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.CounterpartyVersion) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.ProofTry) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = m.ProofHeight.Size() - n += 1 + l + sovChannel(uint64(l)) - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - return n -} - -func (m *MsgChannelOpenAckResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgChannelOpenConfirm) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PortId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.ChannelId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.ProofAck) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = m.ProofHeight.Size() - n += 1 + l + sovChannel(uint64(l)) - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - return n -} - -func (m *MsgChannelOpenConfirmResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgChannelCloseInit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PortId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.ChannelId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - return n -} - -func (m *MsgChannelCloseInitResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgChannelCloseConfirm) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PortId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.ChannelId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.ProofInit) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = m.ProofHeight.Size() - n += 1 + l + sovChannel(uint64(l)) - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - return n -} - -func (m *MsgChannelCloseConfirmResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgRecvPacket) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Packet.Size() - n += 1 + l + sovChannel(uint64(l)) - l = len(m.Proof) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = m.ProofHeight.Size() - n += 1 + l + sovChannel(uint64(l)) - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - return n -} - -func (m *MsgRecvPacketResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgTimeout) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Packet.Size() - n += 1 + l + sovChannel(uint64(l)) - l = len(m.Proof) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = m.ProofHeight.Size() - n += 1 + l + sovChannel(uint64(l)) - if m.NextSequenceRecv != 0 { - n += 1 + sovChannel(uint64(m.NextSequenceRecv)) - } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - return n -} - -func (m *MsgTimeoutResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgTimeoutOnClose) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Packet.Size() - n += 1 + l + sovChannel(uint64(l)) - l = len(m.Proof) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.ProofClose) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = m.ProofHeight.Size() - n += 1 + l + sovChannel(uint64(l)) - if m.NextSequenceRecv != 0 { - n += 1 + sovChannel(uint64(m.NextSequenceRecv)) - } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - return n -} - -func (m *MsgTimeoutOnCloseResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgAcknowledgement) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Packet.Size() - n += 1 + l + sovChannel(uint64(l)) - l = len(m.Acknowledgement) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.Proof) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = m.ProofHeight.Size() - n += 1 + l + sovChannel(uint64(l)) - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - return n -} - -func (m *MsgAcknowledgementResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *Channel) Size() (n int) { if m == nil { return 0 @@ -3584,2738 +1068,6 @@ func sovChannel(x uint64) (n int) { func sozChannel(x uint64) (n int) { return sovChannel(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgChannelOpenInit) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChannelOpenInit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChannelOpenInit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PortId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Channel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChannelOpenInitResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChannelOpenInitResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChannelOpenInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChannelOpenTry) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChannelOpenTry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChannelOpenTry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PortId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DesiredChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChosenChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CounterpartyChosenChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Channel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyVersion", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CounterpartyVersion = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofInit", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProofInit = append(m.ProofInit[:0], dAtA[iNdEx:postIndex]...) - if m.ProofInit == nil { - m.ProofInit = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChannelOpenTryResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChannelOpenTryResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChannelOpenTryResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChannelOpenAck) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChannelOpenAck: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChannelOpenAck: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PortId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CounterpartyChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyVersion", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CounterpartyVersion = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofTry", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProofTry = append(m.ProofTry[:0], dAtA[iNdEx:postIndex]...) - if m.ProofTry == nil { - m.ProofTry = []byte{} - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChannelOpenAckResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChannelOpenAckResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChannelOpenAckResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChannelOpenConfirm) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChannelOpenConfirm: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChannelOpenConfirm: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PortId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofAck", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProofAck = append(m.ProofAck[:0], dAtA[iNdEx:postIndex]...) - if m.ProofAck == nil { - m.ProofAck = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChannelOpenConfirmResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChannelOpenConfirmResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChannelOpenConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChannelCloseInit) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChannelCloseInit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChannelCloseInit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PortId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChannelCloseInitResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChannelCloseInitResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChannelCloseInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChannelCloseConfirm) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChannelCloseConfirm: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChannelCloseConfirm: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PortId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofInit", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProofInit = append(m.ProofInit[:0], dAtA[iNdEx:postIndex]...) - if m.ProofInit == nil { - m.ProofInit = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChannelCloseConfirmResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChannelCloseConfirmResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChannelCloseConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRecvPacket) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRecvPacket: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRecvPacket: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Packet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) - if m.Proof == nil { - m.Proof = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRecvPacketResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRecvPacketResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRecvPacketResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgTimeout) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgTimeout: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTimeout: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Packet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) - if m.Proof == nil { - m.Proof = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NextSequenceRecv", wireType) - } - m.NextSequenceRecv = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NextSequenceRecv |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgTimeoutResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgTimeoutResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTimeoutResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgTimeoutOnClose) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgTimeoutOnClose: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTimeoutOnClose: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Packet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) - if m.Proof == nil { - m.Proof = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofClose", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProofClose = append(m.ProofClose[:0], dAtA[iNdEx:postIndex]...) - if m.ProofClose == nil { - m.ProofClose = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NextSequenceRecv", wireType) - } - m.NextSequenceRecv = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NextSequenceRecv |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgTimeoutOnCloseResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgTimeoutOnCloseResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTimeoutOnCloseResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgAcknowledgement: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAcknowledgement: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Packet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Acknowledgement", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Acknowledgement = append(m.Acknowledgement[:0], dAtA[iNdEx:postIndex]...) - if m.Acknowledgement == nil { - m.Acknowledgement = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) - if m.Proof == nil { - m.Proof = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgAcknowledgementResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgAcknowledgementResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAcknowledgementResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Channel) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ibc/core/04-channel/types/tx.pb.go b/x/ibc/core/04-channel/types/tx.pb.go new file mode 100644 index 0000000000..2ad25780da --- /dev/null +++ b/x/ibc/core/04-channel/types/tx.pb.go @@ -0,0 +1,5405 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/core/channel/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It +// is called by a relayer on Chain A. +type MsgChannelOpenInit struct { + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + Channel Channel `protobuf:"bytes,3,opt,name=channel,proto3" json:"channel"` + Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgChannelOpenInit) Reset() { *m = MsgChannelOpenInit{} } +func (m *MsgChannelOpenInit) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenInit) ProtoMessage() {} +func (*MsgChannelOpenInit) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{0} +} +func (m *MsgChannelOpenInit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenInit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenInit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelOpenInit) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenInit.Merge(m, src) +} +func (m *MsgChannelOpenInit) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenInit) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenInit.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenInit proto.InternalMessageInfo + +// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +type MsgChannelOpenInitResponse struct { +} + +func (m *MsgChannelOpenInitResponse) Reset() { *m = MsgChannelOpenInitResponse{} } +func (m *MsgChannelOpenInitResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenInitResponse) ProtoMessage() {} +func (*MsgChannelOpenInitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{1} +} +func (m *MsgChannelOpenInitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenInitResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelOpenInitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenInitResponse.Merge(m, src) +} +func (m *MsgChannelOpenInitResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenInitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenInitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenInitResponse proto.InternalMessageInfo + +// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +// on Chain B. +type MsgChannelOpenTry struct { + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + DesiredChannelId string `protobuf:"bytes,2,opt,name=desired_channel_id,json=desiredChannelId,proto3" json:"desired_channel_id,omitempty" yaml:"desired_channel_id"` + CounterpartyChosenChannelId string `protobuf:"bytes,3,opt,name=counterparty_chosen_channel_id,json=counterpartyChosenChannelId,proto3" json:"counterparty_chosen_channel_id,omitempty" yaml:"counterparty_chosen_channel_id"` + Channel Channel `protobuf:"bytes,4,opt,name=channel,proto3" json:"channel"` + CounterpartyVersion string `protobuf:"bytes,5,opt,name=counterparty_version,json=counterpartyVersion,proto3" json:"counterparty_version,omitempty" yaml:"counterparty_version"` + ProofInit []byte `protobuf:"bytes,6,opt,name=proof_init,json=proofInit,proto3" json:"proof_init,omitempty" yaml:"proof_init"` + ProofHeight types.Height `protobuf:"bytes,7,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` + Signer string `protobuf:"bytes,8,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgChannelOpenTry) Reset() { *m = MsgChannelOpenTry{} } +func (m *MsgChannelOpenTry) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenTry) ProtoMessage() {} +func (*MsgChannelOpenTry) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{2} +} +func (m *MsgChannelOpenTry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenTry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenTry.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelOpenTry) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenTry.Merge(m, src) +} +func (m *MsgChannelOpenTry) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenTry) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenTry.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenTry proto.InternalMessageInfo + +// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +type MsgChannelOpenTryResponse struct { +} + +func (m *MsgChannelOpenTryResponse) Reset() { *m = MsgChannelOpenTryResponse{} } +func (m *MsgChannelOpenTryResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenTryResponse) ProtoMessage() {} +func (*MsgChannelOpenTryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{3} +} +func (m *MsgChannelOpenTryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenTryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenTryResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelOpenTryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenTryResponse.Merge(m, src) +} +func (m *MsgChannelOpenTryResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenTryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenTryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenTryResponse proto.InternalMessageInfo + +// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge +// the change of channel state to TRYOPEN on Chain B. +type MsgChannelOpenAck struct { + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + CounterpartyChannelId string `protobuf:"bytes,3,opt,name=counterparty_channel_id,json=counterpartyChannelId,proto3" json:"counterparty_channel_id,omitempty" yaml:"counterparty_channel_id"` + CounterpartyVersion string `protobuf:"bytes,4,opt,name=counterparty_version,json=counterpartyVersion,proto3" json:"counterparty_version,omitempty" yaml:"counterparty_version"` + ProofTry []byte `protobuf:"bytes,5,opt,name=proof_try,json=proofTry,proto3" json:"proof_try,omitempty" yaml:"proof_try"` + ProofHeight types.Height `protobuf:"bytes,6,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` + Signer string `protobuf:"bytes,7,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgChannelOpenAck) Reset() { *m = MsgChannelOpenAck{} } +func (m *MsgChannelOpenAck) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenAck) ProtoMessage() {} +func (*MsgChannelOpenAck) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{4} +} +func (m *MsgChannelOpenAck) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenAck.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelOpenAck) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenAck.Merge(m, src) +} +func (m *MsgChannelOpenAck) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenAck) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenAck.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenAck proto.InternalMessageInfo + +// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. +type MsgChannelOpenAckResponse struct { +} + +func (m *MsgChannelOpenAckResponse) Reset() { *m = MsgChannelOpenAckResponse{} } +func (m *MsgChannelOpenAckResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenAckResponse) ProtoMessage() {} +func (*MsgChannelOpenAckResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{5} +} +func (m *MsgChannelOpenAckResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenAckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenAckResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelOpenAckResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenAckResponse.Merge(m, src) +} +func (m *MsgChannelOpenAckResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenAckResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenAckResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenAckResponse proto.InternalMessageInfo + +// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to +// acknowledge the change of channel state to OPEN on Chain A. +type MsgChannelOpenConfirm struct { + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + ProofAck []byte `protobuf:"bytes,3,opt,name=proof_ack,json=proofAck,proto3" json:"proof_ack,omitempty" yaml:"proof_ack"` + ProofHeight types.Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` + Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgChannelOpenConfirm) Reset() { *m = MsgChannelOpenConfirm{} } +func (m *MsgChannelOpenConfirm) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenConfirm) ProtoMessage() {} +func (*MsgChannelOpenConfirm) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{6} +} +func (m *MsgChannelOpenConfirm) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenConfirm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenConfirm.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelOpenConfirm) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenConfirm.Merge(m, src) +} +func (m *MsgChannelOpenConfirm) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenConfirm) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenConfirm.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenConfirm proto.InternalMessageInfo + +// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response type. +type MsgChannelOpenConfirmResponse struct { +} + +func (m *MsgChannelOpenConfirmResponse) Reset() { *m = MsgChannelOpenConfirmResponse{} } +func (m *MsgChannelOpenConfirmResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenConfirmResponse) ProtoMessage() {} +func (*MsgChannelOpenConfirmResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{7} +} +func (m *MsgChannelOpenConfirmResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenConfirmResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelOpenConfirmResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenConfirmResponse.Merge(m, src) +} +func (m *MsgChannelOpenConfirmResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenConfirmResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenConfirmResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenConfirmResponse proto.InternalMessageInfo + +// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A +// to close a channel with Chain B. +type MsgChannelCloseInit struct { + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgChannelCloseInit) Reset() { *m = MsgChannelCloseInit{} } +func (m *MsgChannelCloseInit) String() string { return proto.CompactTextString(m) } +func (*MsgChannelCloseInit) ProtoMessage() {} +func (*MsgChannelCloseInit) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{8} +} +func (m *MsgChannelCloseInit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelCloseInit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelCloseInit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelCloseInit) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelCloseInit.Merge(m, src) +} +func (m *MsgChannelCloseInit) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelCloseInit) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelCloseInit.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelCloseInit proto.InternalMessageInfo + +// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +type MsgChannelCloseInitResponse struct { +} + +func (m *MsgChannelCloseInitResponse) Reset() { *m = MsgChannelCloseInitResponse{} } +func (m *MsgChannelCloseInitResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelCloseInitResponse) ProtoMessage() {} +func (*MsgChannelCloseInitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{9} +} +func (m *MsgChannelCloseInitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelCloseInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelCloseInitResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelCloseInitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelCloseInitResponse.Merge(m, src) +} +func (m *MsgChannelCloseInitResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelCloseInitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelCloseInitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelCloseInitResponse proto.InternalMessageInfo + +// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B +// to acknowledge the change of channel state to CLOSED on Chain A. +type MsgChannelCloseConfirm struct { + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + ProofInit []byte `protobuf:"bytes,3,opt,name=proof_init,json=proofInit,proto3" json:"proof_init,omitempty" yaml:"proof_init"` + ProofHeight types.Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` + Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgChannelCloseConfirm) Reset() { *m = MsgChannelCloseConfirm{} } +func (m *MsgChannelCloseConfirm) String() string { return proto.CompactTextString(m) } +func (*MsgChannelCloseConfirm) ProtoMessage() {} +func (*MsgChannelCloseConfirm) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{10} +} +func (m *MsgChannelCloseConfirm) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelCloseConfirm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelCloseConfirm.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelCloseConfirm) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelCloseConfirm.Merge(m, src) +} +func (m *MsgChannelCloseConfirm) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelCloseConfirm) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelCloseConfirm.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelCloseConfirm proto.InternalMessageInfo + +// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response type. +type MsgChannelCloseConfirmResponse struct { +} + +func (m *MsgChannelCloseConfirmResponse) Reset() { *m = MsgChannelCloseConfirmResponse{} } +func (m *MsgChannelCloseConfirmResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelCloseConfirmResponse) ProtoMessage() {} +func (*MsgChannelCloseConfirmResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{11} +} +func (m *MsgChannelCloseConfirmResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelCloseConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelCloseConfirmResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgChannelCloseConfirmResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelCloseConfirmResponse.Merge(m, src) +} +func (m *MsgChannelCloseConfirmResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelCloseConfirmResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelCloseConfirmResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelCloseConfirmResponse proto.InternalMessageInfo + +// MsgRecvPacket receives incoming IBC packet +type MsgRecvPacket struct { + Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` + Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` + ProofHeight types.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` + Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgRecvPacket) Reset() { *m = MsgRecvPacket{} } +func (m *MsgRecvPacket) String() string { return proto.CompactTextString(m) } +func (*MsgRecvPacket) ProtoMessage() {} +func (*MsgRecvPacket) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{12} +} +func (m *MsgRecvPacket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRecvPacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRecvPacket.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRecvPacket) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRecvPacket.Merge(m, src) +} +func (m *MsgRecvPacket) XXX_Size() int { + return m.Size() +} +func (m *MsgRecvPacket) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRecvPacket.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRecvPacket proto.InternalMessageInfo + +// MsgRecvPacketResponse defines the Msg/RecvPacket response type. +type MsgRecvPacketResponse struct { +} + +func (m *MsgRecvPacketResponse) Reset() { *m = MsgRecvPacketResponse{} } +func (m *MsgRecvPacketResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRecvPacketResponse) ProtoMessage() {} +func (*MsgRecvPacketResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{13} +} +func (m *MsgRecvPacketResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRecvPacketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRecvPacketResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRecvPacketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRecvPacketResponse.Merge(m, src) +} +func (m *MsgRecvPacketResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRecvPacketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRecvPacketResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRecvPacketResponse proto.InternalMessageInfo + +// MsgTimeout receives timed-out packet +type MsgTimeout struct { + Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` + Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` + ProofHeight types.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` + NextSequenceRecv uint64 `protobuf:"varint,4,opt,name=next_sequence_recv,json=nextSequenceRecv,proto3" json:"next_sequence_recv,omitempty" yaml:"next_sequence_recv"` + Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgTimeout) Reset() { *m = MsgTimeout{} } +func (m *MsgTimeout) String() string { return proto.CompactTextString(m) } +func (*MsgTimeout) ProtoMessage() {} +func (*MsgTimeout) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{14} +} +func (m *MsgTimeout) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTimeout) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTimeout.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgTimeout) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTimeout.Merge(m, src) +} +func (m *MsgTimeout) XXX_Size() int { + return m.Size() +} +func (m *MsgTimeout) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTimeout.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTimeout proto.InternalMessageInfo + +// MsgTimeoutResponse defines the Msg/Timeout response type. +type MsgTimeoutResponse struct { +} + +func (m *MsgTimeoutResponse) Reset() { *m = MsgTimeoutResponse{} } +func (m *MsgTimeoutResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTimeoutResponse) ProtoMessage() {} +func (*MsgTimeoutResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{15} +} +func (m *MsgTimeoutResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTimeoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTimeoutResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgTimeoutResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTimeoutResponse.Merge(m, src) +} +func (m *MsgTimeoutResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTimeoutResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTimeoutResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTimeoutResponse proto.InternalMessageInfo + +// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. +type MsgTimeoutOnClose struct { + Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` + Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` + ProofClose []byte `protobuf:"bytes,3,opt,name=proof_close,json=proofClose,proto3" json:"proof_close,omitempty" yaml:"proof_close"` + ProofHeight types.Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` + NextSequenceRecv uint64 `protobuf:"varint,5,opt,name=next_sequence_recv,json=nextSequenceRecv,proto3" json:"next_sequence_recv,omitempty" yaml:"next_sequence_recv"` + Signer string `protobuf:"bytes,6,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgTimeoutOnClose) Reset() { *m = MsgTimeoutOnClose{} } +func (m *MsgTimeoutOnClose) String() string { return proto.CompactTextString(m) } +func (*MsgTimeoutOnClose) ProtoMessage() {} +func (*MsgTimeoutOnClose) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{16} +} +func (m *MsgTimeoutOnClose) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTimeoutOnClose) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTimeoutOnClose.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgTimeoutOnClose) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTimeoutOnClose.Merge(m, src) +} +func (m *MsgTimeoutOnClose) XXX_Size() int { + return m.Size() +} +func (m *MsgTimeoutOnClose) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTimeoutOnClose.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTimeoutOnClose proto.InternalMessageInfo + +// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. +type MsgTimeoutOnCloseResponse struct { +} + +func (m *MsgTimeoutOnCloseResponse) Reset() { *m = MsgTimeoutOnCloseResponse{} } +func (m *MsgTimeoutOnCloseResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTimeoutOnCloseResponse) ProtoMessage() {} +func (*MsgTimeoutOnCloseResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{17} +} +func (m *MsgTimeoutOnCloseResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTimeoutOnCloseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTimeoutOnCloseResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgTimeoutOnCloseResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTimeoutOnCloseResponse.Merge(m, src) +} +func (m *MsgTimeoutOnCloseResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTimeoutOnCloseResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTimeoutOnCloseResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTimeoutOnCloseResponse proto.InternalMessageInfo + +// MsgAcknowledgement receives incoming IBC acknowledgement +type MsgAcknowledgement struct { + Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` + Acknowledgement []byte `protobuf:"bytes,2,opt,name=acknowledgement,proto3" json:"acknowledgement,omitempty"` + Proof []byte `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` + ProofHeight types.Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height" yaml:"proof_height"` + Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgAcknowledgement) Reset() { *m = MsgAcknowledgement{} } +func (m *MsgAcknowledgement) String() string { return proto.CompactTextString(m) } +func (*MsgAcknowledgement) ProtoMessage() {} +func (*MsgAcknowledgement) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{18} +} +func (m *MsgAcknowledgement) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAcknowledgement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAcknowledgement.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAcknowledgement) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAcknowledgement.Merge(m, src) +} +func (m *MsgAcknowledgement) XXX_Size() int { + return m.Size() +} +func (m *MsgAcknowledgement) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAcknowledgement.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAcknowledgement proto.InternalMessageInfo + +// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +type MsgAcknowledgementResponse struct { +} + +func (m *MsgAcknowledgementResponse) Reset() { *m = MsgAcknowledgementResponse{} } +func (m *MsgAcknowledgementResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAcknowledgementResponse) ProtoMessage() {} +func (*MsgAcknowledgementResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bc4637e0ac3fc7b7, []int{19} +} +func (m *MsgAcknowledgementResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAcknowledgementResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAcknowledgementResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAcknowledgementResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAcknowledgementResponse.Merge(m, src) +} +func (m *MsgAcknowledgementResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAcknowledgementResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAcknowledgementResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAcknowledgementResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgChannelOpenInit)(nil), "ibc.core.channel.v1.MsgChannelOpenInit") + proto.RegisterType((*MsgChannelOpenInitResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenInitResponse") + proto.RegisterType((*MsgChannelOpenTry)(nil), "ibc.core.channel.v1.MsgChannelOpenTry") + proto.RegisterType((*MsgChannelOpenTryResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenTryResponse") + proto.RegisterType((*MsgChannelOpenAck)(nil), "ibc.core.channel.v1.MsgChannelOpenAck") + proto.RegisterType((*MsgChannelOpenAckResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenAckResponse") + proto.RegisterType((*MsgChannelOpenConfirm)(nil), "ibc.core.channel.v1.MsgChannelOpenConfirm") + proto.RegisterType((*MsgChannelOpenConfirmResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenConfirmResponse") + proto.RegisterType((*MsgChannelCloseInit)(nil), "ibc.core.channel.v1.MsgChannelCloseInit") + proto.RegisterType((*MsgChannelCloseInitResponse)(nil), "ibc.core.channel.v1.MsgChannelCloseInitResponse") + proto.RegisterType((*MsgChannelCloseConfirm)(nil), "ibc.core.channel.v1.MsgChannelCloseConfirm") + proto.RegisterType((*MsgChannelCloseConfirmResponse)(nil), "ibc.core.channel.v1.MsgChannelCloseConfirmResponse") + proto.RegisterType((*MsgRecvPacket)(nil), "ibc.core.channel.v1.MsgRecvPacket") + proto.RegisterType((*MsgRecvPacketResponse)(nil), "ibc.core.channel.v1.MsgRecvPacketResponse") + proto.RegisterType((*MsgTimeout)(nil), "ibc.core.channel.v1.MsgTimeout") + proto.RegisterType((*MsgTimeoutResponse)(nil), "ibc.core.channel.v1.MsgTimeoutResponse") + proto.RegisterType((*MsgTimeoutOnClose)(nil), "ibc.core.channel.v1.MsgTimeoutOnClose") + proto.RegisterType((*MsgTimeoutOnCloseResponse)(nil), "ibc.core.channel.v1.MsgTimeoutOnCloseResponse") + proto.RegisterType((*MsgAcknowledgement)(nil), "ibc.core.channel.v1.MsgAcknowledgement") + proto.RegisterType((*MsgAcknowledgementResponse)(nil), "ibc.core.channel.v1.MsgAcknowledgementResponse") +} + +func init() { proto.RegisterFile("ibc/core/channel/v1/tx.proto", fileDescriptor_bc4637e0ac3fc7b7) } + +var fileDescriptor_bc4637e0ac3fc7b7 = []byte{ + // 1110 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0x3f, 0x6f, 0xdb, 0x46, + 0x14, 0x17, 0x25, 0x59, 0xb6, 0x9f, 0xdd, 0xc4, 0xa1, 0x64, 0x47, 0xa1, 0x6c, 0xd1, 0x25, 0xd0, + 0x44, 0x4d, 0x11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0x4b, 0xfc, 0x78, 0x48, 0xe9, 0x71, 0x52, 0xa4, 0xb7, 0xde, 0x6b, 0xc8, 0x47, 0xbe, 0x37, + 0x92, 0x38, 0x9a, 0xe4, 0xf9, 0xe4, 0x0a, 0x60, 0x6f, 0xe1, 0x9f, 0x00, 0x02, 0x97, 0xb2, 0x12, + 0xe7, 0xc2, 0xc7, 0x48, 0x0f, 0x2f, 0xc7, 0x78, 0xde, 0x5f, 0xc2, 0xe2, 0xe4, 0xe2, 0x93, 0xe3, + 0xa6, 0x71, 0x80, 0xf4, 0xe0, 0x12, 0x40, 0x50, 0x7b, 0xa1, 0xcb, 0xe0, 0xfe, 0x25, 0x53, 0x39, + 0x2e, 0x5e, 0x7b, 0xd1, 0x47, 0x9e, 0xb3, 0x79, 0xc3, 0xc7, 0x5d, 0x6c, 0x94, 0x21, 0x60, 0xfc, + 0xe6, 0x8d, 0x39, 0x31, 0xea, 0xea, 0xbb, 0xb3, 0xb2, 0xf0, 0xfe, 0xac, 0x2c, 0xfc, 0x73, 0x56, + 0x16, 0x7e, 0x3b, 0x2f, 0xa7, 0xde, 0x9f, 0x97, 0x53, 0x7f, 0x9f, 0x97, 0x53, 0x47, 0xdf, 0x68, + 0xba, 0xd5, 0x39, 0x39, 0xae, 0x22, 0xda, 0xaf, 0x21, 0x6a, 0xf6, 0xa9, 0xc9, 0x7f, 0x1e, 0x99, + 0xed, 0x6e, 0xed, 0xb4, 0xe6, 0xfd, 0x5f, 0xf4, 0xf8, 0xe9, 0xa3, 0xc9, 0x5f, 0x46, 0xd6, 0x68, + 0x80, 0xcd, 0xe3, 0x1c, 0xfb, 0xbb, 0xe8, 0xc9, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd3, 0x86, + 0x17, 0x79, 0xbd, 0x12, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + ChannelOpenInit(ctx context.Context, in *MsgChannelOpenInit, opts ...grpc.CallOption) (*MsgChannelOpenInitResponse, error) + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + ChannelOpenTry(ctx context.Context, in *MsgChannelOpenTry, opts ...grpc.CallOption) (*MsgChannelOpenTryResponse, error) + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + ChannelOpenAck(ctx context.Context, in *MsgChannelOpenAck, opts ...grpc.CallOption) (*MsgChannelOpenAckResponse, error) + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + ChannelOpenConfirm(ctx context.Context, in *MsgChannelOpenConfirm, opts ...grpc.CallOption) (*MsgChannelOpenConfirmResponse, error) + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + ChannelCloseInit(ctx context.Context, in *MsgChannelCloseInit, opts ...grpc.CallOption) (*MsgChannelCloseInitResponse, error) + // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. + ChannelCloseConfirm(ctx context.Context, in *MsgChannelCloseConfirm, opts ...grpc.CallOption) (*MsgChannelCloseConfirmResponse, error) + // RecvPacket defines a rpc handler method for MsgRecvPacket. + RecvPacket(ctx context.Context, in *MsgRecvPacket, opts ...grpc.CallOption) (*MsgRecvPacketResponse, error) + // Timeout defines a rpc handler method for MsgTimeout. + Timeout(ctx context.Context, in *MsgTimeout, opts ...grpc.CallOption) (*MsgTimeoutResponse, error) + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + TimeoutOnClose(ctx context.Context, in *MsgTimeoutOnClose, opts ...grpc.CallOption) (*MsgTimeoutOnCloseResponse, error) + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + Acknowledgement(ctx context.Context, in *MsgAcknowledgement, opts ...grpc.CallOption) (*MsgAcknowledgementResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) ChannelOpenInit(ctx context.Context, in *MsgChannelOpenInit, opts ...grpc.CallOption) (*MsgChannelOpenInitResponse, error) { + out := new(MsgChannelOpenInitResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenInit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelOpenTry(ctx context.Context, in *MsgChannelOpenTry, opts ...grpc.CallOption) (*MsgChannelOpenTryResponse, error) { + out := new(MsgChannelOpenTryResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenTry", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelOpenAck(ctx context.Context, in *MsgChannelOpenAck, opts ...grpc.CallOption) (*MsgChannelOpenAckResponse, error) { + out := new(MsgChannelOpenAckResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenAck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelOpenConfirm(ctx context.Context, in *MsgChannelOpenConfirm, opts ...grpc.CallOption) (*MsgChannelOpenConfirmResponse, error) { + out := new(MsgChannelOpenConfirmResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenConfirm", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelCloseInit(ctx context.Context, in *MsgChannelCloseInit, opts ...grpc.CallOption) (*MsgChannelCloseInitResponse, error) { + out := new(MsgChannelCloseInitResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelCloseInit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelCloseConfirm(ctx context.Context, in *MsgChannelCloseConfirm, opts ...grpc.CallOption) (*MsgChannelCloseConfirmResponse, error) { + out := new(MsgChannelCloseConfirmResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelCloseConfirm", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RecvPacket(ctx context.Context, in *MsgRecvPacket, opts ...grpc.CallOption) (*MsgRecvPacketResponse, error) { + out := new(MsgRecvPacketResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/RecvPacket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Timeout(ctx context.Context, in *MsgTimeout, opts ...grpc.CallOption) (*MsgTimeoutResponse, error) { + out := new(MsgTimeoutResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/Timeout", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) TimeoutOnClose(ctx context.Context, in *MsgTimeoutOnClose, opts ...grpc.CallOption) (*MsgTimeoutOnCloseResponse, error) { + out := new(MsgTimeoutOnCloseResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/TimeoutOnClose", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Acknowledgement(ctx context.Context, in *MsgAcknowledgement, opts ...grpc.CallOption) (*MsgAcknowledgementResponse, error) { + out := new(MsgAcknowledgementResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/Acknowledgement", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + ChannelOpenInit(context.Context, *MsgChannelOpenInit) (*MsgChannelOpenInitResponse, error) + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + ChannelOpenTry(context.Context, *MsgChannelOpenTry) (*MsgChannelOpenTryResponse, error) + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + ChannelOpenAck(context.Context, *MsgChannelOpenAck) (*MsgChannelOpenAckResponse, error) + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + ChannelOpenConfirm(context.Context, *MsgChannelOpenConfirm) (*MsgChannelOpenConfirmResponse, error) + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + ChannelCloseInit(context.Context, *MsgChannelCloseInit) (*MsgChannelCloseInitResponse, error) + // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. + ChannelCloseConfirm(context.Context, *MsgChannelCloseConfirm) (*MsgChannelCloseConfirmResponse, error) + // RecvPacket defines a rpc handler method for MsgRecvPacket. + RecvPacket(context.Context, *MsgRecvPacket) (*MsgRecvPacketResponse, error) + // Timeout defines a rpc handler method for MsgTimeout. + Timeout(context.Context, *MsgTimeout) (*MsgTimeoutResponse, error) + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + TimeoutOnClose(context.Context, *MsgTimeoutOnClose) (*MsgTimeoutOnCloseResponse, error) + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + Acknowledgement(context.Context, *MsgAcknowledgement) (*MsgAcknowledgementResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) ChannelOpenInit(ctx context.Context, req *MsgChannelOpenInit) (*MsgChannelOpenInitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenInit not implemented") +} +func (*UnimplementedMsgServer) ChannelOpenTry(ctx context.Context, req *MsgChannelOpenTry) (*MsgChannelOpenTryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenTry not implemented") +} +func (*UnimplementedMsgServer) ChannelOpenAck(ctx context.Context, req *MsgChannelOpenAck) (*MsgChannelOpenAckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenAck not implemented") +} +func (*UnimplementedMsgServer) ChannelOpenConfirm(ctx context.Context, req *MsgChannelOpenConfirm) (*MsgChannelOpenConfirmResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenConfirm not implemented") +} +func (*UnimplementedMsgServer) ChannelCloseInit(ctx context.Context, req *MsgChannelCloseInit) (*MsgChannelCloseInitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelCloseInit not implemented") +} +func (*UnimplementedMsgServer) ChannelCloseConfirm(ctx context.Context, req *MsgChannelCloseConfirm) (*MsgChannelCloseConfirmResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelCloseConfirm not implemented") +} +func (*UnimplementedMsgServer) RecvPacket(ctx context.Context, req *MsgRecvPacket) (*MsgRecvPacketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecvPacket not implemented") +} +func (*UnimplementedMsgServer) Timeout(ctx context.Context, req *MsgTimeout) (*MsgTimeoutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Timeout not implemented") +} +func (*UnimplementedMsgServer) TimeoutOnClose(ctx context.Context, req *MsgTimeoutOnClose) (*MsgTimeoutOnCloseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TimeoutOnClose not implemented") +} +func (*UnimplementedMsgServer) Acknowledgement(ctx context.Context, req *MsgAcknowledgement) (*MsgAcknowledgementResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Acknowledgement not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_ChannelOpenInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenInit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenInit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenInit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenInit(ctx, req.(*MsgChannelOpenInit)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelOpenTry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenTry) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenTry(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenTry", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenTry(ctx, req.(*MsgChannelOpenTry)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelOpenAck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenAck) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenAck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenAck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenAck(ctx, req.(*MsgChannelOpenAck)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelOpenConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenConfirm) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenConfirm(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenConfirm", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenConfirm(ctx, req.(*MsgChannelOpenConfirm)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelCloseInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelCloseInit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelCloseInit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelCloseInit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelCloseInit(ctx, req.(*MsgChannelCloseInit)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelCloseConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelCloseConfirm) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelCloseConfirm(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelCloseConfirm", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelCloseConfirm(ctx, req.(*MsgChannelCloseConfirm)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RecvPacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRecvPacket) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RecvPacket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/RecvPacket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RecvPacket(ctx, req.(*MsgRecvPacket)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Timeout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTimeout) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Timeout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/Timeout", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Timeout(ctx, req.(*MsgTimeout)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_TimeoutOnClose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTimeoutOnClose) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).TimeoutOnClose(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/TimeoutOnClose", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).TimeoutOnClose(ctx, req.(*MsgTimeoutOnClose)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Acknowledgement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAcknowledgement) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Acknowledgement(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/Acknowledgement", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Acknowledgement(ctx, req.(*MsgAcknowledgement)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.core.channel.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ChannelOpenInit", + Handler: _Msg_ChannelOpenInit_Handler, + }, + { + MethodName: "ChannelOpenTry", + Handler: _Msg_ChannelOpenTry_Handler, + }, + { + MethodName: "ChannelOpenAck", + Handler: _Msg_ChannelOpenAck_Handler, + }, + { + MethodName: "ChannelOpenConfirm", + Handler: _Msg_ChannelOpenConfirm_Handler, + }, + { + MethodName: "ChannelCloseInit", + Handler: _Msg_ChannelCloseInit_Handler, + }, + { + MethodName: "ChannelCloseConfirm", + Handler: _Msg_ChannelCloseConfirm_Handler, + }, + { + MethodName: "RecvPacket", + Handler: _Msg_RecvPacket_Handler, + }, + { + MethodName: "Timeout", + Handler: _Msg_Timeout_Handler, + }, + { + MethodName: "TimeoutOnClose", + Handler: _Msg_TimeoutOnClose_Handler, + }, + { + MethodName: "Acknowledgement", + Handler: _Msg_Acknowledgement_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/core/channel/v1/tx.proto", +} + +func (m *MsgChannelOpenInit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelOpenInit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Channel.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintTx(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgChannelOpenInitResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelOpenInitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgChannelOpenTry) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelOpenTry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x42 + } + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if len(m.ProofInit) > 0 { + i -= len(m.ProofInit) + copy(dAtA[i:], m.ProofInit) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofInit))) + i-- + dAtA[i] = 0x32 + } + if len(m.CounterpartyVersion) > 0 { + i -= len(m.CounterpartyVersion) + copy(dAtA[i:], m.CounterpartyVersion) + i = encodeVarintTx(dAtA, i, uint64(len(m.CounterpartyVersion))) + i-- + dAtA[i] = 0x2a + } + { + size, err := m.Channel.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.CounterpartyChosenChannelId) > 0 { + i -= len(m.CounterpartyChosenChannelId) + copy(dAtA[i:], m.CounterpartyChosenChannelId) + i = encodeVarintTx(dAtA, i, uint64(len(m.CounterpartyChosenChannelId))) + i-- + dAtA[i] = 0x1a + } + if len(m.DesiredChannelId) > 0 { + i -= len(m.DesiredChannelId) + copy(dAtA[i:], m.DesiredChannelId) + i = encodeVarintTx(dAtA, i, uint64(len(m.DesiredChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintTx(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgChannelOpenTryResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelOpenTryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenTryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgChannelOpenAck) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelOpenAck) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x3a + } + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if len(m.ProofTry) > 0 { + i -= len(m.ProofTry) + copy(dAtA[i:], m.ProofTry) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofTry))) + i-- + dAtA[i] = 0x2a + } + if len(m.CounterpartyVersion) > 0 { + i -= len(m.CounterpartyVersion) + copy(dAtA[i:], m.CounterpartyVersion) + i = encodeVarintTx(dAtA, i, uint64(len(m.CounterpartyVersion))) + i-- + dAtA[i] = 0x22 + } + if len(m.CounterpartyChannelId) > 0 { + i -= len(m.CounterpartyChannelId) + copy(dAtA[i:], m.CounterpartyChannelId) + i = encodeVarintTx(dAtA, i, uint64(len(m.CounterpartyChannelId))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintTx(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgChannelOpenAckResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelOpenAckResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenAckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgChannelOpenConfirm) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelOpenConfirm) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x2a + } + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.ProofAck) > 0 { + i -= len(m.ProofAck) + copy(dAtA[i:], m.ProofAck) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofAck))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintTx(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgChannelOpenConfirmResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelOpenConfirmResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgChannelCloseInit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelCloseInit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelCloseInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintTx(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgChannelCloseInitResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelCloseInitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelCloseInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgChannelCloseConfirm) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelCloseConfirm) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelCloseConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x2a + } + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.ProofInit) > 0 { + i -= len(m.ProofInit) + copy(dAtA[i:], m.ProofInit) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofInit))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintTx(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgChannelCloseConfirmResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgChannelCloseConfirmResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelCloseConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRecvPacket) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRecvPacket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRecvPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Proof) > 0 { + i -= len(m.Proof) + copy(dAtA[i:], m.Proof) + i = encodeVarintTx(dAtA, i, uint64(len(m.Proof))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Packet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MsgRecvPacketResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRecvPacketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRecvPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgTimeout) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgTimeout) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTimeout) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x2a + } + if m.NextSequenceRecv != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.NextSequenceRecv)) + i-- + dAtA[i] = 0x20 + } + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Proof) > 0 { + i -= len(m.Proof) + copy(dAtA[i:], m.Proof) + i = encodeVarintTx(dAtA, i, uint64(len(m.Proof))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Packet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MsgTimeoutResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgTimeoutResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTimeoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgTimeoutOnClose) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgTimeoutOnClose) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTimeoutOnClose) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x32 + } + if m.NextSequenceRecv != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.NextSequenceRecv)) + i-- + dAtA[i] = 0x28 + } + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.ProofClose) > 0 { + i -= len(m.ProofClose) + copy(dAtA[i:], m.ProofClose) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofClose))) + i-- + dAtA[i] = 0x1a + } + if len(m.Proof) > 0 { + i -= len(m.Proof) + copy(dAtA[i:], m.Proof) + i = encodeVarintTx(dAtA, i, uint64(len(m.Proof))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Packet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MsgTimeoutOnCloseResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgTimeoutOnCloseResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTimeoutOnCloseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgAcknowledgement) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAcknowledgement) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAcknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x2a + } + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Proof) > 0 { + i -= len(m.Proof) + copy(dAtA[i:], m.Proof) + i = encodeVarintTx(dAtA, i, uint64(len(m.Proof))) + i-- + dAtA[i] = 0x1a + } + if len(m.Acknowledgement) > 0 { + i -= len(m.Acknowledgement) + copy(dAtA[i:], m.Acknowledgement) + i = encodeVarintTx(dAtA, i, uint64(len(m.Acknowledgement))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Packet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MsgAcknowledgementResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAcknowledgementResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAcknowledgementResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgChannelOpenInit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Channel.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgChannelOpenInitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgChannelOpenTry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DesiredChannelId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.CounterpartyChosenChannelId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Channel.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.CounterpartyVersion) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProofInit) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ProofHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgChannelOpenTryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgChannelOpenAck) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.CounterpartyChannelId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.CounterpartyVersion) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProofTry) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ProofHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgChannelOpenAckResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgChannelOpenConfirm) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProofAck) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ProofHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgChannelOpenConfirmResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgChannelCloseInit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgChannelCloseInitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgChannelCloseConfirm) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProofInit) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ProofHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgChannelCloseConfirmResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRecvPacket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Packet.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Proof) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ProofHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRecvPacketResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgTimeout) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Packet.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Proof) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ProofHeight.Size() + n += 1 + l + sovTx(uint64(l)) + if m.NextSequenceRecv != 0 { + n += 1 + sovTx(uint64(m.NextSequenceRecv)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgTimeoutResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgTimeoutOnClose) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Packet.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Proof) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProofClose) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ProofHeight.Size() + n += 1 + l + sovTx(uint64(l)) + if m.NextSequenceRecv != 0 { + n += 1 + sovTx(uint64(m.NextSequenceRecv)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgTimeoutOnCloseResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgAcknowledgement) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Packet.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Acknowledgement) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Proof) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ProofHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAcknowledgementResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgChannelOpenInit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelOpenInit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenInit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Channel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgChannelOpenInitResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelOpenInitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgChannelOpenTry) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelOpenTry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenTry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DesiredChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DesiredChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChosenChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyChosenChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Channel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofInit", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofInit = append(m.ProofInit[:0], dAtA[iNdEx:postIndex]...) + if m.ProofInit == nil { + m.ProofInit = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgChannelOpenTryResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelOpenTryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenTryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgChannelOpenAck) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelOpenAck: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenAck: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofTry", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofTry = append(m.ProofTry[:0], dAtA[iNdEx:postIndex]...) + if m.ProofTry == nil { + m.ProofTry = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgChannelOpenAckResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelOpenAckResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenAckResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgChannelOpenConfirm) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelOpenConfirm: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenConfirm: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofAck", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofAck = append(m.ProofAck[:0], dAtA[iNdEx:postIndex]...) + if m.ProofAck == nil { + m.ProofAck = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgChannelOpenConfirmResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelOpenConfirmResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgChannelCloseInit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelCloseInit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelCloseInit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgChannelCloseInitResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelCloseInitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelCloseInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgChannelCloseConfirm) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelCloseConfirm: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelCloseConfirm: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofInit", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofInit = append(m.ProofInit[:0], dAtA[iNdEx:postIndex]...) + if m.ProofInit == nil { + m.ProofInit = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgChannelCloseConfirmResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChannelCloseConfirmResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelCloseConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRecvPacket) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRecvPacket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRecvPacket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Packet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) + if m.Proof == nil { + m.Proof = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRecvPacketResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRecvPacketResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRecvPacketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTimeout) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTimeout: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTimeout: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Packet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) + if m.Proof == nil { + m.Proof = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextSequenceRecv", wireType) + } + m.NextSequenceRecv = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextSequenceRecv |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTimeoutResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTimeoutResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTimeoutResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTimeoutOnClose) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTimeoutOnClose: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTimeoutOnClose: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Packet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) + if m.Proof == nil { + m.Proof = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofClose", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofClose = append(m.ProofClose[:0], dAtA[iNdEx:postIndex]...) + if m.ProofClose == nil { + m.ProofClose = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextSequenceRecv", wireType) + } + m.NextSequenceRecv = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextSequenceRecv |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTimeoutOnCloseResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTimeoutOnCloseResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTimeoutOnCloseResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAcknowledgement: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAcknowledgement: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Packet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Acknowledgement", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Acknowledgement = append(m.Acknowledgement[:0], dAtA[iNdEx:postIndex]...) + if m.Acknowledgement == nil { + m.Acknowledgement = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) + if m.Proof == nil { + m.Proof = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAcknowledgementResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAcknowledgementResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAcknowledgementResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/staking/types/staking.pb.go b/x/staking/types/staking.pb.go index a5e7693f5d..554851aa3a 100644 --- a/x/staking/types/staking.pb.go +++ b/x/staking/types/staking.pb.go @@ -1094,119 +1094,120 @@ func init() { } var fileDescriptor_64c30c6cf92913c9 = []byte{ - // 1790 bytes of a gzipped FileDescriptorProto + // 1796 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4d, 0x6c, 0x23, 0x49, 0x15, 0x76, 0x3b, 0x5e, 0xc7, 0x7e, 0x4e, 0xe2, 0xa4, 0x26, 0x33, 0xeb, 0x98, 0xc1, 0xed, 0x6d, - 0x96, 0x25, 0xa0, 0x5d, 0x87, 0x09, 0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, 0xda, 0x81, 0x97, 0x06, 0xfc, 0x87, 0xb0, + 0xae, 0xb4, 0x5d, 0x9b, 0x99, 0xbc, 0x82, 0x5f, 0x85, 0x4f, 0x8a, 0x18, 0xbf, 0xca, 0x02, 0xb4, + 0x8e, 0x8f, 0x8f, 0x02, 0x67, 0xd0, 0x27, 0xec, 0xd3, 0xb4, 0xfc, 0x08, 0xae, 0xc6, 0x66, 0xd1, + 0xc0, 0x4a, 0x59, 0x5f, 0x9f, 0x8c, 0xf5, 0xeb, 0x69, 0xeb, 0x13, 0x6c, 0x86, 0x79, 0x25, 0xa2, + 0x1f, 0x06, 0xd6, 0xa5, 0xa8, 0x36, 0x65, 0x11, 0xea, 0xc2, 0x6c, 0xd4, 0x04, 0x5b, 0x12, 0xb5, + 0x45, 0xd9, 0xe5, 0xae, 0x3d, 0x84, 0x52, 0xec, 0x12, 0x8a, 0x5a, 0x50, 0x60, 0xea, 0xb7, 0xf2, + 0xb0, 0x31, 0xdb, 0xc3, 0xa1, 0x98, 0xf2, 0x72, 0x24, 0x69, 0xfc, 0x47, 0x03, 0x88, 0x73, 0xf6, + 0xc5, 0x4c, 0x31, 0xde, 0xca, 0x55, 0xe3, 0x5d, 0x78, 0xae, 0x51, 0x4d, 0x49, 0xa7, 0xfc, 0xf9, + 0xf3, 0x2c, 0x5c, 0xb9, 0x13, 0x76, 0x9e, 0x17, 0xde, 0x07, 0x07, 0xb0, 0x48, 0x3c, 0x16, 0x38, + 0xc2, 0x09, 0x3c, 0xda, 0x5f, 0x99, 0x15, 0xed, 0x4b, 0x6c, 0xda, 0xf3, 0x58, 0x30, 0x52, 0xb1, + 0x0f, 0x61, 0x52, 0xde, 0xf8, 0xe5, 0x02, 0x54, 0x66, 0x49, 0xa2, 0x5d, 0x28, 0x5b, 0x01, 0x11, + 0x84, 0xf0, 0xfe, 0xd0, 0xc4, 0xfd, 0x51, 0x8d, 0x27, 0xcb, 0x14, 0x83, 0x61, 0xae, 0x84, 0x14, + 0x75, 0x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, + 0xee, 0xd7, 0xf3, 0xd2, 0x81, 0xd5, 0xdc, 0xfb, 0x1f, 0xd5, 0x32, 0xcd, 0x5b, 0x9f, 0x3c, 0xaa, + 0x69, 0x0f, 0x1f, 0xd5, 0xb4, 0xbf, 0x3f, 0xaa, 0x69, 0x1f, 0x3c, 0xae, 0x65, 0x1e, 0x3e, 0xae, + 0x65, 0xfe, 0xfc, 0xb8, 0x96, 0xf9, 0xfe, 0xeb, 0x4f, 0xf4, 0xdd, 0x79, 0xf4, 0x51, 0x5b, 0x78, + 0xb1, 0x9b, 0x17, 0x6d, 0xf8, 0xcd, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x48, 0x4c, 0x86, + 0xf3, 0x16, 0x00, 0x00, } func (this *Pool) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) { @@ -1215,605 +1216,605 @@ func (this *Pool) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_ func StakingDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) { d := &github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet{} var gzipped = []byte{ - // 9554 bytes of a gzipped FileDescriptorSet - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x7d, 0x70, 0x24, 0xc7, - 0x75, 0x18, 0x7e, 0xb3, 0x1f, 0xc0, 0xee, 0xc3, 0x02, 0x58, 0x34, 0x70, 0xe0, 0xde, 0xf2, 0x08, - 0x80, 0xc3, 0xaf, 0xe3, 0x91, 0x04, 0xc8, 0x23, 0xef, 0x78, 0xb7, 0x27, 0x91, 0xc2, 0x02, 0x7b, - 0x38, 0xdc, 0xe1, 0x8b, 0x03, 0xe0, 0xa8, 0x2f, 0xff, 0xb6, 0x06, 0xbb, 0x8d, 0xc5, 0x10, 0xbb, - 0x33, 0xc3, 0x99, 0xd9, 0xbb, 0x03, 0x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, 0x80, 0x2a, 0x36, - 0xb1, 0x5e, 0xc5, 0x7a, 0xe5, 0x20, 0x17, 0x9f, 0x89, 0x9f, 0x48, 0x2b, 0x3e, 0x08, 0x7a, 0x04, - 0xc6, 0xcc, 0xe6, 0x4e, 0x5d, 0xab, 0x94, 0x7d, 0x68, 0x30, 0x13, 0x3f, 0x91, 0x54, 0xb2, 0xac, - 0x62, 0xd1, 0x43, 0x7e, 0x08, 0x46, 0xaf, 0x61, 0x75, 0xdf, 0x8f, 0x3a, 0x44, 0x51, 0x47, 0x08, - 0xd8, 0x87, 0xb8, 0x00, 0x99, 0x06, 0xb6, 0x6d, 0xb5, 0x86, 0xcb, 0xce, 0x81, 0x89, 0x73, 0x09, - 0xda, 0xfb, 0x99, 0x96, 0xde, 0x87, 0x7b, 0x3e, 0xc4, 0xa9, 0xb6, 0x0e, 0x4c, 0x8c, 0xe6, 0x21, - 0x8d, 0xf5, 0x66, 0x83, 0x71, 0x48, 0x76, 0xd0, 0x5f, 0x49, 0x6f, 0x36, 0xc2, 0x5c, 0x52, 0x84, - 0x8c, 0xb3, 0x18, 0xb4, 0xb1, 0x75, 0x55, 0xab, 0xe0, 0xdc, 0x00, 0x65, 0xf0, 0x50, 0x0b, 0x83, - 0x4d, 0x56, 0x1f, 0xe6, 0x21, 0xe8, 0xd0, 0x02, 0xa4, 0xf1, 0x75, 0x07, 0xeb, 0xb6, 0x66, 0xe8, - 0xb9, 0x41, 0xca, 0xe4, 0x81, 0x36, 0xa3, 0x88, 0xeb, 0xd5, 0x30, 0x0b, 0x8f, 0x0e, 0x9d, 0x81, - 0x41, 0xc3, 0x74, 0x34, 0x43, 0xb7, 0x73, 0xa9, 0x19, 0xe9, 0xc4, 0xd0, 0xa9, 0xe3, 0x6d, 0x0d, - 0x61, 0x9d, 0xe1, 0x28, 0x02, 0x19, 0x2d, 0x43, 0xd6, 0x36, 0x9a, 0x56, 0x05, 0x97, 0x2b, 0x46, - 0x15, 0x97, 0x35, 0x7d, 0xd7, 0xc8, 0xa5, 0x29, 0x83, 0xe9, 0xd6, 0x8e, 0x50, 0xc4, 0x05, 0xa3, - 0x8a, 0x97, 0xf5, 0x5d, 0x43, 0x19, 0xb1, 0x03, 0x65, 0x34, 0x09, 0x03, 0xf6, 0x81, 0xee, 0xa8, - 0xd7, 0x73, 0x19, 0x6a, 0x21, 0xbc, 0x24, 0xff, 0xc6, 0x00, 0x8c, 0xf6, 0x62, 0x62, 0xe7, 0x21, - 0xb9, 0x4b, 0x7a, 0x99, 0x8b, 0xf5, 0xa3, 0x03, 0x46, 0x13, 0x54, 0xe2, 0xc0, 0x21, 0x95, 0x38, - 0x0f, 0x43, 0x3a, 0xb6, 0x1d, 0x5c, 0x65, 0x16, 0x11, 0xef, 0xd1, 0xa6, 0x80, 0x11, 0xb5, 0x9a, - 0x54, 0xe2, 0x50, 0x26, 0xf5, 0x56, 0x18, 0x75, 0x45, 0x2a, 0x5b, 0xaa, 0x5e, 0x13, 0xb6, 0x39, - 0x17, 0x25, 0xc9, 0x6c, 0x49, 0xd0, 0x29, 0x84, 0x4c, 0x19, 0xc1, 0x81, 0x32, 0x5a, 0x04, 0x30, - 0x74, 0x6c, 0xec, 0x96, 0xab, 0xb8, 0x52, 0xcf, 0xa5, 0x3a, 0x68, 0x69, 0x9d, 0xa0, 0xb4, 0x68, - 0xc9, 0x60, 0xd0, 0x4a, 0x1d, 0x9d, 0xf3, 0x4c, 0x6d, 0xb0, 0x83, 0xa5, 0xac, 0xb2, 0x49, 0xd6, - 0x62, 0x6d, 0xdb, 0x30, 0x62, 0x61, 0x62, 0xf7, 0xb8, 0xca, 0x7b, 0x96, 0xa6, 0x42, 0xcc, 0x46, - 0xf6, 0x4c, 0xe1, 0x64, 0xac, 0x63, 0xc3, 0x96, 0xbf, 0x88, 0xee, 0x03, 0x17, 0x50, 0xa6, 0x66, - 0x05, 0xd4, 0x0b, 0x65, 0x04, 0x70, 0x4d, 0x6d, 0xe0, 0xfc, 0x4b, 0x30, 0x12, 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, 0x48, 0xa5, 0xb2, - 0xe9, 0x4b, 0x89, 0x54, 0x3a, 0x0b, 0xf2, 0x6b, 0x71, 0xc8, 0xf8, 0xe3, 0x70, 0xb2, 0xad, 0xa9, - 0xd0, 0x25, 0x4b, 0xa2, 0x4e, 0xed, 0xbe, 0xae, 0x51, 0xfb, 0xec, 0x02, 0x59, 0xcb, 0x0a, 0x03, - 0x2c, 0x3a, 0x56, 0x18, 0x25, 0x89, 0x23, 0x88, 0xb1, 0x61, 0x16, 0x8d, 0xa4, 0x14, 0x5e, 0x42, - 0x4b, 0x30, 0xf0, 0x82, 0x4d, 0x79, 0x0f, 0x50, 0xde, 0xf7, 0x77, 0xe7, 0x7d, 0x69, 0x93, 0x32, - 0x4f, 0x5f, 0xda, 0x2c, 0xaf, 0xad, 0x2b, 0xab, 0xf3, 0x2b, 0x0a, 0x27, 0x47, 0xc7, 0x20, 0x51, - 0x57, 0x5f, 0x3a, 0x08, 0xae, 0x7a, 0x14, 0xd4, 0xeb, 0x20, 0x1c, 0x83, 0xc4, 0x35, 0xac, 0xee, - 0x07, 0xd7, 0x1a, 0x0a, 0xba, 0x83, 0x93, 0x61, 0x0e, 0x92, 0x54, 0x5f, 0x08, 0x80, 0x6b, 0x2c, - 0x7b, 0x04, 0xa5, 0x20, 0xb1, 0xb0, 0xae, 0x90, 0x09, 0x91, 0x85, 0x0c, 0x83, 0x96, 0x37, 0x96, - 0x4b, 0x0b, 0xa5, 0x6c, 0x4c, 0x3e, 0x0d, 0x03, 0x4c, 0x09, 0x64, 0xb2, 0xb8, 0x6a, 0xc8, 0x1e, - 0xe1, 0x45, 0xce, 0x43, 0x12, 0xb5, 0xdb, 0xab, 0xc5, 0x92, 0x92, 0x8d, 0x05, 0x87, 0x3a, 0x91, - 0x4d, 0xca, 0x36, 0x64, 0xfc, 0x81, 0xf8, 0x8f, 0x66, 0x93, 0xfd, 0x15, 0x09, 0x86, 0x7c, 0x81, - 0x35, 0x89, 0x88, 0xd4, 0x7a, 0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, 0xba, 0xa3, 0xed, - 0x6a, 0xd8, 0xe2, 0x79, 0x22, 0xb6, 0x8f, 0x19, 0xf5, 0xe0, 0x2c, 0x55, 0xf4, 0x28, 0x20, 0xd3, - 0xb0, 0x35, 0x47, 0xbb, 0x8a, 0xcb, 0x9a, 0x2e, 0x92, 0x4a, 0x64, 0x5f, 0x93, 0x50, 0xb2, 0xa2, - 0x66, 0x59, 0x77, 0x5c, 0x6c, 0x1d, 0xd7, 0xd4, 0x10, 0x36, 0x71, 0xe6, 0x71, 0x25, 0x2b, 0x6a, - 0x5c, 0xec, 0x7b, 0x21, 0x53, 0x35, 0x9a, 0x24, 0xd8, 0x63, 0x78, 0x64, 0xed, 0x90, 0x94, 0x21, - 0x06, 0x73, 0x51, 0x78, 0x18, 0xef, 0x65, 0xb3, 0x32, 0xca, 0x10, 0x83, 0x31, 0x94, 0x87, 0x60, - 0x54, 0xad, 0xd5, 0x2c, 0xc2, 0x5c, 0x30, 0x62, 0x1b, 0x93, 0x11, 0x17, 0x4c, 0x11, 0xf3, 0x97, - 0x20, 0x25, 0xf4, 0x40, 0x96, 0x6a, 0xa2, 0x89, 0xb2, 0xc9, 0x76, 0xdb, 0xb1, 0x13, 0x69, 0x25, - 0xa5, 0x8b, 0xca, 0x7b, 0x21, 0xa3, 0xd9, 0x65, 0x2f, 0x39, 0x1f, 0x9b, 0x89, 0x9d, 0x48, 0x29, - 0x43, 0x9a, 0xed, 0x26, 0x36, 0xe5, 0xcf, 0xc7, 0x60, 0x24, 0x78, 0xb8, 0x80, 0x16, 0x21, 0x55, - 0x37, 0x2a, 0x2a, 0x35, 0x2d, 0x76, 0xb2, 0x75, 0x22, 0xe2, 0x3c, 0x62, 0x76, 0x85, 0xe3, 0x2b, - 0x2e, 0x65, 0xfe, 0x77, 0x25, 0x48, 0x09, 0x30, 0x9a, 0x84, 0x84, 0xa9, 0x3a, 0x7b, 0x94, 0x5d, - 0xb2, 0x18, 0xcb, 0x4a, 0x0a, 0x2d, 0x13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0xac, 0x10, 0x23, 0x0f, 0x06, 0x3d, 0xd1, 0xcc, 0xde, 0xf7, 0x7d, 0xd7, 0xce, - 0x03, 0x31, 0x4f, 0xe1, 0x02, 0x0c, 0x07, 0x02, 0x9e, 0x68, 0x56, 0xef, 0xe7, 0xac, 0x32, 0xfe, - 0x78, 0xa7, 0x70, 0x1a, 0x12, 0x24, 0x78, 0x89, 0x26, 0xff, 0xff, 0x39, 0x39, 0x45, 0x2f, 0xbc, - 0x19, 0x52, 0x22, 0x68, 0x89, 0x26, 0xfd, 0x00, 0x27, 0x75, 0x49, 0x08, 0xb9, 0x08, 0x58, 0xa2, - 0xc9, 0xff, 0x9a, 0x20, 0x17, 0x24, 0x84, 0xbc, 0x77, 0x15, 0x7e, 0xe5, 0xa7, 0x12, 0x7c, 0xd1, - 0x11, 0xba, 0x3b, 0x0f, 0x83, 0x3c, 0x52, 0x89, 0xa6, 0xfe, 0x10, 0x6f, 0x5c, 0x50, 0x14, 0x9e, - 0x86, 0x64, 0x8f, 0x0a, 0xff, 0x69, 0x4e, 0xca, 0xf0, 0x0b, 0x0b, 0x30, 0xe4, 0x8b, 0x4e, 0xa2, - 0xc9, 0xff, 0x06, 0x27, 0xf7, 0x53, 0x11, 0xd1, 0x79, 0x74, 0x12, 0xcd, 0xe0, 0xc3, 0x42, 0x74, - 0x4e, 0x41, 0xd4, 0x26, 0x02, 0x93, 0x68, 0xea, 0x8f, 0x08, 0xad, 0x0b, 0x92, 0xc2, 0xb3, 0x90, - 0x76, 0x17, 0x9b, 0x68, 0xfa, 0x8f, 0x72, 0x7a, 0x8f, 0x86, 0x68, 0xc0, 0xb7, 0xd8, 0x45, 0xb3, - 0xf8, 0x19, 0xa1, 0x01, 0x1f, 0x15, 0x99, 0x46, 0xe1, 0x00, 0x26, 0x9a, 0xd3, 0xc7, 0xc4, 0x34, - 0x0a, 0xc5, 0x2f, 0x64, 0x34, 0xa9, 0xcf, 0x8f, 0x66, 0xf1, 0xb3, 0x62, 0x34, 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0x14, 0xd1, 0x04, - 0x24, 0x75, 0x55, 0x37, 0x6c, 0x7e, 0x5b, 0x93, 0x15, 0x8a, 0x3f, 0x27, 0xf5, 0x67, 0x56, 0x23, - 0x6e, 0x53, 0xd4, 0xb6, 0x36, 0xa4, 0xb7, 0x3f, 0xd2, 0xed, 0x2c, 0x82, 0x0c, 0xbd, 0xed, 0x75, - 0xc1, 0x77, 0xf0, 0x30, 0x15, 0x3e, 0x78, 0x78, 0x1e, 0xd7, 0xeb, 0x97, 0x75, 0xe3, 0x9a, 0x4e, - 0x86, 0xdd, 0x76, 0x55, 0xf2, 0x85, 0x04, 0xdc, 0x43, 0xaf, 0xa1, 0x5b, 0x0d, 0x4d, 0x77, 0xe6, - 0x2a, 0xd6, 0x81, 0xe9, 0x50, 0x03, 0x36, 0x76, 0xb9, 0x42, 0xc6, 0xbc, 0xea, 0x59, 0x56, 0x9d, - 0x6f, 0x7b, 0x6c, 0x21, 0xef, 0x42, 0x72, 0x83, 0xd0, 0x11, 0x55, 0x38, 0x86, 0xa3, 0xd6, 0xb9, - 0x8a, 0x58, 0x81, 0x40, 0xd9, 0xd5, 0xf5, 0x18, 0x83, 0x6a, 0xe2, 0xd6, 0x7a, 0x1d, 0xab, 0xbb, - 0xec, 0xaa, 0x60, 0x9c, 0x9e, 0x14, 0xa6, 0x08, 0x80, 0xde, 0x0a, 0x9c, 0x80, 0xa4, 0xda, 0x64, - 0x87, 0x5c, 0xf1, 0x13, 0x19, 0x85, 0x15, 0xe4, 0xcb, 0x30, 0xc8, 0x13, 0xeb, 0x28, 0x0b, 0xf1, - 0x7d, 0x7c, 0x40, 0xdb, 0xc9, 0x28, 0xe4, 0x27, 0x9a, 0x85, 0x24, 0x15, 0x9e, 0xdf, 0x81, 0xce, - 0xcd, 0xb6, 0x48, 0x3f, 0x4b, 0x85, 0x54, 0x18, 0x9a, 0x7c, 0x09, 0x52, 0x8b, 0x46, 0x43, 0xd3, - 0x8d, 0x20, 0xb7, 0x34, 0xe3,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6, 0xc5, 0x03, 0x53, 0xc4, 0xc7, 0x61, 0x42, 0xc7, 0xd7, 0xe9, 0xd5, 0xb0, 0x00, 0x76, 0x9a, - 0x62, 0x23, 0x52, 0x77, 0x25, 0x48, 0xf1, 0x00, 0x8c, 0x54, 0x84, 0xf2, 0x19, 0x2e, 0x50, 0xdc, - 0x61, 0x17, 0x4a, 0xd1, 0x8e, 0x41, 0x4a, 0x35, 0x4d, 0x86, 0x30, 0xc4, 0xfd, 0xa3, 0x69, 0xd2, - 0xaa, 0x93, 0x30, 0x46, 0xfb, 0x68, 0x61, 0xbb, 0x59, 0x77, 0x38, 0x93, 0x0c, 0xc5, 0x19, 0x25, - 0x15, 0x0a, 0x83, 0x53, 0xdc, 0xfb, 0x60, 0x18, 0x5f, 0xd5, 0xaa, 0x58, 0xaf, 0x60, 0x86, 0x37, - 0x4c, 0xf1, 0x32, 0x02, 0x48, 0x91, 0x1e, 0x06, 0xd7, 0xef, 0x95, 0x85, 0x4f, 0x1e, 0x61, 0xfc, - 0x04, 0x7c, 0x9e, 0x81, 0xe5, 0x1c, 0x24, 0x16, 0x55, 0x47, 0x25, 0x01, 0x84, 0x73, 0x9d, 0x2d, - 0x34, 0x19, 0x85, 0xfc, 0x94, 0x5f, 0x8f, 0x41, 0xe2, 0x8a, 0xe1, 0x60, 0xf4, 0xa4, 0x2f, 0xc0, - 0x1b, 0x69, 0x67, 0xcf, 0x9b, 0x5a, 0x4d, 0xc7, 0xd5, 0x55, 0xbb, 0xe6, 0x7b, 0x21, 0xea, 0x99, - 0x53, 0x2c, 0x60, 0x4e, 0x13, 0x90, 0xb4, 0x8c, 0xa6, 0x5e, 0x15, 0x77, 0x98, 0x68, 0x01, 0x95, - 0x20, 0xe5, 0x5a, 0x49, 0x22, 0xca, 0x4a, 0x46, 0x89, 0x95, 0x10, 0x1b, 0xe6, 0x00, 0x65, 0x70, - 0x87, 0x1b, 0x4b, 0x11, 0xd2, 0xae, 0xf3, 0xe2, 0xd6, 0xd6,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0xf2, 0xdb, 0xe0, 0xee, 0xb6, - 0x54, 0x5c, 0xb6, 0x02, 0x24, 0xf6, 0x34, 0xdb, 0xe1, 0x62, 0x3d, 0xd8, 0x49, 0xac, 0x10, 0x35, - 0xa5, 0x91, 0x11, 0x64, 0x29, 0xeb, 0x0d, 0xc3, 0xa8, 0x73, 0x31, 0xe4, 0xcb, 0x30, 0xe6, 0x83, - 0xf1, 0x46, 0xce, 0x40, 0xc2, 0x34, 0xf8, 0xe7, 0x3f, 0x86, 0x4e, 0x1d, 0xef, 0x98, 0xbd, 0x37, - 0x8c, 0x3a, 0xef, 0x36, 0xc5, 0x97, 0x27, 0x00, 0x31, 0x66, 0x34, 0x91, 0x2f, 0x9a, 0xd8, 0x84, - 0xf1, 0x00, 0x94, 0x37, 0xf2, 0x43, 0x1d, 0x12, 0x9c, 0xfa, 0xce, 0x51, 0x48, 0x52, 0xae, 0xe8, - 0x13, 0x12, 0x80, 0xef, 0x44, 0x78, 0xb6, 0x13, 0x9b, 0xf6, 0x7b, 0xe2, 0xfc, 0x5c, 0xcf, 0xf8, - 0x3c, 0x66, 0x3b, 0xf9, 0xde, 0x7f, 0xf5, 0xed, 0x8f, 0xc5, 0xee, 0x47, 0xf2, 0x5c, 0x87, 0xdd, - 0xb8, 0x6f, 0xbe, 0x7c, 0x3e, 0xf0, 0xed, 0x89, 0xc7, 0x7a, 0x6b, 0x4a, 0x48, 0x36, 0xdb, 0x2b, - 0x3a, 0x17, 0xec, 0x3c, 0x15, 0xec, 0x34, 0x7a, 0x32, 0x5a, 0xb0, 0xb9, 0x77, 0x05, 0x27, 0xcd, - 0x7b, 0xd0, 0xef, 0x49, 0x30, 0xd1, 0x6e, 0x4b, 0x87, 0xce, 0xf6, 0x26, 0x45, 0x6b, 0x48, 0x91, - 0x3f, 0x77, 0x08, 0x4a, 0xde, 0x95, 0x25, 0xda, 0x95, 0x79, 0xf4, 0xec, 0x21, 0xba, 0x32, 0xe7, - 0xcf, 0xef, 0xff, 0x4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0x70, 0x14, 0xc6, 0x7d, 0xfd, 0x74, 0xfb, 0xff, 0xbb, 0x31, 0xea, 0x11, 0x8b, 0xb8, 0xa6, - 0xe9, 0x6e, 0xdc, 0x88, 0xff, 0xaa, 0xbe, 0xa7, 0xf0, 0xf4, 0x9c, 0x38, 0xac, 0x9e, 0xf7, 0xa9, - 0x83, 0x08, 0xe9, 0xd3, 0x4d, 0x75, 0xad, 0xb6, 0xbe, 0xf6, 0x91, 0xfa, 0xf8, 0x90, 0x55, 0xe8, - 0x4d, 0x8f, 0xfc, 0xba, 0x04, 0xc3, 0xab, 0x76, 0x6d, 0x5b, 0xaf, 0xfe, 0x5f, 0x6f, 0xbf, 0xbb, - 0x70, 0x34, 0xd0, 0xd3, 0x3b, 0xa4, 0xd2, 0x53, 0xaf, 0x26, 0x20, 0xbe, 0x6a, 0xd7, 0xd0, 0x8b, - 0x30, 0x1a, 0x0e, 0x13, 0x3a, 0x46, 0x7f, 0xad, 0x2b, 0x42, 0xe7, 0x1d, 0x5a, 0xe7, 0xd5, 0x03, - 0xed, 0xc3, 0x70, 0x70, 0xe5, 0x38, 0xd1, 0x85, 0x49, 0x00, 0x33, 0xff, 0x78, 0xaf, 0x98, 0x6e, - 0x63, 0xef, 0x84, 0x94, 0xeb, 0xf4, 0xee, 0xeb, 0x42, 0x2d, 0x90, 0x3a, 0xc7, 0xb3, 0x6d, 0xdc, - 0x0a, 0xd1, 0x5e, 0xd8, 0xa5, 0x74, 0xd3, 0x5e, 0x08, 0xb7, 0xab, 0xf6, 0x3a, 0x4d, 0xad, 0x1d, - 0x00, 0xdf, 0x3c, 0x78, 0xa0, 0x0b, 0x07, 0x0f, 0x2d, 0xff, 0x58, 0x4f, 0x68, 0xee, 0x31, 0xd3, - 0x6d, 0x0e, 0xbf, 0xff, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x31, 0xf4, 0xff, 0xb5, 0x06, 0x94, - 0x00, 0x00, + // 9558 bytes of a gzipped FileDescriptorSet + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x7d, 0x6d, 0x70, 0x24, 0xd7, + 0x71, 0xd8, 0xcd, 0x7e, 0x00, 0xbb, 0x8d, 0x05, 0xb0, 0x78, 0xc0, 0xdd, 0xed, 0x2d, 0x8f, 0x00, + 0x38, 0xfc, 0x3a, 0x1e, 0x49, 0x80, 0x3c, 0xf2, 0x8e, 0xc7, 0x3d, 0x89, 0x34, 0x16, 0xbb, 0x87, + 0x03, 0x0f, 0x5f, 0x1c, 0x00, 0x47, 0x7d, 0x39, 0x5b, 0x83, 0xdd, 0x87, 0xc5, 0x10, 0xbb, 0x33, + 0xc3, 0x99, 0xd9, 0x3b, 0x80, 0x92, 0xaa, 0x68, 0x49, 0x51, 0xa4, 0x73, 0x1c, 0x49, 0x96, 0xcb, + 0x91, 0x28, 0x9d, 0x22, 0x59, 0x4e, 0xe4, 0xc8, 0x4a, 0xfc, 0x21, 0x45, 0x89, 0x93, 0x54, 0x45, + 0x4e, 0xc5, 0xb1, 0xa4, 0x54, 0x5c, 0x52, 0xc5, 0x95, 0x38, 0xae, 0xf8, 0xec, 0x50, 0x2a, 0x87, + 0x51, 0x94, 0x58, 0x3e, 0xcb, 0x89, 0x53, 0xfa, 0x91, 0xd4, 0xfb, 0x9a, 0xaf, 0xfd, 0x98, 0x05, + 0x74, 0x27, 0xca, 0x71, 0x7e, 0x61, 0x5f, 0x4f, 0x77, 0xbf, 0xee, 0x7e, 0xfd, 0xfa, 0xf5, 0xeb, + 0x79, 0x6f, 0x00, 0x9f, 0xb8, 0x00, 0xd3, 0x75, 0xc3, 0xa8, 0x37, 0xf0, 0xac, 0x69, 0x19, 0x8e, + 0xb1, 0xd5, 0xda, 0x9e, 0xad, 0x61, 0xbb, 0x6a, 0x69, 0xa6, 0x63, 0x58, 0x33, 0x14, 0x86, 0x46, + 0x19, 0xc6, 0x8c, 0xc0, 0x90, 0x97, 0x61, 0xec, 0xa2, 0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a, 0x6f, + 0xa1, 0x39, 0x48, 0x36, 0xd4, 0x2d, 0xdc, 0xc8, 0x25, 0xa6, 0xa5, 0x53, 0x23, 0x67, 0x1e, 0xee, + 0x6b, 0x56, 0xce, 0x2c, 0x11, 0x12, 0x85, 0x51, 0xa2, 0x67, 0x20, 0xc1, 0x43, 0x34, 0xe1, 0x70, + 0xba, 0x3f, 0x0e, 0x64, 0x2e, 0x29, 0x94, 0x0e, 0xdd, 0x05, 0x69, 0xf2, 0x97, 0xf9, 0xc6, 0x00, + 0x95, 0x39, 0x45, 0x00, 0xc4, 0x2f, 0x50, 0x1e, 0x52, 0x74, 0x9a, 0xd4, 0xb0, 0x58, 0xda, 0xdc, + 0x36, 0x71, 0xac, 0x1a, 0xde, 0x56, 0x5b, 0x0d, 0xa7, 0x72, 0x55, 0x6d, 0xb4, 0x30, 0x75, 0xf8, + 0xb4, 0x92, 0xe1, 0xc0, 0x2b, 0x04, 0x86, 0xa6, 0x60, 0x88, 0xcd, 0x2a, 0x4d, 0xaf, 0xe1, 0x3d, + 0x1a, 0x3d, 0x93, 0x0a, 0x9b, 0x68, 0x8b, 0x04, 0x42, 0xba, 0x7f, 0xd1, 0x36, 0x74, 0xe1, 0x9a, + 0xb4, 0x0b, 0x02, 0xa0, 0xdd, 0x3f, 0x15, 0x0e, 0xdc, 0x77, 0x77, 0x56, 0x2f, 0xec, 0x53, 0xf2, + 0x97, 0x63, 0x90, 0xa0, 0xf1, 0x62, 0x14, 0x86, 0x36, 0xde, 0xba, 0x56, 0xae, 0x94, 0x56, 0x37, + 0x8b, 0x4b, 0xe5, 0xac, 0x84, 0x46, 0x00, 0x28, 0xe0, 0xe2, 0xd2, 0xea, 0xdc, 0x46, 0x36, 0xe6, + 0xb6, 0x17, 0x57, 0x36, 0xce, 0x3d, 0x99, 0x8d, 0xbb, 0x04, 0x9b, 0x0c, 0x90, 0xf0, 0x23, 0x3c, + 0x71, 0x26, 0x9b, 0x44, 0x59, 0xc8, 0x30, 0x06,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0xdb, + 0xb6, 0x82, 0x52, 0x3a, 0x7f, 0x06, 0x11, 0xef, 0x92, 0x41, 0x10, 0x16, 0x6d, 0x31, 0xfd, 0x27, + 0xdb, 0x62, 0x3a, 0x5b, 0xf6, 0xce, 0xf5, 0xb3, 0xec, 0x51, 0xd8, 0xc1, 0x62, 0x7b, 0xb2, 0x43, + 0x6c, 0xbf, 0x00, 0x63, 0x6d, 0x8c, 0xfa, 0x8e, 0xb1, 0xef, 0x95, 0x20, 0xd7, 0xcd, 0x38, 0x11, + 0x91, 0x2e, 0x16, 0x88, 0x74, 0x17, 0xc2, 0x16, 0xbc, 0xa7, 0xfb, 0x20, 0xb4, 0x8d, 0xf5, 0xe7, + 0x24, 0x38, 0xd6, 0x39, 0x53, 0xec, 0x28, 0xc3, 0x33, 0x30, 0xd0, 0xc4, 0xce, 0x8e, 0x21, 0xb2, + 0xa5, 0x07, 0x3a, 0xac, 0xc1, 0xe4, 0x71, 0x78, 0xb0, 0x39, 0x95, 0x7f, 0x11, 0x8f, 0x77, 0x4b, + 0xf7, 0x98, 0x34, 0x6d, 0x92, 0x7e, 0x30, 0x06, 0x47, 0x3b, 0x32, 0xef, 0x28, 0xe8, 0xdd, 0x00, + 0x9a, 0x6e, 0xb6, 0x1c, 0x96, 0x11, 0xb1, 0x00, 0x9b, 0xa6, 0x10, 0x1a, 0xbc, 0x48, 0xf0, 0x6c, + 0x39, 0xee, 0xf3, 0x38, 0x7d, 0x0e, 0x0c, 0x44, 0x11, 0xce, 0x7b, 0x82, 0x26, 0xa8, 0xa0, 0x93, + 0x5d, 0x34, 0x6d, 0x73, 0xcc, 0xc7, 0x20, 0x5b, 0x6d, 0x68, 0x58, 0x77, 0x2a, 0xb6, 0x63, 0x61, + 0xb5, 0xa9, 0xe9, 0x75, 0xba, 0x82, 0xa4, 0x0a, 0xc9, 0x6d, 0xb5, 0x61, 0x63, 0x65, 0x94, 0x3d, + 0x5e, 0x17, 0x4f, 0x09, 0x05, 0x75, 0x20, 0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6e, 0x54, 0x6c, 0x47, 0xd5, + 0x6b, 0xaa, 0x55, 0xab, 0x78, 0x85, 0xaa, 0x8a, 0x5a, 0xad, 0x62, 0xdb, 0x36, 0xd8, 0x4a, 0xe8, + 0x72, 0x39, 0xa9, 0x1b, 0xeb, 0x1c, 0xd9, 0x5b, 0x22, 0xe6, 0x38, 0x6a, 0xc8, 0x7f, 0xe3, 0xdd, + 0xfc, 0xf7, 0x2e, 0x48, 0x37, 0x55, 0xb3, 0x82, 0x75, 0xc7, 0xda, 0xa7, 0x79, 0x77, 0x4a, 0x49, + 0x35, 0x55, 0xb3, 0x4c, 0xda, 0x3f, 0x92, 0xed, 0xcf, 0x73, 0x89, 0x54, 0x2a, 0x9b, 0x7e, 0x2e, + 0x91, 0x4a, 0x67, 0x41, 0x7e, 0x2d, 0x0e, 0x19, 0x7f, 0x1e, 0x4e, 0xb6, 0x35, 0x55, 0xba, 0x64, + 0x49, 0x34, 0xa8, 0xdd, 0xdb, 0x33, 0x6b, 0x9f, 0x99, 0x27, 0x6b, 0x59, 0x61, 0x80, 0x65, 0xc7, + 0x0a, 0xa3, 0x24, 0x79, 0x04, 0x71, 0x36, 0xcc, 0xb2, 0x91, 0x94, 0xc2, 0x5b, 0x68, 0x01, 0x06, + 0x5e, 0xb4, 0x29, 0xef, 0x01, 0xca, 0xfb, 0xbe, 0xde, 0xbc, 0x9f, 0x5b, 0xa7, 0xcc, 0xd3, 0xcf, + 0xad, 0x57, 0x56, 0x56, 0x95, 0xe5, 0xb9, 0x25, 0x85, 0x93, 0xa3, 0x13, 0x90, 0x68, 0xa8, 0x2f, + 0xef, 0x07, 0x57, 0x3d, 0x0a, 0xea, 0x77, 0x10, 0x4e, 0x40, 0xe2, 0x1a, 0x56, 0x77, 0x83, 0x6b, + 0x0d, 0x05, 0xdd, 0xc1, 0xc9, 0x30, 0x0b, 0x49, 0x6a, 0x2f, 0x04, 0xc0, 0x2d, 0x96, 0x3d, 0x82, + 0x52, 0x90, 0x98, 0x5f, 0x55, 0xc8, 0x84, 0xc8, 0x42, 0x86, 0x41, 0x2b, 0x6b, 0x8b, 0xe5, 0xf9, + 0x72, 0x36, 0x26, 0x9f, 0x85, 0x01, 0x66, 0x04, 0x32, 0x59, 0x5c, 0x33, 0x64, 0x8f, 0xf0, 0x26, + 0xe7, 0x21, 0x89, 0xa7, 0x9b, 0xcb, 0xc5, 0xb2, 0x92, 0x8d, 0x05, 0x87, 0x3a, 0x91, 0x4d, 0xca, + 0x36, 0x64, 0xfc, 0x89, 0xf8, 0x8f, 0x66, 0x93, 0xfd, 0x15, 0x09, 0x86, 0x7c, 0x89, 0x35, 0xc9, + 0x88, 0xd4, 0x46, 0xc3, 0xb8, 0x56, 0x51, 0x1b, 0x9a, 0x6a, 0x73, 0xd7, 0x00, 0x0a, 0x9a, 0x23, + 0x90, 0x7e, 0x87, 0xee, 0x47, 0x34, 0x45, 0x92, 0xd9, 0x01, 0xf9, 0x53, 0x12, 0x64, 0xc3, 0x99, + 0x6d, 0x48, 0x4c, 0xe9, 0x8d, 0x14, 0x53, 0xfe, 0xa4, 0x04, 0x23, 0xc1, 0x74, 0x36, 0x24, 0xde, + 0x3d, 0x6f, 0xa8, 0x78, 0x7f, 0x14, 0x83, 0xe1, 0x40, 0x12, 0xdb, 0xaf, 0x74, 0x2f, 0xc1, 0x98, + 0x56, 0xc3, 0x4d, 0xd3, 0x70, 0xb0, 0x5e, 0xdd, 0xaf, 0x34, 0xf0, 0x55, 0xdc, 0xc8, 0xc9, 0x34, + 0x68, 0xcc, 0xf6, 0x4e, 0x93, 0x67, 0x16, 0x3d, 0xba, 0x25, 0x42, 0x56, 0x18, 0x5f, 0x2c, 0x95, + 0x97, 0xd7, 0x56, 0x37, 0xca, 0x2b, 0xf3, 0x6f, 0xad, 0x6c, 0xae, 0x5c, 0x5e, 0x59, 0x7d, 0x61, + 0x45, 0xc9, 0x6a, 0x21, 0xb4, 0x3b, 0x38, 0xed, 0xd7, 0x20, 0x1b, 0x16, 0x0a, 0x1d, 0x87, 0x4e, + 0x62, 0x65, 0x8f, 0xa0, 0x71, 0x18, 0x5d, 0x59, 0xad, 0xac, 0x2f, 0x96, 0xca, 0x95, 0xf2, 0xc5, + 0x8b, 0xe5, 0xf9, 0x8d, 0x75, 0x56, 0xf8, 0x70, 0xb1, 0x37, 0x02, 0x13, 0x5c, 0x7e, 0x35, 0x0e, + 0xe3, 0x1d, 0x24, 0x41, 0x73, 0x7c, 0xcb, 0xc2, 0x76, 0x51, 0x8f, 0xf6, 0x23, 0xfd, 0x0c, 0xc9, + 0x19, 0xd6, 0x54, 0xcb, 0xe1, 0x3b, 0x9c, 0x87, 0x80, 0x58, 0x49, 0x77, 0xb4, 0x6d, 0x0d, 0x5b, + 0xbc, 0x4e, 0xc4, 0xf6, 0x31, 0xa3, 0x1e, 0x9c, 0x95, 0x8a, 0x1e, 0x01, 0x64, 0x1a, 0xb6, 0xe6, + 0x68, 0x57, 0x71, 0x45, 0xd3, 0x45, 0x51, 0x89, 0xec, 0x6b, 0x12, 0x4a, 0x56, 0x3c, 0x59, 0xd4, + 0x1d, 0x17, 0x5b, 0xc7, 0x75, 0x35, 0x84, 0x4d, 0x82, 0x79, 0x5c, 0xc9, 0x8a, 0x27, 0x2e, 0xf6, + 0x3d, 0x90, 0xa9, 0x19, 0x2d, 0x92, 0xec, 0x31, 0x3c, 0xb2, 0x76, 0x48, 0xca, 0x10, 0x83, 0xb9, + 0x28, 0x3c, 0x8d, 0xf7, 0xaa, 0x59, 0x19, 0x65, 0x88, 0xc1, 0x18, 0xca, 0x83, 0x30, 0xaa, 0xd6, + 0xeb, 0x16, 0x61, 0x2e, 0x18, 0xb1, 0x8d, 0xc9, 0x88, 0x0b, 0xa6, 0x88, 0xf9, 0xe7, 0x20, 0x25, + 0xec, 0x40, 0x96, 0x6a, 0x62, 0x89, 0x8a, 0xc9, 0x76, 0xdb, 0xb1, 0x53, 0x69, 0x25, 0xa5, 0x8b, + 0x87, 0xf7, 0x40, 0x46, 0x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 0xd5, 0x7e, 0x45, + 0x58, 0x8d, 0xd1, 0x06, 0xac, 0xb6, 0x01, 0xc7, 0x38, 0xc7, 0x83, 0x8d, 0xeb, 0xaf, 0x8a, 0xc0, + 0xca, 0xa8, 0x37, 0x83, 0xa3, 0xfb, 0x76, 0xc8, 0xbb, 0xe6, 0x14, 0x09, 0xab, 0x5d, 0x69, 0xaa, + 0x66, 0x1f, 0x9c, 0x7f, 0x8d, 0x73, 0x16, 0x11, 0xdf, 0xcd, 0x78, 0xed, 0x65, 0xd5, 0x24, 0xcc, + 0xdf, 0x02, 0x39, 0xc1, 0xbc, 0xa5, 0x5b, 0xb8, 0x6a, 0xd4, 0x75, 0xed, 0x65, 0x5c, 0xeb, 0x83, + 0xf5, 0xaf, 0x87, 0x86, 0x6a, 0xd3, 0x47, 0x4e, 0x38, 0x2f, 0x42, 0xd6, 0xcd, 0x55, 0x2a, 0x5a, + 0xd3, 0x34, 0x2c, 0x27, 0x82, 0xe3, 0x17, 0xc5, 0x48, 0xb9, 0x74, 0x8b, 0x94, 0xac, 0x50, 0x86, + 0x11, 0xda, 0xec, 0xd7, 0x25, 0xbf, 0xc4, 0x19, 0x0d, 0x7b, 0x54, 0x3c, 0x70, 0x54, 0x8d, 0xa6, + 0xa9, 0x5a, 0xfd, 0xc4, 0xbf, 0x7f, 0x24, 0x02, 0x07, 0x27, 0xe1, 0x81, 0xc3, 0xd9, 0x37, 0x31, + 0x59, 0xed, 0xfb, 0xe0, 0xf0, 0x65, 0x11, 0x38, 0x04, 0x0d, 0x67, 0x21, 0x12, 0x86, 0x3e, 0x58, + 0xfc, 0x63, 0xc1, 0x42, 0xd0, 0x10, 0x16, 0xcf, 0x7b, 0x0b, 0xad, 0x85, 0xeb, 0x9a, 0xed, 0x58, + 0x2c, 0x4d, 0xee, 0xcd, 0xea, 0x9f, 0x7c, 0x37, 0x98, 0x84, 0x29, 0x3e, 0x52, 0x12, 0x89, 0x78, + 0xd9, 0x95, 0xee, 0xa2, 0xa2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95, 0xc4, 0x7a, 0x73, 0xd0, 0xe0, 0xf0, 0x73, + 0x07, 0x0c, 0x0e, 0xc3, 0xa2, 0x27, 0x11, 0x1b, 0x4e, 0x47, 0xc7, 0x06, 0x21, 0xff, 0x21, 0x42, + 0xc3, 0xe7, 0x13, 0x70, 0x37, 0xbd, 0x14, 0x62, 0x35, 0x35, 0xdd, 0x99, 0xad, 0x5a, 0xfb, 0xa6, + 0x43, 0x97, 0x13, 0x63, 0x9b, 0x5b, 0x63, 0xcc, 0x7b, 0x3c, 0xc3, 0x1e, 0x77, 0x71, 0xc9, 0x6d, + 0x48, 0xae, 0x11, 0x3a, 0x62, 0x08, 0xc7, 0x70, 0xd4, 0x06, 0x37, 0x10, 0x6b, 0x10, 0x28, 0xbb, + 0x48, 0x12, 0x63, 0x50, 0x4d, 0xdc, 0x21, 0x69, 0x60, 0x75, 0x9b, 0x1d, 0xdc, 0x8d, 0xd3, 0x25, + 0x24, 0x45, 0x00, 0xf4, 0x8c, 0xee, 0x04, 0x24, 0xd5, 0x16, 0x7b, 0xe5, 0x1c, 0x27, 0x6b, 0x0b, + 0x6d, 0xc8, 0x97, 0x61, 0x90, 0xbf, 0xe6, 0x42, 0x59, 0x88, 0xef, 0xe2, 0x7d, 0xda, 0x4f, 0x46, + 0x21, 0x3f, 0xd1, 0x0c, 0x24, 0xa9, 0xf0, 0xfc, 0x46, 0x42, 0x6e, 0xa6, 0x4d, 0xfa, 0x19, 0x2a, + 0xa4, 0xc2, 0xd0, 0xe4, 0xe7, 0x20, 0x55, 0x32, 0x9a, 0x9a, 0x6e, 0x04, 0xb9, 0xa5, 0x19, 0x37, + 0x2a, 0xb3, 0xd9, 0xe2, 0xae, 0xaf, 0xb0, 0x06, 0x3a, 0x06, 0x03, 0xec, 0x20, 0x37, 0x7f, 0x6d, + 0xce, 0x5b, 0xf2, 0x3c, 0x0c, 0x52, 0xde, 0xab, 0x26, 0x42, 0xfc, 0x66, 0x0f, 0x3f, 0x31, 0x4e, + 0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b, 0xa6, 0x7d, 0xe1, 0x99, 0x71, 0x17, 0x08, 0xce, 0x4f, 0xd0, 0xa0, 0x07, 0x20, + 0x55, 0xdd, 0x51, 0x35, 0xbd, 0xa2, 0xd5, 0x44, 0x56, 0xfb, 0xda, 0xcd, 0xa9, 0xc1, 0x79, 0x02, + 0x5b, 0x2c, 0x29, 0x83, 0xf4, 0xe1, 0x62, 0x8d, 0xac, 0xf4, 0x3b, 0x58, 0xab, 0xef, 0x38, 0x7c, + 0x86, 0xf1, 0x16, 0x3a, 0x0f, 0x09, 0xe2, 0x10, 0xfc, 0xe6, 0x56, 0xbe, 0x6d, 0x6f, 0xe1, 0x6e, + 0xf0, 0x8a, 0x29, 0xd2, 0xf1, 0x87, 0xff, 0x70, 0x4a, 0x52, 0x28, 0x05, 0x9a, 0x87, 0xe1, 0x86, + 0x6a, 0x3b, 0x15, 0xba, 0x42, 0x91, 0xee, 0x93, 0x94, 0xc5, 0x89, 0x76, 0x83, 0x70, 0xc3, 0x72, + 0xd1, 0x87, 0x08, 0x15, 0x03, 0xd5, 0xd0, 0x29, 0xc8, 0x52, 0x26, 0x55, 0xa3, 0xd9, 0xd4, 0x1c, + 0x96, 0x3b, 0x0d, 0x50, 0xbb, 0x8f, 0x10, 0xf8, 0x3c, 0x05, 0xd3, 0x0c, 0xea, 0x2e, 0x48, 0xd3, + 0xab, 0x22, 0x14, 0x85, 0x1d, 0x8b, 0x4c, 0x11, 0x00, 0x7d, 0xf8, 0x20, 0x8c, 0x7a, 0xf1, 0x91, + 0xa1, 0xa4, 0x18, 0x17, 0x0f, 0x4c, 0x11, 0x1f, 0x83, 0x09, 0x1d, 0xef, 0xd1, 0x83, 0x9a, 0x01, + 0xec, 0x34, 0xc5, 0x46, 0xe4, 0xd9, 0x95, 0x20, 0xc5, 0xfd, 0x30, 0x52, 0x15, 0xc6, 0x67, 0xb8, + 0x40, 0x71, 0x87, 0x5d, 0x28, 0x45, 0x3b, 0x01, 0x29, 0xd5, 0x34, 0x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, 0x9b, 0x8f, 0xe1, 0x83, 0xdd, 0xc6, 0x22, 0x64, + 0x6f, 0xb6, 0x36, 0x7f, 0xe3, 0xe6, 0x94, 0xa4, 0x8c, 0x56, 0x43, 0x43, 0xf1, 0x76, 0x18, 0x6a, + 0x99, 0x35, 0xd5, 0xc1, 0x15, 0xba, 0x8f, 0x8b, 0x45, 0xae, 0xf3, 0x93, 0x84, 0xd7, 0xad, 0x9b, + 0x53, 0x88, 0xa9, 0xe5, 0x23, 0x96, 0xe9, 0xea, 0x0f, 0x0c, 0x42, 0x08, 0x7c, 0x3a, 0x7d, 0x4d, + 0x82, 0xa1, 0x92, 0xef, 0x24, 0x57, 0x0e, 0x06, 0x9b, 0x86, 0xae, 0xed, 0x72, 0x7f, 0x4c, 0x2b, + 0xa2, 0x89, 0xf2, 0x90, 0x62, 0x97, 0xea, 0x9c, 0x7d, 0x51, 0xea, 0x14, 0x6d, 0x42, 0x75, 0x0d, + 0x6f, 0xd9, 0x9a, 0x18, 0x0d, 0x45, 0x34, 0xd1, 0x45, 0xc8, 0xda, 0xb8, 0xda, 0xb2, 0x34, 0x67, + 0xbf, 0x52, 0x35, 0x74, 0x47, 0xad, 0x3a, 0xec, 0x7a, 0x56, 0xf1, 0xae, 0x5b, 0x37, 0xa7, 0x8e, + 0x33, 0x59, 0xc3, 0x18, 0xb2, 0x32, 0x2a, 0x40, 0xf3, 0x0c, 0x42, 0x7a, 0xa8, 0x61, 0x47, 0xd5, + 0x1a, 0x76, 0x8e, 0xbd, 0x07, 0x13, 0x4d, 0x9f, 0x2e, 0x5f, 0x18, 0xf4, 0x17, 0xb6, 0x2e, 0x42, + 0xd6, 0x30, 0xb1, 0x15, 0x48, 0x44, 0xa5, 0x70, 0xcf, 0x61, 0x0c, 0x59, 0x19, 0x15, 0x20, 0x91, + 0xa4, 0x3a, 0x64, 0x98, 0xc5, 0x46, 0xd1, 0x6c, 0x6d, 0x79, 0xf5, 0xb0, 0x89, 0xb6, 0xd1, 0x98, + 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9, + 0xc4, 0x1a, 0x0c, 0x07, 0x16, 0xb0, 0x9c, 0xf8, 0x8f, 0xd2, 0xfd, 0xdf, 0xb0, 0x08, 0x32, 0x40, + 0x79, 0x48, 0xe1, 0x3d, 0xd3, 0xb0, 0x1c, 0x5c, 0xa3, 0x47, 0x1e, 0x52, 0x8a, 0xdb, 0x96, 0x57, + 0x00, 0xb5, 0x0f, 0x6e, 0xf8, 0x3b, 0xa4, 0x69, 0xef, 0x3b, 0xa4, 0x13, 0x90, 0xf4, 0x7f, 0xa9, + 0x93, 0x35, 0xbc, 0x3a, 0xc5, 0xed, 0x9e, 0xf3, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, 0x43, 0x89, + 0xb3, 0x44, 0x22, 0x94, 0x00, 0x00, } r := bytes.NewReader(gzipped) gzipr, err := compress_gzip.NewReader(r) diff --git a/x/staking/types/tx.pb.go b/x/staking/types/tx.pb.go index 431e43a5b7..31084678dc 100644 --- a/x/staking/types/tx.pb.go +++ b/x/staking/types/tx.pb.go @@ -467,61 +467,61 @@ func init() { func init() { proto.RegisterFile("cosmos/staking/v1beta1/tx.proto", fileDescriptor_0926ef28816b35ab) } var fileDescriptor_0926ef28816b35ab = []byte{ - // 850 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x96, 0xcb, 0x6e, 0xd3, 0x4c, - 0x1c, 0xc5, 0xe3, 0x24, 0xcd, 0xd7, 0x6f, 0xaa, 0xde, 0xdc, 0x8b, 0x52, 0xab, 0x8a, 0x2b, 0x97, - 0x4b, 0x05, 0xd4, 0xa1, 0x45, 0x08, 0xd4, 0x0d, 0x6a, 0x1a, 0x10, 0x55, 0x89, 0x84, 0xdc, 0xc2, - 0x02, 0x21, 0x45, 0xbe, 0x4c, 0x8c, 0x15, 0xdb, 0x93, 0x7a, 0x26, 0x55, 0x23, 0xf1, 0x00, 0x2c, - 0x2b, 0xb1, 0x63, 0xd5, 0x87, 0x60, 0xcf, 0xb6, 0x62, 0x81, 0xba, 0x44, 0x2c, 0x02, 0x6a, 0x25, - 0xd4, 0x75, 0x9e, 0x00, 0xd9, 0x1e, 0x3b, 0x8e, 0x73, 0x51, 0x54, 0x91, 0x0d, 0xab, 0x36, 0x33, - 0xbf, 0x39, 0x33, 0x73, 0xfe, 0x67, 0x66, 0x0c, 0x78, 0x15, 0x61, 0x0b, 0xe1, 0x3c, 0x26, 0x72, - 0xd5, 0xb0, 0xf5, 0xfc, 0xd1, 0x86, 0x02, 0x89, 0xbc, 0x91, 0x27, 0xc7, 0x62, 0xcd, 0x41, 0x04, - 0xb1, 0x8b, 0x3e, 0x20, 0x52, 0x40, 0xa4, 0x00, 0x37, 0xaf, 0x23, 0x1d, 0x79, 0x48, 0xde, 0xfd, - 0xcf, 0xa7, 0xb9, 0x25, 0x9f, 0x2e, 0xfb, 0x1d, 0x74, 0xa8, 0xdf, 0x95, 0xa3, 0x33, 0x29, 0x32, - 0x86, 0xe1, 0x34, 0x2a, 0x32, 0x6c, 0xda, 0xcf, 0xeb, 0x08, 0xe9, 0x26, 0xcc, 0x7b, 0xbf, 0x94, - 0x7a, 0x25, 0x4f, 0x0c, 0x0b, 0x62, 0x22, 0x5b, 0x35, 0x0a, 0xdc, 0xe8, 0xb3, 0xd4, 0x60, 0x65, - 0x74, 0x05, 0x71, 0x19, 0xd9, 0x6e, 0xf8, 0x5d, 0xc2, 0x97, 0x34, 0x60, 0x4b, 0x58, 0xdf, 0x71, - 0xa0, 0x4c, 0xe0, 0x6b, 0xd9, 0x34, 0x34, 0x99, 0x20, 0x87, 0xdd, 0x03, 0x13, 0x1a, 0xc4, 0xaa, - 0x63, 0xd4, 0x88, 0x81, 0xec, 0x2c, 0xb3, 0xc2, 0xac, 0x4d, 0x6c, 0xae, 0x8a, 0xbd, 0xf7, 0x2d, - 0x16, 0xdb, 0x68, 0x21, 0x7d, 0xd6, 0xe4, 0x13, 0x52, 0x74, 0x34, 0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e, 0x72, - 0xcc, 0xf9, 0x45, 0x8e, 0xf9, 0x75, 0x91, 0x63, 0x4e, 0x2e, 0x73, 0x89, 0xf3, 0xcb, 0x5c, 0xe2, - 0xfb, 0x65, 0x2e, 0xf1, 0xe6, 0xde, 0xc0, 0x67, 0xec, 0x38, 0xfc, 0x64, 0xf5, 0x1e, 0x34, 0x25, - 0xe3, 0x45, 0xf2, 0xc1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3e, 0xb3, 0xef, 0xab, 0x7c, 0x0b, - 0x00, 0x00, + // 860 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x56, 0x4d, 0x6b, 0xe3, 0x46, + 0x18, 0xb6, 0x6c, 0xc7, 0x4d, 0x27, 0xe4, 0x4b, 0xf9, 0xc0, 0x11, 0xc1, 0x0a, 0x4a, 0x3f, 0x42, + 0xdb, 0xc8, 0x4d, 0x4a, 0x29, 0xe4, 0x52, 0xe2, 0xb8, 0xa1, 0x21, 0x35, 0x14, 0x25, 0xed, 0xa1, + 0x14, 0x8c, 0x3e, 0xc6, 0xaa, 0xb0, 0xa4, 0x51, 0x34, 0xe3, 0x10, 0x43, 0x7f, 0x40, 0x8f, 0x81, + 0xde, 0xf6, 0x94, 0x1f, 0xb1, 0x3f, 0x22, 0x2c, 0xec, 0x92, 0xe3, 0xb2, 0x07, 0xef, 0x92, 0xc0, + 0x92, 0xb3, 0x7f, 0xc1, 0xa2, 0xd1, 0x48, 0x96, 0xe5, 0x0f, 0x4c, 0x58, 0x5f, 0xf6, 0x64, 0x33, + 0xf3, 0xcc, 0xf3, 0xce, 0xfb, 0xbc, 0xcf, 0xbc, 0xaf, 0x80, 0xa8, 0x23, 0xec, 0x20, 0x5c, 0xc6, + 0x44, 0x6d, 0x5a, 0xae, 0x59, 0xbe, 0xdc, 0xd3, 0x20, 0x51, 0xf7, 0xca, 0xe4, 0x4a, 0x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 0x8a, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From 3d46c672f6721ef8669ce733da63e2d198234a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Tue, 27 Oct 2020 15:34:25 +0100 Subject: [PATCH 81/84] Fix Optimistic Channel Handshake bugs (#7678) * fix optimistic handshake bugs and add crossing hello test * fix tests Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- x/ibc/core/04-channel/keeper/handshake.go | 31 +++++++++--- .../core/04-channel/keeper/handshake_test.go | 6 +++ x/ibc/testing/coordinator.go | 48 +++++++++++++++++++ 3 files changed, 78 insertions(+), 7 deletions(-) diff --git a/x/ibc/core/04-channel/keeper/handshake.go b/x/ibc/core/04-channel/keeper/handshake.go index 900c234bec..a812536b76 100644 --- a/x/ibc/core/04-channel/keeper/handshake.go +++ b/x/ibc/core/04-channel/keeper/handshake.go @@ -187,16 +187,33 @@ func (k Keeper) ChanOpenTry( return nil, err } - k.SetChannel(ctx, portID, desiredChannelID, channel) + var ( + capKey *capabilitytypes.Capability + err error + ) - capKey, err := k.scopedKeeper.NewCapability(ctx, host.ChannelCapabilityPath(portID, desiredChannelID)) - if err != nil { - return nil, sdkerrors.Wrapf(err, "could not create channel capability for port ID %s and channel ID %s", portID, desiredChannelID) + // Only create a capability and set the sequences if the previous channel does not exist + _, found = k.GetChannel(ctx, portID, desiredChannelID) + if !found { + capKey, err = k.scopedKeeper.NewCapability(ctx, host.ChannelCapabilityPath(portID, desiredChannelID)) + if err != nil { + return nil, sdkerrors.Wrapf(err, "could not create channel capability for port ID %s and channel ID %s", portID, desiredChannelID) + } + + k.SetNextSequenceSend(ctx, portID, desiredChannelID, 1) + k.SetNextSequenceRecv(ctx, portID, desiredChannelID, 1) + k.SetNextSequenceAck(ctx, portID, desiredChannelID, 1) + } else { + // capability initialized in ChanOpenInit + capKey, found = k.scopedKeeper.GetCapability(ctx, host.ChannelCapabilityPath(portID, desiredChannelID)) + if !found { + return nil, sdkerrors.Wrapf(types.ErrChannelCapabilityNotFound, + "capability not found for existing channel, portID (%s) channelID (%s)", portID, desiredChannelID, + ) + } } - k.SetNextSequenceSend(ctx, portID, desiredChannelID, 1) - k.SetNextSequenceRecv(ctx, portID, desiredChannelID, 1) - k.SetNextSequenceAck(ctx, portID, desiredChannelID, 1) + k.SetChannel(ctx, portID, desiredChannelID, channel) k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", desiredChannelID, "previous-state", previousChannel.State.String(), "new-state", "TRYOPEN") diff --git a/x/ibc/core/04-channel/keeper/handshake_test.go b/x/ibc/core/04-channel/keeper/handshake_test.go index 77bbb90ee4..927bc3131b 100644 --- a/x/ibc/core/04-channel/keeper/handshake_test.go +++ b/x/ibc/core/04-channel/keeper/handshake_test.go @@ -153,6 +153,12 @@ func (suite *KeeperTestSuite) TestChanOpenTry() { suite.chainB.CreatePortCapability(connB.NextTestChannel(ibctesting.MockPort).PortID) portCap = suite.chainB.GetPortCapability(connB.NextTestChannel(ibctesting.MockPort).PortID) }, true}, + {"success with crossing hello", func() { + _, _, connA, connB = suite.coordinator.SetupClientConnections(suite.chainA, suite.chainB, ibctesting.Tendermint) + suite.coordinator.ChanOpenInitOnBothChains(suite.chainA, suite.chainB, connA, connB, ibctesting.MockPort, ibctesting.MockPort, types.ORDERED) + + portCap = suite.chainB.GetPortCapability(connB.NextTestChannel(ibctesting.MockPort).PortID) + }, true}, {"success with empty counterparty chosen channel id", func() { var clientA, clientB string clientA, clientB, connA, connB = suite.coordinator.SetupClientConnections(suite.chainA, suite.chainB, ibctesting.Tendermint) diff --git a/x/ibc/testing/coordinator.go b/x/ibc/testing/coordinator.go index 2b7c6a466d..6dbacee50f 100644 --- a/x/ibc/testing/coordinator.go +++ b/x/ibc/testing/coordinator.go @@ -524,6 +524,54 @@ func (coord *Coordinator) ChanOpenInit( return sourceChannel, counterpartyChannel, nil } +// ChanOpenInitOnBothChains initializes a channel on the source chain and counterparty chain +// with the state INIT using the OpenInit handshake call. +func (coord *Coordinator) ChanOpenInitOnBothChains( + source, counterparty *TestChain, + connection, counterpartyConnection *TestConnection, + sourcePortID, counterpartyPortID string, + order channeltypes.Order, +) (TestChannel, TestChannel, error) { + sourceChannel := connection.AddTestChannel(sourcePortID) + counterpartyChannel := counterpartyConnection.AddTestChannel(counterpartyPortID) + + // NOTE: only creation of a capability for a transfer or mock port is supported + // Other applications must bind to the port in InitGenesis or modify this code. + source.CreatePortCapability(sourceChannel.PortID) + counterparty.CreatePortCapability(counterpartyChannel.PortID) + coord.IncrementTime() + + // initialize channel on source + if err := source.ChanOpenInit(sourceChannel, counterpartyChannel, order, connection.ID); err != nil { + return sourceChannel, counterpartyChannel, err + } + coord.IncrementTime() + + // initialize channel on counterparty + if err := counterparty.ChanOpenInit(counterpartyChannel, sourceChannel, order, counterpartyConnection.ID); err != nil { + return sourceChannel, counterpartyChannel, err + } + coord.IncrementTime() + + // update counterparty client on source connection + if err := coord.UpdateClient( + source, counterparty, + connection.ClientID, Tendermint, + ); err != nil { + return sourceChannel, counterpartyChannel, err + } + + // update source client on counterparty connection + if err := coord.UpdateClient( + counterparty, source, + counterpartyConnection.ClientID, Tendermint, + ); err != nil { + return sourceChannel, counterpartyChannel, err + } + + return sourceChannel, counterpartyChannel, nil +} + // ChanOpenTry initializes a channel on the source chain with the state TRYOPEN // using the OpenTry handshake call. func (coord *Coordinator) ChanOpenTry( From e306a852ff9ffb7cae7dfd540b31db56594d49a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Tue, 27 Oct 2020 15:51:47 +0100 Subject: [PATCH 82/84] update core IBC docs (#7560) * update state * add empty concept fields, update callbacks and messages * update client creation, update and upgrade section * add packet lifecycle concepts * add host and proof section * add connection handshake section * add channel handshakes * state transitions * self review fixes * Apply suggestions from code review Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply @fedekunze review suggestions * packet data section * Apply suggestions from code review Co-authored-by: Christopher Goes * add @cwgoes and @fedekunze review suggestions * fix typos Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Christopher Goes Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- x/ibc/core/04-channel/keeper/handshake.go | 2 +- x/ibc/core/05-port/types/module.go | 1 + x/ibc/core/spec/01_concepts.md | 272 +++++++++++++++++++--- x/ibc/core/spec/02_state.md | 32 +-- x/ibc/core/spec/03_state_transitions.md | 99 ++++++++ x/ibc/core/spec/04_messages.md | 47 +++- x/ibc/core/spec/05_callbacks.md | 4 +- 7 files changed, 395 insertions(+), 62 deletions(-) diff --git a/x/ibc/core/04-channel/keeper/handshake.go b/x/ibc/core/04-channel/keeper/handshake.go index a812536b76..03b100be7a 100644 --- a/x/ibc/core/04-channel/keeper/handshake.go +++ b/x/ibc/core/04-channel/keeper/handshake.go @@ -381,7 +381,7 @@ func (k Keeper) ChanOpenConfirm( // // This section defines the set of functions required to close a channel handshake // as defined in https://github.com/cosmos/ics/tree/master/spec/ics-004-channel-and-packet-semantics#closing-handshake - +// // ChanCloseInit is called by either module to close their end of the channel. Once // closed, channels cannot be reopened. func (k Keeper) ChanCloseInit( diff --git a/x/ibc/core/05-port/types/module.go b/x/ibc/core/05-port/types/module.go index a619cd4b7f..a9a7b50922 100644 --- a/x/ibc/core/05-port/types/module.go +++ b/x/ibc/core/05-port/types/module.go @@ -59,6 +59,7 @@ type IBCModule interface { ) error // OnRecvPacket must return the acknowledgement bytes + // In the case of an asynchronous acknowledgement, nil should be returned. OnRecvPacket( ctx sdk.Context, packet channeltypes.Packet, diff --git a/x/ibc/core/spec/01_concepts.md b/x/ibc/core/spec/01_concepts.md index f51a073c4d..9e7654ddda 100644 --- a/x/ibc/core/spec/01_concepts.md +++ b/x/ibc/core/spec/01_concepts.md @@ -7,6 +7,71 @@ order: 1 > NOTE: if you are not familiar with the IBC terminology and concepts, please read this [document](https://github.com/cosmos/ics/blob/master/ibc/1_IBC_TERMINOLOGY.md) as prerequisite reading. +## Client Creation, Updates, and Upgrades + +IBC clients are on chain light clients. The light client is responsible for verifying +counterparty state. A light client can be created by any user submitting a client +identifier and a valid initial `ClientState` and `ConsensusState`. The client identifier +must not already be used. Clients are given a client identifier prefixed store to +store their associated client state and consensus states. Consensus states are +stored using their associated height. + +Clients can be updated by any user submitting a valid `Header`. The client state callback +to `CheckHeaderAndUpdateState` is responsible for verifying the header against previously +stored state. The function should also return the updated client state and consensus state +if the header is considered a valid update. A light client, such as Tendermint, may have +client specific parameters like `TrustLevel` which must be considered valid in relation +to the `Header`. The update height is not necessarily the lastest height of the light +client. Updates may fill in missing consensus state heights. + +Clients may be upgraded. The upgrade should be verified using `VerifyUpgrade`. It is not +a requirement to allow for light client upgrades. For example, the solo machine client +will simply return an error on `VerifyUpgrade`. Clients which implement upgrades +are expected to account for, but not necessarily support, planned and unplanned upgrades. + +## Client Misbehaviour + +IBC clients must freeze when the counterparty chain becomes byzantine and +takes actions that could fool the light client into accepting invalid state +transitions. Thus, relayers are able to submit Misbehaviour proofs that prove +that a counterparty chain has signed two Headers for the same height. This +constitutes misbehaviour as the IBC client could have accepted either header +as valid. Upon verifying the misbehaviour the IBC client must freeze at that +height so that any proof verifications for the frozen height or later fail. + +Note, there is a difference between the chain-level Misbehaviour that IBC is +concerned with and the validator-level Evidence that Tendermint is concerned +with. Tendermint must be able to detect, submit, and punish any evidence of +individual validators breaking the Tendermint consensus protocol and attempting +to mount an attack. IBC clients must only act when an attack is successful +and the chain has successfully forked. In this case, valid Headers submitted +to the IBC client can no longer be trusted and the client must freeze. + +Governance may then choose to override a frozen client and provide the correct, +canonical Header so that the client can continue operating after the Misbehaviour +submission. + +## ClientUpdateProposal + +A governance proposal may be passed to update a specified client with a provided +header. This is useful in unfreezing clients or updating expired clients. Each +client is expected to implement this functionality. A client may choose to disallow +an update by a governance proposal by returning an error in the client state function +'CheckProposedHeaderAndUpdateState'. + +The localhost client cannot be updated by a governance proposal. + +The solo machine client requires the boolean flag 'AllowUpdateAfterProposal' to be set +to true in order to be updated by a proposal. This is set upon client creation and cannot +be updated later. + +The tendermint client has two flags update flags, 'AllowUpdateAfterExpiry' and +'AllowUpdateAfterMisbehaviour'. The former flag can only be used to unexpire clients. The +latter flag can be used to unfreeze a client and if necessary it will also unexpire the client. +It is advised to let a client expire if it has become frozen before proposing a new header. +This is to avoid the client from becoming refrozen if the misbehaviour evidence has not +expired. These boolean flags are set upon client creation and cannot be updated later. + ## IBC Client Heights IBC Client Heights are represented by the struct: @@ -61,27 +126,37 @@ Other client-types may implement their own logic to verify the IBC Heights that The IBC interfaces expect an `ibcexported.Height` interface, however all clients should use the concrete implementation provided in `02-client/types` and reproduced above. -## Client Misbehaviour +## Connection Handshake -IBC clients must freeze when the counterparty chain becomes malicious and -takes actions that could fool the light client into accepting invalid state -transitions. Thus, relayers are able to submit Misbehaviour proofs that prove -that a counterparty chain has signed two Headers for the same height. This -constitutes misbehaviour as the IBC client could have accepted either header -as valid. Upon verifying the misbehaviour the IBC client must freeze at that -height so that any proof verifications for the frozen height or later fail. +The connection handshake occurs in 4 steps as defined in [ICS 03](https://github.com/cosmos/ics/tree/master/spec/ics-003-connection-semantics). -Note, there is a difference between the chain-level Misbehaviour that IBC is -concerned with and the validator-level Evidence that Tendermint is concerned -with. Tendermint must be able to detect, submit, and punish any evidence of -individual validators breaking the Tendermint consensus protocol and attempting -to mount an attack. IBC clients must only act when an attack is successful -and the chain has successfully forked. In this case, valid Headers submitted -to the IBC client can no longer be trusted and the client must freeze. +`ConnOpenInit` is the first attempt to initialize a connection on the executing chain. +The handshake is expected to succeed if the connection identifier selected is not used and the +version selected is supported. The connection identifier for the counterparty connection may +be left empty indicating that the counterparty may select its own identifier. The connection +is set and stored in the INIT state upon success. -Governance may then choose to override a frozen client and provide the correct, -canonical Header so that the client can continue operating after the Misbehaviour -submission. +`ConnOpenTry` is a response to a chain executing `ConnOpenInit`. The executing chain will validate +the chain level parameters the counterparty has stored such as its chainID and consensus parameters. +The executing chain will also verify that if a previous connection exists for the specified +connection identifier that all the parameters match and its previous state was in INIT. This +may occur when both chains execute `ConnOpenInit` simultaneously. The executing chain will verify +that the counterparty created a connection in INIT state. The executing chain will also verify +The `ClientState` and `ConsensusState` the counterparty stores for the executing chain. The +executing chain will select a version from the intersection of its supported versions and the +versions set by the counterparty. The connection is set and stored in the TRYOPEN state upon +success. + +`ConnOpenAck` may be called on a chain when the counterparty connection has entered TRYOPEN. A +previous connection on the executing chain must exist in either INIT or TRYOPEN. The executing +chain will verify the version the counterparty selected. If the counterparty selected its own +connection identifier, it will be validated in the basic validation of a `MsgConnOpenAck`. +The counterparty connection state is verified along with the `ClientState` and `ConsensusState` +stored for the executing chain. The connection is set and stored in the OPEN state upon success. + +`ConnOpenConfirm` is a response to a chain executing `ConnOpenAck`. The executing chain's connection +must be in TRYOPEN. The counterparty connection state is verified to be in the OPEN state. The +connection is set and stored in the OPEN state upon success. ## Connection Version Negotiation @@ -124,6 +199,39 @@ with regards to version selection in `ConnOpenTry`. Each version in a set of versions should have a unique version identifier. ::: +## Channel Handshake + +The channel handshake occurs in 4 steps as defined in [ICS 04](https://github.com/cosmos/ics/tree/master/spec/ics-004-channel-and-packet-semantics). + +`ChanOpenInit` is the first attempt to initialize a channel on top of an existing connection. +The handshake is expected to succeed if the channel identifier selected is not used and the +version selected for the existing connection is a supported IBC version. The portID must correspond +to a port already binded upon `InitChain`. The channel identifier for the counterparty channel +may be left empty indicating that the counterparty may select its own identifier. The channel is +set and stored in the INIT state upon success. The channel parameters `NextSequenceSend`, +`NextSequenceRecv`, and `NextSequenceAck` are all set to 1 and a channel capability is created +for the given portID and channelID path. + +`ChanOpenTry` is a response to a chain executing `ChanOpenInit`. If the executing chain is calling +`ChanOpenTry` after previously executing `ChanOpenInit` then the provided channel parameters must +match the previously selected parameters. The connection the channel is created on top of must be +an OPEN state and its IBC version must support the desired channel type being created (ORDERED, +UNORDERED, etc). The executing chain will verify that the channel state of the counterparty is +in INIT. The executing chain will set and store the channel state in TRYOPEN. The channel +parameters `NextSequenceSend`, `NextSequenceRecv`, and `NextSequenceAck` are all set to 1 and +a channel capability is created for the given portID and channelID path only if the channel +did not previously exist. + +`ChanOpenAck` may be called on a chain when the counterparty channel has entered TRYOPEN. A +previous channel on the executing chain must exist be in either INIT or TRYOPEN state. If the +counterparty selected its own channel identifier, it will be validated in the basic validation +of `MsgChanOpenAck`. The executing chain verifies that the counterparty channel state is in +TRYOPEN. The channel is set and stored in the OPEN state upon success. + +`ChanOpenConfirm` is a response to a chain executing `ChanOpenAck`. The executing chain's +previous channel state must be in TRYOPEN. The executing chain verifies that the counterparty +channel state is OPEN. The channel is set and stored in the OPEN state upon success. + ## Channel Version Negotiation During the channel handshake procedure a version must be agreed upon between @@ -159,23 +267,119 @@ in the handshake callbacks. Implementations which do not feel they would benefit from versioning can do basic string matching using a single compatible version. -## ClientUpdateProposal +## Sending, Receiving, Acknowledging Packets -A governance proposal may be passed to update a specified client with a provided -header. This is useful in unfreezing clients or updating expired clients. Each -client is expected to implement this functionality. A client may choose to disallow -an update by a governance proposal by returning an error in the client state function -'CheckProposedHeaderAndUpdateState'. +Terminology: +**Packet Commitment** A hash of the packet stored on the sending chain. +**Packet Receipt** A single bit indicating that a packet has been received. +Used for timeouts. +**Acknowledgement** Data written to indicate the result of receiving a packet. +Typically conveying either success or failure of the receive. -The localhost client cannot be updated by a governance proposal. +A packet may be associated with one of the following states: +- the packet does not exist (ie it has not been sent) +- the packet has been sent but not received (the packet commitment exists on the +sending chain, but no receipt exists on the receiving chain) +- the packet has been received but not acknowledged (packet commitment exists +on the sending chain, a receipt exists on the receiving chain, but no acknowledgement +exists on the receiving chain) +- the packet has been acknowledgement but the acknowledgement has not been relayed +(the packet commitment exists on the sending chain, the receipt and acknowledgement +exist on the receiving chain) +- the packet has completed its life cycle (the packet commitment does not exist on +the sending chain, but a receipt and acknowledgement exist on the receiving chain) -The solo machine client requires the boolean flag 'AllowUpdateAfterProposal' to be set -to true in order to be updated by a proposal. This is set upon client creation and cannot -be updated later. +Sending of a packet is initiated by a call to the `ChannelKeeper.SendPacket` +function by an application module. Packets being sent will be verified for +correctness (core logic only). If the packet is valid, a hash of the packet +will be stored as a packet commitment using the packet sequence in the key. +Packet commitments are stored on the sending chain. -The tendermint client has two flags update flags, 'AllowUpdateAfterExpiry' and -'AllowUpdateAfterMisbehaviour'. The former flag can only be used to unexpire clients. The -latter flag can be used to unfreeze a client and if necessary it will also unexpire the client. -It is advised to let a client expire if it has become frozen before proposing a new header. -This is to avoid the client from becoming refrozen if the misbehaviour evidence has not -expired. These boolean flags are set upon client creation and cannot be updated later. +A message should be sent to the receving chain indicating that the packet +has been committed on the sending chain and should be received on the +receiving chain. The light client on the receiving chain, which verifies +the sending chain's state, should be updated to the lastest sending chain +state if possible. The verification will fail if the latest state of the +light client does not include the packet commitment. The receiving chain +is responsible for verifying that the counterparty set the hash of the +packet. If verification of the packet to be received is successful, the +receiving chain should store a receipt of the packet and call application +logic if necessary. An acknowledgement may be processed and stored at this time (synchronously) +or at another point in the future (asynchronously). + +Acknowledgements written on the receiving chain may be verified on the +sending chain. If the sending chain successfully verifies the acknowledgement +then it may delete the packet commitment stored at that sequence. There is +no requirement for acknowledgements to be written. Only the hash of the +acknowledgement is stored on the chain. Application logic may be executed +in conjunction with verifying an acknowledgement. For example, in fungible +cross-chain token transfer, a failed acknowledgement results in locked or +burned funds being refunded. + +Relayers are responsible for reconstructing packets between the sending, +receiving, and acknowledging of packets. + +IBC applications sending and receiving packets are expected to appropriately +handle data contained within a packet. For example, cross-chain token +transfers will unmarshal the data into proto definitions representing +a token transfer. + +Future optimizations may allow for storage cleanup. Stored packet +commitments could be removed from channels which do not write +packet acknowledgements and acknowledgements could be removed +when a packet has completed its life cycle. + +## Timing out Packets + +A packet may be timed out on the receiving chain if the packet timeout height or timestamp has +been surpassed on the receving chain or the channel has closed. A timed out +packet can only occur if the packet has never been received on the receiving +chain. ORDERED channels will verify that the packet sequence is greater than +the `NextSequenceRecv` on the receiving chain. UNORDERED channels will verify +that the packet receipt has not been written on the receiving chain. A timeout +on channel closure will additionally verify that the counterparty channel has +been closed. A successful timeout may execute application logic as appropriate. + +Both the packet's timeout timestamp and the timeout height must have been +surpassed on the receiving chain for a timeout to be valid. A timeout timestamp +or timeout height with a 0 value indicates the timeout field may be ignored. +Each packet is required to have at least one valid timeout field. + +## Closing Channels + +Closing a channel occurs in occurs in 2 handshake steps as defined in [ICS 04](https://github.com/cosmos/ics/tree/master/spec/ics-004-channel-and-packet-semantics). + +`ChanCloseInit` will close a channel on the executing chain if the channel exists, it is not +already closed and the connection it exists upon is OPEN. Channels can only be closed by a +calling module or in the case of a packet timeout on an ORDERED channel. + +`ChanCloseConfirm` is a response to a counterparty channel executing `ChanCloseInit`. The channel +on the executing chain will be closed if the channel exists, the channel is not already closed, +the connection the channel exists upon is OPEN and the executing chain successfully verifies +that the counterparty channel has been closed. + +## Port and Channel Capabilities + +## Hostname Validation + +Hostname validation is implemented as defined in [ICS 24](https://github.com/cosmos/ics/tree/master/spec/ics-024-host-requirements). + +The 24-host sub-module parses and validates identifiers. It also builds +the key paths used to store IBC related information. + +A valid identifier must conatin only alphanumeric characters or the +following list of allowed characters: +".", "\_", "+", "-", "#", "[", "]", "<", ">" + +- Client identifiers must contain between 9 and 64 characters. +- Connection identifiers must contain between 10 and 64 characters. +- Channel identifiers must contain between 10 and 64 characters. +- Port identifiers must contain between 2 and 64 characters. + +## Proofs + +Proofs for counterparty state validation are provided as bytes. These bytes +can be unmarshaled into proto definitions as necessary by light clients. +For example, the Tendermint light client will use the bytes as a merkle +proof where as the solo machine client will unmarshal the proof into +several layers proto definitions used for signature verficiation. diff --git a/x/ibc/core/spec/02_state.md b/x/ibc/core/spec/02_state.md index a5381a735c..5df09a097b 100644 --- a/x/ibc/core/spec/02_state.md +++ b/x/ibc/core/spec/02_state.md @@ -4,18 +4,22 @@ order: 2 # State -The paths for the values stored in state can be found [here](https://github.com/cosmos/ics/blob/master/spec/ics-024-host-requirements/README.md#path-space). Additionally, the SDK adds -a prefix to the path to be able to aggregate the values for querying purposes. +The paths for the values stored in state is defined [here](https://github.com/cosmos/ics/blob/master/spec/ics-024-host-requirements/README.md#path-space). +Additionally, the SDK adds a prefix to the path to be able to aggregate the values for querying purposes. +The client type is not stored since it can be obtained through the client state. -| Prefix | Path | Value type | -|--------|------------------------------------------------------------------------|----------------| -| "0/" | "clients/{identifier}/clientState" | ClientState | -| "0/" | "clients/{identifier}/consensusStates/{height}" | ConsensusState | -| "0/" | "clients/{identifier}/type" | ClientType | -| "0/" | "connections/{identifier}" | ConnectionEnd | -| "0/" | "ports/{identifier}" | CapabilityKey | -| "0/" | "ports/{identifier}/channels/{identifier}" | ChannelEnd | -| "0/" | "ports/{identifier}/channels/{identifier}/key" | CapabilityKey | -| "0/" | "ports/{identifier}/channels/{identifier}/nextSequenceRecv" | uint64 | -| "0/" | "ports/{identifier}/channels/{identifier}/packets/{sequence}" | bytes | -| "0/" | "ports/{identifier}/channels/{identifier}/acknowledgements/{sequence}" | bytes | +| Prefix | Path | Value type | +|--------|-----------------------------------------------------------------------------|----------------| +| "0/" | "clients/{identifier}/clientState" | ClientState | +| "0/" | "clients/{identifier}/consensusStates/{height}" | ConsensusState | +| "0/" | "clients/{identifier}/connections" | []string | +| "0/" | "connections/{identifier}" | ConnectionEnd | +| "0/" | "ports/{identifier}" | CapabilityKey | +| "0/" | "channelEnds/ports/{identifier}/channels/{identifier}" | ChannelEnd | +| "0/" | "capabilities/ports/{identifier}/channels/{identifier}/key" | CapabilityKey | +| "0/" | "seqSends/ports/{identifier}/channels/{identifier}/nextSequenceSend" | uint64 | +| "0/" | "seqRecvs/ports/{identifier}/channels/{identifier}/nextSequenceRecv" | uint64 | +| "0/" | "seqAcks/ports/{identifier}/channels/{identifier}/nextSequenceAck" | uint64 | +| "0/" | "commitments/ports/{identifier}/channels/{identifier}/packets/{sequence}" | bytes | +| "0/" | "receipts/ports/{identifier}/channels/{identifier}/receipts/{sequence}" | bytes | +| "0/" | "acks/ports/{identifier}/channels/{identifier}/acknowledgements/{sequence}" | bytes | diff --git a/x/ibc/core/spec/03_state_transitions.md b/x/ibc/core/spec/03_state_transitions.md index dc70ea002c..de31957d66 100644 --- a/x/ibc/core/spec/03_state_transitions.md +++ b/x/ibc/core/spec/03_state_transitions.md @@ -4,3 +4,102 @@ order: 3 # State Transitions +The described state transitions assume successful message exection. + +## Create Client + +`MsgCreateClient` will initialize and store a `ClientState` and `ConsensusState` in the sub-store +created using the given client identifier. + +## Update Client + +`MsgUpdateClient` will update the `ClientState` and create a new `ConsensusState` for the +update height. + +## Misbehaviour + +`MsgSubmitMisbehaviour` will freeze a client. + +## Upgrade Client + +`MsgUpgradeClient` will upgrade the `ClientState` and `ConsensusState` to the update chain level +parameters and if applicable will update to the new light client implementation. + +## Client Update Proposal + +An Update Client Proposal will unfreeze a client and set an updated `ClientState` and a new +`ConsensusState`. + +## Connection Open Init + +`MsgConnectionOpenInit` will initialize a connection state in INIT. + +## Connection Open Try + +`MsgConnectionOpenTry` will initialize or update a connection state to be in TRYOPEN. + +## Connection Open Ack + +`MsgConnectionOpenAck` will update a connection state from INIT or TRYOPEN to be in OPEN. + +## Connection Open Confirm + +`MsgConnectionOpenAck` will update a connection state from TRYOPEN to OPEN. + +## Channel Open Init + +`MsgChannelOpenInit` will initialize a channel state in INIT. It will create a channel capability +and set all Send, Receive and Ack Sequences to 1 for the channel. + +## Channel Open Try + +`MsgChannelOpenTry` will initialize or update a channel state to be in TRYOPEN. If the channel +is being initialized, It will create a channel capability and set all Send, Receive and Ack +Sequences to 1 for the channel. + +## Channel Open Ack + +`MsgChannelOpenAck` will update the channel state to OPEN. It will set the version and channel +identifier for its counterparty. + +## Channel Open Confirm + +`MsgChannelOpenConfirm` will update the channel state to OPEN. + +## Channel Close Init + +`MsgChannelCloseInit` will update the channel state to CLOSED. + +## Channel Close Confirm + +`MsgChannelCloseConfirm` will update the channel state to CLOSED. + +## Send Packet + +A application calling `ChannelKeeper.SendPacket` will incremenet the next sequence send and set +a hash of the packet as the packet commitment. + +## Receive Packet + +`MsgRecvPacket` will increment the next sequence receive for ORDERED channels and set a packet +receipt for UNORDERED channels. + +## Write Acknowledgement + +`WriteAcknowledgement` may be executed synchronously during the execution of `MsgRecvPacket` or +asynchonously by an application module. It writes an acknowledgement to the store. + +## Acknowledge Packet + +`MsgAcknowledgePacket` deletes the packet commitment and for ORDERED channels increments next +sequences ack. + +## Timeout Packet + +`MsgTimeoutPacket` deletes the packet commitment and for ORDERED channels sets the channel state +to CLOSED. + +## Timeout Packet on Channel Closure + +`MsgTimeoutOnClose` deletes the packet commitment and for ORDERED channels sets the channel state +to CLOSED. diff --git a/x/ibc/core/spec/04_messages.md b/x/ibc/core/spec/04_messages.md index fd46b5b8d1..34d68200b2 100644 --- a/x/ibc/core/spec/04_messages.md +++ b/x/ibc/core/spec/04_messages.md @@ -29,9 +29,8 @@ This message is expected to fail if: - `Signer` is empty - A light client with the provided id and type already exist -The message creates and stores a light client with the given ID and consensus type, -stores the validator set as the `Commiter` of the given consensus state and stores -both the consensus state and its commitment root (i.e app hash). +The message creates and stores a light client with an initial consensus state for the given client +identifier. ### MsgUpdateClient @@ -51,11 +50,36 @@ This message is expected to fail if: - `Header` is empty or invalid - `Signer` is empty - A `ClientState` hasn't been created for the given ID -- the header's client type is different from the registered one -- the client is frozen due to misbehaviour and cannot be updated +- The client is frozen due to misbehaviour and cannot be updated +- The header fails to provide a valid update for the client -The message validates the header and updates the consensus state with the new -height, commitment root and validator sets, which are then stored. +The message validates the header and updates the client state and consensus state for the +header height. + +### MsgUpgradeClient +```go +type MsgUpgradeClient struct { + ClientId string + ClientState *types.Any // proto-packed client state + UpgradeHeight *Height + ProofUpgrade []byte + Signer string +} +``` + +This message is expected to fail if: + +- `ClientId` is invalid (not alphanumeric or not within 10-20 characters) +- `ClientState` is empty or invalid +- `UpgradeHeight` is empty or zero +- `ProofUpgrade` is empty +- `Signer` is empty +- A `ClientState` hasn't been created for the given ID +- The client is frozen due to misbehaviour and cannot be upgraded +- The upgrade proof fails + +The message upgrades the client state and consensus state upon successful validation of a +chain upgrade. ### MsgSubmitMisbehaviour @@ -77,8 +101,7 @@ This message is expected to fail if: - A `ClientState` hasn't been created for the given ID - `Misbehaviour` check failed -The message validates the header and updates the consensus state with the new -height, commitment root and validator sets, which are then stored. +The message verifies the misbehaviour and freezes the client. ## ICS 03 - Connection @@ -432,7 +455,7 @@ This message is expected to fail if: - `Packet` fails basic validation - `Proof` does not prove that the packet has not been received on the counterparty chain. -The message times out a packet on chain B. +The message times out a packet that was sent on chain A and never received on chain B. ### MsgTimeoutOnClose @@ -461,7 +484,7 @@ This message is expected to fail if: - `Proof` does not prove that the packet has not been received on the counterparty chain. - `ProofClose` does not prove that the counterparty channel end has been closed. -The message times out a packet on chain B. +The message times out a packet that was sent on chain A and never received on chain B. ### MsgAcknowledgement @@ -486,4 +509,4 @@ This message is expected to fail if: - `Acknowledgement` is empty - `Proof` does not prove that the counterparty received the `Packet`. -The message receives a packet on chain A. +The message acknowledges that the packet sent from chainA was received on chain B. diff --git a/x/ibc/core/spec/05_callbacks.md b/x/ibc/core/spec/05_callbacks.md index 8d81554c51..c276ae370e 100644 --- a/x/ibc/core/spec/05_callbacks.md +++ b/x/ibc/core/spec/05_callbacks.md @@ -4,7 +4,8 @@ order: 5 # Callbacks -Application modules implementing the IBC module must implement the following callbacks as found in [05-port](../core/05-port/types/module.go). +Application modules implementing the IBC module must implement the following callbacks as found in [05-port](../05-port/types/module.go). +More information on how to implement these callbacks can be found in the [implementation guide](../../../../docs/ibc/custom.md). ```go // IBCModule defines an interface that implements all the callbacks @@ -59,6 +60,7 @@ type IBCModule interface { ) error // OnRecvPacket must return the acknowledgement bytes + // In the case of an asynchronous acknowledgement, nil should be returned. OnRecvPacket( ctx sdk.Context, packet channeltypes.Packet, From db09e516131b1f02181ffade8a2e991f00ec5ac5 Mon Sep 17 00:00:00 2001 From: Marko Date: Tue, 27 Oct 2020 16:46:57 +0100 Subject: [PATCH 83/84] ci: upload coverage once (#7690) --- .codecov.yml | 2 - .github/workflows/test.yml | 319 ++++++++----------------------------- version/command.go | 6 +- 3 files changed, 71 insertions(+), 256 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index bd5979393c..e17633a5d3 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -7,8 +7,6 @@ coverage: precision: 2 round: down range: 70...100 - notify: - after_n_builds: 4 status: # Learn more at https://docs.codecov.io/docs/commit-status diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33968233fe..1976f21f0c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,46 +57,41 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Display go version - run: go version - name: Create a file with all the pkgs run: go list ./... > pkgs.txt - name: Split pkgs into 4 files - run: split -n l/4 --additional-suffix=.txt ./pkgs.txt + run: split -d -n l/4 pkgs.txt pkgs.txt.part. # cache multiple - uses: actions/upload-artifact@v2 with: - name: "${{ github.sha }}-aa" - path: ./xaa.txt + name: "${{ github.sha }}-00" + path: ./pkgs.txt.part.00 - uses: actions/upload-artifact@v2 with: - name: "${{ github.sha }}-ab" - path: ./xab.txt + name: "${{ github.sha }}-01" + path: ./pkgs.txt.part.01 - uses: actions/upload-artifact@v2 with: - name: "${{ github.sha }}-ac" - path: ./xac.txt + name: "${{ github.sha }}-02" + path: ./pkgs.txt.part.02 - uses: actions/upload-artifact@v2 with: - name: "${{ github.sha }}-ad" - path: ./xad.txt + name: "${{ github.sha }}-03" + path: ./pkgs.txt.part.03 - test-coverage-run-1: + tests: runs-on: ubuntu-latest needs: split-test-files - timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + part: ["00", "01", "02", "03"] steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2.1.3 with: go-version: 1.15 - - name: Display go version - run: go version - uses: technote-space/get-diff-action@v4 - id: git_diff with: PATTERNS: | **/**.go @@ -104,11 +99,46 @@ jobs: go.sum - uses: actions/download-artifact@v2 with: - name: "${{ github.sha }}-aa" + name: "${{ github.sha }}-${{ matrix.part }}" if: env.GIT_DIFF - name: test & coverage report creation run: | - cat xaa.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='norace ledger test_ledger_mock' + cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -timeout 30m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='norace ledger test_ledger_mock' + if: env.GIT_DIFF + - uses: actions/upload-artifact@v2 + with: + name: "${{ github.sha }}-${{ matrix.part }}-coverage" + path: ./${{ matrix.part }}profile.out + + upload-coverage-report: + runs-on: ubuntu-latest + needs: tests + steps: + - uses: actions/checkout@v2 + - uses: technote-space/get-diff-action@v4 + with: + PATTERNS: | + **/**.go + go.mod + go.sum + - uses: actions/download-artifact@v2 + with: + name: "${{ github.sha }}-00-coverage" + if: env.GIT_DIFF + - uses: actions/download-artifact@v2 + with: + name: "${{ github.sha }}-01-coverage" + if: env.GIT_DIFF + - uses: actions/download-artifact@v2 + with: + name: "${{ github.sha }}-02-coverage" + if: env.GIT_DIFF + - uses: actions/download-artifact@v2 + with: + name: "${{ github.sha }}-03-coverage" + if: env.GIT_DIFF + - run: | + cat ./*profile.out | grep -v "mode: atomic" >> coverage.txt if: env.GIT_DIFF - name: filter out DONTCOVER run: | @@ -121,24 +151,24 @@ jobs: sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt done if: env.GIT_DIFF - - uses: codecov/codecov-action@v1.0.14 + - uses: codecov/codecov-action@v1.0.13 with: file: ./coverage.txt if: env.GIT_DIFF - test-coverage-run-2: + test-race: runs-on: ubuntu-latest needs: split-test-files - timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + part: ["00", "01", "02", "03"] steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2.1.3 with: go-version: 1.15 - - name: Display go version - run: go version - uses: technote-space/get-diff-action@v4 - id: git_diff with: PATTERNS: | **/**.go @@ -146,235 +176,20 @@ jobs: go.sum - uses: actions/download-artifact@v2 with: - name: "${{ github.sha }}-ab" + name: "${{ github.sha }}-${{ matrix.part }}" if: env.GIT_DIFF - name: test & coverage report creation run: | - cat xab.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='norace ledger test_ledger_mock' - if: env.GIT_DIFF - - name: filter out DONTCOVER - run: | - excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')" - excludelist+=" $(find ./ -type f -name '*.pb.go')" - excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')" - for filename in ${excludelist}; do - filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g') - echo "Excluding ${filename} from coverage report..." - sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt - done - if: env.GIT_DIFF - - uses: codecov/codecov-action@v1.0.14 - with: - file: ./coverage.txt - if: env.GIT_DIFF - - test-coverage-run-3: - runs-on: ubuntu-latest - needs: split-test-files - timeout-minutes: 15 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Display go version - run: go version - - uses: technote-space/get-diff-action@v4 - id: git_diff - with: - PATTERNS: | - **/**.go - go.mod - go.sum - - uses: actions/download-artifact@v2 - with: - name: "${{ github.sha }}-ac" - if: env.GIT_DIFF - - name: test & coverage report creation - run: | - cat xac.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='norace ledger test_ledger_mock' - if: env.GIT_DIFF - - name: filter out DONTCOVER - run: | - excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')" - excludelist+=" $(find ./ -type f -name '*.pb.go')" - excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')" - for filename in ${excludelist}; do - filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g') - echo "Excluding ${filename} from coverage report..." - sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt - done - if: env.GIT_DIFF - - uses: codecov/codecov-action@v1.0.14 - with: - file: ./coverage.txt - if: env.GIT_DIFF - - test-coverage-run-4: - runs-on: ubuntu-latest - needs: split-test-files - timeout-minutes: 15 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Display go version - run: go version - - uses: technote-space/get-diff-action@v4 - id: git_diff - with: - PATTERNS: | - **/**.go - go.mod - go.sum - - uses: actions/download-artifact@v2 - with: - name: "${{ github.sha }}-ad" - if: env.GIT_DIFF - - name: test & coverage report creation - run: | - cat xad.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='norace ledger test_ledger_mock' - if: env.GIT_DIFF - - name: filter out DONTCOVER - run: | - excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')" - excludelist+=" $(find ./ -type f -name '*.pb.go')" - excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')" - for filename in ${excludelist}; do - filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g') - echo "Excluding ${filename} from coverage report..." - sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt - done - if: env.GIT_DIFF - - uses: codecov/codecov-action@v1.0.14 - with: - file: ./coverage.txt - if: env.GIT_DIFF - - test-race-1: - runs-on: ubuntu-latest - needs: split-test-files - timeout-minutes: 30 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Display go version - run: go version - - uses: technote-space/get-diff-action@v4 - id: git_diff - with: - PATTERNS: | - **/**.go - go.mod - go.sum - - uses: actions/download-artifact@v2 - with: - name: "${{ github.sha }}-aa" - if: env.GIT_DIFF - - name: Run tests with race detector - run: cat xaa.txt | xargs go test -mod=readonly -json -timeout 30m -race -tags='cgo ledger test_ledger_mock' > xaa-race-output.txt + cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -timeout 30m -race -tags='cgo ledger test_ledger_mock' > ${{ matrix.part }}-race-output.txt if: env.GIT_DIFF - uses: actions/upload-artifact@v2 with: - name: "${{ github.sha }}-aa-race-output" - path: ./xaa-race-output.txt - - test-race-2: - runs-on: ubuntu-latest - needs: split-test-files - timeout-minutes: 30 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Display go version - run: go version - - uses: technote-space/get-diff-action@v4 - id: git_diff - with: - PATTERNS: | - **/**.go - go.mod - go.sum - - uses: actions/download-artifact@v2 - with: - name: "${{ github.sha }}-ab" - if: env.GIT_DIFF - - name: Run tests with race detector - run: cat xab.txt | xargs go test -mod=readonly -json -timeout 30m -race -tags='cgo ledger test_ledger_mock' > xab-race-output.txt - if: env.GIT_DIFF - - uses: actions/upload-artifact@v2 - with: - name: "${{ github.sha }}-ab-race-output" - path: ./xab-race-output.txt - - test-race-3: - runs-on: ubuntu-latest - needs: split-test-files - timeout-minutes: 30 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Display go version - run: go version - - uses: technote-space/get-diff-action@v4 - id: git_diff - with: - PATTERNS: | - **/**.go - go.mod - go.sum - - uses: actions/download-artifact@v2 - with: - name: "${{ github.sha }}-ac" - if: env.GIT_DIFF - - name: Run tests with race detector - run: cat xac.txt | xargs go test -mod=readonly -json -timeout 30m -race -tags='cgo ledger test_ledger_mock' > xac-race-output.txt - if: env.GIT_DIFF - - uses: actions/upload-artifact@v2 - with: - name: "${{ github.sha }}-ac-race-output" - path: ./xac-race-output.txt - - test-race-4: - runs-on: ubuntu-latest - needs: split-test-files - timeout-minutes: 30 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.15 - - name: Display go version - run: go version - - uses: technote-space/get-diff-action@v4 - id: git_diff - with: - PATTERNS: | - **/**.go - go.mod - go.sum - - uses: actions/download-artifact@v2 - with: - name: "${{ github.sha }}-ad" - if: env.GIT_DIFF - - name: Run tests with race detector - run: cat xad.txt | xargs go test -mod=readonly -json -timeout 30m -race -tags='cgo ledger test_ledger_mock' > xad-race-output.txt - if: env.GIT_DIFF - - uses: actions/upload-artifact@v2 - with: - name: "${{ github.sha }}-ad-race-output" - path: ./xad-race-output.txt + name: "${{ github.sha }}-${{ matrix.part }}-race-output" + path: ./${{ matrix.part }}-race-output.txt race-detector-report: runs-on: ubuntu-latest - needs: [test-race-1, test-race-2, test-race-3, test-race-4, install-tparse] + needs: [test-race, install-tparse] timeout-minutes: 5 steps: - uses: actions/checkout@v2 @@ -387,19 +202,19 @@ jobs: go.sum - uses: actions/download-artifact@v2 with: - name: "${{ github.sha }}-aa-race-output" + name: "${{ github.sha }}-00-race-output" if: env.GIT_DIFF - uses: actions/download-artifact@v2 with: - name: "${{ github.sha }}-ab-race-output" + name: "${{ github.sha }}-01-race-output" if: env.GIT_DIFF - uses: actions/download-artifact@v2 with: - name: "${{ github.sha }}-ac-race-output" + name: "${{ github.sha }}-02-race-output" if: env.GIT_DIFF - uses: actions/download-artifact@v2 with: - name: "${{ github.sha }}-ad-race-output" + name: "${{ github.sha }}-03-race-output" if: env.GIT_DIFF - uses: actions/cache@v2.1.2 with: @@ -407,7 +222,7 @@ jobs: key: ${{ runner.os }}-go-tparse-binary if: env.GIT_DIFF - name: Generate test report (go test -race) - run: cat xa*-race-output.txt | ~/go/bin/tparse + run: cat ./*-race-output.txt | ~/go/bin/tparse if: env.GIT_DIFF liveness-test: diff --git a/version/command.go b/version/command.go index c4c9cf7874..9291c0a824 100644 --- a/version/command.go +++ b/version/command.go @@ -23,8 +23,10 @@ func NewVersionCommand() *cobra.Command { return nil } - var bz []byte - var err error + var ( + bz []byte + err error + ) output, _ := cmd.Flags().GetString(cli.OutputFlag) switch strings.ToLower(output) { From 7792ccf3420aa41a1e54dc9ad679ea5bd7b23625 Mon Sep 17 00:00:00 2001 From: Marko Date: Tue, 27 Oct 2020 18:13:17 +0100 Subject: [PATCH 84/84] docker fix (#7692) --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e519490d78..9456ebf302 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -33,6 +33,7 @@ jobs: TAGS="${DOCKER_IMAGE}:${VERSION}" if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then TAGS="$TAGS,${DOCKER_IMAGE}:${VERSION}" + fi echo ::set-output name=version::${VERSION} echo ::set-output name=tags::${TAGS} echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')