Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pause125 committed May 16, 2024
1 parent b629a6a commit 033bcf5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The `Temporary Area` in the code is used to store temporary state data related t

Here are some example codes:

```move
```rust
struct TempState has store, copy, drop {
value: u64,
}
Expand Down Expand Up @@ -103,6 +103,12 @@ The Inscription structure includes the following fields:
- `parent`: Parent object ID, of type `Option<ObjectID>`.
- `pointer`: Pointer, of type `Option<u64>`.

<Callout>
TODO: This section of the document requires improvement.

1. Provide a more detailed description of the "Inscription" field.
</Callout>

### 2. How to Accept Inscription as Method Parameters

In Rooch, `Inscription` is stored as an `Object<Inscription>` in the global state. Developers can accept the structure as a parameter by using a reference (`&`) or a mutable reference (`&mut`) to read data contained in the Inscription or to save temporary or permanent state in the Inscription object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ UTXO(Unspent Transaction Output)是比特币系统中的一个核心概念

以下是一些示例代码:

```move
```rust
struct TempState has store, copy, drop {
value: u64,
}
Expand Down Expand Up @@ -103,6 +103,12 @@ Inscription 结构体包含了以下字段:
- `parent`: 父对象ID,类型为 `Option<ObjectID>`
- `pointer`: 指针,类型为 `Option<u64>`

<Callout>
TODO: 这部分文档需要改进

1. 更详细的描述 Inscription 字段。
</Callout>

### 2. 如何通过方法参数接受 Inscription

在 Rooch 中 `Inscription` 以对象 `Object<Inscription>` 的形式储存在全局状态中。 开发者可以通过引用(`&`)或可变引用(`&mut`)的方式接受结构体作为参数,读取 Inscription 包含的数据或者在 Inscription 对象中保存临时状态或者永久状态。
Expand Down
3 changes: 1 addition & 2 deletions frameworks/rooch-framework/doc/transfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
- [Function `transfer_object`](#0x3_transfer_transfer_object)


<pre><code><b>use</b> <a href="">0x1::debug</a>;
<b>use</b> <a href="">0x1::option</a>;
<pre><code><b>use</b> <a href="">0x1::option</a>;
<b>use</b> <a href="">0x2::account</a>;
<b>use</b> <a href="">0x2::object</a>;
<b>use</b> <a href="account.md#0x3_account">0x3::account</a>;
Expand Down

0 comments on commit 033bcf5

Please sign in to comment.