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

Feat: Add missing tests for Erc1155 E2E Tests #488

Closed

Conversation

Dhanraj30
Copy link


Description

This pull request adds the missing receiver-related tests for the _burn and _burn_batch functions in the erc1155.rs file.

Changes

  • Added tests for _burn and _burn_batch:
    • errors_when_receiver_reverts_with_reason
    • errors_when_receiver_reverts_without_reason
    • errors_when_receiver_panics
    • errors_when_invalid_receiver_contract

Issue

Resolves #482

Checklist

  • Tests
  • Documentation
  • Changelog

Copy link

netlify bot commented Jan 11, 2025

Deploy Preview for contracts-stylus canceled.

Name Link
🔨 Latest commit 5000439
🔍 Latest deploy log https://app.netlify.com/sites/contracts-stylus/deploys/6782427341a4ef0008000a98

Copy link
Collaborator

@0xNeshi 0xNeshi left a comment

Choose a reason for hiding this comment

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

Hey @Dhanraj30, thanks for wanting to contribute!

I took a look at the changes, and it turns out we don't need to test burn and burn_batch for reverts in ERC1155Receiver. Here's why: both functions use _update_with_acceptance_check internally, which doesn't do anything with the ERC1155Receiver contract when to is Address::ZERO - which is always the case for burns.

Sorry you spent time working on this! 🙏

Would you be interested in tackling some other issues instead? We could really use help cleaning up the Rust code in our docs (#480). There's also a quick win available - just reordering our docs sections (#476).

@0xNeshi 0xNeshi closed this Jan 13, 2025
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.

[Feature]: Add Missing Erc1155 E2E Tests
2 participants