@@ -2,7 +2,6 @@ package vm
22
33import (
44 "bytes"
5- "fmt"
65 "math/big"
76 "strconv"
87 "testing"
@@ -82,9 +81,6 @@ func RunVmTest(p string, t *testing.T) {
8281 helper .CreateFileTests (t , p , & tests )
8382
8483 for name , test := range tests {
85- if name != "log2_nonEmptyMem" {
86- continue
87- }
8884 db , _ := ethdb .NewMemDatabase ()
8985 statedb := state .New (common.Hash {}, db )
9086 for addr , account := range test .Pre {
@@ -172,12 +168,26 @@ func RunVmTest(p string, t *testing.T) {
172168 if len (test .Logs ) != len (logs ) {
173169 t .Errorf ("log length mismatch. Expected %d, got %d" , len (test .Logs ), len (logs ))
174170 } else {
175- fmt .Println ("A" , test .Logs )
176- fmt .Println ("B" , logs )
177171 for i , log := range test .Logs {
172+ if common .HexToAddress (log .AddressF ) != logs [i ].Address () {
173+ t .Errorf ("'%s' log address expected %v got %x" , name , log .AddressF , logs [i ].Address ())
174+ }
175+
176+ if ! bytes .Equal (logs [i ].Data (), helper .FromHex (log .DataF )) {
177+ t .Errorf ("'%s' log data expected %v got %x" , name , log .DataF , logs [i ].Data ())
178+ }
179+
180+ if len (log .TopicsF ) != len (logs [i ].Topics ()) {
181+ t .Errorf ("'%s' log topics length expected %d got %d" , name , len (log .TopicsF ), logs [i ].Topics ())
182+ } else {
183+ for j , topic := range log .TopicsF {
184+ if common .HexToHash (topic ) != logs [i ].Topics ()[j ] {
185+ t .Errorf ("'%s' log topic[%d] expected %v got %x" , name , j , topic , logs [i ].Topics ()[j ])
186+ }
187+ }
188+ }
178189 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 )
190+
181191 if ! bytes .Equal (genBloom , common .Hex2Bytes (log .BloomF )) {
182192 t .Errorf ("'%s' bloom mismatch" , name )
183193 }
0 commit comments