feat: Add `SIGN_MODE_AMINO_AUX` handler (#10268)
<!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description Closes: #10249 <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
This commit is contained in:
parent
f726a2398a
commit
465ace2fc7
|
@ -2,6 +2,7 @@ package client
|
|||
|
||||
import (
|
||||
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/signing"
|
||||
)
|
||||
|
@ -41,6 +42,7 @@ type (
|
|||
SetMemo(memo string)
|
||||
SetFeeAmount(amount sdk.Coins)
|
||||
SetGasLimit(limit uint64)
|
||||
SetTip(tip *tx.Tip)
|
||||
SetTimeoutHeight(height uint64)
|
||||
SetFeeGranter(feeGranter sdk.AccAddress)
|
||||
}
|
||||
|
|
|
@ -2469,7 +2469,7 @@ ReflectionService defines a service for interface reflection.
|
|||
<a name="cosmos.base.reflection.v2alpha1.AppDescriptor"></a>
|
||||
|
||||
### AppDescriptor
|
||||
AppDescriptor describes a Cosmos SDK based application
|
||||
AppDescriptor describes a cosmos-sdk based application
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
|
@ -2750,7 +2750,7 @@ InterfaceImplementerDescriptor describes an interface implementer
|
|||
<a name="cosmos.base.reflection.v2alpha1.MsgDescriptor"></a>
|
||||
|
||||
### MsgDescriptor
|
||||
MsgDescriptor describes a Cosmos SDK message that can be delivered with a transaction
|
||||
MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
|
@ -2783,7 +2783,7 @@ because it would be redundant with the grpc reflection service
|
|||
<a name="cosmos.base.reflection.v2alpha1.QueryServiceDescriptor"></a>
|
||||
|
||||
### QueryServiceDescriptor
|
||||
QueryServiceDescriptor describes a Cosmos SDK queryable service
|
||||
QueryServiceDescriptor describes a cosmos-sdk queryable service
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
|
@ -2800,12 +2800,12 @@ QueryServiceDescriptor describes a Cosmos SDK queryable service
|
|||
<a name="cosmos.base.reflection.v2alpha1.QueryServicesDescriptor"></a>
|
||||
|
||||
### QueryServicesDescriptor
|
||||
QueryServicesDescriptor contains the list of Cosmos SDK queriable services
|
||||
QueryServicesDescriptor contains the list of cosmos-sdk queriable services
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| `query_services` | [QueryServiceDescriptor](#cosmos.base.reflection.v2alpha1.QueryServiceDescriptor) | repeated | query_services is a list of Cosmos SDK QueryServiceDescriptor |
|
||||
| `query_services` | [QueryServiceDescriptor](#cosmos.base.reflection.v2alpha1.QueryServiceDescriptor) | repeated | query_services is a list of cosmos-sdk QueryServiceDescriptor |
|
||||
|
||||
|
||||
|
||||
|
@ -2861,7 +2861,7 @@ ReflectionService defines a service for application reflection.
|
|||
|
||||
| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
|
||||
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
|
||||
| `GetAuthnDescriptor` | [GetAuthnDescriptorRequest](#cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest) | [GetAuthnDescriptorResponse](#cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse) | GetAuthnDescriptor returns information on how to authenticate transactions in the application NOTE: this RPC is still experimental and might be subject to breaking changes or removal in future releases of the Cosmos SDK. | GET|/cosmos/base/reflection/v1beta1/app_descriptor/authn|
|
||||
| `GetAuthnDescriptor` | [GetAuthnDescriptorRequest](#cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest) | [GetAuthnDescriptorResponse](#cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse) | GetAuthnDescriptor returns information on how to authenticate transactions in the application NOTE: this RPC is still experimental and might be subject to breaking changes or removal in future releases of the cosmos-sdk. | GET|/cosmos/base/reflection/v1beta1/app_descriptor/authn|
|
||||
| `GetChainDescriptor` | [GetChainDescriptorRequest](#cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest) | [GetChainDescriptorResponse](#cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse) | GetChainDescriptor returns the description of the chain | GET|/cosmos/base/reflection/v1beta1/app_descriptor/chain|
|
||||
| `GetCodecDescriptor` | [GetCodecDescriptorRequest](#cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest) | [GetCodecDescriptorResponse](#cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse) | GetCodecDescriptor returns the descriptor of the codec of the application | GET|/cosmos/base/reflection/v1beta1/app_descriptor/codec|
|
||||
| `GetConfigurationDescriptor` | [GetConfigurationDescriptorRequest](#cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest) | [GetConfigurationDescriptorResponse](#cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse) | GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application | GET|/cosmos/base/reflection/v1beta1/app_descriptor/configuration|
|
||||
|
@ -2882,7 +2882,7 @@ ReflectionService defines a service for application reflection.
|
|||
<a name="cosmos.base.snapshots.v1beta1.Metadata"></a>
|
||||
|
||||
### Metadata
|
||||
Metadata contains Cosmos SDK-specific snapshot metadata.
|
||||
Metadata contains SDK-specific snapshot metadata.
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
|
@ -3559,7 +3559,7 @@ Msg defines the bank Msg service.
|
|||
|
||||
### PrivKey
|
||||
Deprecated: PrivKey defines a ed25519 private key.
|
||||
NOTE: ed25519 keys must not be used in Cosmos SDK apps except in a tendermint validator context.
|
||||
NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context.
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
|
@ -3574,8 +3574,8 @@ NOTE: ed25519 keys must not be used in Cosmos SDK apps except in a tendermint va
|
|||
<a name="cosmos.crypto.ed25519.PubKey"></a>
|
||||
|
||||
### PubKey
|
||||
PubKey is an ed25519 public key for handling Tendermint keys in the Cosmos SDK.
|
||||
It's needed for Any serialization and Cosmos SDK compatibility.
|
||||
PubKey is an ed25519 public key for handling Tendermint keys in SDK.
|
||||
It's needed for Any serialization and SDK compatibility.
|
||||
It must not be used in a non Tendermint key context because it doesn't implement
|
||||
ADR-28. Nevertheless, you will like to use ed25519 in app user level
|
||||
then you must create a new proto message and follow ADR-28 for Address construction.
|
||||
|
@ -9089,7 +9089,7 @@ Query defines the gRPC querier service.
|
|||
<a name="cosmos.staking.v1beta1.MsgBeginRedelegate"></a>
|
||||
|
||||
### MsgBeginRedelegate
|
||||
MsgBeginRedelegate defines a Cosmos SDK message for performing a redelegation
|
||||
MsgBeginRedelegate defines a SDK message for performing a redelegation
|
||||
of coins from a delegator and source validator to a destination validator.
|
||||
|
||||
|
||||
|
@ -9123,7 +9123,7 @@ MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type.
|
|||
<a name="cosmos.staking.v1beta1.MsgCreateValidator"></a>
|
||||
|
||||
### MsgCreateValidator
|
||||
MsgCreateValidator defines a Cosmos SDK message for creating a new validator.
|
||||
MsgCreateValidator defines a SDK message for creating a new validator.
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
|
@ -9154,7 +9154,7 @@ MsgCreateValidatorResponse defines the Msg/CreateValidator response type.
|
|||
<a name="cosmos.staking.v1beta1.MsgDelegate"></a>
|
||||
|
||||
### MsgDelegate
|
||||
MsgDelegate defines a Cosmos SDK message for performing a delegation of coins
|
||||
MsgDelegate defines a SDK message for performing a delegation of coins
|
||||
from a delegator to a validator.
|
||||
|
||||
|
||||
|
@ -9182,7 +9182,7 @@ MsgDelegateResponse defines the Msg/Delegate response type.
|
|||
<a name="cosmos.staking.v1beta1.MsgEditValidator"></a>
|
||||
|
||||
### MsgEditValidator
|
||||
MsgEditValidator defines a Cosmos SDK message for editing an existing validator.
|
||||
MsgEditValidator defines a SDK message for editing an existing validator.
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
|
@ -9210,7 +9210,7 @@ MsgEditValidatorResponse defines the Msg/EditValidator response type.
|
|||
<a name="cosmos.staking.v1beta1.MsgUndelegate"></a>
|
||||
|
||||
### MsgUndelegate
|
||||
MsgUndelegate defines a Cosmos SDK message for performing an undelegation from a
|
||||
MsgUndelegate defines a SDK message for performing an undelegation from a
|
||||
delegate and a validator.
|
||||
|
||||
|
||||
|
@ -9367,6 +9367,7 @@ SignMode represents a signing mode with its own security guarantees.
|
|||
| SIGN_MODE_TEXTUAL | 2 | SIGN_MODE_TEXTUAL is a future signing mode that will verify some human-readable textual representation on top of the binary representation from SIGN_MODE_DIRECT. It is currently not supported. |
|
||||
| SIGN_MODE_DIRECT_JSON | 3 | SIGN_MODE_DIRECT_JSON specifies a signing mode which uses SignDocJSON. It is verified using a canonical JSON representation of the bytes used in SIGN_MODE_DIRECT. It is currently not supported. |
|
||||
| SIGN_MODE_DIRECT_AUX | 4 | 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. |
|
||||
| SIGN_MODE_AMINO_AUX | 5 | SIGN_MODE_AMINO_AUX specifies a signing mode which uses SignDocAminoAux. |
|
||||
| SIGN_MODE_LEGACY_AMINO_JSON | 127 | SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses Amino JSON and will be removed in the future. |
|
||||
|
||||
|
||||
|
@ -9873,7 +9874,7 @@ Plan specifies information about a planned upgrade and when it should occur.
|
|||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| `name` | [string](#string) | | Sets the name for the upgrade. This name will be used by the upgraded version of the software to apply any special "on-upgrade" commands during the first BeginBlock method after the upgrade is applied. It is also used to detect whether a software version can handle a given upgrade. If no upgrade handler with this name has been set in the software, it will be assumed that the software is out-of-date when the upgrade Time or Height is reached and the software will exit. |
|
||||
| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | **Deprecated.** Deprecated: Time based upgrades have been deprecated. Time based upgrade logic has been removed from the Cosmos SDK. If this field is not empty, an error will be thrown. |
|
||||
| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | **Deprecated.** Deprecated: Time based upgrades have been deprecated. Time based upgrade logic has been removed from the SDK. If this field is not empty, an error will be thrown. |
|
||||
| `height` | [int64](#int64) | | The height at which the upgrade must be performed. Only used if Time is not set. |
|
||||
| `info` | [string](#string) | | Any application specific upgrade info to be included on-chain such as a git commit that validators could automatically upgrade to |
|
||||
| `upgraded_client_state` | [google.protobuf.Any](#google.protobuf.Any) | | **Deprecated.** Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been moved to the IBC module in the sub module 02-client. If this field is not empty, an error will be thrown. |
|
||||
|
|
|
@ -32,6 +32,10 @@ enum SignMode {
|
|||
// for adding Tips in transactions.
|
||||
SIGN_MODE_DIRECT_AUX = 4;
|
||||
|
||||
// SIGN_MODE_AMINO_AUX specifies a signing mode which uses
|
||||
// SignDocAminoAux.
|
||||
SIGN_MODE_AMINO_AUX = 5;
|
||||
|
||||
// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
|
||||
// Amino JSON and will be removed in the future.
|
||||
SIGN_MODE_LEGACY_AMINO_JSON = 127;
|
||||
|
|
|
@ -248,7 +248,7 @@ message Fee {
|
|||
// Tip is the tip used for meta-transactions.
|
||||
message Tip {
|
||||
// amount is the amount of the tip
|
||||
repeated cosmos.base.v1beta1.Coin amount = 1;
|
||||
repeated cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false];
|
||||
// tipper is the address of the account paying for the tip
|
||||
string tipper = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
}
|
||||
|
|
|
@ -47,6 +47,9 @@ const (
|
|||
// require signers signing over other signers' `signer_info`. It also allows
|
||||
// for adding Tips in transactions.
|
||||
SignMode_SIGN_MODE_DIRECT_AUX SignMode = 4
|
||||
// SIGN_MODE_AMINO_AUX specifies a signing mode which uses
|
||||
// SignDocAminoAux.
|
||||
SignMode_SIGN_MODE_AMINO_AUX SignMode = 5
|
||||
// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
|
||||
// Amino JSON and will be removed in the future.
|
||||
SignMode_SIGN_MODE_LEGACY_AMINO_JSON SignMode = 127
|
||||
|
@ -58,6 +61,7 @@ var SignMode_name = map[int32]string{
|
|||
2: "SIGN_MODE_TEXTUAL",
|
||||
3: "SIGN_MODE_DIRECT_JSON",
|
||||
4: "SIGN_MODE_DIRECT_AUX",
|
||||
5: "SIGN_MODE_AMINO_AUX",
|
||||
127: "SIGN_MODE_LEGACY_AMINO_JSON",
|
||||
}
|
||||
|
||||
|
@ -67,6 +71,7 @@ var SignMode_value = map[string]int32{
|
|||
"SIGN_MODE_TEXTUAL": 2,
|
||||
"SIGN_MODE_DIRECT_JSON": 3,
|
||||
"SIGN_MODE_DIRECT_AUX": 4,
|
||||
"SIGN_MODE_AMINO_AUX": 5,
|
||||
"SIGN_MODE_LEGACY_AMINO_JSON": 127,
|
||||
}
|
||||
|
||||
|
@ -404,43 +409,43 @@ func init() {
|
|||
}
|
||||
|
||||
var fileDescriptor_9a54958ff3d0b1b9 = []byte{
|
||||
// 562 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xc1, 0x6e, 0xd3, 0x40,
|
||||
0x10, 0x86, 0xed, 0xc6, 0xad, 0xda, 0x29, 0x42, 0x66, 0x49, 0xa5, 0xd4, 0x20, 0x53, 0x95, 0x03,
|
||||
0x15, 0x52, 0xd7, 0x6a, 0x7b, 0x40, 0x70, 0x73, 0x13, 0x93, 0x86, 0x36, 0x09, 0xd8, 0x89, 0x54,
|
||||
0xb8, 0x58, 0xb6, 0xb3, 0x35, 0x56, 0x63, 0xaf, 0xf1, 0xae, 0x51, 0x7d, 0xe2, 0x15, 0x78, 0x0c,
|
||||
0x78, 0x0e, 0x2e, 0x1c, 0x7b, 0xe4, 0x88, 0x92, 0x67, 0xe0, 0x8e, 0x62, 0xc7, 0x49, 0x2a, 0x8a,
|
||||
0x10, 0x39, 0x59, 0x3b, 0xf3, 0xcf, 0x37, 0xff, 0x6a, 0x66, 0x0d, 0x4f, 0x3c, 0xca, 0x42, 0xca,
|
||||
0x34, 0x7e, 0xa5, 0xb1, 0xc0, 0x8f, 0x82, 0xc8, 0xd7, 0x3e, 0x1e, 0xb8, 0x84, 0x3b, 0x07, 0xe5,
|
||||
0x19, 0xc7, 0x09, 0xe5, 0x14, 0x6d, 0x17, 0x42, 0xcc, 0xaf, 0x70, 0x99, 0x98, 0x0a, 0x95, 0xfd,
|
||||
0x29, 0xc3, 0x4b, 0xb2, 0x98, 0x53, 0x2d, 0x4c, 0x87, 0x3c, 0x60, 0xc1, 0x1c, 0x54, 0x06, 0x0a,
|
||||
0x92, 0xb2, 0xed, 0x53, 0xea, 0x0f, 0x89, 0x96, 0x9f, 0xdc, 0xf4, 0x42, 0x73, 0xa2, 0xac, 0x48,
|
||||
0xed, 0x5e, 0x40, 0xd5, 0x0a, 0xfc, 0xc8, 0xe1, 0x69, 0x42, 0x1a, 0x84, 0x79, 0x49, 0x10, 0x73,
|
||||
0x9a, 0x30, 0xd4, 0x01, 0x60, 0x65, 0x9c, 0xd5, 0xc4, 0x9d, 0xca, 0xde, 0xe6, 0x21, 0xc6, 0x7f,
|
||||
0x75, 0x84, 0x6f, 0x81, 0x98, 0x0b, 0x84, 0xdd, 0x5f, 0x12, 0xdc, 0xbf, 0x45, 0x83, 0x8e, 0x00,
|
||||
0xe2, 0xd4, 0x1d, 0x06, 0x9e, 0x7d, 0x49, 0xb2, 0x9a, 0xb8, 0x23, 0xee, 0x6d, 0x1e, 0x56, 0x71,
|
||||
0xe1, 0x17, 0x97, 0x7e, 0xb1, 0x1e, 0x65, 0xe6, 0x46, 0xa1, 0x3b, 0x25, 0x19, 0x6a, 0x82, 0x34,
|
||||
0x70, 0xb8, 0x53, 0x5b, 0xc9, 0xe5, 0x47, 0xff, 0x67, 0x0b, 0x37, 0x1c, 0xee, 0x98, 0x39, 0x00,
|
||||
0x29, 0xb0, 0xce, 0xc8, 0x87, 0x94, 0x44, 0x1e, 0xa9, 0x55, 0x76, 0xc4, 0x3d, 0xc9, 0x9c, 0x9d,
|
||||
0x95, 0x6f, 0x15, 0x90, 0x26, 0x52, 0xd4, 0x83, 0x35, 0x16, 0x44, 0xfe, 0x90, 0x4c, 0xed, 0xbd,
|
||||
0x58, 0xa2, 0x1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||
0x59, 0xdd, 0x8e, 0x5c, 0x41, 0x35, 0xa8, 0xfe, 0x91, 0xd2, 0xfb, 0xe7, 0xb2, 0x84, 0x1e, 0xc1,
|
||||
0x83, 0x79, 0xe6, 0xcc, 0x68, 0xea, 0xf5, 0xb7, 0xb6, 0xde, 0x6e, 0x75, 0xba, 0x45, 0xe9, 0xa7,
|
||||
0xe3, 0xe6, 0xf7, 0x91, 0x2a, 0x5e, 0x8f, 0x54, 0xf1, 0xe7, 0x48, 0x15, 0x3f, 0x8f, 0x55, 0xe1,
|
||||
0x7a, 0xac, 0x0a, 0x3f, 0xc6, 0xaa, 0xf0, 0x6e, 0xdf, 0x0f, 0xf8, 0xfb, 0xd4, 0xc5, 0x1e, 0x0d,
|
||||
0xb5, 0xf2, 0xe5, 0xe7, 0x9f, 0x7d, 0x36, 0xb8, 0xd4, 0x78, 0x16, 0x93, 0xc5, 0xdf, 0x89, 0xbb,
|
||||
0x96, 0xbf, 0x9b, 0xa3, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9a, 0x94, 0x26, 0xd7, 0x6a, 0x04,
|
||||
0x00, 0x00,
|
||||
// 571 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x41, 0x4f, 0xd4, 0x40,
|
||||
0x14, 0xc7, 0xb7, 0x6c, 0x97, 0xc0, 0xc3, 0x98, 0x3a, 0x2c, 0x71, 0xa9, 0xa6, 0x12, 0x3c, 0x48,
|
||||
0x4c, 0x98, 0x06, 0x38, 0x18, 0xbd, 0x95, 0xdd, 0xba, 0xac, 0xb0, 0x8b, 0xb6, 0x4b, 0x82, 0x5e,
|
||||
0x36, 0x6d, 0x77, 0xa8, 0x0d, 0xdb, 0x4e, 0xed, 0x4c, 0x0d, 0x3d, 0xf9, 0x15, 0xfc, 0x1a, 0x7e,
|
||||
0x0c, 0xe3, 0xc5, 0x23, 0x47, 0x8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, 0xfa, 0x87, 0x1d, 0x73, 0x74, 0x34, 0xb0, 0x5f, 0x9b, 0xed, 0xde, 0xcb, 0x9e,
|
||||
0xd9, 0x51, 0x6a, 0xa8, 0x09, 0x4a, 0x25, 0x75, 0x7a, 0x96, 0xd9, 0x1e, 0x2a, 0x12, 0x5a, 0x81,
|
||||
0x7b, 0x55, 0x75, 0x68, 0x1e, 0x0f, 0x8f, 0x8c, 0x03, 0x65, 0xee, 0x26, 0x27, 0x37, 0x8f, 0x5e,
|
||||
0xd9, 0x87, 0x03, 0xa5, 0x8e, 0x5a, 0xd0, 0xfc, 0x43, 0x32, 0x8e, 0x8e, 0x15, 0x19, 0xdd, 0x87,
|
||||
0xe5, 0x4a, 0x31, 0xfa, 0xbd, 0xc1, 0xa1, 0x10, 0x1a, 0xe8, 0x11, 0x3c, 0xa8, 0x84, 0x03, 0xb3,
|
||||
0x6b, 0xb4, 0xdf, 0x16, 0xba, 0x60, 0x7e, 0xda, 0xed, 0x7e, 0xbf, 0xd0, 0xa4, 0xf3, 0x0b, 0x4d,
|
||||
0xfa, 0x79, 0xa1, 0x49, 0x9f, 0x2f, 0xb5, 0xda, 0xf9, 0xa5, 0x56, 0xfb, 0x71, 0xa9, 0xd5, 0xde,
|
||||
0x6d, 0xfa, 0x01, 0x7f, 0x9f, 0xba, 0xd8, 0xa3, 0xa1, 0x5e, 0x3e, 0x09, 0xe2, 0x67, 0x93, 0x8d,
|
||||
0x4f, 0x75, 0x9e, 0xc5, 0xe4, 0xfa, 0x3b, 0xe3, 0xce, 0x8b, 0x3f, 0xd4, 0xce, 0xef, 0x00, 0x00,
|
||||
0x00, 0xff, 0xff, 0x67, 0xe0, 0x5a, 0xe2, 0x83, 0x04, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *SignatureDescriptors) Marshal() (dAtA []byte, err error) {
|
||||
|
|
|
@ -950,7 +950,7 @@ func (m *Fee) GetGranter() string {
|
|||
// Tip is the tip used for meta-transactions.
|
||||
type Tip struct {
|
||||
// amount is the amount of the tip
|
||||
Amount []*types2.Coin `protobuf:"bytes,1,rep,name=amount,proto3" json:"amount,omitempty"`
|
||||
Amount []types2.Coin `protobuf:"bytes,1,rep,name=amount,proto3" json:"amount"`
|
||||
// tipper is the address of the account paying for the tip
|
||||
Tipper string `protobuf:"bytes,2,opt,name=tipper,proto3" json:"tipper,omitempty"`
|
||||
}
|
||||
|
@ -988,7 +988,7 @@ func (m *Tip) XXX_DiscardUnknown() {
|
|||
|
||||
var xxx_messageInfo_Tip proto.InternalMessageInfo
|
||||
|
||||
func (m *Tip) GetAmount() []*types2.Coin {
|
||||
func (m *Tip) GetAmount() []types2.Coin {
|
||||
if m != nil {
|
||||
return m.Amount
|
||||
}
|
||||
|
@ -1021,70 +1021,70 @@ func init() {
|
|||
func init() { proto.RegisterFile("cosmos/tx/v1beta1/tx.proto", fileDescriptor_96d1575ffde80842) }
|
||||
|
||||
var fileDescriptor_96d1575ffde80842 = []byte{
|
||||
// 1004 bytes of a gzipped FileDescriptorProto
|
||||
// 1007 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0x1b, 0x45,
|
||||
0x14, 0xf7, 0x66, 0x6d, 0xc7, 0x7e, 0x49, 0xda, 0x66, 0x14, 0x21, 0xc7, 0x51, 0xdd, 0x60, 0x54,
|
||||
0xf0, 0x25, 0xbb, 0x49, 0x2a, 0xa0, 0x20, 0x24, 0xb0, 0x5b, 0xaa, 0x94, 0xd2, 0x56, 0x1a, 0xe7,
|
||||
0xd4, 0xcb, 0x6a, 0xbc, 0x9e, 0xac, 0x87, 0x7a, 0x67, 0x96, 0x9d, 0x59, 0xf0, 0x7e, 0x08, 0xa4,
|
||||
0x0a, 0x09, 0x71, 0xe5, 0xcc, 0x99, 0x0f, 0xd1, 0x63, 0xc5, 0x89, 0x13, 0x54, 0xc9, 0x09, 0x21,
|
||||
0xf1, 0x15, 0x40, 0x3b, 0x3b, 0xbb, 0x49, 0x8b, 0xb1, 0x2b, 0x51, 0x71, 0xf2, 0xcc, 0x9b, 0xdf,
|
||||
0xfb, 0xbd, 0xdf, 0xfb, 0xb3, 0x33, 0x86, 0xb6, 0x2f, 0x64, 0x28, 0xa4, 0xab, 0x66, 0xee, 0x57,
|
||||
0x07, 0x23, 0xaa, 0xc8, 0x81, 0xab, 0x66, 0x4e, 0x14, 0x0b, 0x25, 0xd0, 0x66, 0x7e, 0xe6, 0xa8,
|
||||
0x99, 0x63, 0xce, 0xda, 0x5b, 0x81, 0x08, 0x84, 0x3e, 0x75, 0xb3, 0x55, 0x0e, 0x6c, 0xef, 0x19,
|
||||
0x12, 0x3f, 0x4e, 0x23, 0x25, 0xdc, 0x30, 0x99, 0x2a, 0x26, 0x59, 0x50, 0x32, 0x16, 0x06, 0x03,
|
||||
0xef, 0x18, 0xf8, 0x88, 0x48, 0x5a, 0x62, 0x7c, 0xc1, 0xb8, 0x39, 0x7f, 0xe7, 0x5c, 0x93, 0x64,
|
||||
0x01, 0x67, 0xfc, 0x9c, 0xc9, 0xec, 0x0d, 0x70, 0x3b, 0x10, 0x22, 0x98, 0x52, 0x57, 0xef, 0x46,
|
||||
0xc9, 0x89, 0x4b, 0x78, 0x5a, 0x1c, 0xe5, 0x1c, 0x5e, 0xae, 0xd5, 0x24, 0xa2, 0x37, 0xdd, 0x6f,
|
||||
0x2c, 0x58, 0x39, 0x9e, 0xa1, 0x3d, 0xa8, 0x8e, 0xc4, 0x38, 0x6d, 0x59, 0xbb, 0x56, 0x6f, 0xed,
|
||||
0x70, 0xdb, 0xf9, 0x47, 0xb2, 0xce, 0xf1, 0x6c, 0x20, 0xc6, 0x29, 0xd6, 0x30, 0x74, 0x13, 0x9a,
|
||||
0x24, 0x51, 0x13, 0x8f, 0xf1, 0x13, 0xd1, 0x5a, 0xd1, 0x3e, 0x3b, 0x73, 0x7c, 0xfa, 0x89, 0x9a,
|
||||
0xdc, 0xe5, 0x27, 0x02, 0x37, 0x88, 0x59, 0xa1, 0x0e, 0x40, 0x26, 0x9b, 0xa8, 0x24, 0xa6, 0xb2,
|
||||
0x65, 0xef, 0xda, 0xbd, 0x75, 0x7c, 0xc1, 0xd2, 0xe5, 0x50, 0x3b, 0x9e, 0x61, 0xf2, 0x35, 0xba,
|
||||
0x0a, 0x90, 0x85, 0xf2, 0x46, 0xa9, 0xa2, 0x52, 0xeb, 0x5a, 0xc7, 0xcd, 0xcc, 0x32, 0xc8, 0x0c,
|
||||
0xe8, 0x6d, 0xb8, 0x5c, 0x2a, 0x30, 0x98, 0x15, 0x8d, 0xd9, 0x28, 0x42, 0xe5, 0xb8, 0x65, 0xf1,
|
||||
0xbe, 0xb5, 0x60, 0x75, 0xc8, 0x02, 0x7e, 0x5b, 0xf8, 0xaf, 0x2b, 0xe4, 0x36, 0x34, 0xfc, 0x09,
|
||||
0x61, 0xdc, 0x63, 0xe3, 0x96, 0xbd, 0x6b, 0xf5, 0x9a, 0x78, 0x55, 0xef, 0xef, 0x8e, 0xd1, 0x75,
|
||||
0xb8, 0x44, 0x7c, 0x5f, 0x24, 0x5c, 0x79, 0x3c, 0x09, 0x47, 0x34, 0x6e, 0x55, 0x77, 0xad, 0x5e,
|
||||
0x15, 0x6f, 0x18, 0xeb, 0x03, 0x6d, 0xec, 0xfe, 0x6e, 0xc1, 0x9a, 0x11, 0xf5, 0xd9, 0xf0, 0xe1,
|
||||
0x83, 0xff, 0xaf, 0x3b, 0xff, 0x59, 0x3a, 0x72, 0x61, 0x2b, 0xab, 0xae, 0x37, 0x16, 0xbe, 0x27,
|
||||
0x27, 0xe4, 0xf0, 0xdd, 0xf7, 0xbc, 0x09, 0x91, 0x93, 0x56, 0x4d, 0x57, 0x6a, 0x53, 0xe6, 0x59,
|
||||
0x0d, 0xf5, 0xc9, 0x11, 0x91, 0x93, 0xee, 0x9f, 0x16, 0x5c, 0x31, 0xb9, 0xde, 0x66, 0x31, 0xf5,
|
||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 0x44, 0x7c, 0x35, 0x60,
|
||||
0xaa, 0x9f, 0xb9, 0xe1, 0x92, 0x00, 0x7d, 0x08, 0x50, 0x56, 0x3d, 0xbb, 0xb6, 0xed, 0x65, 0x65,
|
||||
0x6f, 0x16, 0x65, 0x97, 0x83, 0x1a, 0xd8, 0x32, 0x09, 0xbb, 0x7f, 0x58, 0x60, 0xdf, 0xa1, 0x14,
|
||||
0xf9, 0x50, 0x27, 0x61, 0x76, 0x2b, 0x98, 0xa1, 0x2c, 0xaf, 0xe3, 0xec, 0x05, 0xbf, 0x20, 0x85,
|
||||
0xf1, 0xc1, 0xfe, 0xd3, 0x5f, 0xaf, 0x55, 0x7e, 0xfc, 0xed, 0x5a, 0x2f, 0x60, 0x6a, 0x92, 0x8c,
|
||||
0x1c, 0x5f, 0x84, 0x6e, 0xf1, 0xef, 0x40, 0xff, 0xec, 0xc9, 0xf1, 0x63, 0x57, 0xa5, 0x11, 0x95,
|
||||
0xda, 0x41, 0x62, 0x43, 0x8d, 0x76, 0xa0, 0x19, 0x10, 0xe9, 0x4d, 0x59, 0xc8, 0x94, 0x6e, 0x44,
|
||||
0x15, 0x37, 0x02, 0x22, 0x3f, 0xcf, 0xf6, 0xc8, 0x81, 0x5a, 0x44, 0x52, 0x1a, 0xe7, 0xd7, 0xd8,
|
||||
0xa0, 0xf5, 0xf3, 0x4f, 0x7b, 0x5b, 0x46, 0x43, 0x7f, 0x3c, 0x8e, 0xa9, 0x94, 0x43, 0x15, 0x33,
|
||||
0x1e, 0xe0, 0x1c, 0x86, 0x0e, 0x61, 0x35, 0x88, 0x09, 0x57, 0xe6, 0x5e, 0x5b, 0xe4, 0x51, 0x00,
|
||||
0xbb, 0x5f, 0x80, 0x7d, 0xcc, 0x22, 0x74, 0xf0, 0xca, 0xc9, 0x96, 0xd2, 0xf7, 0xa1, 0xae, 0x58,
|
||||
0x14, 0xd1, 0x38, 0xbf, 0xa4, 0x16, 0x04, 0x33, 0xb8, 0xc1, 0xc7, 0x4f, 0x4f, 0x3b, 0xd6, 0xb3,
|
||||
0xd3, 0x8e, 0xf5, 0xfc, 0xb4, 0x63, 0x3d, 0x39, 0xeb, 0x54, 0x9e, 0x9d, 0x75, 0x2a, 0xbf, 0x9c,
|
||||
0x75, 0x2a, 0x8f, 0xae, 0x2f, 0x2f, 0x9c, 0xab, 0x66, 0xa3, 0xba, 0xfe, 0xd8, 0x6e, 0xfc, 0x1d,
|
||||
0x00, 0x00, 0xff, 0xff, 0x2e, 0xeb, 0x69, 0xc0, 0xc0, 0x09, 0x00, 0x00,
|
||||
0x14, 0xf7, 0x66, 0x6d, 0xc7, 0x7e, 0x4d, 0xda, 0x66, 0x14, 0x21, 0xc7, 0x51, 0xdd, 0x60, 0x54,
|
||||
0xf0, 0x25, 0xbb, 0x69, 0x2a, 0x68, 0x41, 0x48, 0x60, 0xb7, 0x54, 0x29, 0xa5, 0xad, 0x34, 0xce,
|
||||
0xa9, 0x97, 0xd5, 0x78, 0x3d, 0x59, 0x8f, 0xea, 0x9d, 0x59, 0x76, 0x66, 0xc1, 0xfe, 0x10, 0x48,
|
||||
0x15, 0x12, 0xe2, 0xca, 0x99, 0x33, 0x1f, 0xa2, 0xc7, 0x8a, 0x13, 0x27, 0xa8, 0x92, 0x13, 0x42,
|
||||
0xe2, 0x2b, 0x80, 0x66, 0x76, 0x76, 0x93, 0x96, 0x60, 0x57, 0xa2, 0xe2, 0xe4, 0x99, 0x37, 0xbf,
|
||||
0xf7, 0x7b, 0xbf, 0xf7, 0x67, 0x67, 0x0c, 0xed, 0x50, 0xc8, 0x58, 0x48, 0x5f, 0xcd, 0xfc, 0xaf,
|
||||
0xae, 0x8f, 0xa8, 0x22, 0xd7, 0x7d, 0x35, 0xf3, 0x92, 0x54, 0x28, 0x81, 0x36, 0xf2, 0x33, 0x4f,
|
||||
0xcd, 0x3c, 0x7b, 0xd6, 0xde, 0x8c, 0x44, 0x24, 0xcc, 0xa9, 0xaf, 0x57, 0x39, 0xb0, 0xbd, 0x6b,
|
||||
0x49, 0xc2, 0x74, 0x9e, 0x28, 0xe1, 0xc7, 0xd9, 0x54, 0x31, 0xc9, 0xa2, 0x92, 0xb1, 0x30, 0x58,
|
||||
0x78, 0xc7, 0xc2, 0x47, 0x44, 0xd2, 0x12, 0x13, 0x0a, 0xc6, 0xed, 0xf9, 0x7b, 0xa7, 0x9a, 0x24,
|
||||
0x8b, 0x38, 0xe3, 0xa7, 0x4c, 0x76, 0x6f, 0x81, 0x5b, 0x91, 0x10, 0xd1, 0x94, 0xfa, 0x66, 0x37,
|
||||
0xca, 0x8e, 0x7c, 0xc2, 0xe7, 0xc5, 0x51, 0xce, 0x11, 0xe4, 0x5a, 0x6d, 0x22, 0x66, 0xd3, 0xfd,
|
||||
0xc6, 0x81, 0x95, 0xc3, 0x19, 0xda, 0x85, 0xea, 0x48, 0x8c, 0xe7, 0x2d, 0x67, 0xc7, 0xe9, 0x5d,
|
||||
0xd8, 0xdf, 0xf2, 0xfe, 0x91, 0xac, 0x77, 0x38, 0x1b, 0x88, 0xf1, 0x1c, 0x1b, 0x18, 0xba, 0x05,
|
||||
0x4d, 0x92, 0xa9, 0x49, 0xc0, 0xf8, 0x91, 0x68, 0xad, 0x18, 0x9f, 0xed, 0x73, 0x7c, 0xfa, 0x99,
|
||||
0x9a, 0xdc, 0xe3, 0x47, 0x02, 0x37, 0x88, 0x5d, 0xa1, 0x0e, 0x80, 0x96, 0x4d, 0x54, 0x96, 0x52,
|
||||
0xd9, 0x72, 0x77, 0xdc, 0xde, 0x1a, 0x3e, 0x63, 0xe9, 0x72, 0xa8, 0x1d, 0xce, 0x30, 0xf9, 0x1a,
|
||||
0x5d, 0x01, 0xd0, 0xa1, 0x82, 0xd1, 0x5c, 0x51, 0x69, 0x74, 0xad, 0xe1, 0xa6, 0xb6, 0x0c, 0xb4,
|
||||
0x01, 0xbd, 0x0b, 0x97, 0x4a, 0x05, 0x16, 0xb3, 0x62, 0x30, 0xeb, 0x45, 0xa8, 0x1c, 0xb7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 0x79, 0x1d, 0x62, 0x09,
|
||||
0xd6, 0x90, 0xee, 0x77, 0x2b, 0x50, 0xcf, 0xdb, 0x85, 0xf6, 0xa0, 0x11, 0x53, 0x29, 0x49, 0x64,
|
||||
0x92, 0x74, 0xff, 0x35, 0x8b, 0x12, 0x85, 0x10, 0x54, 0x63, 0x1a, 0xe7, 0x5d, 0x6d, 0x62, 0xb3,
|
||||
0xd6, 0xea, 0x15, 0x8b, 0xa9, 0xc8, 0x54, 0x30, 0xa1, 0x2c, 0x9a, 0x28, 0x93, 0x5e, 0x15, 0xaf,
|
||||
0x5b, 0xeb, 0x81, 0x31, 0xa2, 0x01, 0x6c, 0xd0, 0x99, 0xa2, 0x5c, 0x32, 0xc1, 0x03, 0x91, 0x28,
|
||||
0x26, 0xb8, 0x6c, 0xfd, 0xb5, 0xba, 0x20, 0xec, 0xe5, 0x12, 0xff, 0x28, 0x87, 0xa3, 0xc7, 0xd0,
|
||||
0xe1, 0x82, 0x07, 0x61, 0xca, 0x14, 0x0b, 0xc9, 0x34, 0x38, 0x87, 0xf0, 0xd2, 0x02, 0xc2, 0x6d,
|
||||
0x2e, 0xf8, 0x6d, 0xeb, 0xfb, 0xd9, 0x2b, 0xdc, 0xdd, 0x1f, 0x1c, 0x68, 0x14, 0x23, 0x89, 0x3e,
|
||||
0x85, 0x35, 0x3d, 0x2a, 0x34, 0x35, 0x43, 0x5c, 0x54, 0xe7, 0xca, 0x39, 0x75, 0x1d, 0x1a, 0x98,
|
||||
0x99, 0xe3, 0x0b, 0xb2, 0x5c, 0x4b, 0xdd, 0x90, 0x23, 0x4a, 0xed, 0x70, 0x9c, 0xd7, 0x90, 0xbb,
|
||||
0x94, 0x62, 0x0d, 0x29, 0x5a, 0xe7, 0x2e, 0x6f, 0xdd, 0xf7, 0x0e, 0xc0, 0x69, 0xbc, 0x57, 0xc6,
|
||||
0xd0, 0x79, 0xbd, 0x31, 0xbc, 0x05, 0xcd, 0x58, 0x8c, 0xe9, 0xb2, 0x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, 0x6a, 0x2f, 0x62, 0x6a, 0x92, 0x8d,
|
||||
0xbc, 0x50, 0xc4, 0x7e, 0xf1, 0xef, 0xc0, 0xfc, 0xec, 0xca, 0xf1, 0x13, 0x5f, 0xcd, 0x13, 0x2a,
|
||||
0x8d, 0x83, 0xc4, 0x96, 0x1a, 0x6d, 0x43, 0x33, 0x22, 0x32, 0x98, 0xb2, 0x98, 0x29, 0xd3, 0x88,
|
||||
0x2a, 0x6e, 0x44, 0x44, 0x7e, 0xa1, 0xf7, 0xc8, 0x83, 0x5a, 0x42, 0xe6, 0x34, 0xcd, 0xaf, 0xb1,
|
||||
0x41, 0xeb, 0xe7, 0x9f, 0x76, 0x37, 0xad, 0x86, 0xfe, 0x78, 0x9c, 0x52, 0x29, 0x87, 0x2a, 0x65,
|
||||
0x3c, 0xc2, 0x39, 0x0c, 0xed, 0xc3, 0x6a, 0x94, 0x12, 0xae, 0xec, 0xbd, 0xb6, 0xc8, 0xa3, 0x00,
|
||||
0x76, 0x13, 0x70, 0x0f, 0x59, 0x82, 0x6e, 0xbe, 0x7e, 0xb2, 0x55, 0x9d, 0x6c, 0x99, 0xc0, 0x1e,
|
||||
0xd4, 0x15, 0x4b, 0x12, 0x9a, 0xe6, 0x57, 0xd5, 0x82, 0x90, 0x16, 0x37, 0xf8, 0xe4, 0xd9, 0x71,
|
||||
0xc7, 0x79, 0x7e, 0xdc, 0x71, 0x5e, 0x1c, 0x77, 0x9c, 0xa7, 0x27, 0x9d, 0xca, 0xf3, 0x93, 0x4e,
|
||||
0xe5, 0x97, 0x93, 0x4e, 0xe5, 0xf1, 0xb5, 0xe5, 0xe5, 0xf3, 0xd5, 0x6c, 0x54, 0x37, 0x9f, 0xdc,
|
||||
0x8d, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x17, 0x43, 0x65, 0x00, 0xc6, 0x09, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Tx) Marshal() (dAtA []byte, err error) {
|
||||
|
@ -4095,7 +4095,7 @@ func (m *Tip) Unmarshal(dAtA []byte) error {
|
|||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Amount = append(m.Amount, &types2.Coin{})
|
||||
m.Amount = append(m.Amount, types2.Coin{})
|
||||
if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
package legacytx
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec/legacy"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
type StdSignDocAux struct {
|
||||
AccountNumber uint64 `json:"account_number" yaml:"account_number"`
|
||||
Sequence uint64 `json:"sequence" yaml:"sequence"`
|
||||
TimeoutHeight uint64 `json:"timeout_height,omitempty" yaml:"timeout_height"`
|
||||
ChainID string `json:"chain_id" yaml:"chain_id"`
|
||||
Memo string `json:"memo" yaml:"memo"`
|
||||
Msgs []json.RawMessage `json:"msgs" yaml:"msgs"`
|
||||
Tip sdk.Coins `json:"tip" yaml:"tip"`
|
||||
}
|
||||
|
||||
// StdSignBytes returns the bytes to sign for a transaction.
|
||||
func StdSignAuxBytes(chainID string, accnum, sequence, timeout uint64, tip sdk.Coins, msgs []sdk.Msg, memo string) []byte {
|
||||
msgsBytes := make([]json.RawMessage, 0, len(msgs))
|
||||
for _, msg := range msgs {
|
||||
legacyMsg, ok := msg.(LegacyMsg)
|
||||
if !ok {
|
||||
panic(fmt.Errorf("expected %T when using AMINO_AUX", (*LegacyMsg)(nil)))
|
||||
}
|
||||
|
||||
msgsBytes = append(msgsBytes, json.RawMessage(legacyMsg.GetSignBytes()))
|
||||
}
|
||||
|
||||
bz, err := legacy.Cdc.MarshalJSON(StdSignDocAux{
|
||||
AccountNumber: accnum,
|
||||
ChainID: chainID,
|
||||
Memo: memo,
|
||||
Msgs: msgsBytes,
|
||||
Sequence: sequence,
|
||||
TimeoutHeight: timeout,
|
||||
Tip: tip,
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return sdk.MustSortJSON(bz)
|
||||
}
|
|
@ -7,6 +7,7 @@ import (
|
|||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
"github.com/cosmos/cosmos-sdk/types/tx"
|
||||
"github.com/cosmos/cosmos-sdk/types/tx/signing"
|
||||
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
|
||||
)
|
||||
|
@ -56,6 +57,10 @@ 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
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
package tx
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
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"
|
||||
)
|
||||
|
||||
var _ signing.SignModeHandler = signModeAminoAuxHandler{}
|
||||
|
||||
// signModeAminoAuxHandler defines the SIGN_MODE_AMINO_AUX SignModeHandler
|
||||
type signModeAminoAuxHandler struct{}
|
||||
|
||||
// DefaultMode implements SignModeHandler.DefaultMode
|
||||
func (signModeAminoAuxHandler) DefaultMode() signingtypes.SignMode {
|
||||
return signingtypes.SignMode_SIGN_MODE_AMINO_AUX
|
||||
}
|
||||
|
||||
// Modes implements SignModeHandler.Modes
|
||||
func (signModeAminoAuxHandler) Modes() []signingtypes.SignMode {
|
||||
return []signingtypes.SignMode{signingtypes.SignMode_SIGN_MODE_AMINO_AUX}
|
||||
}
|
||||
|
||||
// GetSignBytes implements SignModeHandler.GetSignBytes
|
||||
func (signModeAminoAuxHandler) GetSignBytes(
|
||||
mode signingtypes.SignMode, data signing.SignerData, tx sdk.Tx,
|
||||
) ([]byte, error) {
|
||||
|
||||
if mode != signingtypes.SignMode_SIGN_MODE_AMINO_AUX {
|
||||
return nil, fmt.Errorf("expected %s, got %s", signingtypes.SignMode_SIGN_MODE_AMINO_AUX, mode)
|
||||
}
|
||||
|
||||
protoTx, ok := tx.(*wrapper)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("can only handle a protobuf Tx, got %T", tx)
|
||||
}
|
||||
|
||||
if protoTx.txBodyHasUnknownNonCriticals {
|
||||
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, aminoNonCriticalFieldsError)
|
||||
}
|
||||
|
||||
body := protoTx.tx.Body
|
||||
|
||||
if len(body.ExtensionOptions) != 0 || len(body.NonCriticalExtensionOptions) != 0 {
|
||||
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "SIGN_MODE_AMINO_AUX does not support protobuf extension options.")
|
||||
}
|
||||
|
||||
return legacytx.StdSignAuxBytes(
|
||||
data.ChainID, data.AccountNumber, data.Sequence, protoTx.GetTimeoutHeight(),
|
||||
protoTx.tx.AuthInfo.Tip.Amount, tx.GetMsgs(), protoTx.GetMemo(),
|
||||
), nil
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
package tx
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/testdata"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
txtypes "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"
|
||||
)
|
||||
|
||||
func TestAminoAuxHandler(t *testing.T) {
|
||||
privKey, pubkey, addr := testdata.KeyTestPubAddr()
|
||||
interfaceRegistry := codectypes.NewInterfaceRegistry()
|
||||
interfaceRegistry.RegisterImplementations((*sdk.Msg)(nil), &testdata.TestMsg{})
|
||||
marshaler := codec.NewProtoCodec(interfaceRegistry)
|
||||
|
||||
txConfig := NewTxConfig(marshaler, []signingtypes.SignMode{signingtypes.SignMode_SIGN_MODE_AMINO_AUX})
|
||||
txBuilder := txConfig.NewTxBuilder()
|
||||
|
||||
accountNumber := uint64(1)
|
||||
chainId := "test-chain"
|
||||
memo := "sometestmemo"
|
||||
msgs := []sdk.Msg{testdata.NewTestMsg(addr)}
|
||||
accSeq := uint64(2) // Arbitrary account sequence
|
||||
timeout := uint64(10)
|
||||
fee := txtypes.Fee{Amount: sdk.NewCoins(sdk.NewInt64Coin("atom", 150)), GasLimit: 20000}
|
||||
tip := sdk.NewCoins(sdk.NewCoin("regen", sdk.NewInt(1000)))
|
||||
|
||||
err := txBuilder.SetMsgs(msgs...)
|
||||
require.NoError(t, err)
|
||||
txBuilder.SetMemo(memo)
|
||||
txBuilder.SetFeeAmount(fee.Amount)
|
||||
txBuilder.SetGasLimit(fee.GasLimit)
|
||||
txBuilder.SetTimeoutHeight(timeout)
|
||||
txBuilder.SetTip(&txtypes.Tip{
|
||||
Amount: tip,
|
||||
Tipper: addr.String(), // Not needed when signing using AMINO_AUX, but putting here for clarity.
|
||||
})
|
||||
|
||||
sigData := &signingtypes.SingleSignatureData{
|
||||
SignMode: signingtypes.SignMode_SIGN_MODE_AMINO_AUX,
|
||||
}
|
||||
|
||||
sig := signingtypes.SignatureV2{
|
||||
PubKey: pubkey,
|
||||
Data: sigData,
|
||||
Sequence: accSeq,
|
||||
}
|
||||
err = txBuilder.SetSignatures(sig)
|
||||
require.NoError(t, err)
|
||||
|
||||
signingData := signing.SignerData{
|
||||
ChainID: chainId,
|
||||
AccountNumber: accountNumber,
|
||||
Sequence: accSeq,
|
||||
SignerIndex: 0,
|
||||
}
|
||||
|
||||
handler := signModeAminoAuxHandler{}
|
||||
signBytes, err := handler.GetSignBytes(signingtypes.SignMode_SIGN_MODE_AMINO_AUX, signingData, txBuilder.GetTx())
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, signBytes)
|
||||
|
||||
expectedSignBytes := legacytx.StdSignAuxBytes(chainId, accountNumber, accSeq, timeout, tip, msgs, memo)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, expectedSignBytes, signBytes)
|
||||
|
||||
t.Log("verify that setting signature doesn't change sign bytes")
|
||||
sigData.Signature, err = privKey.Sign(signBytes)
|
||||
require.NoError(t, err)
|
||||
err = txBuilder.SetSignatures(sig)
|
||||
require.NoError(t, err)
|
||||
signBytes, err = handler.GetSignBytes(signingtypes.SignMode_SIGN_MODE_AMINO_AUX, signingData, txBuilder.GetTx())
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, expectedSignBytes, signBytes)
|
||||
|
||||
// expect error with wrong sign mode
|
||||
_, err = handler.GetSignBytes(signingtypes.SignMode_SIGN_MODE_DIRECT, signingData, txBuilder.GetTx())
|
||||
require.Error(t, err)
|
||||
|
||||
// expect error with extension options
|
||||
bldr := newBuilder()
|
||||
buildTx(t, bldr)
|
||||
any, err := codectypes.NewAnyWithValue(testdata.NewTestMsg())
|
||||
require.NoError(t, err)
|
||||
bldr.tx.Body.ExtensionOptions = []*codectypes.Any{any}
|
||||
tx := bldr.GetTx()
|
||||
_, err = handler.GetSignBytes(signingtypes.SignMode_SIGN_MODE_AMINO_AUX, signingData, tx)
|
||||
require.Error(t, err)
|
||||
|
||||
// expect error with non-critical extension options
|
||||
bldr = newBuilder()
|
||||
buildTx(t, bldr)
|
||||
bldr.tx.Body.NonCriticalExtensionOptions = []*codectypes.Any{any}
|
||||
tx = bldr.GetTx()
|
||||
_, err = handler.GetSignBytes(signingtypes.SignMode_SIGN_MODE_AMINO_AUX, signingData, tx)
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
func TestAminoAuxHandler_DefaultMode(t *testing.T) {
|
||||
handler := signModeAminoAuxHandler{}
|
||||
require.Equal(t, signingtypes.SignMode_SIGN_MODE_AMINO_AUX, handler.DefaultMode())
|
||||
}
|
||||
|
||||
func TestAminoAuxModeHandler_nonDIRECT_MODE(t *testing.T) {
|
||||
invalidModes := []signingtypes.SignMode{
|
||||
signingtypes.SignMode_SIGN_MODE_DIRECT,
|
||||
signingtypes.SignMode_SIGN_MODE_DIRECT_JSON,
|
||||
signingtypes.SignMode_SIGN_MODE_TEXTUAL,
|
||||
signingtypes.SignMode_SIGN_MODE_LEGACY_AMINO_JSON,
|
||||
signingtypes.SignMode_SIGN_MODE_UNSPECIFIED,
|
||||
signingtypes.SignMode_SIGN_MODE_DIRECT_AUX,
|
||||
}
|
||||
for _, invalidMode := range invalidModes {
|
||||
t.Run(invalidMode.String(), func(t *testing.T) {
|
||||
var dh signModeAminoAuxHandler
|
||||
var signingData signing.SignerData
|
||||
_, err := dh.GetSignBytes(invalidMode, signingData, nil)
|
||||
require.Error(t, err)
|
||||
wantErr := fmt.Errorf("expected %s, got %s", signingtypes.SignMode_SIGN_MODE_AMINO_AUX, invalidMode)
|
||||
require.Equal(t, err, wantErr)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestAminoAuxModeHandler_nonProtoTx(t *testing.T) {
|
||||
var ah signModeAminoAuxHandler
|
||||
var signingData signing.SignerData
|
||||
tx := new(nonProtoTx)
|
||||
_, err := ah.GetSignBytes(signingtypes.SignMode_SIGN_MODE_AMINO_AUX, signingData, tx)
|
||||
require.Error(t, err)
|
||||
wantErr := fmt.Errorf("can only handle a protobuf Tx, got %T", tx)
|
||||
require.Equal(t, err, wantErr)
|
||||
}
|
|
@ -250,6 +250,13 @@ 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{}
|
||||
|
|
|
@ -30,6 +30,8 @@ func makeSignModeHandler(modes []signingtypes.SignMode) signing.SignModeHandler
|
|||
handlers[i] = signModeLegacyAminoJSONHandler{}
|
||||
case signingtypes.SignMode_SIGN_MODE_DIRECT_AUX:
|
||||
handlers[i] = signModeDirectAuxHandler{}
|
||||
case signingtypes.SignMode_SIGN_MODE_AMINO_AUX:
|
||||
handlers[i] = signModeAminoAuxHandler{}
|
||||
default:
|
||||
panic(fmt.Errorf("unsupported sign mode %+v", mode))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue