From 4ddf76f7fc662086365744169f986693d0b17ed8 Mon Sep 17 00:00:00 2001 From: Nina Barbakadze Date: Wed, 19 Jun 2024 15:18:30 +0200 Subject: [PATCH] refactor: improve godoc --- proto/tendermint/store/types.proto | 4 ++-- rpc/core/types/responses.go | 4 ++-- store/store.go | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/proto/tendermint/store/types.proto b/proto/tendermint/store/types.proto index 54c5143c69..843667455b 100644 --- a/proto/tendermint/store/types.proto +++ b/proto/tendermint/store/types.proto @@ -12,8 +12,8 @@ message BlockStoreState { // as well as the result of executing the transaction. message TxInfo { int64 height = 1; - uint32 index = 2; + uint32 index = 2; // The response code of executing the tx. 0 means // successfully executed, all others are error codes. - uint32 code = 3; + uint32 code = 3; } diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index f072aa9779..c5b858cfc1 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -60,8 +60,8 @@ type ResultCommit struct { CanonicalCommit bool `json:"canonical"` } -// ResultTxStatus contains info to locate a tx in a committed block. -// TODO: nina update godoc +// ResultTxStatus represents the status of a transaction during its life cycle. +// It contains info to locate a tx in a committed block as well as its execution code and status. type ResultTxStatus struct { Height int64 `json:"height"` Index uint32 `json:"index"` diff --git a/store/store.go b/store/store.go index fb27f5c196..df06c64212 100644 --- a/store/store.go +++ b/store/store.go @@ -450,8 +450,7 @@ func (bs *BlockStore) SaveSeenCommit(height int64, seenCommit *types.Commit) err return bs.db.Set(calcSeenCommitKey(height), seenCommitBytes) } -// SaveTxInfo gets Tx hashes from the block converts them to TxInfo and persists them to the db. -// TODO: nina: update godoc here +// SaveTxInfo indexes the txs from the block with the given response codes during execution. func (bs *BlockStore) SaveTxInfo(block *types.Block, txResponseCodes []uint32) error { if len(txResponseCodes) != len(block.Txs) { return fmt.Errorf("txResponseCodes length mismatch with block txs length")