GetTransactionByHash get a transaction by its hash.
(hash string)
| 33 | |
| 34 | // GetTransactionByHash get a transaction by its hash. |
| 35 | func (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. |
| 48 | func (m *TransactionsModel) GetTransactionListOfBlock(ofBlockHeight int, page, size int) ( |
no outgoing calls
no test coverage detected