Skip to content

Commit

Permalink
refactor: improve godoc
Browse files Browse the repository at this point in the history
  • Loading branch information
ninabarbakadze committed Jun 19, 2024
1 parent db029d4 commit 4ddf76f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions proto/tendermint/store/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions rpc/core/types/responses.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
3 changes: 1 addition & 2 deletions store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 4ddf76f

Please sign in to comment.