Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add SIGN_MODE_DIRECT_AUX and tx Tip proto definitions #9405

Merged
merged 16 commits into from
Aug 11, 2021
Merged
41 changes: 41 additions & 0 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,9 @@
- [ModeInfo.Multi](#cosmos.tx.v1beta1.ModeInfo.Multi)
- [ModeInfo.Single](#cosmos.tx.v1beta1.ModeInfo.Single)
- [SignDoc](#cosmos.tx.v1beta1.SignDoc)
- [SignDocAux](#cosmos.tx.v1beta1.SignDocAux)
- [SignerInfo](#cosmos.tx.v1beta1.SignerInfo)
- [Tip](#cosmos.tx.v1beta1.Tip)
- [Tx](#cosmos.tx.v1beta1.Tx)
- [TxBody](#cosmos.tx.v1beta1.TxBody)
- [TxRaw](#cosmos.tx.v1beta1.TxRaw)
Expand Down Expand Up @@ -7427,6 +7429,8 @@ SignMode represents a signing mode with its own security guarantees.
| SIGN_MODE_UNSPECIFIED | 0 | SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be rejected |
| SIGN_MODE_DIRECT | 1 | SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is verified with raw bytes from Tx |
| 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 |
| SIGN_MODE_DIRECT_AUX | 3 | |
| SIGN_MODE_TEXTUAL_AUX | 4 | |
| 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 |


Expand Down Expand Up @@ -7456,6 +7460,7 @@ transaction.
| ----- | ---- | ----- | ----------- |
| `signer_infos` | [SignerInfo](#cosmos.tx.v1beta1.SignerInfo) | repeated | signer_infos defines the signing modes for the required signers. The number and order of elements must match the required signers from TxBody's messages. The first element is the primary signer and the one which pays the fee. |
| `fee` | [Fee](#cosmos.tx.v1beta1.Fee) | | Fee is the fee and gas limit for the transaction. The first signer is the primary signer and the one which pays the fee. The fee can be calculated based on the cost of evaluating the body and doing signature verification of the signers. This can be estimated via simulation. |
| `tip` | [Tip](#cosmos.tx.v1beta1.Tip) | | |



Expand Down Expand Up @@ -7549,6 +7554,26 @@ SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT.



<a name="cosmos.tx.v1beta1.SignDocAux"></a>

### SignDocAux



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `body_bytes` | [bytes](#bytes) | | |
| `public_key` | [google.protobuf.Any](#google.protobuf.Any) | | |
| `chain_id` | [string](#string) | | |
| `account_number` | [uint64](#uint64) | | |
| `sequence` | [uint64](#uint64) | | |
| `tip` | [Tip](#cosmos.tx.v1beta1.Tip) | | tip should be left empty if the signer is not the tipper for this transaction |






<a name="cosmos.tx.v1beta1.SignerInfo"></a>

### SignerInfo
Expand All @@ -7567,6 +7592,22 @@ signer.



<a name="cosmos.tx.v1beta1.Tip"></a>

### Tip



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | |
| `tipper` | [string](#string) | | |






<a name="cosmos.tx.v1beta1.Tx"></a>

### Tx
Expand Down
4 changes: 4 additions & 0 deletions proto/cosmos/tx/signing/v1beta1/signing.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ enum SignMode {
// from SIGN_MODE_DIRECT
SIGN_MODE_TEXTUAL = 2;

SIGN_MODE_DIRECT_AUX = 3;

SIGN_MODE_TEXTUAL_AUX = 4;
amaury1093 marked this conversation as resolved.
Show resolved Hide resolved

// 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;
Expand Down
21 changes: 20 additions & 1 deletion proto/cosmos/tx/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ message SignDoc {
uint64 account_number = 4;
}

message SignDocAux {
bytes body_bytes = 1;
google.protobuf.Any public_key = 2;
amaury1093 marked this conversation as resolved.
Show resolved Hide resolved
string chain_id = 3;
aaronc marked this conversation as resolved.
Show resolved Hide resolved
uint64 account_number = 4;
uint64 sequence = 5;

// tip should be left empty if the signer is not the tipper for this transaction
Tip tip = 6;
}

// TxBody is the body of a transaction that all signers sign over.
message TxBody {
// messages is a list of messages to be executed. The required signers of
Expand Down Expand Up @@ -108,14 +119,16 @@ 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 tip = 3;
}

// SignerInfo describes the public key and signing mode of a single top-level
// signer.
message SignerInfo {
// public_key is the public key of the signer. It is optional for accounts
// that already exist in state. If unset, the verifier can use the required \
// signer address for this position and lookup the public key.
// signer address for this position and lookup the public key.
google.protobuf.Any public_key = 1;

// mode_info describes the signing mode of the signer and is a nested
Expand Down Expand Up @@ -181,3 +194,9 @@ message Fee {
// not support fee grants, this will fail
string granter = 4;
}

message Tip {
repeated cosmos.base.v1beta1.Coin amount = 1
amaury1093 marked this conversation as resolved.
Show resolved Hide resolved
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
string tipper = 2;
aaronc marked this conversation as resolved.
Show resolved Hide resolved
}
80 changes: 44 additions & 36 deletions types/tx/signing/signing.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading