From bf1fa86b7a6088b0d8c65046591e4645a67f0d40 Mon Sep 17 00:00:00 2001 From: Jiri Date: Fri, 19 Apr 2024 15:52:51 +0200 Subject: [PATCH] FIxes --- fetch/cosmwasm_contract/src/contract.rs | 5 ++++- fetch/cosmwasm_contract/src/migration.rs | 1 + fetch/cosmwasm_contract/src/msg.rs | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fetch/cosmwasm_contract/src/contract.rs b/fetch/cosmwasm_contract/src/contract.rs index f21ae6e..4c2c0f6 100644 --- a/fetch/cosmwasm_contract/src/contract.rs +++ b/fetch/cosmwasm_contract/src/contract.rs @@ -19,6 +19,7 @@ use crate::state::{config, config_read, refunds_add, refunds_have, State}; pub const DEFAULT_DENOM: &str = "aasi"; pub const DEFAULT_RELAY_EON: u64 = 0; +pub const DEFAULT_FEES_ACCRUED: Uint128 = Uint128::zero(); /* *************************************************** * ************** Initialization ************* @@ -38,6 +39,7 @@ pub fn instantiate( &info.sender, supply, DEFAULT_RELAY_EON, + DEFAULT_FEES_ACCRUED, &msg, )?; @@ -50,6 +52,7 @@ pub fn initialise_contract_state( admin: &Addr, supply: Uint128, relay_eon: u64, + fees_accrued: Uint128, msg: &InstantiateMsg, ) -> StdResult<()> { let current_block_number = env.block.height; @@ -70,7 +73,7 @@ pub fn initialise_contract_state( let state = State { supply, - fees_accrued: Uint128::zero(), + fees_accrued, next_swap_id: msg.next_swap_id, sealed_reverse_swap_id: 0, relay_eon, diff --git a/fetch/cosmwasm_contract/src/migration.rs b/fetch/cosmwasm_contract/src/migration.rs index 7df8d18..45cae72 100644 --- a/fetch/cosmwasm_contract/src/migration.rs +++ b/fetch/cosmwasm_contract/src/migration.rs @@ -18,6 +18,7 @@ pub fn migrate(deps: DepsMut, env: Env, msg: MigrateMsg) -> StdResult &re_init.admin, re_init.supply, re_init.relay_eon, + re_init.fees_accrued, &re_init.init_msg, )?; } else if !is_state_valid(deps.storage) { diff --git a/fetch/cosmwasm_contract/src/msg.rs b/fetch/cosmwasm_contract/src/msg.rs index 527bdd3..b1e4d4a 100644 --- a/fetch/cosmwasm_contract/src/msg.rs +++ b/fetch/cosmwasm_contract/src/msg.rs @@ -169,6 +169,7 @@ pub struct ReInitMsg { pub admin: Addr, pub supply: Uint128, pub relay_eon: u64, + pub fees_accrued: Uint128, } #[derive(Serialize, Deserialize, JsonSchema)]