aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api/eth.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/eth.go
parent6f69b4d61f1278ea2d9351667512a1202403eaff (diff)
downloadgo-tangerine-3a983d2419cdd053f5e03193794d1663c841f4b2.tar
go-tangerine-3a983d2419cdd053f5e03193794d1663c841f4b2.tar.gz
go-tangerine-3a983d2419cdd053f5e03193794d1663c841f4b2.tar.bz2
go-tangerine-3a983d2419cdd053f5e03193794d1663c841f4b2.tar.lz
go-tangerine-3a983d2419cdd053f5e03193794d1663c841f4b2.tar.xz
go-tangerine-3a983d2419cdd053f5e03193794d1663c841f4b2.tar.zst
go-tangerine-3a983d2419cdd053f5e03193794d1663c841f4b2.zip
Initial getTransactionReceipt support
Diffstat (limited to 'rpc/api/eth.go')
-rw-r--r--rpc/api/eth.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/rpc/api/eth.go b/rpc/api/eth.go
index db0b4b024..c556c739f 100644
--- a/rpc/api/eth.go
+++ b/rpc/api/eth.go
@@ -77,6 +77,7 @@ var (
"eth_submitWork": (*ethApi).SubmitWork,
"eth_resend": (*ethApi).Resend,
"eth_pendingTransactions": (*ethApi).PendingTransactions,
+ "eth_getTransactionReceipt": (*ethApi).GetTransactionReceipt,
}
)
@@ -596,3 +597,22 @@ func (self *ethApi) PendingTransactions(req *shared.Request) (interface{}, error
return ltxs, nil
}
+
+func (self *ethApi) GetTransactionReceipt(req *shared.Request) (interface{}, error) {
+ args := new(HashArgs)
+ if err := self.codec.Decode(req.Params, &args); err != nil {
+ return nil, shared.NewDecodeParamError(err.Error())
+ }
+
+ rec, _ := self.xeth.GetTxReceipt(common.StringToHash(args.Hash))
+ // We could have an error of "not found". Should disambiguate
+ // if err != nil {
+ // return err, nil
+ // }
+ if rec != nil {
+ v := NewReceiptRes(rec)
+ return v, nil
+ }
+
+ return nil, nil
+}