File tree 1 file changed +13
-7
lines changed
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -352,13 +352,19 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
352
352
amount => token. amount ( amount. parse :: < f64 > ( ) . unwrap ( ) ) ,
353
353
} ;
354
354
355
- if op == Operation :: Deposit && amount > token_balance {
356
- return Err ( format ! (
357
- "Deposit amount of {} is greater than current balance of {}" ,
358
- token. format_amount( amount) ,
359
- token. format_amount( token_balance) ,
360
- )
361
- . into ( ) ) ;
355
+ if op == Operation :: Deposit {
356
+ if amount > token_balance {
357
+ return Err ( format ! (
358
+ "Deposit amount of {} is greater than current balance of {}" ,
359
+ token. format_amount( amount) ,
360
+ token. format_amount( token_balance) ,
361
+ )
362
+ . into ( ) ) ;
363
+ }
364
+ if amount == 0 {
365
+ println ! ( "Nothing to deposit" ) ;
366
+ return Ok ( ( ) ) ;
367
+ }
362
368
}
363
369
364
370
for pool in & pools {
You can’t perform that action at this time.
0 commit comments