Change `address` from bytes to bech32 strings (#7242)

* init

* Fix bank proto messages

* missing conversions

* remove casttype for addresses

* Fix tests

* Fix consaddress

* more test fixes

* Fix tests

* fixed tests

* migrate missing proto declarations

* format

* Fix format

* Fix alignment

* Fix more tests

* Fix ibc merge issue

* Fix fmt

* Fix more tests

* Fix missing address declarations

* Fix staking tests

* Fix more tests

* Fix config

* fixed tests

* Fix more tests

* Update staking grpc tests

* Fix merge issue

* fixed failing tests in x/distr

* fixed sim tests

* fixed failing tests

* Fix bugs

* Add logs

* fixed slashing issue

* Fix staking grpc tests

* Fix all bank tests :)

* Fix tests in distribution

* Fix more tests in distr

* Fix slashing tests

* Fix statking tests

* Fix evidence tests

* Fix gov tests

* Fix bug in create vesting account

* Fix test

* remove fmt

* fixed gov tests

* fixed x/ibc tests

* fixed x/ibc-transfer tests

* fixed staking tests

* fixed staking tests

* fixed test

* fixed distribution issue

* fix pagination test

* fmt

* lint

* fix build

* fix format

* revert tally tests

* revert tally tests

* lint

* Fix sim test

* revert

* revert

* fixed tally issue

* fix tests

* revert

* fmt

* refactor

* remove `GetAddress()`

* remove fmt

* revert fmt.Striger usage

* Fix tests

* Fix rest test

* disable interfacer lint check

* make proto-format

* add nolint rule

* remove stray println

Co-authored-by: aleem1314 <aleem.md789@gmail.com>
Co-authored-by: atheesh <atheesh@vitwit.com>
This commit is contained in:
Anil Kumar Kammari 2020-09-25 15:55:37 +05:30 committed by GitHub
parent 91ca8ad3c1
commit d55c1a2665
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
247 changed files with 5815 additions and 7810 deletions

View File

@ -111,7 +111,8 @@ func (m *ListAllInterfacesResponse) GetInterfaceNames() []string {
return nil
}
// ListImplementationsRequest is the request type of the ListImplementations RPC.
// ListImplementationsRequest is the request type of the ListImplementations
// RPC.
type ListImplementationsRequest struct {
// interface_name defines the interface to query the implementations for.
InterfaceName string `protobuf:"bytes,1,opt,name=interface_name,json=interfaceName,proto3" json:"interface_name,omitempty"`
@ -157,7 +158,8 @@ func (m *ListImplementationsRequest) GetInterfaceName() string {
return ""
}
// ListImplementationsResponse is the response type of the ListImplementations RPC.
// ListImplementationsResponse is the response type of the ListImplementations
// RPC.
type ListImplementationsResponse struct {
ImplementationMessageNames []string `protobuf:"bytes,1,rep,name=implementation_message_names,json=implementationMessageNames,proto3" json:"implementation_message_names,omitempty"`
}

View File

@ -54,7 +54,7 @@ func (s *IntegrationTestSuite) TestGRPCQuery() {
var header metadata.MD
bankRes, err := bankClient.Balance(
context.Background(),
&banktypes.QueryBalanceRequest{Address: val0.Address, Denom: denom},
&banktypes.QueryBalanceRequest{Address: val0.Address.String(), Denom: denom},
grpc.Header(&header), // Also fetch grpc header
)
s.Require().NoError(err)
@ -70,7 +70,7 @@ func (s *IntegrationTestSuite) TestGRPCQuery() {
bankClient = banktypes.NewQueryClient(val0.ClientCtx)
bankRes, err = bankClient.Balance(
context.Background(),
&banktypes.QueryBalanceRequest{Address: val0.Address, Denom: denom},
&banktypes.QueryBalanceRequest{Address: val0.Address.String(), Denom: denom},
grpc.Header(&header),
)
blockHeight = header.Get(grpctypes.GRPCBlockHeightHeader)

View File

@ -164,8 +164,8 @@ func (*PublicKey) XXX_OneofWrappers() []interface{} {
}
}
// PubKeyMultisigThreshold specifies a public key type which nests multiple public
// keys and a threshold
// PubKeyMultisigThreshold specifies a public key type which nests multiple
// public keys and a threshold
type PubKeyMultisigThreshold struct {
K uint32 `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty" yaml:"threshold"`
PubKeys []*PublicKey `protobuf:"bytes,2,rep,name=public_keys,json=publicKeys,proto3" json:"public_keys,omitempty" yaml:"pubkeys"`
@ -219,8 +219,8 @@ func (m *PubKeyMultisigThreshold) GetPubKeys() []*PublicKey {
}
// MultiSignature wraps the signatures from a PubKeyMultisigThreshold.
// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers signed and
// with which modes.
// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers
// signed and with which modes.
type MultiSignature struct {
Signatures [][]byte `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"`
XXX_unrecognized []byte `json:"-"`

View File

@ -11,11 +11,13 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types";
// for basic account functionality. Any custom account type should extend this
// type for additional functionality (e.g. vesting).
message BaseAccount {
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
option (gogoproto.equal) = false;
option (cosmos_proto.implements_interface) = "AccountI";
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string address = 1;
google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty", (gogoproto.moretags) = "yaml:\"public_key\""];
uint64 account_number = 3 [(gogoproto.moretags) = "yaml:\"account_number\""];
uint64 sequence = 4;

View File

@ -24,8 +24,11 @@ service Query {
// QueryAccountRequest is the request type for the Query/Account RPC method.
message QueryAccountRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// address defines the address to query for.
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string address = 1;
}
// QueryAccountResponse is the response type for the Query/Account RPC method.

View File

@ -14,7 +14,8 @@ message Params {
bool default_send_enabled = 2 [(gogoproto.moretags) = "yaml:\"default_send_enabled,omitempty\""];
}
// SendEnabled maps coin denom to a send_enabled status (whether a denom is sendable).
// SendEnabled maps coin denom to a send_enabled status (whether a denom is
// sendable).
message SendEnabled {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
@ -24,18 +25,20 @@ message SendEnabled {
// Input models transaction input.
message Input {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string address = 1;
repeated cosmos.base.v1beta1.Coin coins = 2
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}
// Output models transaction outputs.
message Output {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string address = 1;
repeated cosmos.base.v1beta1.Coin coins = 2
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}
@ -43,9 +46,10 @@ message Output {
// Supply represents a struct that passively keeps track of the total supply
// amounts in the network.
message Supply {
option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
option (cosmos_proto.implements_interface) = "*github.com/cosmos/cosmos-sdk/x/bank/exported.SupplyI";
repeated cosmos.base.v1beta1.Coin total = 1

View File

@ -26,10 +26,11 @@ message GenesisState {
// Balance defines an account address and balance pair used in the bank module's
// genesis state.
message Balance {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// address is the address of the balance holder.
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string address = 1;
// coins defines the different coins this balance holds.
repeated cosmos.base.v1beta1.Coin coins = 2

View File

@ -39,8 +39,11 @@ service Query {
// QueryBalanceRequest is the request type for the Query/Balance RPC method.
message QueryBalanceRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// address is the address to query balances for.
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string address = 1;
// denom is the coin denom to query balances for.
string denom = 2;
@ -54,14 +57,18 @@ message QueryBalanceResponse {
// QueryBalanceRequest is the request type for the Query/AllBalances RPC method.
message QueryAllBalancesRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// address is the address to query balances for.
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string address = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC method.
// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC
// method.
message QueryAllBalancesResponse {
// balances is the balances of all the coins.
repeated cosmos.base.v1beta1.Coin balances = 1
@ -71,10 +78,12 @@ message QueryAllBalancesResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC method.
// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC
// method.
message QueryTotalSupplyRequest {}
// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC method
// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC
// method
message QueryTotalSupplyResponse {
// supply is the supply of the coins
repeated cosmos.base.v1beta1.Coin supply = 1

View File

@ -9,23 +9,18 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types";
// MsgSend represents a message to send coins from one account to another.
message MsgSend {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
bytes from_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"from_address\""
];
bytes to_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"to_address\""
];
string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""];
string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""];
repeated cosmos.base.v1beta1.Coin amount = 3
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}
// MsgMultiSend represents an arbitrary multi-in, multi-out send message.
message MsgMultiSend {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
repeated Input inputs = 1 [(gogoproto.nullable) = false];
repeated Output outputs = 2 [(gogoproto.nullable) = false];

View File

@ -22,7 +22,8 @@ message TxResponse {
uint32 code = 4;
// Result bytes, if any.
string data = 5;
// The output of the application's logger (raw string). May be non-deterministic.
// The output of the application's logger (raw string). May be
// non-deterministic.
string raw_log = 6;
// The output of the application's logger (typed). May be non-deterministic.
repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false];
@ -34,8 +35,9 @@ message TxResponse {
int64 gas_used = 10;
// The request transaction bytes.
google.protobuf.Any tx = 11;
// Time of the previous block. For heights > 1, it's the weighted median of the
// timestamps of the valid votes in the block.LastCommit. For height == 1, it's genesis time.
// Time of the previous block. For heights > 1, it's the weighted median of
// the timestamps of the valid votes in the block.LastCommit. For height == 1,
// it's genesis time.
string timestamp = 12;
}
@ -80,15 +82,15 @@ message GasInfo {
message Result {
option (gogoproto.goproto_getters) = false;
// Data is any data returned from message or handler execution. It MUST be length
// prefixed in order to separate data from multiple message executions.
// Data is any data returned from message or handler execution. It MUST be
// length prefixed in order to separate data from multiple message executions.
bytes data = 1;
// Log contains the log information from message or handler execution.
string log = 2;
// Events contains a slice of Event objects that were emitted during message or
// handler execution.
// Events contains a slice of Event objects that were emitted during message
// or handler execution.
repeated tendermint.abci.Event events = 3 [(gogoproto.nullable) = false];
}
@ -99,7 +101,8 @@ message SimulationResponse {
Result result = 2;
}
// MsgData defines the data returned in a Result object during message execution.
// MsgData defines the data returned in a Result object during message
// execution.
message MsgData {
option (gogoproto.stringer) = true;
@ -107,8 +110,8 @@ message MsgData {
bytes data = 2;
}
// TxMsgData defines a list of MsgData. A transaction will have a MsgData object for
// each message.
// TxMsgData defines a list of MsgData. A transaction will have a MsgData object
// for each message.
message TxMsgData {
option (gogoproto.stringer) = true;

View File

@ -22,16 +22,16 @@ message PublicKey {
}
}
// PubKeyMultisigThreshold specifies a public key type which nests multiple public
// keys and a threshold
// PubKeyMultisigThreshold specifies a public key type which nests multiple
// public keys and a threshold
message PubKeyMultisigThreshold {
uint32 threshold = 1 [(gogoproto.customname) = "K", (gogoproto.moretags) = "yaml:\"threshold\""];
repeated PublicKey public_keys = 2 [(gogoproto.customname) = "PubKeys", (gogoproto.moretags) = "yaml:\"pubkeys\""];
}
// MultiSignature wraps the signatures from a PubKeyMultisigThreshold.
// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers signed and
// with which modes.
// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers
// signed and with which modes.
message MultiSignature {
option (gogoproto.goproto_unrecognized) = true;
repeated bytes signatures = 1;

View File

@ -26,13 +26,14 @@ message PageRequest {
uint64 limit = 3;
// count_total is set to true to indicate that the result set should include
// a count of the total number of items available for pagination in UIs. count_total
// is only respected when offset is used. It is ignored when key is set.
// a count of the total number of items available for pagination in UIs.
// count_total is only respected when offset is used. It is ignored when key
// is set.
bool count_total = 4;
}
// PageResponse is to be embedded in gRPC response messages where the corresponding
// request message has used PageRequest.
// PageResponse is to be embedded in gRPC response messages where the
// corresponding request message has used PageRequest.
//
// message SomeResponse {
// repeated Bar results = 1;

View File

@ -16,7 +16,8 @@ service ReflectionService {
// ListImplementations list all the concrete types that implement a given
// interface.
rpc ListImplementations(ListImplementationsRequest) returns (ListImplementationsResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces/{interface_name}/implementations";
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces/"
"{interface_name}/implementations";
};
}
@ -29,13 +30,15 @@ message ListAllInterfacesResponse {
repeated string interface_names = 1;
}
// ListImplementationsRequest is the request type of the ListImplementations RPC.
// ListImplementationsRequest is the request type of the ListImplementations
// RPC.
message ListImplementationsRequest {
// interface_name defines the interface to query the implementations for.
string interface_name = 1;
}
// ListImplementationsResponse is the response type of the ListImplementations RPC.
// ListImplementationsResponse is the response type of the ListImplementations
// RPC.
message ListImplementationsResponse {
repeated string implementation_message_names = 1;
}

View File

@ -5,8 +5,8 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types";
import "gogoproto/gogo.proto";
// Capability defines an implementation of an object capability. The index provided to
// a Capability must be globally unique.
// Capability defines an implementation of an object capability. The index
// provided to a Capability must be globally unique.
message Capability {
option (gogoproto.goproto_stringer) = false;

View File

@ -7,9 +7,10 @@ import "gogoproto/gogo.proto";
// MsgVerifyInvariant represents a message to verify a particular invariance.
message MsgVerifyInvariant {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
bytes sender = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string sender = 1;
string invariant_module_name = 2 [(gogoproto.moretags) = "yaml:\"invariant_module_name\""];
string invariant_route = 3 [(gogoproto.moretags) = "yaml:\"invariant_route\""];
}

View File

@ -6,12 +6,13 @@ import "google/protobuf/any.proto";
option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/multisig";
// LegacyAminoPubKey specifies a public key type
// LegacyAminoPubKey specifies a public key type
// which nests multiple public keys and a threshold,
// it uses legacy amino address rules.
message LegacyAminoPubKey {
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_getters) = false;
uint32 threshold = 1 [(gogoproto.moretags) = "yaml:\"threshold\""];
repeated google.protobuf.Any public_keys = 2 [(gogoproto.customname) = "PubKeys", (gogoproto.moretags) = "yaml:\"pubkeys\""];
uint32 threshold = 1 [(gogoproto.moretags) = "yaml:\"threshold\""];
repeated google.protobuf.Any public_keys = 2
[(gogoproto.customname) = "PubKeys", (gogoproto.moretags) = "yaml:\"pubkeys\""];
}

View File

@ -11,12 +11,12 @@ option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1";
// the x-coordinate. Otherwise the first byte is a 0x03.
// This prefix is followed with the x-coordinate.
message PubKey {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_stringer) = false;
bytes key = 1;
bytes key = 1;
}
// PrivKey defines a secp256k1 private key.
message PrivKey {
bytes key = 1;
bytes key = 1;
}

View File

@ -35,9 +35,10 @@ message Params {
// The reference count indicates the number of objects
// which might need to reference this historical entry at any point.
// ReferenceCount =
// number of outstanding delegations which ended the associated period (and might need to read
// that record)
// + number of slashes which ended the associated period (and might need to read that record)
// number of outstanding delegations which ended the associated period (and
// might need to read that record)
// + number of slashes which ended the associated period (and might need to
// read that record)
// + one per validator for the zeroeth period, set on initialization
message ValidatorHistoricalRewards {
repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [
@ -103,21 +104,22 @@ message FeePool {
// together with how many coins are proposed to be spent, and to which
// recipient account.
message CommunityPoolSpendProposal {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
string title = 1;
string description = 2;
bytes recipient = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string recipient = 3;
repeated cosmos.base.v1beta1.Coin amount = 4
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}
// DelegatorStartingInfo represents the starting info for a delegator reward period.
// It tracks the previous validator period, the delegation's amount
// of staking token, and the creation height (to check later on
// if any slashes have occurred).
// NOTE: Even though validators are slashed to whole staking tokens, the
// delegators within the validator may be left with less than a full token,
// DelegatorStartingInfo represents the starting info for a delegator reward
// period. It tracks the previous validator period, the delegation's amount of
// staking token, and the creation height (to check later on if any slashes have
// occurred). NOTE: Even though validators are slashed to whole staking tokens,
// the delegators within the validator may be left with less than a full token,
// thus sdk.Dec is used.
message DelegatorStartingInfo {
uint64 previous_period = 1 [(gogoproto.moretags) = "yaml:\"previous_period\""];
@ -132,23 +134,24 @@ message DelegatorStartingInfo {
// DelegationDelegatorReward represents the properties
// of a delegator's delegation reward.
message DelegationDelegatorReward {
bytes validator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = true;
string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""];
repeated cosmos.base.v1beta1.DecCoin reward = 2
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
}
// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal with a deposit
// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal
// with a deposit
message CommunityPoolSpendProposalWithDeposit {
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = true;
string title = 1 [(gogoproto.moretags) = "yaml:\"title\""];
string description = 2 [(gogoproto.moretags) = "yaml:\"description\""];
bytes recipient = 3 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"recipient\""
];
string amount = 4 [(gogoproto.moretags) = "yaml:\"amount\""];
string deposit = 5 [(gogoproto.moretags) = "yaml:\"deposit\""];
string recipient = 3 [(gogoproto.moretags) = "yaml:\"recipient\""];
string amount = 4 [(gogoproto.moretags) = "yaml:\"amount\""];
string deposit = 5 [(gogoproto.moretags) = "yaml:\"deposit\""];
}

View File

@ -8,29 +8,27 @@ import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos/distribution/v1beta1/distribution.proto";
// DelegatorWithdrawInfo is the address for where distributions rewards are withdrawn to by default
// this struct is only used at genesis to feed in default withdraw addresses.
// DelegatorWithdrawInfo is the address for where distributions rewards are
// withdrawn to by default this struct is only used at genesis to feed in
// default withdraw addresses.
message DelegatorWithdrawInfo {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// delegator_address is the address of the delegator.
bytes delegator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"delegator_address\""
];
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
// withdraw_address is the address to withdraw the delegation rewards to.
bytes withdraw_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"withdraw_address\""
];
string withdraw_address = 2 [(gogoproto.moretags) = "yaml:\"withdraw_address\""];
}
// ValidatorOutstandingRewardsRecord is used for import/export via genesis json.
message ValidatorOutstandingRewardsRecord {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// validator_address is the address of the validator.
bytes validator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""];
// outstanding_rewards represents the oustanding rewards of a validator.
repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 [
@ -40,26 +38,28 @@ message ValidatorOutstandingRewardsRecord {
];
}
// ValidatorAccumulatedCommissionRecord is used for import / export via genesis json.
// ValidatorAccumulatedCommissionRecord is used for import / export via genesis
// json.
message ValidatorAccumulatedCommissionRecord {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// validator_address is the address of the validator.
bytes validator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""];
// accumulated is the accumulated commission of a validator.
ValidatorAccumulatedCommission accumulated = 2
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"accumulated\""];
}
// ValidatorHistoricalRewardsRecord is used for import / export via genesis json.
// ValidatorHistoricalRewardsRecord is used for import / export via genesis
// json.
message ValidatorHistoricalRewardsRecord {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// validator_address is the address of the validator.
bytes validator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""];
// period defines the period the historical rewards apply to.
uint64 period = 2;
@ -70,11 +70,11 @@ message ValidatorHistoricalRewardsRecord {
// ValidatorCurrentRewardsRecord is used for import / export via genesis json.
message ValidatorCurrentRewardsRecord {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// validator_address is the address of the validator.
bytes validator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""];
// rewards defines the current rewards of a validator.
ValidatorCurrentRewards rewards = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"rewards\""];
@ -82,17 +82,14 @@ message ValidatorCurrentRewardsRecord {
// DelegatorStartingInfoRecord used for import / export via genesis json.
message DelegatorStartingInfoRecord {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// delegator_address is the address of the delegator.
bytes delegator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"delegator_address\""
];
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
// validator_address is the address of the validator.
bytes validator_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
// starting_info defines the starting info of a delegator.
DelegatorStartingInfo starting_info = 3
@ -101,11 +98,11 @@ message DelegatorStartingInfoRecord {
// ValidatorSlashEventRecord is used for import / export via genesis json.
message ValidatorSlashEventRecord {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// validator_address is the address of the validator.
bytes validator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""];
// height defines the block height at which the slash event occured.
uint64 height = 2;
// period is the period of the slash event.
@ -116,6 +113,9 @@ message ValidatorSlashEventRecord {
// GenesisState defines the distribution module's genesis state.
message GenesisState {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// params defines all the paramaters of the module.
Params params = 1 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"params\""];
@ -127,10 +127,7 @@ message GenesisState {
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"delegator_withdraw_infos\""];
// fee_pool defines the previous proposer at genesis.
bytes previous_proposer = 4 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress",
(gogoproto.moretags) = "yaml:\"previous_proposer\""
];
string previous_proposer = 4 [(gogoproto.moretags) = "yaml:\"previous_proposer\""];
// fee_pool defines the outstanding rewards of all validators at genesis.
repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5

View File

@ -19,12 +19,14 @@ service Query {
// ValidatorOutstandingRewards queries rewards of a validator address.
rpc ValidatorOutstandingRewards(QueryValidatorOutstandingRewardsRequest)
returns (QueryValidatorOutstandingRewardsResponse) {
option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards";
option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/"
"{validator_address}/outstanding_rewards";
}
// ValidatorCommission queries accumulated commission for a validator.
rpc ValidatorCommission(QueryValidatorCommissionRequest) returns (QueryValidatorCommissionResponse) {
option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}/commission";
option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/"
"{validator_address}/commission";
}
// ValidatorSlashes queries slash events of a validator.
@ -34,23 +36,26 @@ service Query {
// DelegationRewards queries the total rewards accrued by a delegation.
rpc DelegationRewards(QueryDelegationRewardsRequest) returns (QueryDelegationRewardsResponse) {
option (google.api.http).get =
"/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}";
option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/"
"{validator_address}";
}
// DelegationTotalRewards queries the total rewards accrued by a each validator.
// DelegationTotalRewards queries the total rewards accrued by a each
// validator.
rpc DelegationTotalRewards(QueryDelegationTotalRewardsRequest) returns (QueryDelegationTotalRewardsResponse) {
option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards";
}
// DelegatorValidators queries the validators of a delegator.
rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) {
option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators";
option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/"
"{delegator_address}/validators";
}
// DelegatorWithdrawAddress queries withdraw address of a delegator.
rpc DelegatorWithdrawAddress(QueryDelegatorWithdrawAddressRequest) returns (QueryDelegatorWithdrawAddressResponse) {
option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address";
option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/"
"{delegator_address}/withdraw_address";
}
// CommunityPool queries the community pool coins.
@ -68,33 +73,41 @@ message QueryParamsResponse {
Params params = 1 [(gogoproto.nullable) = false];
}
// QueryValidatorOutstandingRewardsRequest is the request type for the Query/ValidatorOutstandingRewards RPC method.
// QueryValidatorOutstandingRewardsRequest is the request type for the
// Query/ValidatorOutstandingRewards RPC method.
message QueryValidatorOutstandingRewardsRequest {
// validator_address defines the validator address to query for.
bytes validator_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
string validator_address = 1;
}
// QueryValidatorOutstandingRewardsResponse is the response type for the Query/ValidatorOutstandingRewards RPC method.
// QueryValidatorOutstandingRewardsResponse is the response type for the
// Query/ValidatorOutstandingRewards RPC method.
message QueryValidatorOutstandingRewardsResponse {
ValidatorOutstandingRewards rewards = 1 [(gogoproto.nullable) = false];
}
// QueryValidatorCommissionRequest is the request type for the Query/ValidatorCommission RPC method
// QueryValidatorCommissionRequest is the request type for the
// Query/ValidatorCommission RPC method
message QueryValidatorCommissionRequest {
// validator_address defines the validator address to query for.
bytes validator_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
string validator_address = 1;
}
// QueryValidatorCommissionResponse is the response type for the Query/ValidatorCommission RPC method
// QueryValidatorCommissionResponse is the response type for the
// Query/ValidatorCommission RPC method
message QueryValidatorCommissionResponse {
// commission defines the commision the validator received.
ValidatorAccumulatedCommission commission = 1 [(gogoproto.nullable) = false];
}
// QueryValidatorSlashesRequest is the request type for the Query/ValidatorSlashes RPC method
// QueryValidatorSlashesRequest is the request type for the
// Query/ValidatorSlashes RPC method
message QueryValidatorSlashesRequest {
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = true;
// validator_address defines the validator address to query for.
bytes validator_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
string validator_address = 1;
// starting_height defines the optional starting height to query the slashes.
uint64 starting_height = 2;
// starting_height defines the optional ending height to query the slashes.
@ -103,7 +116,8 @@ message QueryValidatorSlashesRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 4;
}
// QueryValidatorSlashesResponse is the response type for the Query/ValidatorSlashes RPC method.
// QueryValidatorSlashesResponse is the response type for the
// Query/ValidatorSlashes RPC method.
message QueryValidatorSlashesResponse {
// slashes defines the slashes the validator received.
repeated ValidatorSlashEvent slashes = 1 [(gogoproto.nullable) = false];
@ -112,28 +126,37 @@ message QueryValidatorSlashesResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryDelegationRewardsRequest is the request type for the Query/DelegationRewards RPC method.
// QueryDelegationRewardsRequest is the request type for the
// Query/DelegationRewards RPC method.
message QueryDelegationRewardsRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// delegator_address defines the delegator address to query for.
bytes delegator_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string delegator_address = 1;
// validator_address defines the validator address to query for.
bytes validator_address = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
string validator_address = 2;
}
// QueryDelegationRewardsResponse is the response type for the Query/DelegationRewards RPC method.
// QueryDelegationRewardsResponse is the response type for the
// Query/DelegationRewards RPC method.
message QueryDelegationRewardsResponse {
// rewards defines the rewards accrued by a delegation.
repeated cosmos.base.v1beta1.DecCoin rewards = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"];
}
// QueryDelegationTotalRewardsRequest is the request type for the Query/DelegationTotalRewards RPC method.
// QueryDelegationTotalRewardsRequest is the request type for the
// Query/DelegationTotalRewards RPC method.
message QueryDelegationTotalRewardsRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// delegator_address defines the delegator address to query for.
bytes delegator_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string delegator_address = 1;
}
// QueryDelegationTotalRewardsResponse is the response type for the Query/DelegationTotalRewards RPC method.
// QueryDelegationTotalRewardsResponse is the response type for the
// Query/DelegationTotalRewards RPC method.
message QueryDelegationTotalRewardsResponse {
// rewards defines all the rewards accrued by a delegator.
repeated DelegationDelegatorReward rewards = 1 [(gogoproto.nullable) = false];
@ -142,34 +165,52 @@ message QueryDelegationTotalRewardsResponse {
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"];
}
// QueryDelegatorValidatorsRequest is the request type for the Query/DelegatorValidators RPC method.
// QueryDelegatorValidatorsRequest is the request type for the
// Query/DelegatorValidators RPC method.
message QueryDelegatorValidatorsRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// delegator_address defines the delegator address to query for.
bytes delegator_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string delegator_address = 1;
}
// QueryDelegatorValidatorsResponse is the response type for the Query/DelegatorValidators RPC method.
// QueryDelegatorValidatorsResponse is the response type for the
// Query/DelegatorValidators RPC method.
message QueryDelegatorValidatorsResponse {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// validators defines the validators a delegator is delegating for.
repeated bytes validators = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
repeated string validators = 1;
}
// QueryDelegatorWithdrawAddressRequest is the request type for the Query/DelegatorWithdrawAddress RPC method.
// QueryDelegatorWithdrawAddressRequest is the request type for the
// Query/DelegatorWithdrawAddress RPC method.
message QueryDelegatorWithdrawAddressRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// delegator_address defines the delegator address to query for.
bytes delegator_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string delegator_address = 1;
}
// QueryDelegatorWithdrawAddressResponse is the response type for the Query/DelegatorWithdrawAddress RPC method.
// QueryDelegatorWithdrawAddressResponse is the response type for the
// Query/DelegatorWithdrawAddress RPC method.
message QueryDelegatorWithdrawAddressResponse {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// withdraw_address defines the delegator address to query for.
bytes withdraw_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string withdraw_address = 1;
}
// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC method.
// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC
// method.
message QueryCommunityPoolRequest {}
// QueryCommunityPoolResponse is the response type for the Query/CommunityPool RPC method.
// QueryCommunityPoolResponse is the response type for the Query/CommunityPool
// RPC method.
message QueryCommunityPoolResponse {
// pool defines community pool's coins.
repeated cosmos.base.v1beta1.DecCoin pool = 1

View File

@ -10,41 +10,39 @@ import "cosmos/base/v1beta1/coin.proto";
// MsgSetWithdrawAddress sets the withdraw address for
// a delegator (or validator self-delegation).
message MsgSetWithdrawAddress {
bytes delegator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"delegator_address\""
];
bytes withdraw_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"withdraw_address\""
];
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string withdraw_address = 2 [(gogoproto.moretags) = "yaml:\"withdraw_address\""];
}
// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator
// from a single validator.
message MsgWithdrawDelegatorReward {
bytes delegator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"delegator_address\""
];
bytes validator_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
}
// MsgWithdrawValidatorCommission withdraws the full commission to the validator address.
// MsgWithdrawValidatorCommission withdraws the full commission to the validator
// address.
message MsgWithdrawValidatorCommission {
bytes validator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""];
}
// MsgFundCommunityPool allows an account to directly
// fund the community pool.
message MsgFundCommunityPool {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
repeated cosmos.base.v1beta1.Coin amount = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string depositor = 2;
}

View File

@ -12,12 +12,10 @@ import "google/protobuf/timestamp.proto";
message Equivocation {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.equal) = false;
int64 height = 1;
google.protobuf.Timestamp time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
int64 power = 3;
bytes consensus_address = 4 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress",
(gogoproto.moretags) = "yaml:\"consensus_address\""
];
string consensus_address = 4 [(gogoproto.moretags) = "yaml:\"consensus_address\""];
}

View File

@ -33,13 +33,15 @@ message QueryEvidenceResponse {
google.protobuf.Any evidence = 1;
}
// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC method.
// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC
// method.
message QueryAllEvidenceRequest {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC method.
// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC
// method.
message QueryAllEvidenceResponse {
// evidence returns all evidences.
repeated google.protobuf.Any evidence = 1;

View File

@ -11,7 +11,9 @@ import "cosmos_proto/cosmos.proto";
// MsgSubmitEvidence represents a message that supports submitting arbitrary
// Evidence of misbehavior such as equivocation or counterfactual signing.
message MsgSubmitEvidence {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
bytes submitter = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "Evidence"];
string submitter = 1;
google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "Evidence"];
}

View File

@ -40,12 +40,14 @@ message TextProposal {
string description = 2;
}
// Deposit defines an amount deposited by an account address to an active proposal.
// Deposit defines an amount deposited by an account address to an active
// proposal.
message Deposit {
option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;
option (gogoproto.equal) = false;
uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""];
bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string depositor = 2;
repeated cosmos.base.v1beta1.Coin amount = 3
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}
@ -80,15 +82,20 @@ enum ProposalStatus {
// PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status.
PROPOSAL_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusNil"];
// PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit period.
// PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit
// period.
PROPOSAL_STATUS_DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"];
// PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting period.
// PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting
// period.
PROPOSAL_STATUS_VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"];
// PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has passed.
// PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has
// passed.
PROPOSAL_STATUS_PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"];
// PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has been rejected.
// PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has
// been rejected.
PROPOSAL_STATUS_REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"];
// PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has failed.
// PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has
// failed.
PROPOSAL_STATUS_FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"];
}
@ -109,10 +116,11 @@ message TallyResult {
// Vote defines a vote on a governance proposal.
// A Vote consists of a proposal ID, the voter, and the vote option.
message Vote {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
option (gogoproto.equal) = false;
uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""];
bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string voter = 2;
VoteOption option = 3;
}
@ -126,7 +134,8 @@ message DepositParams {
(gogoproto.jsontag) = "min_deposit,omitempty"
];
// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months.
// Maximum period for Atom holders to deposit on a proposal. Initial value: 2
// months.
google.protobuf.Duration max_deposit_period = 2 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
@ -148,7 +157,8 @@ message VotingParams {
// TallyParams defines the params for tallying votes on governance proposals.
message TallyParams {
// Minimum percentage of total stake needed to vote for a result to be considered valid.
// Minimum percentage of total stake needed to vote for a result to be
// considered valid.
bytes quorum = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
@ -162,7 +172,8 @@ message TallyParams {
(gogoproto.jsontag) = "threshold,omitempty"
];
// Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Default value: 1/3.
// Minimum value of Veto votes to Total votes ratio for proposal to be
// vetoed. Default value: 1/3.
bytes veto_threshold = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,

View File

@ -64,20 +64,24 @@ message QueryProposalResponse {
// QueryProposalsRequest is the request type for the Query/Proposals RPC method.
message QueryProposalsRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// proposal_status defines the status of the proposals.
ProposalStatus proposal_status = 1;
// voter defines the voter address for the proposals.
bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string voter = 2;
// depositor defines the deposit addresses from the proposals.
bytes depositor = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string depositor = 3;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 4;
}
// QueryProposalsResponse is the response type for the Query/Proposals RPC method.
// QueryProposalsResponse is the response type for the Query/Proposals RPC
// method.
message QueryProposalsResponse {
repeated Proposal proposals = 1 [(gogoproto.nullable) = false];
@ -87,11 +91,14 @@ message QueryProposalsResponse {
// QueryVoteRequest is the request type for the Query/Vote RPC method.
message QueryVoteRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// proposal_id defines the unique id of the proposal.
uint64 proposal_id = 1;
// voter defines the oter address for the proposals.
bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string voter = 2;
}
// QueryVoteResponse is the response type for the Query/Vote RPC method.
@ -120,7 +127,8 @@ message QueryVotesResponse {
// QueryParamsRequest is the request type for the Query/Params RPC method.
message QueryParamsRequest {
// params_type defines which parameters to query for, can be one of "voting", "tallying" or "deposit".
// params_type defines which parameters to query for, can be one of "voting",
// "tallying" or "deposit".
string params_type = 1;
}
@ -136,11 +144,14 @@ message QueryParamsResponse {
// QueryDepositRequest is the request type for the Query/Deposit RPC method.
message QueryDepositRequest {
option (gogoproto.goproto_getters) = false;
option (gogoproto.equal) = false;
// proposal_id defines the unique id of the proposal.
uint64 proposal_id = 1;
// depositor defines the deposit addresses from the proposals.
bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string depositor = 2;
}
// QueryDepositResponse is the response type for the Query/Deposit RPC method.

View File

@ -15,7 +15,7 @@ option (gogoproto.goproto_getters_all) = false;
// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary
// proposal Content.
message MsgSubmitProposal {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"];
repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [
@ -23,24 +23,24 @@ message MsgSubmitProposal {
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "yaml:\"initial_deposit\""
];
bytes proposer = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string proposer = 3;
}
// MsgVote defines a message to cast a vote.
message MsgVote {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""];
bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string voter = 2;
VoteOption option = 3;
}
// MsgDeposit defines a message to submit a deposit to an existing proposal.
message MsgDeposit {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""];
bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string depositor = 2;
repeated cosmos.base.v1beta1.Coin amount = 3
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}

View File

@ -37,16 +37,19 @@ message QueryParamsResponse {
// QueryInflationRequest is the request type for the Query/Inflation RPC method.
message QueryInflationRequest {}
// QueryInflationResponse is the response type for the Query/Inflation RPC method.
// QueryInflationResponse is the response type for the Query/Inflation RPC
// method.
message QueryInflationResponse {
// inflation is the current minting inflation value.
bytes inflation = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
}
// QueryAnnualProvisionsRequest is the request type for the Query/AnnualProvisions RPC method.
// QueryAnnualProvisionsRequest is the request type for the
// Query/AnnualProvisions RPC method.
message QueryAnnualProvisionsRequest {}
// QueryAnnualProvisionsResponse is the response type for the Query/AnnualProvisions RPC method.
// QueryAnnualProvisionsResponse is the response type for the
// Query/AnnualProvisions RPC method.
message QueryAnnualProvisionsResponse {
// annual_provisions is the current minting annual provisions value.
bytes annual_provisions = 1

View File

@ -16,7 +16,8 @@ message ParameterChangeProposal {
repeated ParamChange changes = 3 [(gogoproto.nullable) = false];
}
// ParamChange defines an individual parameter change, for use in ParameterChangeProposal.
// ParamChange defines an individual parameter change, for use in
// ParameterChangeProposal.
message ParamChange {
option (gogoproto.goproto_stringer) = false;

View File

@ -9,7 +9,8 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal";
// Query defines the gRPC querier service.
service Query {
// Params queries a specific parameter of a module, given its subspace and key.
// Params queries a specific parameter of a module, given its subspace and
// key.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/cosmos/params/v1beta1/params";
}

View File

@ -31,7 +31,8 @@ message SigningInfo {
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_signing_info\""];
}
// ValidatorMissedBlocks contains array of missed blocks of corresponding address.
// ValidatorMissedBlocks contains array of missed blocks of corresponding
// address.
message ValidatorMissedBlocks {
// address is the validator address.
string address = 1;

View File

@ -34,24 +34,28 @@ message QueryParamsResponse {
Params params = 1 [(gogoproto.nullable) = false];
}
// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC method
// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC
// method
message QuerySigningInfoRequest {
// cons_address is the address to query signing info of
bytes cons_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"];
string cons_address = 1;
}
// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC method
// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC
// method
message QuerySigningInfoResponse {
// val_signing_info is the signing info of requested val cons address
ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false];
}
// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC method
// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC
// method
message QuerySigningInfosRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC method
// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC
// method
message QuerySigningInfosResponse {
// info is the signing info of all validators
repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 [(gogoproto.nullable) = false];

View File

@ -8,14 +8,13 @@ import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
// ValidatorSigningInfo defines a validator's signing info for monitoring their liveness activity.
// ValidatorSigningInfo defines a validator's signing info for monitoring their
// liveness activity.
message ValidatorSigningInfo {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
bytes address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress" // validator consensus address
];
string address = 1;
// height at which validator was first a candidate OR was unjailed
int64 start_height = 2 [(gogoproto.moretags) = "yaml:\"start_height\""];
// index offset into signed block bit array
@ -23,7 +22,8 @@ message ValidatorSigningInfo {
// timestamp validator cannot be unjailed until
google.protobuf.Timestamp jailed_until = 4
[(gogoproto.moretags) = "yaml:\"jailed_until\"", (gogoproto.stdtime) = true, (gogoproto.nullable) = false];
// whether or not a validator has been tombstoned (killed out of validator set)
// 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 [(gogoproto.moretags) = "yaml:\"missed_blocks_counter\""];

View File

@ -10,9 +10,8 @@ import "gogoproto/gogo.proto";
// them into the bonded validator set, so they can begin receiving provisions
// and rewards again.
message MsgUnjail {
bytes validator_addr = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"address\"",
(gogoproto.jsontag) = "address"
];
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = true;
string validator_addr = 1 [(gogoproto.moretags) = "yaml:\"address\"", (gogoproto.jsontag) = "address"];
}

View File

@ -42,8 +42,11 @@ message GenesisState {
// LastValidatorPower required for validator set update logic.
message LastValidatorPower {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// address is the address of the validator.
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
string address = 1;
// power defines the power of the validator.
int64 power = 2;

View File

@ -28,18 +28,21 @@ service Query {
// ValidatorUnbondingDelegations queries unbonding delegations of a validator.
rpc ValidatorUnbondingDelegations(QueryValidatorUnbondingDelegationsRequest)
returns (QueryValidatorUnbondingDelegationsResponse) {
option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations";
option (google.api.http).get = "/cosmos/staking/v1beta1/validators/"
"{validator_addr}/unbonding_delegations";
}
// Delegation queries delegate info for given validator delegator pair.
rpc Delegation(QueryDelegationRequest) returns (QueryDelegationResponse) {
option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}";
option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/"
"{delegator_addr}";
}
// UnbondingDelegation queries unbonding info for given validator delegator pair.
// UnbondingDelegation queries unbonding info for given validator delegator
// pair.
rpc UnbondingDelegation(QueryUnbondingDelegationRequest) returns (QueryUnbondingDelegationResponse) {
option (google.api.http).get =
"/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation";
option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/"
"{delegator_addr}/unbonding_delegation";
}
// DelegatorDelegations queries all delegations of a given delegator address.
@ -47,10 +50,12 @@ service Query {
option (google.api.http).get = "/cosmos/staking/v1beta1/delegations/{delegator_addr}";
}
// DelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.
// DelegatorUnbondingDelegations queries all unbonding delegations of a given
// delegator address.
rpc DelegatorUnbondingDelegations(QueryDelegatorUnbondingDelegationsRequest)
returns (QueryDelegatorUnbondingDelegationsResponse) {
option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations";
option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/"
"{delegator_addr}/unbonding_delegations";
}
// Redelegations queries redelegations of given address.
@ -58,14 +63,17 @@ service Query {
option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations";
}
// DelegatorValidators queries all validators info for given delegator address.
// DelegatorValidators queries all validators info for given delegator
// address.
rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) {
option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators";
}
// DelegatorValidator queries validator info for given delegator validator pair.
// DelegatorValidator queries validator info for given delegator validator
// pair.
rpc DelegatorValidator(QueryDelegatorValidatorRequest) returns (QueryDelegatorValidatorResponse) {
option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}";
option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/"
"{validator_addr}";
}
// HistoricalInfo queries the historical info for given height.
@ -105,7 +113,7 @@ message QueryValidatorsResponse {
// QueryValidatorRequest is response type for the Query/Validator RPC method
message QueryValidatorRequest {
// validator_addr defines the validator address to query for.
bytes validator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
string validator_addr = 1;
}
// QueryValidatorResponse is response type for the Query/Validator RPC method
@ -114,16 +122,18 @@ message QueryValidatorResponse {
Validator validator = 1 [(gogoproto.nullable) = false];
}
// QueryValidatorDelegationsRequest is request type for the Query/ValidatorDelegations RPC method
// QueryValidatorDelegationsRequest is request type for the
// Query/ValidatorDelegations RPC method
message QueryValidatorDelegationsRequest {
// validator_addr defines the validator address to query for.
bytes validator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
string validator_addr = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryValidatorDelegationsResponse is response type for the Query/ValidatorDelegations RPC method
// QueryValidatorDelegationsResponse is response type for the
// Query/ValidatorDelegations RPC method
message QueryValidatorDelegationsResponse {
repeated DelegationResponse delegation_responses = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "DelegationResponses"];
@ -132,16 +142,18 @@ message QueryValidatorDelegationsResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryValidatorUnbondingDelegationsRequest is required type for the Query/ValidatorUnbondingDelegations RPC method
// QueryValidatorUnbondingDelegationsRequest is required type for the
// Query/ValidatorUnbondingDelegations RPC method
message QueryValidatorUnbondingDelegationsRequest {
// validator_addr defines the validator address to query for.
bytes validator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
string validator_addr = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryValidatorUnbondingDelegationsResponse is response type for the Query/ValidatorUnbondingDelegations RPC method.
// QueryValidatorUnbondingDelegationsResponse is response type for the
// Query/ValidatorUnbondingDelegations RPC method.
message QueryValidatorUnbondingDelegationsResponse {
repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false];
@ -151,11 +163,14 @@ message QueryValidatorUnbondingDelegationsResponse {
// QueryDelegationRequest is request type for the Query/Delegation RPC method.
message QueryDelegationRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// delegator_addr defines the delegator address to query for.
bytes delegator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string delegator_addr = 1;
// validator_addr defines the validator address to query for.
bytes validator_addr = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
string validator_addr = 2;
}
// QueryDelegationResponse is response type for the Query/Delegation RPC method.
@ -164,31 +179,41 @@ message QueryDelegationResponse {
DelegationResponse delegation_response = 1;
}
// QueryUnbondingDelegationRequest is request type for the Query/UnbondingDelegation RPC method.
// QueryUnbondingDelegationRequest is request type for the
// Query/UnbondingDelegation RPC method.
message QueryUnbondingDelegationRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// delegator_addr defines the delegator address to query for.
bytes delegator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string delegator_addr = 1;
// validator_addr defines the validator address to query for.
bytes validator_addr = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
string validator_addr = 2;
}
// QueryDelegationResponse is response type for the Query/UnbondingDelegation RPC method.
// QueryDelegationResponse is response type for the Query/UnbondingDelegation
// RPC method.
message QueryUnbondingDelegationResponse {
// unbond defines the unbonding information of a delegation.
UnbondingDelegation unbond = 1 [(gogoproto.nullable) = false];
}
// QueryDelegatorDelegationsRequest is request type for the Query/DelegatorDelegations RPC method.
// QueryDelegatorDelegationsRequest is request type for the
// Query/DelegatorDelegations RPC method.
message QueryDelegatorDelegationsRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// delegator_addr defines the delegator address to query for.
bytes delegator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string delegator_addr = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryDelegatorDelegationsResponse is response type for the Query/DelegatorDelegations RPC method.
// QueryDelegatorDelegationsResponse is response type for the
// Query/DelegatorDelegations RPC method.
message QueryDelegatorDelegationsResponse {
// delegation_responses defines all the delegations' info of a delegator.
repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false];
@ -197,16 +222,21 @@ message QueryDelegatorDelegationsResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryDelegatorUnbondingDelegationsRequest is request type for the Query/DelegatorUnbondingDelegations RPC method.
// QueryDelegatorUnbondingDelegationsRequest is request type for the
// Query/DelegatorUnbondingDelegations RPC method.
message QueryDelegatorUnbondingDelegationsRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// delegator_addr defines the delegator address to query for.
bytes delegator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string delegator_addr = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryUnbondingDelegatorDelegationsResponse is response type for the Query/UnbondingDelegatorDelegations RPC method.
// QueryUnbondingDelegatorDelegationsResponse is response type for the
// Query/UnbondingDelegatorDelegations RPC method.
message QueryDelegatorUnbondingDelegationsResponse {
repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false];
@ -214,22 +244,27 @@ message QueryDelegatorUnbondingDelegationsResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryRedelegationsRequest is request type for the Query/Redelegations RPC method.
// QueryRedelegationsRequest is request type for the Query/Redelegations RPC
// method.
message QueryRedelegationsRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// delegator_addr defines the delegator address to query for.
bytes delegator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string delegator_addr = 1;
// src_validator_addr defines the validator address to redelegate from.
bytes src_validator_addr = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
string src_validator_addr = 2;
// dst_validator_addr defines the validator address to redelegate to.
bytes dst_validator_addr = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
string dst_validator_addr = 3;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 4;
}
// QueryRedelegationsResponse is response type for the Query/Redelegations RPC method.
// QueryRedelegationsResponse is response type for the Query/Redelegations RPC
// method.
message QueryRedelegationsResponse {
repeated RedelegationResponse redelegation_responses = 1 [(gogoproto.nullable) = false];
@ -237,16 +272,21 @@ message QueryRedelegationsResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryDelegatorValidatorsRequest is request type for the Query/DelegatorValidators RPC method.
// QueryDelegatorValidatorsRequest is request type for the
// Query/DelegatorValidators RPC method.
message QueryDelegatorValidatorsRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// delegator_addr defines the delegator address to query for.
bytes delegator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string delegator_addr = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryDelegatorValidatorsResponse is response type for the Query/DelegatorValidators RPC method.
// QueryDelegatorValidatorsResponse is response type for the
// Query/DelegatorValidators RPC method.
message QueryDelegatorValidatorsResponse {
// validators defines the the validators' info of a delegator.
repeated Validator validators = 1 [(gogoproto.nullable) = false];
@ -255,28 +295,35 @@ message QueryDelegatorValidatorsResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryDelegatorValidatorRequest is request type for the Query/DelegatorValidator RPC method.
// QueryDelegatorValidatorRequest is request type for the
// Query/DelegatorValidator RPC method.
message QueryDelegatorValidatorRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// delegator_addr defines the delegator address to query for.
bytes delegator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string delegator_addr = 1;
// validator_addr defines the validator address to query for.
bytes validator_addr = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
string validator_addr = 2;
}
// QueryDelegatorValidatorResponse response type for the Query/DelegatorValidator RPC method.
// QueryDelegatorValidatorResponse response type for the
// Query/DelegatorValidator RPC method.
message QueryDelegatorValidatorResponse {
// validator defines the the validator info.
Validator validator = 1 [(gogoproto.nullable) = false];
}
// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC method.
// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC
// method.
message QueryHistoricalInfoRequest {
// height defines at which height to query the historical info.
int64 height = 1;
}
// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC method.
// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC
// method.
message QueryHistoricalInfoResponse {
// hist defines the historical info at the given height.
HistoricalInfo hist = 1;

View File

@ -9,8 +9,9 @@ import "cosmos/base/v1beta1/coin.proto";
option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types";
// 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
// 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
// (`n` is set by the staking module's `historical_entries` parameter).
message HistoricalInfo {
tendermint.types.Header header = 1 [(gogoproto.nullable) = false];
@ -58,23 +59,20 @@ message Description {
string details = 5;
}
// Validator defines a validator, together with the total amount of the Validator's
// bond shares and their exchange rate to coins.
// Slashing results in a decrease in the exchange rate, allowing correct
// calculation of future undelegations without iterating over delegators.
// When coins are delegated to this validator, the validator is credited with a
// delegation whose number of bond shares is based on the amount of coins
// delegated divided by the current exchange rate. Voting power can be
// calculated as total bonded shares multiplied by exchange rate.
// Validator defines a validator, together with the total amount of the
// Validator's bond shares and their exchange rate to coins. Slashing results in
// a decrease in the exchange rate, allowing correct calculation of future
// undelegations without iterating over delegators. When coins are delegated to
// this validator, the validator is credited with a delegation whose number of
// bond shares is based on the amount of coins delegated divided by the current
// exchange rate. Voting power can be calculated as total bonded shares
// multiplied by exchange rate.
message Validator {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;
bytes operator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"operator_address\""
];
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"];
@ -101,24 +99,19 @@ message ValAddresses {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.stringer) = true;
repeated bytes addresses = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
repeated string addresses = 1;
}
// DVPair is struct that just has a delegator-validator pair with no other data.
// It is intended to be used as a marshalable pointer. For example, a DVPair can
// be used to construct the key to getting an UnbondingDelegation from state.
message DVPair {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
bytes delegator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"delegator_address\""
];
bytes validator_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
}
// DVPairs defines an array of DVPair objects.
@ -131,21 +124,13 @@ message DVPairs {
// example, a DVVTriplet can be used to construct the key to getting a
// Redelegation from state.
message DVVTriplet {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
bytes delegator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"delegator_address\""
];
bytes validator_src_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_src_address\""
];
bytes validator_dst_address = 3 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_dst_address\""
];
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""];
string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""];
}
// DVVTriplets defines an array of DVVTriplet objects.
@ -157,34 +142,24 @@ message DVVTriplets {
// owned by one delegator, and is associated with the voting power of one
// validator.
message Delegation {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
bytes delegator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"delegator_address\""
];
bytes validator_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
string shares = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
}
// UnbondingDelegation stores all of a single delegator's unbonding bonds
// for a single validator in an time-ordered list.
message UnbondingDelegation {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
bytes delegator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"delegator_address\""
];
bytes validator_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false]; // unbonding delegation entries
}
@ -224,21 +199,13 @@ message RedelegationEntry {
// Redelegation contains the list of a particular delegator's redelegating bonds
// from a particular source validator to a particular destination validator.
message Redelegation {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
bytes delegator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"delegator_address\""
];
bytes validator_src_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_src_address\""
];
bytes validator_dst_address = 3 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_dst_address\""
];
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""];
string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""];
repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries
}
@ -255,10 +222,10 @@ message Params {
string bond_denom = 5 [(gogoproto.moretags) = "yaml:\"bond_denom\""];
}
// DelegationResponse is equivalent to Delegation except that it contains a balance
// in addition to shares which is more suitable for client responses.
// DelegationResponse is equivalent to Delegation except that it contains a
// balance in addition to shares which is more suitable for client responses.
message DelegationResponse {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_stringer) = false;
Delegation delegation = 1 [(gogoproto.nullable) = false];
@ -280,13 +247,14 @@ message RedelegationEntryResponse {
// contain a balance in addition to shares which is more suitable for client
// responses.
message RedelegationResponse {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
Redelegation redelegation = 1 [(gogoproto.nullable) = false];
repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false];
}
// Pool is used for tracking bonded and not-bonded token supply of the bond denomination.
// Pool is used for tracking bonded and not-bonded token supply of the bond
// denomination.
message Pool {
option (gogoproto.description) = true;
option (gogoproto.equal) = true;

View File

@ -9,7 +9,8 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types";
// MsgCreateValidator defines an SDK message for creating a new validator.
message MsgCreateValidator {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
Description description = 1 [(gogoproto.nullable) = false];
CommissionRates commission = 2 [(gogoproto.nullable) = false];
@ -18,27 +19,19 @@ message MsgCreateValidator {
(gogoproto.moretags) = "yaml:\"min_self_delegation\"",
(gogoproto.nullable) = false
];
bytes delegator_address = 4 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"delegator_address\""
];
bytes validator_address = 5 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
string pubkey = 6;
cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false];
string delegator_address = 4 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_address = 5 [(gogoproto.moretags) = "yaml:\"validator_address\""];
string pubkey = 6;
cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false];
}
// MsgEditValidator defines an SDK message for editing an existing validator.
message MsgEditValidator {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
Description description = 1 [(gogoproto.nullable) = false];
bytes validator_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"address\""
];
string validator_address = 2 [(gogoproto.moretags) = "yaml:\"address\""];
// We pass a reference to the new commission rate and min self delegation as
// it's not mandatory to update. If not updated, the deserialized rate will be
@ -58,51 +51,33 @@ message MsgEditValidator {
// MsgDelegate defines an SDK message for performing a delegation of coins
// from a delegator to a validator.
message MsgDelegate {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
bytes delegator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"delegator_address\""
];
bytes validator_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
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];
}
// MsgBeginRedelegate defines an SDK message for performing a redelegation
// of coins from a delegator and source validator to a destination validator.
message MsgBeginRedelegate {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
bytes delegator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"delegator_address\""
];
bytes validator_src_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_src_address\""
];
bytes validator_dst_address = 3 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_dst_address\""
];
cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false];
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""];
string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""];
cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false];
}
// MsgUndelegate defines an SDK message for performing an undelegation from a
// delegate and a validator.
message MsgUndelegate {
option (gogoproto.equal) = true;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
bytes delegator_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"delegator_address\""
];
bytes validator_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress",
(gogoproto.moretags) = "yaml:\"validator_address\""
];
cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
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];
}

View File

@ -8,15 +8,17 @@ option go_package = "github.com/cosmos/cosmos-sdk/types/tx/signing";
// SignMode represents a signing mode with its own security guarantees.
enum SignMode {
// SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be rejected
// SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be
// rejected
SIGN_MODE_UNSPECIFIED = 0;
// SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is verified
// with raw bytes from Tx
// SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is
// verified with raw bytes from Tx
SIGN_MODE_DIRECT = 1;
// SIGN_MODE_TEXTUAL is a future signing mode that will verify some human-readable
// textual representation on top of the binary representation from SIGN_MODE_DIRECT
// SIGN_MODE_TEXTUAL is a future signing mode that will verify some
// human-readable textual representation on top of the binary representation
// from SIGN_MODE_DIRECT
SIGN_MODE_TEXTUAL = 2;
// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
@ -30,9 +32,10 @@ message SignatureDescriptors {
repeated SignatureDescriptor signatures = 1;
}
// SignatureDescriptor is a convenience type which represents the full data for a
// signature including the public key of the signer, signing modes and the signature
// itself. It is primarily used for coordinating signatures between clients.
// SignatureDescriptor is a convenience type which represents the full data for
// a signature including the public key of the signer, signing modes and the
// signature itself. It is primarily used for coordinating signatures between
// clients.
message SignatureDescriptor {
// public_key is the public key of the signer
google.protobuf.Any public_key = 1;

View File

@ -14,37 +14,44 @@ message Tx {
// body is the processable content of the transaction
TxBody body = 1;
// auth_info is the authorization related content of the transaction, specifically
// signers, signer modes and fee
// auth_info is the authorization related content of the transaction,
// specifically signers, signer modes and fee
AuthInfo auth_info = 2;
// signatures is a list of signatures that matches the length and order of AuthInfo's signer_infos to
// allow connecting signature meta information like public key and signing mode by position.
// signatures is a list of signatures that matches the length and order of
// AuthInfo's signer_infos to allow connecting signature meta information like
// public key and signing mode by position.
repeated bytes signatures = 3;
}
// TxRaw is a variant of Tx that pins the signer's exact binary representation of body and
// auth_info. This is used for signing, broadcasting and verification. The binary
// `serialize(tx: TxRaw)` is stored in Tendermint and the hash `sha256(serialize(tx: TxRaw))`
// becomes the "txhash", commonly used as the transaction ID.
// TxRaw is a variant of Tx that pins the signer's exact binary representation
// of body and auth_info. This is used for signing, broadcasting and
// verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and
// the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used
// as the transaction ID.
message TxRaw {
// body_bytes is a protobuf serialization of a TxBody that matches the representation in SignDoc.
// body_bytes is a protobuf serialization of a TxBody that matches the
// representation in SignDoc.
bytes body_bytes = 1;
// auth_info_bytes is a protobuf serialization of an AuthInfo that matches the representation in SignDoc.
// auth_info_bytes is a protobuf serialization of an AuthInfo that matches the
// representation in SignDoc.
bytes auth_info_bytes = 2;
// signatures is a list of signatures that matches the length and order of AuthInfo's signer_infos to
// allow connecting signature meta information like public key and signing mode by position.
// signatures is a list of signatures that matches the length and order of
// AuthInfo's signer_infos to allow connecting signature meta information like
// public key and signing mode by position.
repeated bytes signatures = 3;
}
// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT.
message SignDoc {
// body_bytes is protobuf serialization of a TxBody that matches the representation in TxRaw.
// body_bytes is protobuf serialization of a TxBody that matches the
// representation in TxRaw.
bytes body_bytes = 1;
// auth_info_bytes is a protobuf serialization of an AuthInfo that matches the representation in TxRaw.
// auth_info_bytes is a protobuf serialization of an AuthInfo that matches the
// representation in TxRaw.
bytes auth_info_bytes = 2;
// chain_id is the unique identifier of the chain this transaction targets.
@ -58,12 +65,14 @@ message SignDoc {
// TxBody is the body of a transaction that all signers sign over.
message TxBody {
// messages is a list of messages to be executed. The required signers of those messages define
// the number and order of elements in AuthInfo's signer_infos and Tx's signatures.
// Each required signer address is added to the list only the first time it occurs.
// messages is a list of messages to be executed. The required signers of
// those messages define the number and order of elements in AuthInfo's
// signer_infos and Tx's signatures. Each required signer address is added to
// the list only the first time it occurs.
//
// By convention, the first required signer (usually from the first message) is referred
// to as the primary signer and pays the fee for the whole transaction.
// By convention, the first required signer (usually from the first message)
// is referred to as the primary signer and pays the fee for the whole
// transaction.
repeated google.protobuf.Any messages = 1;
// memo is any arbitrary memo to be added to the transaction
@ -84,11 +93,13 @@ message TxBody {
repeated google.protobuf.Any non_critical_extension_options = 2047;
}
// AuthInfo describes the fee and signer modes that are used to sign a transaction.
// AuthInfo describes the fee and signer modes that are used to sign a
// transaction.
message AuthInfo {
// signer_infos defines the signing modes for the required signers. The number
// and order of elements must match the required signers from TxBody's messages.
// The first element is the primary signer and the one which pays the fee.
// and order of elements must match the required signers from TxBody's
// messages. The first element is the primary signer and the one which pays
// the fee.
repeated SignerInfo signer_infos = 1;
// Fee is the fee and gas limit for the transaction. The first signer is the
@ -98,7 +109,8 @@ message AuthInfo {
Fee fee = 2;
}
// SignerInfo describes the public key and signing mode of a single top-level signer.
// SignerInfo describes the public key and signing mode of a single top-level
// signer.
message SignerInfo {
// public_key is the public key of the signer. It is optional for accounts
// that already exist in state. If unset, the verifier can use the required \
@ -110,8 +122,8 @@ message SignerInfo {
ModeInfo mode_info = 2;
// sequence is the sequence of the account, which describes the
// number of committed transactions signed by a given address. It is used to prevent
// replay attacks.
// number of committed transactions signed by a given address. It is used to
// prevent replay attacks.
uint64 sequence = 3;
}
@ -128,7 +140,8 @@ message ModeInfo {
}
// Single is the mode info for a single signer. It is structured as a message
// to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the future
// to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the
// future
message Single {
// mode is the signing mode of the single signer
cosmos.tx.signing.v1beta1.SignMode mode = 1;

View File

@ -19,22 +19,26 @@ service Query {
}
}
// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC method.
// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC
// method.
message QueryCurrentPlanRequest {}
// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC method.
// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC
// method.
message QueryCurrentPlanResponse {
// plan is the current upgrade plan.
Plan plan = 1;
}
// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC method.
// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC
// method.
message QueryAppliedPlanRequest {
// name is the name of the applied plan to query for.
string name = 1;
}
// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC method.
// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC
// method.
message QueryAppliedPlanResponse {
// height is the block height at which the plan was applied.
int64 height = 1;

View File

@ -12,11 +12,13 @@ option (gogoproto.goproto_getters_all) = false;
message Plan {
option (gogoproto.equal) = true;
// Sets the name for the upgrade. This name will be used by the upgraded version of the software to apply any
// special "on-upgrade" commands during the first BeginBlock method after the upgrade is applied. It is also used
// to detect whether a software version can handle a given upgrade. If no upgrade handler with this name has been
// set in the software, it will be assumed that the software is out-of-date when the upgrade Time or Height
// is reached and the software will exit.
// Sets the name for the upgrade. This name will be used by the upgraded
// version of the software to apply any special "on-upgrade" commands during
// the first BeginBlock method after the upgrade is applied. It is also used
// to detect whether a software version can handle a given upgrade. If no
// upgrade handler with this name has been set in the software, it will be
// assumed that the software is out-of-date when the upgrade Time or Height is
// reached and the software will exit.
string name = 1;
// The time after which the upgrade must be performed.
@ -32,7 +34,8 @@ message Plan {
string info = 4;
}
// SoftwareUpgradeProposal is a gov Content type for initiating a software upgrade.
// SoftwareUpgradeProposal is a gov Content type for initiating a software
// upgrade.
message SoftwareUpgradeProposal {
option (gogoproto.equal) = true;
@ -41,7 +44,8 @@ message SoftwareUpgradeProposal {
Plan plan = 3 [(gogoproto.nullable) = false];
}
// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software upgrade.
// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software
// upgrade.
message CancelSoftwareUpgradeProposal {
option (gogoproto.equal) = true;

View File

@ -11,14 +11,8 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types";
message MsgCreateVestingAccount {
option (gogoproto.equal) = true;
bytes from_address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"from_address\""
];
bytes to_address = 2 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"to_address\""
];
string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""];
string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""];
repeated cosmos.base.v1beta1.Coin amount = 3
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];

View File

@ -9,97 +9,127 @@ import "ibc/client/client.proto";
// 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];
bytes signer = 4 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 4;
}
// 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 channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
Channel channel = 3 [(gogoproto.nullable) = false];
string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""];
bytes proof_init = 5 [(gogoproto.moretags) = "yaml:\"proof_init\""];
ibc.client.Height proof_height = 6 [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
bytes signer = 7 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 7;
}
// 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_version = 3 [(gogoproto.moretags) = "yaml:\"counterparty_version\""];
bytes proof_try = 4 [(gogoproto.moretags) = "yaml:\"proof_try\""];
ibc.client.Height proof_height = 5 [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
bytes signer = 6 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 6;
}
// 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.client.Height proof_height = 4 [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
bytes signer = 5 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 5;
}
// 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\""];
bytes signer = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 3;
}
// 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.client.Height proof_height = 4 [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
bytes signer = 5 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 5;
}
// 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.client.Height proof_height = 3 [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
bytes signer = 4 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 4;
}
// 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.client.Height proof_height = 3 [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
uint64 next_sequence_recv = 4 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""];
bytes signer = 5 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 5;
}
// 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.client.Height proof_height = 4 [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
uint64 next_sequence_recv = 5 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""];
bytes signer = 6 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 6;
}
// 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.client.Height proof_height = 4 [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
bytes signer = 5 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 5;
}
// Channel defines pipeline for exactly-once packet delivery between specific

View File

@ -72,7 +72,6 @@ service Query {
"{packet_commitment_sequences}/unrelayed_acks";
}
// NextSequenceReceive returns the next receive sequence for a given channel.
rpc NextSequenceReceive(QueryNextSequenceReceiveRequest) returns (QueryNextSequenceReceiveResponse) {
option (google.api.http).get = "/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/next_sequence";

View File

@ -50,6 +50,9 @@ message ClientUpdateProposal {
// 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
@ -58,29 +61,35 @@ message MsgCreateClient {
// height.
google.protobuf.Any consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""];
// signer address
bytes signer = 4 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
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
bytes signer = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 3;
}
// 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
bytes signer = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 3;
}
// Height is a monotonically increasing data type

View File

@ -21,13 +21,15 @@ service Query {
option (google.api.http).get = "/ibc/client/v1beta1/client_states";
}
// ConsensusState queries a consensus state associated with a client state at a given height.
// ConsensusState queries a consensus state associated with a client state at
// a given height.
rpc ConsensusState(QueryConsensusStateRequest) returns (QueryConsensusStateResponse) {
option (google.api.http).get =
"/ibc/client/v1beta1/consensus_states/{client_id}/epoch/{epoch_number}/height/{epoch_height}";
option (google.api.http).get = "/ibc/client/v1beta1/consensus_states/{client_id}/epoch/{epoch_number}/"
"height/{epoch_height}";
}
// ConsensusStates queries all the consensus state associated with a given client.
// ConsensusStates queries all the consensus state associated with a given
// client.
rpc ConsensusStates(QueryConsensusStatesRequest) returns (QueryConsensusStatesResponse) {
option (google.api.http).get = "/ibc/client/v1beta1/consensus_states/{client_id}";
}
@ -70,8 +72,9 @@ message QueryClientStatesResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryConsensusStateRequest is the request type for the Query/ConsensusState RPC method. Besides
// the consensus state, it includes a proof and the height from which the proof was retrieved.
// QueryConsensusStateRequest is the request type for the Query/ConsensusState
// RPC method. Besides the consensus state, it includes a proof and the height
// from which the proof was retrieved.
message QueryConsensusStateRequest {
// client identifier
string client_id = 1;
@ -79,11 +82,13 @@ message QueryConsensusStateRequest {
uint64 epoch_number = 2;
// consensus state epoch height
uint64 epoch_height = 3;
// latest_height overrrides the height field and queries the latest stored ConsensusState
// latest_height overrrides the height field and queries the latest stored
// ConsensusState
bool latest_height = 4;
}
// QueryConsensusStateResponse is the response type for the Query/ConsensusState RPC method
// QueryConsensusStateResponse is the response type for the Query/ConsensusState
// RPC method
message QueryConsensusStateResponse {
// consensus state associated with the client identifier at the given height
google.protobuf.Any consensus_state = 1;
@ -93,10 +98,10 @@ message QueryConsensusStateResponse {
string proof_path = 3;
// height at which the proof was retrieved
ibc.client.Height proof_height = 4 [(gogoproto.nullable) = false];
;
}
// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates RPC method.
// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates
// RPC method.
message QueryConsensusStatesRequest {
// client identifier
string client_id = 1;
@ -104,7 +109,8 @@ message QueryConsensusStatesRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryConsensusStatesResponse is the response type for the Query/ConsensusStates RPC method
// QueryConsensusStatesResponse is the response type for the
// Query/ConsensusStates RPC method
message QueryConsensusStatesResponse {
// consensus states associated with the identifier
repeated ConsensusStateWithHeight consensus_states = 1 [(gogoproto.nullable) = false];

View File

@ -15,13 +15,14 @@ message MerkleRoot {
}
// MerklePrefix is merkle path prefixed to the key.
// The constructed key from the Path and the key will be append(Path.KeyPath, append(Path.KeyPrefix, key...))
// The constructed key from the Path and the key will be append(Path.KeyPath,
// append(Path.KeyPrefix, key...))
message MerklePrefix {
bytes key_prefix = 1 [(gogoproto.moretags) = "yaml:\"key_prefix\""];
}
// MerklePath is the path used to verify commitment proofs, which can be an arbitrary
// structured object (defined by a commitment type).
// MerklePath is the path used to verify commitment proofs, which can be an
// arbitrary structured object (defined by a commitment type).
message MerklePath {
option (gogoproto.goproto_stringer) = false;
@ -29,9 +30,9 @@ message MerklePath {
}
// MerkleProof is a wrapper type that contains a merkle proof.
// It demonstrates membership or non-membership for an element or set of elements,
// verifiable in conjunction with a known commitment root. Proofs should be
// succinct.
// It demonstrates membership or non-membership for an element or set of
// elements, verifiable in conjunction with a known commitment root. Proofs
// should be succinct.
message MerkleProof {
tendermint.crypto.ProofOps proof = 1;
}

View File

@ -11,15 +11,21 @@ import "ibc/client/client.proto";
// 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];
bytes signer = 4 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 4;
}
// 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 connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""];
google.protobuf.Any client_state = 3 [(gogoproto.moretags) = "yaml:\"client_state\""];
@ -35,12 +41,15 @@ message MsgConnectionOpenTry {
bytes proof_consensus = 9 [(gogoproto.moretags) = "yaml:\"proof_consensus\""];
ibc.client.Height consensus_height = 10
[(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false];
bytes signer = 11 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 11;
}
// 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 version = 2;
google.protobuf.Any client_state = 3 [(gogoproto.moretags) = "yaml:\"client_state\""];
@ -54,17 +63,20 @@ message MsgConnectionOpenAck {
bytes proof_consensus = 7 [(gogoproto.moretags) = "yaml:\"proof_consensus\""];
ibc.client.Height consensus_height = 8
[(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false];
bytes signer = 9 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 9;
}
// 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.client.Height proof_height = 3 [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
bytes signer = 4 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string signer = 4;
}
// ICS03 - Connection Data Structures as defined in

View File

@ -37,8 +37,8 @@ service Query {
// ConnectionConsensusState queries the consensus state associated with the
// connection.
rpc ConnectionConsensusState(QueryConnectionConsensusStateRequest) returns (QueryConnectionConsensusStateResponse) {
option (google.api.http).get = "/ibc/connection/v1beta1/connections/{connection_id}/consensus_state/epoch/"
"{epoch_number}/height/{epoch_height}";
option (google.api.http).get = "/ibc/connection/v1beta1/connections/{connection_id}/consensus_state/"
"epoch/{epoch_number}/height/{epoch_height}";
}
}

View File

@ -102,7 +102,8 @@ message ClientStateData {
google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""];
}
// ConsensusStateSignBytes returns the SignBytes data for consensus state verification.
// ConsensusStateSignBytes returns the SignBytes data for consensus state
// verification.
message ConsensusStateData {
option (gogoproto.goproto_getters) = false;
@ -110,7 +111,8 @@ message ConsensusStateData {
google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""];
}
// ConnectionStateSignBytes returns the SignBytes data for connection state verification.
// ConnectionStateSignBytes returns the SignBytes data for connection state
// verification.
message ConnectionStateData {
option (gogoproto.goproto_getters) = false;
@ -118,7 +120,8 @@ message ConnectionStateData {
ibc.connection.ConnectionEnd connection = 2;
}
// ChannelStateSignBytes returns the SignBytes data for channel state verification.
// ChannelStateSignBytes returns the SignBytes data for channel state
// verification.
message ChannelStateData {
option (gogoproto.goproto_getters) = false;
@ -126,20 +129,22 @@ message ChannelStateData {
ibc.channel.Channel channel = 2;
}
// PacketCommitmentSignBytes returns the SignBytes data for packet commitment verification.
// PacketCommitmentSignBytes returns the SignBytes data for packet commitment
// verification.
message PacketCommitmentData {
bytes path = 1;
bytes commitment = 2;
}
// PacketAcknowledgementSignBytes returns the SignBytes data for acknowledgement verification.
// PacketAcknowledgementSignBytes returns the SignBytes data for acknowledgement
// verification.
message PacketAcknowledgementData {
bytes path = 1;
bytes acknowledgement = 2;
}
// PacketAcknowledgementAbsenceSignBytes returns the SignBytes data for acknowledgement absence
// verification.
// PacketAcknowledgementAbsenceSignBytes returns the SignBytes data for
// acknowledgement absence verification.
message PacketAcknowledgementAbsenseData {
bytes path = 1;
}

View File

@ -26,25 +26,29 @@ service Query {
}
}
// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC method
// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC
// method
message QueryDenomTraceRequest {
// hash (in hex format) of the denomination trace information.
string hash = 1;
}
// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC method.
// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC
// method.
message QueryDenomTraceResponse {
// denom_trace returns the requested denomination trace information.
DenomTrace denom_trace = 1;
}
// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC method
// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC
// method
message QueryDenomTracesRequest {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC method.
// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC
// method.
message QueryDenomTracesResponse {
// denom_traces returns all denominations trace information.
repeated DenomTrace denom_traces = 1 [(gogoproto.castrepeated) = "Traces", (gogoproto.nullable) = false];

View File

@ -11,6 +11,9 @@ import "ibc/client/client.proto";
// 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
@ -18,7 +21,7 @@ message MsgTransfer {
// the tokens to be transferred
cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false];
// the sender address
bytes sender = 4 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
string sender = 4;
// the recipient address on the destination chain
string receiver = 5;
// Timeout height relative to the current block height.

View File

@ -61,7 +61,7 @@ func (s *IntegrationTestSuite) TestGRPCServer() {
var header metadata.MD
bankRes, err := bankClient.Balance(
context.Background(),
&banktypes.QueryBalanceRequest{Address: val0.Address, Denom: denom},
&banktypes.QueryBalanceRequest{Address: val0.Address.String(), Denom: denom},
grpc.Header(&header), // Also fetch grpc header
)
s.Require().NoError(err)
@ -75,7 +75,7 @@ func (s *IntegrationTestSuite) TestGRPCServer() {
// Request metadata should work
bankRes, err = bankClient.Balance(
metadata.AppendToOutgoingContext(context.Background(), grpctypes.GRPCBlockHeightHeader, "1"), // Add metadata to request
&banktypes.QueryBalanceRequest{Address: val0.Address, Denom: denom},
&banktypes.QueryBalanceRequest{Address: val0.Address.String(), Denom: denom},
grpc.Header(&header),
)
blockHeight = header.Get(grpctypes.GRPCBlockHeightHeader)

View File

@ -80,7 +80,16 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []
// withdraw all delegator rewards
dels := app.StakingKeeper.GetAllDelegations(ctx)
for _, delegation := range dels {
_, _ = app.DistrKeeper.WithdrawDelegationRewards(ctx, delegation.DelegatorAddress, delegation.ValidatorAddress)
valAddr, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress)
if err != nil {
panic(err)
}
delAddr, err := sdk.AccAddressFromBech32(delegation.DelegatorAddress)
if err != nil {
panic(err)
}
_, _ = app.DistrKeeper.WithdrawDelegationRewards(ctx, delAddr, valAddr)
}
// clear validator slash events
@ -107,8 +116,16 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []
// reinitialize all delegations
for _, del := range dels {
app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, del.DelegatorAddress, del.ValidatorAddress)
app.DistrKeeper.Hooks().AfterDelegationModified(ctx, del.DelegatorAddress, del.ValidatorAddress)
valAddr, err := sdk.ValAddressFromBech32(del.ValidatorAddress)
if err != nil {
panic(err)
}
delAddr, err := sdk.AccAddressFromBech32(del.DelegatorAddress)
if err != nil {
panic(err)
}
app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr)
app.DistrKeeper.Hooks().AfterDelegationModified(ctx, delAddr, valAddr)
}
// reset context height

View File

@ -84,7 +84,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
// create concrete account type based on input parameters
var genAccount authtypes.GenesisAccount
balances := banktypes.Balance{Address: addr, Coins: coins.Sort()}
balances := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()}
baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0)
if !vestingAmt.IsZero() {

View File

@ -200,7 +200,7 @@ func InitTestnet(
sdk.NewCoin(sdk.DefaultBondDenom, accStakingTokens),
}
genBalances = append(genBalances, banktypes.Balance{Address: addr, Coins: coins.Sort()})
genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: coins.Sort()})
genAccounts = append(genAccounts, authtypes.NewBaseAccount(addr, nil, 0, 0))
valTokens := sdk.TokensFromConsensusPower(100)

View File

@ -92,7 +92,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs
for _, val := range valSet.Validators {
validator := stakingtypes.Validator{
OperatorAddress: val.Address.Bytes(),
OperatorAddress: sdk.ValAddress(val.Address).String(),
ConsensusPubkey: sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, val.PubKey),
Jailed: false,
Status: sdk.Bonded,

View File

@ -283,7 +283,7 @@ func New(t *testing.T, cfg Config) *Network {
)
genFiles = append(genFiles, tmCfg.GenesisFile())
genBalances = append(genBalances, banktypes.Balance{Address: addr, Coins: balances.Sort()})
genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: balances.Sort()})
genAccounts = append(genAccounts, authtypes.NewBaseAccount(addr, nil, 0, 0))
commission, err := sdk.NewDecFromStr("0.5")

View File

@ -8,7 +8,6 @@ import (
encoding_binary "encoding/binary"
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
tx "github.com/cosmos/cosmos-sdk/types/tx"
_ "github.com/gogo/protobuf/gogoproto"
grpc1 "github.com/gogo/protobuf/grpc"
@ -576,7 +575,7 @@ func (m *TestAnyResponse) GetHasAnimal() *HasAnimal {
// msg type for testing
type TestMsg struct {
Signers []github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,rep,name=signers,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"signers,omitempty"`
Signers []string `protobuf:"bytes,1,rep,name=signers,proto3" json:"signers,omitempty"`
}
func (m *TestMsg) Reset() { *m = TestMsg{} }
@ -612,13 +611,6 @@ func (m *TestMsg) XXX_DiscardUnknown() {
var xxx_messageInfo_TestMsg proto.InternalMessageInfo
func (m *TestMsg) GetSigners() []github_com_cosmos_cosmos_sdk_types.AccAddress {
if m != nil {
return m.Signers
}
return nil
}
// bad MultiSignature with extra fields
type BadMultiSignature struct {
Signatures [][]byte `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"`
@ -3435,132 +3427,131 @@ func init() {
func init() { proto.RegisterFile("proto.proto", fileDescriptor_2fcc84b9998d60d8) }
var fileDescriptor_2fcc84b9998d60d8 = []byte{
// 2003 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0x4f, 0x8f, 0x1b, 0x49,
0x15, 0x9f, 0x76, 0xdb, 0x33, 0xf6, 0x1b, 0xaf, 0xc7, 0xa9, 0x0d, 0x4b, 0xc7, 0xd9, 0x4c, 0x66,
0x5b, 0xd9, 0xc4, 0xac, 0x36, 0x76, 0xdc, 0x76, 0x24, 0x94, 0x03, 0x8a, 0x3d, 0x99, 0xd9, 0x89,
0x48, 0x26, 0xa8, 0x93, 0x0d, 0x28, 0x17, 0xab, 0xdd, 0x5d, 0xb6, 0x5b, 0xb1, 0xab, 0x86, 0xae,
0x72, 0x32, 0xe6, 0x84, 0xe0, 0xc0, 0x75, 0x2f, 0x08, 0x89, 0x1b, 0x47, 0x4e, 0x68, 0xbf, 0x01,
0x37, 0x72, 0x41, 0xca, 0x05, 0x09, 0x09, 0x29, 0x42, 0xc9, 0x95, 0x4f, 0x00, 0x42, 0x8b, 0xaa,
0xba, 0xfa, 0x8f, 0x67, 0xec, 0x59, 0x67, 0x16, 0x36, 0x1a, 0x89, 0x8b, 0x5d, 0xf5, 0xfa, 0x57,
0xbf, 0x7a, 0xf5, 0xfe, 0x75, 0x57, 0x15, 0xac, 0x1f, 0x04, 0x94, 0xd3, 0x9a, 0xfc, 0x45, 0x79,
0x8e, 0x19, 0xf7, 0x1c, 0xee, 0x54, 0xce, 0x0f, 0xe8, 0x80, 0x4a, 0x61, 0x5d, 0xb4, 0xc2, 0xe7,
0x95, 0x0b, 0x03, 0x4a, 0x07, 0x23, 0x5c, 0x97, 0xbd, 0xde, 0xa4, 0x5f, 0x77, 0xc8, 0x54, 0x3d,
0xaa, 0xb8, 0x94, 0x8d, 0x29, 0xab, 0xf3, 0xc3, 0xfa, 0xb3, 0x46, 0x0f, 0x73, 0xa7, 0x51, 0xe7,
0x87, 0xe1, 0x33, 0xf3, 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bb, 0xed, 0x0e, 0x28, 0xfa, 0x5e, 0x92, 0xd9, 0xa9, 0xeb, 0xa0, 0xca,
0xbb, 0xc7, 0xc5, 0xea, 0xc6, 0xa4, 0x05, 0xf9, 0xe8, 0xee, 0x06, 0x5d, 0x4e, 0x30, 0xc7, 0xae,
0x7d, 0x2a, 0x95, 0x59, 0x8f, 0x14, 0xc5, 0x0f, 0xe5, 0x05, 0x0a, 0xaf, 0x79, 0xc6, 0x74, 0x59,
0x49, 0x6e, 0x78, 0x2a, 0x97, 0x67, 0x3c, 0x91, 0xe3, 0xdb, 0xbb, 0x2f, 0x5e, 0xad, 0x6b, 0x2f,
0x5f, 0xad, 0x6b, 0xff, 0x7c, 0xb5, 0xae, 0x7d, 0xfe, 0x7a, 0x7d, 0xe9, 0xe5, 0xeb, 0xf5, 0xa5,
0xbf, 0xbf, 0x5e, 0x5f, 0x7a, 0x56, 0xeb, 0xfb, 0xe1, 0x60, 0xdc, 0xad, 0xb9, 0x74, 0x54, 0x57,
0x97, 0x87, 0xf2, 0xef, 0x16, 0xf3, 0x9e, 0xd7, 0x39, 0xe1, 0x38, 0xf4, 0x87, 0xf5, 0x88, 0xb9,
0xbb, 0x2c, 0x42, 0xa6, 0xf1, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8b, 0xd7, 0x2e, 0x82, 0xb2,
0x1c, 0x00, 0x00,
}
@ -6808,8 +6799,8 @@ func (m *TestMsg) Size() (n int) {
var l int
_ = l
if len(m.Signers) > 0 {
for _, b := range m.Signers {
l = len(b)
for _, s := range m.Signers {
l = len(s)
n += 1 + l + sovProto(uint64(l))
}
}
@ -8990,7 +8981,7 @@ func (m *TestMsg) Unmarshal(dAtA []byte) error {
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Signers", wireType)
}
var byteLen int
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
@ -9000,23 +8991,23 @@ func (m *TestMsg) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthProto
}
postIndex := iNdEx + byteLen
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Signers = append(m.Signers, make([]byte, postIndex-iNdEx))
copy(m.Signers[len(m.Signers)-1], dAtA[iNdEx:postIndex])
m.Signers = append(m.Signers, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default:
iNdEx = preIndex

View File

@ -62,7 +62,8 @@ message TestAnyResponse {
// msg type for testing
message TestMsg {
repeated bytes signers = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
option (gogoproto.goproto_getters) = false;
repeated string signers = 1;
}
// bad MultiSignature with extra fields

View File

@ -29,8 +29,14 @@ func NewTestGasLimit() uint64 {
// NewTestMsg creates a message for testing with the given signers.
func NewTestMsg(addrs ...sdk.AccAddress) *TestMsg {
var accAddresses []string
for _, addr := range addrs {
accAddresses = append(accAddresses, addr.String())
}
return &TestMsg{
Signers: addrs,
Signers: accAddresses,
}
}
@ -45,4 +51,13 @@ func (msg *TestMsg) GetSignBytes() []byte {
}
return sdk.MustSortJSON(bz)
}
func (msg *TestMsg) GetSigners() []sdk.AccAddress {
addrs := make([]sdk.AccAddress, len(msg.Signers))
for i, in := range msg.Signers {
addr, _ := sdk.AccAddressFromBech32(in)
addrs[i] = addr
}
return addrs
}
func (msg *TestMsg) ValidateBasic() error { return nil }

View File

@ -40,7 +40,8 @@ type TxResponse struct {
Code uint32 `protobuf:"varint,4,opt,name=code,proto3" json:"code,omitempty"`
// Result bytes, if any.
Data string `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
// The output of the application's logger (raw string). May be non-deterministic.
// The output of the application's logger (raw string). May be
// non-deterministic.
RawLog string `protobuf:"bytes,6,opt,name=raw_log,json=rawLog,proto3" json:"raw_log,omitempty"`
// The output of the application's logger (typed). May be non-deterministic.
Logs ABCIMessageLogs `protobuf:"bytes,7,rep,name=logs,proto3,castrepeated=ABCIMessageLogs" json:"logs"`
@ -52,8 +53,9 @@ type TxResponse struct {
GasUsed int64 `protobuf:"varint,10,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"`
// The request transaction bytes.
Tx *types.Any `protobuf:"bytes,11,opt,name=tx,proto3" json:"tx,omitempty"`
// Time of the previous block. For heights > 1, it's the weighted median of the
// timestamps of the valid votes in the block.LastCommit. For height == 1, it's genesis time.
// Time of the previous block. For heights > 1, it's the weighted median of
// the timestamps of the valid votes in the block.LastCommit. For height == 1,
// it's genesis time.
Timestamp string `protobuf:"bytes,12,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
}
@ -313,13 +315,13 @@ func (m *GasInfo) GetGasUsed() uint64 {
// Result is the union of ResponseFormat and ResponseCheckTx.
type Result struct {
// Data is any data returned from message or handler execution. It MUST be length
// prefixed in order to separate data from multiple message executions.
// Data is any data returned from message or handler execution. It MUST be
// length prefixed in order to separate data from multiple message executions.
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
// Log contains the log information from message or handler execution.
Log string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"`
// Events contains a slice of Event objects that were emitted during message or
// handler execution.
// Events contains a slice of Event objects that were emitted during message
// or handler execution.
Events []types1.Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events"`
}
@ -401,7 +403,8 @@ func (m *SimulationResponse) GetResult() *Result {
return nil
}
// MsgData defines the data returned in a Result object during message execution.
// MsgData defines the data returned in a Result object during message
// execution.
type MsgData struct {
MsgType string `protobuf:"bytes,1,opt,name=msg_type,json=msgType,proto3" json:"msg_type,omitempty"`
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
@ -453,8 +456,8 @@ func (m *MsgData) GetData() []byte {
return nil
}
// TxMsgData defines a list of MsgData. A transaction will have a MsgData object for
// each message.
// TxMsgData defines a list of MsgData. A transaction will have a MsgData object
// for each message.
type TxMsgData struct {
Data []*MsgData `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
}

View File

@ -185,6 +185,7 @@ func (aa AccAddress) MarshalYAML() (interface{}, error) {
func (aa *AccAddress) UnmarshalJSON(data []byte) error {
var s string
err := json.Unmarshal(data, &s)
if err != nil {
return err
}

View File

@ -42,8 +42,9 @@ type PageRequest struct {
// If left empty it will default to a value to be set by each app.
Limit uint64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
// count_total is set to true to indicate that the result set should include
// a count of the total number of items available for pagination in UIs. count_total
// is only respected when offset is used. It is ignored when key is set.
// a count of the total number of items available for pagination in UIs.
// count_total is only respected when offset is used. It is ignored when key
// is set.
CountTotal bool `protobuf:"varint,4,opt,name=count_total,json=countTotal,proto3" json:"count_total,omitempty"`
}
@ -108,8 +109,8 @@ func (m *PageRequest) GetCountTotal() bool {
return false
}
// PageResponse is to be embedded in gRPC response messages where the corresponding
// request message has used PageRequest.
// PageResponse is to be embedded in gRPC response messages where the
// corresponding request message has used PageRequest.
//
// message SomeResponse {
// repeated Bar results = 1;

View File

@ -11,6 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/store"
"github.com/cosmos/cosmos-sdk/store/prefix"
@ -46,7 +47,7 @@ func TestPagination(t *testing.T) {
balances = append(balances, sdk.NewInt64Coin(denom, 100))
}
addr1 := sdk.AccAddress([]byte("addr1"))
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))

View File

@ -28,13 +28,15 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type SignMode int32
const (
// SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be rejected
// SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be
// rejected
SignMode_SIGN_MODE_UNSPECIFIED SignMode = 0
// SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is verified
// with raw bytes from Tx
// SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is
// verified with raw bytes from Tx
SignMode_SIGN_MODE_DIRECT SignMode = 1
// SIGN_MODE_TEXTUAL is a future signing mode that will verify some human-readable
// textual representation on top of the binary representation from SIGN_MODE_DIRECT
// SIGN_MODE_TEXTUAL is a future signing mode that will verify some
// human-readable textual representation on top of the binary representation
// from SIGN_MODE_DIRECT
SignMode_SIGN_MODE_TEXTUAL SignMode = 2
// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
// Amino JSON and will be removed in the future
@ -109,9 +111,10 @@ func (m *SignatureDescriptors) GetSignatures() []*SignatureDescriptor {
return nil
}
// SignatureDescriptor is a convenience type which represents the full data for a
// signature including the public key of the signer, signing modes and the signature
// itself. It is primarily used for coordinating signatures between clients.
// SignatureDescriptor is a convenience type which represents the full data for
// a signature including the public key of the signer, signing modes and the
// signature itself. It is primarily used for coordinating signatures between
// clients.
type SignatureDescriptor struct {
// public_key is the public key of the signer
PublicKey *types.Any `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`

View File

@ -32,11 +32,12 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Tx struct {
// body is the processable content of the transaction
Body *TxBody `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
// auth_info is the authorization related content of the transaction, specifically
// signers, signer modes and fee
// auth_info is the authorization related content of the transaction,
// specifically signers, signer modes and fee
AuthInfo *AuthInfo `protobuf:"bytes,2,opt,name=auth_info,json=authInfo,proto3" json:"auth_info,omitempty"`
// signatures is a list of signatures that matches the length and order of AuthInfo's signer_infos to
// allow connecting signature meta information like public key and signing mode by position.
// signatures is a list of signatures that matches the length and order of
// AuthInfo's signer_infos to allow connecting signature meta information like
// public key and signing mode by position.
Signatures [][]byte `protobuf:"bytes,3,rep,name=signatures,proto3" json:"signatures,omitempty"`
}
@ -94,17 +95,21 @@ func (m *Tx) GetSignatures() [][]byte {
return nil
}
// TxRaw is a variant of Tx that pins the signer's exact binary representation of body and
// auth_info. This is used for signing, broadcasting and verification. The binary
// `serialize(tx: TxRaw)` is stored in Tendermint and the hash `sha256(serialize(tx: TxRaw))`
// becomes the "txhash", commonly used as the transaction ID.
// TxRaw is a variant of Tx that pins the signer's exact binary representation
// of body and auth_info. This is used for signing, broadcasting and
// verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and
// the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used
// as the transaction ID.
type TxRaw struct {
// body_bytes is a protobuf serialization of a TxBody that matches the representation in SignDoc.
// body_bytes is a protobuf serialization of a TxBody that matches the
// representation in SignDoc.
BodyBytes []byte `protobuf:"bytes,1,opt,name=body_bytes,json=bodyBytes,proto3" json:"body_bytes,omitempty"`
// auth_info_bytes is a protobuf serialization of an AuthInfo that matches the representation in SignDoc.
// auth_info_bytes is a protobuf serialization of an AuthInfo that matches the
// representation in SignDoc.
AuthInfoBytes []byte `protobuf:"bytes,2,opt,name=auth_info_bytes,json=authInfoBytes,proto3" json:"auth_info_bytes,omitempty"`
// signatures is a list of signatures that matches the length and order of AuthInfo's signer_infos to
// allow connecting signature meta information like public key and signing mode by position.
// signatures is a list of signatures that matches the length and order of
// AuthInfo's signer_infos to allow connecting signature meta information like
// public key and signing mode by position.
Signatures [][]byte `protobuf:"bytes,3,rep,name=signatures,proto3" json:"signatures,omitempty"`
}
@ -164,9 +169,11 @@ func (m *TxRaw) GetSignatures() [][]byte {
// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT.
type SignDoc struct {
// body_bytes is protobuf serialization of a TxBody that matches the representation in TxRaw.
// body_bytes is protobuf serialization of a TxBody that matches the
// representation in TxRaw.
BodyBytes []byte `protobuf:"bytes,1,opt,name=body_bytes,json=bodyBytes,proto3" json:"body_bytes,omitempty"`
// auth_info_bytes is a protobuf serialization of an AuthInfo that matches the representation in TxRaw.
// auth_info_bytes is a protobuf serialization of an AuthInfo that matches the
// representation in TxRaw.
AuthInfoBytes []byte `protobuf:"bytes,2,opt,name=auth_info_bytes,json=authInfoBytes,proto3" json:"auth_info_bytes,omitempty"`
// chain_id is the unique identifier of the chain this transaction targets.
// It prevents signed transactions from being used on another chain by an
@ -239,12 +246,14 @@ func (m *SignDoc) GetAccountNumber() uint64 {
// TxBody is the body of a transaction that all signers sign over.
type TxBody struct {
// messages is a list of messages to be executed. The required signers of those messages define
// the number and order of elements in AuthInfo's signer_infos and Tx's signatures.
// Each required signer address is added to the list only the first time it occurs.
// messages is a list of messages to be executed. The required signers of
// those messages define the number and order of elements in AuthInfo's
// signer_infos and Tx's signatures. Each required signer address is added to
// the list only the first time it occurs.
//
// By convention, the first required signer (usually from the first message) is referred
// to as the primary signer and pays the fee for the whole transaction.
// By convention, the first required signer (usually from the first message)
// is referred to as the primary signer and pays the fee for the whole
// transaction.
Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
// memo is any arbitrary memo to be added to the transaction
Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"`
@ -329,11 +338,13 @@ func (m *TxBody) GetNonCriticalExtensionOptions() []*types.Any {
return nil
}
// AuthInfo describes the fee and signer modes that are used to sign a transaction.
// AuthInfo describes the fee and signer modes that are used to sign a
// transaction.
type AuthInfo struct {
// signer_infos defines the signing modes for the required signers. The number
// and order of elements must match the required signers from TxBody's messages.
// The first element is the primary signer and the one which pays the fee.
// and order of elements must match the required signers from TxBody's
// messages. The first element is the primary signer and the one which pays
// the fee.
SignerInfos []*SignerInfo `protobuf:"bytes,1,rep,name=signer_infos,json=signerInfos,proto3" json:"signer_infos,omitempty"`
// Fee is the fee and gas limit for the transaction. The first signer is the
// primary signer and the one which pays the fee. The fee can be calculated
@ -389,7 +400,8 @@ func (m *AuthInfo) GetFee() *Fee {
return nil
}
// SignerInfo describes the public key and signing mode of a single top-level signer.
// SignerInfo describes the public key and signing mode of a single top-level
// signer.
type SignerInfo struct {
// public_key is the public key of the signer. It is optional for accounts
// that already exist in state. If unset, the verifier can use the required \
@ -399,8 +411,8 @@ type SignerInfo struct {
// structure to support nested multisig pubkey's
ModeInfo *ModeInfo `protobuf:"bytes,2,opt,name=mode_info,json=modeInfo,proto3" json:"mode_info,omitempty"`
// sequence is the sequence of the account, which describes the
// number of committed transactions signed by a given address. It is used to prevent
// replay attacks.
// number of committed transactions signed by a given address. It is used to
// prevent replay attacks.
Sequence uint64 `protobuf:"varint,3,opt,name=sequence,proto3" json:"sequence,omitempty"`
}
@ -548,7 +560,8 @@ func (*ModeInfo) XXX_OneofWrappers() []interface{} {
}
// Single is the mode info for a single signer. It is structured as a message
// to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the future
// to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the
// future
type ModeInfo_Single struct {
// mode is the signing mode of the single signer
Mode signing.SignMode `protobuf:"varint,1,opt,name=mode,proto3,enum=cosmos.tx.signing.v1beta1.SignMode" json:"mode,omitempty"`

View File

@ -93,7 +93,7 @@ func GetAccountCmd() *cobra.Command {
}
queryClient := types.NewQueryClient(clientCtx)
res, err := queryClient.Account(context.Background(), &types.QueryAccountRequest{Address: key})
res, err := queryClient.Account(context.Background(), &types.QueryAccountRequest{Address: key.String()})
if err != nil {
return err
}

View File

@ -2,9 +2,10 @@ package rest_test
import (
"fmt"
"strings"
"testing"
"strings"
"github.com/stretchr/testify/suite"
"github.com/cosmos/cosmos-sdk/client/tx"
@ -14,6 +15,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/rest"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
authclient "github.com/cosmos/cosmos-sdk/x/auth/client"
rest2 "github.com/cosmos/cosmos-sdk/x/auth/client/rest"
"github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx"
"github.com/cosmos/cosmos-sdk/x/bank/types"
@ -182,8 +184,8 @@ func (s *IntegrationTestSuite) createTestStdTx(val *network.Validator, sequence
txConfig := legacytx.StdTxConfig{Cdc: s.cfg.LegacyAmino}
msg := &types.MsgSend{
FromAddress: val.Address,
ToAddress: val.Address,
FromAddress: val.Address.String(),
ToAddress: val.Address.String(),
Amount: sdk.Coins{sdk.NewInt64Coin(fmt.Sprintf("%stoken", val.Moniker), 100)},
}

View File

@ -19,12 +19,17 @@ func (ak AccountKeeper) Account(c context.Context, req *types.QueryAccountReques
return nil, status.Errorf(codes.InvalidArgument, "empty request")
}
if req.Address.Empty() {
if req.Address == "" {
return nil, status.Error(codes.InvalidArgument, "Address cannot be empty")
}
ctx := sdk.UnwrapSDKContext(c)
account := ak.GetAccount(ctx, req.Address)
addr, err := sdk.AccAddressFromBech32(req.Address)
if err != nil {
return nil, err
}
account := ak.GetAccount(ctx, addr)
if account == nil {
return nil, status.Errorf(codes.NotFound, "account %s not found", req.Address)
}

View File

@ -31,7 +31,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryAccount() {
{
"invalid request",
func() {
req = &types.QueryAccountRequest{Address: []byte("")}
req = &types.QueryAccountRequest{Address: ""}
},
false,
func(res *types.QueryAccountResponse) {},
@ -39,7 +39,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryAccount() {
{
"invalid request with empty byte array",
func() {
req = &types.QueryAccountRequest{Address: []byte{}}
req = &types.QueryAccountRequest{Address: ""}
},
false,
func(res *types.QueryAccountResponse) {},
@ -47,7 +47,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryAccount() {
{
"account not found",
func() {
req = &types.QueryAccountRequest{Address: addr}
req = &types.QueryAccountRequest{Address: addr.String()}
},
false,
func(res *types.QueryAccountResponse) {},
@ -57,7 +57,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryAccount() {
func() {
suite.app.AccountKeeper.SetAccount(suite.ctx,
suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, addr))
req = &types.QueryAccountRequest{Address: addr}
req = &types.QueryAccountRequest{Address: addr.String()}
},
true,
func(res *types.QueryAccountResponse) {

View File

@ -47,7 +47,7 @@ func TestKeeperTestSuite(t *testing.T) {
func TestAccountMapperGetSet(t *testing.T) {
app, ctx := createTestApp(true)
addr := sdk.AccAddress([]byte("some-address"))
addr := sdk.AccAddress([]byte("some---------address"))
// no account before its created
acc := app.AccountKeeper.GetAccount(ctx, addr)
@ -77,8 +77,8 @@ func TestAccountMapperGetSet(t *testing.T) {
func TestAccountMapperRemoveAccount(t *testing.T) {
app, ctx := createTestApp(true)
addr1 := sdk.AccAddress([]byte("addr1"))
addr2 := sdk.AccAddress([]byte("addr2"))
addr1 := sdk.AccAddress([]byte("addr1---------------"))
addr2 := sdk.AccAddress([]byte("addr2---------------"))
// create accounts
acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1)

View File

@ -31,7 +31,12 @@ func queryAccount(ctx sdk.Context, req abci.RequestQuery, k AccountKeeper, legac
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())
}
account := k.GetAccount(ctx, params.Address)
addr, err := sdk.AccAddressFromBech32(params.Address)
if err != nil {
return nil, err
}
account := k.GetAccount(ctx, addr)
if account == nil {
return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownAddress, "account %s does not exist", params.Address)
}

View File

@ -39,13 +39,13 @@ func TestQueryAccount(t *testing.T) {
require.Error(t, err)
require.Nil(t, res)
req.Data = legacyQuerierCdc.MustMarshalJSON(&types.QueryAccountRequest{Address: []byte("")})
req.Data = legacyQuerierCdc.MustMarshalJSON(&types.QueryAccountRequest{Address: ""})
res, err = querier(ctx, path, req)
require.Error(t, err)
require.Nil(t, res)
_, _, addr := testdata.KeyTestPubAddr()
req.Data = legacyQuerierCdc.MustMarshalJSON(&types.QueryAccountRequest{Address: addr})
req.Data = legacyQuerierCdc.MustMarshalJSON(&types.QueryAccountRequest{Address: addr.String()})
res, err = querier(ctx, path, req)
require.Error(t, err)
require.Nil(t, res)

View File

@ -37,8 +37,8 @@ func TestHandlerMap_GetSignBytes(t *testing.T) {
memo := "foo"
msgs := []sdk.Msg{
&banktypes.MsgSend{
FromAddress: addr1,
ToAddress: addr2,
FromAddress: addr1.String(),
ToAddress: addr2.String(),
Amount: coins,
},
}

View File

@ -8,9 +8,8 @@ import (
"strings"
"github.com/gogo/protobuf/proto"
"github.com/tendermint/tendermint/crypto"
yaml "gopkg.in/yaml.v2"
"gopkg.in/yaml.v2"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
@ -26,9 +25,10 @@ var (
)
// NewBaseAccount creates a new BaseAccount object
//nolint:interfacer
func NewBaseAccount(address sdk.AccAddress, pubKey crypto.PubKey, accountNumber, sequence uint64) *BaseAccount {
acc := &BaseAccount{
Address: address,
Address: address.String(),
AccountNumber: accountNumber,
Sequence: sequence,
}
@ -49,13 +49,14 @@ func ProtoBaseAccount() AccountI {
// NewBaseAccountWithAddress - returns a new base account with a given address
func NewBaseAccountWithAddress(addr sdk.AccAddress) *BaseAccount {
return &BaseAccount{
Address: addr,
Address: addr.String(),
}
}
// GetAddress - Implements sdk.AccountI.
func (acc BaseAccount) GetAddress() sdk.AccAddress {
return acc.Address
addr, _ := sdk.AccAddressFromBech32(acc.Address)
return addr
}
// SetAddress - Implements sdk.AccountI.
@ -64,7 +65,7 @@ func (acc *BaseAccount) SetAddress(addr sdk.AccAddress) error {
return errors.New("cannot override BaseAccount address")
}
acc.Address = addr
acc.Address = addr.String()
return nil
}
@ -125,8 +126,16 @@ func (acc *BaseAccount) SetSequence(seq uint64) error {
// Validate checks for errors on the account fields
func (acc BaseAccount) Validate() error {
if acc.PubKey != nil && acc.Address != nil &&
!bytes.Equal(acc.GetPubKey().Address().Bytes(), acc.Address.Bytes()) {
if acc.Address == "" || acc.PubKey == nil {
return nil
}
accAddr, err := sdk.AccAddressFromBech32(acc.Address)
if err != nil {
return err
}
if !bytes.Equal(acc.GetPubKey().Address().Bytes(), accAddr.Bytes()) {
return errors.New("account address and pubkey address do not match")
}
@ -226,7 +235,7 @@ func (ma ModuleAccount) Validate() error {
return errors.New("module account name cannot be blank")
}
if !ma.Address.Equals(sdk.AccAddress(crypto.AddressHash([]byte(ma.Name)))) {
if ma.Address != sdk.AccAddress(crypto.AddressHash([]byte(ma.Name))).String() {
return fmt.Errorf("address %s cannot be derived from the module name '%s'", ma.Address, ma.Name)
}
@ -249,8 +258,13 @@ func (ma ModuleAccount) String() string {
// MarshalYAML returns the YAML representation of a ModuleAccount.
func (ma ModuleAccount) MarshalYAML() (interface{}, error) {
accAddr, err := sdk.AccAddressFromBech32(ma.Address)
if err != nil {
return nil, err
}
bs, err := yaml.Marshal(moduleAccountPretty{
Address: ma.Address,
Address: accAddr,
PubKey: "",
AccountNumber: ma.AccountNumber,
Sequence: ma.Sequence,
@ -267,8 +281,13 @@ func (ma ModuleAccount) MarshalYAML() (interface{}, error) {
// MarshalJSON returns the JSON representation of a ModuleAccount.
func (ma ModuleAccount) MarshalJSON() ([]byte, error) {
accAddr, err := sdk.AccAddressFromBech32(ma.Address)
if err != nil {
return nil, err
}
return json.Marshal(moduleAccountPretty{
Address: ma.Address,
Address: accAddr,
PubKey: "",
AccountNumber: ma.AccountNumber,
Sequence: ma.Sequence,

View File

@ -27,11 +27,12 @@ func (ar AccountRetriever) GetAccount(clientCtx client.Context, addr sdk.AccAddr
// GetAccountWithHeight queries for an account given an address. Returns the
// 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) {
var header metadata.MD
queryClient := NewQueryClient(clientCtx)
res, err := queryClient.Account(context.Background(), &QueryAccountRequest{Address: addr}, grpc.Header(&header))
res, err := queryClient.Account(context.Background(), &QueryAccountRequest{Address: addr.String()}, grpc.Header(&header))
if err != nil {
return nil, 0, err
}

View File

@ -6,7 +6,6 @@ package types
import (
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
_ "github.com/regen-network/cosmos-proto"
@ -30,10 +29,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// for basic account functionality. Any custom account type should extend this
// type for additional functionality (e.g. vesting).
type BaseAccount struct {
Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty"`
PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"public_key,omitempty" yaml:"public_key"`
AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty" yaml:"account_number"`
Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"`
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"public_key,omitempty" yaml:"public_key"`
AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty" yaml:"account_number"`
Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"`
}
func (m *BaseAccount) Reset() { *m = BaseAccount{} }
@ -192,50 +191,50 @@ func init() {
func init() { proto.RegisterFile("cosmos/auth/v1beta1/auth.proto", fileDescriptor_7e1f7e915d020d2d) }
var fileDescriptor_7e1f7e915d020d2d = []byte{
// 687 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x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0xe1, 0x66,
0x7b, 0x98, 0xa8, 0xa5, 0x63, 0xdf, 0x7b, 0xc5, 0x15, 0x69, 0xea, 0x8b, 0xe7, 0x9c, 0x1f, 0x25,
0xaa, 0x22, 0xba, 0xfd, 0xa5, 0x80, 0x6e, 0x95, 0xe8, 0x54, 0x9e, 0x80, 0xe5, 0x18, 0x54, 0xee,
0x67, 0x50, 0xe4, 0x06, 0xad, 0xed, 0x27, 0x67, 0xcd, 0xf2, 0x7f, 0xbc, 0xe9, 0xd3, 0x61, 0xa2,
0x6e, 0x4e, 0x35, 0x3d, 0xbe, 0x55, 0x8c, 0x12, 0x55, 0x9b, 0xdd, 0x76, 0x5c, 0x44, 0xb7, 0x36,
0xe9, 0xcc, 0xdc, 0xf6, 0x62, 0xba, 0xef, 0x9f, 0x57, 0xaa, 0x64, 0xee, 0x7e, 0x19, 0x2a, 0xd2,
0xf5, 0x50, 0x91, 0x7e, 0x0c, 0x15, 0xe9, 0xfd, 0x8d, 0x92, 0xbb, 0xbe, 0x51, 0x72, 0xdf, 0x6e,
0x94, 0xdc, 0xeb, 0x87, 0xff, 0xbc, 0xe5, 0x81, 0xf8, 0x12, 0xf1, 0x93, 0x76, 0xe6, 0xf9, 0x95,
0x3e, 0xfe, 0x13, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x49, 0xdd, 0xa9, 0xa5, 0x04, 0x00, 0x00,
// 674 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0x4d, 0x4f, 0xdb, 0x4a,
0x14, 0x8d, 0x5f, 0xf2, 0xf8, 0x98, 0x00, 0x12, 0x26, 0x80, 0x93, 0xf7, 0x64, 0x5b, 0x5e, 0xe5,
0x49, 0x2f, 0x8e, 0x92, 0x8a, 0x4a, 0x64, 0x51, 0x15, 0xd3, 0x2e, 0x50, 0x0b, 0x42, 0x46, 0xea,
0xa2, 0xaa, 0xe4, 0x8e, 0x9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x94, 0xff, 0x67, 0x25, 0x6b,
0xff, 0xcb, 0x50, 0x95, 0x6e, 0x87, 0xaa, 0xf4, 0x7d, 0xa8, 0x4a, 0x1f, 0xef, 0xd5, 0xc2, 0xed,
0xbd, 0x5a, 0xf8, 0x7a, 0xaf, 0x16, 0xde, 0xfe, 0xe7, 0x07, 0xec, 0x2c, 0x76, 0x4d, 0x8f, 0xe0,
0xfc, 0x2d, 0xc8, 0x7f, 0x1a, 0xb4, 0x7b, 0xde, 0x1c, 0x88, 0xa7, 0x85, 0x25, 0x21, 0xa2, 0xee,
0x02, 0xff, 0x52, 0x9f, 0xfc, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x49, 0x90, 0x16, 0xd9, 0x76, 0x04,
0x00, 0x00,
}
func (this *Params) Equal(that interface{}) bool {
@ -545,7 +544,7 @@ func (m *BaseAccount) Unmarshal(dAtA []byte) error {
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
}
var byteLen int
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAuth
@ -555,25 +554,23 @@ func (m *BaseAccount) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthAuth
}
postIndex := iNdEx + byteLen
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthAuth
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...)
if m.Address == nil {
m.Address = []byte{}
}
m.Address = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {

View File

@ -7,7 +7,6 @@ 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"
_ "github.com/gogo/protobuf/gogoproto"
grpc1 "github.com/gogo/protobuf/grpc"
proto "github.com/gogo/protobuf/proto"
@ -35,7 +34,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// QueryAccountRequest is the request type for the Query/Account RPC method.
type QueryAccountRequest struct {
// address defines the address to query for.
Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty"`
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
}
func (m *QueryAccountRequest) Reset() { *m = QueryAccountRequest{} }
@ -71,13 +70,6 @@ func (m *QueryAccountRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryAccountRequest proto.InternalMessageInfo
func (m *QueryAccountRequest) GetAddress() github_com_cosmos_cosmos_sdk_types.AccAddress {
if m != nil {
return m.Address
}
return nil
}
// QueryAccountResponse is the response type for the Query/Account RPC method.
type QueryAccountResponse struct {
// account defines the account of the corresponding address.
@ -217,34 +209,34 @@ func init() {
func init() { proto.RegisterFile("cosmos/auth/v1beta1/query.proto", fileDescriptor_c451370b3929a27c) }
var fileDescriptor_c451370b3929a27c = []byte{
// 428 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xbd, 0xce, 0xd3, 0x30,
0x14, 0x4d, 0x2a, 0x68, 0x91, 0xe9, 0xe4, 0x66, 0x80, 0x14, 0x52, 0x14, 0x86, 0xb6, 0x43, 0x6d,
0xb5, 0x4c, 0x48, 0x2c, 0x09, 0x13, 0x62, 0x29, 0x11, 0x13, 0x0b, 0x72, 0x52, 0x93, 0x56, 0xd0,
0x38, 0x8d, 0x1d, 0x44, 0x85, 0x90, 0x10, 0x2f, 0x00, 0x12, 0x2b, 0x8f, 0xc1, 0x43, 0x54, 0x4c,
0x95, 0x58, 0x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3, 0x64, 0xeb, 0x18, 0xeb, 0xad, 0x63, 0x5c, 0x6d, 0x1d, 0xe3, 0x7b, 0x3b,
0x9a, 0x8a, 0x49, 0x16, 0xa0, 0x90, 0xcd, 0xf2, 0x00, 0xf5, 0xd3, 0xe1, 0xe3, 0x5f, 0xf8, 0xaf,
0x4a, 0x13, 0x8b, 0x84, 0xf2, 0xa0, 0x2c, 0x1f, 0xfc, 0xc3, 0x7d, 0x00, 0x00, 0x00, 0xff, 0xff,
0xef, 0x40, 0xd8, 0x2e, 0x25, 0x03, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -584,7 +576,7 @@ func (m *QueryAccountRequest) Unmarshal(dAtA []byte) error {
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
}
var byteLen int
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
@ -594,25 +586,23 @@ func (m *QueryAccountRequest) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthQuery
}
postIndex := iNdEx + byteLen
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthQuery
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...)
if m.Address == nil {
m.Address = []byte{}
}
m.Address = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex

View File

@ -47,7 +47,7 @@ func request_Query_Account_0(ctx context.Context, marshaler runtime.Marshaler, c
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address")
}
protoReq.Address, err = runtime.Bytes(val)
protoReq.Address, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
@ -74,7 +74,7 @@ func local_request_Query_Account_0(ctx context.Context, marshaler runtime.Marsha
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address")
}
protoReq.Address, err = runtime.Bytes(val)
protoReq.Address, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)

View File

@ -31,15 +31,24 @@ func handleMsgCreateVestingAccount(ctx sdk.Context, ak keeper.AccountKeeper, bk
return nil, err
}
if bk.BlockedAddr(msg.ToAddress) {
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, msg.ToAddress); acc != nil {
if acc := ak.GetAccount(ctx, to); acc != nil {
return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress)
}
baseAccount := ak.NewAccountWithAddress(ctx, 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)
}
@ -70,7 +79,7 @@ func handleMsgCreateVestingAccount(ctx sdk.Context, ak keeper.AccountKeeper, bk
}
}()
err := bk.SendCoins(ctx, msg.FromAddress, msg.ToAddress, msg.Amount)
err = bk.SendCoins(ctx, from, to, msg.Amount)
if err != nil {
return nil, err
}

View File

@ -31,9 +31,9 @@ func (suite *HandlerTestSuite) TestMsgCreateVestingAccount() {
ctx := suite.app.BaseApp.NewContext(false, tmproto.Header{Height: suite.app.LastBlockHeight() + 1})
balances := sdk.NewCoins(sdk.NewInt64Coin("test", 1000))
addr1 := sdk.AccAddress([]byte("addr1"))
addr2 := sdk.AccAddress([]byte("addr2"))
addr3 := sdk.AccAddress([]byte("addr3"))
addr1 := sdk.AccAddress([]byte("addr1_______________"))
addr2 := sdk.AccAddress([]byte("addr2_______________"))
addr3 := sdk.AccAddress([]byte("addr3_______________"))
acc1 := suite.app.AccountKeeper.NewAccountWithAddress(ctx, addr1)
suite.app.AccountKeeper.SetAccount(ctx, acc1)
@ -72,7 +72,9 @@ func (suite *HandlerTestSuite) TestMsgCreateVestingAccount() {
suite.Require().NoError(err)
suite.Require().NotNil(res)
accI := suite.app.AccountKeeper.GetAccount(ctx, tc.msg.ToAddress)
toAddr, err := sdk.AccAddressFromBech32(tc.msg.ToAddress)
suite.Require().NoError(err)
accI := suite.app.AccountKeeper.GetAccount(ctx, toAddr)
suite.Require().NotNil(accI)
if tc.msg.Delayed {

View File

@ -11,10 +11,11 @@ const TypeMsgCreateVestingAccount = "msg_create_vesting_account"
var _ sdk.Msg = &MsgCreateVestingAccount{}
// NewMsgCreateVestingAccount returns a reference to a new MsgCreateVestingAccount.
//nolint:interfacer
func NewMsgCreateVestingAccount(fromAddr, toAddr sdk.AccAddress, amount sdk.Coins, endTime int64, delayed bool) *MsgCreateVestingAccount {
return &MsgCreateVestingAccount{
FromAddress: fromAddr,
ToAddress: toAddr,
FromAddress: fromAddr.String(),
ToAddress: toAddr.String(),
Amount: amount,
EndTime: endTime,
Delayed: delayed,
@ -29,11 +30,19 @@ func (msg MsgCreateVestingAccount) Type() string { return TypeMsgCreateVestingAc
// ValidateBasic Implements Msg.
func (msg MsgCreateVestingAccount) ValidateBasic() error {
if err := sdk.VerifyAddressFormat(msg.FromAddress); err != nil {
from, err := sdk.AccAddressFromBech32(msg.FromAddress)
if err != nil {
return err
}
to, err := sdk.AccAddressFromBech32(msg.ToAddress)
if err != nil {
return err
}
if err := sdk.VerifyAddressFormat(from); err != nil {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address: %s", err)
}
if err := sdk.VerifyAddressFormat(msg.ToAddress); err != nil {
if err := sdk.VerifyAddressFormat(to); err != nil {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid recipient address: %s", err)
}
@ -60,5 +69,9 @@ func (msg MsgCreateVestingAccount) GetSignBytes() []byte {
// GetSigners returns the expected signers for a MsgCreateVestingAccount.
func (msg MsgCreateVestingAccount) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{msg.FromAddress}
from, err := sdk.AccAddressFromBech32(msg.FromAddress)
if err != nil {
panic(err)
}
return []sdk.AccAddress{from}
}

View File

@ -4,7 +4,6 @@
package types
import (
bytes "bytes"
fmt "fmt"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
types "github.com/cosmos/cosmos-sdk/types"
@ -29,11 +28,11 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// MsgCreateVestingAccount defines a message that enables creating a vesting
// account.
type MsgCreateVestingAccount struct {
FromAddress github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"from_address,omitempty" yaml:"from_address"`
ToAddress github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"to_address,omitempty" yaml:"to_address"`
Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
EndTime int64 `protobuf:"varint,4,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty" yaml:"end_time"`
Delayed bool `protobuf:"varint,5,opt,name=delayed,proto3" json:"delayed,omitempty"`
FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty" yaml:"from_address"`
ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty" yaml:"to_address"`
Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
EndTime int64 `protobuf:"varint,4,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty" yaml:"end_time"`
Delayed bool `protobuf:"varint,5,opt,name=delayed,proto3" json:"delayed,omitempty"`
}
func (m *MsgCreateVestingAccount) Reset() { *m = MsgCreateVestingAccount{} }
@ -69,18 +68,18 @@ func (m *MsgCreateVestingAccount) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgCreateVestingAccount proto.InternalMessageInfo
func (m *MsgCreateVestingAccount) GetFromAddress() github_com_cosmos_cosmos_sdk_types.AccAddress {
func (m *MsgCreateVestingAccount) GetFromAddress() string {
if m != nil {
return m.FromAddress
}
return nil
return ""
}
func (m *MsgCreateVestingAccount) GetToAddress() github_com_cosmos_cosmos_sdk_types.AccAddress {
func (m *MsgCreateVestingAccount) GetToAddress() string {
if m != nil {
return m.ToAddress
}
return nil
return ""
}
func (m *MsgCreateVestingAccount) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins {
@ -111,32 +110,30 @@ func init() {
func init() { proto.RegisterFile("cosmos/vesting/v1beta1/tx.proto", fileDescriptor_5338ca97811f9792) }
var fileDescriptor_5338ca97811f9792 = []byte{
// 385 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0xcf, 0xd2, 0x40,
0x18, 0xc7, 0x7b, 0x16, 0x01, 0x0f, 0x12, 0x63, 0x31, 0x5a, 0x19, 0x7a, 0x4d, 0xa7, 0x2e, 0x5c,
0x45, 0x37, 0x36, 0x4a, 0x62, 0x4c, 0x8c, 0x4b, 0x63, 0x1c, 0x5c, 0xc8, 0xf5, 0x7a, 0x96, 0x06,
0xda, 0x23, 0xbd, 0x83, 0xc0, 0xb7, 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c9,
0x1b, 0x0c, 0x85, 0x6d, 0x92, 0x96, 0xdb, 0x99, 0xba, 0xad, 0xbb, 0xbd, 0x37, 0xaf, 0x70, 0x7d,
0xce, 0xf2, 0x40, 0xcd, 0x2d, 0xf1, 0x8c, 0x27, 0x99, 0xff, 0xfa, 0x50, 0x20, 0xed, 0xe7, 0x6f,
0xe4, 0xde, 0x03, 0x56, 0x36, 0x88, 0xa0, 0x8e, 0x36, 0x30, 0xec, 0xb2, 0x2c, 0x9a, 0xcb, 0x24,
0x65, 0x66, 0xcb, 0x06, 0xae, 0xee, 0x0f, 0x2e, 0x05, 0x7a, 0xaa, 0x36, 0x69, 0x14, 0x27, 0xe8,
0xb0, 0x2c, 0xfa, 0x94, 0xa4, 0xcc, 0x30, 0x61, 0x27, 0x62, 0x2b, 0xb2, 0x67, 0x91, 0xf9, 0xd8,
0x06, 0x6e, 0x37, 0x68, 0xca, 0x49, 0xeb, 0xef, 0x77, 0x04, 0xfc, 0x0f, 0x87, 0x93, 0x05, 0x8e,
0x27, 0x0b, 0xfc, 0x39, 0x59, 0xe0, 0xdb, 0xd9, 0xd2, 0x8e, 0x67, 0x4b, 0xfb, 0x75, 0xb6, 0xb4,
0x2f, 0xe3, 0x3b, 0x67, 0xdb, 0x79, 0x64, 0x23, 0x17, 0xd7, 0x5f, 0xa9, 0x1a, 0x35, 0x6c, 0x57,
0x1f, 0xfe, 0xed, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x00, 0x09, 0x49, 0x69, 0x02, 0x00,
0x00,
// 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,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 0xd8, 0xac,
0x7e, 0xb9, 0xd4, 0x1a, 0xd1, 0x28, 0x76, 0xce, 0xd7, 0xa9, 0x26, 0xbd, 0xbc, 0x6b, 0x66, 0x18,
0xf1, 0xc9, 0xdc, 0xb3, 0x7c, 0x4a, 0xec, 0x62, 0xab, 0xf8, 0x9c, 0xb1, 0xe0, 0xd1, 0xe6, 0xab,
0x19, 0x66, 0xb9, 0x81, 0xb9, 0x45, 0xb4, 0x6c, 0xc1, 0x26, 0x8e, 0x83, 0x31, 0x8f, 0x08, 0x56,
0x6a, 0x3a, 0x30, 0xab, 0x4e, 0x67, 0x9f, 0x6a, 0xff, 0x44, 0xb1, 0x92, 0x31, 0xdc, 0x06, 0x8e,
0x83, 0xdb, 0x88, 0x60, 0x59, 0x81, 0x8d, 0x00, 0x4f, 0xd1, 0x0a, 0x07, 0xca, 0x1f, 0x1d, 0x98,
0x4d, 0xb7, 0x84, 0x83, 0xda, 0xe7, 0xb3, 0x06, 0x9c, 0xeb, 0xf5, 0x56, 0x05, 0x9b, 0xad, 0x0a,
0x3e, 0xb6, 0x2a, 0x78, 0xda, 0xa9, 0xd2, 0x66, 0xa7, 0x4a, 0x6f, 0x3b, 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,
}
func (this *MsgCreateVestingAccount) Equal(that interface{}) bool {
@ -158,10 +155,10 @@ func (this *MsgCreateVestingAccount) Equal(that interface{}) bool {
} else if this == nil {
return false
}
if !bytes.Equal(this.FromAddress, that1.FromAddress) {
if this.FromAddress != that1.FromAddress {
return false
}
if !bytes.Equal(this.ToAddress, that1.ToAddress) {
if this.ToAddress != that1.ToAddress {
return false
}
if len(this.Amount) != len(that1.Amount) {
@ -325,7 +322,7 @@ func (m *MsgCreateVestingAccount) Unmarshal(dAtA []byte) error {
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", wireType)
}
var byteLen int
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
@ -335,31 +332,29 @@ func (m *MsgCreateVestingAccount) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + byteLen
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.FromAddress = append(m.FromAddress[:0], dAtA[iNdEx:postIndex]...)
if m.FromAddress == nil {
m.FromAddress = []byte{}
}
m.FromAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", wireType)
}
var byteLen int
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
@ -369,25 +364,23 @@ func (m *MsgCreateVestingAccount) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + byteLen
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ToAddress = append(m.ToAddress[:0], dAtA[iNdEx:postIndex]...)
if m.ToAddress == nil {
m.ToAddress = []byte{}
}
m.ToAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {

View File

@ -183,8 +183,13 @@ func (bva BaseVestingAccount) String() string {
// MarshalYAML returns the YAML representation of a BaseVestingAccount.
func (bva BaseVestingAccount) MarshalYAML() (interface{}, error) {
accAddr, err := sdk.AccAddressFromBech32(bva.Address)
if err != nil {
return nil, err
}
alias := vestingAccountYAML{
Address: bva.Address,
Address: accAddr,
AccountNumber: bva.AccountNumber,
Sequence: bva.Sequence,
OriginalVesting: bva.OriginalVesting,
@ -306,8 +311,13 @@ func (cva ContinuousVestingAccount) String() string {
// MarshalYAML returns the YAML representation of a ContinuousVestingAccount.
func (cva ContinuousVestingAccount) MarshalYAML() (interface{}, error) {
accAddr, err := sdk.AccAddressFromBech32(cva.Address)
if err != nil {
return nil, err
}
alias := vestingAccountYAML{
Address: cva.Address,
Address: accAddr,
AccountNumber: cva.AccountNumber,
Sequence: cva.Sequence,
OriginalVesting: cva.OriginalVesting,
@ -459,8 +469,13 @@ func (pva PeriodicVestingAccount) String() string {
// MarshalYAML returns the YAML representation of a PeriodicVestingAccount.
func (pva PeriodicVestingAccount) MarshalYAML() (interface{}, error) {
accAddr, err := sdk.AccAddressFromBech32(pva.Address)
if err != nil {
return nil, err
}
alias := vestingAccountYAML{
Address: pva.Address,
Address: accAddr,
AccountNumber: pva.AccountNumber,
Sequence: pva.Sequence,
OriginalVesting: pva.OriginalVesting,

View File

@ -88,7 +88,7 @@ var (
func TestSendNotEnoughBalance(t *testing.T) {
acc := &authtypes.BaseAccount{
Address: addr1,
Address: addr1.String(),
}
genAccs := []authtypes.GenesisAccount{acc}
@ -164,12 +164,17 @@ func TestSendToModuleAcc(t *testing.T) {
app := simapp.SetupWithGenesisAccounts(genAccs)
ctx := app.BaseApp.NewContext(false, tmproto.Header{})
err := app.BankKeeper.SetBalances(ctx, test.msg.FromAddress, test.fromBalance)
fromAddr, err := sdk.AccAddressFromBech32(test.msg.FromAddress)
require.NoError(t, err)
toAddr, err := sdk.AccAddressFromBech32(test.msg.ToAddress)
require.NoError(t, err)
err = app.BankKeeper.SetBalances(ctx, fromAddr, test.fromBalance)
require.NoError(t, err)
app.Commit()
res1 := app.AccountKeeper.GetAccount(ctx, test.msg.FromAddress)
res1 := app.AccountKeeper.GetAccount(ctx, fromAddr)
require.NotNil(t, res1)
require.Equal(t, acc, res1.(*authtypes.BaseAccount))
@ -185,8 +190,8 @@ func TestSendToModuleAcc(t *testing.T) {
require.Error(t, err)
}
simapp.CheckBalance(t, app, test.msg.FromAddress, test.expFromBalance)
simapp.CheckBalance(t, app, test.msg.ToAddress, test.expToBalance)
simapp.CheckBalance(t, app, fromAddr, test.expFromBalance)
simapp.CheckBalance(t, app, toAddr, test.expToBalance)
res2 := app.AccountKeeper.GetAccount(app.NewContext(true, tmproto.Header{}), addr1)
require.NotNil(t, res2)
@ -199,7 +204,7 @@ func TestSendToModuleAcc(t *testing.T) {
func TestMsgMultiSendWithAccounts(t *testing.T) {
acc := &authtypes.BaseAccount{
Address: addr1,
Address: addr1.String(),
}
genAccs := []authtypes.GenesisAccount{acc}
@ -267,10 +272,10 @@ func TestMsgMultiSendWithAccounts(t *testing.T) {
func TestMsgMultiSendMultipleOut(t *testing.T) {
acc1 := &authtypes.BaseAccount{
Address: addr1,
Address: addr1.String(),
}
acc2 := &authtypes.BaseAccount{
Address: addr2,
Address: addr2.String(),
}
genAccs := []authtypes.GenesisAccount{acc1, acc2}
@ -315,13 +320,13 @@ func TestMsgMultiSendMultipleOut(t *testing.T) {
func TestMsgMultiSendMultipleInOut(t *testing.T) {
acc1 := &authtypes.BaseAccount{
Address: addr1,
Address: addr1.String(),
}
acc2 := &authtypes.BaseAccount{
Address: addr2,
Address: addr2.String(),
}
acc4 := &authtypes.BaseAccount{
Address: addr4,
Address: addr4.String(),
}
genAccs := []authtypes.GenesisAccount{acc1, acc2, acc4}

View File

@ -20,7 +20,7 @@ var moduleAccAddr = authtypes.NewModuleAddress(stakingtypes.BondedPoolName)
func BenchmarkOneBankSendTxPerBlock(b *testing.B) {
// Add an account at genesis
acc := authtypes.BaseAccount{
Address: addr1,
Address: addr1.String(),
}
// construct genesis state
@ -62,7 +62,7 @@ func BenchmarkOneBankSendTxPerBlock(b *testing.B) {
func BenchmarkOneBankMultiSendTxPerBlock(b *testing.B) {
// Add an account at genesis
acc := authtypes.BaseAccount{
Address: addr1,
Address: addr1.String(),
}
// Construct genesis state

View File

@ -3,7 +3,6 @@
package rest_test
import (
"encoding/base64"
"fmt"
"github.com/gogo/protobuf/proto"
@ -103,10 +102,6 @@ func (s *IntegrationTestSuite) TestBalancesGRPCHandler() {
val := s.network.Validators[0]
baseURL := val.APIAddress
// TODO: need to pass bech32 string instead of base64 encoding string.
// ref: https://github.com/cosmos/cosmos-sdk/issues/7195
accAddrBase64 := base64.URLEncoding.EncodeToString(val.Address)
testCases := []struct {
name string
url string
@ -115,7 +110,7 @@ func (s *IntegrationTestSuite) TestBalancesGRPCHandler() {
}{
{
"gRPC total account balance",
fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", baseURL, accAddrBase64),
fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", baseURL, val.Address.String()),
&types.QueryAllBalancesResponse{},
&types.QueryAllBalancesResponse{
Balances: sdk.NewCoins(
@ -129,7 +124,7 @@ func (s *IntegrationTestSuite) TestBalancesGRPCHandler() {
},
{
"gPRC account balance of a denom",
fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s/%s", baseURL, accAddrBase64, s.cfg.BondDenom),
fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s/%s", baseURL, val.Address.String(), s.cfg.BondDenom),
&types.QueryBalanceResponse{},
&types.QueryBalanceResponse{
Balance: &sdk.Coin{
@ -140,7 +135,7 @@ func (s *IntegrationTestSuite) TestBalancesGRPCHandler() {
},
{
"gPRC account balance of a bogus denom",
fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s/foobar", baseURL, accAddrBase64),
fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s/foobar", baseURL, val.Address.String()),
&types.QueryBalanceResponse{},
&types.QueryBalanceResponse{
Balance: &sdk.Coin{

View File

@ -37,8 +37,8 @@ func (s *IntegrationTestSuite) TestCoinSend() {
s.Require().Nil(stdTx.Signatures)
s.Require().Equal([]types.Msg{
&banktypes.MsgSend{
FromAddress: account.GetAddress(),
ToAddress: account.GetAddress(),
FromAddress: account.GetAddress().String(),
ToAddress: account.GetAddress().String(),
Amount: sendReq.Amount,
},
}, stdTx.GetMsgs())

View File

@ -34,11 +34,20 @@ func handleMsgSend(ctx sdk.Context, k keeper.Keeper, msg *types.MsgSend) (*sdk.R
return nil, err
}
if k.BlockedAddr(msg.ToAddress) {
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, msg.FromAddress, msg.ToAddress, msg.Amount)
err = k.SendCoins(ctx, from, to, msg.Amount)
if err != nil {
return nil, err
}
@ -73,7 +82,11 @@ func handleMsgMultiSend(ctx sdk.Context, k keeper.Keeper, msg *types.MsgMultiSen
}
for _, out := range msg.Outputs {
if k.BlockedAddr(out.Address) {
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)
}
}

View File

@ -15,11 +15,16 @@ func (k BaseKeeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) {
genState.Balances = types.SanitizeGenesisBalances(genState.Balances)
for _, balance := range genState.Balances {
if err := k.ValidateBalance(ctx, balance.Address); err != nil {
addr, err := sdk.AccAddressFromBech32(balance.Address)
if err != nil {
panic(err)
}
if err := k.SetBalances(ctx, balance.Address, balance.Coins); err != nil {
if err := k.ValidateBalance(ctx, addr); err != nil {
panic(err)
}
if err := k.SetBalances(ctx, addr, balance.Coins); err != nil {
panic(fmt.Errorf("error on setting balances %w", err))
}

View File

@ -12,7 +12,11 @@ func (suite *IntegrationTestSuite) TestExportGenesis() {
expectedBalances := suite.getTestBalances()
for i := range []int{1, 2} {
app.BankKeeper.SetDenomMetaData(ctx, expectedMetadata[i])
err := app.BankKeeper.SetBalances(ctx, expectedBalances[i].Address, expectedBalances[i].Coins)
accAddr, err1 := sdk.AccAddressFromBech32(expectedBalances[i].Address)
if err1 != nil {
panic(err1)
}
err := app.BankKeeper.SetBalances(ctx, accAddr, expectedBalances[i].Coins)
suite.Require().NoError(err)
}
@ -33,8 +37,8 @@ func (suite *IntegrationTestSuite) getTestBalances() []types.Balance {
addr2, _ := sdk.AccAddressFromBech32("cosmos1f9xjhxm0plzrh9cskf4qee4pc2xwp0n0556gh0")
addr1, _ := sdk.AccAddressFromBech32("cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh")
return []types.Balance{
{addr2, sdk.Coins{sdk.NewInt64Coin("testcoin1", 32), sdk.NewInt64Coin("testcoin2", 34)}},
{addr1, sdk.Coins{sdk.NewInt64Coin("testcoin3", 10)}},
{addr2.String(), sdk.Coins{sdk.NewInt64Coin("testcoin1", 32), sdk.NewInt64Coin("testcoin2", 34)}},
{addr1.String(), sdk.Coins{sdk.NewInt64Coin("testcoin3", 10)}},
}
}

View File

@ -20,7 +20,7 @@ func (k BaseKeeper) Balance(ctx context.Context, req *types.QueryBalanceRequest)
return nil, status.Error(codes.InvalidArgument, "empty request")
}
if req.Address.Empty() {
if req.Address == "" {
return nil, status.Error(codes.InvalidArgument, "address cannot be empty")
}
@ -29,7 +29,12 @@ func (k BaseKeeper) Balance(ctx context.Context, req *types.QueryBalanceRequest)
}
sdkCtx := sdk.UnwrapSDKContext(ctx)
balance := k.GetBalance(sdkCtx, req.Address, req.Denom)
address, err := sdk.AccAddressFromBech32(req.Address)
if err != nil {
return nil, err
}
balance := k.GetBalance(sdkCtx, address, req.Denom)
return &types.QueryBalanceResponse{Balance: &balance}, nil
}
@ -40,9 +45,9 @@ func (k BaseKeeper) AllBalances(ctx context.Context, req *types.QueryAllBalances
return nil, status.Error(codes.InvalidArgument, "empty request")
}
addr := req.Address
if addr.Empty() {
return nil, status.Errorf(codes.InvalidArgument, "address cannot be empty")
addr, err := sdk.AccAddressFromBech32(req.Address)
if err != nil {
return nil, err
}
sdkCtx := sdk.UnwrapSDKContext(ctx)

View File

@ -18,7 +18,7 @@ func (suite *IntegrationTestSuite) TestQueryBalance() {
_, err := queryClient.Balance(gocontext.Background(), &types.QueryBalanceRequest{})
suite.Require().Error(err)
_, err = queryClient.Balance(gocontext.Background(), &types.QueryBalanceRequest{Address: addr})
_, err = queryClient.Balance(gocontext.Background(), &types.QueryBalanceRequest{Address: addr.String()})
suite.Require().Error(err)
req := types.NewQueryBalanceRequest(addr, fooDenom)

View File

@ -271,7 +271,7 @@ func (suite *IntegrationTestSuite) TestSendCoinsNewAccount() {
app, ctx := suite.app, suite.ctx
balances := sdk.NewCoins(newFooCoin(100), newBarCoin(50))
addr1 := sdk.AccAddress([]byte("addr1"))
addr1 := sdk.AccAddress([]byte("addr1_______________"))
acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1)
app.AccountKeeper.SetAccount(ctx, acc1)
suite.Require().NoError(app.BankKeeper.SetBalances(ctx, addr1, balances))
@ -279,7 +279,7 @@ func (suite *IntegrationTestSuite) TestSendCoinsNewAccount() {
acc1Balances := app.BankKeeper.GetAllBalances(ctx, addr1)
suite.Require().Equal(balances, acc1Balances)
addr2 := sdk.AccAddress([]byte("addr2"))
addr2 := sdk.AccAddress([]byte("addr2_______________"))
suite.Require().Nil(app.AccountKeeper.GetAccount(ctx, addr2))
app.BankKeeper.GetAllBalances(ctx, addr2)
@ -311,10 +311,10 @@ func (suite *IntegrationTestSuite) TestInputOutputNewAccount() {
suite.Require().Empty(app.BankKeeper.GetAllBalances(ctx, addr2))
inputs := []types.Input{
{Address: addr1, Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))},
{Address: addr1.String(), Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))},
}
outputs := []types.Output{
{Address: addr2, Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))},
{Address: addr2.String(), Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))},
}
suite.Require().NoError(app.BankKeeper.InputOutputCoins(ctx, inputs, outputs))
@ -342,12 +342,12 @@ func (suite *IntegrationTestSuite) TestInputOutputCoins() {
app.AccountKeeper.SetAccount(ctx, acc3)
inputs := []types.Input{
{Address: addr1, Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))},
{Address: addr1, Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))},
{Address: addr1.String(), Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))},
{Address: addr1.String(), Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))},
}
outputs := []types.Output{
{Address: addr2, Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))},
{Address: addr3, Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))},
{Address: addr2.String(), Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))},
{Address: addr3.String(), Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))},
}
suite.Require().Error(app.BankKeeper.InputOutputCoins(ctx, inputs, []types.Output{}))
@ -356,12 +356,12 @@ func (suite *IntegrationTestSuite) TestInputOutputCoins() {
suite.Require().NoError(app.BankKeeper.SetBalances(ctx, addr1, balances))
insufficientInputs := []types.Input{
{Address: addr1, Coins: sdk.NewCoins(newFooCoin(300), newBarCoin(100))},
{Address: addr1, Coins: sdk.NewCoins(newFooCoin(300), newBarCoin(100))},
{Address: addr1.String(), Coins: sdk.NewCoins(newFooCoin(300), newBarCoin(100))},
{Address: addr1.String(), Coins: sdk.NewCoins(newFooCoin(300), newBarCoin(100))},
}
insufficientOutputs := []types.Output{
{Address: addr2, Coins: sdk.NewCoins(newFooCoin(300), newBarCoin(100))},
{Address: addr3, Coins: sdk.NewCoins(newFooCoin(300), newBarCoin(100))},
{Address: addr2.String(), Coins: sdk.NewCoins(newFooCoin(300), newBarCoin(100))},
{Address: addr3.String(), Coins: sdk.NewCoins(newFooCoin(300), newBarCoin(100))},
}
suite.Require().Error(app.BankKeeper.InputOutputCoins(ctx, insufficientInputs, insufficientOutputs))
suite.Require().NoError(app.BankKeeper.InputOutputCoins(ctx, inputs, outputs))
@ -381,11 +381,11 @@ func (suite *IntegrationTestSuite) TestSendCoins() {
app, ctx := suite.app, suite.ctx
balances := sdk.NewCoins(newFooCoin(100), newBarCoin(50))
addr1 := sdk.AccAddress([]byte("addr1"))
addr1 := sdk.AccAddress([]byte("addr1_______________"))
acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1)
app.AccountKeeper.SetAccount(ctx, acc1)
addr2 := sdk.AccAddress([]byte("addr2"))
addr2 := sdk.AccAddress([]byte("addr2_______________"))
acc2 := app.AccountKeeper.NewAccountWithAddress(ctx, addr2)
app.AccountKeeper.SetAccount(ctx, acc2)
suite.Require().NoError(app.BankKeeper.SetBalances(ctx, addr2, balances))
@ -411,8 +411,8 @@ func (suite *IntegrationTestSuite) TestValidateBalance() {
ctx = ctx.WithBlockHeader(tmproto.Header{Time: now})
endTime := now.Add(24 * time.Hour)
addr1 := sdk.AccAddress([]byte("addr1"))
addr2 := sdk.AccAddress([]byte("addr2"))
addr1 := sdk.AccAddress([]byte("addr1_______________"))
addr2 := sdk.AccAddress([]byte("addr2_______________"))
suite.Require().Error(app.BankKeeper.ValidateBalance(ctx, addr1))
@ -433,7 +433,7 @@ func (suite *IntegrationTestSuite) TestValidateBalance() {
func (suite *IntegrationTestSuite) TestBalance() {
app, ctx := suite.app, suite.ctx
addr := sdk.AccAddress([]byte("addr1"))
addr := sdk.AccAddress([]byte("addr1_______________"))
acc := app.AccountKeeper.NewAccountWithAddress(ctx, addr)
app.AccountKeeper.SetAccount(ctx, acc)
@ -504,7 +504,7 @@ func (suite *IntegrationTestSuite) TestSendEnabled() {
func (suite *IntegrationTestSuite) TestHasBalance() {
app, ctx := suite.app, suite.ctx
addr := sdk.AccAddress([]byte("addr1"))
addr := sdk.AccAddress([]byte("addr1_______________"))
acc := app.AccountKeeper.NewAccountWithAddress(ctx, addr)
app.AccountKeeper.SetAccount(ctx, acc)
@ -520,8 +520,8 @@ func (suite *IntegrationTestSuite) TestHasBalance() {
func (suite *IntegrationTestSuite) TestMsgSendEvents() {
app, ctx := suite.app, suite.ctx
addr := sdk.AccAddress([]byte("addr1"))
addr2 := sdk.AccAddress([]byte("addr2"))
addr := sdk.AccAddress([]byte("addr1_______________"))
addr2 := sdk.AccAddress([]byte("addr2_______________"))
acc := app.AccountKeeper.NewAccountWithAddress(ctx, addr)
app.AccountKeeper.SetAccount(ctx, acc)
@ -589,12 +589,12 @@ func (suite *IntegrationTestSuite) TestMsgMultiSendEvents() {
newCoins := sdk.NewCoins(sdk.NewInt64Coin(fooDenom, 50))
newCoins2 := sdk.NewCoins(sdk.NewInt64Coin(barDenom, 100))
inputs := []types.Input{
{Address: addr, Coins: newCoins},
{Address: addr2, Coins: newCoins2},
{Address: addr.String(), Coins: newCoins},
{Address: addr2.String(), Coins: newCoins2},
}
outputs := []types.Output{
{Address: addr3, Coins: newCoins},
{Address: addr4, Coins: newCoins2},
{Address: addr3.String(), Coins: newCoins},
{Address: addr4.String(), Coins: newCoins2},
}
suite.Require().Error(app.BankKeeper.InputOutputCoins(ctx, inputs, outputs))
@ -679,9 +679,9 @@ func (suite *IntegrationTestSuite) TestSpendableCoins() {
origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100))
delCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50))
addr1 := sdk.AccAddress([]byte("addr1"))
addr2 := sdk.AccAddress([]byte("addr2"))
addrModule := sdk.AccAddress([]byte("moduleAcc"))
addr1 := sdk.AccAddress([]byte("addr1_______________"))
addr2 := sdk.AccAddress([]byte("addr2_______________"))
addrModule := sdk.AccAddress([]byte("moduleAcc___________"))
macc := app.AccountKeeper.NewAccountWithAddress(ctx, addrModule)
bacc := authtypes.NewBaseAccountWithAddress(addr1)
@ -710,8 +710,8 @@ func (suite *IntegrationTestSuite) TestVestingAccountSend() {
origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100))
sendCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50))
addr1 := sdk.AccAddress([]byte("addr1"))
addr2 := sdk.AccAddress([]byte("addr2"))
addr1 := sdk.AccAddress([]byte("addr1_______________"))
addr2 := sdk.AccAddress([]byte("addr2_______________"))
bacc := authtypes.NewBaseAccountWithAddress(addr1)
vacc := vesting.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix())
@ -738,8 +738,8 @@ func (suite *IntegrationTestSuite) TestPeriodicVestingAccountSend() {
origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100))
sendCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50))
addr1 := sdk.AccAddress([]byte("addr1"))
addr2 := sdk.AccAddress([]byte("addr2"))
addr1 := sdk.AccAddress([]byte("addr1_______________"))
addr2 := sdk.AccAddress([]byte("addr2_______________"))
periods := vesting.Periods{
vesting.Period{Length: int64(12 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin("stake", 50)}},
vesting.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin("stake", 25)}},
@ -773,8 +773,8 @@ func (suite *IntegrationTestSuite) TestVestingAccountReceive() {
origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100))
sendCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50))
addr1 := sdk.AccAddress([]byte("addr1"))
addr2 := sdk.AccAddress([]byte("addr2"))
addr1 := sdk.AccAddress([]byte("addr1_______________"))
addr2 := sdk.AccAddress([]byte("addr2_______________"))
bacc := authtypes.NewBaseAccountWithAddress(addr1)
vacc := vesting.NewContinuousVestingAccount(bacc, origCoins, ctx.BlockHeader().Time.Unix(), endTime.Unix())
@ -806,8 +806,8 @@ func (suite *IntegrationTestSuite) TestPeriodicVestingAccountReceive() {
origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100))
sendCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50))
addr1 := sdk.AccAddress([]byte("addr1"))
addr2 := sdk.AccAddress([]byte("addr2"))
addr1 := sdk.AccAddress([]byte("addr1_______________"))
addr2 := sdk.AccAddress([]byte("addr2_______________"))
bacc := authtypes.NewBaseAccountWithAddress(addr1)
periods := vesting.Periods{
@ -846,9 +846,9 @@ func (suite *IntegrationTestSuite) TestDelegateCoins() {
origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100))
delCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50))
addr1 := sdk.AccAddress([]byte("addr1"))
addr2 := sdk.AccAddress([]byte("addr2"))
addrModule := sdk.AccAddress([]byte("moduleAcc"))
addr1 := sdk.AccAddress([]byte("addr1_______________"))
addr2 := sdk.AccAddress([]byte("addr2_______________"))
addrModule := sdk.AccAddress([]byte("moduleAcc___________"))
macc := app.AccountKeeper.NewAccountWithAddress(ctx, addrModule) // we don't need to define an actual module account bc we just need the address for testing
acc := app.AccountKeeper.NewAccountWithAddress(ctx, addr2)
@ -879,8 +879,8 @@ func (suite *IntegrationTestSuite) TestDelegateCoins_Invalid() {
origCoins := sdk.NewCoins(newFooCoin(100))
delCoins := sdk.NewCoins(newFooCoin(50))
addr1 := sdk.AccAddress([]byte("addr1"))
addrModule := sdk.AccAddress([]byte("moduleAcc"))
addr1 := sdk.AccAddress([]byte("addr1_______________"))
addrModule := sdk.AccAddress([]byte("moduleAcc___________"))
macc := app.AccountKeeper.NewAccountWithAddress(ctx, addrModule) // we don't need to define an actual module account bc we just need the address for testing
acc := app.AccountKeeper.NewAccountWithAddress(ctx, addr1)
@ -906,9 +906,9 @@ func (suite *IntegrationTestSuite) TestUndelegateCoins() {
origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100))
delCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50))
addr1 := sdk.AccAddress([]byte("addr1"))
addr2 := sdk.AccAddress([]byte("addr2"))
addrModule := sdk.AccAddress([]byte("moduleAcc"))
addr1 := sdk.AccAddress([]byte("addr1_______________"))
addr2 := sdk.AccAddress([]byte("addr2_______________"))
addrModule := sdk.AccAddress([]byte("moduleAcc___________"))
bacc := authtypes.NewBaseAccountWithAddress(addr1)
macc := app.AccountKeeper.NewAccountWithAddress(ctx, addrModule) // we don't need to define an actual module account bc we just need the address for testing
@ -956,8 +956,8 @@ func (suite *IntegrationTestSuite) TestUndelegateCoins_Invalid() {
origCoins := sdk.NewCoins(newFooCoin(100))
delCoins := sdk.NewCoins(newFooCoin(50))
addr1 := sdk.AccAddress([]byte("addr1"))
addrModule := sdk.AccAddress([]byte("moduleAcc"))
addr1 := sdk.AccAddress([]byte("addr1_______________"))
addrModule := sdk.AccAddress([]byte("moduleAcc___________"))
macc := app.AccountKeeper.NewAccountWithAddress(ctx, addrModule) // we don't need to define an actual module account bc we just need the address for testing
acc := app.AccountKeeper.NewAccountWithAddress(ctx, addr1)

View File

@ -39,7 +39,12 @@ func queryBalance(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerie
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())
}
balance := k.GetBalance(ctx, params.Address, params.Denom)
address, err := sdk.AccAddressFromBech32(params.Address)
if err != nil {
return nil, err
}
balance := k.GetBalance(ctx, address, params.Denom)
bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, balance)
if err != nil {
@ -56,7 +61,12 @@ func queryAllBalance(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQue
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())
}
balances := k.GetAllBalances(ctx, params.Address)
address, err := sdk.AccAddressFromBech32(params.Address)
if err != nil {
return nil, err
}
balances := k.GetAllBalances(ctx, address)
bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, balances)
if err != nil {

View File

@ -85,7 +85,12 @@ func (k BaseSendKeeper) InputOutputCoins(ctx sdk.Context, inputs []types.Input,
}
for _, in := range inputs {
err := k.SubtractCoins(ctx, in.Address, in.Coins)
inAddress, err := sdk.AccAddressFromBech32(in.Address)
if err != nil {
return err
}
err = k.SubtractCoins(ctx, inAddress, in.Coins)
if err != nil {
return err
}
@ -93,13 +98,17 @@ func (k BaseSendKeeper) InputOutputCoins(ctx sdk.Context, inputs []types.Input,
ctx.EventManager().EmitEvent(
sdk.NewEvent(
sdk.EventTypeMessage,
sdk.NewAttribute(types.AttributeKeySender, in.Address.String()),
sdk.NewAttribute(types.AttributeKeySender, in.Address),
),
)
}
for _, out := range outputs {
err := k.AddCoins(ctx, out.Address, out.Coins)
outAddress, err := sdk.AccAddressFromBech32(out.Address)
if err != nil {
return err
}
err = k.AddCoins(ctx, outAddress, out.Coins)
if err != nil {
return err
}
@ -107,7 +116,7 @@ func (k BaseSendKeeper) InputOutputCoins(ctx sdk.Context, inputs []types.Input,
ctx.EventManager().EmitEvent(
sdk.NewEvent(
types.EventTypeTransfer,
sdk.NewAttribute(types.AttributeKeyRecipient, out.Address.String()),
sdk.NewAttribute(types.AttributeKeyRecipient, out.Address),
sdk.NewAttribute(sdk.AttributeKeyAmount, out.Coins.String()),
),
)
@ -116,10 +125,10 @@ func (k BaseSendKeeper) InputOutputCoins(ctx sdk.Context, inputs []types.Input,
//
// NOTE: This should ultimately be removed in favor a more flexible approach
// such as delegated fee messages.
acc := k.ak.GetAccount(ctx, out.Address)
acc := k.ak.GetAccount(ctx, outAddress)
if acc == nil {
defer telemetry.IncrCounter(1, "new", "account")
k.ak.SetAccount(ctx, k.ak.NewAccountWithAddress(ctx, out.Address))
k.ak.SetAccount(ctx, k.ak.NewAccountWithAddress(ctx, outAddress))
}
}

View File

@ -83,7 +83,7 @@ func (k BaseViewKeeper) GetAccountsBalances(ctx sdk.Context) []types.Balance {
}
accountBalance := types.Balance{
Address: addr,
Address: addr.String(),
Coins: sdk.NewCoins(balance),
}
balances = append(balances, accountBalance)

View File

@ -42,7 +42,7 @@ func RandomGenesisBalances(simState *module.SimulationState) []types.Balance {
for _, acc := range simState.Accounts {
genesisBalances = append(genesisBalances, types.Balance{
Address: acc.Address,
Address: acc.Address.String(),
Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(simState.InitialStake))),
})
}

Some files were not shown because too many files have changed in this diff Show More