You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use gadget_sdk as sdk;use gadget_sdk::tangle_subxt::tangle_testnet_runtime::api;use std::convert::Infallible;use api::services::events::JobCalled;use sdk::event_listener::tangle::TangleEventListener;#[derive(Clone)]pubstructServiceContext{pubconfig: sdk::config::StdGadgetConfiguration,}/// Returns "Hello World!" if `who` is `None`, otherwise returns "Hello, {who}!"#[sdk::job(id = 0, params(who), result(_), event_listener(listener = TangleEventListener::<JobCalled,ServiceContext>))]pubfnsay_hello(who:Option<String>,context:ServiceContext) -> Result<String,Infallible>{match who {Some(who) => Ok(format!("Hello, {who}!")),None => Ok("Hello World!".to_string()),}}
And When I try to compile it, I get this error:
error[E0271]: expected `{async block@src/lib.rs:14:1: 14:121}` to be a future that resolves to `Result<TangleJobEvent<OnlineClient<PolkadotConfig>>, Error>`, but it resolves to `Result<TangleEvent<JobCalled, ServiceContext>, _>`
--> src/lib.rs:14:1
|
14 | #[sdk::job(id = 0, params(who), result(_), event_listener(listener = TangleEventListener::<JobCalled, ServiceContext>))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Result<TangleJobEvent<...>, ...>`, found `Result<TangleEvent<JobCalled, ...>, ...>`
|
= note: expected enum `Result<TangleJobEvent<OnlineClient<PolkadotConfig>>, gadget_sdk::Error>`
found enum `Result<gadget_sdk::event_listener::tangle::TangleEvent<gadget_sdk::tangle_subxt::tangle_testnet_runtime::api::services::events::JobCalled, ServiceContext>, _>`
note: required by a bound in `EventFlowWrapper::<Ctx, Event, PreProcessOut, JobOutput>::new`
--> /home/shady/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gadget-sdk-0.2.1/src/event_listener/executor.rs:129:24
|
120 | pub fn new<T, Pre, PreFut, Job, JobFut, Post, PostFut>(
| --- required by a bound in this associated function
...
129 | PreFut: Future<Output = Result<PreProcessOut, crate::Error>> + Send + 'static,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `EventFlowWrapper::<Ctx, Event, PreProcessOut, JobOutput>::new`
= note: this error originates in the attribute macro `sdk::job` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0271`.
error: could not compile `hello-blueprint` (lib) due to 1 previous error
My Cargo.toml deps
[dependencies]
tracing = "0.1"async-trait = "0.1"color-eyre = "0.6"structopt = "0.3.26"tokio = { version = "1.39", default-features = false, features = ["full"] }
tracing-subscriber = { version = "0.3", features = ["parking_lot", "env-filter"] }
[dependencies.gadget-sdk]
version = "0.2.1"default-features = falsefeatures = ["std", "getrandom"]
[build-dependencies]
blueprint-metadata = "0.1.5"
This seems to be something related to the recent PRs #363#359
The text was updated successfully, but these errors were encountered:
Here is my blueprint:
And When I try to compile it, I get this error:
My Cargo.toml deps
This seems to be something related to the recent PRs #363 #359
The text was updated successfully, but these errors were encountered: