aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum/repl.go
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-05-26 16:53:58 +0800
committerMaran <maran.hidskes@gmail.com>2014-05-26 16:53:58 +0800
commit5374a95c581f45f840d1e8a993fb8e403e9d4aec (patch)
tree2f4488f631e749d543e39afec35d01493feb8d9e /ethereum/repl.go
parent36683f2e2957c262b17e71b15ecdb04d2feda0f5 (diff)
parent26ecf4b7809ebf79d2923f0b661818a37271be33 (diff)
downloaddexon-5374a95c581f45f840d1e8a993fb8e403e9d4aec.tar
dexon-5374a95c581f45f840d1e8a993fb8e403e9d4aec.tar.gz
dexon-5374a95c581f45f840d1e8a993fb8e403e9d4aec.tar.bz2
dexon-5374a95c581f45f840d1e8a993fb8e403e9d4aec.tar.lz
dexon-5374a95c581f45f840d1e8a993fb8e403e9d4aec.tar.xz
dexon-5374a95c581f45f840d1e8a993fb8e403e9d4aec.tar.zst
dexon-5374a95c581f45f840d1e8a993fb8e403e9d4aec.zip
Merge branch 'develop' of github.com:ethereum/go-ethereum into develop
Diffstat (limited to 'ethereum/repl.go')
-rw-r--r--ethereum/repl.go15
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)