From 72ec1abee8daf7fa1e269c6212766f24f1c459e5 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Tue, 24 Dec 2024 22:45:33 -0700 Subject: [PATCH] feat: merge main get cli building --- Cargo.lock | 1 + cli/Cargo.toml | 1 + cli/src/deploy/tangle.rs | 10 ++++++++-- cli/src/main.rs | 7 ++++--- crates/crypto/bls/src/w3f_bls.rs | 6 +++--- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 67a92a6..7f59e5e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2599,6 +2599,7 @@ dependencies = [ "clap-cargo", "color-eyre", "escargot", + "gadget-blueprint-proc-macro-core", "gadget-clients", "gadget-crypto", "gadget-crypto-core", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index c5e7dc7..1955c3d 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -52,6 +52,7 @@ hex = { workspace = true, default-features = true } thiserror = { workspace = true, default-features = true } # Gadget dependencies +gadget-blueprint-proc-macro-core = { workspace = true, default-features = true } gadget-std = { workspace = true, default-features = true } gadget-logging = { workspace = true, default-features = true } gadget-utils-tangle = { workspace = true, default-features = true } diff --git a/cli/src/deploy/tangle.rs b/cli/src/deploy/tangle.rs index db90e8c..dd83d09 100644 --- a/cli/src/deploy/tangle.rs +++ b/cli/src/deploy/tangle.rs @@ -75,9 +75,15 @@ pub async fn generate_service_blueprint, T: AsRef>( let package = find_package(&metadata, pkg_name)?.clone(); let package_clone = &package.clone(); - let mut blueprint = load_blueprint_metadata(&package)?; + let blueprint = load_blueprint_metadata(&package)?; build_contracts_if_needed(package_clone, &blueprint).context("Building contracts")?; - deploy_contracts_to_tangle(rpc_url.as_ref(), package_clone, &mut blueprint, signer_evm).await?; + deploy_contracts_to_tangle( + rpc_url.as_ref(), + package_clone, + &mut blueprint.clone(), + signer_evm, + ) + .await?; bake_blueprint(blueprint) } diff --git a/cli/src/main.rs b/cli/src/main.rs index 0bb6a1c..00fb3df 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1,9 +1,10 @@ use std::path::PathBuf; +use crate::deploy::tangle::{deploy_to_tangle, Opts}; use cargo_tangle::create::BlueprintType; use cargo_tangle::{create, deploy, keys}; use clap::{Parser, Subcommand}; -use keys::KeyType; +use gadget_crypto::KeyTypeId; /// Tangle CLI tool #[derive(Parser, Debug)] @@ -75,7 +76,7 @@ pub enum GadgetCommands { Keygen { /// The type of key to generate #[arg(short, long, value_enum)] - key_type: KeyType, + key_type: KeyTypeId, /// The path to save the key to, if not provided, the key will be printed /// to the console instead @@ -131,7 +132,7 @@ async fn main() -> color_eyre::Result<()> { .manifest .manifest_path .unwrap_or_else(|| PathBuf::from("Cargo.toml")); - let _ = deploy::deploy_to_tangle(deploy::Opts { + let _ = deploy_to_tangle(Opts { http_rpc_url, ws_rpc_url, manifest_path, diff --git a/crates/crypto/bls/src/w3f_bls.rs b/crates/crypto/bls/src/w3f_bls.rs index 963dcb6..b45080e 100644 --- a/crates/crypto/bls/src/w3f_bls.rs +++ b/crates/crypto/bls/src/w3f_bls.rs @@ -73,9 +73,9 @@ macro_rules! define_bls_key { /// key type pub struct []; - super::impl_w3f_serde!([], PublicKey<[]>); - super::impl_w3f_serde!([], SecretKey<[]>); - super::impl_w3f_serde!([], Signature<[]>); + impl_w3f_serde!([], PublicKey<[]>); + impl_w3f_serde!([], SecretKey<[]>); + impl_w3f_serde!([], Signature<[]>); impl KeyType for [] { type Public = [];