1
1
package stateChanges
2
2
3
3
import (
4
+ "encoding/hex"
4
5
"fmt"
5
6
"math/big"
6
7
"strconv"
@@ -344,10 +345,10 @@ func TestStateChangesCollector_Publish(t *testing.T) {
344
345
require .NoError (t , err )
345
346
346
347
require .Len (t , stateChangesForTx , 1 )
347
- require .Len (t , stateChangesForTx ["hash0" ].StateChanges , 10 )
348
+ require .Len (t , stateChangesForTx [hex . EncodeToString ([] byte ( "hash0" )) ].StateChanges , 10 )
348
349
349
350
require .Equal (t , stateChangesForTx , map [string ]* data.StateChanges {
350
- "hash0" : {
351
+ hex . EncodeToString ([] byte ( "hash0" )) : {
351
352
StateChanges : []* data.StateChange {
352
353
{Type : data .Write , TxHash : []byte ("hash0" )},
353
354
{Type : data .Write , TxHash : []byte ("hash0" )},
@@ -391,10 +392,10 @@ func TestStateChangesCollector_Publish(t *testing.T) {
391
392
require .NoError (t , err )
392
393
393
394
require .Len (t , stateChangesForTx , 1 )
394
- require .Len (t , stateChangesForTx ["hash1" ].StateChanges , 10 )
395
+ require .Len (t , stateChangesForTx [hex . EncodeToString ([] byte ( "hash1" )) ].StateChanges , 10 )
395
396
396
397
require .Equal (t , stateChangesForTx , map [string ]* data.StateChanges {
397
- "hash1" : {
398
+ hex . EncodeToString ([] byte ( "hash1" )) : {
398
399
StateChanges : []* data.StateChange {
399
400
{Type : data .Read , TxHash : []byte ("hash1" )},
400
401
{Type : data .Read , TxHash : []byte ("hash1" )},
@@ -438,11 +439,11 @@ func TestStateChangesCollector_Publish(t *testing.T) {
438
439
require .NoError (t , err )
439
440
440
441
require .Len (t , stateChangesForTx , 2 )
441
- require .Len (t , stateChangesForTx ["hash0" ].StateChanges , 10 )
442
- require .Len (t , stateChangesForTx ["hash1" ].StateChanges , 10 )
442
+ require .Len (t , stateChangesForTx [hex . EncodeToString ([] byte ( "hash0" )) ].StateChanges , 10 )
443
+ require .Len (t , stateChangesForTx [hex . EncodeToString ([] byte ( "hash1" )) ].StateChanges , 10 )
443
444
444
445
require .Equal (t , stateChangesForTx , map [string ]* data.StateChanges {
445
- "hash0" : {
446
+ hex . EncodeToString ([] byte ( "hash0" )) : {
446
447
StateChanges : []* data.StateChange {
447
448
{Type : data .Write , TxHash : []byte ("hash0" )},
448
449
{Type : data .Write , TxHash : []byte ("hash0" )},
@@ -456,7 +457,7 @@ func TestStateChangesCollector_Publish(t *testing.T) {
456
457
{Type : data .Write , TxHash : []byte ("hash0" )},
457
458
},
458
459
},
459
- "hash1" : {
460
+ hex . EncodeToString ([] byte ( "hash1" )) : {
460
461
StateChanges : []* data.StateChange {
461
462
{Type : data .Read , TxHash : []byte ("hash1" )},
462
463
{Type : data .Read , TxHash : []byte ("hash1" )},
0 commit comments