Skip to content

Commit

Permalink
chore: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
drewstone committed Nov 5, 2024
2 parents b6c61f8 + eacf856 commit 781960d
Show file tree
Hide file tree
Showing 29 changed files with 1,690 additions and 124 deletions.
39 changes: 32 additions & 7 deletions Cargo.lock

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

20 changes: 14 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[workspace]
resolver = "2"
members = [
"blueprint-build-utils",
"blueprint-metadata",
"blueprints/incredible-squaring",
"blueprints/incredible-squaring-eigenlayer",
Expand All @@ -10,6 +11,7 @@ members = [
"gadget-io",
"blueprint-test-utils",
"blueprint-manager",
"blueprint-serde",
"sdk",
"macros/blueprint-proc-macro",
"macros/blueprint-proc-macro-core",
Expand All @@ -35,29 +37,33 @@ unused_import_braces = "deny"
pedantic = { level = "deny", priority = -1 }
all = { level = "deny", priority = -1 }
single_match_else = "allow"
uninlined_format_args = "allow"
needless_late_init = "allow"

[workspace.lints.rustdoc]
broken_intra_doc_links = "deny"

[workspace.dependencies]
gadget-io = { version = "0.0.4", path = "./gadget-io", default-features = false }
gadget-io = { version = "0.0.5", path = "./gadget-io", default-features = false }
blueprint-manager = { version = "0.1.1", path = "./blueprint-manager" }
blueprint-serde = { version = "0.1.0", path = "./blueprint-serde", package = "gadget-blueprint-serde" }
blueprint-test-utils = { path = "./blueprint-test-utils" }
gadget-sdk = { path = "./sdk", default-features = false, version = "0.2.3" }
gadget-sdk = { path = "./sdk", default-features = false, version = "0.3.0" }

incredible-squaring-blueprint = { path = "./blueprints/incredible-squaring", default-features = false, version = "0.1.1" }
incredible-squaring-blueprint-eigenlayer = { path = "./blueprints/incredible-squaring-eigenlayer", default-features = false, version = "0.1.1" }
incredible-squaring-blueprint-symbiotic = { path = "./blueprints/incredible-squaring-symbiotic", default-features = false, version = "0.1.1" }
example-blueprint = { path = "./blueprints/example-blueprint", default-features = false, version = "0.1.1" }
gadget-blueprint-proc-macro = { path = "./macros/blueprint-proc-macro", default-features = false, version = "0.2.3" }
gadget-blueprint-proc-macro = { path = "./macros/blueprint-proc-macro", default-features = false, version = "0.3.0" }
gadget-blueprint-proc-macro-core = { path = "./macros/blueprint-proc-macro-core", default-features = false, version = "0.1.5" }
gadget-context-derive = { path = "./macros/context-derive", default-features = false, version = "0.1.3" }
gadget-context-derive = { path = "./macros/context-derive", default-features = false, version = "0.2.0" }
blueprint-build-utils = { path = "./blueprint-build-utils", default-features = false, version = "0.1.0" }
blueprint-metadata = { path = "./blueprint-metadata", default-features = false, version = "0.1.6" }
cargo-tangle = { path = "./cli", version = "0.2.1" }
cargo-tangle = { path = "./cli", version = "0.2.2" }
cargo_metadata = { version = "0.18.1" }

# Tangle-related dependencies
tangle-subxt = { version = "0.4.0", default-features = false }
tangle-subxt = { version = "0.5.0", default-features = false }
subxt-signer = { version = "0.37.0", default-features = false }
subxt = { version = "0.37.0", default-features = false }
subxt-core = { version = "0.37.0", default-features = false }
Expand Down Expand Up @@ -113,6 +119,7 @@ multiaddr = { version = "0.18.1", default-features = false }
nix = { version = "0.29.0", features = ["process", "signal"] }
num-bigint = "0.4.6"
parking_lot = "0.12.3"
paste = "1.0.15"
proc-macro2 = "1.0"
prometheus = { version = "0.13.4", default-features = false }
quote = "1.0"
Expand All @@ -122,6 +129,7 @@ rustdoc-types = "0.31.0"
schnorrkel = { version = "0.11.4", default-features = false, features = ["preaudit_deprecated", "getrandom"] }
serde = { version = "1.0.208", default-features = false }
serde_json = "1.0"
serde_test = "1.0.177"
sha2 = "0.10.8"
sqlx = "=0.7.3"
syn = "2.0.75"
Expand Down
15 changes: 15 additions & 0 deletions blueprint-build-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "blueprint-build-utils"
version = "0.1.0"
description = "Tangle Blueprint build utils"
authors.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
publish = false

[dependencies]

[lints]
workspace = true
61 changes: 61 additions & 0 deletions blueprint-build-utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
use std::env;
use std::path::PathBuf;
use std::process::Command;

/// Build the Smart contracts at the specified directories, automatically rerunning if changes are
/// detected in this crates Smart Contracts (`./contracts/lib`).
///
/// # Panics
/// - If the Cargo Manifest directory is not found.
/// - If the `forge` executable is not found.
pub fn build_contracts(contract_dirs: Vec<&str>) {
println!("cargo::rerun-if-changed=contracts/lib/*");
println!("cargo::rerun-if-changed=contracts/src/*");

// Get the project root directory
let root = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());

// Try to find the `forge` executable dynamically
let forge_executable = match Command::new("which").arg("forge").output() {
Ok(output) => {
let path = String::from_utf8_lossy(&output.stdout).trim().to_string();
assert!(
!path.is_empty(),
"Forge executable not found. Make sure Foundry is installed."
);
path
}
Err(e) => panic!("Failed to find `forge` executable: {e}"),
};

for dir in contract_dirs {
let full_path = root.join(dir).canonicalize().unwrap_or_else(|_| {
println!(
"Directory not found or inaccessible: {}",
root.join(dir).display()
);
root.join(dir)
});

if full_path.exists() {
println!("cargo:rerun-if-changed={}", full_path.display());

let status = Command::new(&forge_executable)
.current_dir(&full_path)
.arg("build")
.status()
.expect("Failed to execute Forge build");

assert!(
status.success(),
"Forge build failed for directory: {}",
full_path.display()
);
} else {
println!(
"Directory not found or does not exist: {}",
full_path.display()
);
}
}
}
18 changes: 18 additions & 0 deletions blueprint-serde/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.0](https://github.com/tangle-network/gadget/releases/tag/gadget-blueprint-serde-v0.1.0) - 2024-11-05

### Added

- `blueprint-serde` crate ([#429](https://github.com/tangle-network/gadget/pull/429))

### Other

- add description to crates ([#444](https://github.com/tangle-network/gadget/pull/444))
24 changes: 24 additions & 0 deletions blueprint-serde/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "gadget-blueprint-serde"
version = "0.1.0"
description = "Tangle Blueprints serde integration"
authors.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true

[dependencies]
paste.workspace = true
serde.workspace = true
tangle-subxt.workspace = true

[dev-dependencies]
serde_test.workspace = true

[lints]
workspace = true

[features]
default = ["std"]
std = []
Loading

0 comments on commit 781960d

Please sign in to comment.