@@ -18,7 +18,6 @@ package watcher_test
18
18
19
19
import (
20
20
"github.com/ethereum/go-ethereum/common"
21
- "github.com/ethereum/go-ethereum/crypto"
22
21
. "github.com/onsi/ginkgo"
23
22
. "github.com/onsi/gomega"
24
23
"github.com/sirupsen/logrus"
@@ -36,7 +35,7 @@ import (
36
35
var _ = Describe ("Storage Watcher" , func () {
37
36
Describe ("AddTransformer" , func () {
38
37
It ("adds transformers" , func () {
39
- fakeHashedAddress := common . BytesToHash ( crypto . Keccak256 ( common . FromHex ( "0x12345" )) )
38
+ fakeHashedAddress := utils . HexToKeccak256Hash ( "0x12345" )
40
39
fakeTransformer := & mocks.MockStorageTransformer {KeccakOfAddress : fakeHashedAddress }
41
40
w := watcher .NewStorageWatcher (mocks .NewMockStorageFetcher (), test_config .NewTestDB (test_config .NewTestNode ()))
42
41
@@ -61,7 +60,7 @@ var _ = Describe("Storage Watcher", func() {
61
60
BeforeEach (func () {
62
61
errs = make (chan error )
63
62
diffs = make (chan utils.StorageDiff )
64
- hashedAddress = common . BytesToHash ( crypto . Keccak256 ( common . FromHex ( "0x0123456789abcdef" )) )
63
+ hashedAddress = utils . HexToKeccak256Hash ( "0x0123456789abcdef" )
65
64
mockFetcher = mocks .NewMockStorageFetcher ()
66
65
mockQueue = & mocks.MockStorageQueue {}
67
66
mockTransformer = & mocks.MockStorageTransformer {KeccakOfAddress : hashedAddress }
@@ -192,7 +191,7 @@ var _ = Describe("Storage Watcher", func() {
192
191
It ("deletes obsolete diff from queue if contract not recognized" , func (done Done ) {
193
192
obsoleteDiff := utils.StorageDiff {
194
193
Id : csvDiff .Id + 1 ,
195
- KeccakOfContractAddress : common . BytesToHash ( crypto . Keccak256 ( common . FromHex ( "0xfedcba9876543210" )) ),
194
+ KeccakOfContractAddress : utils . HexToKeccak256Hash ( "0xfedcba9876543210" ),
196
195
}
197
196
mockQueue .DiffsToReturn = []utils.StorageDiff {obsoleteDiff }
198
197
@@ -207,7 +206,7 @@ var _ = Describe("Storage Watcher", func() {
207
206
It ("logs error if deleting obsolete diff fails" , func (done Done ) {
208
207
obsoleteDiff := utils.StorageDiff {
209
208
Id : csvDiff .Id + 1 ,
210
- KeccakOfContractAddress : common . BytesToHash ( crypto . Keccak256 ( common . FromHex ( "0xfedcba9876543210" )) ),
209
+ KeccakOfContractAddress : utils . HexToKeccak256Hash ( "0xfedcba9876543210" ),
211
210
}
212
211
mockQueue .DiffsToReturn = []utils.StorageDiff {obsoleteDiff }
213
212
mockQueue .DeleteErr = fakes .FakeError
0 commit comments