@@ -25,8 +25,8 @@ pub fn basic_stake_if_test() {
2525 } ;
2626 let amount = QUOTE_PRECISION as u64 ; // $1
2727 let mut spot_market = SpotMarket {
28- deposit_balance : 0 ,
29- cumulative_deposit_interest : 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ,
28+ deposit_balance : 0 . into ( ) ,
29+ cumulative_deposit_interest : ( 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ) . into ( ) ,
3030 insurance_fund : InsuranceFund {
3131 unstaking_period : 0 ,
3232 ..InsuranceFund :: default ( )
@@ -124,8 +124,8 @@ pub fn basic_seeded_stake_if_test() {
124124 } ;
125125 let amount = QUOTE_PRECISION as u64 ; // $1
126126 let mut spot_market = SpotMarket {
127- deposit_balance : 0 ,
128- cumulative_deposit_interest : 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ,
127+ deposit_balance : 0 . into ( ) ,
128+ cumulative_deposit_interest : ( 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ) . into ( ) ,
129129 insurance_fund : InsuranceFund {
130130 unstaking_period : 0 ,
131131 ..InsuranceFund :: default ( )
@@ -224,16 +224,16 @@ pub fn large_num_seeded_stake_if_test() {
224224
225225 // all funds in revenue pool
226226 let mut spot_market = SpotMarket {
227- deposit_balance : 100 * SPOT_BALANCE_PRECISION ,
228- cumulative_deposit_interest : 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ,
227+ deposit_balance : ( 100 * SPOT_BALANCE_PRECISION ) . into ( ) ,
228+ cumulative_deposit_interest : ( 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ) . into ( ) ,
229229 insurance_fund : InsuranceFund {
230230 unstaking_period : 0 ,
231231 revenue_settle_period : 1 ,
232232 ..InsuranceFund :: default ( )
233233 } ,
234234 revenue_pool : PoolBalance {
235235 market_index : 0 ,
236- scaled_balance : 100 * SPOT_BALANCE_PRECISION ,
236+ scaled_balance : ( 100 * SPOT_BALANCE_PRECISION ) . into ( ) ,
237237 ..PoolBalance :: default ( )
238238 } ,
239239 ..SpotMarket :: default ( )
@@ -371,8 +371,8 @@ pub fn gains_stake_if_test() {
371371 } ;
372372 let amount = QUOTE_PRECISION as u64 ; // $1
373373 let mut spot_market = SpotMarket {
374- deposit_balance : 0 ,
375- cumulative_deposit_interest : 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ,
374+ deposit_balance : 0 . into ( ) ,
375+ cumulative_deposit_interest : ( 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ) . into ( ) ,
376376 insurance_fund : InsuranceFund {
377377 unstaking_period : 0 ,
378378 ..InsuranceFund :: default ( )
@@ -496,8 +496,8 @@ pub fn losses_stake_if_test() {
496496 } ;
497497 let amount = QUOTE_PRECISION as u64 ; // $1
498498 let mut spot_market = SpotMarket {
499- deposit_balance : 0 ,
500- cumulative_deposit_interest : 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ,
499+ deposit_balance : 0 . into ( ) ,
500+ cumulative_deposit_interest : ( 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ) . into ( ) ,
501501 insurance_fund : InsuranceFund {
502502 unstaking_period : 0 ,
503503 ..InsuranceFund :: default ( )
@@ -624,8 +624,8 @@ pub fn escrow_losses_stake_if_test() {
624624 } ;
625625 let amount = ( QUOTE_PRECISION * 100_000 ) as u64 ; // $100k
626626 let mut spot_market = SpotMarket {
627- deposit_balance : 0 ,
628- cumulative_deposit_interest : 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ,
627+ deposit_balance : 0 . into ( ) ,
628+ cumulative_deposit_interest : ( 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ) . into ( ) ,
629629 insurance_fund : InsuranceFund {
630630 unstaking_period : 60 * 60 * 24 * 7 , // 7 weeks
631631 ..InsuranceFund :: default ( )
@@ -721,12 +721,12 @@ pub fn escrow_gains_stake_if_test() {
721721 } ;
722722 let amount = 100_000_384_939_u64 ; // $100k + change
723723 let mut spot_market = SpotMarket {
724- deposit_balance : 0 ,
725- cumulative_deposit_interest : 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ,
724+ deposit_balance : 0 . into ( ) ,
725+ cumulative_deposit_interest : ( 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ) . into ( ) ,
726726 insurance_fund : InsuranceFund {
727727 unstaking_period : 60 * 60 * 24 * 7 , // 7 weeks
728- total_shares : 1 ,
729- user_shares : 0 ,
728+ total_shares : 1 . into ( ) ,
729+ user_shares : 0 . into ( ) ,
730730 ..InsuranceFund :: default ( )
731731 } ,
732732 ..SpotMarket :: default ( )
@@ -841,12 +841,12 @@ pub fn drained_stake_if_test_rebase_on_new_add() {
841841 let amount = 100_000_384_939_u64 ; // $100k + change
842842
843843 let mut spot_market = SpotMarket {
844- deposit_balance : 0 ,
845- cumulative_deposit_interest : 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ,
844+ deposit_balance : 0 . into ( ) ,
845+ cumulative_deposit_interest : ( 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ) . into ( ) ,
846846 insurance_fund : InsuranceFund {
847847 unstaking_period : 60 * 60 * 24 * 7 , // 7 weeks
848- total_shares : 100_000 * QUOTE_PRECISION ,
849- user_shares : 80_000 * QUOTE_PRECISION ,
848+ total_shares : ( 100_000 * QUOTE_PRECISION ) . into ( ) ,
849+ user_shares : ( 80_000 * QUOTE_PRECISION ) . into ( ) ,
850850 ..InsuranceFund :: default ( )
851851 } ,
852852 ..SpotMarket :: default ( )
@@ -950,12 +950,12 @@ pub fn drained_stake_if_test_rebase_on_old_remove_all() {
950950 let mut if_balance = 0 ;
951951
952952 let mut spot_market = SpotMarket {
953- deposit_balance : 0 ,
954- cumulative_deposit_interest : 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ,
953+ deposit_balance : 0 . into ( ) ,
954+ cumulative_deposit_interest : ( 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ) . into ( ) ,
955955 insurance_fund : InsuranceFund {
956956 unstaking_period : 0 ,
957- total_shares : 100_000 * QUOTE_PRECISION ,
958- user_shares : 80_000 * QUOTE_PRECISION ,
957+ total_shares : ( 100_000 * QUOTE_PRECISION ) . into ( ) ,
958+ user_shares : ( 80_000 * QUOTE_PRECISION ) . into ( ) ,
959959 ..InsuranceFund :: default ( )
960960 } ,
961961 ..SpotMarket :: default ( )
@@ -1044,12 +1044,12 @@ pub fn drained_stake_if_test_rebase_on_old_remove_all_2() {
10441044 let mut if_balance = 0 ;
10451045
10461046 let mut spot_market = SpotMarket {
1047- deposit_balance : 0 ,
1048- cumulative_deposit_interest : 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ,
1047+ deposit_balance : 0 . into ( ) ,
1048+ cumulative_deposit_interest : ( 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ) . into ( ) ,
10491049 insurance_fund : InsuranceFund {
10501050 unstaking_period : 0 ,
1051- total_shares : 100_930_021_053 ,
1052- user_shares : 83_021 * QUOTE_PRECISION + 135723 ,
1051+ total_shares : 100_930_021_053 . into ( ) ,
1052+ user_shares : ( 83_021 * QUOTE_PRECISION + 135723 ) . into ( ) ,
10531053 ..InsuranceFund :: default ( )
10541054 } ,
10551055 ..SpotMarket :: default ( )
@@ -1258,8 +1258,8 @@ pub fn multiple_if_stakes_and_rebase() {
12581258
12591259 let amount = ( QUOTE_PRECISION * 100_000 ) as u64 ; // $100k
12601260 let mut spot_market = SpotMarket {
1261- deposit_balance : 0 ,
1262- cumulative_deposit_interest : 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ,
1261+ deposit_balance : 0 . into ( ) ,
1262+ cumulative_deposit_interest : ( 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ) . into ( ) ,
12631263 insurance_fund : InsuranceFund {
12641264 unstaking_period : 0 ,
12651265 ..InsuranceFund :: default ( )
@@ -1377,8 +1377,8 @@ pub fn multiple_if_stakes_and_rebase_and_admin_remove() {
13771377
13781378 let amount = ( QUOTE_PRECISION * 100_000 ) as u64 ; // $100k
13791379 let mut spot_market = SpotMarket {
1380- deposit_balance : 0 ,
1381- cumulative_deposit_interest : 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ,
1380+ deposit_balance : 0 . into ( ) ,
1381+ cumulative_deposit_interest : ( 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ) . into ( ) ,
13821382 insurance_fund : InsuranceFund {
13831383 unstaking_period : 0 ,
13841384 ..InsuranceFund :: default ( )
@@ -1539,8 +1539,8 @@ fn test_transfer_protocol_owned_stake() {
15391539 } ;
15401540
15411541 let mut spot_market = SpotMarket {
1542- deposit_balance : 0 ,
1543- cumulative_deposit_interest : 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ,
1542+ deposit_balance : 0 . into ( ) ,
1543+ cumulative_deposit_interest : ( 1111 * SPOT_CUMULATIVE_INTEREST_PRECISION / 1000 ) . into ( ) ,
15441544 insurance_fund : InsuranceFund {
15451545 unstaking_period : 0 ,
15461546 ..InsuranceFund :: default ( )
0 commit comments