-
Notifications
You must be signed in to change notification settings - Fork 69
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
2022 add validation scripts after contract deployments #2081
base: main
Are you sure you want to change the base?
2022 add validation scripts after contract deployments #2081
Conversation
…that in the validation lc tests instead of using external apis
… deployments for testing
…o 2022-add-validation-scripts-after-contract-deployments
utils/src/deployer.rs
Outdated
@@ -472,6 +625,30 @@ pub async fn is_proxy_contract( | |||
Ok(implementation_address != H160::zero()) | |||
} | |||
|
|||
pub async fn is_valid_admin_light_client_proxy<M: Middleware + 'static>( |
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.
Since the implementation of the function is the same and we only call the owner
function of (I think) OwnableUpgradable
we could create the bindings for OwnableUpgradable
and instantiate that rust contract type. Then we can use the same function for all our proxy contracts and don't have to duplicate the function implementation.
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.
great call e44b49f
utils/src/deployer.rs
Outdated
@@ -307,6 +307,143 @@ pub async fn deploy_mock_light_client_contract<M: Middleware + 'static>( | |||
Ok(contract.address()) | |||
} | |||
|
|||
/// Deployment `LightClientMock.sol` as proxy for testing | |||
pub async fn deploy_light_client_contract_as_proxy_for_test<M: Middleware + 'static>( |
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.
It looks like this should be feature gated with #[cfg(any(test, feature = "testing"))]
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.
good call! Thank you!
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.
that function appeared to be duplicated as it was already in a test module . Removed duplicates here: 58a9890
@alysiahuggins It seems part of this PR is already on |
justfile
Outdated
@@ -76,7 +76,7 @@ build-docker-images: | |||
scripts/build-docker-images-native | |||
|
|||
# generate rust bindings for contracts | |||
REGEXP := "^LightClient$|^LightClientStateUpdateVK$|^FeeContract$|PlonkVerifier$|^ERC1967Proxy$|^LightClientMock$|^LightClientStateUpdateVKMock$|^PlonkVerifier2$" | |||
REGEXP := "^LightClient$|^LightClientStateUpdateVK$|^FeeContract$|^HotShot$|PlonkVerifier$|^ERC1967Proxy$|^OwnableUpgradeable$|^LightClientMock$|^LightClientStateUpdateVKMock$|^PlonkVerifier2$" |
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.
The HotShot contract has been removed.
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.
thanks, i missed that handling a merge conflict beeb04b
Closes #1198
This PR:
Key places to review:
How to test this PR:
cargo test service --all-features
Or more precisely
cargo test test_fail_validate_light_contract_proxy --all-features
cargo test test_validate_light_contract_is_not_a_proxy --all-features