-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[DEVSVCS-518] Workflow Registry Contract #14990
base: develop
Are you sure you want to change the base?
Conversation
1e373da
to
ea6b7ff
Compare
AER Report: CI Core ran successfully ✅AER Report: Operator UI CI ran successfully ✅ |
af3a3ae
to
8cc5835
Compare
Quality Gate passedIssues Measures |
653d06d
to
8f37a80
Compare
b321eed
to
81df9a9
Compare
81df9a9
to
4e04532
Compare
3ea3eab
to
40023d2
Compare
@@ -22,6 +22,7 @@ LinkToken.json | |||
typechain | |||
**/vendor | |||
src/v0.8/ccip/** | |||
src/v0.8/workflow/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason we ignore prettier, i used to rely on prettier to format for me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:D we're using forge fmt right now in our repo as it's a bit faster :D
@@ -132,6 +132,19 @@ let config = { | |||
version: '0.8.19', | |||
settings: COMPILER_SETTINGS, | |||
}, | |||
'src/v0.8/workflow/dev/WorkflowRegistry.sol': { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this?
|
||
import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableSet.sol"; | ||
|
||
/// @title DONAccessControl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if a title adds a lot
|
||
// Struct | ||
struct DONPermission { | ||
uint32 donID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing struct packing comments
error AddressNotAuthorized(uint32 donID, address caller); | ||
error DONNotAllowed(uint32 donID); | ||
|
||
/// @notice Updates the allowed status for a single DON |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments should end with a .
@@ -39,7 +39,8 @@ jobs: | |||
{ "name": "operatorforwarder", "setup": { "run-coverage": true, "min-coverage": 55.7, "run-gas-snapshot": true, "run-forge-fmt": false }}, | |||
{ "name": "shared", "setup": { "run-coverage": true, "extra-coverage-params": "--no-match-path='*CallWithExactGas*' --ir-minimum", "min-coverage": 32.6, "run-gas-snapshot": true, "run-forge-fmt": false }}, | |||
{ "name": "transmission", "setup": { "run-coverage": true, "min-coverage": 61.5, "run-gas-snapshot": true, "run-forge-fmt": false }}, | |||
{ "name": "vrf", "setup": { "run-coverage": false, "min-coverage": 98.5, "run-gas-snapshot": false, "run-forge-fmt": false }} | |||
{ "name": "vrf", "setup": { "run-coverage": false, "min-coverage": 98.5, "run-gas-snapshot": false, "run-forge-fmt": false }}, | |||
{ "name": "workflow", "setup": { "run-coverage": true, "extra-coverage-params": "--ir-minimum", "min-coverage": 60.0, "run-gas-snapshot": false, "run-forge-fmt": false }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is forge fmt false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"min-coverage": 60.0
That's very low. You want this to be well above 90%
uint32 private s_chainID = 1; | ||
|
||
function setUp() public { | ||
vm.prank(s_owner); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use vm.startPrank to use a prank for multiple calls
import {WorkflowRegistryManager} from "../dev/WorkflowRegistryManager.sol"; | ||
import {Test} from "forge-std/Test.sol"; | ||
|
||
contract WorkflowRegistryManagerTest is Test { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the following test name format
test_Description for standard tests.
testFuzz_Description for fuzz tests.
test_RevertWhen_Condition for tests expecting a revert.
testFork_Description for tests that fork from a network.
and create a test file per function to be called. For the folder structure, see #15165 as example.
|
||
// Activate first version | ||
s_manager.activateVersion(1); | ||
vm.stopPrank(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to stop the prank
function testGetAllVersionsPagination() public { | ||
// Add multiple versions | ||
vm.startPrank(s_owner); | ||
for (uint32 i = 0; i < 5; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++i, even in tests :)
address private s_owner = address(1); | ||
address private s_unauthorizedUser = address(2); | ||
address private s_authorizedUser = address(3); | ||
bytes32 private s_workflowID1 = keccak256(abi.encodePacked("workflow1")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think you have to encode it at all
The PR isn't forge formatted but also adds its code to prettierignore. This means there is no formatting which is not allowed |
using EnumerableSet for EnumerableSet.UintSet; | ||
|
||
// Constants | ||
string public constant override typeAndVersion = "WorkflowRegistry 1.0.0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When under development please use the -dev
suffix for versions
Initial dev portion of the workflow registry contract ported from dev-platform