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

Child chain mintable predicates E2E tests #1560

Merged

Conversation

Stefan-Ethernal
Copy link
Collaborator

@Stefan-Ethernal Stefan-Ethernal commented May 29, 2023

Description

This PR tweaks CLI commands for sending bridge transactions and implements E2E tests which prove that child chain mintable predicates are working correctly.
Note that child chain mintable native token is mapped only on mintable predicates (it is prevented to be mapped in non-mintable ones).

Bridge CLI commands UX changes

Bridge deposit commands have a new flag called --minter-key, which represents the private key of the account that is able to do token minting (e.g. has associated MINTER_ROLE etc.). If it is provided, deposit command is going to mint tokens to the sender account (otherwise it would do just deposit).

All bridge commands are enhanced with an additional flag called --child-chain-mintable. This flag denotes whether child chain mintable predicates are engaged in a given bridge transaction. It is used to determine whether exit events (aka L2StateSynced events) are extracted from a receipt. Depending on the direction of assets bridging, exit events can be present either:

  • for withdrawals when using non-child chain mintable predicates
  • for deposits when using child chain mintable predicates

Mandatory stake-token flag to rootchain deploy command

Introduced mandatory stake-token flag to rootchain deploy command, because the previous approach was not correct, since instead of using root chain native token, we were using child chain native token root chain pairing address.

E2E tests

Implemented two e2e tests, which are bridging child chain-originated tokens (mintable native tokens and ERC721 tokens).

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

@Stefan-Ethernal Stefan-Ethernal force-pushed the EVM-670-deploy-access-list-mintable-predicates branch from 0e3fda9 to 5e40f7f Compare May 29, 2023 08:21
@Stefan-Ethernal Stefan-Ethernal self-assigned this May 29, 2023
@Stefan-Ethernal Stefan-Ethernal added feature New update to Polygon Edge breaking change Functionality that contains breaking changes labels May 29, 2023
@Stefan-Ethernal Stefan-Ethernal force-pushed the EVM-654-implement-mintable-predicates-e-2-e-tests branch from e6cab8d to 36680bc Compare May 29, 2023 08:58
Base automatically changed from EVM-670-deploy-access-list-mintable-predicates to develop May 29, 2023 09:23
@Stefan-Ethernal Stefan-Ethernal force-pushed the EVM-654-implement-mintable-predicates-e-2-e-tests branch 6 times, most recently from 95d03fc to 258e034 Compare June 2, 2023 12:33
@Stefan-Ethernal Stefan-Ethernal requested a review from a team June 2, 2023 12:35
@Stefan-Ethernal Stefan-Ethernal marked this pull request as ready for review June 2, 2023 12:35
@Stefan-Ethernal Stefan-Ethernal changed the title Mintable predicates E2E tests Child chain mintable predicates E2E tests Jun 2, 2023
@Stefan-Ethernal Stefan-Ethernal force-pushed the EVM-654-implement-mintable-predicates-e-2-e-tests branch from 163374d to a843c6d Compare June 2, 2023 14:40
@Stefan-Ethernal Stefan-Ethernal force-pushed the EVM-654-implement-mintable-predicates-e-2-e-tests branch from a843c6d to ee6a002 Compare June 2, 2023 15:58
* Consolidate bridge transaction result into single struct

* Update SC to the latest spec

* Fix

* Add json tag to title field
@Stefan-Ethernal Stefan-Ethernal merged commit fc803f1 into develop Jun 5, 2023
@Stefan-Ethernal Stefan-Ethernal deleted the EVM-654-implement-mintable-predicates-e-2-e-tests branch June 5, 2023 12:33
@github-actions github-actions bot locked and limited conversation to collaborators Jun 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking change Functionality that contains breaking changes feature New update to Polygon Edge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants