@@ -18,9 +18,9 @@ package storage_test
18
18
19
19
import (
20
20
"github.com/ethereum/go-ethereum/common"
21
+ "github.com/ethereum/go-ethereum/crypto"
21
22
. "github.com/onsi/ginkgo"
22
23
. "github.com/onsi/gomega"
23
-
24
24
"github.com/vulcanize/vulcanizedb/libraries/shared/factories/storage"
25
25
"github.com/vulcanize/vulcanizedb/libraries/shared/mocks"
26
26
"github.com/vulcanize/vulcanizedb/libraries/shared/storage/utils"
@@ -38,17 +38,17 @@ var _ = Describe("Storage transformer", func() {
38
38
mappings = & mocks.MockMappings {}
39
39
repository = & mocks.MockStorageRepository {}
40
40
t = storage.Transformer {
41
- Address : common.Address {},
42
- Mappings : mappings ,
43
- Repository : repository ,
41
+ HashedAddress : common.Hash {},
42
+ Mappings : mappings ,
43
+ Repository : repository ,
44
44
}
45
45
})
46
46
47
47
It ("returns the contract address being watched" , func () {
48
- fakeAddress := common .HexToAddress ( "0x12345" )
49
- t .Address = fakeAddress
48
+ fakeAddress := common .BytesToHash ( crypto . Keccak256 ( common . FromHex ( "0x12345" )) )
49
+ t .HashedAddress = fakeAddress
50
50
51
- Expect (t .ContractAddress ()).To (Equal (fakeAddress ))
51
+ Expect (t .KeccakContractAddress ()).To (Equal (fakeAddress ))
52
52
})
53
53
54
54
It ("looks up metadata for storage key" , func () {
@@ -73,11 +73,11 @@ var _ = Describe("Storage transformer", func() {
73
73
fakeBlockNumber := 123
74
74
fakeBlockHash := "0x67890"
75
75
fakeRow := utils.StorageDiff {
76
- Contract : common.Address {},
77
- BlockHash : common .HexToHash (fakeBlockHash ),
78
- BlockHeight : fakeBlockNumber ,
79
- StorageKey : common.Hash {},
80
- StorageValue : rawValue .Hash (),
76
+ KeccakOfContractAddress : common.Hash {},
77
+ BlockHash : common .HexToHash (fakeBlockHash ),
78
+ BlockHeight : fakeBlockNumber ,
79
+ StorageKey : common.Hash {},
80
+ StorageValue : rawValue .Hash (),
81
81
}
82
82
83
83
err := t .Execute (fakeRow )
@@ -121,11 +121,11 @@ var _ = Describe("Storage transformer", func() {
121
121
It ("passes the decoded data items to the repository" , func () {
122
122
mappings .Metadata = fakeMetadata
123
123
fakeRow := utils.StorageDiff {
124
- Contract : common.Address {},
125
- BlockHash : common .HexToHash (fakeBlockHash ),
126
- BlockHeight : fakeBlockNumber ,
127
- StorageKey : common.Hash {},
128
- StorageValue : rawValue .Hash (),
124
+ KeccakOfContractAddress : common.Hash {},
125
+ BlockHash : common .HexToHash (fakeBlockHash ),
126
+ BlockHeight : fakeBlockNumber ,
127
+ StorageKey : common.Hash {},
128
+ StorageValue : rawValue .Hash (),
129
129
}
130
130
131
131
err := t .Execute (fakeRow )
0 commit comments