Skip to content

Commit

Permalink
api: rename /chain/transactions fields
Browse files Browse the repository at this point in the history
renames:
  * transactionHash -> hash
  * blockHeight -> height
  * transactionIndex -> index
  * transactionType -> type

affected endpoints:
  /chain/blocks/{height}/transactions/page/{page}
  /chain/transactions/page/{page}
  /chain/transactions
  /chain/transactions/{height}/{index}
  /chain/transactions/reference/{hash}
  • Loading branch information
altergui committed Sep 2, 2024
1 parent 194de89 commit 60b68ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vochain/indexer/indexertypes/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ type TxPackage struct {

// Transaction holds the db reference for a single transaction
type Transaction struct {
Hash types.HexBytes `json:"transactionHash" swaggertype:"string" example:"75e8f822f5dd13973ac5158d600f0a2a5fea4bfefce9712ab5195bf17884cfad"`
BlockHeight uint32 `json:"blockHeight" format:"int32" example:"64924"`
TxBlockIndex int32 `json:"transactionIndex" format:"int32" example:"0"`
TxType string `json:"transactionType" enums:"vote,newProcess,admin,setProcess,registerKey,mintTokens,sendTokens,setTransactionCosts,setAccount,collectFaucet,setKeykeeper" example:"Vote"`
Hash types.HexBytes `json:"hash" swaggertype:"string" example:"75e8f822f5dd13973ac5158d600f0a2a5fea4bfefce9712ab5195bf17884cfad"`
BlockHeight uint32 `json:"height" format:"int32" example:"64924"`
TxBlockIndex int32 `json:"index" format:"int32" example:"0"`
TxType string `json:"type" enums:"vote,newProcess,admin,setProcess,registerKey,mintTokens,sendTokens,setTransactionCosts,setAccount,collectFaucet,setKeykeeper" example:"Vote"`
}

func TransactionFromDB(dbtx *indexerdb.Transaction) *Transaction {
Expand Down

0 comments on commit 60b68ee

Please sign in to comment.