Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Extract Signed<T> to replace SignedStatement, SignedBitfield, etc #1282

@coriolinus

Description

@coriolinus

I think that it might make our life easier if we extracted signing behavior entirely with something like this:

struct Signed<T> {
    payload: T,
    validator_index: ValidatorIndex,
    signature: ValidatorSignature,
}

impl<T: Encode> Signed<T> {
    fn sign(payload: T, context: SigningContext, index: ValidatorIndex, key: PrivateKey) -> Signed<T> { ... }
    fn validate(&self, context: SigningContext, key: PublicKey) -> bool { ... }
}

Originally posted by @coriolinus in #1270

Metadata

Metadata

Assignees

No one assigned

    Labels

    I8-refactorCode needs refactoring.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions