aboutsummaryrefslogtreecommitdiffstats
path: root/javascript/javascript_runtime.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-08-16 07:38:24 +0800
committerobscuren <geffobscura@gmail.com>2014-08-16 07:38:24 +0800
commit2eab964a00b998068f49b088949730f4896e256c (patch)
tree3264e7768f49948d8798519319b13f67ad39fbae /javascript/javascript_runtime.go
parent8f1b461228a8e1cf81762c81037f879300f4989e (diff)
downloadgo-tangerine-2eab964a00b998068f49b088949730f4896e256c.tar
go-tangerine-2eab964a00b998068f49b088949730f4896e256c.tar.gz
go-tangerine-2eab964a00b998068f49b088949730f4896e256c.tar.bz2
go-tangerine-2eab964a00b998068f49b088949730f4896e256c.tar.lz
go-tangerine-2eab964a00b998068f49b088949730f4896e256c.tar.xz
go-tangerine-2eab964a00b998068f49b088949730f4896e256c.tar.zst
go-tangerine-2eab964a00b998068f49b088949730f4896e256c.zip
Switched over to ethpipe
Diffstat (limited to 'javascript/javascript_runtime.go')
-rw-r--r--javascript/javascript_runtime.go20
1 files changed, 4 insertions, 16 deletions
diff --git a/javascript/javascript_runtime.go b/javascript/javascript_runtime.go
index d384c5048..c794c32a8 100644
--- a/javascript/javascript_runtime.go
+++ b/javascript/javascript_runtime.go
@@ -10,7 +10,7 @@ import (
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethlog"
- "github.com/ethereum/eth-go/ethpub"
+ "github.com/ethereum/eth-go/ethpipe"
"github.com/ethereum/eth-go/ethreact"
"github.com/ethereum/eth-go/ethstate"
"github.com/ethereum/eth-go/ethutil"
@@ -23,7 +23,7 @@ var jsrelogger = ethlog.NewLogger("JSRE")
type JSRE struct {
ethereum *eth.Ethereum
Vm *otto.Otto
- lib *ethpub.PEthereum
+ pipe *ethpipe.JSPipe
blockChan chan ethreact.Event
changeChan chan ethreact.Event
@@ -50,7 +50,7 @@ func NewJSRE(ethereum *eth.Ethereum) *JSRE {
re := &JSRE{
ethereum,
otto.New(),
- ethpub.New(ethereum),
+ ethpipe.NewJSPipe(ethereum),
make(chan ethreact.Event, 10),
make(chan ethreact.Event, 10),
make(chan bool),
@@ -71,7 +71,7 @@ func NewJSRE(ethereum *eth.Ethereum) *JSRE {
reactor := ethereum.Reactor()
reactor.Subscribe("newBlock", re.blockChan)
- re.Bind("eth", &JSEthereum{re.lib, re.Vm, ethereum})
+ re.Bind("eth", &JSEthereum{re.pipe, re.Vm, ethereum})
re.initStdFuncs()
@@ -123,18 +123,6 @@ out:
case block := <-self.blockChan:
if _, ok := block.Resource.(*ethchain.Block); ok {
}
- case object := <-self.changeChan:
- if stateObject, ok := object.Resource.(*ethstate.StateObject); ok {
- 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.(*ethstate.StorageState); ok {
- for _, cb := range self.objectCb[ethutil.Bytes2Hex(storageObject.StateAddress)+ethutil.Bytes2Hex(storageObject.Address)] {
- val, _ := self.Vm.ToValue(ethpub.NewPStorageState(storageObject))
- cb.Call(cb, val)
- }
- }
}
}
}