diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-11 02:59:12 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-11 02:59:12 +0800 |
commit | 5553e5aaed5c3f4e303b7d6671d2c92a45aa487e (patch) | |
tree | fc4f9c7a088d0af0e3eec76258df89c3e9968ba4 /xeth | |
parent | af6afbaa56efa15abe6a03665c6674b0e2f591c8 (diff) | |
download | dexon-5553e5aaed5c3f4e303b7d6671d2c92a45aa487e.tar.gz dexon-5553e5aaed5c3f4e303b7d6671d2c92a45aa487e.tar.zst dexon-5553e5aaed5c3f4e303b7d6671d2c92a45aa487e.zip |
states moved to chain
Diffstat (limited to 'xeth')
-rw-r--r-- | xeth/pipe.go | 12 | ||||
-rw-r--r-- | xeth/world.go | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/xeth/pipe.go b/xeth/pipe.go index 2ca8134ce..a8d8ed999 100644 --- a/xeth/pipe.go +++ b/xeth/pipe.go @@ -22,7 +22,7 @@ type VmVars struct { type XEth struct { obj core.EthManager blockManager *core.BlockManager - blockChain *core.ChainManager + chainManager *core.ChainManager world *World Vm VmVars @@ -32,7 +32,7 @@ func New(obj core.EthManager) *XEth { pipe := &XEth{ obj: obj, blockManager: obj.BlockManager(), - blockChain: obj.ChainManager(), + chainManager: obj.ChainManager(), } pipe.world = NewWorld(pipe) @@ -51,7 +51,7 @@ func (self *XEth) Nonce(addr []byte) uint64 { } func (self *XEth) Block(hash []byte) *types.Block { - return self.blockChain.GetBlock(hash) + return self.chainManager.GetBlock(hash) } func (self *XEth) Storage(addr, storageAddr []byte) *ethutil.Value { @@ -82,7 +82,7 @@ func (self *XEth) Execute(addr []byte, data []byte, value, gas, price *ethutil.V func (self *XEth) ExecuteObject(object *Object, data []byte, value, gas, price *ethutil.Value) ([]byte, error) { var ( initiator = state.NewStateObject(self.obj.KeyManager().KeyPair().Address()) - block = self.blockChain.CurrentBlock + block = self.chainManager.CurrentBlock ) self.Vm.State = self.World().State().Copy() @@ -131,14 +131,14 @@ func (self *XEth) Transact(key *crypto.KeyPair, to []byte, value, gas, price *et tx = types.NewTransactionMessage(hash, value.BigInt(), gas.BigInt(), price.BigInt(), data) } - state := self.blockManager.TransState() + state := self.chainManager.TransState() nonce := state.GetNonce(key.Address()) tx.Nonce = nonce tx.Sign(key.PrivateKey) // Do some pre processing for our "pre" events and hooks - block := self.blockChain.NewBlock(key.Address()) + block := self.chainManager.NewBlock(key.Address()) coinbase := state.GetStateObject(key.Address()) coinbase.SetGasPool(block.GasLimit) self.blockManager.ApplyTransactions(coinbase, state, block, types.Transactions{tx}, true) diff --git a/xeth/world.go b/xeth/world.go index c5c20c224..956ef1e15 100644 --- a/xeth/world.go +++ b/xeth/world.go @@ -23,7 +23,7 @@ func (self *XEth) World() *World { } func (self *World) State() *state.StateDB { - return self.pipe.blockManager.CurrentState() + return self.pipe.chainManager.State() } func (self *World) Get(addr []byte) *Object { |