feat: [v0.8-develop] update SingleOwnerPlugin to use installValidation [1/2] #91
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
In preparation to revamp the
installPluginworkflow, we need to moveSingleOwnerPluginto the user-controlled flow. Currently this isinstallValidation, with the goal being merging the two install flows into one, user-controlled flow.Additionally, SingleOwnerPlugin still uses the old mechanism of "treat functionId as an implementation switcher, rather than a config switcher". We've had draft examples of the intended updated usage in #89 and #84, but it'd be helpful to actually bring this change into the current state of
v0.8-develop.Solution
Change the internal storage of SingleOwnerPlugin to use the id field as a key in a mapping.
Update the test factories to use the user-controlled install flow. For consistency, introduce a constant across tests called
TEST_DEFAULT_OWNER_FUNCTION_IDso the installation flow and usage can rely on the same value for the id.This requires adding the
isSignatureValidationflag to theinstallValidationflow. However, doing so naively results in a stack-too-deep error, due to the large number of parameters. To address this, pack the validation function'sFunctionReferenceinto a new variable type, calledValidationConfig, along with the flags forisGlobalandisSignatureValidation.Update the usage of SingleOwnerPlugin in tests. There's a lot of this.