@@ -286,7 +286,9 @@ mod math_functions {
286
286
(
287
287
Value :: Number ( Number :: from_f64( 100.0 ) . expect( "should create float number" ) ) ,
288
288
Value :: Number ( Number :: from_f64( 3.0 ) . expect( "should create float number" ) ) ,
289
- Value :: Number ( Number :: from_f64( 33.333333333333336 ) . expect( "should create float number" ) ) ,
289
+ Value :: Number (
290
+ Number :: from_f64( 33.333333333333336 ) . expect( "should create float number" ) ,
291
+ ) ,
290
292
) ,
291
293
(
292
294
Value :: new_number( 10 ) ,
@@ -926,8 +928,16 @@ mod control_flow_and_logic {
926
928
let cases = [
927
929
( Value :: BigNum ( 1 . into ( ) ) , Value :: BigNum ( 1 . into ( ) ) , true ) ,
928
930
( Value :: BigNum ( 1 . into ( ) ) , Value :: BigNum ( 2 . into ( ) ) , false ) ,
929
- ( Value :: Number ( Number :: from_f64 ( 3.33 ) . expect ( "should create float" ) ) , Value :: Number ( Number :: from_f64 ( 3.33 ) . expect ( "should create float" ) ) , true ) ,
930
- ( Value :: Number ( Number :: from_f64 ( 3.33 ) . expect ( "should create float" ) ) , Value :: Number ( Number :: from_f64 ( 3.3 ) . expect ( "should create float" ) ) , false ) ,
931
+ (
932
+ Value :: Number ( Number :: from_f64 ( 3.33 ) . expect ( "should create float" ) ) ,
933
+ Value :: Number ( Number :: from_f64 ( 3.33 ) . expect ( "should create float" ) ) ,
934
+ true ,
935
+ ) ,
936
+ (
937
+ Value :: Number ( Number :: from_f64 ( 3.33 ) . expect ( "should create float" ) ) ,
938
+ Value :: Number ( Number :: from_f64 ( 3.3 ) . expect ( "should create float" ) ) ,
939
+ false ,
940
+ ) ,
931
941
( Value :: Bool ( true ) , Value :: Bool ( true ) , true ) ,
932
942
( Value :: Bool ( true ) , Value :: Bool ( false ) , false ) ,
933
943
(
@@ -1299,7 +1309,8 @@ mod string_and_array {
1299
1309
#[ test]
1300
1310
fn test_get_dai_price_in_usd_eval ( ) {
1301
1311
let mut input = get_default_input ( ) ;
1302
- input. global . channel . deposit_asset = "0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359" . to_string ( ) ;
1312
+ input. global . channel . deposit_asset =
1313
+ "0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359" . to_string ( ) ;
1303
1314
let mut output = Output {
1304
1315
show : true ,
1305
1316
boost : 1.0 ,
@@ -1308,16 +1319,17 @@ mod string_and_array {
1308
1319
1309
1320
let amount_dai = BigNum :: from_str ( "100000000000000000000" ) . expect ( "Should create BigNum" ) ; // 100 DAI
1310
1321
let amount_usd = Some ( Value :: BigNum ( BigNum :: from ( 100 ) ) ) ;
1311
- let rule = Rule :: Function ( Function :: new_get_price_in_usd (
1312
- Rule :: Value ( Value :: BigNum ( amount_dai) ) ,
1313
- ) ) ;
1322
+ let rule = Rule :: Function ( Function :: new_get_price_in_usd ( Rule :: Value ( Value :: BigNum (
1323
+ amount_dai,
1324
+ ) ) ) ) ;
1314
1325
assert_eq ! ( Ok ( amount_usd) , rule. eval( & input, & mut output) ) ;
1315
1326
}
1316
1327
1317
1328
#[ test]
1318
1329
fn test_get_tether_price_in_usd_eval ( ) {
1319
1330
let mut input = get_default_input ( ) ;
1320
- input. global . channel . deposit_asset = "0xdac17f958d2ee523a2206206994597c13d831ec7" . to_string ( ) ;
1331
+ input. global . channel . deposit_asset =
1332
+ "0xdac17f958d2ee523a2206206994597c13d831ec7" . to_string ( ) ;
1321
1333
let mut output = Output {
1322
1334
show : true ,
1323
1335
boost : 1.0 ,
@@ -1326,9 +1338,9 @@ mod string_and_array {
1326
1338
1327
1339
let amount_tether = BigNum :: from_str ( "100000000" ) . expect ( "Should create BigNum" ) ; // 100 Tether
1328
1340
let amount_usd = Some ( Value :: BigNum ( BigNum :: from ( 100 ) ) ) ;
1329
- let rule = Rule :: Function ( Function :: new_get_price_in_usd (
1330
- Rule :: Value ( Value :: BigNum ( amount_tether) ) ,
1331
- ) ) ;
1341
+ let rule = Rule :: Function ( Function :: new_get_price_in_usd ( Rule :: Value ( Value :: BigNum (
1342
+ amount_tether,
1343
+ ) ) ) ) ;
1332
1344
assert_eq ! ( Ok ( amount_usd) , rule. eval( & input, & mut output) ) ;
1333
1345
}
1334
1346
}
0 commit comments