Skip to content

Commit

Permalink
fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Nov 28, 2023
1 parent ee44343 commit 9270c4e
Show file tree
Hide file tree
Showing 62 changed files with 4,484 additions and 4,030 deletions.
37 changes: 28 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ ibc-proto = { version = "^0.39.1", default-features = false }
serde-json-wasm = { version = "^1.0.0", default-features = false }

clap = { version = "^4.4.8", features = ["derive"] }
cosmrs = { version = "^0.15.0", features = ["cosmwasm", "rpc", "grpc", "bip32", "dev"] }
cosmrs = { version = "^0.15.0", features = [
"cosmwasm",
"rpc",
"grpc",
"bip32",
"dev",
] }
tokio = { version = "^1.34.0", features = ["full"] }
cosmos-sdk-proto = { version = "^0.20.0", features = ["grpc-transport"] }
tonic = { version = "^0.10.2" }
Expand All @@ -81,17 +87,30 @@ serde-cw-value = { git = "https://github.com/dzmitry-lahoda-forks/serde-cw-value
no-panic = "^0.1"
scale-info = { version = "^2.10.0", default-features = false }
prost = { version = "^0.12.3", default-features = false }
bip32 = { version = "^0.5.1", default-features = false, features = ["alloc", "secp256k1", "mnemonic", "bip39"] }
prost-types = { version = "^0.12.3", default-features = false }
bip32 = { version = "^0.5.1", default-features = false, features = [
"alloc",
"secp256k1",
"mnemonic",
"bip39",
] }
prost-types = { version = "^0.12.3", default-features = false }
sha2 = { version = "^0.10.8", default-features = false }
num-traits = { version = "^0.2.17", default-features = false }
thiserror = { version = "^1.0.50", default-features = false, package = "thiserror-core" }
xcm = { version = "^5.0.0", default-features = false, package = "staging-xcm" }
cw-utils = { version = "^1.0.3", default-features = false }
cw2 = { version = "^1.1.2", default-features = false }
ibc-apps-more= { git = "https://github.com/ComposableFi/ibc-apps-more-rs.git", branch = "main", default-features = false }
ibc-apps = { git = "https://github.com/dzmitry-lahoda-forks/ibc-rs.git", branch = "dz/14", default-features = false, features = ["serde"] }
ibc-core = { git = "https://github.com/dzmitry-lahoda-forks/ibc-rs.git", branch = "dz/14", default-features = false, features = ["serde"] }
ibc-primitives = { git = "https://github.com/dzmitry-lahoda-forks/ibc-rs.git", branch = "dz/14", default-features = false, features = ["serde"] }
primitive-types = { git= "https://github.com/dzmitry-lahoda-forks/parity-common.git", branch = "dz/3", default-features = false, features = ["serde_no_std"] }
neutron-sdk = { version = "^0.7.0", default-features = false }
ibc-apps-more = { git = "https://github.com/ComposableFi/ibc-apps-more-rs.git", branch = "main", default-features = false }
ibc-apps = { git = "https://github.com/dzmitry-lahoda-forks/ibc-rs.git", branch = "dz/14", default-features = false, features = [
"serde",
] }
ibc-core = { git = "https://github.com/dzmitry-lahoda-forks/ibc-rs.git", branch = "dz/14", default-features = false, features = [
"serde",
] }
ibc-primitives = { git = "https://github.com/dzmitry-lahoda-forks/ibc-rs.git", branch = "dz/14", default-features = false, features = [
"serde",
] }
primitive-types = { git = "https://github.com/dzmitry-lahoda-forks/parity-common.git", branch = "dz/3", default-features = false, features = [
"serde_no_std",
] }
neutron-sdk = { version = "^0.7.0", default-features = false }
11 changes: 9 additions & 2 deletions contracts/cosmwasm/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ crate-type = ["cdylib", "rlib"]
[features]
library = []
json-schema = ["ibc-apps-more/json-schema", "cvm-runtime/json-schema"]
std = ["cvm-runtime/std", "dep:cosmwasm-schema", "ibc-apps-more/std"]
std = [
"cvm-runtime/std",
"dep:cosmwasm-schema",
"ibc-apps-more/std",
"thiserror/std",
]
default = ["std"]

[dependencies]
Expand All @@ -32,4 +37,6 @@ prost = { workspace = true, features = ["prost-derive"] }
cvm-runtime = { path = "../../../crates/cvm-runtime", features = [
"cosmwasm",
], default-features = false }
ibc-apps-more= { workspace = true, default-features = false, features = ["cosmwasm"] }
ibc-apps-more = { workspace = true, default-features = false, features = [
"cosmwasm",
] }
14 changes: 7 additions & 7 deletions contracts/cosmwasm/executor/src/authenticate.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
error::{ContractError, Result},
state::OWNERS,
error::{ContractError, Result},
state::OWNERS,
};
use cosmwasm_std::{Addr, Deps};

Expand All @@ -12,9 +12,9 @@ pub struct Authenticated(());
/// interpreter.
/// Any operation executing against the interpreter must pass this check.
pub fn ensure_owner(deps: Deps, self_addr: &Addr, sender: Addr) -> Result<Authenticated> {
if sender == self_addr || OWNERS.has(deps.storage, sender) {
Ok(Authenticated(()))
} else {
Err(ContractError::NotAuthorized)
}
if sender == self_addr || OWNERS.has(deps.storage, sender) {
Ok(Authenticated(()))
} else {
Err(ContractError::NotAuthorized)
}
}
30 changes: 15 additions & 15 deletions contracts/cosmwasm/executor/src/bin/interpreter.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#[cfg(all(feature = "json-schema", not(target_arch = "wasm32")))]
#[allow(clippy::disallowed_methods)]
fn main() {
use cosmwasm_schema::write_api;
use cw_cvm_executor::msg::*;
use cosmwasm_schema::write_api;
use cw_cvm_executor::msg::*;

write_api! {
instantiate: InstantiateMsg,
query: QueryMsg,
execute: ExecuteMsg,
}
let events = schemars::gen::SchemaGenerator::default()
.into_root_schema_for::<cw_cvm_executor::events::CvmInterpreter>();
write_api! {
instantiate: InstantiateMsg,
query: QueryMsg,
execute: ExecuteMsg,
}
let events = schemars::gen::SchemaGenerator::default()
.into_root_schema_for::<cw_cvm_executor::events::CvmInterpreter>();

// same as in above macro
let mut out_dir = std::env::current_dir().unwrap();
out_dir.push("schema");
// same as in above macro
let mut out_dir = std::env::current_dir().unwrap();
out_dir.push("schema");

use ::std::fs::write;
use ::std::fs::write;

let path = out_dir.join(concat!("events", ".json"));
let path = out_dir.join(concat!("events", ".json"));

write(&path, serde_json_wasm::to_string(&events).unwrap()).unwrap();
write(&path, serde_json_wasm::to_string(&events).unwrap()).unwrap();
}

#[cfg(not(all(feature = "json-schema", not(target_arch = "wasm32"))))]
Expand Down
Loading

0 comments on commit 9270c4e

Please sign in to comment.