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

ref: Add/Sub Assignment Operations + e2e-tests.sh #467

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

0xNeshi
Copy link
Collaborator

@0xNeshi 0xNeshi commented Dec 26, 2024

Resolves #445, Resolves #443

PR Checklist

  • Tests
  • Documentation
  • Changelog

@0xNeshi 0xNeshi self-assigned this Dec 26, 2024
Copy link

netlify bot commented Dec 26, 2024

Deploy Preview for contracts-stylus canceled.

Name Link
🔨 Latest commit da89ce4
🔍 Latest deploy log https://app.netlify.com/sites/contracts-stylus/deploys/676dac38c4ebf30008549720

Comment on lines +71 to +73
// For each account, the nonce has an initial value of 0, can only be
// incremented by one, and cannot be decremented or reset. This
// guarantees that the nonce never overflows.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Add comment from Solidity version

Copy link

codecov bot commented Dec 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.6%. Comparing base (9192c18) to head (da89ce4).

Additional details and impacted files
Files with missing lines Coverage Δ
contracts/src/access/control.rs 98.5% <ø> (ø)
contracts/src/access/ownable.rs 94.1% <ø> (ø)
contracts/src/access/ownable_two_step.rs 99.2% <ø> (ø)
contracts/src/finance/vesting_wallet.rs 55.6% <ø> (ø)
...racts/src/token/erc1155/extensions/metadata_uri.rs 78.5% <ø> (ø)
contracts/src/token/erc1155/extensions/supply.rs 81.1% <ø> (ø)
...tracts/src/token/erc1155/extensions/uri_storage.rs 98.2% <ø> (ø)
contracts/src/token/erc1155/mod.rs 96.9% <ø> (ø)
contracts/src/token/erc20/extensions/capped.rs 83.3% <ø> (ø)
contracts/src/token/erc20/extensions/metadata.rs 22.2% <ø> (ø)
... and 12 more

@0xNeshi 0xNeshi requested a review from ggonzalez94 December 26, 2024 18:39
cargo test --features std,e2e --test "*"
else
cargo test --features std,e2e "$@"
fi
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The script can now be called in the following ways:

  • if no arguments are passed, the behavior is the same as before
  • otherwise, pass whatever arguments are present to cargo test directly

We can now easily filter for even unit tests with this script.

This should cover most of our testing needs.

NOTE: feel free to suggest or add any additional feature you think might be useful.

Copy link
Collaborator Author

@0xNeshi 0xNeshi Dec 27, 2024

Choose a reason for hiding this comment

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

An other option is to omit the if-statement, and just call cargo test --features std,e2e "$@", passing whatever arguments to the command. In our e2e workflow, we'd then call the script like ./scripts/e2e-tests.sh --test "*".

I'd be more in favor of this approach, but my first instinct was to keep the existing behavior as much as possible, and only change it after discussing it with you guys.

At this point it's really a matter of taste

Copy link
Collaborator

@bidzyyys bidzyyys left a comment

Choose a reason for hiding this comment

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

I believe we can apply #[allow(clippy::used_underscore_binding)] for the whole contracts library

@bidzyyys bidzyyys self-requested a review December 27, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants