terra: migrations for lower bridge fee

Change-Id: Ic83b321d42c9148f3915a365d195298ff052eda2
This commit is contained in:
Reisen 2021-10-11 10:04:47 +00:00 committed by David Paryente
parent 91087bdb66
commit ddf43b85d7
2 changed files with 6 additions and 3 deletions

View File

@ -317,7 +317,7 @@ fn handle_attest_meta(
} else {
wrapped_asset(deps.storage).save(&asset_id, &HumanAddr::from(WRAPPED_ASSET_UPDATING))?;
CosmosMsg::Wasm(WasmMsg::Instantiate {
admin: Some(env.contract.address.to_string()),
admin: Some(env.contract.address.clone().into_string()),
code_id: cfg.wrapped_asset_code_id,
msg: to_binary(&WrappedInit {
name: get_string_from_32(&meta.name)?,

View File

@ -82,7 +82,10 @@ const FEE_AMOUNT: u128 = 10000;
pub const FEE_DENOMINATION: &str = "uluna";
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn migrate(_deps: DepsMut, _env: Env, _msg: MigrateMsg) -> StdResult<Response> {
pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> StdResult<Response> {
let mut state = config_read(deps.storage).load()?;
state.fee = Coin::new(0, FEE_DENOMINATION);
config(deps.storage).save(&state)?;
Ok(Response::default())
}
@ -329,7 +332,7 @@ fn handle_post_message(
let fee = state.fee;
// Check fee
if !has_coins(info.funds.as_ref(), &fee) {
if fee.amount.u128() > 0 && !has_coins(info.funds.as_ref(), &fee) {
return ContractError::FeeTooLow.std_err();
}