Skip to content

Commit

Permalink
feat: merge main get cli building
Browse files Browse the repository at this point in the history
  • Loading branch information
drewstone committed Dec 25, 2024
1 parent 474b2dc commit 72ec1ab
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
10 changes: 8 additions & 2 deletions cli/src/deploy/tangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,15 @@ pub async fn generate_service_blueprint<P: Into<PathBuf>, T: AsRef<str>>(

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)
}

Expand Down
7 changes: 4 additions & 3 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions crates/crypto/bls/src/w3f_bls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ macro_rules! define_bls_key {
/// key type
pub struct [<W3f $ty>];

super::impl_w3f_serde!([<W3f $ty Public>], PublicKey<[<Tiny $ty:upper>]>);
super::impl_w3f_serde!([<W3f $ty Secret>], SecretKey<[<Tiny $ty:upper>]>);
super::impl_w3f_serde!([<W3f $ty Signature>], Signature<[<Tiny $ty:upper>]>);
impl_w3f_serde!([<W3f $ty Public>], PublicKey<[<Tiny $ty:upper>]>);
impl_w3f_serde!([<W3f $ty Secret>], SecretKey<[<Tiny $ty:upper>]>);
impl_w3f_serde!([<W3f $ty Signature>], Signature<[<Tiny $ty:upper>]>);

impl KeyType for [<W3f $ty>] {
type Public = [<W3f $ty Public>];
Expand Down

0 comments on commit 72ec1ab

Please sign in to comment.