Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Commit

Permalink
feat: use contract.filterContractEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
kratico committed Apr 4, 2023
1 parent 491636c commit 3db7b05
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions examples/ink/interact.eg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"] })

Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 3db7b05

Please sign in to comment.