11use crate :: contract:: { execute, instantiate} ;
22use crate :: models:: {
3- AllPendingRewardsQuery , AssetQuery , Config , ExecuteMsg , InstantiateMsg , PendingRewardsRes ,
4- QueryMsg , StakedBalanceRes , ModifyAssetPair ,
3+ AllPendingRewardsQuery , AssetQuery , Config , ExecuteMsg , InstantiateMsg , ModifyAssetPair ,
4+ PendingRewardsRes , QueryMsg , StakedBalanceRes ,
55} ;
66use crate :: query:: query;
77use crate :: state:: CONFIG ;
@@ -11,7 +11,7 @@ use alliance_protocol::alliance_protocol::{
1111} ;
1212use alliance_protocol:: token_factory:: CustomExecuteMsg ;
1313use cosmwasm_std:: testing:: { mock_env, mock_info} ;
14- use cosmwasm_std:: { coin, from_json, Deps , DepsMut , Response , StdResult , Uint128 , Binary , Addr } ;
14+ use cosmwasm_std:: { coin, from_json, Addr , Binary , Deps , DepsMut , Response , StdResult , Uint128 } ;
1515use cw20:: Cw20ReceiveMsg ;
1616use cw_asset:: { Asset , AssetInfo } ;
1717
@@ -24,7 +24,7 @@ pub fn setup_contract(deps: DepsMut) -> Response<CustomExecuteMsg> {
2424 let init_msg = InstantiateMsg {
2525 governance : "gov" . to_string ( ) ,
2626 fee_collector_address : "collector_address" . to_string ( ) ,
27- astro_incentives_address : "astro_incentives" . to_string ( ) ,
27+ astro_incentives_address : "astro_incentives" . to_string ( ) ,
2828 controller : "controller" . to_string ( ) ,
2929 reward_denom : "uluna" . to_string ( ) ,
3030 } ;
@@ -51,19 +51,17 @@ pub fn modify_asset(deps: DepsMut, assets: Vec<ModifyAssetPair>) -> Response {
5151 execute ( deps, env, info, msg) . unwrap ( )
5252}
5353
54-
5554pub fn stake ( deps : DepsMut , user : & str , amount : u128 , denom : & str ) -> Response {
5655 let info = mock_info ( user, & [ coin ( amount, denom) ] ) ;
5756 let env = mock_env ( ) ;
5857 let msg = ExecuteMsg :: Stake { } ;
5958 execute ( deps, env, info, msg) . unwrap ( )
6059}
6160
62-
6361pub fn stake_cw20 ( deps : DepsMut , user : & str , amount : u128 , denom : & str ) -> Response {
6462 let mut info = mock_info ( user, & [ ] ) ;
6563 let env = mock_env ( ) ;
66- let msg = ExecuteMsg :: Receive ( Cw20ReceiveMsg {
64+ let msg = ExecuteMsg :: Receive ( Cw20ReceiveMsg {
6765 sender : String :: from ( user) ,
6866 amount : Uint128 :: new ( amount) ,
6967 msg : Binary :: default ( ) ,
@@ -133,7 +131,12 @@ pub fn claim_rewards(deps: DepsMut, user: &str, denom: &str) -> Response {
133131 execute ( deps, env, info, msg) . unwrap ( )
134132}
135133
136- pub fn query_rewards ( deps : Deps , user : & str , deposit_asset : & str , reward_asset : & str ) -> PendingRewardsRes {
134+ pub fn query_rewards (
135+ deps : Deps ,
136+ user : & str ,
137+ deposit_asset : & str ,
138+ reward_asset : & str ,
139+ ) -> PendingRewardsRes {
137140 from_json (
138141 query (
139142 deps,
0 commit comments