Skip to content

Commit

Permalink
fix: missing metamagic changes (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncpenke authored Mar 7, 2024
1 parent 9282e72 commit 4207ce4
Show file tree
Hide file tree
Showing 10 changed files with 546 additions and 30 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ jobs:
build:
runs-on:
group: rust-heavy
container: dscvrdocker/be-edge-base-builder
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_VERSION }}
- uses: jwlawson/[email protected]
- name: Run
run: ./build-scripts/build_and_test.sh
env:
Expand Down
13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ members = [
"crates/ic-canister-logger",
"crates/ic-canister-stable-storage",
"crates/ic-identity-util",
"crates/ic-ingress-validator-util",
"crates/ic-rc-principal",
"crates/instrumented-error",
]
Expand All @@ -22,12 +23,12 @@ async-std = "1.12.0"
async-trait = "0.1"
# Note: Need to leave ring at 0.16 for compatibility with ic-agent
bincode = "1.3"
candid = { git = "https://github.com/dscvr-one/candid.git", rev = "65d73d6", features = [
candid = { git = "https://github.com/dscvr-one/candid.git", rev = "0.9.3-3", features = [
"parser",
"deepsize",
] }
convert_case = "0.1"
deepsize = { git = "https://github.com/dscvr-one/deepsize.git", rev = "822ba27", features = [
"candid",
convert_case = "0.6"
deepsize = { git = "https://github.com/dscvr-one/deepsize.git", rev = "0.2.0-candid-0.9.3-2", features = [
"serde_bytes",
"derive",
"std",
Expand All @@ -37,7 +38,7 @@ enum-iterator = "1.2.0"
flate2 = "1.0"
futures = "0.3.25"
ic-agent = { version = "0.25.0", features = ["pem"] }
ic-cdk = "0.11"
ic-cdk = "0.10"
lazy_static = "1.4"
num-traits = "0.2.15"
ring = "0.16"
Expand All @@ -56,4 +57,4 @@ tracing-stackdriver = "0.8"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[patch.crates-io]
candid = { git = "https://github.com/dscvr-one/candid.git", rev = "65d73d6" }
candid = { git = "https://github.com/dscvr-one/candid.git", rev = "0.9.3-3" }
18 changes: 0 additions & 18 deletions crates/dscvr-candid-generator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,3 @@
pub mod rust_canister_agent;
pub mod util;

#[cfg(test)]
mod test {
use super::*;
use std::path::Path;
const DID: &str = "../../canisters/society_rs/society-common.did";
#[test]
#[ignore]
fn test_generate() {
let output_dir: std::path::PathBuf = Path::new("src").join("gen");
std::fs::create_dir_all("src/gen").unwrap();
let _ = rust_canister_agent::generate(
Path::new(DID),
&output_dir.join("dscvr_tx_log_agent.rs"),
)
.expect("Something good to happen");
}
}
7 changes: 6 additions & 1 deletion crates/dscvr-canister-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ futures.workspace = true
garcon = "0.2.3"
hex = "0.4"
ic-agent.workspace = true
ic-test-state-machine-client = "3.0"
serde_bytes.workspace = true
serde.workspace = true
thiserror.workspace = true
Expand All @@ -32,4 +31,10 @@ dscvr-canister-exports = { path = "../dscvr-canister-exports" }
dscvr-interface = { path = "../dscvr-interface" }
ic-canister-stable-storage = { path = "../ic-canister-stable-storage" }
ic-identity-util = { path = "../ic-identity-util" }
ic-test-state-machine-client = "=3.0.0"
instrumented-error = { path = "../instrumented-error" }

[build-dependencies]

dscvr-candid-generator = { path = "../dscvr-candid-generator" }
dscvr-tracing-util = { path = "../dscvr-tracing-util" }
12 changes: 12 additions & 0 deletions crates/dscvr-canister-agent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ impl CanisterAgent {
}
}

pub async fn new_replica(
caller: Arc<dyn Identity>,
replica: &str,
canister_id: &str,
) -> Result<Self> {
let agent = Self {
agent: agent_impl::replica_impl::new(caller, replica).await?,
canister_id: Principal::from_text(canister_id)?,
};
Ok(agent)
}

pub async fn clone_with_identity(&self, identity: Arc<dyn Identity>) -> Result<Self> {
Ok(Self {
agent: self.agent.clone_with_identity(identity).await?,
Expand Down
Loading

0 comments on commit 4207ce4

Please sign in to comment.