You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
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.
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
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.The text was updated successfully, but these errors were encountered: