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

R/test utils #70

Merged
merged 60 commits into from
Sep 25, 2024
Merged

R/test utils #70

merged 60 commits into from
Sep 25, 2024

Conversation

maurolacy
Copy link
Collaborator

Refactor test utilities so that they are common to the contracts.

Also fixes the finality tests under the full-validation feature.

Comment on lines +28 to +29
# feature for enabling the full validation
full-validation = [ "btc-staking/full-validation" ]
Copy link
Member

Choose a reason for hiding this comment

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

Does the finality contract need the option for full validation? I thought the full validation is only relevant for Babylon <-> contract interaction, and only BTC staking contracts needs to have that. In theory finality contract can work with BTC staking contract with or without full validation.

For testing finality contract, we can always use BTC staking contract without full validation imo

Copy link
Collaborator Author

@maurolacy maurolacy Sep 25, 2024

Choose a reason for hiding this comment

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

Yes, but this is a stronger setting, in which we confirm the full-validation feature works also in / for the multi-contract tests.
In fact all this comes from the fact that CI was running workspace tests with the full validation feature enabled, and they were failing for the finality contract.

I've now enabled that back, and tests are passing.

Copy link
Member

Choose a reason for hiding this comment

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

I see. Is there a way to make this feature only for developments/tests? np with me if we cannot do it though

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's already like that. Because the code under the library feature, used when importing other contracts, is only used / invoked from test code. These high level full-validation features in contracts other than the staking contract are just wrappers to the staking one; so that the feature can be enabled on purpose. Which, only affects tests.

Copy link
Member

@SebastianElvis SebastianElvis left a comment

Choose a reason for hiding this comment

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

👍

Comment on lines +28 to +29
# feature for enabling the full validation
full-validation = [ "btc-staking/full-validation" ]
Copy link
Member

Choose a reason for hiding this comment

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

I see. Is there a way to make this feature only for developments/tests? np with me if we cannot do it though

contracts/btc-staking/Cargo.toml Show resolved Hide resolved
Base automatically changed from r/finality-contract to main September 25, 2024 13:45
@maurolacy maurolacy merged commit 9b0bd97 into main Sep 25, 2024
2 checks passed
@maurolacy maurolacy deleted the r/test-utils branch September 25, 2024 14:08
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.

2 participants