Skip to content

Commit

Permalink
fix(tari-generate): fix some small bugs (#1042)
Browse files Browse the repository at this point in the history
Some small fixes to make this work
  • Loading branch information
stringhandler authored May 31, 2024
1 parent 029f502 commit 20a2a5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions applications/tari_generate/src/generators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ impl FromStr for GeneratorType {

fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"rust" => Ok(GeneratorType::RustTemplateCli),
"rust-template-cli" => Ok(GeneratorType::RustTemplateCli),
_ => Err(anyhow::anyhow!("Invalid generator type")),
}
Expand Down
5 changes: 4 additions & 1 deletion applications/tari_generate/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,16 +310,19 @@ async fn scaffold(args: ScaffoldArgs) -> anyhow::Result<()> {
let request = json!({
"jsonrpc" : "2.0",
"method": "get_template",
"params": [hex::decode(args.template_address)?],
//"params": [hex::decode(args.template_address)?],
"params": [args.template_address],
"id": 1
});

let response = reqwest::Client::new()
.post(jrpc_url)
.json(&request)
.header(reqwest::header::CONTENT_TYPE, "application/json")
.send()
.await?;
let response = response.json::<Value>().await?;
dbg!(&response);
let name: &str = response["result"]["registration_metadata"]["name"]
.as_str()
.unwrap_or("unnamed.wasm");
Expand Down

0 comments on commit 20a2a5d

Please sign in to comment.