From 3a983d2419cdd053f5e03193794d1663c841f4b2 Mon Sep 17 00:00:00 2001 From: Taylor Gerring Date: Fri, 3 Jul 2015 11:20:07 -0500 Subject: Initial getTransactionReceipt support --- rpc/api/parsing.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'rpc/api/parsing.go') diff --git a/rpc/api/parsing.go b/rpc/api/parsing.go index 632462c31..d1f9ccac2 100644 --- a/rpc/api/parsing.go +++ b/rpc/api/parsing.go @@ -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 -- cgit v1.2.3