diff --git a/contracts/cosmwasm/executor/src/contract.rs b/contracts/cosmwasm/executor/src/contract.rs index 6f84651..e932d56 100644 --- a/contracts/cosmwasm/executor/src/contract.rs +++ b/contracts/cosmwasm/executor/src/contract.rs @@ -11,9 +11,7 @@ use alloc::borrow::Cow; #[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; use cosmwasm_std::{ - ensure, to_json_binary, wasm_execute, Addr, BankMsg, Binary, Coin, CosmosMsg, Deps, DepsMut, - Env, MessageInfo, QueryRequest, Reply, Response, StdError, StdResult, SubMsg, SubMsgResult, - WasmQuery, + ensure, to_json_binary, wasm_execute, Addr, BankMsg, Binary, Coin, CosmosMsg, Deps, DepsMut, Env, MessageInfo, QueryRequest, Reply, Response, StdError, StdResult, SubMsg, SubMsgResult, Uint128, WasmQuery }; use cvm_route::{asset::AssetReference, exchange::ExchangeItem}; use cvm_runtime::{ @@ -483,7 +481,7 @@ pub fn interpret_transfer( let mut coin = deps .querier .query_balance(env.contract.address.clone(), denom)?; - let transfer_amount = balance.apply(coin.amount.into())?.into(); + let transfer_amount: Uint128 = balance.apply(coin.amount.into())?.into(); if transfer_amount.is_zero() { // after cross chain route 1% of total can become zero, so it is not error continue; diff --git a/mantis/node/src/mantis/blackbox/mod.rs b/mantis/node/src/mantis/blackbox/mod.rs index 756ec97..e69dd2d 100644 --- a/mantis/node/src/mantis/blackbox/mod.rs +++ b/mantis/node/src/mantis/blackbox/mod.rs @@ -4,7 +4,7 @@ use bounded_collections::Get; use cvm_runtime::{ outpost::GetConfigResponse, shared::{CvmFundsFilter, CvmInstruction, CvmProgram}, - Amount, + Amount, AssetId, }; use cw_mantis_order::{CrossChainPart, OrderItem, SolutionSubMsg}; @@ -43,15 +43,12 @@ fn build_next( } fn new_spawn( - spawn: &Spawn, + spawn: &SpawnStrStr, program: CvmProgram, glt: &GetConfigResponse, salt: &[u8], ) -> CvmInstruction { - let in_asset_id = match spawn.in_asset_id.as_ref().expect("in_asset_id") { - InAssetId::Variant1(id) => id.parse().expect("in_asset_id"), - _ => panic!("in_asset_id"), - }; + let in_asset_id = AssetId(spawn.in_asset_id.parse().expect("in_asset_id")); let in_amount: Amount = match spawn.in_asset_amount.as_ref().expect("in_asset_amount") { InAssetAmount::Variant0(x) => (*x).try_into().expect("in_asset_amount"), @@ -80,7 +77,7 @@ fn new_spawn( } } -fn new_exchange(exchange: &Exchange) -> CvmInstruction { +fn new_exchange(exchange: &ExchangeStrStr) -> CvmInstruction { let exchange_id = match &exchange.pool_id { PoolId::Variant1(id) => id.parse().expect("pool id"), _ => panic!("exchange_id"),