Test Cases
In order to make CLV as secure and high performance multi-chain. There are lots of test cases have been made to support.
EVM Compatibility Tests
Balance Tests
The CLV EVM should provide the same interface for balance transfer and query.
The balance transfer should run correctly and related balance updated.
Test cases can be viewed here: https://github.com/clover-network/clover-sdk/blob/main/tests/test-balance.ts
Block Tests
The CLV EVM can return correct genesis block.
CLV EVM can support query block by number or hash.
The returned block should contain transactions and correct transaction root.
The newly generated block should has valid timestamp and includes previous block as parent
Test cases can be viewed here: https://github.com/clover-network/clover-sdk/blob/main/tests/test-block.ts
Bloom Tests
The transaction receipt should contains correct bloom data
Test cases can be viewed here: https://github.com/clover-network/clover-sdk/blob/main/tests/test-bloom.ts
Smart Contract Creation Tests
Smart contract can be correctly created by CLV EVM.
Smart contract creation can return transaction hash.
Test cases can be viewed here: https://github.com/clover-network/clover-sdk/blob/main/tests/test-contract.ts
Smart Contract Call Tests
CLV EVM should support the invoke of smart contract call.
The smart contract call should return expected result.
The smart contract call should fail in case of invalid parameters.
Test cases can be viewed here: https://github.com/clover-network/clover-sdk/blob/main/tests/test-contract-methods.ts
Gas Fee Tests
CLV EVM should support estimation of gas fee.
The gas limit should decrease on next block if gas unused.
The estimated gas should be correct for smart contract creation or method call.
Test cases can be viewed here: https://github.com/clover-network/clover-sdk/blob/main/tests/test-gas.ts
Other Tests
CLV EVM should support correct nonce query.
CLV EVM should return the revert reason in case of failure.
CLV EVM should return a valid transaction receipt for a successful or failed transaction.
Test cases can be viewed here: https://github.com/clover-network/clover-sdk/tree/main/tests
End to End Tests
In order to test the full functionality of CLV EVM, we provide a script which can automatically deploy Uniswap on CLV for one-shot.
It can deploy Uniswap ERC20 token to CLV
It can deploy Uniswap V2 Factory smart contract to CLV
It can deploy WETH ERC20 token to CLV
It can deploy Uniswap V2 Router smart contract to CLV
It can deploy Multicall smart contract to CLV
Please find the cool script here: https://github.com/clover-network/clover-sdk/blob/main/tests/e2e-tests/test/test-uniswap.js
Complex Gas Fee Tests
CLV EVM is based on Frontier, we find that the gas fee estimation under some cases may fail, such as nested smart contract call. CLV provides a binary search based solution to solve the problem. Please find the details here:
After the fix, CLV EVM can support all kinds of gas estimation correctly, please find the test case here: https://github.com/clover-network/clover-sdk/blob/main/tests/inner-contract-tests/test/test-inner-contract.js
CLV Account Binding Tests
CLV has a powerful dual-chain architecture, which will empower its users to build their decentralized apps and digital assets on one blockchain (CLV EVM powered) and take advantage of Polkadot chain on the other. Thus CLV account binding is very important, it enables users to do all the staffs under one unified account. Also the bound accounts can share the same balance, as well as the integration of the cool features on the dual-chain.
The related test cases can be found here: https://github.com/clover-network/clover-sdk/blob/main/tests/account-bind-tests/test-account-bind.js
CLV TPS Tests
In order to test the performance of CLV chain, test cases have been carried out both on EVM and CLV Parachain.
The EVM TPS tests can be found at: https://github.com/clover-network/clover-sdk/blob/main/tests/tps-tests/test-web3-tps.js
The CLV Parachain tests can be found at: https://github.com/clover-network/clover-sdk/blob/main/tests/tps-tests/test-polkadot-tps.js
Last updated