转至元数据结尾
转至元数据起始

正在查看旧版本。 查看 当前版本.

与当前比较 查看页面历史

« 上一页 版本 2 下一步 »

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:

  1. 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

  2. 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:

  1. Call chain related APIs.

  2. 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:

  1. Command output and template variables, support for both integration testing and command line tools.

  2. Use arbitrary addresses in integration tests for testing.

  3. Enhanced integration testing capabilities of fork mode, developers can test locally based on a certain high state of the mainnet or testnet.

  4. Added package and deploy 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.

  • 无标签