@@ -2,11 +2,13 @@ package vm
22
33import (
44 "bytes"
5+ "fmt"
56 "math/big"
67 "strconv"
78 "testing"
89
910 "github.com/ethereum/go-ethereum/common"
11+ "github.com/ethereum/go-ethereum/core/types"
1012 "github.com/ethereum/go-ethereum/ethdb"
1113 "github.com/ethereum/go-ethereum/logger"
1214 "github.com/ethereum/go-ethereum/state"
@@ -80,6 +82,9 @@ func RunVmTest(p string, t *testing.T) {
8082 helper .CreateFileTests (t , p , & tests )
8183
8284 for name , test := range tests {
85+ if name != "log2_nonEmptyMem" {
86+ continue
87+ }
8388 db , _ := ethdb .NewMemDatabase ()
8489 statedb := state .New (common.Hash {}, db )
8590 for addr , account := range test .Pre {
@@ -167,16 +172,16 @@ func RunVmTest(p string, t *testing.T) {
167172 if len (test .Logs ) != len (logs ) {
168173 t .Errorf ("log length mismatch. Expected %d, got %d" , len (test .Logs ), len (logs ))
169174 } else {
170- /*
171- fmt.Println("A ", test.Logs )
172- fmt.Println("B", logs)
173- for i, log := range test. Logs {
174- genBloom := common.LeftPadBytes(types.LogsBloom(state.Logs{logs[i]}).Bytes(), 256 )
175- if !bytes.Equal(genBloom, common.Hex2Bytes(log.BloomF)) {
176- t.Errorf("bloom mismatch")
177- }
178- }
179- */
175+ fmt . Println ( "A" , test . Logs )
176+ fmt .Println ("B " , logs )
177+ for i , log := range test . Logs {
178+ genBloom := common . LeftPadBytes ( types . LogsBloom (state. Logs { logs [ i ]}). Bytes (), 256 )
179+ fmt . Println ( "A BLOOM" , log . BloomF )
180+ fmt . Printf ( "B BLOOM %x \n " , genBloom )
181+ if ! bytes . Equal ( genBloom , common . Hex2Bytes ( log . BloomF )) {
182+ t . Errorf ( "'%s' bloom mismatch" , name )
183+ }
184+ }
180185 }
181186 }
182187 //statedb.Trie().PrintRoot()
0 commit comments