capi
capi copied to clipboard
`SignablePatternRune` & `SignedPatternRune`
Is there any design for a SignablePatternRune and SignedPatternRune, which could somehow...
- shield the consumer from the complexity of typing the signature constraints +
signedmethod - allow us to attach common methods (such as
verify)
The signed method's params will be the same across inheritors. The difference is in what they return.
signed<SU>(signatureFactory: SignatureDataFactory<C, U, SU>) {
return Rune.fn($extrinsic)
.call(this.chain.metadata)
.into(CodecRune)
.encoded(Rune.rec({
protocolVersion: 4,
call: this,
signature: signatureFactory(this.chain),
}))
.into(SignedExtrinsicRune, this.chain)
}
... I'd imagine most patterns will make use of such a flow (being .signed). Would be nice if we could further simplify. Thoughts @nythrox?
Or, a signableRune factory
Blocked on #517