Skip to content

Commit

Permalink
chore: fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
drewstone committed Nov 5, 2024
1 parent 679ef9b commit b6c61f8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions blueprints/example-blueprint/src/examples/raw_tangle_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,6 @@ use gadget_sdk::tangle_subxt::tangle_testnet_runtime::api;
#[derive(Clone)]
pub struct MyContext;

#[job(
id = 0,
event_listener(
listener = TangleEventListener<MyContext>,
),
)]
pub fn raw(event: TangleEvent<MyContext>, context: MyContext) -> Result<u64, gadget_sdk::Error> {
if let Some(balance_transfer) = event
.evt
.as_event::<api::balances::events::Transfer>()
.ok()
.flatten()
{
gadget_sdk::info!("Found a balance transfer: {balance_transfer:?}");
}
Ok(0)
}

pub async fn constructor(
env: StdGadgetConfiguration,
) -> color_eyre::Result<impl InitializableEventHandler> {
Expand All @@ -43,3 +25,21 @@ pub async fn constructor(
signer,
})
}

#[job(
id = 0,
event_listener(
listener = TangleEventListener<MyContext>,
),
)]
pub fn raw(event: TangleEvent<MyContext>, context: MyContext) -> Result<u64, gadget_sdk::Error> {
if let Some(balance_transfer) = event
.evt
.as_event::<api::balances::events::Transfer>()
.ok()
.flatten()
{
gadget_sdk::info!("Found a balance transfer: {balance_transfer:?}");
}
Ok(0)
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub async fn xsquare_eigen(
numberSquared: number_to_be_squared.saturating_pow(U256::from(2u32)),
};

let bls_key_pair = match ctx.keystore().and_then(|ks| Ok(ks.bls_bn254_key())) {
let bls_key_pair = match ctx.keystore().map(|ks| ks.bls_bn254_key()) {
Ok(kp) => match kp {
Ok(k) => k,
Err(e) => return Ok(0),
Expand Down

0 comments on commit b6c61f8

Please sign in to comment.