Skip to content

Commit

Permalink
fixing astroport
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Nov 29, 2023
1 parent b125362 commit 2cd39a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions contracts/cosmwasm/executor/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use cosmwasm_std::entry_point;
use cosmwasm_std::{
ensure, ensure_eq, to_json_binary, wasm_execute, Addr, BankMsg, Binary, Coin, CosmosMsg, Deps,
DepsMut, Env, MessageInfo, QueryRequest, Reply, Response, StdError, StdResult, SubMsg,
SubMsgResult, WasmQuery, WasmMsg, to_binary,
SubMsgResult, WasmQuery, WasmMsg,
};
use cvm_runtime::{
apply_bindings,
Expand Down Expand Up @@ -298,7 +298,7 @@ fn interpret_exchange(
.add_submessage(msg)
}
AstroportRouterContract {
pool_id,
address,
token_a,
token_b,
} => {
Expand All @@ -324,8 +324,8 @@ fn interpret_exchange(
max_spread,
};
let msg = CosmosMsg::Wasm(WasmMsg::Execute {
contract_addr: pool_id.to_string(),
msg: to_binary(&msg)?,
contract_addr: address.to_string(),
msg: to_json_binary(&msg)?,
funds: vec![give.try_into().expect("coin")],
});
let msg = SubMsg::reply_always(msg, EXCHANGE_ID);
Expand Down
2 changes: 1 addition & 1 deletion crates/cvm-runtime/src/proto/cvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ super::define_conversion! {
use pb::program::binding_value::Type;
Ok(match binding_value.r#type.non_empty()? {
Type::Register(reg) => {
let reg = pb::program::Register::from_i32(reg).ok_or(())?;
let reg = pb::program::Register::try_from(reg).map_err(|_| ())?;
Self::Register(reg.into())
},
Type::AssetId(asset_id) => Self::Asset(asset_id.into()),
Expand Down
2 changes: 1 addition & 1 deletion crates/cvm-runtime/src/service/dex/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub enum ExchangeType {
},
#[cfg(feature = "cosmwasm")]
AstroportRouterContract {
pool_id: u64,
address: Addr,
token_a: String,
token_b: String,
},
Expand Down

0 comments on commit 2cd39a8

Please sign in to comment.