Open harrysolovay opened 1 year ago
I haven't attempted cancellation, but event extraction is seemingly working fine.
import { polkadotDev } from "@capi/polkadot-dev"
import { createDevUsers } from "capi"
import { MultisigRune } from "capi/patterns/multisig"
import { signature } from "capi/patterns/signature/polkadot"
const { alexa, billy, carol, david } = await createDevUsers()
const multisig = MultisigRune.from(polkadotDev, {
signatories: [alexa, billy, carol].map(({ publicKey }) => publicKey),
threshold: 3,
})
await multisig
.fund(2_000_000_000_000n)
.signed(signature({ sender: alexa }))
.sent()
.dbgStatus("Existential deposit")
.finalized()
.run()
const call = polkadotDev.Balances.transferKeepAlive({
dest: david.address,
value: 1_230_000_000_000n,
})
const firstProposalEvents = await multisig
.ratify(alexa.address, call)
.signed(signature({ sender: alexa }))
.sent()
.dbgStatus("Proposal:")
.finalizedEvents()
.run()
console.log("Proposal events", firstProposalEvents)
const finalApprovalEvents = await multisig
.ratify(billy.address, call)
.signed(signature({ sender: billy }))
.sent()
.dbgStatus("Final approval:")
.finalizedEvents()
.run()
console.log("Final approval events", finalApprovalEvents)
I'll follow up after I've had the chance to test within your chore-capi-beta47
branch.
@statictype has reported an issue in gamma 1 in which multisig approval/cancellation event capture is supposedly broken.
In resolving this, let's also create an example of multisig proposal cancellation.