-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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?