Skip to content

Commit

Permalink
ohoho
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Apr 10, 2024
1 parent 8d3584b commit 4f59d9c
Show file tree
Hide file tree
Showing 12 changed files with 2,595,384 additions and 13 deletions.
5 changes: 4 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ hex = { version = "^0.4.3", default-features = false }
enumn = { version = "0.1.13", default-features = false }
prost-build = { version = "^0.12.2" }
bech32 = { version = "^0.9.0", default-features = false }
cosmwasm-std = { version = "^1.5.0", features = [
cosmwasm-std = { version = "1.5.0", features = [
"iterator",
], default-features = false }

Expand All @@ -79,7 +79,7 @@ cw20 = { version = "^1.1.2", default-features = false }
cw-controllers = { version = "^1.1.1", default-features = false }
sylvia = { version = "^0.9.1", default-features = false }
schemars = { version = "^0.8.16", default-features = false }
cosmwasm-schema = { version = "^1.5.0", default-features = false }
cosmwasm-schema = { version = "1.5.0", default-features = false }
serde = { version = "1.0.192", default-features = false }
cw-storage-plus = { version = "^1.2.0", features = [
"iterator",
Expand All @@ -88,7 +88,7 @@ itertools = { version = "0.12.0", default-features = false }
cw-multi-test = {version = "^1.0.0", default-features = false}

num-integer = { version = "0.1.45", default-features = false }
num-rational = {git = "https://github.com/dzmitry-lahoda-forks/num-rational.git", rev = "719b4dbe0afd69b98f5875e3bdf936b9df822522", default-features = false}
num-rational = {git = "https://github.com/dzmitry-lahoda-forks/num-rational.git", rev = "b7350e2f4c64f8f7a468d5321e95f8f523867c66", default-features = false}
num-traits = { version = "^0.2.18", default-features = false }


Expand All @@ -111,7 +111,7 @@ rand = { version = "^0.8.5", default-features = false }
rust_decimal = {version = "1.33", default-features = false}
rust_decimal_macros = {version = "1.33", default-features = false}
rand_distr = "^0.4.3"
strum = "^0.25"
strum = {version = "^0.25", default-features = false, features = ["derive"]}
strum_macros = "^0.25"
tuples = { version = "^1.14.0" }
serde-cw-value = { git = "https://github.com/dzmitry-lahoda-forks/serde-cw-value.git", branch = "dz/3", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions contracts/cosmwasm/executor/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ pub fn instantiate(
msg: cvm_runtime::executor::InstantiateMsg,
) -> Result {
set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;
let gateway_address =
let outpost_address =
cvm_runtime::outpost::Outpost::addr_validate(deps.api, &msg.outpost_address)?;
let config = Config {
outpost_address: gateway_address,
outpost_address,
executor_origin: msg.executor_origin,
};
CONFIG.save(deps.storage, &config)?;
Expand Down
10 changes: 8 additions & 2 deletions contracts/cosmwasm/order/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ num-rational = { workspace = true, default-features = false, features = [


[features]
std = ["cvm-runtime/std", "num-rational/std",]
json-schema = ["cvm-runtime/json-schema", "dep:schemars", "num-rational/json-schema"]
std = [
"cvm-runtime/std",
"num-rational/std",
]
json-schema = [
"cvm-runtime/json-schema", "dep:schemars",
"num-rational/json-schema"
]

2 changes: 1 addition & 1 deletion contracts/cosmwasm/order/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use cosmwasm_std::{ensure, BankMsg, Event, StdResult};
use cvm_runtime::{outpost::ExecuteProgramMsg, AssetId};
use mantis_cw::{DenomPair, OrderSide};

pub type Ratio = num_rational::Ratio<u64>;
pub type Ratio = (u64, u64); // num_rational::Ratio<u64>;

use crate::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion crates/cvm-runtime/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::ExecutorOrigin;
)]
#[serde(rename_all = "snake_case")]
pub struct InstantiateMsg {
/// Address of the gateway.
/// Address of the CVM outpost.
pub outpost_address: String,
/// The executor origin.
pub executor_origin: ExecutorOrigin,
Expand Down
Empty file added expanded.rs
Empty file.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@
pkgs.zlib.out
rust.cargo
rust.rustc
pkgs.rustfilt
pkgs.cargo-expand # TODO: assert no f32/f64 in contracts cargo expand --target=wasm32-unknown-unknown --package=cw-cvm-outpost > expanded.rs
pkgs.wabt # TODO: val contract no f32/f64 wasm2wat ../../target/wasm32-unknown-unknown/release/cw1_whitelist_ng.wasm > ./ng.wat
# pkgs.vscode-extensions.yzhang.markdown-all-in-one
Expand Down
2 changes: 1 addition & 1 deletion mantis/node/src/bin/mantis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ async fn solve(
pair_solution.cows,
cvm_program,
tip,
pair_solution.optimal_price,
pair_solution.optimal_price.into(),
signing_key,
order_contract,
rpc,
Expand Down
2 changes: 1 addition & 1 deletion mantis/node/src/mantis/solve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl IntentBankInput {
.expect("order")
.clone();
order
.fill(cow.cow_out_amount, optimal_ratio)
.fill(cow.cow_out_amount, optimal_ratio.into())
.expect("off chain");
pair.add(&order.given);

Expand Down
Loading

0 comments on commit 4f59d9c

Please sign in to comment.