Starcoin has released version v1.12.3-beta. Version 1.12 focuses on improving the integration-test capability of the (mpm
) Move Package Manager and optimizing the command-line development experience for developers.
As the DApp's Move contract becomes more and more complex, we face some complex test scenarios:
scene one
Project A depends on Starcoin Move Framework, and Project B depends on Project A. At this time, if the Project B needs to test locally, it needs the integration test tool to provide the following capabilities:
Project B needs to be able to test the environment locally and deploy the Move contract of project A to the account address of project A. or
Project B forks a branch from the test network or the main network as a test environment, so that project B can directly test based on the contracts and states that have been deployed on the network.
scene two
The contract of project A relies on the historical state on the chain for some verification, such as obtaining the user's STC balance at a certain historical height. At this time, integration tests need to provide the following capabilities:
Call chain related APIs.
The post-test depends on the output of the pre-test.
The version released this time mainly focuses on these two complex scenarios to improve integration testing and command-line tools, and mainly provide or enhance the following features:
Command output and template variables, support for both integration testing and command line tools.
Use arbitrary addresses in integration tests for testing.
Enhanced integration testing capabilities of
fork
mode, developers can test locally based on a certain high state of the mainnet or testnet.Added
package
anddeploy
integration testing support to facilitate integration testing through two-phase upgrades and DAO upgrades.
Detailed description and usage scenarios
mpm integration-test
1. Command output and template variables
For instructions with output results (such as faucet, call, call-api, etc.), the output results will be saved in the running environment, and subsequent instructions can obtain these results, and use template variables to use some fields in the results as follow-up the input parameters of the instruction.
This feature can meet the requirement that some tests need to rely on the output result of the pre-order command as the input parameter.