File tree 2 files changed +14
-5
lines changed
2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,18 @@ async fn main() -> Result<()> {
33
33
CustomRetryPolicy ,
34
34
) ;
35
35
let client = RpcClient :: builder ( ) . layer ( retry_layer) . http ( args. rpc_url . clone ( ) ) ;
36
-
37
36
let balance_alerts_layer = BalanceAlertLayer :: new ( BalanceAlertConfig {
38
37
watch_address : wallet. default_signer ( ) . address ( ) ,
39
- warn_threshold : config. market . balance_warn_threshold . and_then ( |s| parse_ether ( & s) . ok ( ) ) ,
40
- error_threshold : config. market . balance_error_threshold . and_then ( |s| parse_ether ( & s) . ok ( ) ) ,
38
+ warn_threshold : config
39
+ . market
40
+ . balance_warn_threshold
41
+ . map ( |s| parse_ether ( & s) )
42
+ . transpose ( ) ?,
43
+ error_threshold : config
44
+ . market
45
+ . balance_error_threshold
46
+ . map ( |s| parse_ether ( & s) )
47
+ . transpose ( ) ?,
41
48
} ) ;
42
49
43
50
let provider = ProviderBuilder :: new ( )
Original file line number Diff line number Diff line change @@ -78,12 +78,14 @@ where
78
78
. market
79
79
. stake_balance_warn_threshold
80
80
. as_ref ( )
81
- . and_then ( |s| parse_ether ( s) . ok ( ) ) ,
81
+ . map ( |s| parse_ether ( s) )
82
+ . transpose ( ) ?,
82
83
& config
83
84
. market
84
85
. stake_balance_error_threshold
85
86
. as_ref ( )
86
- . and_then ( |s| parse_ether ( s) . ok ( ) ) ,
87
+ . map ( |s| parse_ether ( s) )
88
+ . transpose ( ) ?,
87
89
) ;
88
90
}
89
91
You can’t perform that action at this time.
0 commit comments