From 3db7b05731dad38c79aae9caddb1c908334ca3f9 Mon Sep 17 00:00:00 2001 From: Matias Volpe Date: Tue, 4 Apr 2023 16:20:58 -0300 Subject: [PATCH] feat: use contract.filterContractEvents --- examples/ink/interact.eg.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/ink/interact.eg.ts b/examples/ink/interact.eg.ts index 78eac2c1c..70adc3b61 100644 --- a/examples/ink/interact.eg.ts +++ b/examples/ink/interact.eg.ts @@ -8,16 +8,12 @@ */ import { assertNotEquals } from "asserts" -import { alice, Rune } from "capi" +import { alice } from "capi" import { InkMetadataRune } from "capi/patterns/ink/mod.ts" import { signature } from "capi/patterns/signature/polkadot.ts" -import { chain, types } from "contracts_dev/mod.js" +import { chain } from "contracts_dev/mod.js" import { parse } from "../../deps/std/flags.ts" -const { - contracts_node_runtime: { RuntimeEvent }, -} = types - // Attempt to read contract address from command line argument (optional) let { address } = parse(Deno.args, { string: ["address"] }) @@ -55,10 +51,8 @@ await contract .sent() .dbgStatus("Flip:") .inBlockEvents() - .pipe((events) => - Rune.resolve(events).map((events) => events.filter((e) => RuntimeEvent.isContracts(e.event))) - ) - // .pipe(contract.filterContractEvents) + // .pipe((events) => Rune.resolve(events)) + .pipe(contract.filterContractEvents) .dbg("filtered events") .run()