Skip to content

Commit

Permalink
fix: move SigBlockHeight from TxBody into AuthInfo (#344)
Browse files Browse the repository at this point in the history
* fix: move `SigBlockHeight` from TxBody into AuthInfo (#293)

* chore: add the change into CHANGELOG.md

* fix: revert the omission of `GetSigBlockHeight()` in the tests

* fix: revert the omission `SetSigBlockHeight()` in simapp

* chore: replace the description in CHANGELOG.md into PR's

* chore: change the scope of the item into auth
  • Loading branch information
Youngtaek Yoon committed Oct 5, 2021
1 parent 678637c commit cc78696
Show file tree
Hide file tree
Showing 8 changed files with 221 additions and 256 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
* (wasm) [\#254](https://github.com/line/lbm-sdk/pull/254) Specify wasm event types
* (x) [\#255](https://github.com/line/lbm-sdk/pull/255) Remove legacy from modules
* (perf) [\#320](https:/github.com/line/lbm-sdk/pull/320) internal objects optimization (BaseAccount, Balance & Supply)
* (auth) [\#344](https://github.com/line/lbm-sdk/pull/344) move SigBlockHeight from TxBody into AuthInfo

### Bug Fixes
* (test) [\#92](https://github.com/line/lbm-sdk/pull/92) Fix SendToModuleAccountTest
Expand Down
2 changes: 1 addition & 1 deletion docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -9469,6 +9469,7 @@ transaction.
| ----- | ---- | ----- | ----------- |
| `signer_infos` | [SignerInfo](#lbm.tx.v1.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](#lbm.tx.v1.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. |
| `sig_block_height` | [uint64](#uint64) | | sig block height is available between current block height and current block height - `VALID_SIG_BLOCK_PERIOD` this is used for distinguish signatures instead of account number. this is mandatory. |



Expand Down Expand Up @@ -9605,7 +9606,6 @@ TxBody is the body of a transaction that all signers sign over.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | messages is a list of messages to be executed. The required signers of those messages define the number and order of elements in AuthInfo's signer_infos and Tx's signatures. Each required signer address is added to the list only the first time it occurs. By convention, the first required signer (usually from the first message) is referred to as the primary signer and pays the fee for the whole transaction. |
| `sig_block_height` | [uint64](#uint64) | | sig block height is available between current block height and current block height - `VALID_SIG_BLOCK_PERIOD` this is used for distinguish signatures instead of account number. this is mandatory. |
| `memo` | [string](#string) | | memo is any arbitrary memo to be added to the transaction |
| `timeout_height` | [uint64](#uint64) | | timeout is the block height after which this transaction will not be processed by the chain |
| `extension_options` | [google.protobuf.Any](#google.protobuf.Any) | repeated | extension_options are arbitrary options that can be added by chains when the default options are not sufficient. If any of these are present and can't be handled, the transaction will be rejected |
Expand Down
12 changes: 6 additions & 6 deletions proto/lbm/tx/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,12 @@ message TxBody {
// transaction.
repeated google.protobuf.Any messages = 1;

// sig block height is available between current block height and current block height - `VALID_SIG_BLOCK_PERIOD`
// this is used for distinguish signatures instead of account number. this is mandatory.
uint64 sig_block_height = 2;

// memo is any arbitrary memo to be added to the transaction
string memo = 3;
string memo = 2;

// timeout is the block height after which this transaction will not
// be processed by the chain
uint64 timeout_height = 4;
uint64 timeout_height = 3;

// extension_options are arbitrary options that can be added by chains
// when the default options are not sufficient. If any of these are present
Expand All @@ -107,6 +103,10 @@ 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;

// sig block height is available between current block height and current block height - `VALID_SIG_BLOCK_PERIOD`
// this is used for distinguish signatures instead of account number. this is mandatory.
uint64 sig_block_height = 3;
}

// SignerInfo describes the public key and signing mode of a single top-level
Expand Down
258 changes: 111 additions & 147 deletions testutil/testdata/unknonwnproto.pb.go

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions testutil/testdata/unknonwnproto.proto
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,9 @@ message TestUpdatedTxRaw {

message TestUpdatedTxBody {
repeated google.protobuf.Any messages = 1;
uint64 sig_block_height = 2;
string memo = 3;
int64 timeout_height = 4;
uint64 some_new_field = 5;
string memo = 2;
int64 timeout_height = 3;
uint64 some_new_field = 4;
string some_new_field_non_critical_field = 1050;
repeated google.protobuf.Any extension_options = 1023;
repeated google.protobuf.Any non_critical_extension_options = 2047;
Expand Down
Loading

0 comments on commit cc78696

Please sign in to comment.