Skip to content

Commit

Permalink
fix: get macro tests building
Browse files Browse the repository at this point in the history
  • Loading branch information
Serial-ATA committed Jan 22, 2025
1 parent a6a738c commit 98423f1
Show file tree
Hide file tree
Showing 20 changed files with 39 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

6 changes: 3 additions & 3 deletions crates/keystore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ alloy-signer = { workspace = true, optional = true }
alloy-signer-local = { workspace = true, optional = true, features = ["mnemonic"] }

# Substrate dependencies (optional)
sp-core = { workspace = true }
sp-core = { workspace = true, optional = true }
sp-io = { workspace = true, optional = true }
subxt = { workspace = true, features = ["substrate-compat"], optional = true }
subxt-core = { workspace = true, optional = true }
Expand Down Expand Up @@ -92,7 +92,7 @@ std = [
"rust-bls-bn254?/std",
# Conditional std enables for protocols
"alloy-primitives?/std",
"sp-core/std",
"sp-core?/std",
"sp-io?/std",
"subxt-core?/std",
"subxt?/native",
Expand All @@ -105,7 +105,7 @@ sr25519-schnorrkel = ["schnorrkel", "hex", "gadget-crypto/sr25519-schnorrkel"]
zebra = ["ed25519-zebra", "hex", "gadget-crypto/ed25519"]
bls = ["w3f-bls", "hex", "gadget-crypto/bls"]
bn254 = ["ark-bn254", "ark-ec", "ark-ff", "ark-serialize", "gadget-crypto/bn254"]
sp-core = ["gadget-crypto/sp-core"]
sp-core = ["dep:sp-core", "gadget-crypto/sp-core"]

# Meant to be used in conjunction with `tangle` feature (for `sp-core`)
substrate = ["paste", "sp-core", "sp-io", "subxt", "subxt-core", "tangle-subxt", "gadget-crypto/sp-core"]
Expand Down
2 changes: 1 addition & 1 deletion crates/macros/blueprint-proc-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ serde_json = { workspace = true, features = ["alloc"] }
indexmap = { workspace = true }

[dev-dependencies]
blueprint-sdk = { workspace = true, features = ["std", "macros", "evm", "tangle", "eigenlayer", "testing"] }
gadget-event-listeners = { workspace = true, features = ["testing"] }
gadget-macros = { workspace = true, features = ["std", "tangle", "evm"] }

trybuild = { workspace = true }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use gadget_blueprint_proc_macro::job;
use blueprint_sdk::macros::job;

#[job(id = 0, params(n t), result(Vec<u8>))]
fn keygen(n: u16, t: u8) -> Vec<u8> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use gadget_blueprint_proc_macro::job;
use blueprint_sdk::macros::job;

#[job(id = 0, params(n), result(Vec<u8> String))]
fn keygen(n: u16) -> (Vec<u8>, String) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use gadget_blueprint_proc_macro::job;
use blueprint_sdk::macros::job;

#[job(id = 0, params(n, t), event_listener(listener = null), result(Vec<u8>))]
fn keygen(n: u16, vec: Vec<u8>) -> Result<Vec<u8>, String> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use gadget_blueprint_proc_macro::job;
use blueprint_sdk::macros::job;

#[job(params(n), result(Vec<u8>))]
fn keygen(n: u16) -> Vec<u8> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::EmptyContext;
use gadget_blueprint_proc_macro::job;
use gadget_event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::macros::job;

#[job(id = 0, event_listener(listener = PendingEventListener<u16, EmptyContext>), result(_))]
#[allow(clippy::unused_unit)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::EmptyContext;
use gadget_blueprint_proc_macro::job;
use gadget_event_listeners::core::testing::PendingEventListener;
use gadget_std::convert::Infallible;
use blueprint_sdk::event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::macros::job;
use blueprint_sdk::std::convert::Infallible;

#[job(id = 0, event_listener(listener = PendingEventListener<u16, EmptyContext>), result(Vec<u8>, String))]
fn keygen(ctx: EmptyContext, n: u16) -> Result<(Vec<u8>, String), Infallible> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::EmptyContext;
use gadget_blueprint_proc_macro::job;
use gadget_event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::macros::job;

pub struct TestReturnType;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::EmptyContext;
use gadget_blueprint_proc_macro::job;
use gadget_event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::macros::job;

#[job(id = 0, event_listener(listener = PendingEventListener<u16, EmptyContext>), result(_))]
#[allow(clippy::unused_unit)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::EmptyContext;
use gadget_blueprint_proc_macro::job;
use gadget_event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::macros::job;

#[job(id = 0, event_listener(listener = PendingEventListener<u16, EmptyContext>), result(_))]
fn keygen(ctx: EmptyContext, n: u16) {}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::EmptyContext;
use gadget_blueprint_proc_macro::job;
use gadget_event_listeners::core::testing::PendingEventListener;
use gadget_std::convert::Infallible;
use blueprint_sdk::event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::macros::job;
use blueprint_sdk::std::convert::Infallible;

#[job(id = 0, event_listener(listener = PendingEventListener<u16, EmptyContext>))]
fn keygen(ctx: EmptyContext, n: u16) -> Result<Vec<u8>, Infallible> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::EmptyContext;
use gadget_blueprint_proc_macro::job;
use gadget_event_listeners::core::testing::PendingEventListener;
use gadget_std::convert::Infallible;
use blueprint_sdk::event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::macros::job;
use blueprint_sdk::std::convert::Infallible;

#[job(id = 0, event_listener(listener = PendingEventListener<(u16, String), EmptyContext>))]
fn keygen(ctx: EmptyContext, args: (u16, String)) -> Result<Vec<u8>, Infallible> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::EmptyContext;
use gadget_blueprint_proc_macro::job;
use gadget_event_listeners::core::testing::PendingEventListener;
use gadget_std::convert::Infallible;
use blueprint_sdk::event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::macros::job;
use blueprint_sdk::std::convert::Infallible;

#[job(id = 0, event_listener(listener = PendingEventListener<(u16, u8), EmptyContext>), result(Vec<u8>))]
fn keygen(ctx: EmptyContext, args: (u16, u8)) -> Result<Vec<u8>, Infallible> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::EmptyContext;
use gadget_blueprint_proc_macro::job;
use gadget_event_listeners::core::testing::PendingEventListener;
use gadget_std::convert::Infallible;
use blueprint_sdk::event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::macros::job;
use blueprint_sdk::std::convert::Infallible;

#[job(id = 0, event_listener(listener = PendingEventListener<u16, EmptyContext>), result(Vec<u8>, String))]
fn keygen(ctx: EmptyContext, n: u16) -> Result<(Vec<u8>, String), Infallible> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::EmptyContext;
use gadget_blueprint_proc_macro::job;
use gadget_event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::macros::job;

#[job(id = 0, event_listener(listener = PendingEventListener<u16, EmptyContext>), result(Vec<u8>))]
fn keygen(ctx: EmptyContext, n: u16) -> Vec<u8> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::EmptyContext;
use gadget_blueprint_proc_macro::job;
use gadget_event_listeners::core::testing::PendingEventListener;
use gadget_std::convert::Infallible;
use blueprint_sdk::event_listeners::core::testing::PendingEventListener;
use blueprint_sdk::macros::job;
use blueprint_sdk::std::convert::Infallible;

/// A simple job that generates a key of length `n`
#[job(id = 0, event_listener(listener = PendingEventListener<u16, EmptyContext>), result(Vec<u8>))]
Expand Down
1 change: 1 addition & 0 deletions crates/sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ networking = [
"gadget-clients/networking",
"gadget-keystore/std",
"gadget-config/networking",
"gadget-macros?/networking",
]

p2p = ["gadget-context-derive/networking"]
Expand Down
2 changes: 1 addition & 1 deletion crates/sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ pub use gadget_utils as utils;
pub use gadget_config as config;
pub use gadget_keystore as keystore;
pub use gadget_std as std;
pub use serde;
pub use tokio;
pub use serde;

#[cfg(feature = "local-store")]
pub use gadget_stores as stores;

0 comments on commit 98423f1

Please sign in to comment.