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

feat: add fluent.Multisig #485

Merged
merged 6 commits into from
Dec 30, 2022
Merged

feat: add fluent.Multisig #485

merged 6 commits into from
Dec 30, 2022

Conversation

kratico
Copy link
Contributor

@kratico kratico commented Dec 23, 2022

Add fluent.Multisig with

  • ratify, to create or approve proposals for execution
  • vote, to vote proposals without proposal execution
  • cancel, to cancel an existing proposal
  • isProposed, to check if if the given call hash has been proposed
  • proposals, to list outstanding proposals

It also adds the following utils

  • u8a.isEqual to compare Uint8Array
  • callHash effect to compute the Blake256 hash for the given scale encoded call

@kratico kratico marked this pull request as ready for review December 26, 2022 18:57
Comment on lines +170 to +187
function $call<
Client extends Z.$<rpc.Client> = Z.$<rpc.Client>,
>(client: Client) {
const metadata_ = metadata(client)()
const deriveCodec_ = scale.deriveCodec(metadata_)
return scale.$call(deriveCodec_, metadata_)
}

export function callHash<
Client extends Z.$<rpc.Client> = Z.$<rpc.Client>,
Call extends Z.$<unknown> = Z.$<unknown>,
>(client: Client) {
return (call: Call) => {
return Z.ls($call(client), call).next(([codec, call]) => {
return Blake2_256.hash(codec.encode(call))
})
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harrysolovay I'm not sure about the best location for these $call and callHash

@kratico kratico merged commit 9c0f28b into main Dec 30, 2022
@kratico kratico deleted the feat/fluent-multisig branch December 30, 2022 15:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants