Skip to content

Conversation

@adam-alchemy
Copy link
Contributor

@adam-alchemy adam-alchemy commented Apr 18, 2024

Motivation

Motivation and rationale very similar to #40. With validation function assignments merged, it makes sense to also merge pre-validation types.

"Merge" here means that when a pre validation hook is applied (an installed plugin address + a function id for the hook), then the two plugin functions preUserOpValidationHook and preRuntimeValidationHook should both start to be called in their respective workflow paths, using the same function id.

This reduces redundancy in manifests, and avoids the possibility of configuring one type of validation but not the other.

This simplification helps pave the way for multiple validation & better composability by reducing the size and complexity of account state.

Solution

  • Consolidate the manifest fields (and account storage fields) preUserOpValidationHooks and preRuntimeValidationHooks into one field preValidationHooks.
  • Merge pre validation hook function ids in provided sample and mock plugins.
  • Update the return type of getPreValidationHooks in IAccountLoupe to only return one array of FunctionRefernce types.

@adam-alchemy adam-alchemy requested review from howydev and jaypaik April 18, 2024 20:20
Copy link
Collaborator

@howydev howydev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jaypaik jaypaik requested a review from a team April 22, 2024 23:41
Copy link
Contributor

@huaweigu huaweigu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants