@ -122,12 +122,7 @@ func testCallTracer(tracerName string, dirPath string, t *testing.T) {
}
// Configure a blockchain with the given prestate
var (
signer = types . MakeSigner ( test . Genesis . Config , new ( big . Int ) . SetUint64 ( uint64 ( test . Context . Number ) ) , uint64 ( test . Context . Time ) )
origin , _ = signer . Sender ( tx )
txContext = vm . TxContext {
Origin : origin ,
GasPrice : tx . GasPrice ( ) ,
}
signer = types . MakeSigner ( test . Genesis . Config , new ( big . Int ) . SetUint64 ( uint64 ( test . Context . Number ) ) , uint64 ( test . Context . Time ) )
context = vm . BlockContext {
CanTransfer : core . CanTransfer ,
Transfer : core . Transfer ,
@ -146,11 +141,11 @@ func testCallTracer(tracerName string, dirPath string, t *testing.T) {
if err != nil {
t . Fatalf ( "failed to create call tracer: %v" , err )
}
evm := vm . NewEVM ( context , txContext , statedb , test . Genesis . Config , vm . Config { Tracer : tracer } )
msg , err := core . TransactionToMessage ( tx , signer , nil )
msg , err := core . TransactionToMessage ( tx , signer , context . BaseFee )
if err != nil {
t . Fatalf ( "failed to prepare transaction for tracing: %v" , err )
}
evm := vm . NewEVM ( context , core . NewEVMTxContext ( msg ) , statedb , test . Genesis . Config , vm . Config { Tracer : tracer } )
vmRet , err := core . ApplyMessage ( evm , msg , new ( core . GasPool ) . AddGas ( tx . Gas ( ) ) )
if err != nil {
t . Fatalf ( "failed to execute transaction: %v" , err )
@ -222,10 +217,6 @@ func benchTracer(tracerName string, test *callTracerTest, b *testing.B) {
b . Fatalf ( "failed to parse testcase input: %v" , err )
}
signer := types . MakeSigner ( test . Genesis . Config , new ( big . Int ) . SetUint64 ( uint64 ( test . Context . Number ) ) , uint64 ( test . Context . Time ) )
msg , err := core . TransactionToMessage ( tx , signer , nil )
if err != nil {
b . Fatalf ( "failed to prepare transaction for tracing: %v" , err )
}
origin , _ := signer . Sender ( tx )
txContext := vm . TxContext {
Origin : origin ,
@ -240,6 +231,10 @@ func benchTracer(tracerName string, test *callTracerTest, b *testing.B) {
Difficulty : ( * big . Int ) ( test . Context . Difficulty ) ,
GasLimit : uint64 ( test . Context . GasLimit ) ,
}
msg , err := core . TransactionToMessage ( tx , signer , context . BaseFee )
if err != nil {
b . Fatalf ( "failed to prepare transaction for tracing: %v" , err )
}
triedb , _ , statedb := tests . MakePreState ( rawdb . NewMemoryDatabase ( ) , test . Genesis . Alloc , false , rawdb . HashScheme )
defer triedb . Close ( )