@@ -68,15 +68,16 @@ fn test_update_config() {
6868 let mut deps = mock_dependencies ( & [ ] ) ;
6969 let api = deps. api ;
7070
71- deps. querier . add_wasm_query_response ( api. addr_make ( "token_contract" ) . as_str ( ) , |_| {
72- cosmwasm_std:: ContractResult :: Ok (
73- to_json_binary ( & drop_staking_base:: msg:: token:: ConfigResponse {
74- factory_contract : api. addr_make ( "factory_contract" ) . to_string ( ) ,
75- denom : "ld_denom" . to_string ( ) ,
76- } )
77- . unwrap ( ) ,
78- )
79- } ) ;
71+ deps. querier
72+ . add_wasm_query_response ( api. addr_make ( "token_contract" ) . as_str ( ) , move |_| {
73+ cosmwasm_std:: ContractResult :: Ok (
74+ to_json_binary ( & drop_staking_base:: msg:: token:: ConfigResponse {
75+ factory_contract : api. addr_make ( "factory_contract" ) . to_string ( ) ,
76+ denom : "ld_denom" . to_string ( ) ,
77+ } )
78+ . unwrap ( ) ,
79+ )
80+ } ) ;
8081 deps. querier
8182 . add_wasm_query_response ( "old_token_contract" , |_| {
8283 cosmwasm_std:: ContractResult :: Ok (
@@ -331,9 +332,10 @@ fn test_add_remove_bond_provider() {
331332 to_json_binary:: <Vec <( Addr , bool ) >>( & vec![ ] ) . unwrap( )
332333 ) ;
333334
334- deps. querier . add_wasm_query_response ( bond_provider_address. as_str ( ) , |_| {
335- cosmwasm_std:: ContractResult :: Ok ( to_json_binary ( & true ) . unwrap ( ) )
336- } ) ;
335+ deps. querier
336+ . add_wasm_query_response ( bond_provider_address. as_str ( ) , |_| {
337+ cosmwasm_std:: ContractResult :: Ok ( to_json_binary ( & true ) . unwrap ( ) )
338+ } ) ;
337339
338340 let res = execute (
339341 deps. as_mut ( ) ,
@@ -540,12 +542,13 @@ fn test_tick_idle_claim_wo_unbond() {
540542 . unwrap ( ) ,
541543 )
542544 } ) ;
543- deps. querier
544- . add_wasm_query_response ( api. addr_make ( "validators_set_contract" ) . as_str ( ) , |_| {
545+ deps. querier . add_wasm_query_response (
546+ api. addr_make ( "validators_set_contract" ) . as_str ( ) ,
547+ move |_| {
545548 cosmwasm_std:: ContractResult :: Ok (
546549 to_json_binary ( & vec ! [
547550 drop_staking_base:: state:: validatorset:: ValidatorInfo {
548- valoper_address: "valoper_address" . to_string( ) ,
551+ valoper_address: api . addr_make ( "valoper_address" ) . to_string( ) ,
549552 weight: 1 ,
550553 on_top: Uint128 :: zero( ) ,
551554 last_processed_remote_height: None ,
@@ -562,15 +565,16 @@ fn test_tick_idle_claim_wo_unbond() {
562565 ] )
563566 . unwrap ( ) ,
564567 )
565- } ) ;
568+ } ,
569+ ) ;
566570 deps. querier
567- . add_wasm_query_response ( api. addr_make ( "puppeteer_contract" ) . as_str ( ) , |_| {
571+ . add_wasm_query_response ( api. addr_make ( "puppeteer_contract" ) . as_str ( ) , move |_| {
568572 cosmwasm_std:: ContractResult :: Ok (
569573 to_json_binary ( & DelegationsResponse {
570574 delegations : Delegations {
571575 delegations : vec ! [ DropDelegation {
572- delegator: Addr :: unchecked ( "ica_address" ) ,
573- validator: "valoper_address" . to_string( ) ,
576+ delegator: api . addr_make ( "ica_address" ) ,
577+ validator: api . addr_make ( "valoper_address" ) . to_string( ) ,
574578 amount: Coin {
575579 denom: "remote_denom" . to_string( ) ,
576580 amount: Uint128 :: new( 100_000 ) ,
@@ -711,12 +715,13 @@ fn test_tick_idle_claim_with_unbond_transfer() {
711715 . unwrap ( ) ,
712716 )
713717 } ) ;
714- deps. querier
715- . add_wasm_query_response ( api. addr_make ( "validators_set_contract" ) . as_str ( ) , |_| {
718+ deps. querier . add_wasm_query_response (
719+ api. addr_make ( "validators_set_contract" ) . as_str ( ) ,
720+ move |_| {
716721 cosmwasm_std:: ContractResult :: Ok (
717722 to_json_binary ( & vec ! [
718723 drop_staking_base:: state:: validatorset:: ValidatorInfo {
719- valoper_address: "valoper_address" . to_string( ) ,
724+ valoper_address: api . addr_make ( "valoper_address" ) . to_string( ) ,
720725 weight: 1 ,
721726 on_top: Uint128 :: zero( ) ,
722727 last_processed_remote_height: None ,
@@ -733,15 +738,16 @@ fn test_tick_idle_claim_with_unbond_transfer() {
733738 ] )
734739 . unwrap ( ) ,
735740 )
736- } ) ;
741+ } ,
742+ ) ;
737743 deps. querier
738- . add_wasm_query_response ( api. addr_make ( "puppeteer_contract" ) . as_str ( ) , |_| {
744+ . add_wasm_query_response ( api. addr_make ( "puppeteer_contract" ) . as_str ( ) , move |_| {
739745 cosmwasm_std:: ContractResult :: Ok (
740746 to_json_binary ( & DelegationsResponse {
741747 delegations : Delegations {
742748 delegations : vec ! [ DropDelegation {
743- delegator: Addr :: unchecked ( "ica_address" ) ,
744- validator: "valoper_address" . to_string( ) ,
749+ delegator: api . addr_make ( "ica_address" ) ,
750+ validator: api . addr_make ( "valoper_address" ) . to_string( ) ,
745751 amount: Coin {
746752 denom: "remote_denom" . to_string( ) ,
747753 amount: Uint128 :: new( 100_000 ) ,
@@ -950,7 +956,11 @@ fn test_tick_claiming_error_wo_transfer() {
950956 let q: StrategyQueryMsg = from_json ( msg) . unwrap ( ) ;
951957 match q {
952958 StrategyQueryMsg :: CalcDeposit { deposit } => cosmwasm_std:: ContractResult :: Ok (
953- to_json_binary ( & vec ! [ ( api. addr_make( "valoper_address" ) . to_string( ) , deposit) ] ) . unwrap ( ) ,
959+ to_json_binary ( & vec ! [ (
960+ api. addr_make( "valoper_address" ) . to_string( ) ,
961+ deposit,
962+ ) ] )
963+ . unwrap ( ) ,
954964 ) ,
955965 _ => unimplemented ! ( ) ,
956966 }
@@ -1070,7 +1080,11 @@ fn test_tick_claiming_error_with_transfer() {
10701080 let q: StrategyQueryMsg = from_json ( msg) . unwrap ( ) ;
10711081 match q {
10721082 StrategyQueryMsg :: CalcDeposit { deposit } => cosmwasm_std:: ContractResult :: Ok (
1073- to_json_binary ( & vec ! [ ( api. addr_make( "valoper_address" ) . to_string( ) , deposit) ] ) . unwrap ( ) ,
1083+ to_json_binary ( & vec ! [ (
1084+ api. addr_make( "valoper_address" ) . to_string( ) ,
1085+ deposit,
1086+ ) ] )
1087+ . unwrap ( ) ,
10741088 ) ,
10751089 _ => unimplemented ! ( ) ,
10761090 }
@@ -1241,7 +1255,11 @@ fn test_tick_claiming_wo_transfer_unbonding() {
12411255 let q: StrategyQueryMsg = from_json ( msg) . unwrap ( ) ;
12421256 match q {
12431257 StrategyQueryMsg :: CalcWithdraw { withdraw } => cosmwasm_std:: ContractResult :: Ok (
1244- to_json_binary ( & vec ! [ ( api. addr_make( "valoper_address" ) . to_string( ) , withdraw) ] ) . unwrap ( ) ,
1258+ to_json_binary ( & vec ! [ (
1259+ api. addr_make( "valoper_address" ) . to_string( ) ,
1260+ withdraw,
1261+ ) ] )
1262+ . unwrap ( ) ,
12451263 ) ,
12461264 _ => unimplemented ! ( ) ,
12471265 }
@@ -1426,7 +1444,11 @@ fn test_tick_claiming_wo_idle() {
14261444 let q: StrategyQueryMsg = from_json ( msg) . unwrap ( ) ;
14271445 match q {
14281446 StrategyQueryMsg :: CalcWithdraw { withdraw } => cosmwasm_std:: ContractResult :: Ok (
1429- to_json_binary ( & vec ! [ ( api. addr_make( "valoper_address" ) . to_string( ) , withdraw) ] ) . unwrap ( ) ,
1447+ to_json_binary ( & vec ! [ (
1448+ api. addr_make( "valoper_address" ) . to_string( ) ,
1449+ withdraw,
1450+ ) ] )
1451+ . unwrap ( ) ,
14301452 ) ,
14311453 _ => unimplemented ! ( ) ,
14321454 }
@@ -1965,7 +1987,7 @@ fn test_bond_lsm_share_increase_exchange_rate() {
19651987 BOND_PROVIDERS . init ( deps. as_mut ( ) . storage ) . unwrap ( ) ;
19661988
19671989 deps. querier
1968- . add_wasm_query_response ( api. addr_make ( "puppeteer_contract" ) . as_str ( ) , |_| {
1990+ . add_wasm_query_response ( api. addr_make ( "puppeteer_contract" ) . as_str ( ) , move |_| {
19691991 cosmwasm_std:: ContractResult :: Ok (
19701992 to_json_binary ( & DelegationsResponse {
19711993 delegations : Delegations {
@@ -1984,7 +2006,7 @@ fn test_bond_lsm_share_increase_exchange_rate() {
19842006 )
19852007 } ) ;
19862008 deps. querier
1987- . add_wasm_query_response ( api. addr_make ( "puppeteer_contract" ) . as_str ( ) , |_| {
2009+ . add_wasm_query_response ( api. addr_make ( "puppeteer_contract" ) . as_str ( ) , move |_| {
19882010 cosmwasm_std:: ContractResult :: Ok (
19892011 to_json_binary ( & DelegationsResponse {
19902012 delegations : Delegations {
@@ -2090,11 +2112,14 @@ fn test_unbond() {
20902112 let mut env = mock_env ( ) ;
20912113
20922114 deps. querier
2093- . add_wasm_query_response ( "factory_contract" , |_| {
2115+ . add_wasm_query_response ( "factory_contract" , move |_| {
20942116 cosmwasm_std:: ContractResult :: Ok (
20952117 to_json_binary ( & HashMap :: from ( [
20962118 ( "token_contract" , api. addr_make ( "token_contract" ) . as_str ( ) ) ,
2097- ( "withdrawal_voucher_contract" , api. addr_make ( "withdrawal_voucher_contract" ) . as_str ( ) ) ,
2119+ (
2120+ "withdrawal_voucher_contract" ,
2121+ api. addr_make ( "withdrawal_voucher_contract" ) . as_str ( ) ,
2122+ ) ,
20982123 ] ) )
20992124 . unwrap ( ) ,
21002125 )
0 commit comments