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

Create automatic testing suite for ERC20 and oracle wrapper contracts #20

Open
4 tasks
ebma opened this issue Jul 11, 2023 · 4 comments
Open
4 tasks

Create automatic testing suite for ERC20 and oracle wrapper contracts #20

ebma opened this issue Jul 11, 2023 · 4 comments
Labels
priority:low Do it some day type:chore Maintenance tasks

Comments

@ebma
Copy link
Member

ebma commented Jul 11, 2023

Context

Our wrapper contracts are using the chain extension, so we have to compile them to WASM. Meaning we cannot use testing suites for EVM contracts but we can also not write unit tests to the same file. We could, however, have tests that deploy the contracts to our chain and then do automated tests with the deployed contracts.

Solang is doing tests similar to this. They define some helper functions here and in their actual test implementation (e.g. this), they use those helper functions to deploy and interact with the contracts on-chain, asserting certain values as results of the interactions.

Solution

We will create an automatic testing suite that uses a local standalone chain to deploy and interact with the compiled smart contracts. The standalone chain features the exact same chain extension that is also live on Pendulum/Amplitude/Foucoco.

Tasks

  • Wait until this ticket is completed.
  • Set up a standalone test chain in this repository using the template and include 1) the chain_extension extract as part of 249, 2) the orml_tokens pallet, and 3) the DIA pallet. All of these are required to configure the chain extension similarly to how it is set up on our main chains.
  • Create a new directory tests and create a test suite for the ERC20 and price oracle wrapper contract. The ERC20 test can be adopted from this file, both tests should follow a similar structure. We would probably also need these helper functions.
  • Add instructions on how to run the tests to the README. It should describe how the automatic testing works, and mention the commands needed to run it.
@ebma ebma added the priority:low Do it some day label Jul 11, 2023
@ebma
Copy link
Member Author

ebma commented Jul 11, 2023

Hey team! Please add your planning poker estimate with Zenhub @ashneverdawn @TorstenStueber

@prayagd
Copy link
Collaborator

prayagd commented Dec 7, 2023

@ebma does the wasm-deploy what this ticket says and can we close this ticket?

@ebma
Copy link
Member Author

ebma commented Dec 7, 2023

We can use wasm-deploy to facilitate the testing described in this ticket. We shouldn't close it though as we still need to actually implement the testing for these specific contracts.

@prayagd
Copy link
Collaborator

prayagd commented Dec 8, 2023

ok got it, Moving it to icebox then as wasm deploy not priority right now

@TorstenStueber TorstenStueber added the type:chore Maintenance tasks label Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:low Do it some day type:chore Maintenance tasks
Projects
None yet
Development

No branches or pull requests

3 participants