aboutsummaryrefslogtreecommitdiffstats
path: root/eth/api.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.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.go')
-rw-r--r--eth/api.go17
1 files changed, 6 insertions, 11 deletions
diff --git a/eth/api.go b/eth/api.go
index 48f512b1b..b3185c392 100644
--- a/eth/api.go
+++ b/eth/api.go
@@ -37,6 +37,7 @@ import (
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/miner"
+ "github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rpc"
"golang.org/x/net/context"
@@ -303,13 +304,13 @@ func (api *PublicDebugAPI) DumpBlock(number uint64) (state.Dump, error) {
// PrivateDebugAPI is the collection of Etheruem full node APIs exposed over
// the private debugging endpoint.
type PrivateDebugAPI struct {
- config *core.ChainConfig
+ config *params.ChainConfig
eth *Ethereum
}
// NewPrivateDebugAPI creates a new API definition for the full node-related
// private debug methods of the Ethereum service.
-func NewPrivateDebugAPI(config *core.ChainConfig, eth *Ethereum) *PrivateDebugAPI {
+func NewPrivateDebugAPI(config *params.ChainConfig, eth *Ethereum) *PrivateDebugAPI {
return &PrivateDebugAPI{config: config, eth: eth}
}
@@ -505,21 +506,15 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, txHash common.
if err != nil {
return nil, err
}
+
+ signer := types.MakeSigner(api.config, block.Number())
// Mutate the state and trace the selected transaction
for idx, tx := range block.Transactions() {
// Assemble the transaction call message
- from, err := tx.FromFrontier()
+ msg, err := tx.AsMessage(signer)
if err != nil {
return nil, fmt.Errorf("sender retrieval failed: %v", err)
}
- msg := callmsg{
- addr: from,
- to: tx.To(),
- gas: tx.Gas(),
- gasPrice: tx.GasPrice(),
- value: tx.Value(),
- data: tx.Data(),
- }
// Mutate the state if we haven't reached the tracing transaction yet
if uint64(idx) < txIndex {
vmenv := core.NewEnv(stateDb, api.config, api.eth.BlockChain(), msg, block.Header(), vm.Config{})