Skip to content

Commit

Permalink
update doc of test api
Browse files Browse the repository at this point in the history
  • Loading branch information
vita-dounai committed Sep 23, 2020
1 parent f83a14f commit e731378
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/in_depth/test_api.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 测试专用API
# 单元测试专用API

Liquid的特色功能之一是能够在合约中编写单元测试。但是在单元测试中,有时除了需要对合约方法的输出、状态变量的值等进行测试,还需要测试区块链的状态,甚至需要改变区块链的状态来观察对合约方法执行逻辑的影响。Liquid提供了一组测试专用的API,使得在本地运行合约的单元测试时,您能够基于这些API获取或改变模拟区块链环境中的状态,从而对合约进行更深入一步的测试。

Expand Down Expand Up @@ -96,4 +96,5 @@ fn foo() {
// ...
```

`data`外,`Event`中还包括一个由事件索引组成的数组`topics`。每个索引的类型为`Hash`,其内部是一个长度为32的字节数组。`Hash`类型能够方便与字节数组、字符串互相转换,其接口与[`Address`类型](./types.html#Address)类似。
`data`外,`Event`中还包括一个由事件索引组成的数组`topics`。每个索引的类型为`Hash`,其内部是一个长度为32的字节数组。`Hash`类型能够方便与字节数组、字符串互相转换,其接口与[`Address`类型](./types.html#address)类似。

0 comments on commit e731378

Please sign in to comment.