refactor!: remove tips (backport #17787) (#17819)

Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
mergify[bot] 2023-09-21 10:24:58 +02:00 committed by GitHub
parent b1208ef298
commit deea20c712
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
49 changed files with 292 additions and 934 deletions

View File

@ -154,6 +154,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### API Breaking Changes
* (x/auth) [#17787](https://github.com/cosmos/cosmos-sdk/pull/17787) Remove Tip functionality.
* (types) `module.EndBlockAppModule` has been replaced by Core API `appmodule.HasEndBlocker` or `module.HasABCIEndBlock` when needing validator updates.
* (types) `module.BeginBlockAppModule` has been replaced by Core API `appmodule.HasBeginBlocker`.
* (types) [#17358](https://github.com/cosmos/cosmos-sdk/pull/17358) Remove deprecated `sdk.Handler`, use `baseapp.MsgServiceHandler` instead.

View File

@ -2729,8 +2729,7 @@ const (
SignMode_SIGN_MODE_TEXTUAL SignMode = 2
// SIGN_MODE_DIRECT_AUX specifies a signing mode which uses
// SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not
// require signers signing over other signers' `signer_info`. It also allows
// for adding Tips in transactions.
// require signers signing over other signers' `signer_info`.
//
// Since: cosmos-sdk 0.46
SignMode_SIGN_MODE_DIRECT_AUX SignMode = 3

View File

@ -8329,12 +8329,9 @@ type SignDocDirectAux struct {
AccountNumber uint64 `protobuf:"varint,4,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"`
// sequence is the sequence number of the signing account.
Sequence uint64 `protobuf:"varint,5,opt,name=sequence,proto3" json:"sequence,omitempty"`
// Tip is the optional tip used for transactions fees paid in another denom.
// It should be left empty if the signer is not the tipper for this
// transaction.
// tips have been depreacted and should not be used
//
// This field is ignored if the chain didn't enable tips, i.e. didn't add the
// `TipDecorator` in its posthandler.
// Deprecated: Do not use.
Tip *Tip `protobuf:"bytes,6,opt,name=tip,proto3" json:"tip,omitempty"`
}
@ -8393,6 +8390,7 @@ func (x *SignDocDirectAux) GetSequence() uint64 {
return 0
}
// Deprecated: Do not use.
func (x *SignDocDirectAux) GetTip() *Tip {
if x != nil {
return x.Tip
@ -8509,6 +8507,8 @@ type AuthInfo struct {
// `TipDecorator` in its posthandler.
//
// Since: cosmos-sdk 0.46
//
// Deprecated: Do not use.
Tip *Tip `protobuf:"bytes,3,opt,name=tip,proto3" json:"tip,omitempty"`
}
@ -8546,6 +8546,7 @@ func (x *AuthInfo) GetFee() *Fee {
return nil
}
// Deprecated: Do not use.
func (x *AuthInfo) GetTip() *Tip {
if x != nil {
return x.Tip
@ -8763,6 +8764,8 @@ func (x *Fee) GetGranter() string {
// Tip is the tip used for meta-transactions.
//
// Since: cosmos-sdk 0.46
//
// Deprecated: Do not use.
type Tip struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -9011,7 +9014,7 @@ var file_cosmos_tx_v1beta1_tx_proto_rawDesc = []byte{
0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61,
0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f,
0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xee, 0x01, 0x0a, 0x10,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xf2, 0x01, 0x0a, 0x10,
0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x41, 0x75, 0x78,
0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12,
@ -9024,121 +9027,122 @@ var file_cosmos_tx_v1beta1_tx_proto_rawDesc = []byte{
0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e,
0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e,
0x63, 0x65, 0x12, 0x28, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x63, 0x65, 0x12, 0x2c, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65,
0x74, 0x61, 0x31, 0x2e, 0x54, 0x69, 0x70, 0x52, 0x03, 0x74, 0x69, 0x70, 0x22, 0x95, 0x02, 0x0a,
0x06, 0x54, 0x78, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52,
0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d,
0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x25, 0x0a,
0x0e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18,
0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x48, 0x65,
0x69, 0x67, 0x68, 0x74, 0x12, 0x42, 0x0a, 0x11, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xff, 0x07, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5a, 0x0a, 0x1e, 0x6e, 0x6f, 0x6e, 0x5f,
0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xff, 0x0f, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x1b, 0x6e, 0x6f, 0x6e, 0x43, 0x72, 0x69, 0x74,
0x69, 0x63, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa0, 0x01, 0x0a, 0x08, 0x41, 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66,
0x6f, 0x12, 0x40, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e,
0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x49, 0x6e,
0x66, 0x6f, 0x73, 0x12, 0x28, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62,
0x65, 0x74, 0x61, 0x31, 0x2e, 0x46, 0x65, 0x65, 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, 0x28, 0x0a,
0x03, 0x74, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54,
0x69, 0x70, 0x52, 0x03, 0x74, 0x69, 0x70, 0x22, 0x97, 0x01, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e,
0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x33, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63,
0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79,
0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x38, 0x0a, 0x09, 0x6d,
0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b,
0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x6d, 0x6f, 0x64,
0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63,
0x65, 0x22, 0xe0, 0x02, 0x0a, 0x08, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c,
0x0a, 0x06, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22,
0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x69, 0x6e, 0x67,
0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x05,
0x6d, 0x75, 0x6c, 0x74, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f,
0x74, 0x61, 0x31, 0x2e, 0x54, 0x69, 0x70, 0x42, 0x02, 0x18, 0x01, 0x52, 0x03, 0x74, 0x69, 0x70,
0x22, 0x95, 0x02, 0x0a, 0x06, 0x54, 0x78, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x30, 0x0a, 0x08, 0x6d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x41, 0x6e, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x12, 0x0a,
0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d,
0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69,
0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x6f,
0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x42, 0x0a, 0x11, 0x65, 0x78, 0x74, 0x65,
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xff, 0x07,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x10, 0x65, 0x78, 0x74, 0x65,
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5a, 0x0a, 0x1e,
0x6e, 0x6f, 0x6e, 0x5f, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x74,
0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xff,
0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x1b, 0x6e, 0x6f, 0x6e,
0x43, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa4, 0x01, 0x0a, 0x08, 0x41, 0x75, 0x74,
0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x40, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x5f,
0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f,
0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e,
0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x48, 0x00,
0x52, 0x05, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x1a, 0x41, 0x0a, 0x06, 0x53, 0x69, 0x6e, 0x67, 0x6c,
0x65, 0x12, 0x37, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x73, 0x69, 0x67, 0x6e,
0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e,
0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x1a, 0x90, 0x01, 0x0a, 0x05, 0x4d,
0x75, 0x6c, 0x74, 0x69, 0x12, 0x4b, 0x0a, 0x08, 0x62, 0x69, 0x74, 0x61, 0x72, 0x72, 0x61, 0x79,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e,
0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x2e,
0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x42,
0x69, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x08, 0x62, 0x69, 0x74, 0x61, 0x72, 0x72, 0x61,
0x79, 0x12, 0x3a, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18,
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74,
0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e,
0x66, 0x6f, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x42, 0x05, 0x0a,
0x03, 0x73, 0x75, 0x6d, 0x22, 0x81, 0x02, 0x0a, 0x03, 0x46, 0x65, 0x65, 0x12, 0x79, 0x0a, 0x06,
0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63,
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f,
0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d,
0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65,
0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52,
0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c,
0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c,
0x69, 0x6d, 0x69, 0x74, 0x12, 0x2e, 0x0a, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e,
0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x70,
0x61, 0x79, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f,
0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52,
0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x22, 0xb2, 0x01, 0x0a, 0x03, 0x54, 0x69, 0x70,
0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f,
0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64,
0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0,
0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7,
0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x06, 0x74,
0x69, 0x70, 0x70, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d,
0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e,
0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x28, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78,
0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x46, 0x65, 0x65, 0x52, 0x03, 0x66, 0x65,
0x65, 0x12, 0x2c, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16,
0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
0x61, 0x31, 0x2e, 0x54, 0x69, 0x70, 0x42, 0x02, 0x18, 0x01, 0x52, 0x03, 0x74, 0x69, 0x70, 0x22,
0x97, 0x01, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x33,
0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63,
0x4b, 0x65, 0x79, 0x12, 0x38, 0x0a, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e,
0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x08, 0x6d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a,
0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52,
0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x22, 0xe0, 0x02, 0x0a, 0x08, 0x4d, 0x6f,
0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e,
0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49,
0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, 0x73, 0x69,
0x6e, 0x67, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e,
0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f,
0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x48, 0x00, 0x52, 0x05, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x1a,
0x41, 0x0a, 0x06, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x6d, 0x6f, 0x64,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x2e, 0x74, 0x78, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65,
0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f,
0x64, 0x65, 0x1a, 0x90, 0x01, 0x0a, 0x05, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x12, 0x4b, 0x0a, 0x08,
0x62, 0x69, 0x74, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f,
0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x6d,
0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e,
0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x42, 0x69, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52,
0x08, 0x62, 0x69, 0x74, 0x61, 0x72, 0x72, 0x61, 0x79, 0x12, 0x3a, 0x0a, 0x0a, 0x6d, 0x6f, 0x64,
0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e,
0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65,
0x49, 0x6e, 0x66, 0x6f, 0x73, 0x42, 0x05, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x22, 0x81, 0x02, 0x0a,
0x03, 0x46, 0x65, 0x65, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61,
0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42,
0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f,
0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e,
0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69,
0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12,
0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01,
0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2e, 0x0a, 0x05,
0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d,
0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53,
0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x74, 0x69, 0x70, 0x70, 0x65, 0x72, 0x22, 0xce, 0x01,
0x0a, 0x0d, 0x41, 0x75, 0x78, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12,
0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64,
0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72,
0x65, 0x73, 0x73, 0x12, 0x3e, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x6f, 0x63, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74,
0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f,
0x63, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x41, 0x75, 0x78, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e,
0x44, 0x6f, 0x63, 0x12, 0x37, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x73, 0x69,
0x67, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69,
0x67, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03,
0x73, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x69, 0x67, 0x42, 0xb4,
0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78,
0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74,
0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69,
0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f,
0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x74, 0x78, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
0x31, 0xa2, 0x02, 0x03, 0x43, 0x54, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x2e, 0x54, 0x78, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x11, 0x43, 0x6f,
0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2,
0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65,
0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea,
0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x54, 0x78, 0x3a, 0x3a, 0x56, 0x31,
0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07,
0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2,
0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73,
0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72,
0x22, 0xb6, 0x01, 0x0a, 0x03, 0x54, 0x69, 0x70, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75,
0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f,
0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43,
0x6f, 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63,
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e,
0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79,
0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f,
0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x06, 0x74, 0x69, 0x70, 0x70, 0x65, 0x72, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e,
0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x74,
0x69, 0x70, 0x70, 0x65, 0x72, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xce, 0x01, 0x0a, 0x0d, 0x41, 0x75,
0x78, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x07, 0x61,
0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4,
0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12,
0x3e, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x6f, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31,
0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x44, 0x69, 0x72,
0x65, 0x63, 0x74, 0x41, 0x75, 0x78, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x12,
0x37, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e,
0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e,
0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x6f,
0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x67, 0x18,
0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x69, 0x67, 0x42, 0xb4, 0x01, 0x0a, 0x15, 0x63,
0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62,
0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a,
0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65,
0x74, 0x61, 0x31, 0x3b, 0x74, 0x78, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03,
0x43, 0x54, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x54, 0x78, 0x2e,
0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x5c, 0x54, 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1d, 0x43, 0x6f,
0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c,
0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x6f,
0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x54, 0x78, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61,
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -72,7 +72,7 @@ type BaseApp struct {
mempool mempool.Mempool // application side mempool
anteHandler sdk.AnteHandler // ante handler for fee and auth
postHandler sdk.PostHandler // post handler, optional, e.g. for tips
postHandler sdk.PostHandler // post handler, optional
initChainer sdk.InitChainer // ABCI InitChain handler
preBlocker sdk.PreBlocker // logic to run before BeginBlocker

View File

@ -6,7 +6,6 @@ import (
"github.com/cosmos/gogoproto/proto"
"google.golang.org/protobuf/types/known/anypb"
basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1"
txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1"
txsigning "cosmossdk.io/x/tx/signing"
"cosmossdk.io/x/tx/signing/aminojson"
@ -130,12 +129,6 @@ func (b *AuxTxBuilder) SetSignMode(mode signing.SignMode) error {
return nil
}
// SetTip sets an optional tip in the AuxSignerData.
func (b *AuxTxBuilder) SetTip(tip *tx.Tip) {
b.checkEmptyFields()
b.auxSignerData.SignDoc.Tip = tip
}
// SetSignature sets the aux signer's signature in the AuxSignerData.
func (b *AuxTxBuilder) SetSignature(sig []byte) {
b.checkEmptyFields()
@ -214,11 +207,7 @@ func (b *AuxTxBuilder) GetSignBytes() ([]byte, error) {
handler := aminojson.NewSignModeHandler(aminojson.SignModeHandlerOptions{
FileResolver: proto.HybridResolver,
})
legacyTip := b.auxSignerData.SignDoc.Tip
tip := &txv1beta1.Tip{
Amount: make([]*basev1beta1.Coin, len(legacyTip.Amount)),
Tipper: legacyTip.Tipper,
}
auxBody := &txv1beta1.TxBody{
Messages: body.Messages,
Memo: body.Memo,
@ -230,12 +219,7 @@ func (b *AuxTxBuilder) GetSignBytes() ([]byte, error) {
ExtensionOptions: nil,
NonCriticalExtensionOptions: nil,
}
for i, coin := range legacyTip.Amount {
tip.Amount[i] = &basev1beta1.Coin{
Denom: coin.Denom,
Amount: coin.Amount.String(),
}
}
signBz, err = handler.GetSignBytes(
context.Background(),
txsigning.SignerData{
@ -254,7 +238,6 @@ func (b *AuxTxBuilder) GetSignBytes() ([]byte, error) {
// over empty fees.
// ref: https://github.com/cosmos/cosmos-sdk/pull/10348
Fee: &txv1beta1.Fee{},
Tip: tip,
},
},
)

View File

@ -84,25 +84,11 @@ func TestAuxTxBuilder(t *testing.T) {
},
true, "got unknown sign mode SIGN_MODE_UNSPECIFIED",
},
{
"GetSignBytes tipper should not be nil (if tip is set)",
func() error {
require.NoError(t, b.SetMsgs(msg1))
require.NoError(t, b.SetPubKey(pub1))
b.SetTip(&typestx.Tip{})
require.NoError(t, b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX))
_, err := b.GetSignBytes()
return err
},
true, "tipper cannot be empty",
},
{
"GetSignBytes works for DIRECT_AUX",
func() error {
require.NoError(t, b.SetMsgs(msg1))
require.NoError(t, b.SetPubKey(pub1))
b.SetTip(tip)
require.NoError(t, b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX))
_, err := b.GetSignBytes()
@ -115,7 +101,6 @@ func TestAuxTxBuilder(t *testing.T) {
func() error {
require.NoError(t, b.SetMsgs(msg1))
require.NoError(t, b.SetPubKey(pub1))
b.SetTip(tip)
require.NoError(t, b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX))
_, err := b.GetSignBytes()
@ -131,7 +116,6 @@ func TestAuxTxBuilder(t *testing.T) {
func() error {
require.NoError(t, b.SetMsgs(msg1))
require.NoError(t, b.SetPubKey(pub1))
b.SetTip(tip)
b.SetAddress(addr1.String())
require.NoError(t, b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX))
@ -153,7 +137,6 @@ func TestAuxTxBuilder(t *testing.T) {
b.SetChainID(chainID)
require.NoError(t, b.SetMsgs(msg1))
require.NoError(t, b.SetPubKey(pub1))
b.SetTip(tip)
b.SetAddress(addr1.String())
err := b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX)
require.NoError(t, err)
@ -176,7 +159,6 @@ func TestAuxTxBuilder(t *testing.T) {
func() error {
require.NoError(t, b.SetMsgs(msg1))
require.NoError(t, b.SetPubKey(pub1))
b.SetTip(tip)
b.SetAddress(addr1.String())
err := b.SetSignMode(signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON)
require.NoError(t, err)
@ -196,7 +178,6 @@ func TestAuxTxBuilder(t *testing.T) {
b.SetChainID(chainID)
require.NoError(t, b.SetMsgs(msg1))
require.NoError(t, b.SetPubKey(pub1))
b.SetTip(tip)
b.SetAddress(addr1.String())
err := b.SetSignMode(signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON)
require.NoError(t, err)
@ -250,7 +231,6 @@ func checkCorrectData(t *testing.T, cdc codec.Codec, auxSignerData typestx.AuxSi
require.Equal(t, chainID, auxSignerData.SignDoc.ChainId)
require.Equal(t, msgAny, body.GetMessages()[0])
require.Equal(t, pkAny, auxSignerData.SignDoc.PublicKey)
require.Equal(t, tip, auxSignerData.SignDoc.Tip)
require.Equal(t, signMode, auxSignerData.Mode)
require.Equal(t, rawSig, auxSignerData.Sig)
}

View File

@ -18,7 +18,6 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/tx"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
)
@ -38,7 +37,6 @@ type Factory struct {
generateOnly bool
memo string
fees sdk.Coins
tip *tx.Tip
feeGranter sdk.AccAddress
feePayer sdk.AccAddress
gasPrices sdk.DecCoins
@ -105,11 +103,6 @@ func NewFactoryCLI(clientCtx client.Context, flagSet *pflag.FlagSet) (Factory, e
feesStr, _ := flagSet.GetString(flags.FlagFees)
f = f.WithFees(feesStr)
tipsStr, _ := flagSet.GetString(flags.FlagTip)
// Add tips to factory. The tipper is necessarily the Msg signer, i.e.
// the from address.
f = f.WithTips(tipsStr, clientCtx.FromAddress.String())
gasPricesStr, _ := flagSet.GetString(flags.FlagGasPrices)
f = f.WithGasPrices(gasPricesStr)
@ -169,20 +162,6 @@ func (f Factory) WithFees(fees string) Factory {
return f
}
// WithTips returns a copy of the Factory with an updated tip.
func (f Factory) WithTips(tip, tipper string) Factory {
parsedTips, err := sdk.ParseCoinsNormalized(tip)
if err != nil {
panic(err)
}
f.tip = &tx.Tip{
Tipper: tipper,
Amount: parsedTips,
}
return f
}
// WithGasPrices returns a copy of the Factory with updated gas prices.
func (f Factory) WithGasPrices(gasPrices string) Factory {
parsedGasPrices, err := sdk.ParseDecCoins(gasPrices)

View File

@ -3,7 +3,6 @@ package tx_test
import (
"github.com/cosmos/cosmos-sdk/testutil/testdata"
"github.com/cosmos/cosmos-sdk/types"
typestx "github.com/cosmos/cosmos-sdk/types/tx"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
)
@ -19,5 +18,4 @@ var (
msg1 = banktypes.NewMsgSend(addr1, addr2, types.NewCoins(types.NewInt64Coin("wack", 2)))
chainID = "test-chain"
tip = &typestx.Tip{Tipper: addr1.String(), Amount: testdata.NewTestFeeAmount()}
)

View File

@ -393,13 +393,6 @@ func makeAuxSignerData(clientCtx client.Context, f Factory, msgs ...sdk.Msg) (tx
return tx.AuxSignerData{}, err
}
if f.tip != nil {
if _, err := sdk.AccAddressFromBech32(f.tip.Tipper); err != nil {
return tx.AuxSignerData{}, sdkerrors.ErrInvalidAddress.Wrap("tipper must be a bech32 address")
}
b.SetTip(f.tip)
}
err = b.SetSignMode(f.SignMode())
if err != nil {
return tx.AuxSignerData{}, err

View File

@ -9,8 +9,6 @@ import (
"github.com/stretchr/testify/require"
"google.golang.org/grpc"
"cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/cosmos/cosmos-sdk/codec"
@ -388,22 +386,12 @@ func TestPreprocessHook(t *testing.T) {
extAny, err := codectypes.NewAnyWithValue(extVal)
requireT.NoError(err)
coin := sdk.Coin{
Denom: "atom",
Amount: math.NewInt(20),
}
newTip := &txtypes.Tip{
Amount: sdk.Coins{coin},
Tipper: "galaxy",
}
preprocessHook := client.PreprocessTxFn(func(chainID string, key keyring.KeyType, tx client.TxBuilder) error {
extensionBuilder, ok := tx.(authtx.ExtensionOptionsTxBuilder)
requireT.True(ok)
// Set new extension and tip
extensionBuilder.SetExtensionOptions(extAny)
tx.SetTip(newTip)
return nil
})
@ -435,9 +423,6 @@ func TestPreprocessHook(t *testing.T) {
opt := hasExtOptsTx.GetExtensionOptions()[0]
requireT.Equal(opt, extAny)
tip := txb.GetTx().GetTip()
requireT.Equal(tip, newTip)
}
func testSigners(require *require.Assertions, tr signing.Tx, pks ...cryptotypes.PubKey) []signingtypes.SignatureV2 {

View File

@ -47,7 +47,6 @@ type (
SetFeeAmount(amount sdk.Coins)
SetFeePayer(feePayer sdk.AccAddress)
SetGasLimit(limit uint64)
SetTip(tip *tx.Tip)
SetTimeoutHeight(height uint64)
SetFeeGranter(feeGranter sdk.AccAddress)
AddAuxSignerData(tx.AuxSignerData) error

View File

@ -412,7 +412,8 @@ First, it retrieves the `sdk.Msg`'s fully-qualified type name, by checking the `
`PostHandler` is similar to `AnteHandler`, but it, as the name suggests, executes custom post tx processing logic after [`RunMsgs`](#runmsgs) is called. `PostHandler` receives the `Result` of the the `RunMsgs` in order to enable this customizable behavior.
Like `AnteHandler`s, `PostHandler`s are theoretically optional, one use case for `PostHandler`s is transaction tips (enabled by default in simapp).
Like `AnteHandler`s, `PostHandler`s are theoretically optional.
Other use cases like unused gas refund can also be enabled by `PostHandler`s.
```go reference

View File

@ -91,7 +91,6 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/v1beta
The use case is a multi-signer transaction, where one of the signers is appointed to gather all signatures, broadcast the signature and pay for fees, and the others only care about the transaction body. This generally allows for a better multi-signing UX. If Alice, Bob and Charlie are part of a 3-signer transaction, then Alice and Bob can both use `SIGN_MODE_DIRECT_AUX` to sign over the `TxBody` and their own signer info (no need an additional step to gather other signers' ones, like in `SIGN_MODE_DIRECT`), without specifying a fee in their SignDoc. Charlie can then gather both signatures from Alice and Bob, and
create the final transaction by appending a fee. Note that the fee payer of the transaction (in our case Charlie) must sign over the fees, so must use `SIGN_MODE_DIRECT` or `SIGN_MODE_LEGACY_AMINO_JSON`.
A concrete use case is implemented in [transaction tips](./14-tips.md): the tipper may use `SIGN_MODE_DIRECT_AUX` to specify a tip in the transaction, without signing over the actual transaction fees. Then, the fee payer appends fees inside the tipper's desired `TxBody`, and as an exchange for paying the fees and broadcasting the transaction, receives the tipper's transaction tips as payment.
#### `SIGN_MODE_TEXTUAL`

View File

@ -1,214 +0,0 @@
---
sidebar_position: 1
---
# Transaction Tips
:::note Synopsis
Transaction tips are a mechanism to pay for transaction fees using another denom than the native fee denom of the chain. They are still in beta, and are not included by default in the SDK.
:::
## Context
In a Cosmos ecosystem where more and more chains are connected via [IBC](https://ibc.cosmos.network/), it happens that users want to perform actions on chains where they don't have native tokens yet. An example would be an Osmosis user who wants to vote on a proposal on the Cosmos Hub, but they don't have ATOMs in their wallet. A solution would be to swap OSMO for ATOM just for voting on this proposal, but that is cumbersome. Cross-chain DeFi project [Emeris](https://emeris.com/) is another use case.
Transaction tips is a new solution for cross-chain transaction fees payment, whereby the transaction initiator signs a transaction without specifying fees, but uses a new `Tip` field. They send this signed transaction to a fee relayer who will choose the transaction fees and broadcast the final transaction, and the SDK provides a mechanism that will transfer the pre-defined `Tip` to the fee payer, to cover for fees.
Assuming we have two chains, A and B, we define the following terms:
* **the tipper**: this is the initiator of the transaction, who wants to execute a `Msg` on chain A, but doesn't have any native chain A tokens, only chain B tokens. In our example above, the tipper is the Osmosis (chain B) user wanting to vote on a Cosmos Hub (chain A) proposal.
* **the fee payer**: this is the party that will relay and broadcast the final transaction on chain A, and has chain A tokens. The tipper doesn't need to trust the feepayer.
* **the target chain**: the chain where the `Msg` is executed, chain A in this case.
## Transaction Tips Flow
The transaction tips flow happens in multiple steps.
1. The tipper sends via IBC some chain B tokens to chain A. These tokens will cover for fees on the target chain A. This means that chain A's bank module holds some IBC tokens under the tipper's address.
2. The tipper drafts a transaction to be executed on the chain A. It can include chain A `Msg`s. However, instead of creating a normal transaction, they create the following `AuxSignerData` document:
```protobuf reference
https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/v1beta1/tx.proto#L231-L244
```
where we have defined `SignDocDirectAux` as:
```protobuf reference
https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/v1beta1/tx.proto#L68-L98
```
where `Tip` is defined as
```protobuf reference
https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/v1beta1/tx.proto#L233-L244
```
Notice that this document doesn't sign over the final chain A fees. Instead, it includes a `Tip` field. It also doesn't include the whole `AuthInfo` object as in `SIGN_MODE_DIRECT`, only the minimum information needed by the tipper
3. The tipper signs the `SignDocDirectAux` document and attaches the signature to the `AuxSignerData`, then sends the signed `AuxSignerData` to the fee payer.
4. From the signed `AuxSignerData` document, the fee payer constructs a transaction, using the following algorithm:
* use as `TxBody` the exact `AuxSignerData.SignDocDirectAux.body_bytes`, to not alter the original intent of the tipper,
* create an `AuthInfo` with:
* `AuthInfo.Tip` copied from `AuxSignerData.SignDocDirectAux.Tip`,
* `AuthInfo.Fee` chosen by the fee payer, which should cover for the transaction gas, but also be small enough so that the tip/fee exchange rate is economically interesting for the fee payer,
* `AuthInfo.SignerInfos` has two signers: the first signer is the tipper, using the public key, sequence and sign mode specified in `AuxSignerData`; and the second signer is the fee payer, using their favorite sign mode,
* a `Signatures` array with two items: the tipper's signature from `AuxSignerData.Sig`, and the final fee payer's signature.
5. Broadcast the final transaction signed by the two parties to the target chain. Once included, the Cosmos SDK will trigger a transfer of the `Tip` specified in the transaction from the tipper address to the fee payer address.
### Fee Payers Market
The benefit of transaction tips for the tipper is clear: there is no need to swap tokens before executing a cross-chain message.
For the fee payer, the benefit is in the tip v.s. fee exchange. Put simply, the fee payer pays the fees of an unknown tipper's transaction, and gets in exchange the tip that the tipper chose. There is an economic incentive for the fee payer to do so only when the tip is greater than the transaction fees, given the exchange rates between the two tokens.
In the future, we imagine a market where fee payers will compete to include transactions from tippers, who on their side will optimize by specifying the lowest tip possible. A number of automated services might spin up to perform transaction gas simulation and exchange rate monitoring to optimize both the tip and fee values in real-time.
### Tipper and Fee Payer Sign Modes
As we mentioned in the flow above, the tipper signs over the `SignDocDirectAux`, and the fee payer signs over the whole final transaction. As such, both parties might use different sign modes.
* The tipper MUST use `SIGN_MODE_DIRECT_AUX` or `SIGN_MODE_LEGACY_AMINO_JSON`. That is because the tipper needs to sign over the body, the tip, but not the other signers' information and not over the fee (which is unknown to the tipper).
* The fee payer MUST use `SIGN_MODE_DIRECT` or `SIGN_MODE_LEGACY_AMINO_JSON`. The fee payer signs over the whole transaction.
For example, if the fee payer signs the whole transaction with `SIGN_MODE_DIRECT_AUX`, it will be rejected by the node, as that would introduce malleability issues (`SIGN_MODE_DIRECT_AUX` doesn't sign over fees).
In both cases, using `SIGN_MODE_LEGACY_AMINO_JSON` is recommended only if hardware wallet signing is needed.
## Enabling Tips on your Chain
The transaction tips functionality is introduced in Cosmos SDK v0.46, so earlier versions do not have support for tips. It is however not included by default in a v0.46 app. Sending a transaction with tips to a chain which didn't enable tips will result in a no-op, i.e. the `tip` field in the transaction will be ignored.
Enabling tips on a chain is done by adding the `TipDecorator` in the posthandler chain:
```go
// HandlerOptions are the options required for constructing a SDK PostHandler which supports tips.
type HandlerOptions struct {
BankKeeper types.BankKeeper
}
// MyPostHandler returns a posthandler chain with the TipDecorator.
func MyPostHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.BankKeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for posthandler")
}
postDecorators := []sdk.AnteDecorator{
posthandler.NewTipDecorator(options.bankKeeper),
}
return sdk.ChainAnteDecorators(postDecorators...), nil
}
func (app *SimApp) setPostHandler() {
postHandler, err := MyPostHandler(
HandlerOptions{
BankKeeper: app.BankKeeper,
},
)
if err != nil {
panic(err)
}
app.SetPostHandler(postHandler)
}
```
Notice that `NewTipDecorator` needs a reference to the BankKeeper, for transferring the tip to the fee payer.
## CLI Usage
The Cosmos SDK also provides some CLI tooling for the transaction tips flow, both for the tipper and for the feepayer.
For the tipper, the CLI `tx` subcommand has two new flags: `--aux` and `--tip`. The `--aux` flag is used to denote that we are creating an `AuxSignerData` instead of a `Tx`, and the `--tip` is used to populate its `Tip` field.
```bash
$ simd tx gov vote 16 yes --from <tipper_address> --aux --tip 50ibcdenom
### Prints the AuxSignerData as JSON:
### {"address":"cosmos1q0ayf5vq6fd2xxrwh30upg05hxdnyw2h5249a2","sign_doc":{"body_bytes":"CosBChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEmsKLWNvc21vczFxMGF5ZjV2cTZmZDJ4eHJ3aDMwdXBnMDVoeGRueXcyaDUyNDlhMhItY29zbW9zMXdlNWoyZXI2MHV5OXF3YzBta3ptdGdtdHA5Z3F5NXY2bjhnZGdlGgsKBXN0YWtlEgIxMA==","public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AojOF/1luQ5H/nZDSrE1w3CyzGJhJdQuS7hFX5wAA6uJ"},"chain_id":"","account_number":"0","sequence":"1","tip":{"amount":[{"denom":"ibcdenom","amount":"50"}],"tipper":"cosmos1q0ayf5vq6fd2xxrwh30upg05hxdnyw2h5249a2"}},"mode":"SIGN_MODE_DIRECT_AUX","sig":"v/d/bGq9FGdecs6faMG2t//nRirFTiqwFtUB65M6kh0QdUeM6jg3r8oJX1o17xkoDxJ09EyJiSyvo6fbU7vUxg=="}
```
It is useful to pipe the JSON output to a file, `> aux_signed_tx.json`
For the fee payer, the Cosmos SDK added a `tx aux-to-fee` subcommand to include an `AuxSignerData` into a transaction, add fees to it, and broadcast it.
```bash
$ simd tx aux-to-fee aux_signed_tx.json --from <fee_payer_address> --fees 30atom
### Prints the broadcasted tx response:
### code: 0
### codespace: sdk
### data: ""
### events: []
### gas_used: "0"
### gas_wanted: "0"
### height: "0"
### info: ""
### logs: []
### timestamp: ""
### tx: null
```
Upon completion of the second command, the fee payer's balance will be down the `30atom` fees, and up the `50ibcdenom` tip.
For both commands, the flag `--sign-mode=amino-json` is still available for hardware wallet signing.
## Programmatic Usage
For the tipper, the SDK exposes a new transaction builder, the `AuxTxBuilder`, for generating an `AuxSignerData`. The API of `AuxTxBuilder` is defined [in `client/tx`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/client/tx/aux_builder.go#L22), and can be used as follows:
```go
// Note: there's no need to use clientCtx.TxConfig anymore.
bldr := clienttx.NewAuxTxBuilder()
err := bldr.SetMsgs(msgs...)
bldr.SetAddress("cosmos1...")
bldr.SetMemo(...)
bldr.SetTip(...)
bldr.SetPubKey(...)
err := bldr.SetSignMode(...) // DIRECT_AUX or AMINO, or else error
// ... other setters are also available
// Get the bytes to sign.
signBz, err := bldr.GetSignBytes()
// Sign the bz using your favorite method.
sig, err := privKey.sign(signBz)
// Set the signature
bldr.SetSig(sig)
// Get the final auxSignerData to be sent to the fee payer
auxSignerData, err:= bldr.GetAuxSignerData()
```
For the fee payer, the SDK added a new method on the existing `TxBuilder` to import data from an `AuxSignerData`:
```go
// get `auxSignerData` from tipper, see code snippet above.
txBuilder := clientCtx.TxConfig.NewTxBuilder()
err := txBuilder.AddAuxSignerData(auxSignerData)
if err != nil {
return err
}
// A lot of fields will be populated in txBuilder, such as its Msgs, tip
// memo, etc...
// The fee payer choses the fee to set on the transaction.
txBuilder.SetFeePayer(<fee_payer_address>)
txBuilder.SetFeeAmount(...)
txBuilder.SetGasLimit(...)
// Usual signing code
err = authclient.SignTx(...)
if err != nil {
return err
}
```

View File

@ -32,8 +32,7 @@ enum SignMode {
// SIGN_MODE_DIRECT_AUX specifies a signing mode which uses
// SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not
// require signers signing over other signers' `signer_info`. It also allows
// for adding Tips in transactions.
// require signers signing over other signers' `signer_info`.
//
// Since: cosmos-sdk 0.46
SIGN_MODE_DIRECT_AUX = 3;

View File

@ -88,13 +88,8 @@ message SignDocDirectAux {
// sequence is the sequence number of the signing account.
uint64 sequence = 5;
// Tip is the optional tip used for transactions fees paid in another denom.
// It should be left empty if the signer is not the tipper for this
// transaction.
//
// This field is ignored if the chain didn't enable tips, i.e. didn't add the
// `TipDecorator` in its posthandler.
Tip tip = 6;
// tips have been depreacted and should not be used
Tip tip = 6 [deprecated = true];
}
// TxBody is the body of a transaction that all signers sign over.
@ -142,14 +137,13 @@ message AuthInfo {
// based on the cost of evaluating the body and doing signature verification
// of the signers. This can be estimated via simulation.
Fee fee = 2;
// Tip is the optional tip used for transactions fees paid in another denom.
//
// This field is ignored if the chain didn't enable tips, i.e. didn't add the
// `TipDecorator` in its posthandler.
//
// Since: cosmos-sdk 0.46
Tip tip = 3;
Tip tip = 3 [deprecated = true];
}
// SignerInfo describes the public key and signing mode of a single top-level
@ -232,6 +226,7 @@ message Fee {
//
// Since: cosmos-sdk 0.46
message Tip {
option deprecated = true;
// amount is the amount of the tip
repeated cosmos.base.v1beta1.Coin amount = 1 [
(gogoproto.nullable) = false,

View File

@ -513,12 +513,7 @@ func NewSimApp(
// meaning that both `runMsgs` and `postHandler` state will be committed if
// both are successful, and both will be reverted if any of the two fails.
//
// The SDK exposes a default postHandlers chain, which comprises of only
// one decorator: the Transaction Tips decorator. However, some chains do
// not need it by default, so feel free to comment the next line if you do
// not need tips.
// To read more about tips:
// https://docs.cosmos.network/main/core/tips.html
// The SDK exposes a default postHandlers chain
//
// Please note that changing any of the anteHandler or postHandler chain is
// likely to be a state-machine breaking change, which needs a coordinated

View File

@ -16,7 +16,7 @@ require (
cosmossdk.io/x/evidence v0.0.0-20230915171831-2196edacb99d
cosmossdk.io/x/feegrant v0.0.0-20230915171831-2196edacb99d
cosmossdk.io/x/nft v0.0.0-20230915171831-2196edacb99d
cosmossdk.io/x/tx v0.10.0
cosmossdk.io/x/tx v0.10.1-0.20230920120022-6715b5afb59f
cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d
github.com/cometbft/cometbft v0.38.0
github.com/cosmos/cosmos-db v1.0.0
@ -184,7 +184,7 @@ require (
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.0 // indirect
gotest.tools/v3 v3.5.1 // indirect
nhooyr.io/websocket v1.8.6 // indirect
pgregory.net/rapid v1.1.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect

View File

@ -215,8 +215,8 @@ cosmossdk.io/x/feegrant v0.0.0-20230915171831-2196edacb99d h1:Cm3KveQ0GkXJvUkBwO
cosmossdk.io/x/feegrant v0.0.0-20230915171831-2196edacb99d/go.mod h1:KcSYzPq6JR8C8yhVYgCGsmRoTpFlLnask4ZlRi7f3h0=
cosmossdk.io/x/nft v0.0.0-20230915171831-2196edacb99d h1:jj/vNw1pOMh3ar/8Yb42jEAi6U+vB/TrPPWrqlkdAMo=
cosmossdk.io/x/nft v0.0.0-20230915171831-2196edacb99d/go.mod h1:Q60Uu6/UsZlACzmGzSkGLSc/U8I6tbEusbqjTE40pvk=
cosmossdk.io/x/tx v0.10.0 h1:LxWF/hksVDbeQmFj4voLM5ZCHyVZ1cCNIqKenfH9plc=
cosmossdk.io/x/tx v0.10.0/go.mod h1:MKo9/b5wsoL8dd9y9pvD2yOP1CMvzHIWYxi1l2oLPFo=
cosmossdk.io/x/tx v0.10.1-0.20230920120022-6715b5afb59f h1:Dkw1pM+jnjK9Pk0CM6JZKLLDaMXWDCHSlLJiHcSmPpg=
cosmossdk.io/x/tx v0.10.1-0.20230920120022-6715b5afb59f/go.mod h1:lRM7U4VkxFjWBKZp7Mo818azphiNixeMCV8h1ZofkhM=
cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d h1:LH8NPa2+yoMFdCTxCFyQUX5zVDip4YDgtg7e0EecDqo=
cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d/go.mod h1:+5jCm6Lk/CrQhQvtJFy/tmuLfhQKNMn/U0vwrRz/dxQ=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
@ -1705,8 +1705,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY=
gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

View File

@ -188,7 +188,6 @@ func txCommand() *cobra.Command {
authcmd.GetBroadcastCommand(),
authcmd.GetEncodeCommand(),
authcmd.GetDecodeCommand(),
authcmd.GetAuxToFeeCommand(),
authcmd.GetSimulateCmd(),
)

View File

@ -1676,12 +1676,6 @@ func (s *E2ETestSuite) TestAuxToFeeWithTips() {
genTxFile := testutil.WriteToNewTempFile(s.T(), string(res.Bytes()))
defer genTxFile.Close()
// broadcast the tx
res, err = authclitestutil.TxAuxToFeeExec(
val.ClientCtx,
genTxFile.Name(),
tc.feePayerArgs...,
)
s.Require().NoError(s.network.WaitForNextBlock())
switch {

View File

@ -14,7 +14,7 @@ require (
cosmossdk.io/x/evidence v0.0.0-20230915171831-2196edacb99d
cosmossdk.io/x/feegrant v0.0.0-20230915171831-2196edacb99d
cosmossdk.io/x/nft v0.0.0-20230915171831-2196edacb99d // indirect
cosmossdk.io/x/tx v0.10.0
cosmossdk.io/x/tx v0.10.1-0.20230920120022-6715b5afb59f
cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d
github.com/cometbft/cometbft v0.38.0
github.com/cosmos/cosmos-db v1.0.0
@ -27,7 +27,7 @@ require (
github.com/stretchr/testify v1.8.4
google.golang.org/grpc v1.58.1
google.golang.org/protobuf v1.31.0
gotest.tools/v3 v3.5.0
gotest.tools/v3 v3.5.1
pgregory.net/rapid v1.1.0
)

View File

@ -213,8 +213,8 @@ cosmossdk.io/x/feegrant v0.0.0-20230915171831-2196edacb99d h1:Cm3KveQ0GkXJvUkBwO
cosmossdk.io/x/feegrant v0.0.0-20230915171831-2196edacb99d/go.mod h1:KcSYzPq6JR8C8yhVYgCGsmRoTpFlLnask4ZlRi7f3h0=
cosmossdk.io/x/nft v0.0.0-20230915171831-2196edacb99d h1:jj/vNw1pOMh3ar/8Yb42jEAi6U+vB/TrPPWrqlkdAMo=
cosmossdk.io/x/nft v0.0.0-20230915171831-2196edacb99d/go.mod h1:Q60Uu6/UsZlACzmGzSkGLSc/U8I6tbEusbqjTE40pvk=
cosmossdk.io/x/tx v0.10.0 h1:LxWF/hksVDbeQmFj4voLM5ZCHyVZ1cCNIqKenfH9plc=
cosmossdk.io/x/tx v0.10.0/go.mod h1:MKo9/b5wsoL8dd9y9pvD2yOP1CMvzHIWYxi1l2oLPFo=
cosmossdk.io/x/tx v0.10.1-0.20230920120022-6715b5afb59f h1:Dkw1pM+jnjK9Pk0CM6JZKLLDaMXWDCHSlLJiHcSmPpg=
cosmossdk.io/x/tx v0.10.1-0.20230920120022-6715b5afb59f/go.mod h1:lRM7U4VkxFjWBKZp7Mo818azphiNixeMCV8h1ZofkhM=
cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d h1:LH8NPa2+yoMFdCTxCFyQUX5zVDip4YDgtg7e0EecDqo=
cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d/go.mod h1:+5jCm6Lk/CrQhQvtJFy/tmuLfhQKNMn/U0vwrRz/dxQ=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
@ -1706,8 +1706,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY=
gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

View File

@ -1204,13 +1204,6 @@ func (s *CLITestSuite) TestAuxToFeeWithTips() {
genTxFile := testutil.WriteToNewTempFile(s.T(), string(res.Bytes()))
defer genTxFile.Close()
// broadcast the tx
res, err = authtestutil.TxAuxToFeeExec(
s.clientCtx,
genTxFile.Name(),
tc.feePayerArgs...,
)
switch {
case tc.expectErrBroadCast:
require.Error(err)

View File

@ -49,7 +49,6 @@ import (
"github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/bech32"
"github.com/cosmos/cosmos-sdk/types/module/testutil"
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
@ -149,10 +148,6 @@ func TestAminoJSON_Equivalence(t *testing.T) {
AccNum: 1,
AccSeq: 2,
SignerAddress: "signerAddress",
Tip: &txv1beta1.Tip{
Tipper: "tipper",
Amount: []*v1beta1.Coin{{Denom: "uatom", Amount: "1000"}},
},
Fee: &txv1beta1.Fee{
Amount: []*v1beta1.Coin{{Denom: "uatom", Amount: "1000"}},
},
@ -170,10 +165,6 @@ func TestAminoJSON_Equivalence(t *testing.T) {
require.NoError(t, txBuilder.SetMsgs([]types.Msg{tt.Gogo}...))
txBuilder.SetMemo(handlerOptions.Memo)
txBuilder.SetFeeAmount(types.Coins{types.NewInt64Coin("uatom", 1000)})
txBuilder.SetTip(&txtypes.Tip{
Amount: types.Coins{types.NewInt64Coin("uatom", 1000)},
Tipper: "tipper",
})
theTx := txBuilder.GetTx()
legacySigningData := signing.SignerData{

View File

@ -17,12 +17,6 @@ func (s *SignDocDirectAux) ValidateBasic() error {
return sdkerrors.ErrInvalidPubKey.Wrap("public key cannot be empty")
}
if s.Tip != nil {
if s.Tip.Tipper == "" {
return sdkerrors.ErrInvalidRequest.Wrap("tipper cannot be empty")
}
}
return nil
}

View File

@ -14,7 +14,7 @@ import (
func TestSignDocDirectAux(t *testing.T) {
bodyBz := []byte{42}
_, pk, addr := testdata.KeyTestPubAddr()
_, pk, _ := testdata.KeyTestPubAddr()
pkAny, err := codectypes.NewAnyWithValue(pk)
require.NoError(t, err)
@ -25,12 +25,10 @@ func TestSignDocDirectAux(t *testing.T) {
}{
{"empty bodyBz", tx.SignDocDirectAux{}, true},
{"empty pubkey", tx.SignDocDirectAux{BodyBytes: bodyBz}, true},
{"empty tipper", tx.SignDocDirectAux{BodyBytes: bodyBz, PublicKey: pkAny, Tip: &tx.Tip{Amount: testdata.NewTestFeeAmount()}}, true},
{"happy case w/o tip", tx.SignDocDirectAux{BodyBytes: bodyBz, PublicKey: pkAny}, false},
{"happy case w/ tip", tx.SignDocDirectAux{
BodyBytes: bodyBz,
PublicKey: pkAny,
Tip: &tx.Tip{Tipper: addr.String(), Amount: testdata.NewTestFeeAmount()},
}, false},
}

View File

@ -49,8 +49,7 @@ const (
SignMode_SIGN_MODE_TEXTUAL SignMode = 2
// SIGN_MODE_DIRECT_AUX specifies a signing mode which uses
// SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not
// require signers signing over other signers' `signer_info`. It also allows
// for adding Tips in transactions.
// require signers signing over other signers' `signer_info`.
//
// Since: cosmos-sdk 0.46
SignMode_SIGN_MODE_DIRECT_AUX SignMode = 3

View File

@ -1,11 +0,0 @@
package tx
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
// TipTx defines the interface to be implemented by Txs that handle Tips.
type TipTx interface {
sdk.FeeTx
GetTip() *Tip
}

View File

@ -264,13 +264,8 @@ type SignDocDirectAux struct {
AccountNumber uint64 `protobuf:"varint,4,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"`
// sequence is the sequence number of the signing account.
Sequence uint64 `protobuf:"varint,5,opt,name=sequence,proto3" json:"sequence,omitempty"`
// Tip is the optional tip used for transactions fees paid in another denom.
// It should be left empty if the signer is not the tipper for this
// transaction.
//
// This field is ignored if the chain didn't enable tips, i.e. didn't add the
// `TipDecorator` in its posthandler.
Tip *Tip `protobuf:"bytes,6,opt,name=tip,proto3" json:"tip,omitempty"`
// tips have been depreacted and should not be used
Tip *Tip `protobuf:"bytes,6,opt,name=tip,proto3" json:"tip,omitempty"` // Deprecated: Do not use.
}
func (m *SignDocDirectAux) Reset() { *m = SignDocDirectAux{} }
@ -341,6 +336,7 @@ func (m *SignDocDirectAux) GetSequence() uint64 {
return 0
}
// Deprecated: Do not use.
func (m *SignDocDirectAux) GetTip() *Tip {
if m != nil {
return m.Tip
@ -462,7 +458,7 @@ type AuthInfo struct {
// `TipDecorator` in its posthandler.
//
// Since: cosmos-sdk 0.46
Tip *Tip `protobuf:"bytes,3,opt,name=tip,proto3" json:"tip,omitempty"`
Tip *Tip `protobuf:"bytes,3,opt,name=tip,proto3" json:"tip,omitempty"` // Deprecated: Do not use.
}
func (m *AuthInfo) Reset() { *m = AuthInfo{} }
@ -512,6 +508,7 @@ func (m *AuthInfo) GetFee() *Fee {
return nil
}
// Deprecated: Do not use.
func (m *AuthInfo) GetTip() *Tip {
if m != nil {
return m.Tip
@ -866,6 +863,8 @@ func (m *Fee) GetGranter() string {
// Tip is the tip used for meta-transactions.
//
// Since: cosmos-sdk 0.46
//
// Deprecated: Do not use.
type Tip struct {
// amount is the amount of the tip
Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
@ -1021,73 +1020,74 @@ func init() {
func init() { proto.RegisterFile("cosmos/tx/v1beta1/tx.proto", fileDescriptor_96d1575ffde80842) }
var fileDescriptor_96d1575ffde80842 = []byte{
// 1052 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x41, 0x6f, 0x1b, 0xc5,
0x17, 0xf7, 0x7a, 0x6d, 0xc7, 0x7e, 0x4d, 0xda, 0x64, 0x14, 0xfd, 0xe5, 0x38, 0xaa, 0x9b, 0xbf,
0xab, 0x82, 0x55, 0x29, 0xbb, 0x6d, 0x7a, 0xa0, 0x20, 0x04, 0xd8, 0x0d, 0x51, 0xaa, 0x52, 0x90,
0x36, 0x39, 0xf5, 0xb2, 0x1a, 0xaf, 0x27, 0xeb, 0x51, 0xbd, 0x33, 0xcb, 0xce, 0x2c, 0x78, 0x8f,
0x7c, 0x00, 0xa4, 0x0a, 0x09, 0x21, 0x71, 0xe2, 0x88, 0x38, 0x55, 0x88, 0x0f, 0xd1, 0x13, 0xaa,
0x38, 0x71, 0x82, 0x2a, 0x39, 0xf4, 0xc6, 0x57, 0x00, 0xcd, 0xec, 0xec, 0x26, 0x2d, 0xa9, 0x0d,
0x02, 0x89, 0x8b, 0x3d, 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, 0xf3, 0x49,
0xb7, 0xf2, 0xe0, 0xda, 0xe2, 0x24, 0xbb, 0x72, 0x36, 0x6a, 0xe8, 0xe6, 0x74, 0xeb, 0x8f, 0x00,
0x00, 0x00, 0xff, 0xff, 0x1f, 0x66, 0x4c, 0xda, 0x17, 0x0a, 0x00, 0x00,
// 1059 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x41, 0x6f, 0x1b, 0x45,
0x14, 0xf6, 0x7a, 0x6d, 0xc7, 0x7e, 0x4d, 0xda, 0x64, 0x14, 0x21, 0xc7, 0x51, 0xdd, 0xe0, 0xaa,
0x60, 0x55, 0x64, 0xb7, 0x4d, 0x0f, 0x94, 0x0a, 0x01, 0x76, 0x43, 0x94, 0xaa, 0x14, 0xa4, 0x4d,
0x4e, 0xbd, 0xac, 0xc6, 0xeb, 0xc9, 0x7a, 0x54, 0xef, 0xcc, 0xb2, 0x33, 0x0b, 0xde, 0x23, 0x3f,
0x00, 0xa9, 0x42, 0x42, 0x48, 0x9c, 0x39, 0x20, 0x4e, 0x3d, 0x20, 0x7e, 0x43, 0x4f, 0xa8, 0xe2,
0xc4, 0x09, 0xaa, 0xe4, 0xd0, 0x3b, 0x7f, 0x00, 0x34, 0xb3, 0xb3, 0x9b, 0xb4, 0xa4, 0x4e, 0x11,
0x48, 0x5c, 0xec, 0x99, 0xb7, 0xdf, 0x7b, 0xf3, 0xbd, 0x37, 0xdf, 0xbc, 0x07, 0x9d, 0x80, 0x8b,
0x88, 0x0b, 0x57, 0xce, 0xdc, 0xcf, 0xae, 0x8f, 0x88, 0xc4, 0xd7, 0x5d, 0x39, 0x73, 0xe2, 0x84,
0x4b, 0x8e, 0x56, 0xf2, 0x6f, 0x8e, 0x9c, 0x39, 0xe6, 0x5b, 0x67, 0x05, 0x47, 0x94, 0x71, 0x57,
0xff, 0xe6, 0xa8, 0xce, 0x6a, 0xc8, 0x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fd, 0xcb, 0x8f, 0x9b, 0xab, 0x86,
0xd9, 0x60, 0x3c, 0x4e, 0x88, 0x10, 0x7b, 0x32, 0xa1, 0x2c, 0xf4, 0x72, 0x18, 0xda, 0x82, 0x85,
0x30, 0xc1, 0x4c, 0x9a, 0xae, 0x37, 0xcf, 0xa3, 0x00, 0xf6, 0x7e, 0xb2, 0xc0, 0xde, 0xa7, 0xf1,
0xff, 0x59, 0x83, 0x6b, 0xd0, 0x90, 0x34, 0x8e, 0x49, 0x92, 0xf7, 0xc1, 0x39, 0xac, 0x0d, 0xee,
0x56, 0xb5, 0x6d, 0xf5, 0x7e, 0xb6, 0x60, 0x69, 0x90, 0xce, 0xf2, 0xc7, 0xbb, 0x8d, 0x25, 0x56,
0xe9, 0xe3, 0x1c, 0xae, 0xd5, 0x35, 0x37, 0x7d, 0x03, 0x44, 0xef, 0x41, 0x53, 0xc9, 0xd7, 0x1f,
0xf3, 0xc0, 0xbc, 0x8e, 0xcb, 0x2f, 0xe9, 0x4a, 0x27, 0xa7, 0x9a, 0xb7, 0x20, 0xcc, 0xf0, 0x2d,
0x5e, 0x85, 0xfd, 0x0f, 0x5f, 0x05, 0x5a, 0x06, 0x5b, 0xd0, 0x50, 0xdf, 0xd3, 0xa2, 0xa7, 0x96,
0xc3, 0xf7, 0x1f, 0x1f, 0x76, 0xad, 0x27, 0x87, 0x5d, 0xeb, 0xe9, 0x61, 0xd7, 0x7a, 0x78, 0xd4,
0xad, 0x3c, 0x39, 0xea, 0x56, 0x7e, 0x3d, 0xea, 0x56, 0xee, 0x5f, 0x39, 0xbb, 0xd0, 0xae, 0x9c,
0x8d, 0x1a, 0xba, 0x41, 0xdd, 0xf8, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x24, 0x52, 0x64, 0xe6, 0x23,
0x0a, 0x00, 0x00,
}
func (m *Tx) Marshal() (dAtA []byte, err error) {

View File

@ -481,17 +481,6 @@ simd tx broadcast tx.signed.json
More information about the `broadcast` command can be found running `simd tx broadcast --help`.
#### `aux-to-fee`
The `aux-to-fee` comamnds includes the aux signer data in the tx, broadcast the tx, and sends the tip amount to the broadcaster.
[Learn more about tip transaction](https://docs.cosmos.network/main/core/tips).
```bash
# simd tx bank send <from> <to> <amount> --aux (optional: --tip <tipAmt> --tipper <tipper>)
simd tx aux-to-fee tx.aux.signed.json
```
More information about the `aux-to-fee` command can be found running `simd tx aux-to-fee --help`.
### gRPC

View File

@ -1,93 +0,0 @@
package cli
import (
"fmt"
"os"
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
clienttx "github.com/cosmos/cosmos-sdk/client/tx"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/tx"
authclient "github.com/cosmos/cosmos-sdk/x/auth/client"
)
func GetAuxToFeeCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "aux-to-fee <aux_signed_tx.json>",
Short: "Includes the aux signer data in the tx, broadcast the tx, and sends the tip amount to the broadcaster",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return err
}
auxSignerData := tx.AuxSignerData{}
err = readAuxSignerData(clientCtx.Codec, &auxSignerData, args[0])
if err != nil {
return err
}
if auxSignerData.SignDoc.ChainId != clientCtx.ChainID {
return fmt.Errorf("expected chain-id %s, got %s in aux signer data", clientCtx.ChainID, auxSignerData.SignDoc.ChainId)
}
f, err := clienttx.NewFactoryCLI(clientCtx, cmd.Flags())
if err != nil {
return err
}
txBuilder := clientCtx.TxConfig.NewTxBuilder()
err = txBuilder.AddAuxSignerData(auxSignerData)
if err != nil {
return err
}
txBuilder.SetFeePayer(clientCtx.FromAddress)
txBuilder.SetFeeAmount(f.Fees())
txBuilder.SetGasLimit(f.Gas())
if clientCtx.GenerateOnly {
json, err := clientCtx.TxConfig.TxJSONEncoder()(txBuilder.GetTx())
if err != nil {
return err
}
return clientCtx.PrintString(fmt.Sprintf("%s\n", json))
}
err = authclient.SignTx(f, clientCtx, clientCtx.FromName, txBuilder, clientCtx.Offline, false)
if err != nil {
return err
}
txBytes, err := clientCtx.TxConfig.TxEncoder()(txBuilder.GetTx())
if err != nil {
return err
}
// broadcast to a CometBFT node
res, err := clientCtx.BroadcastTx(txBytes)
if err != nil {
return err
}
return clientCtx.PrintProto(res)
},
}
flags.AddTxFlagsToCmd(cmd)
return cmd
}
func readAuxSignerData(cdc codec.Codec, auxSignerData *tx.AuxSignerData, filename string) error {
bytes, err := os.ReadFile(filename)
if err != nil {
return err
}
return cdc.UnmarshalJSON(bytes, auxSignerData)
}

View File

@ -80,15 +80,6 @@ func TxDecodeExec(clientCtx client.Context, encodedTx string, extraArgs ...strin
return clitestutil.ExecTestCLICmd(clientCtx, cli.GetDecodeCommand(), append(args, extraArgs...))
}
// TxAuxToFeeExec executes `GetAuxToFeeCommand` cli command with given args.
func TxAuxToFeeExec(clientCtx client.Context, filename string, extraArgs ...string) (testutil.BufferWriter, error) {
args := []string{
filename,
}
return clitestutil.ExecTestCLICmd(clientCtx, cli.GetAuxToFeeCommand(), append(args, extraArgs...))
}
func TxMultiSignBatchExec(clientCtx client.Context, filename, from, sigFile1, sigFile2 string, extraArgs ...string) (testutil.BufferWriter, error) {
args := []string{
fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest),

View File

@ -14,7 +14,6 @@ import (
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/crypto/types/multisig"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/tx"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
)
@ -41,7 +40,6 @@ type StdSignDoc struct {
Memo string `json:"memo" yaml:"memo"`
Fee json.RawMessage `json:"fee" yaml:"fee"`
Msgs []json.RawMessage `json:"msgs" yaml:"msgs"`
Tip *StdTip `json:"tip,omitempty" yaml:"tip"`
}
var RegressionTestingAminoCodec *codec.LegacyAmino
@ -62,7 +60,7 @@ func mustSortJSON(bz []byte) []byte {
// StdSignBytes returns the bytes to sign for a transaction.
// Deprecated: Please use x/tx/signing/aminojson instead.
func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee, msgs []sdk.Msg, memo string, tip *tx.Tip) []byte {
func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee, msgs []sdk.Msg, memo string) []byte {
if RegressionTestingAminoCodec == nil {
panic(fmt.Errorf("must set RegressionTestingAminoCodec before calling StdSignBytes"))
}
@ -72,15 +70,6 @@ func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee,
msgsBytes = append(msgsBytes, mustSortJSON(bz))
}
var stdTip *StdTip
if tip != nil {
if tip.Tipper == "" {
panic(fmt.Errorf("tipper cannot be empty"))
}
stdTip = &StdTip{Amount: tip.Amount, Tipper: tip.Tipper}
}
bz, err := legacy.Cdc.MarshalJSON(StdSignDoc{
AccountNumber: accnum,
ChainID: chainID,
@ -89,7 +78,6 @@ func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee,
Msgs: msgsBytes,
Sequence: sequence,
TimeoutHeight: timeout,
Tip: stdTip,
})
if err != nil {
panic(err)

View File

@ -8,7 +8,6 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/tx"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
)
@ -170,9 +169,6 @@ func (tx StdTx) FeeGranter() sdk.AccAddress {
return nil
}
// GetTip always returns nil for StdTx
func (tx StdTx) GetTip() *tx.Tip { return nil }
func (tx StdTx) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
for _, m := range tx.Msgs {
err := codectypes.UnpackInterfaces(m, unpacker)

View File

@ -45,10 +45,6 @@ func (s *StdTxBuilder) SetGasLimit(limit uint64) {
s.StdTx.Fee.Gas = limit
}
func (s *StdTxBuilder) SetTip(tip *tx.Tip) {
panic("StdTxBuilder does not support tips")
}
// SetMemo implements TxBuilder.SetMemo
func (s *StdTxBuilder) SetMemo(memo string) {
s.Memo = memo

View File

@ -39,16 +39,11 @@ func TestStdSignBytes(t *testing.T) {
fee *txv1beta1.Fee
msgs []sdk.Msg
memo string
tip *txv1beta1.Tip
}
defaultFee := &txv1beta1.Fee{
Amount: []*basev1beta1.Coin{{Denom: "atom", Amount: "150"}},
GasLimit: 100000,
}
defaultTip := &txv1beta1.Tip{
Amount: []*basev1beta1.Coin{{Denom: "tiptoken", Amount: "150"}},
Tipper: addr.String(),
}
msgStr := fmt.Sprintf(`{"type":"testpb/TestMsg","value":{"signers":["%s"]}}`, addr)
tests := []struct {
name string
@ -57,54 +52,39 @@ func TestStdSignBytes(t *testing.T) {
}{
{
"with timeout height",
args{"1234", 3, 6, 10, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil},
args{"1234", 3, 6, 10, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"},
fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000"},"memo":"memo","msgs":[%s],"sequence":"6","timeout_height":"10"}`, msgStr),
},
{
"no timeout height (omitempty)",
args{"1234", 3, 6, 0, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil},
args{"1234", 3, 6, 0, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"},
fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000"},"memo":"memo","msgs":[%s],"sequence":"6"}`, msgStr),
},
{
"empty fee",
args{"1234", 3, 6, 0, &txv1beta1.Fee{}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil},
args{"1234", 3, 6, 0, &txv1beta1.Fee{}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"},
fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[%s],"sequence":"6"}`, msgStr),
},
{
"no fee payer and fee granter (both omitempty)",
args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil},
args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"},
fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000"},"memo":"memo","msgs":[%s],"sequence":"6"}`, msgStr),
},
{
"with fee granter, no fee payer (omitempty)",
args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Granter: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil},
args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Granter: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"},
fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","granter":"%s"},"memo":"memo","msgs":[%s],"sequence":"6"}`, addr, msgStr),
},
{
"with fee payer, no fee granter (omitempty)",
args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil},
args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"},
fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","payer":"%s"},"memo":"memo","msgs":[%s],"sequence":"6"}`, addr, msgStr),
},
{
"with fee payer and fee granter",
args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String(), Granter: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil},
args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String(), Granter: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"},
fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","granter":"%s","payer":"%s"},"memo":"memo","msgs":[%s],"sequence":"6"}`, addr, addr, msgStr),
},
{
"no fee, with tip",
args{"1234", 3, 6, 0, &txv1beta1.Fee{}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", defaultTip},
fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[%s],"sequence":"6","tip":{"amount":[{"amount":"150","denom":"tiptoken"}],"tipper":"%s"}}`, msgStr, addr),
},
{
"with fee and with tip",
args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", defaultTip},
fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","payer":"%s"},"memo":"memo","msgs":[%s],"sequence":"6","tip":{"amount":[{"amount":"150","denom":"tiptoken"}],"tipper":"%s"}}`, addr, msgStr, addr),
},
{
"with empty tip (but not nil), tipper cannot be empty",
args{"1234", 3, 6, 0, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", &txv1beta1.Tip{Tipper: addr.String()}},
fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000"},"memo":"memo","msgs":[%s],"sequence":"6","tip":{"amount":[],"tipper":"%s"}}`, msgStr, addr),
},
}
handler := aminojson.NewSignModeHandler(aminojson.SignModeHandlerOptions{
FileResolver: proto.HybridResolver,
@ -137,7 +117,6 @@ func TestStdSignBytes(t *testing.T) {
},
AuthInfo: &txv1beta1.AuthInfo{
Fee: tc.args.fee,
Tip: tc.args.tip,
},
},
)

View File

@ -1,58 +0,0 @@
package posthandler
import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/tx"
"github.com/cosmos/cosmos-sdk/x/auth/types"
)
// ValidateBasicDecorator will call tx.ValidateBasic and return any non-nil error.
// If ValidateBasic passes, decorator calls next AnteHandler in chain. Note,
// ValidateBasicDecorator decorator will not get executed on ReCheckTx since it
// is not dependent on application state.
type tipDecorator struct {
bankKeeper types.BankKeeper
}
// NewTipDecorator returns a new decorator for handling transactions with
// tips.
//
// IMPORTANT: This decorator is still in beta, please use it at your own risk.
func NewTipDecorator(bankKeeper types.BankKeeper) sdk.AnteDecorator {
return tipDecorator{
bankKeeper: bankKeeper,
}
}
func (d tipDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
err := d.transferTip(ctx, tx)
if err != nil {
return ctx, err
}
return next(ctx, tx, simulate)
}
// transferTip transfers the tip from the tipper to the fee payer.
func (d tipDecorator) transferTip(ctx sdk.Context, sdkTx sdk.Tx) error {
tipTx, ok := sdkTx.(tx.TipTx)
// No-op if the tx doesn't have tips.
if !ok || tipTx.GetTip() == nil {
return nil
}
tipper, err := sdk.AccAddressFromBech32(tipTx.GetTip().Tipper)
if err != nil {
return err
}
coins := tipTx.GetTip().Amount
if err := d.bankKeeper.IsSendEnabledCoins(ctx, coins...); err != nil {
return fmt.Errorf("cannot tip these coins: %w", err)
}
return d.bankKeeper.SendCoins(ctx, tipper, tipTx.FeePayer(), coins)
}

View File

@ -3,7 +3,6 @@ package signing
import (
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/tx"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
)
@ -23,7 +22,6 @@ type Tx interface {
types.TxWithMemo
types.FeeTx
tx.TipTx
types.TxWithTimeoutHeight
types.HasValidateBasic
}

View File

@ -54,23 +54,6 @@ func (w *wrapper) GetSigningTxData() txsigning.TxData {
}
}
var txTip *txv1beta1.Tip
tip := authInfo.Tip
if tip != nil {
tipCoins := tip.GetAmount()
tipAmount := make([]*basev1beta1.Coin, len(tipCoins))
for i, coin := range tipCoins {
tipAmount[i] = &basev1beta1.Coin{
Denom: coin.Denom,
Amount: coin.Amount.String(),
}
}
txTip = &txv1beta1.Tip{
Amount: tipAmount,
Tipper: tip.Tipper,
}
}
txSignerInfos := make([]*txv1beta1.SignerInfo, len(authInfo.SignerInfos))
for i, signerInfo := range authInfo.SignerInfos {
modeInfo := &txv1beta1.ModeInfo{}
@ -94,7 +77,6 @@ func (w *wrapper) GetSigningTxData() txsigning.TxData {
Payer: authInfo.Fee.Payer,
Granter: authInfo.Fee.Granter,
},
Tip: txTip,
}
txBody := &txv1beta1.TxBody{

View File

@ -6,15 +6,12 @@ import (
"github.com/stretchr/testify/require"
"cosmossdk.io/math"
clienttx "github.com/cosmos/cosmos-sdk/client/tx"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
_ "github.com/cosmos/cosmos-sdk/testutil/testdata/testpb"
sdk "github.com/cosmos/cosmos-sdk/types"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
)
@ -25,9 +22,9 @@ var (
aux2Priv, aux2Pk, aux2Addr = testdata.KeyTestPubAddr()
feepayerPriv, feepayerPk, feepayerAddr = testdata.KeyTestPubAddr()
msg = testdata.NewTestMsg(tipperAddr, aux2Addr)
memo = "test-memo"
tip = &txtypes.Tip{Tipper: tipperAddr.String(), Amount: sdk.NewCoins(sdk.NewCoin("tip-denom", math.NewIntFromUint64(123)))}
msg = testdata.NewTestMsg(tipperAddr, aux2Addr)
memo = "test-memo"
chainID = "test-chain"
gas = testdata.NewTestGasLimit()
fee = testdata.NewTestFeeAmount()
@ -47,8 +44,8 @@ func TestBuilderWithAux(t *testing.T) {
testdata.RegisterInterfaces(interfaceRegistry)
// Create an AuxTxBuilder for tipper (1st signer)
tipperBuilder, tipperSig := makeTipperTxBuilder(t)
tipperSignerData, err := tipperBuilder.GetAuxSignerData()
txBuilder, txSig := makeTxBuilder(t)
txSignerData, err := txBuilder.GetAuxSignerData()
require.NoError(t, err)
// Create an AuxTxBuilder for aux2 (2nd signer)
@ -59,9 +56,10 @@ func TestBuilderWithAux(t *testing.T) {
aux2Builder.SetTimeoutHeight(3)
aux2Builder.SetMemo(memo)
aux2Builder.SetChainID(chainID)
aux2Builder.SetMsgs(msg)
aux2Builder.SetPubKey(aux2Pk)
aux2Builder.SetTip(tip)
err = aux2Builder.SetMsgs(msg)
require.NoError(t, err)
err = aux2Builder.SetPubKey(aux2Pk)
require.NoError(t, err)
extOptAny, err := codectypes.NewAnyWithValue(extOpt)
require.NoError(t, err)
aux2Builder.SetExtensionOptions(extOptAny)
@ -90,30 +88,28 @@ func TestBuilderWithAux(t *testing.T) {
malleate func()
expErr bool
}{
{"address and msg signer mistacher", func() { tipperBuilder.SetAddress("foobar") }, true},
{"memo mismatch", func() { tipperBuilder.SetMemo("mismatch") }, true},
{"timeout height mismatch", func() { tipperBuilder.SetTimeoutHeight(98) }, true},
{"extension options length mismatch", func() { tipperBuilder.SetExtensionOptions() }, true},
{"extension options member mismatch", func() { tipperBuilder.SetExtensionOptions(&codectypes.Any{}) }, true},
{"non-critical extension options length mismatch", func() { tipperBuilder.SetNonCriticalExtensionOptions() }, true},
{"non-critical extension options member mismatch", func() { tipperBuilder.SetNonCriticalExtensionOptions(&codectypes.Any{}) }, true},
{"tip amount mismatch", func() { tipperBuilder.SetTip(&txtypes.Tip{Tipper: tip.Tipper, Amount: sdk.NewCoins()}) }, true},
{"tipper mismatch", func() { tipperBuilder.SetTip(&txtypes.Tip{Tipper: "mismatch", Amount: tip.Amount}) }, true},
{"address and msg signer mistacher", func() { txBuilder.SetAddress("foobar") }, true},
{"memo mismatch", func() { txBuilder.SetMemo("mismatch") }, true},
{"timeout height mismatch", func() { txBuilder.SetTimeoutHeight(98) }, true},
{"extension options length mismatch", func() { txBuilder.SetExtensionOptions() }, true},
{"extension options member mismatch", func() { txBuilder.SetExtensionOptions(&codectypes.Any{}) }, true},
{"non-critical extension options length mismatch", func() { txBuilder.SetNonCriticalExtensionOptions() }, true},
{"non-critical extension options member mismatch", func() { txBuilder.SetNonCriticalExtensionOptions(&codectypes.Any{}) }, true},
{"happy case", func() {}, false},
}
for _, tc := range testcases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
tipperBuilder, tipperSig = makeTipperTxBuilder(t)
txBuilder, txSig = makeTxBuilder(t)
tc.malleate()
_, err := tipperBuilder.GetSignBytes()
_, err := txBuilder.GetSignBytes()
require.NoError(t, err)
tipperSignerData, err = tipperBuilder.GetAuxSignerData()
txSignerData, err = txBuilder.GetAuxSignerData()
require.NoError(t, err)
err = w.AddAuxSignerData(tipperSignerData)
err = w.AddAuxSignerData(txSignerData)
if tc.expErr {
require.Error(t, err)
} else {
@ -127,10 +123,10 @@ func TestBuilderWithAux(t *testing.T) {
w.SetGasLimit(gas)
sigs, err := w.(authsigning.SigVerifiableTx).GetSignaturesV2()
require.NoError(t, err)
tipperSigV2 := sigs[0]
txSigV2 := sigs[0]
aux2SigV2 := sigs[1]
// Set all signer infos.
w.SetSignatures(tipperSigV2, aux2SigV2, signing.SignatureV2{
w.SetSignatures(txSigV2, aux2SigV2, signing.SignatureV2{
PubKey: feepayerPk,
Sequence: 15,
})
@ -150,7 +146,7 @@ func TestBuilderWithAux(t *testing.T) {
feepayerSig, err := feepayerPriv.Sign(signBz)
require.NoError(t, err)
// Set all signatures.
w.SetSignatures(tipperSigV2, aux2SigV2, signing.SignatureV2{
w.SetSignatures(txSigV2, aux2SigV2, signing.SignatureV2{
PubKey: feepayerPk,
Data: &signing.SingleSignatureData{
SignMode: signing.SignMode_SIGN_MODE_DIRECT,
@ -167,7 +163,6 @@ func TestBuilderWithAux(t *testing.T) {
require.Equal(t, tx.(sdk.FeeTx).FeePayer(), []byte(feepayerAddr))
require.Equal(t, tx.(sdk.FeeTx).GetFee(), fee)
require.Equal(t, tx.(sdk.FeeTx).GetGas(), gas)
require.Equal(t, tip, tx.(txtypes.TipTx).GetTip())
require.Equal(t, msg, tx.GetMsgs()[0])
require.Equal(t, memo, tx.(sdk.TxWithMemo).GetMemo())
require.Equal(t, uint64(3), tx.(sdk.TxWithTimeoutHeight).GetTimeoutHeight())
@ -176,7 +171,7 @@ func TestBuilderWithAux(t *testing.T) {
require.Len(t, sigs, 3)
require.Equal(t, signing.SignatureV2{
PubKey: tipperPk,
Data: &signing.SingleSignatureData{SignMode: signing.SignMode_SIGN_MODE_DIRECT_AUX, Signature: tipperSig},
Data: &signing.SingleSignatureData{SignMode: signing.SignMode_SIGN_MODE_DIRECT_AUX, Signature: txSig},
Sequence: 2,
}, sigs[0])
require.Equal(t, signing.SignatureV2{
@ -191,28 +186,30 @@ func TestBuilderWithAux(t *testing.T) {
}, sigs[2])
}
func makeTipperTxBuilder(t *testing.T) (clienttx.AuxTxBuilder, []byte) {
tipperBuilder := clienttx.NewAuxTxBuilder()
tipperBuilder.SetAddress(tipperAddr.String())
tipperBuilder.SetAccountNumber(1)
tipperBuilder.SetSequence(2)
tipperBuilder.SetTimeoutHeight(3)
tipperBuilder.SetMemo(memo)
tipperBuilder.SetChainID(chainID)
tipperBuilder.SetMsgs(msg)
tipperBuilder.SetPubKey(tipperPk)
tipperBuilder.SetTip(tip)
func makeTxBuilder(t *testing.T) (clienttx.AuxTxBuilder, []byte) {
t.Helper()
txBuilder := clienttx.NewAuxTxBuilder()
txBuilder.SetAddress(tipperAddr.String())
txBuilder.SetAccountNumber(1)
txBuilder.SetSequence(2)
txBuilder.SetTimeoutHeight(3)
txBuilder.SetMemo(memo)
txBuilder.SetChainID(chainID)
err := txBuilder.SetMsgs(msg)
require.NoError(t, err)
err = txBuilder.SetPubKey(tipperPk)
require.NoError(t, err)
extOptAny, err := codectypes.NewAnyWithValue(extOpt)
require.NoError(t, err)
tipperBuilder.SetExtensionOptions(extOptAny)
tipperBuilder.SetNonCriticalExtensionOptions(extOptAny)
err = tipperBuilder.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX)
txBuilder.SetExtensionOptions(extOptAny)
txBuilder.SetNonCriticalExtensionOptions(extOptAny)
err = txBuilder.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX)
require.NoError(t, err)
signBz, err := tipperBuilder.GetSignBytes()
signBz, err := txBuilder.GetSignBytes()
require.NoError(t, err)
tipperSig, err := tipperPriv.Sign(signBz)
require.NoError(t, err)
tipperBuilder.SetSignature(tipperSig)
txBuilder.SetSignature(tipperSig)
return tipperBuilder, tipperSig
return txBuilder, tipperSig
}

View File

@ -45,10 +45,8 @@ type wrapper struct {
var (
_ authsigning.Tx = &wrapper{}
_ client.TxBuilder = &wrapper{}
_ tx.TipTx = &wrapper{}
_ ante.HasExtensionOptionsTx = &wrapper{}
_ ExtensionOptionsTxBuilder = &wrapper{}
_ tx.TipTx = &wrapper{}
)
// ExtensionOptionsTxBuilder defines a TxBuilder that can also set extensions.
@ -214,10 +212,6 @@ func (w *wrapper) FeeGranter() []byte {
return w.tx.FeeGranter(w.cdc)
}
func (w *wrapper) GetTip() *tx.Tip {
return w.tx.AuthInfo.Tip
}
func (w *wrapper) GetMemo() string {
return w.tx.Body.Memo
}
@ -318,13 +312,6 @@ func (w *wrapper) SetFeeAmount(coins sdk.Coins) {
w.authInfoBz = nil
}
func (w *wrapper) SetTip(tip *tx.Tip) {
w.tx.AuthInfo.Tip = tip
// set authInfoBz to nil because the cached authInfoBz no longer matches tx.AuthInfo
w.authInfoBz = nil
}
func (w *wrapper) SetFeePayer(feePayer sdk.AccAddress) {
if w.tx.AuthInfo.Fee == nil {
w.tx.AuthInfo.Fee = &tx.Fee{}
@ -499,14 +486,6 @@ func (w *wrapper) AddAuxSignerData(data tx.AuxSignerData) error {
}
}
}
if w.tx.AuthInfo.Tip != nil && data.SignDoc.Tip != nil {
if !w.tx.AuthInfo.Tip.Amount.Equal(data.SignDoc.Tip.Amount) {
return sdkerrors.ErrInvalidRequest.Wrapf("TxBuilder has tip %+v, got %+v in AuxSignerData", w.tx.AuthInfo.Tip.Amount, data.SignDoc.Tip.Amount)
}
if w.tx.AuthInfo.Tip.Tipper != data.SignDoc.Tip.Tipper {
return sdkerrors.ErrInvalidRequest.Wrapf("TxBuilder has tipper %s, got %s in AuxSignerData", w.tx.AuthInfo.Tip.Tipper, data.SignDoc.Tip.Tipper)
}
}
w.SetMemo(body.Memo)
w.SetTimeoutHeight(body.TimeoutHeight)
@ -520,7 +499,6 @@ func (w *wrapper) AddAuxSignerData(data tx.AuxSignerData) error {
if err != nil {
return err
}
w.SetTip(data.GetSignDoc().GetTip())
// Get the aux signer's index in GetSigners.
signerIndex := -1

View File

@ -50,7 +50,6 @@ func TestDirectAuxHandler(t *testing.T) {
}
fee := txtypes.Fee{Amount: sdk.NewCoins(sdk.NewInt64Coin("atom", 150)), GasLimit: 20000}
tip := &txtypes.Tip{Amount: sdk.NewCoins(sdk.NewInt64Coin("tip-token", 10))}
err = txBuilder.SetMsgs(msgs...)
require.NoError(t, err)
@ -58,7 +57,6 @@ func TestDirectAuxHandler(t *testing.T) {
txBuilder.SetFeeAmount(fee.Amount)
txBuilder.SetFeePayer(feePayerAddr)
txBuilder.SetGasLimit(fee.GasLimit)
txBuilder.SetTip(tip)
err = txBuilder.SetSignatures(sig, feePayerSig)
require.NoError(t, err)
@ -110,7 +108,6 @@ func TestDirectAuxHandler(t *testing.T) {
ChainId: "test-chain",
PublicKey: any,
Sequence: accSeq,
Tip: tip,
}
expectedSignBytes, err := signDocDirectAux.Marshal()

View File

@ -63,20 +63,6 @@ func (s signModeLegacyAminoJSONHandler) GetSignBytes(mode signingtypes.SignMode,
return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "got empty address in %s handler", signingtypes.SignMode_SIGN_MODE_LEGACY_AMINO_JSON)
}
tip := protoTx.GetTip()
isTipper := tip != nil && tip.Tipper == addr
// We set a convention that if the tipper signs with LEGACY_AMINO_JSON, then
// they sign over empty fees and 0 gas.
if isTipper {
return legacytx.StdSignBytes(
data.ChainID, data.AccountNumber, data.Sequence, protoTx.GetTimeoutHeight(),
// The tipper signs over 0 fee and 0 gas, no feepayer, no feegranter by convention.
legacytx.StdFee{},
tx.GetMsgs(), protoTx.GetMemo(), tip,
), nil
}
return legacytx.StdSignBytes(
data.ChainID, data.AccountNumber, data.Sequence, protoTx.GetTimeoutHeight(),
legacytx.StdFee{
@ -85,6 +71,6 @@ func (s signModeLegacyAminoJSONHandler) GetSignBytes(mode signingtypes.SignMode,
Payer: protoTx.tx.AuthInfo.Fee.Payer,
Granter: protoTx.tx.AuthInfo.Fee.Granter,
},
tx.GetMsgs(), protoTx.GetMemo(), tip,
tx.GetMsgs(), protoTx.GetMemo(),
), nil
}

View File

@ -14,7 +14,6 @@ import (
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/tx"
signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
"github.com/cosmos/cosmos-sdk/x/auth/signing"
@ -46,7 +45,6 @@ func TestLegacyAminoJSONHandler_GetSignBytes(t *testing.T) {
chainID = "test-chain"
accNum uint64 = 7
seqNum uint64 = 7
tip = &tx.Tip{Tipper: addr1.String(), Amount: coins}
)
testcases := []struct {
@ -58,22 +56,18 @@ func TestLegacyAminoJSONHandler_GetSignBytes(t *testing.T) {
{
"signer which is also fee payer (no tips)", addr1.String(),
func(w *wrapper) {},
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo, nil),
},
{
"signer which is also fee payer (with tips)", addr2.String(),
func(w *wrapper) { w.SetTip(tip) },
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo, tip),
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo),
},
{
"explicit fee payer", addr1.String(),
func(w *wrapper) { w.SetFeePayer(addr2) },
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo, nil),
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo),
},
{
"explicit fee granter", addr1.String(),
func(w *wrapper) { w.SetFeeGranter(addr2) },
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo, nil),
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo),
},
{
"explicit fee payer and fee granter", addr1.String(),
@ -81,12 +75,7 @@ func TestLegacyAminoJSONHandler_GetSignBytes(t *testing.T) {
w.SetFeePayer(addr2)
w.SetFeeGranter(addr2)
},
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo, nil),
},
{
"signer which is also tipper", addr1.String(),
func(w *wrapper) { w.SetTip(tip) },
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{}, []sdk.Msg{msg}, memo, tip),
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo),
},
}
@ -151,7 +140,6 @@ func TestLegacyAminoJSONHandler_AllGetSignBytesComparison(t *testing.T) {
chainID = "test-chain"
accNum uint64
seqNum uint64 = 7
tip = &tx.Tip{Tipper: addr1.String(), Amount: coins}
)
modeHandler := aminojson.NewSignModeHandler(aminojson.SignModeHandlerOptions{})
@ -169,22 +157,18 @@ func TestLegacyAminoJSONHandler_AllGetSignBytesComparison(t *testing.T) {
{
"signer which is also fee payer (no tips)", addr1.String(),
func(w *wrapper) {},
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo, nil),
},
{
"signer which is also fee payer (with tips)", addr2.String(),
func(w *wrapper) { w.SetTip(tip) },
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo, tip),
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo),
},
{
"explicit fee payer", addr1.String(),
func(w *wrapper) { w.SetFeePayer(addr2) },
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo, nil),
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo),
},
{
"explicit fee granter", addr1.String(),
func(w *wrapper) { w.SetFeeGranter(addr2) },
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo, nil),
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo),
},
{
"explicit fee payer and fee granter", addr1.String(),
@ -192,12 +176,7 @@ func TestLegacyAminoJSONHandler_AllGetSignBytesComparison(t *testing.T) {
w.SetFeePayer(addr2)
w.SetFeeGranter(addr2)
},
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo, nil),
},
{
"signer which is also tipper", addr1.String(),
func(w *wrapper) { w.SetTip(tip) },
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{}, []sdk.Msg{msg}, memo, tip),
legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo),
},
}

View File

@ -111,7 +111,7 @@ func TestAminoJSON(t *testing.T) {
for i, tt := range tests {
t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) {
tx.Msgs = []sdk.Msg{tt.msg}
legacyJSON := string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{tt.msg}, "memo", nil))
legacyJSON := string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{tt.msg}, "memo"))
require.Equal(t, tt.exp, legacyJSON)
legacyAny, err := cdctypes.NewAnyWithValue(tt.msg)

View File

@ -12,7 +12,7 @@ require (
cosmossdk.io/store v1.0.0-rc.0
github.com/cometbft/cometbft v0.38.0
github.com/cosmos/cosmos-proto v1.0.0-beta.3
github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230829152823-ca0f89e96ce9
github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230920204301-cbd0c511a8e9
github.com/cosmos/gogoproto v1.4.11
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3

View File

@ -182,8 +182,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0
github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U=
github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o=
github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I=
github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230829152823-ca0f89e96ce9 h1:y235JKySvAU3UgksIY5nk4t90WPozlkV9ZefDZvPE3c=
github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230829152823-ca0f89e96ce9/go.mod h1:olbHxcVB4zWwnF+oNPbKIoEIO5HgHndzKUqdpuu4s34=
github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230920204301-cbd0c511a8e9 h1:FNfBnRvrzzl3Clk//peoOZhtQ+NaDZJiStuw2kZl8Nc=
github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230920204301-cbd0c511a8e9/go.mod h1:8rNGga/Gg9/NIFvpqO4URts+8Cz/XVB0wTr5ZDm22UM=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=

View File

@ -34,13 +34,13 @@ func TestAminoJSON(t *testing.T) {
tx.Msgs = []sdk.Msg{msg}
require.Equal(t,
`{"account_number":"1","chain_id":"foo","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[{"type":"cosmos-sdk/MsgGrantAllowance","value":{"allowance":{"type":"cosmos-sdk/BasicAllowance","value":{"spend_limit":[{"amount":"100","denom":"foo"}]}},"grantee":"cosmos1def","granter":"cosmos1abc"}}],"sequence":"1","timeout_height":"1"}`,
string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo", nil)),
string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo")),
)
msg = &feegrant.MsgRevokeAllowance{Granter: "cosmos1abc", Grantee: "cosmos1def"}
tx.Msgs = []sdk.Msg{msg}
require.Equal(t,
`{"account_number":"1","chain_id":"foo","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[{"type":"cosmos-sdk/MsgRevokeAllowance","value":{"grantee":"cosmos1def","granter":"cosmos1abc"}}],"sequence":"1","timeout_height":"1"}`,
string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo", nil)),
string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo")),
)
}