Initial getTransactionReceipt support

This commit is contained in:
Taylor Gerring
2015-07-03 11:20:07 -05:00
parent 6f69b4d61f
commit 3a983d2419
2 changed files with 43 additions and 0 deletions

View File

@ -402,6 +402,29 @@ func NewUncleRes(h *types.Header) *UncleRes {
// WorkProved string `json:"workProved"`
// }
type ReceiptRes struct {
TransactionHash *hexdata `json:transactionHash`
TransactionIndex *hexnum `json:transactionIndex`
BlockNumber *hexnum `json:blockNumber`
BlockHash *hexdata `json:blockHash`
CumulativeGasUsed *hexnum `json:cumulativeGasUsed`
GasUsed *hexnum `json:gasUsed`
ContractAddress *hexdata `json:contractAddress`
Logs *[]interface{} `json:logs`
}
func NewReceiptRes(rec *types.Receipt) *ReceiptRes {
if rec == nil {
return nil
}
var v = new(ReceiptRes)
// TODO fill out rest of object
v.CumulativeGasUsed = newHexNum(rec.CumulativeGasUsed)
return v
}
func numString(raw interface{}) (*big.Int, error) {
var number *big.Int
// Parse as integer