-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom subconfigurations for a tree #155
base: master
Are you sure you want to change the base?
Conversation
meling
commented
Dec 31, 2021
- Added Configuration.Contains(nodeID)
- Changed WithNodeIDs(ids []uint32) to ids ...uint32
- Custom subconfigurations for a tree
This makes it easier to use with single entry node IDs.
This implements methods for constructing subconfigurations. The example implementation provided herein is for a binary tree that can be used for signature aggregation such as Handle.
This makes it easier to use with single entry node IDs.
This implements methods for constructing subconfigurations. The example implementation provided herein is for a binary tree that can be used for signature aggregation such as Handle.
Looking at the // AsRawManager provides access to the underlying RawManager of a generated Manager.
type AsRawManager interface {
// AsRaw returns a pointer to the underlying RawManager.
AsRaw() *RawManager
} // Derive subconfigurations from the manager's base configuration.
-func SubConfigurations(mgr *RawManager, opt SubConfigOption) ([]RawConfiguration, error) {
+func SubConfigurations(mgr AsRawManager, opt SubConfigOption) ([]RawConfiguration, error) {
if opt == nil {
return nil, ConfigCreationError(fmt.Errorf("missing required subconfiguration option"))
}
- return opt.subConfig(mgr)
+ return opt.subConfig(mgr.AsRaw())
} This makes it possible to pass a generated manager as the argument to the function, but then there is the problem of converting the raw configurations returned by the function back into generated configurations. Do you have any ideas on how to make this work? |
Of course, one solution is to move this function into the generated code, but that would necessitate changes to the |
bea0b8e
to
bf7cc7f
Compare