MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / GetTransactionByHash

Method GetTransactionByHash

api/models/transactions.go:35–45  ·  view source on GitHub ↗

GetTransactionByHash get a transaction by its hash.

(hash string)

Source from the content-addressed store, hash-verified

33
34// GetTransactionByHash get a transaction by its hash.
35func (m *TransactionsModel) GetTransactionByHash(hash string) (tx *Transaction, err error) {
36 tx = &Transaction{}
37 query := `SELECT block_height, tx_index, hash, block_hash, timestamp, tx_type,
38 address, raw
39 FROM indexed_transactions WHERE hash = ?`
40 err = chaindb.SelectOne(tx, query, hash)
41 if err == sql.ErrNoRows {
42 return nil, nil
43 }
44 return tx, err
45}
46
47// GetTransactionListOfBlock get a transaction list of block.
48func (m *TransactionsModel) GetTransactionListOfBlock(ofBlockHeight int, page, size int) (

Callers 2

bpGetTransactionByHashFunction · 0.95
GetTransactionListMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected