@@ -56,24 +56,24 @@ var _ = Describe("Geth Storage Watcher", func() {
56
56
diffs chan utils.StorageDiff
57
57
storageWatcher watcher.GethStorageWatcher
58
58
address common.Address
59
- keccakOfAddress common.Address
59
+ keccakOfAddress common.Hash
60
60
)
61
61
62
62
BeforeEach (func () {
63
63
errs = make (chan error )
64
64
diffs = make (chan utils.StorageDiff )
65
65
address = common .HexToAddress ("0x0123456789abcdef" )
66
- keccakOfAddress = common .BytesToAddress (crypto .Keccak256 (address [:]))
66
+ keccakOfAddress = common .BytesToHash (crypto .Keccak256 (address [:]))
67
67
mockFetcher = mocks .NewMockStorageFetcher ()
68
68
mockQueue = & mocks.MockStorageQueue {}
69
69
mockTransformer = & mocks.MockStorageTransformer {Address : address }
70
70
gethDiff = utils.StorageDiff {
71
- Id : 1338 ,
72
- Contract : keccakOfAddress ,
73
- BlockHash : common .HexToHash ("0xfedcba9876543210" ),
74
- BlockHeight : 0 ,
75
- StorageKey : common .HexToHash ("0xabcdef1234567890" ),
76
- StorageValue : common .HexToHash ("0x9876543210abcdef" ),
71
+ Id : 1338 ,
72
+ KeccakOfContractAddress : keccakOfAddress ,
73
+ BlockHash : common .HexToHash ("0xfedcba9876543210" ),
74
+ BlockHeight : 0 ,
75
+ StorageKey : common .HexToHash ("0xabcdef1234567890" ),
76
+ StorageValue : common .HexToHash ("0x9876543210abcdef" ),
77
77
}
78
78
})
79
79
@@ -151,10 +151,10 @@ var _ = Describe("Geth Storage Watcher", func() {
151
151
It ("keeps track transformers by the keccak256 hash of their contract address " , func (done Done ) {
152
152
go storageWatcher .Execute (diffs , errs , time .Hour )
153
153
154
- m := make (map [common.Address ]transformer.StorageTransformer )
154
+ m := make (map [common.Hash ]transformer.StorageTransformer )
155
155
m [keccakOfAddress ] = mockTransformer
156
156
157
- Eventually (func () map [common.Address ]transformer.StorageTransformer {
157
+ Eventually (func () map [common.Hash ]transformer.StorageTransformer {
158
158
return storageWatcher .KeccakAddressTransformers
159
159
}).Should (Equal (m ))
160
160
@@ -164,15 +164,15 @@ var _ = Describe("Geth Storage Watcher", func() {
164
164
It ("gets the transformer from the known keccak address map first" , func (done Done ) {
165
165
anotherAddress := common .HexToAddress ("0xafakeaddress" )
166
166
anotherTransformer := & mocks.MockStorageTransformer {Address : anotherAddress }
167
- keccakOfAnotherAddress := common .BytesToAddress (crypto .Keccak256 (anotherAddress [:]))
167
+ keccakOfAnotherAddress := common .BytesToHash (crypto .Keccak256 (anotherAddress [:]))
168
168
169
169
anotherGethDiff := utils.StorageDiff {
170
- Id : 1338 ,
171
- Contract : keccakOfAnotherAddress ,
172
- BlockHash : common .HexToHash ("0xfedcba9876543210" ),
173
- BlockHeight : 0 ,
174
- StorageKey : common .HexToHash ("0xabcdef1234567890" ),
175
- StorageValue : common .HexToHash ("0x9876543210abcdef" ),
170
+ Id : 1338 ,
171
+ KeccakOfContractAddress : keccakOfAnotherAddress ,
172
+ BlockHash : common .HexToHash ("0xfedcba9876543210" ),
173
+ BlockHeight : 0 ,
174
+ StorageKey : common .HexToHash ("0xabcdef1234567890" ),
175
+ StorageValue : common .HexToHash ("0x9876543210abcdef" ),
176
176
}
177
177
mockFetcher .DiffsToReturn = []utils.StorageDiff {anotherGethDiff }
178
178
storageWatcher .KeccakAddressTransformers [keccakOfAnotherAddress ] = anotherTransformer
0 commit comments