Skip to content

Commit

Permalink
[move] Added u<num> modules (MystenLabs#17883)
Browse files Browse the repository at this point in the history
## Description 

- Added various primitive defining modules for integers.
- Particularly useful with method syntax 

## Test plan 

- TODO

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
  • Loading branch information
tnowacki authored Jun 11, 2024
1 parent 41e224b commit 0b44037
Show file tree
Hide file tree
Showing 110 changed files with 3,340 additions and 2,676 deletions.
84 changes: 42 additions & 42 deletions crates/sui-framework/docs/bridge/bridge.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crates/sui-framework/docs/bridge/chain_ids.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ title: Module `0xb::chain_ids`



<pre><code><b>const</b> <a href="chain_ids.md#0xb_chain_ids_EInvalidBridgeRoute">EInvalidBridgeRoute</a>: u64 = 0;
<pre><code><b>const</b> <a href="chain_ids.md#0xb_chain_ids_EInvalidBridgeRoute">EInvalidBridgeRoute</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 0;
</code></pre>


Expand Down
36 changes: 18 additions & 18 deletions crates/sui-framework/docs/bridge/committee.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ title: Module `0xb::committee`

</dd>
<dt>
<code>last_committee_update_epoch: u64</code>
<code>last_committee_update_epoch: <a href="../move-stdlib/u64.md#0x1_u64">u64</a></code>
</dt>
<dd>

Expand Down Expand Up @@ -129,7 +129,7 @@ title: Module `0xb::committee`

</dd>
<dt>
<code>stake_participation_percentage: u64</code>
<code>stake_participation_percentage: <a href="../move-stdlib/u64.md#0x1_u64">u64</a></code>
</dt>
<dd>

Expand Down Expand Up @@ -168,7 +168,7 @@ title: Module `0xb::committee`
The public key bytes of the bridge key
</dd>
<dt>
<code><a href="../sui-system/voting_power.md#0x3_voting_power">voting_power</a>: u64</code>
<code><a href="../sui-system/voting_power.md#0x3_voting_power">voting_power</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a></code>
</dt>
<dd>
Voting power, values are voting power in the scale of 10000.
Expand Down Expand Up @@ -240,7 +240,7 @@ title: Module `0xb::committee`



<pre><code><b>const</b> <a href="committee.md#0xb_committee_ENotSystemAddress">ENotSystemAddress</a>: u64 = 3;
<pre><code><b>const</b> <a href="committee.md#0xb_committee_ENotSystemAddress">ENotSystemAddress</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 3;
</code></pre>


Expand All @@ -249,7 +249,7 @@ title: Module `0xb::committee`



<pre><code><b>const</b> <a href="committee.md#0xb_committee_EInvalidSignature">EInvalidSignature</a>: u64 = 2;
<pre><code><b>const</b> <a href="committee.md#0xb_committee_EInvalidSignature">EInvalidSignature</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 2;
</code></pre>


Expand All @@ -258,7 +258,7 @@ title: Module `0xb::committee`



<pre><code><b>const</b> <a href="committee.md#0xb_committee_ECDSA_COMPRESSED_PUBKEY_LENGTH">ECDSA_COMPRESSED_PUBKEY_LENGTH</a>: u64 = 33;
<pre><code><b>const</b> <a href="committee.md#0xb_committee_ECDSA_COMPRESSED_PUBKEY_LENGTH">ECDSA_COMPRESSED_PUBKEY_LENGTH</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 33;
</code></pre>


Expand All @@ -267,7 +267,7 @@ title: Module `0xb::committee`



<pre><code><b>const</b> <a href="committee.md#0xb_committee_ECommitteeAlreadyInitiated">ECommitteeAlreadyInitiated</a>: u64 = 7;
<pre><code><b>const</b> <a href="committee.md#0xb_committee_ECommitteeAlreadyInitiated">ECommitteeAlreadyInitiated</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 7;
</code></pre>


Expand All @@ -276,7 +276,7 @@ title: Module `0xb::committee`



<pre><code><b>const</b> <a href="committee.md#0xb_committee_EDuplicatePubkey">EDuplicatePubkey</a>: u64 = 8;
<pre><code><b>const</b> <a href="committee.md#0xb_committee_EDuplicatePubkey">EDuplicatePubkey</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 8;
</code></pre>


Expand All @@ -285,7 +285,7 @@ title: Module `0xb::committee`



<pre><code><b>const</b> <a href="committee.md#0xb_committee_EDuplicatedSignature">EDuplicatedSignature</a>: u64 = 1;
<pre><code><b>const</b> <a href="committee.md#0xb_committee_EDuplicatedSignature">EDuplicatedSignature</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 1;
</code></pre>


Expand All @@ -294,7 +294,7 @@ title: Module `0xb::committee`



<pre><code><b>const</b> <a href="committee.md#0xb_committee_EInvalidPubkeyLength">EInvalidPubkeyLength</a>: u64 = 6;
<pre><code><b>const</b> <a href="committee.md#0xb_committee_EInvalidPubkeyLength">EInvalidPubkeyLength</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 6;
</code></pre>


Expand All @@ -303,7 +303,7 @@ title: Module `0xb::committee`



<pre><code><b>const</b> <a href="committee.md#0xb_committee_ESenderIsNotInBridgeCommittee">ESenderIsNotInBridgeCommittee</a>: u64 = 9;
<pre><code><b>const</b> <a href="committee.md#0xb_committee_ESenderIsNotInBridgeCommittee">ESenderIsNotInBridgeCommittee</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 9;
</code></pre>


Expand All @@ -312,7 +312,7 @@ title: Module `0xb::committee`



<pre><code><b>const</b> <a href="committee.md#0xb_committee_ESenderNotActiveValidator">ESenderNotActiveValidator</a>: u64 = 5;
<pre><code><b>const</b> <a href="committee.md#0xb_committee_ESenderNotActiveValidator">ESenderNotActiveValidator</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 5;
</code></pre>


Expand All @@ -321,7 +321,7 @@ title: Module `0xb::committee`



<pre><code><b>const</b> <a href="committee.md#0xb_committee_ESignatureBelowThreshold">ESignatureBelowThreshold</a>: u64 = 0;
<pre><code><b>const</b> <a href="committee.md#0xb_committee_ESignatureBelowThreshold">ESignatureBelowThreshold</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 0;
</code></pre>


Expand All @@ -330,7 +330,7 @@ title: Module `0xb::committee`



<pre><code><b>const</b> <a href="committee.md#0xb_committee_EValidatorBlocklistContainsUnknownKey">EValidatorBlocklistContainsUnknownKey</a>: u64 = 4;
<pre><code><b>const</b> <a href="committee.md#0xb_committee_EValidatorBlocklistContainsUnknownKey">EValidatorBlocklistContainsUnknownKey</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 4;
</code></pre>


Expand Down Expand Up @@ -495,7 +495,7 @@ title: Module `0xb::committee`



<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="committee.md#0xb_committee_try_create_next_committee">try_create_next_committee</a>(self: &<b>mut</b> <a href="committee.md#0xb_committee_BridgeCommittee">committee::BridgeCommittee</a>, active_validator_voting_power: <a href="../sui-framework/vec_map.md#0x2_vec_map_VecMap">vec_map::VecMap</a>&lt;<b>address</b>, u64&gt;, min_stake_participation_percentage: u64, ctx: &<a href="../sui-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>)
<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="committee.md#0xb_committee_try_create_next_committee">try_create_next_committee</a>(self: &<b>mut</b> <a href="committee.md#0xb_committee_BridgeCommittee">committee::BridgeCommittee</a>, active_validator_voting_power: <a href="../sui-framework/vec_map.md#0x2_vec_map_VecMap">vec_map::VecMap</a>&lt;<b>address</b>, <a href="../move-stdlib/u64.md#0x1_u64">u64</a>&gt;, min_stake_participation_percentage: <a href="../move-stdlib/u64.md#0x1_u64">u64</a>, ctx: &<a href="../sui-framework/tx_context.md#0x2_tx_context_TxContext">tx_context::TxContext</a>)
</code></pre>


Expand All @@ -506,8 +506,8 @@ title: Module `0xb::committee`

<pre><code><b>public</b>(<a href="../sui-framework/package.md#0x2_package">package</a>) <b>fun</b> <a href="committee.md#0xb_committee_try_create_next_committee">try_create_next_committee</a>(
self: &<b>mut</b> <a href="committee.md#0xb_committee_BridgeCommittee">BridgeCommittee</a>,
active_validator_voting_power: VecMap&lt;<b>address</b>, u64&gt;,
min_stake_participation_percentage: u64,
active_validator_voting_power: VecMap&lt;<b>address</b>, <a href="../move-stdlib/u64.md#0x1_u64">u64</a>&gt;,
min_stake_participation_percentage: <a href="../move-stdlib/u64.md#0x1_u64">u64</a>,
ctx: &TxContext
) {
<b>let</b> <b>mut</b> i = 0;
Expand All @@ -528,7 +528,7 @@ title: Module `0xb::committee`
<b>let</b> member = <a href="committee.md#0xb_committee_CommitteeMember">CommitteeMember</a> {
sui_address: registration.sui_address,
bridge_pubkey_bytes: registration.bridge_pubkey_bytes,
<a href="../sui-system/voting_power.md#0x3_voting_power">voting_power</a>: (<a href="../sui-system/voting_power.md#0x3_voting_power">voting_power</a> <b>as</b> u64),
<a href="../sui-system/voting_power.md#0x3_voting_power">voting_power</a>: (<a href="../sui-system/voting_power.md#0x3_voting_power">voting_power</a> <b>as</b> <a href="../move-stdlib/u64.md#0x1_u64">u64</a>),
http_rest_url: registration.http_rest_url,
blocklisted: <b>false</b>,
};
Expand Down
46 changes: 23 additions & 23 deletions crates/sui-framework/docs/bridge/limiter.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ title: Module `0xb::limiter`

<dl>
<dt>
<code>transfer_limits: <a href="../sui-framework/vec_map.md#0x2_vec_map_VecMap">vec_map::VecMap</a>&lt;<a href="chain_ids.md#0xb_chain_ids_BridgeRoute">chain_ids::BridgeRoute</a>, u64&gt;</code>
<code>transfer_limits: <a href="../sui-framework/vec_map.md#0x2_vec_map_VecMap">vec_map::VecMap</a>&lt;<a href="chain_ids.md#0xb_chain_ids_BridgeRoute">chain_ids::BridgeRoute</a>, <a href="../move-stdlib/u64.md#0x1_u64">u64</a>&gt;</code>
</dt>
<dd>

Expand Down Expand Up @@ -78,25 +78,25 @@ title: Module `0xb::limiter`

<dl>
<dt>
<code>hour_head: u64</code>
<code>hour_head: <a href="../move-stdlib/u64.md#0x1_u64">u64</a></code>
</dt>
<dd>

</dd>
<dt>
<code>hour_tail: u64</code>
<code>hour_tail: <a href="../move-stdlib/u64.md#0x1_u64">u64</a></code>
</dt>
<dd>

</dd>
<dt>
<code>per_hour_amounts: <a href="../move-stdlib/vector.md#0x1_vector">vector</a>&lt;u64&gt;</code>
<code>per_hour_amounts: <a href="../move-stdlib/vector.md#0x1_vector">vector</a>&lt;<a href="../move-stdlib/u64.md#0x1_u64">u64</a>&gt;</code>
</dt>
<dd>

</dd>
<dt>
<code>total_amount: u64</code>
<code>total_amount: <a href="../move-stdlib/u64.md#0x1_u64">u64</a></code>
</dt>
<dd>

Expand Down Expand Up @@ -135,7 +135,7 @@ title: Module `0xb::limiter`

</dd>
<dt>
<code>new_limit: u64</code>
<code>new_limit: <a href="../move-stdlib/u64.md#0x1_u64">u64</a></code>
</dt>
<dd>

Expand All @@ -154,7 +154,7 @@ title: Module `0xb::limiter`



<pre><code><b>const</b> <a href="limiter.md#0xb_limiter_ELimitNotFoundForRoute">ELimitNotFoundForRoute</a>: u64 = 0;
<pre><code><b>const</b> <a href="limiter.md#0xb_limiter_ELimitNotFoundForRoute">ELimitNotFoundForRoute</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 0;
</code></pre>


Expand All @@ -163,7 +163,7 @@ title: Module `0xb::limiter`



<pre><code><b>const</b> <a href="limiter.md#0xb_limiter_MAX_TRANSFER_LIMIT">MAX_TRANSFER_LIMIT</a>: u64 = 18446744073709551615;
<pre><code><b>const</b> <a href="limiter.md#0xb_limiter_MAX_TRANSFER_LIMIT">MAX_TRANSFER_LIMIT</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 18446744073709551615;
</code></pre>


Expand All @@ -172,7 +172,7 @@ title: Module `0xb::limiter`



<pre><code><b>const</b> <a href="limiter.md#0xb_limiter_USD_VALUE_MULTIPLIER">USD_VALUE_MULTIPLIER</a>: u64 = 100000000;
<pre><code><b>const</b> <a href="limiter.md#0xb_limiter_USD_VALUE_MULTIPLIER">USD_VALUE_MULTIPLIER</a>: <a href="../move-stdlib/u64.md#0x1_u64">u64</a> = 100000000;
</code></pre>


Expand All @@ -183,7 +183,7 @@ title: Module `0xb::limiter`



<pre><code><b>public</b> <b>fun</b> <a href="limiter.md#0xb_limiter_get_route_limit">get_route_limit</a>(self: &<a href="limiter.md#0xb_limiter_TransferLimiter">limiter::TransferLimiter</a>, route: &<a href="chain_ids.md#0xb_chain_ids_BridgeRoute">chain_ids::BridgeRoute</a>): u64
<pre><code><b>public</b> <b>fun</b> <a href="limiter.md#0xb_limiter_get_route_limit">get_route_limit</a>(self: &<a href="limiter.md#0xb_limiter_TransferLimiter">limiter::TransferLimiter</a>, route: &<a href="chain_ids.md#0xb_chain_ids_BridgeRoute">chain_ids::BridgeRoute</a>): <a href="../move-stdlib/u64.md#0x1_u64">u64</a>
</code></pre>


Expand All @@ -192,7 +192,7 @@ title: Module `0xb::limiter`
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="limiter.md#0xb_limiter_get_route_limit">get_route_limit</a>(self: &<a href="limiter.md#0xb_limiter_TransferLimiter">TransferLimiter</a>, route: &BridgeRoute): u64 {
<pre><code><b>public</b> <b>fun</b> <a href="limiter.md#0xb_limiter_get_route_limit">get_route_limit</a>(self: &<a href="limiter.md#0xb_limiter_TransferLimiter">TransferLimiter</a>, route: &BridgeRoute): <a href="../move-stdlib/u64.md#0x1_u64">u64</a> {
self.transfer_limits[route]
}
</code></pre>
Expand Down Expand Up @@ -235,7 +235,7 @@ title: Module `0xb::limiter`



<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="limiter.md#0xb_limiter_check_and_record_sending_transfer">check_and_record_sending_transfer</a>&lt;T&gt;(self: &<b>mut</b> <a href="limiter.md#0xb_limiter_TransferLimiter">limiter::TransferLimiter</a>, <a href="treasury.md#0xb_treasury">treasury</a>: &<a href="treasury.md#0xb_treasury_BridgeTreasury">treasury::BridgeTreasury</a>, <a href="../sui-framework/clock.md#0x2_clock">clock</a>: &<a href="../sui-framework/clock.md#0x2_clock_Clock">clock::Clock</a>, route: <a href="chain_ids.md#0xb_chain_ids_BridgeRoute">chain_ids::BridgeRoute</a>, amount: u64): bool
<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="limiter.md#0xb_limiter_check_and_record_sending_transfer">check_and_record_sending_transfer</a>&lt;T&gt;(self: &<b>mut</b> <a href="limiter.md#0xb_limiter_TransferLimiter">limiter::TransferLimiter</a>, <a href="treasury.md#0xb_treasury">treasury</a>: &<a href="treasury.md#0xb_treasury_BridgeTreasury">treasury::BridgeTreasury</a>, <a href="../sui-framework/clock.md#0x2_clock">clock</a>: &<a href="../sui-framework/clock.md#0x2_clock_Clock">clock::Clock</a>, route: <a href="chain_ids.md#0xb_chain_ids_BridgeRoute">chain_ids::BridgeRoute</a>, amount: <a href="../move-stdlib/u64.md#0x1_u64">u64</a>): bool
</code></pre>


Expand All @@ -249,7 +249,7 @@ title: Module `0xb::limiter`
<a href="treasury.md#0xb_treasury">treasury</a>: &BridgeTreasury,
<a href="../sui-framework/clock.md#0x2_clock">clock</a>: &Clock,
route: BridgeRoute,
amount: u64
amount: <a href="../move-stdlib/u64.md#0x1_u64">u64</a>
): bool {
// Create record for route <b>if</b> not exists
<b>if</b> (!self.transfer_records.contains(&route)) {
Expand Down Expand Up @@ -289,8 +289,8 @@ title: Module `0xb::limiter`
// Now scale down <b>to</b> notional value
<b>let</b> notional_amount = notional_amount_with_token_multiplier
/ (<a href="treasury.md#0xb_treasury">treasury</a>.decimal_multiplier&lt;T&gt;() <b>as</b> u128);
// Should be safe <b>to</b> downcast <b>to</b> u64 after dividing by the decimals
<b>let</b> notional_amount = (notional_amount <b>as</b> u64);
// Should be safe <b>to</b> downcast <b>to</b> <a href="../move-stdlib/u64.md#0x1_u64">u64</a> after dividing by the decimals
<b>let</b> notional_amount = (notional_amount <b>as</b> <a href="../move-stdlib/u64.md#0x1_u64">u64</a>);

// Record <a href="../sui-framework/transfer.md#0x2_transfer">transfer</a> value
<b>let</b> new_amount = record.per_hour_amounts.pop_back() + notional_amount;
Expand All @@ -310,7 +310,7 @@ title: Module `0xb::limiter`



<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="limiter.md#0xb_limiter_update_route_limit">update_route_limit</a>(self: &<b>mut</b> <a href="limiter.md#0xb_limiter_TransferLimiter">limiter::TransferLimiter</a>, route: &<a href="chain_ids.md#0xb_chain_ids_BridgeRoute">chain_ids::BridgeRoute</a>, new_usd_limit: u64)
<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="limiter.md#0xb_limiter_update_route_limit">update_route_limit</a>(self: &<b>mut</b> <a href="limiter.md#0xb_limiter_TransferLimiter">limiter::TransferLimiter</a>, route: &<a href="chain_ids.md#0xb_chain_ids_BridgeRoute">chain_ids::BridgeRoute</a>, new_usd_limit: <a href="../move-stdlib/u64.md#0x1_u64">u64</a>)
</code></pre>


Expand All @@ -322,7 +322,7 @@ title: Module `0xb::limiter`
<pre><code><b>public</b>(<a href="../sui-framework/package.md#0x2_package">package</a>) <b>fun</b> <a href="limiter.md#0xb_limiter_update_route_limit">update_route_limit</a>(
self: &<b>mut</b> <a href="limiter.md#0xb_limiter_TransferLimiter">TransferLimiter</a>,
route: &BridgeRoute,
new_usd_limit: u64
new_usd_limit: <a href="../move-stdlib/u64.md#0x1_u64">u64</a>
) {
<b>let</b> receiving_chain = *route.destination();

Expand Down Expand Up @@ -350,7 +350,7 @@ title: Module `0xb::limiter`



<pre><code><b>fun</b> <a href="limiter.md#0xb_limiter_current_hour_since_epoch">current_hour_since_epoch</a>(<a href="../sui-framework/clock.md#0x2_clock">clock</a>: &<a href="../sui-framework/clock.md#0x2_clock_Clock">clock::Clock</a>): u64
<pre><code><b>fun</b> <a href="limiter.md#0xb_limiter_current_hour_since_epoch">current_hour_since_epoch</a>(<a href="../sui-framework/clock.md#0x2_clock">clock</a>: &<a href="../sui-framework/clock.md#0x2_clock_Clock">clock::Clock</a>): <a href="../move-stdlib/u64.md#0x1_u64">u64</a>
</code></pre>


Expand All @@ -359,7 +359,7 @@ title: Module `0xb::limiter`
<summary>Implementation</summary>


<pre><code><b>fun</b> <a href="limiter.md#0xb_limiter_current_hour_since_epoch">current_hour_since_epoch</a>(<a href="../sui-framework/clock.md#0x2_clock">clock</a>: &Clock): u64 {
<pre><code><b>fun</b> <a href="limiter.md#0xb_limiter_current_hour_since_epoch">current_hour_since_epoch</a>(<a href="../sui-framework/clock.md#0x2_clock">clock</a>: &Clock): <a href="../move-stdlib/u64.md#0x1_u64">u64</a> {
<a href="../sui-framework/clock.md#0x2_clock_timestamp_ms">clock::timestamp_ms</a>(<a href="../sui-framework/clock.md#0x2_clock">clock</a>) / 3600000
}
</code></pre>
Expand All @@ -374,7 +374,7 @@ title: Module `0xb::limiter`



<pre><code><b>fun</b> <a href="limiter.md#0xb_limiter_adjust_transfer_records">adjust_transfer_records</a>(self: &<b>mut</b> <a href="limiter.md#0xb_limiter_TransferRecord">limiter::TransferRecord</a>, current_hour_since_epoch: u64)
<pre><code><b>fun</b> <a href="limiter.md#0xb_limiter_adjust_transfer_records">adjust_transfer_records</a>(self: &<b>mut</b> <a href="limiter.md#0xb_limiter_TransferRecord">limiter::TransferRecord</a>, current_hour_since_epoch: <a href="../move-stdlib/u64.md#0x1_u64">u64</a>)
</code></pre>


Expand All @@ -383,7 +383,7 @@ title: Module `0xb::limiter`
<summary>Implementation</summary>


<pre><code><b>fun</b> <a href="limiter.md#0xb_limiter_adjust_transfer_records">adjust_transfer_records</a>(self: &<b>mut</b> <a href="limiter.md#0xb_limiter_TransferRecord">TransferRecord</a>, current_hour_since_epoch: u64) {
<pre><code><b>fun</b> <a href="limiter.md#0xb_limiter_adjust_transfer_records">adjust_transfer_records</a>(self: &<b>mut</b> <a href="limiter.md#0xb_limiter_TransferRecord">TransferRecord</a>, current_hour_since_epoch: <a href="../move-stdlib/u64.md#0x1_u64">u64</a>) {
<b>if</b> (self.hour_head == current_hour_since_epoch) {
<b>return</b> // nothing <b>to</b> backfill
};
Expand Down Expand Up @@ -426,7 +426,7 @@ title: Module `0xb::limiter`



<pre><code><b>fun</b> <a href="limiter.md#0xb_limiter_initial_transfer_limits">initial_transfer_limits</a>(): <a href="../sui-framework/vec_map.md#0x2_vec_map_VecMap">vec_map::VecMap</a>&lt;<a href="chain_ids.md#0xb_chain_ids_BridgeRoute">chain_ids::BridgeRoute</a>, u64&gt;
<pre><code><b>fun</b> <a href="limiter.md#0xb_limiter_initial_transfer_limits">initial_transfer_limits</a>(): <a href="../sui-framework/vec_map.md#0x2_vec_map_VecMap">vec_map::VecMap</a>&lt;<a href="chain_ids.md#0xb_chain_ids_BridgeRoute">chain_ids::BridgeRoute</a>, <a href="../move-stdlib/u64.md#0x1_u64">u64</a>&gt;
</code></pre>


Expand All @@ -435,7 +435,7 @@ title: Module `0xb::limiter`
<summary>Implementation</summary>


<pre><code><b>fun</b> <a href="limiter.md#0xb_limiter_initial_transfer_limits">initial_transfer_limits</a>(): VecMap&lt;BridgeRoute, u64&gt; {
<pre><code><b>fun</b> <a href="limiter.md#0xb_limiter_initial_transfer_limits">initial_transfer_limits</a>(): VecMap&lt;BridgeRoute, <a href="../move-stdlib/u64.md#0x1_u64">u64</a>&gt; {
<b>let</b> <b>mut</b> transfer_limits = <a href="../sui-framework/vec_map.md#0x2_vec_map_empty">vec_map::empty</a>();
// 5M limit on Sui -&gt; Ethereum mainnet
transfer_limits.insert(
Expand Down
Loading

0 comments on commit 0b44037

Please sign in to comment.