diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-26 06:41:55 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-26 06:41:55 +0800 |
commit | 0d89c1d212e121b4904bf24b5332de9d4344334b (patch) | |
tree | b6499be349d9950ba083e211ebb787294fbf413c /ethereum/repl.go | |
parent | 7f1a4c377c18055137909521d809251248b7b5af (diff) | |
parent | 818bc84591c490b29cb28ee1e4895c8f303a0af1 (diff) | |
download | go-tangerine-0d89c1d212e121b4904bf24b5332de9d4344334b.tar go-tangerine-0d89c1d212e121b4904bf24b5332de9d4344334b.tar.gz go-tangerine-0d89c1d212e121b4904bf24b5332de9d4344334b.tar.bz2 go-tangerine-0d89c1d212e121b4904bf24b5332de9d4344334b.tar.lz go-tangerine-0d89c1d212e121b4904bf24b5332de9d4344334b.tar.xz go-tangerine-0d89c1d212e121b4904bf24b5332de9d4344334b.tar.zst go-tangerine-0d89c1d212e121b4904bf24b5332de9d4344334b.zip |
Merge branch 'release/poc5-rc9'poc5-rc9
Diffstat (limited to 'ethereum/repl.go')
-rw-r--r-- | ethereum/repl.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ethereum/repl.go b/ethereum/repl.go index d1243d19c..10f51675e 100644 --- a/ethereum/repl.go +++ b/ethereum/repl.go @@ -48,13 +48,22 @@ func (self *JSRepl) parseInput(code string) { // The JSEthereum object attempts to wrap the PEthereum object and returns // meaningful javascript objects +type JSBlock struct { + *ethpub.PBlock + eth *JSEthereum +} + +func (self *JSBlock) GetTransaction(hash string) otto.Value { + return self.eth.toVal(self.PBlock.GetTransaction(hash)) +} + type JSEthereum struct { *ethpub.PEthereum vm *otto.Otto } func (self *JSEthereum) GetBlock(hash string) otto.Value { - return self.toVal(self.PEthereum.GetBlock(hash)) + return self.toVal(&JSBlock{self.PEthereum.GetBlock(hash), self}) } func (self *JSEthereum) GetKey() otto.Value { @@ -76,8 +85,8 @@ func (self *JSEthereum) Transact(key, recipient, valueStr, gasStr, gasPriceStr, return self.toVal(r) } -func (self *JSEthereum) Create(key, valueStr, gasStr, gasPriceStr, initStr, bodyStr string) otto.Value { - r, err := self.PEthereum.Create(key, valueStr, gasStr, gasPriceStr, initStr, bodyStr) +func (self *JSEthereum) Create(key, valueStr, gasStr, gasPriceStr, scriptStr string) otto.Value { + r, err := self.PEthereum.Create(key, valueStr, gasStr, gasPriceStr, scriptStr) if err != nil { fmt.Println(err) |