aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/xeth.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-12 22:59:07 +0800
committerobscuren <geffobscura@gmail.com>2015-03-12 22:59:07 +0800
commit2273155e7e325a2a6a940fffae7e9f6744b2ec22 (patch)
tree1767f5b797db8988afc46e9118b61d522a9c5226 /xeth/xeth.go
parent26a563642431806486b595f29e22ae833abb6a8c (diff)
downloaddexon-2273155e7e325a2a6a940fffae7e9f6744b2ec22.tar.gz
dexon-2273155e7e325a2a6a940fffae7e9f6744b2ec22.tar.zst
dexon-2273155e7e325a2a6a940fffae7e9f6744b2ec22.zip
Get transaction implemented
* Added a GetTransaction to XEth * Implemented the `eth_getTransactionByHash` RPC method
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r--xeth/xeth.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 70172a1c8..4c28caf86 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -32,6 +32,7 @@ type Backend interface {
Peers() []*p2p.Peer
BlockDb() ethutil.Database
StateDb() ethutil.Database
+ ExtraDb() ethutil.Database
EventMux() *event.TypeMux
Whisper() *whisper.Whisper
@@ -127,6 +128,14 @@ func (self *XEth) EthBlockByHash(strHash string) *types.Block {
return block
}
+func (self *XEth) EthTransactionByHash(hash string) *types.Transaction {
+ data, _ := self.eth.ExtraDb().Get(fromHex(hash))
+ if len(data) != 0 {
+ return types.NewTransactionFromBytes(data)
+ }
+ return nil
+}
+
func (self *XEth) BlockByNumber(num int64) *Block {
if num == -1 {
return NewBlock(self.chainManager.CurrentBlock())
@@ -231,10 +240,6 @@ func (self *XEth) SecretToAddress(key string) string {
return toHex(pair.Address())
}
-func (self *XEth) Execute(addr, value, gas, price, data string) (string, error) {
- return "", nil
-}
-
type KeyVal struct {
Key string `json:"key"`
Value string `json:"value"`