Skip to content

Commit

Permalink
fix(sui-framework): fixes after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriyr committed Jun 6, 2024
1 parent dba760e commit 6369cb3
Show file tree
Hide file tree
Showing 18 changed files with 151 additions and 1,038 deletions.
16 changes: 8 additions & 8 deletions crates/iota-framework/docs/timelock/label.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ title: Module `0x10cf::label`
<b>use</b> <a href="../move-stdlib/option.md#0x1_option">0x1::option</a>;
<b>use</b> <a href="../move-stdlib/string.md#0x1_string">0x1::string</a>;
<b>use</b> <a href="../move-stdlib/type_name.md#0x1_type_name">0x1::type_name</a>;
<b>use</b> <a href="../sui-framework/object.md#0x2_object">0x2::object</a>;
<b>use</b> <a href="../sui-framework/tx_context.md#0x2_tx_context">0x2::tx_context</a>;
<b>use</b> <a href="../sui-framework/types.md#0x2_types">0x2::types</a>;
<b>use</b> <a href="../iota-framework/object.md#0x2_object">0x2::object</a>;
<b>use</b> <a href="../iota-framework/tx_context.md#0x2_tx_context">0x2::tx_context</a>;
<b>use</b> <a href="../iota-framework/types.md#0x2_types">0x2::types</a>;
</code></pre>


Expand All @@ -49,7 +49,7 @@ Can be publicly transferred like any other object.

<dl>
<dt>
<code>id: <a href="../sui-framework/object.md#0x2_object_UID">object::UID</a></code>
<code>id: <a href="../iota-framework/object.md#0x2_object_UID">object::UID</a></code>
</dt>
<dd>

Expand Down Expand Up @@ -112,7 +112,7 @@ Create a <code><a href="label.md#0x10cf_label_LabelerCap">LabelerCap</a></code>
Can be created only by consuming a one time witness.


<pre><code><b>public</b> <b>fun</b> <a href="label.md#0x10cf_label_create_labeler_cap">create_labeler_cap</a>&lt;L: drop&gt;(witness: L, ctx: &<b>mut</b> <a href="../sui-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): <a href="label.md#0x10cf_label_LabelerCap">label::LabelerCap</a>&lt;L&gt;
<pre><code><b>public</b> <b>fun</b> <a href="label.md#0x10cf_label_create_labeler_cap">create_labeler_cap</a>&lt;L: drop&gt;(witness: L, ctx: &<b>mut</b> <a href="../iota-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): <a href="label.md#0x10cf_label_LabelerCap">label::LabelerCap</a>&lt;L&gt;
</code></pre>


Expand All @@ -122,10 +122,10 @@ Can be created only by consuming a one time witness.


<pre><code><b>public</b> <b>fun</b> <a href="label.md#0x10cf_label_create_labeler_cap">create_labeler_cap</a>&lt;L: drop&gt;(witness: L, ctx: &<b>mut</b> TxContext): <a href="label.md#0x10cf_label_LabelerCap">LabelerCap</a>&lt;L&gt; {
<b>assert</b>!(<a href="../sui-framework/types.md#0x2_types_is_one_time_witness">types::is_one_time_witness</a>(&witness), <a href="label.md#0x10cf_label_ENotOneTimeWitness">ENotOneTimeWitness</a>);
<b>assert</b>!(<a href="../iota-framework/types.md#0x2_types_is_one_time_witness">types::is_one_time_witness</a>(&witness), <a href="label.md#0x10cf_label_ENotOneTimeWitness">ENotOneTimeWitness</a>);

<a href="label.md#0x10cf_label_LabelerCap">LabelerCap</a>&lt;L&gt; {
id: <a href="../sui-framework/object.md#0x2_object_new">object::new</a>(ctx),
id: <a href="../iota-framework/object.md#0x2_object_new">object::new</a>(ctx),
}
}
</code></pre>
Expand Down Expand Up @@ -156,7 +156,7 @@ If a capability is destroyed, it is impossible to add the related labels.
id,
} = cap;

<a href="../sui-framework/object.md#0x2_object_delete">object::delete</a>(id);
<a href="../iota-framework/object.md#0x2_object_delete">object::delete</a>(id);
}
</code></pre>

Expand Down
36 changes: 7 additions & 29 deletions crates/iota-framework/docs/timelock/timelock.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,11 @@ A timelock implementation.
- [Function `check_expiration_timestamp_ms`](#0x10cf_timelock_check_expiration_timestamp_ms)


<<<<<<< HEAD:crates/sui-framework/docs/timelock/timelock.md
<pre><code><b>use</b> <a href="label.md#0x10cf_label">0x10cf::label</a>;
<b>use</b> <a href="../move-stdlib/option.md#0x1_option">0x1::option</a>;
<b>use</b> <a href="../sui-framework/object.md#0x2_object">0x2::object</a>;
<b>use</b> <a href="../sui-framework/transfer.md#0x2_transfer">0x2::transfer</a>;
<b>use</b> <a href="../sui-framework/tx_context.md#0x2_tx_context">0x2::tx_context</a>;
=======
<pre><code><b>use</b> <a href="../iota-framework/object.md#0x2_object">0x2::object</a>;
<b>use</b> <a href="../iota-framework/object.md#0x2_object">0x2::object</a>;
<b>use</b> <a href="../iota-framework/transfer.md#0x2_transfer">0x2::transfer</a>;
<b>use</b> <a href="../iota-framework/tx_context.md#0x2_tx_context">0x2::tx_context</a>;
>>>>>>> develop:crates/iota-framework/docs/timelock/timelock.md
</code></pre>


Expand Down Expand Up @@ -144,7 +138,7 @@ Function to lock an object till a unix timestamp in milliseconds.
Function to lock a labeled object till a unix timestamp in milliseconds.


<pre><code><b>public</b> <b>fun</b> <a href="timelock.md#0x10cf_timelock_lock_with_label">lock_with_label</a>&lt;T: store, L&gt;(cap: &<a href="label.md#0x10cf_label_LabelerCap">label::LabelerCap</a>&lt;L&gt;, locked: T, expiration_timestamp_ms: u64, ctx: &<b>mut</b> <a href="../sui-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): <a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;
<pre><code><b>public</b> <b>fun</b> <a href="timelock.md#0x10cf_timelock_lock_with_label">lock_with_label</a>&lt;T: store, L&gt;(cap: &<a href="label.md#0x10cf_label_LabelerCap">label::LabelerCap</a>&lt;L&gt;, locked: T, expiration_timestamp_ms: u64, ctx: &<b>mut</b> <a href="../iota-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): <a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;
</code></pre>


Expand Down Expand Up @@ -181,11 +175,7 @@ Function to lock a labeled object till a unix timestamp in milliseconds.
Function to unlock the object from a <code><a href="timelock.md#0x10cf_timelock_TimeLock">TimeLock</a></code>.


<<<<<<< HEAD:crates/sui-framework/docs/timelock/timelock.md
<pre><code><b>public</b> <b>fun</b> <a href="timelock.md#0x10cf_timelock_unlock">unlock</a>&lt;T: store&gt;(self: <a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;, ctx: &<a href="../sui-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): T
=======
<pre><code><b>public</b> <b>fun</b> <a href="timelock.md#0x10cf_timelock_unlock">unlock</a>&lt;T: store&gt;(self: <a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;, ctx: &<b>mut</b> <a href="../iota-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): T
>>>>>>> develop:crates/iota-framework/docs/timelock/timelock.md
<pre><code><b>public</b> <b>fun</b> <a href="timelock.md#0x10cf_timelock_unlock">unlock</a>&lt;T: store&gt;(self: <a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;, ctx: &<a href="../iota-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): T
</code></pre>


Expand Down Expand Up @@ -244,11 +234,7 @@ Function to get the expiration timestamp of a <code><a href="timelock.md#0x10cf_
Function to check if a <code><a href="timelock.md#0x10cf_timelock_TimeLock">TimeLock</a></code> is locked.


<<<<<<< HEAD:crates/sui-framework/docs/timelock/timelock.md
<pre><code><b>public</b> <b>fun</b> <a href="timelock.md#0x10cf_timelock_is_locked">is_locked</a>&lt;T: store&gt;(self: &<a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;, ctx: &<a href="../sui-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): bool
=======
<pre><code><b>public</b> <b>fun</b> <a href="timelock.md#0x10cf_timelock_is_locked">is_locked</a>&lt;T: store&gt;(self: &<a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;, ctx: &<b>mut</b> <a href="../iota-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): bool
>>>>>>> develop:crates/iota-framework/docs/timelock/timelock.md
<pre><code><b>public</b> <b>fun</b> <a href="timelock.md#0x10cf_timelock_is_locked">is_locked</a>&lt;T: store&gt;(self: &<a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;, ctx: &<a href="../iota-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): bool
</code></pre>


Expand All @@ -274,11 +260,7 @@ Function to get the remaining time of a <code><a href="timelock.md#0x10cf_timelo
Returns 0 if the lock has expired.


<<<<<<< HEAD:crates/sui-framework/docs/timelock/timelock.md
<pre><code><b>public</b> <b>fun</b> <a href="timelock.md#0x10cf_timelock_remaining_time">remaining_time</a>&lt;T: store&gt;(self: &<a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;, ctx: &<a href="../sui-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): u64
=======
<pre><code><b>public</b> <b>fun</b> <a href="timelock.md#0x10cf_timelock_remaining_time">remaining_time</a>&lt;T: store&gt;(self: &<a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;, ctx: &<b>mut</b> <a href="../iota-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): u64
>>>>>>> develop:crates/iota-framework/docs/timelock/timelock.md
<pre><code><b>public</b> <b>fun</b> <a href="timelock.md#0x10cf_timelock_remaining_time">remaining_time</a>&lt;T: store&gt;(self: &<a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;, ctx: &<a href="../iota-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): u64
</code></pre>


Expand Down Expand Up @@ -363,11 +345,7 @@ Must not be callable from the outside, as one could modify the locked object.
Function to get the label of a <code><a href="timelock.md#0x10cf_timelock_TimeLock">TimeLock</a></code>.


<<<<<<< HEAD:crates/sui-framework/docs/timelock/timelock.md
<pre><code><b>public</b> <b>fun</b> <a href="label.md#0x10cf_label">label</a>&lt;T: store&gt;(self: &<a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;): &<a href="../move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;<a href="label.md#0x10cf_label_Label">label::Label</a>&gt;
=======
<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="timelock.md#0x10cf_timelock_pack">pack</a>&lt;T: store&gt;(locked: T, expiration_timestamp_ms: u64, ctx: &<b>mut</b> <a href="../iota-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): <a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;
>>>>>>> develop:crates/iota-framework/docs/timelock/timelock.md
</code></pre>


Expand All @@ -392,7 +370,7 @@ Function to get the label of a <code><a href="timelock.md#0x10cf_timelock_TimeLo
A utility function to pack a <code><a href="timelock.md#0x10cf_timelock_TimeLock">TimeLock</a></code>.


<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="timelock.md#0x10cf_timelock_pack">pack</a>&lt;T: store&gt;(locked: T, expiration_timestamp_ms: u64, <a href="label.md#0x10cf_label">label</a>: <a href="../move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;<a href="label.md#0x10cf_label_Label">label::Label</a>&gt;, ctx: &<b>mut</b> <a href="../sui-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): <a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;
<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="timelock.md#0x10cf_timelock_pack">pack</a>&lt;T: store&gt;(locked: T, expiration_timestamp_ms: u64, <a href="label.md#0x10cf_label">label</a>: <a href="../move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;<a href="label.md#0x10cf_label_Label">label::Label</a>&gt;, ctx: &<b>mut</b> <a href="../iota-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>): <a href="timelock.md#0x10cf_timelock_TimeLock">timelock::TimeLock</a>&lt;T&gt;
</code></pre>


Expand Down Expand Up @@ -489,7 +467,7 @@ An utility function to transfer a <code><a href="timelock.md#0x10cf_timelock_Tim
An utility function to check that the <code>expiration_timestamp_ms</code> value is valid.


<pre><code><b>fun</b> <a href="timelock.md#0x10cf_timelock_check_expiration_timestamp_ms">check_expiration_timestamp_ms</a>(expiration_timestamp_ms: u64, ctx: &<a href="../sui-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>)
<pre><code><b>fun</b> <a href="timelock.md#0x10cf_timelock_check_expiration_timestamp_ms">check_expiration_timestamp_ms</a>(expiration_timestamp_ms: u64, ctx: &<a href="../iota-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>)
</code></pre>


Expand Down
20 changes: 2 additions & 18 deletions crates/iota-framework/docs/timelock/timelocked_balance.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,11 @@ Utility functions for time-locked balance.
- [Function `split`](#0x10cf_timelocked_balance_split)


<<<<<<< HEAD:crates/sui-framework/docs/timelock/timelocked_balance.md
<pre><code><b>use</b> <a href="label.md#0x10cf_label">0x10cf::label</a>;
<b>use</b> <a href="timelock.md#0x10cf_timelock">0x10cf::timelock</a>;
<b>use</b> <a href="../move-stdlib/option.md#0x1_option">0x1::option</a>;
<b>use</b> <a href="../sui-framework/balance.md#0x2_balance">0x2::balance</a>;
<b>use</b> <a href="../sui-framework/tx_context.md#0x2_tx_context">0x2::tx_context</a>;
=======
<pre><code><b>use</b> <a href="timelock.md#0x10cf_timelock">0x10cf::timelock</a>;
<b>use</b> <a href="../iota-framework/balance.md#0x2_balance">0x2::balance</a>;
<b>use</b> <a href="../iota-framework/tx_context.md#0x2_tx_context">0x2::tx_context</a>;
>>>>>>> develop:crates/iota-framework/docs/timelock/timelocked_balance.md
</code></pre>


Expand Down Expand Up @@ -72,16 +66,11 @@ Join two <code>TimeLock&lt;Balance&lt;T&gt;&gt;</code> together.
<b>assert</b>!(self.expiration_timestamp_ms() == other.expiration_timestamp_ms(), <a href="timelocked_balance.md#0x10cf_timelocked_balance_EDifferentExpirationTime">EDifferentExpirationTime</a>);
<b>assert</b>!(self.<a href="label.md#0x10cf_label">label</a>() == other.<a href="label.md#0x10cf_label">label</a>(), <a href="timelocked_balance.md#0x10cf_timelocked_balance_EDifferentLabels">EDifferentLabels</a>);

<<<<<<< HEAD:crates/sui-framework/docs/timelock/timelocked_balance.md
// Unpack the time-locked <a href="../sui-framework/balance.md#0x2_balance">balance</a>.
// Unpack the time-locked <a href="../iota-framework/balance.md#0x2_balance">balance</a>.
<b>let</b> (value, _, <a href="label.md#0x10cf_label">label</a>) = <a href="timelock.md#0x10cf_timelock_unpack">timelock::unpack</a>(other);

// Destroy the labels.
<a href="label.md#0x10cf_label_destroy_opt">label::destroy_opt</a>(<a href="label.md#0x10cf_label">label</a>);
=======
// Unpack the time-locked <a href="../iota-framework/balance.md#0x2_balance">balance</a>.
<b>let</b> (value, _) = <a href="timelock.md#0x10cf_timelock_unpack">timelock::unpack</a>(other);
>>>>>>> develop:crates/iota-framework/docs/timelock/timelocked_balance.md

// Join the balances.
self.locked_mut().<a href="timelocked_balance.md#0x10cf_timelocked_balance_join">join</a>(value);
Expand Down Expand Up @@ -148,13 +137,8 @@ Split a <code>TimeLock&lt;Balance&lt;T&gt;&gt;</code> and take a sub balance fro
// Split the locked <a href="../iota-framework/balance.md#0x2_balance">balance</a>.
<b>let</b> value = self.locked_mut().<a href="timelocked_balance.md#0x10cf_timelocked_balance_split">split</a>(value);

<<<<<<< HEAD:crates/sui-framework/docs/timelock/timelocked_balance.md
// Pack the splitted <a href="../sui-framework/balance.md#0x2_balance">balance</a> into a <a href="timelock.md#0x10cf_timelock">timelock</a>.
<a href="timelock.md#0x10cf_timelock_pack">timelock::pack</a>(value, self.expiration_timestamp_ms(), <a href="label.md#0x10cf_label_clone_opt">label::clone_opt</a>(self.<a href="label.md#0x10cf_label">label</a>()), ctx)
=======
// Pack the splitted <a href="../iota-framework/balance.md#0x2_balance">balance</a> into a <a href="timelock.md#0x10cf_timelock">timelock</a>.
<a href="timelock.md#0x10cf_timelock_pack">timelock::pack</a>(value, self.expiration_timestamp_ms(), ctx)
>>>>>>> develop:crates/iota-framework/docs/timelock/timelocked_balance.md
<a href="timelock.md#0x10cf_timelock_pack">timelock::pack</a>(value, self.expiration_timestamp_ms(), <a href="label.md#0x10cf_label_clone_opt">label::clone_opt</a>(self.<a href="label.md#0x10cf_label">label</a>()), ctx)
}
</code></pre>

Expand Down
Loading

0 comments on commit 6369cb3

Please sign in to comment.