@@ -102,7 +102,7 @@ func (s *AcrossMessageHandlerTestSuite) SetupTest() {
102102 )
103103}
104104
105- func (s * AcrossMessageHandlerTestSuite ) Test_HandleMessage_FailedLogQuery () {
105+ func (s * AcrossMessageHandlerTestSuite ) Test_HandleMessage_FailedTransactionQuery () {
106106 s .mockCommunication .EXPECT ().Broadcast (
107107 gomock .Any (),
108108 gomock .Any (),
@@ -111,8 +111,7 @@ func (s *AcrossMessageHandlerTestSuite) Test_HandleMessage_FailedLogQuery() {
111111 ).Return (nil )
112112 p , _ := pstoremem .NewPeerstore ()
113113 s .mockHost .EXPECT ().Peerstore ().Return (p )
114- s .mockEventFilterer .EXPECT ().LatestBlock ().Return (big .NewInt (100 ), nil )
115- s .mockEventFilterer .EXPECT ().FilterLogs (gomock .Any (), gomock .Any ()).Return ([]types.Log {}, fmt .Errorf ("error" ))
114+ s .mockEventFilterer .EXPECT ().TransactionReceipt (gomock .Any (), gomock .Any ()).Return (nil , fmt .Errorf ("error" ))
116115
117116 errChn := make (chan error , 1 )
118117 ad := & message.AcrossData {
@@ -146,8 +145,9 @@ func (s *AcrossMessageHandlerTestSuite) Test_HandleMessage_LogMissing() {
146145 ).Return (nil )
147146 p , _ := pstoremem .NewPeerstore ()
148147 s .mockHost .EXPECT ().Peerstore ().Return (p )
149- s .mockEventFilterer .EXPECT ().FilterLogs (gomock .Any (), gomock .Any ()).Return ([]types.Log {}, nil )
150- s .mockEventFilterer .EXPECT ().LatestBlock ().Return (big .NewInt (100 ), nil )
148+ s .mockEventFilterer .EXPECT ().TransactionReceipt (gomock .Any (), gomock .Any ()).Return (& types.Receipt {
149+ Logs : []* types.Log {},
150+ }, nil )
151151
152152 errChn := make (chan error , 1 )
153153 ad := & message.AcrossData {
@@ -181,11 +181,12 @@ func (s *AcrossMessageHandlerTestSuite) Test_HandleMessage_IgnoreRemovedLogs() {
181181 ).Return (nil )
182182 p , _ := pstoremem .NewPeerstore ()
183183 s .mockHost .EXPECT ().Peerstore ().Return (p )
184- s .mockEventFilterer .EXPECT ().LatestBlock ().Return (big .NewInt (100 ), nil )
185- s .mockEventFilterer .EXPECT ().FilterLogs (gomock .Any (), gomock .Any ()).Return ([]types.Log {
186- {
187- Removed : true ,
188- Data : s .validLog ,
184+ s .mockEventFilterer .EXPECT ().TransactionReceipt (gomock .Any (), gomock .Any ()).Return (& types.Receipt {
185+ Logs : []* types.Log {
186+ {
187+ Removed : true ,
188+ Data : s .validLog ,
189+ },
189190 },
190191 }, nil )
191192
@@ -222,26 +223,28 @@ func (s *AcrossMessageHandlerTestSuite) Test_HandleMessage_ValidLog() {
222223 p , _ := pstoremem .NewPeerstore ()
223224 s .mockHost .EXPECT ().Peerstore ().Return (p )
224225
225- s .mockEventFilterer .EXPECT ().LatestBlock ().Return (big .NewInt (200 ), nil ).AnyTimes ()
226- s .mockEventFilterer .EXPECT ().FilterLogs (gomock .Any (), gomock .Any ()).Return ([]types.Log {
227- {
228- Removed : false ,
229- Data : s .validLog ,
230- Topics : []common.Hash {
231- {},
232- {},
233- {},
234- {},
226+ s .mockEventFilterer .EXPECT ().TransactionReceipt (gomock .Any (), gomock .Any ()).Return (& types.Receipt {
227+ Logs : []* types.Log {
228+ {
229+ Removed : false ,
230+ Data : s .validLog ,
231+ Topics : []common.Hash {
232+ common .HexToHash ("0x32ed1a409ef04c7b0227189c3a103dc5ac10e775a15b785dcc510201f7c25ad3" ),
233+ {},
234+ common .HexToHash ("0x0000000000000000000000000000000000000000000000000000000000279995" ),
235+ {},
236+ },
235237 },
236238 },
237239 }, nil )
240+
238241 s .mockWatcher .EXPECT ().WaitForConfirmations (gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any ()).Return (nil )
239242 s .mockCoordinator .EXPECT ().Execute (gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any ()).Return (nil )
240243
241244 errChn := make (chan error , 1 )
242245 ad := & message.AcrossData {
243246 ErrChn : errChn ,
244- DepositId : big .NewInt (100 ),
247+ DepositId : big .NewInt (2595221 ),
245248 Nonce : big .NewInt (101 ),
246249 LiquidityPool : common .HexToAddress ("0xbe526bA5d1ad94cC59D7A79d99A59F607d31A657" ),
247250 Caller : common .HexToAddress ("0x5ECF7351930e4A251193aA022Ef06249C6cBfa27" ),
@@ -272,16 +275,17 @@ func (s *AcrossMessageHandlerTestSuite) Test_HandleMessage_ZeroOutputToken() {
272275 s .mockHost .EXPECT ().Peerstore ().Return (p )
273276
274277 log , _ := hex .DecodeString ("0000000000000000000000003355df6d4c9c3035724fd0e3914de96a5a83aaf40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d7cbe22000000000000000000000000000000000000000000000000000000006d789ac90000000000000000000000000000000000000000000000000000000067ce09230000000000000000000000000000000000000000000000000000000067ce5ea7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000051d55999c7cd91b17af7276cbecd647dbc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000" )
275- s .mockEventFilterer .EXPECT ().LatestBlock ().Return (big .NewInt (400 ), nil ).AnyTimes ()
276- s .mockEventFilterer .EXPECT ().FilterLogs (gomock .Any (), gomock .Any ()).Return ([]types.Log {
277- {
278- Removed : false ,
279- Data : log ,
280- Topics : []common.Hash {
281- {},
282- {},
283- {},
284- {},
278+ s .mockEventFilterer .EXPECT ().TransactionReceipt (gomock .Any (), gomock .Any ()).Return (& types.Receipt {
279+ Logs : []* types.Log {
280+ {
281+ Removed : false ,
282+ Data : log ,
283+ Topics : []common.Hash {
284+ common .HexToHash ("0x32ed1a409ef04c7b0227189c3a103dc5ac10e775a15b785dcc510201f7c25ad3" ),
285+ {},
286+ common .HexToHash ("0x0000000000000000000000000000000000000000000000000000000000279995" ),
287+ {},
288+ },
285289 },
286290 },
287291 }, nil )
@@ -292,7 +296,7 @@ func (s *AcrossMessageHandlerTestSuite) Test_HandleMessage_ZeroOutputToken() {
292296 errChn := make (chan error , 1 )
293297 ad := & message.AcrossData {
294298 ErrChn : errChn ,
295- DepositId : big .NewInt (100 ),
299+ DepositId : big .NewInt (2595221 ),
296300 Nonce : big .NewInt (101 ),
297301 LiquidityPool : common .HexToAddress ("0xbe526bA5d1ad94cC59D7A79d99A59F607d31A657" ),
298302 Caller : common .HexToAddress ("0x5ECF7351930e4A251193aA022Ef06249C6cBfa27" ),
0 commit comments