aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum/javascript_runtime.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <obscuren@users.noreply.github.com>2014-07-01 22:15:59 +0800
committerJeffrey Wilcke <obscuren@users.noreply.github.com>2014-07-01 22:15:59 +0800
commit5e02d2b5866e9aeb4bc0ad0ec4479f2104131f51 (patch)
tree6d50a032f70e1b3709f47403fcc793e52ac9b4c9 /ethereum/javascript_runtime.go
parent4fc60f340f6ef5ffe68e684ed44e5974fa08e8c8 (diff)
parentce88a73aa6e695a0b672da2d01baf14f03d514b0 (diff)
downloaddexon-5e02d2b5866e9aeb4bc0ad0ec4479f2104131f51.tar
dexon-5e02d2b5866e9aeb4bc0ad0ec4479f2104131f51.tar.gz
dexon-5e02d2b5866e9aeb4bc0ad0ec4479f2104131f51.tar.bz2
dexon-5e02d2b5866e9aeb4bc0ad0ec4479f2104131f51.tar.lz
dexon-5e02d2b5866e9aeb4bc0ad0ec4479f2104131f51.tar.xz
dexon-5e02d2b5866e9aeb4bc0ad0ec4479f2104131f51.tar.zst
dexon-5e02d2b5866e9aeb4bc0ad0ec4479f2104131f51.zip
Merge pull request #96 from ethersphere/feature/keys
Feature/keys
Diffstat (limited to 'ethereum/javascript_runtime.go')
-rw-r--r--ethereum/javascript_runtime.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/ethereum/javascript_runtime.go b/ethereum/javascript_runtime.go
index 0dfe07a54..852a50487 100644
--- a/ethereum/javascript_runtime.go
+++ b/ethereum/javascript_runtime.go
@@ -122,12 +122,12 @@ out:
}
case object := <-self.changeChan:
if stateObject, ok := object.Resource.(*ethchain.StateObject); ok {
- for _, cb := range self.objectCb[ethutil.Hex(stateObject.Address())] {
+ for _, cb := range self.objectCb[ethutil.Bytes2Hex(stateObject.Address())] {
val, _ := self.vm.ToValue(ethpub.NewPStateObject(stateObject))
cb.Call(cb, val)
}
} else if storageObject, ok := object.Resource.(*ethchain.StorageState); ok {
- for _, cb := range self.objectCb[ethutil.Hex(storageObject.StateAddress)+ethutil.Hex(storageObject.Address)] {
+ for _, cb := range self.objectCb[ethutil.Bytes2Hex(storageObject.StateAddress)+ethutil.Bytes2Hex(storageObject.Address)] {
val, _ := self.vm.ToValue(ethpub.NewPStorageState(storageObject))
cb.Call(cb, val)
}
@@ -178,12 +178,12 @@ func (self *JSRE) watch(call otto.FunctionCall) otto.Value {
if storageCallback {
self.objectCb[addr+storageAddr] = append(self.objectCb[addr+storageAddr], cb)
- event := "storage:" + string(ethutil.FromHex(addr)) + ":" + string(ethutil.FromHex(storageAddr))
+ event := "storage:" + string(ethutil.Hex2Bytes(addr)) + ":" + string(ethutil.Hex2Bytes(storageAddr))
self.ethereum.Reactor().Subscribe(event, self.changeChan)
} else {
self.objectCb[addr] = append(self.objectCb[addr], cb)
- event := "object:" + string(ethutil.FromHex(addr))
+ event := "object:" + string(ethutil.Hex2Bytes(addr))
self.ethereum.Reactor().Subscribe(event, self.changeChan)
}
@@ -221,7 +221,7 @@ func (self *JSRE) execBlock(call otto.FunctionCall) otto.Value {
return otto.UndefinedValue()
}
- err = utils.BlockDo(self.ethereum, ethutil.FromHex(hash))
+ err = utils.BlockDo(self.ethereum, ethutil.Hex2Bytes(hash))
if err != nil {
fmt.Println(err)
return otto.FalseValue()