aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api/parsing.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-07-04 00:20:07 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-07-04 12:03:11 +0800
commit3a983d2419cdd053f5e03193794d1663c841f4b2 (patch)
tree79924d9b8abd38b4f6d8f4a932465c985c67de8a /rpc/api/parsing.go
parent6f69b4d61f1278ea2d9351667512a1202403eaff (diff)
downloaddexon-3a983d2419cdd053f5e03193794d1663c841f4b2.tar
dexon-3a983d2419cdd053f5e03193794d1663c841f4b2.tar.gz
dexon-3a983d2419cdd053f5e03193794d1663c841f4b2.tar.bz2
dexon-3a983d2419cdd053f5e03193794d1663c841f4b2.tar.lz
dexon-3a983d2419cdd053f5e03193794d1663c841f4b2.tar.xz
dexon-3a983d2419cdd053f5e03193794d1663c841f4b2.tar.zst
dexon-3a983d2419cdd053f5e03193794d1663c841f4b2.zip
Initial getTransactionReceipt support
Diffstat (limited to 'rpc/api/parsing.go')
-rw-r--r--rpc/api/parsing.go23
1 files changed, 23 insertions, 0 deletions
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