Skip to content

(feat) Refactor Multikey Views and Multisig Views to be extensible. #7

@dhuseby

Description

@dhuseby

We received a request to add Attributes to both Multikey and Multisig to store non-standard algorithm codecs so that both Multikey and Multisig are extensible. Adding that requires a rethink of the Views approach because the user of Multikey and Multisig will need to supply the impls of the different Views for their experimental keys/sigs. So instead of an abstract factor returning Box<&impl View> we're going to need to move the abstraction further "upstream".

I'm proposing that we switch from abstract factory to a builder trait for building views. That way Multikey and Multisig will depend on a mk::ViewBuilder trait and a ms::ViewBuilder trait respectively when they need to access views.

The primary change is we'll be adding &impl ViewBuilder as a parameter to some functions and all functions that depend on ViewBuilder will be returning Results because constructing a view will now always be fallible (i.e. relies upon try_build to get the concrete View instance).

The existing impls for different algorithms (e.g. Ed25519, etc) will be changed to prove an ViewBuilder impl.

@mikelodder7 @DougAnderson444 thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions