Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny2022da committed Mar 28, 2024
1 parent 743518c commit f315695
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions core/vm/runtime/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,17 +856,17 @@ func TestRuntimeJSTracer(t *testing.T) {
func TestRuntimeJSTracerWithOpcodeOptimizer(t *testing.T) {
jsTracers := []string{
`{enters: 0, exits: 0, enterGas: 0, gasUsed: 0, steps:0,
step: function() { this.steps},
step: function() { this.steps++},
fault: function() {},
result: function() {
return [this.enters, this.exits,this.enterGas,this.gasUsed, this.steps].join(",")
},
enter: function(frame) {
this.enters;
this.enters++;
this.enterGas = frame.getGas();
},
exit: function(res) {
this.exits;
this.exits++;
this.gasUsed = res.getGasUsed();
}}`,
`{enters: 0, exits: 0, enterGas: 0, gasUsed: 0, steps:0,
Expand All @@ -875,11 +875,11 @@ func TestRuntimeJSTracerWithOpcodeOptimizer(t *testing.T) {
return [this.enters, this.exits,this.enterGas,this.gasUsed, this.steps].join(",")
},
enter: function(frame) {
this.enters;
this.enters++;
this.enterGas = frame.getGas();
},
exit: function(res) {
this.exits;
this.exits++;
this.gasUsed = res.getGasUsed();
}}`}
tests := []struct {
Expand Down
2 changes: 1 addition & 1 deletion eth/tracers/js/tracer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func TestTracerWithOptimization(t *testing.T) {
}, {
code: "{res: [], step: function(log) { if (log.op.toString() === 'STOP') { this.res.push(log.memory.slice(5, 1025 * 1024)) } }, fault: function() {}, result: function() { return this.res }}",
want: "",
fail: "tracer reached limit for padding memory slice: end 1049600, memorySize 32 at step (<eval>:1:83(20)) in server-side tracer function 'step'",
fail: "reached limit for padding memory slice: 1049568 at step (<eval>:1:83(20)) in server-side tracer function 'step'",
contract: []byte{byte(vm.PUSH1), byte(0xff), byte(vm.PUSH1), byte(0x00), byte(vm.MSTORE8), byte(vm.STOP)},
},
} {
Expand Down
3 changes: 2 additions & 1 deletion tests/block_test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ func (t *BlockTest) Run(snapshotter bool, scheme string, tracer vm.EVMLogger) er
cache.SnapshotWait = true
}
chain, err := core.NewBlockChain(db, cache, gspec, nil, engine, vm.Config{
Tracer: tracer,
Tracer: tracer,
EnableOpcodeOptimizations: false,
}, nil, nil)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion tests/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func runBenchmark(b *testing.B, t *StateTest) {
key := fmt.Sprintf("%s/%d", subtest.Fork, subtest.Index)

b.Run(key, func(b *testing.B) {
vmconfig := vm.Config{}
vmconfig := vm.Config{EnableOpcodeOptimizations: false}

config, eips, err := GetChainConfig(subtest.Fork)
if err != nil {
Expand Down

0 comments on commit f315695

Please sign in to comment.