aboutsummaryrefslogtreecommitdiffstats
path: root/eth/api_backend.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-11-14 17:52:02 +0800
committerGitHub <noreply@github.com>2016-11-14 17:52:02 +0800
commitca73dea3b9bcdf3b5424b5c48c70817439e2e304 (patch)
tree670e2833878e72555644fbbd81db6c5a1b44493f /eth/api_backend.go
parent21701190ac0a838e347f31b7a918bb0a60c1e8c1 (diff)
parent648bd22427000b6e20a5e1a9c397005aa1ad4f9b (diff)
downloaddexon-ca73dea3b9bcdf3b5424b5c48c70817439e2e304.tar
dexon-ca73dea3b9bcdf3b5424b5c48c70817439e2e304.tar.gz
dexon-ca73dea3b9bcdf3b5424b5c48c70817439e2e304.tar.bz2
dexon-ca73dea3b9bcdf3b5424b5c48c70817439e2e304.tar.lz
dexon-ca73dea3b9bcdf3b5424b5c48c70817439e2e304.tar.xz
dexon-ca73dea3b9bcdf3b5424b5c48c70817439e2e304.tar.zst
dexon-ca73dea3b9bcdf3b5424b5c48c70817439e2e304.zip
Merge pull request #3179 from obscuren/eip-158
EIP158 & 160 Hardfork
Diffstat (limited to 'eth/api_backend.go')
-rw-r--r--eth/api_backend.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/eth/api_backend.go b/eth/api_backend.go
index efe9a7a01..0925132ef 100644
--- a/eth/api_backend.go
+++ b/eth/api_backend.go
@@ -30,6 +30,7 @@ import (
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/internal/ethapi"
+ "github.com/ethereum/go-ethereum/params"
rpc "github.com/ethereum/go-ethereum/rpc"
"golang.org/x/net/context"
)
@@ -40,6 +41,14 @@ type EthApiBackend struct {
gpo *gasprice.GasPriceOracle
}
+func (b *EthApiBackend) ChainConfig() *params.ChainConfig {
+ return b.eth.chainConfig
+}
+
+func (b *EthApiBackend) CurrentBlock() *types.Block {
+ return b.eth.blockchain.CurrentBlock()
+}
+
func (b *EthApiBackend) SetHead(number uint64) {
b.eth.blockchain.SetHead(number)
}
@@ -99,11 +108,10 @@ func (b *EthApiBackend) GetTd(blockHash common.Hash) *big.Int {
func (b *EthApiBackend) GetVMEnv(ctx context.Context, msg core.Message, state ethapi.State, header *types.Header) (vm.Environment, func() error, error) {
statedb := state.(EthApiState).state
- addr, _ := msg.From()
- from := statedb.GetOrNewStateObject(addr)
+ from := statedb.GetOrNewStateObject(msg.From())
from.SetBalance(common.MaxBig)
vmError := func() error { return nil }
- return core.NewEnv(statedb, b.eth.chainConfig, b.eth.blockchain, msg, header, b.eth.chainConfig.VmConfig), vmError, nil
+ return core.NewEnv(statedb, b.eth.chainConfig, b.eth.blockchain, msg, header, vm.Config{}), vmError, nil
}
func (b *EthApiBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error {