Skip to content

Commit

Permalink
w3vm: fixed BenchmarkVM
Browse files Browse the repository at this point in the history
  • Loading branch information
lmittmann committed Aug 28, 2024
1 parent 0afaee3 commit e677200
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions w3vm/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ func BenchmarkVM(b *testing.B) {
// fetch blocks
blocks := make([]*types.Block, nBlocks)
calls := make([]w3types.RPCCaller, nBlocks)
for i, block := range blocks {
calls[i] = eth.BlockByNumber(big.NewInt(int64(i))).Returns(&block)
for i := range blocks {
number := big.NewInt(startBlock + int64(i))
calls[i] = eth.BlockByNumber(number).Returns(&blocks[i])
}

if err := client.Call(calls...); err != nil {
Expand Down

0 comments on commit e677200

Please sign in to comment.