@@ -240,9 +240,10 @@ where
240
240
tokio:: run (
241
241
Interval :: new ( Instant :: now ( ) , interval)
242
242
. for_each ( move |instant| {
243
- debug ! (
243
+ trace ! (
244
244
"[{:?}] Getting settlement data from the blockchain; instant={:?}" ,
245
- address, instant
245
+ address,
246
+ instant
246
247
) ;
247
248
tokio:: spawn ( _self. handle_received_transactions ( ) ) ;
248
249
Ok ( ( ) )
@@ -290,21 +291,22 @@ where
290
291
. block_number ( )
291
292
. map_err ( move |err| error ! ( "Could not fetch current block number {:?}" , err) )
292
293
. and_then ( move |current_block| {
293
- debug ! ( "Current block {}" , current_block) ;
294
+ trace ! ( "Current block {}" , current_block) ;
294
295
// get the safe number of blocks to avoid reorgs
295
296
let fetch_until = current_block - confirmations;
296
297
// U256 does not implement IntoFuture so we must wrap it
297
298
Ok ( ( Ok ( fetch_until) , store. load_recently_observed_block ( ) ) )
298
299
} )
299
300
. flatten ( )
300
301
. and_then ( move |( fetch_until, last_observed_block) | {
301
- debug ! (
302
+ trace ! (
302
303
"Will fetch txs from block {} until {}" ,
303
- last_observed_block, fetch_until
304
+ last_observed_block,
305
+ fetch_until
304
306
) ;
305
307
306
308
let notify_all_txs_fut = if let Some ( token_address) = token_address {
307
- debug ! ( "Settling for ERC20 transactions" ) ;
309
+ trace ! ( "Settling for ERC20 transactions" ) ;
308
310
// get all erc20 transactions
309
311
let notify_all_erc20_txs_fut = filter_transfer_logs (
310
312
web3. clone ( ) ,
@@ -325,7 +327,7 @@ where
325
327
// combine all erc20 futures for that range of blocks
326
328
Either :: A ( notify_all_erc20_txs_fut)
327
329
} else {
328
- debug ! ( "Settling for ETH transactions" ) ;
330
+ trace ! ( "Settling for ETH transactions" ) ;
329
331
let checked_blocks = last_observed_block. low_u64 ( ) ..=fetch_until. low_u64 ( ) ;
330
332
// for each block create a future which will notify the
331
333
// connector about all the transactions in that block that are sent to our account
@@ -337,7 +339,7 @@ where
337
339
} ;
338
340
339
341
notify_all_txs_fut. and_then ( move |ret| {
340
- debug ! ( "Transactions settled {:?}" , ret) ;
342
+ trace ! ( "Transactions settled {:?}" , ret) ;
341
343
// now that all transactions have been processed successfully, we
342
344
// can save `fetch_until` as the latest observed block
343
345
store_clone. save_recently_observed_block ( fetch_until)
@@ -384,7 +386,7 @@ where
384
386
}
385
387
386
388
fn notify_eth_txs_in_block ( & self , block_number : u64 ) -> impl Future < Item = ( ) , Error = ( ) > {
387
- debug ! ( "Getting txs for block {}" , block_number) ;
389
+ trace ! ( "Getting txs for block {}" , block_number) ;
388
390
let self_clone = self . clone ( ) ;
389
391
// Get the block at `block_number`
390
392
self . web3
@@ -412,7 +414,7 @@ where
412
414
join_all ( submit_txs_to_connector_future)
413
415
} )
414
416
. and_then ( move |_res| {
415
- debug ! (
417
+ trace ! (
416
418
"Successfully logged transactions in block: {:?}" ,
417
419
block_number
418
420
) ;
@@ -678,7 +680,7 @@ where
678
680
let data = prefixed_mesage ( challenge_clone) ;
679
681
let challenge_hash = Sha3 :: digest ( & data) ;
680
682
let recovered_address = payment_details. sig . recover ( & challenge_hash) ;
681
- debug ! ( "Received payment details {:?}" , payment_details) ;
683
+ trace ! ( "Received payment details {:?}" , payment_details) ;
682
684
result ( recovered_address)
683
685
. map_err ( move |err| {
684
686
let err = format ! ( "Could not recover address {:?}" , err) ;
@@ -695,7 +697,8 @@ where
695
697
} else {
696
698
let error_msg = format ! (
697
699
"Recovered address did not match: {:?}. Expected {:?}" ,
698
- recovered_address, payment_details. to
700
+ recovered_address. to_string( ) ,
701
+ payment_details. to
699
702
) ;
700
703
error ! ( "{}" , error_msg) ;
701
704
err ( ( StatusCode :: from_u16 ( 502 ) . unwrap ( ) , error_msg) )
0 commit comments