Skip to content

Commit 1c1c25a

Browse files
Post-rebase fixes
1 parent 627544f commit 1c1c25a

File tree

7 files changed

+72
-57
lines changed

7 files changed

+72
-57
lines changed

Cargo.lock

Lines changed: 1 addition & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/core/src/contract.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use cosmwasm_std::{
22
attr, ensure, ensure_eq, ensure_ne, to_json_binary, Addr, Attribute, BankQuery, Binary, Coin,
3-
CosmosMsg, CustomQuery, Decimal, Deps, DepsMut, Env, GrpcQuery, MessageInfo, Order,
4-
QueryRequest, Response, StdError, StdResult, Uint128, Uint64, WasmMsg,
3+
CosmosMsg, CustomQuery, Decimal, Deps, DepsMut, Env, MessageInfo, Order, QueryRequest,
4+
Response, StdError, StdResult, Uint128, Uint64, WasmMsg,
55
};
66
use cw_storage_plus::{Bound, Item};
77
use drop_helpers::answer::response;

contracts/core/src/tests.rs

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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(),
@@ -950,7 +952,11 @@ fn test_tick_claiming_error_wo_transfer() {
950952
let q: StrategyQueryMsg = from_json(msg).unwrap();
951953
match q {
952954
StrategyQueryMsg::CalcDeposit { deposit } => cosmwasm_std::ContractResult::Ok(
953-
to_json_binary(&vec![(api.addr_make("valoper_address").to_string(), deposit)]).unwrap(),
955+
to_json_binary(&vec![(
956+
api.addr_make("valoper_address").to_string(),
957+
deposit,
958+
)])
959+
.unwrap(),
954960
),
955961
_ => unimplemented!(),
956962
}
@@ -1070,7 +1076,11 @@ fn test_tick_claiming_error_with_transfer() {
10701076
let q: StrategyQueryMsg = from_json(msg).unwrap();
10711077
match q {
10721078
StrategyQueryMsg::CalcDeposit { deposit } => cosmwasm_std::ContractResult::Ok(
1073-
to_json_binary(&vec![(api.addr_make("valoper_address").to_string(), deposit)]).unwrap(),
1079+
to_json_binary(&vec![(
1080+
api.addr_make("valoper_address").to_string(),
1081+
deposit,
1082+
)])
1083+
.unwrap(),
10741084
),
10751085
_ => unimplemented!(),
10761086
}
@@ -1241,7 +1251,11 @@ fn test_tick_claiming_wo_transfer_unbonding() {
12411251
let q: StrategyQueryMsg = from_json(msg).unwrap();
12421252
match q {
12431253
StrategyQueryMsg::CalcWithdraw { withdraw } => cosmwasm_std::ContractResult::Ok(
1244-
to_json_binary(&vec![(api.addr_make("valoper_address").to_string(), withdraw)]).unwrap(),
1254+
to_json_binary(&vec![(
1255+
api.addr_make("valoper_address").to_string(),
1256+
withdraw,
1257+
)])
1258+
.unwrap(),
12451259
),
12461260
_ => unimplemented!(),
12471261
}
@@ -1426,7 +1440,11 @@ fn test_tick_claiming_wo_idle() {
14261440
let q: StrategyQueryMsg = from_json(msg).unwrap();
14271441
match q {
14281442
StrategyQueryMsg::CalcWithdraw { withdraw } => cosmwasm_std::ContractResult::Ok(
1429-
to_json_binary(&vec![(api.addr_make("valoper_address").to_string(), withdraw)]).unwrap(),
1443+
to_json_binary(&vec![(
1444+
api.addr_make("valoper_address").to_string(),
1445+
withdraw,
1446+
)])
1447+
.unwrap(),
14301448
),
14311449
_ => unimplemented!(),
14321450
}
@@ -1965,7 +1983,7 @@ fn test_bond_lsm_share_increase_exchange_rate() {
19651983
BOND_PROVIDERS.init(deps.as_mut().storage).unwrap();
19661984

19671985
deps.querier
1968-
.add_wasm_query_response(api.addr_make("puppeteer_contract").as_str(), |_| {
1986+
.add_wasm_query_response(api.addr_make("puppeteer_contract").as_str(), move |_| {
19691987
cosmwasm_std::ContractResult::Ok(
19701988
to_json_binary(&DelegationsResponse {
19711989
delegations: Delegations {
@@ -1984,7 +2002,7 @@ fn test_bond_lsm_share_increase_exchange_rate() {
19842002
)
19852003
});
19862004
deps.querier
1987-
.add_wasm_query_response(api.addr_make("puppeteer_contract").as_str(), |_| {
2005+
.add_wasm_query_response(api.addr_make("puppeteer_contract").as_str(), move |_| {
19882006
cosmwasm_std::ContractResult::Ok(
19892007
to_json_binary(&DelegationsResponse {
19902008
delegations: Delegations {
@@ -2090,11 +2108,14 @@ fn test_unbond() {
20902108
let mut env = mock_env();
20912109

20922110
deps.querier
2093-
.add_wasm_query_response("factory_contract", |_| {
2111+
.add_wasm_query_response("factory_contract", move |_| {
20942112
cosmwasm_std::ContractResult::Ok(
20952113
to_json_binary(&HashMap::from([
20962114
("token_contract", api.addr_make("token_contract").as_str()),
2097-
("withdrawal_voucher_contract", api.addr_make("withdrawal_voucher_contract").as_str()),
2115+
(
2116+
"withdrawal_voucher_contract",
2117+
api.addr_make("withdrawal_voucher_contract").as_str(),
2118+
),
20982119
]))
20992120
.unwrap(),
21002121
)

contracts/factory/src/tests.rs

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,28 +1283,33 @@ fn test_query_state() {
12831283
fn test_query_pause_info() {
12841284
let mut deps = mock_dependencies(&[]);
12851285
let api = deps.api;
1286-
deps.querier.add_wasm_query_response(api.addr_make("core_contract").as_str(), |_| {
1287-
cosmwasm_std::ContractResult::Ok(
1288-
to_json_binary(&CorePause {
1289-
tick: true,
1290-
bond: false,
1291-
unbond: false,
1292-
})
1293-
.unwrap(),
1294-
)
1295-
});
12961286
deps.querier
1297-
.add_wasm_query_response(api.addr_make("withdrawal_manager_contract").as_str(), |_| {
1287+
.add_wasm_query_response(api.addr_make("core_contract").as_str(), |_| {
12981288
cosmwasm_std::ContractResult::Ok(
1299-
to_json_binary(&drop_helpers::pause::PauseInfoResponse::Unpaused {}).unwrap(),
1289+
to_json_binary(&CorePause {
1290+
tick: true,
1291+
bond: false,
1292+
unbond: false,
1293+
})
1294+
.unwrap(),
13001295
)
13011296
});
1302-
deps.querier
1303-
.add_wasm_query_response(api.addr_make("rewards_manager_contract").as_str(), |_| {
1297+
deps.querier.add_wasm_query_response(
1298+
api.addr_make("withdrawal_manager_contract").as_str(),
1299+
|_| {
1300+
cosmwasm_std::ContractResult::Ok(
1301+
to_json_binary(&drop_helpers::pause::PauseInfoResponse::Unpaused {}).unwrap(),
1302+
)
1303+
},
1304+
);
1305+
deps.querier.add_wasm_query_response(
1306+
api.addr_make("rewards_manager_contract").as_str(),
1307+
|_| {
13041308
cosmwasm_std::ContractResult::Ok(
13051309
to_json_binary(&drop_helpers::pause::PauseInfoResponse::Paused {}).unwrap(),
13061310
)
1307-
});
1311+
},
1312+
);
13081313
set_default_factory_state(deps.as_mut(), api);
13091314
let query_res: drop_staking_base::state::factory::PauseInfoResponse =
13101315
from_json(query(deps.as_ref(), mock_env(), QueryMsg::PauseInfo {}).unwrap()).unwrap();

contracts/lsm-share-bond-provider/src/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fn lsm_denom_query_config(
140140
);
141141

142142
deps.querier
143-
.add_wasm_query_response(api.addr_make("puppeteer_contract").as_str(), |_| {
143+
.add_wasm_query_response(api.addr_make("puppeteer_contract").as_str(), move |_| {
144144
cosmwasm_std::ContractResult::Ok(
145145
to_json_binary(&DelegationsResponse {
146146
delegations: Delegations {
@@ -451,7 +451,7 @@ fn test_process_on_idle_supported() {
451451
});
452452

453453
deps.querier
454-
.add_wasm_query_response(api.addr_make("puppeteer_contract").as_str(), |_| {
454+
.add_wasm_query_response(api.addr_make("puppeteer_contract").as_str(), move |_| {
455455
cosmwasm_std::ContractResult::Ok(
456456
to_json_binary(&IcaState::Registered {
457457
ica_address: api.addr_make("ica_address").to_string(),

contracts/native-bond-provider/src/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ fn process_on_idle_delegation() {
673673
.unwrap();
674674

675675
deps.querier
676-
.add_wasm_query_response("strategy_contract", |_| {
676+
.add_wasm_query_response("strategy_contract", move |_| {
677677
cosmwasm_std::ContractResult::Ok(
678678
to_json_binary(&vec![(
679679
api.addr_make("valoper_address").to_string(),
@@ -752,7 +752,7 @@ fn process_on_idle_ibc_transfer() {
752752
});
753753

754754
deps.querier
755-
.add_wasm_query_response(api.addr_make("puppeteer_contract").as_str(), |_| {
755+
.add_wasm_query_response(api.addr_make("puppeteer_contract").as_str(), move |_| {
756756
cosmwasm_std::ContractResult::Ok(
757757
to_json_binary(&IcaState::Registered {
758758
ica_address: api.addr_make("ica_address").to_string(),

contracts/val-ref/src/tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ fn execute_bond_hook_known_validator() {
280280
let req = from_json::<CoreQueryMsg>(req).unwrap();
281281
assert_eq!(req, CoreQueryMsg::ExchangeRate {});
282282

283-
cosmwasm_std::ContractResult::Ok(
284-
to_json_binary(&Decimal::from_ratio(3u128, 2u128)).unwrap(),
285-
)
286-
});
283+
cosmwasm_std::ContractResult::Ok(
284+
to_json_binary(&Decimal::from_ratio(3u128, 2u128)).unwrap(),
285+
)
286+
});
287287

288288
let response = contract::execute(
289289
deps.as_mut(),

0 commit comments

Comments
 (0)