Update contract summary output to include transaction info

This commit is contained in:
Matt Krump
2017-11-14 09:57:27 -06:00
committed by Eric Meyer
parent a23023f7d6
commit d0602833bb
6 changed files with 90 additions and 15 deletions
+1 -1
View File
@@ -200,7 +200,7 @@ func (repository Postgres) loadContract(contractRows *sql.Rows) []core.WatchedCo
for contractRows.Next() {
var savedContractHash string
contractRows.Scan(&savedContractHash)
transactionRows, _ := repository.Db.Query(`SELECT tx_hash, tx_nonce, tx_to, tx_from, tx_gaslimit, tx_gasprice, tx_value FROM transactions WHERE tx_to = $1`, savedContractHash)
transactionRows, _ := repository.Db.Query(`SELECT tx_hash, tx_nonce, tx_to, tx_from, tx_gaslimit, tx_gasprice, tx_value FROM transactions WHERE tx_to = $1 ORDER BY block_id desc`, savedContractHash)
transactions := repository.loadTransactions(transactionRows)
savedContract := core.WatchedContract{Hash: savedContractHash, Transactions: transactions}
savedContracts = append(savedContracts, savedContract)