-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: candid generator + agent crates (#2)
- Loading branch information
Showing
32 changed files
with
3,496 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "dscvr-candid-generator" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
candid.workspace = true | ||
convert_case.workspace = true | ||
prettyplease = "0.2" | ||
quote = "1.0" | ||
syn = { version = "2.0", features = ["full"] } | ||
tracing.workspace = true | ||
|
||
instrumented-error = { path = "../instrumented-error" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//! Generates clients that are complementary to those provided | ||
//! by didc (https://github.com/dfinity/candid/tree/master/tools/didc) | ||
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"); | ||
} | ||
} |
Oops, something went wrong.