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

E2E: Clean config parsing #1922

Merged
merged 8 commits into from
Sep 29, 2023

Conversation

pmikolajczyk41
Copy link
Member

@pmikolajczyk41 pmikolajczyk41 commented Sep 26, 2023

  • [y] y/n | Does it introduce breaking changes? (although an extremely cosmetic one)
  • [n] y/n | Is it dependant on the specific version of cargo-contract or pallet-contracts?

Description

Instead of parsing e2e configuration arguments, checking for errors and handling all situations manually, we can use darling library that is dedicated for exactly such boilerplate.

I have removed most of the testcases (leaving only the positive scenario) - they seem to be completely unnecessary now, since all the error detection and handling is now outsourced. We may however bring them back (preferably in another PR) as UI tests for e2e crate.

The only breaking change is that we won't accept runtime-only literal (only runtime_only is now valid). Additionally, we accept path arguments (like runtime) both in raw form and as literals (default in darling).

Note: we had to change additional_contracts field type from Vec<String> to String, since darling doesn't support parsing Vec<String> in the intended way (only by multiple argument occurrences). However, this is not visible from outside struct internal implementation.

Checklist before requesting a review

  • My code follows the style guidelines of this project
  • I have added an entry to CHANGELOG.md
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

Copy link
Collaborator

@ascjones ascjones left a comment

Choose a reason for hiding this comment

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

Love it ❤️

@ascjones ascjones merged commit b370401 into use-ink:master Sep 29, 2023
22 checks passed
@pmikolajczyk41 pmikolajczyk41 deleted the clean-config-parsing branch September 29, 2023 08:50
@SkymanOne SkymanOne mentioned this pull request Nov 30, 2023
@SkymanOne SkymanOne mentioned this pull request Mar 4, 2024
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.

None yet

2 participants