aboutsummaryrefslogtreecommitdiffstats
path: root/xeth
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-06-16 18:41:50 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-06-30 00:51:47 +0800
commit1d42888d3047dabfb352c94a2051e7af14d2a509 (patch)
tree8ca68ca98bd697f26f2033a5480e78ccbf064162 /xeth
parent654564e164b3b6f7f4ba1e8bbd6fcd64776068fa (diff)
downloaddexon-1d42888d3047dabfb352c94a2051e7af14d2a509.tar
dexon-1d42888d3047dabfb352c94a2051e7af14d2a509.tar.gz
dexon-1d42888d3047dabfb352c94a2051e7af14d2a509.tar.bz2
dexon-1d42888d3047dabfb352c94a2051e7af14d2a509.tar.lz
dexon-1d42888d3047dabfb352c94a2051e7af14d2a509.tar.xz
dexon-1d42888d3047dabfb352c94a2051e7af14d2a509.tar.zst
dexon-1d42888d3047dabfb352c94a2051e7af14d2a509.zip
core/types: make blocks immutable
Diffstat (limited to 'xeth')
-rw-r--r--xeth/xeth.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 11d30ebac..0dbedff43 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -209,8 +209,8 @@ func (self *XEth) AtStateNum(num int64) *XEth {
// - could be removed in favour of mining on testdag (natspec e2e + networking)
// + filters
func (self *XEth) ApplyTestTxs(statedb *state.StateDB, address common.Address, txc uint64) (uint64, *XEth) {
-
- block := self.backend.ChainManager().NewBlock(address)
+ chain := self.backend.ChainManager()
+ header := chain.CurrentBlock().Header()
coinbase := statedb.GetStateObject(address)
coinbase.SetGasLimit(big.NewInt(10000000))
txs := self.backend.TxPool().GetQueuedTransactions()
@@ -218,7 +218,7 @@ func (self *XEth) ApplyTestTxs(statedb *state.StateDB, address common.Address, t
for i := 0; i < len(txs); i++ {
for _, tx := range txs {
if tx.Nonce() == txc {
- _, _, err := core.ApplyMessage(core.NewEnv(statedb, self.backend.ChainManager(), tx, block), tx, coinbase)
+ _, _, err := core.ApplyMessage(core.NewEnv(statedb, self.backend.ChainManager(), tx, header), tx, coinbase)
if err != nil {
panic(err)
}
@@ -845,8 +845,8 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st
msg.gasPrice = self.DefaultGasPrice()
}
- block := self.CurrentBlock()
- vmenv := core.NewEnv(statedb, self.backend.ChainManager(), msg, block)
+ header := self.CurrentBlock().Header()
+ vmenv := core.NewEnv(statedb, self.backend.ChainManager(), msg, header)
res, gas, err := core.ApplyMessage(vmenv, msg, from)
return common.ToHex(res), gas.String(), err