Skip to content

Commit ef2790c

Browse files
committed
Update generated docs
1 parent 637a031 commit ef2790c

File tree

12 files changed

+71
-71
lines changed

12 files changed

+71
-71
lines changed

crates/sui-framework/docs/std/internal.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ module example::use_permit;
1212
public struct MyType { /* ... */ }
1313
1414
public fun test_permit() {
15-
let permit = internal::permit<MyType>();
16-
/* external_module::call_with_permit(permit); */
15+
let permit = internal::permit<MyType>();
16+
/* external_module::call_with_permit(permit); */
1717
}
1818
```
1919

@@ -25,7 +25,7 @@ To write a function that is guarded by a <code><a href="../std/internal.md#std_i
2525
module example::type_registry;
2626
2727
public fun register_type<T>(_: internal::Permit<T> /* ... */) {
28-
/* ... */
28+
/* ... */
2929
}
3030
```
3131

crates/sui-framework/docs/sui/bcs.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ Usage example:
1919
/// This function reads u8 and u64 value from the input
2020
/// and returns the rest of the bytes.
2121
fun deserialize(bytes: vector<u8>): (u8, u64, vector<u8>) {
22-
use sui::bcs::{Self, BCS};
22+
use sui::bcs::{Self, BCS};
2323
24-
let prepared: BCS = bcs::new(bytes);
25-
let (u8_value, u64_value) = (
26-
prepared.peel_u8(),
27-
prepared.peel_u64()
28-
);
24+
let prepared: BCS = bcs::new(bytes);
25+
let (u8_value, u64_value) = (
26+
prepared.peel_u8(),
27+
prepared.peel_u64()
28+
);
2929
30-
// unpack bcs struct
31-
let leftovers = prepared.into_remainder_bytes();
30+
// unpack bcs struct
31+
let leftovers = prepared.into_remainder_bytes();
3232
33-
(u8_value, u64_value, leftovers)
33+
(u8_value, u64_value, leftovers)
3434
}
3535
```
3636

@@ -768,11 +768,11 @@ however the tag can be any <code>u32</code> value.
768768
Example:
769769
```rust
770770
let my_enum = match (bcs.peel_enum_tag()) {
771-
0 => Enum::Empty,
772-
1 => Enum::U8(bcs.peel_u8()),
773-
2 => Enum::U16(bcs.peel_u16()),
774-
3 => Enum::Struct { a: bcs.peel_address(), b: bcs.peel_u8() },
775-
_ => abort,
771+
0 => Enum::Empty,
772+
1 => Enum::U8(bcs.peel_u8()),
773+
2 => Enum::U16(bcs.peel_u16()),
774+
3 => Enum::Struct { a: bcs.peel_address(), b: bcs.peel_u8() },
775+
_ => abort,
776776
};
777777
```
778778

crates/sui-framework/docs/sui/display.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ on the property values of an Object.
7474
```
7575
// Example of a display object
7676
Display<0x...::capy::Capy> {
77-
fields:
78-
<name, "Capy { genes }">
79-
<link, "https://capy.art/capy/{ id }">
80-
<image, "https://api.capy.art/capy/{ id }/svg">
81-
<description, "Lovely Capy, one of many">
77+
fields:
78+
<name, "Capy { genes }">
79+
<link, "https://capy.art/capy/{ id }">
80+
<image, "https://api.capy.art/capy/{ id }/svg">
81+
<description, "Lovely Capy, one of many">
8282
}
8383
```
8484

crates/sui-framework/docs/sui/event.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ creates and sends a custom MoveEvent as a part of the effects
77
certificate of the transaction.
88

99
Every MoveEvent has the following properties:
10-
- sender
11-
- type signature (<code>T</code>)
12-
- event data (the value of <code>T</code>)
13-
- timestamp (local to a node)
14-
- transaction digest
10+
- sender
11+
- type signature (<code>T</code>)
12+
- event data (the value of <code>T</code>)
13+
- timestamp (local to a node)
14+
- transaction digest
1515

1616
Example:
1717
```
1818
module my::marketplace {
19-
use sui::event;
20-
/* ... */
21-
struct ItemPurchased has copy, drop {
22-
item_id: ID, buyer: address
23-
}
24-
entry fun buy(/* .... */) {
25-
/* ... */
26-
event::emit(ItemPurchased { item_id: ..., buyer: .... })
27-
}
19+
use sui::event;
20+
/* ... */
21+
struct ItemPurchased has copy, drop {
22+
item_id: ID, buyer: address
23+
}
24+
entry fun buy(/* .... */) {
25+
/* ... */
26+
event::emit(ItemPurchased { item_id: ..., buyer: .... })
27+
}
2828
}
2929
```
3030

crates/sui-framework/docs/sui/package.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -704,13 +704,13 @@ package. This ticket only authorizes an upgrade to a package
704704
that matches this digest. A package's contents are identified
705705
by two things:
706706

707-
- modules: [[u8]] a list of the package's module contents
708-
- deps: [[u8; 32]] a list of 32 byte ObjectIDs of the
709-
package's transitive dependencies
707+
- modules: [[u8]] a list of the package's module contents
708+
- deps: [[u8; 32]] a list of 32 byte ObjectIDs of the
709+
package's transitive dependencies
710710

711711
A package's digest is calculated as:
712712

713-
sha3_256(sort(modules ++ deps))
713+
sha3_256(sort(modules ++ deps))
714714

715715

716716
<pre><code><b>public</b> <b>fun</b> <a href="../sui/package.md#sui_package_ticket_digest">ticket_digest</a>(ticket: &<a href="../sui/package.md#sui_package_UpgradeTicket">sui::package::UpgradeTicket</a>): &vector&lt;u8&gt;

crates/sui-framework/docs/sui/protocol_config.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ We should never need to expose this to user packages.
3333
### Arguments
3434

3535
* <code>feature_flag_name</code> - The name of the feature flag as bytes (e.g., b"enable_vdf")
36-
- It is expected to be a valid UTF-8 string
37-
- The flag should exist in the protocol config
36+
- It is expected to be a valid UTF-8 string
37+
- The flag should exist in the protocol config
3838

3939

4040
<a name="@Returns_1"></a>
@@ -53,7 +53,7 @@ We should never need to expose this to user packages.
5353
use sui::protocol_config;
5454
5555
if (protocol_config::is_feature_enabled(b"enable_accumulators")) {
56-
// Accumulators are available
56+
// Accumulators are available
5757
};
5858
```
5959

crates/sui-framework/docs/sui_system/staking_pool.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,12 +1099,12 @@ Called at epoch boundaries to process the pending stake.
10991099
## Function `withdraw_rewards`
11001100

11011101
This function does the following:
1102-
1. Calculates the total amount of SUI (including principal and rewards) that the provided pool tokens represent
1103-
at the current exchange rate.
1104-
2. Using the above number and the given <code>principal_withdraw_amount</code>, calculates the rewards portion of the
1105-
stake we should withdraw.
1106-
3. Withdraws the rewards portion from the rewards pool at the current exchange rate. We only withdraw the rewards
1107-
portion because the principal portion was already taken out of the staker's self custodied StakedSui.
1102+
1. Calculates the total amount of SUI (including principal and rewards) that the provided pool tokens represent
1103+
at the current exchange rate.
1104+
2. Using the above number and the given <code>principal_withdraw_amount</code>, calculates the rewards portion of the
1105+
stake we should withdraw.
1106+
3. Withdraws the rewards portion from the rewards pool at the current exchange rate. We only withdraw the rewards
1107+
portion because the principal portion was already taken out of the staker's self custodied StakedSui.
11081108

11091109

11101110
<pre><code><b>fun</b> <a href="../sui_system/staking_pool.md#sui_system_staking_pool_withdraw_rewards">withdraw_rewards</a>(pool: &<b>mut</b> <a href="../sui_system/staking_pool.md#sui_system_staking_pool_StakingPool">sui_system::staking_pool::StakingPool</a>, principal_withdraw_amount: u64, pool_token_withdraw_amount: u64, epoch: u64): <a href="../sui/balance.md#sui_balance_Balance">sui::balance::Balance</a>&lt;<a href="../sui/sui.md#sui_sui_SUI">sui::sui::SUI</a>&gt;

crates/sui-framework/docs/sui_system/storage_fund.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ title: Module `sui_system::storage_fund`
5656

5757
Struct representing the storage fund, containing two <code>Balance</code>s:
5858
- <code><a href="../sui_system/storage_fund.md#sui_system_storage_fund_total_object_storage_rebates">total_object_storage_rebates</a></code> has the invariant that it's the sum of <code>storage_rebate</code> of
59-
all objects currently stored on-chain. To maintain this invariant, the only inflow of this
60-
balance is storage charges collected from transactions, and the only outflow is storage rebates
61-
of transactions, including both the portion refunded to the transaction senders as well as
62-
the non-refundable portion taken out and put into <code>non_refundable_balance</code>.
59+
all objects currently stored on-chain. To maintain this invariant, the only inflow of this
60+
balance is storage charges collected from transactions, and the only outflow is storage rebates
61+
of transactions, including both the portion refunded to the transaction senders as well as
62+
the non-refundable portion taken out and put into <code>non_refundable_balance</code>.
6363
- <code>non_refundable_balance</code> contains any remaining inflow of the storage fund that should not
64-
be taken out of the fund.
64+
be taken out of the fund.
6565

6666

6767
<pre><code><b>public</b> <b>struct</b> <a href="../sui_system/storage_fund.md#sui_system_storage_fund_StorageFund">StorageFund</a> <b>has</b> store

crates/sui-framework/docs/sui_system/sui_system.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ To properly upgrade the <code>SuiSystemStateInner</code> type, we need to ship a
1515
1. Define a new <code>SuiSystemStateInner</code>type (e.g. <code>SuiSystemStateInnerV2</code>).
1616
2. Define a data migration function that migrates the old <code>SuiSystemStateInner</code> to the new one (i.e. SuiSystemStateInnerV2).
1717
3. Replace all uses of <code>SuiSystemStateInner</code> with <code>SuiSystemStateInnerV2</code> in both sui_system.move and sui_system_state_inner.move,
18-
with the exception of the <code><a href="../sui_system/sui_system_state_inner.md#sui_system_sui_system_state_inner_create">sui_system_state_inner::create</a></code> function, which should always return the genesis type.
18+
with the exception of the <code><a href="../sui_system/sui_system_state_inner.md#sui_system_sui_system_state_inner_create">sui_system_state_inner::create</a></code> function, which should always return the genesis type.
1919
4. Inside <code><a href="../sui_system/sui_system.md#sui_system_sui_system_load_inner_maybe_upgrade">load_inner_maybe_upgrade</a></code> function, check the current version in the wrapper, and if it's not the latest version,
20-
call the data migration function to upgrade the inner object. Make sure to also update the version in the wrapper.
20+
call the data migration function to upgrade the inner object. Make sure to also update the version in the wrapper.
2121
A detailed example can be found in sui/tests/framework_upgrades/mock_sui_systems/shallow_upgrade.
2222
Along with the Move change, we also need to update the Rust code to support the new type. This includes:
2323
1. Define a new <code>SuiSystemStateInner</code> struct type that matches the new Move type, and implement the SuiSystemStateTrait.
@@ -32,7 +32,7 @@ To upgrade Validator type, besides everything above, we also need to:
3232
2. Define a data migration function that migrates the old Validator to the new one (i.e. ValidatorV2).
3333
3. Replace all uses of Validator with ValidatorV2 except the genesis creation function.
3434
4. In validator_wrapper::upgrade_to_latest, check the current version in the wrapper, and if it's not the latest version,
35-
call the data migration function to upgrade it.
35+
call the data migration function to upgrade it.
3636
In Rust, we also need to add a new case in <code>get_validator_from_table</code>.
3737
Note that it is possible to upgrade SuiSystemStateInner without upgrading Validator, but not the other way around.
3838
And when we only upgrade SuiSystemStateInner, the version of Validator in the wrapper will not be updated, and hence may become
@@ -1556,7 +1556,7 @@ This function should be called at the end of an epoch, and advances the system t
15561556
It does the following things:
15571557
1. Add storage charge to the storage fund.
15581558
2. Burn the storage rebates from the storage fund. These are already refunded to transaction sender's
1559-
gas coins.
1559+
gas coins.
15601560
3. Distribute computation charge to validator stake.
15611561
4. Update all validators.
15621562

crates/sui-framework/docs/sui_system/sui_system_state_inner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2202,7 +2202,7 @@ This function should be called at the end of an epoch, and advances the system t
22022202
It does the following things:
22032203
1. Add storage charge to the storage fund.
22042204
2. Burn the storage rebates from the storage fund. These are already refunded to transaction sender's
2205-
gas coins.
2205+
gas coins.
22062206
3. Distribute computation charge to validator stake.
22072207
4. Update all validators.
22082208

0 commit comments

Comments
 (0)