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 index field into TxResponse #526

Merged
merged 7 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Improvements

* (refactor) [\#493](https://github.com/line/lbm-sdk/pull/493) restructure x/consortium
* (server/grpc) [\#526](https://github.com/line/lbm-sdk/pull/526) add index field into TxResponse

### Bug Fixes
* (x/wasm) [\#453](https://github.com/line/lbm-sdk/pull/453) modify wasm grpc query api path
Expand Down
7 changes: 4 additions & 3 deletions client/docs/statik/statik.go

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5011,6 +5011,7 @@ tags are stringified and the log is JSON decoded.
| `events` | [ostracon.abci.Event](#ostracon.abci.Event) | repeated | Events defines all the events emitted by processing a transaction. Note, these events include those emitted by processing all the messages and those emitted from the ante handler. Whereas Logs contains the events, with additional metadata, emitted only by processing the messages.

Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 |
| `index` | [uint32](#uint32) | | The transaction index within block |



Expand Down Expand Up @@ -13425,7 +13426,7 @@ MsgStoreCodeAndInstantiateContract submit Wasm code to the system and instantiat
| `instantiate_permission` | [AccessConfig](#lbm.wasm.v1.AccessConfig) | | |
| `admin` | [string](#string) | | Admin is an optional address that can execute migrations |
| `label` | [string](#string) | | Label is optional metadata to be stored with a contract instance. |
| `msg` | [bytes](#bytes) | | InitMsg json encoded message to be passed to the contract on instantiation |
| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on instantiation |
| `funds` | [lbm.base.v1.Coin](#lbm.base.v1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation |


Expand Down
2 changes: 2 additions & 0 deletions proto/lbm/base/abci/v1/abci.proto
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ message TxResponse {
//
// Since: cosmos-sdk 0.42.11, 0.44.5, 0.45
repeated ostracon.abci.Event events = 13 [(gogoproto.nullable) = false];
// The transaction index within block
uint32 index = 14;
}

// ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
Expand Down
146 changes: 88 additions & 58 deletions types/abci.pb.go

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

1 change: 1 addition & 0 deletions types/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func NewResponseResultTx(res *ctypes.ResultTx, anyTx *codectypes.Any, timestamp
Tx: anyTx,
Timestamp: timestamp,
Events: res.TxResult.Events,
Index: res.Index,
}
}

Expand Down
3 changes: 3 additions & 0 deletions types/result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func (s *resultTestSuite) TestResponseResultTx() {
resultTx := &ctypes.ResultTx{
Hash: bytes.HexBytes([]byte("test")),
Height: 10,
Index: 1,
TxResult: deliverTxResult,
}
logs, err := sdk.ParseABCILogs(`[]`)
Expand All @@ -160,6 +161,7 @@ func (s *resultTestSuite) TestResponseResultTx() {
GasUsed: 90,
Tx: nil,
Timestamp: "timestamp",
Index: 1,
}

s.Require().Equal(want, sdk.NewResponseResultTx(resultTx, nil, "timestamp"))
Expand All @@ -171,6 +173,7 @@ events: []
gas_used: "90"
gas_wanted: "100"
height: "10"
index: 1
info: info
logs: []
raw_log: '[]'
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/types/tx.pb.go

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