Skip to content
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

feat: parameter validation for modules #19

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions solidity/contracts/Module.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ abstract contract Module is IModule {
address _finalizer
) external virtual onlyOracle {}

/// @inheritdoc IModule
function validateParameters(bytes calldata _encodedParameters) external pure virtual returns (bool _valid) {}

/**
* @notice Computes the id a given request
*
Expand Down
8 changes: 8 additions & 0 deletions solidity/interfaces/IModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ interface IModule {
address _finalizer
) external;

/**
* @notice Validates parameters prior to creating a request
*
* @param _encodedParameters The encoded parameters for the request
* @param _valid Boolean indicating if the parameters are valid or not
*/
function validateParameters(bytes memory _encodedParameters) external pure returns (bool _valid);

/**
* @notice Returns the name of the module.
*
Expand Down
Loading