Skip to content

Commit b1d7f3c

Browse files
committed
chore(target_chains/sui): update iota_testnet move.toml and use iota libs
1 parent 5fbca94 commit b1d7f3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+343
-335
lines changed

target_chains/sui/vendor/wormhole_iota_testnet/examples/coins/sources/coin.move

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
#[test_only]
44
module coins::coin {
5-
use sui::object::{Self};
6-
use sui::package::{Self};
7-
use sui::transfer::{Self};
8-
use sui::tx_context::{Self, TxContext};
5+
use iota::object::{Self};
6+
use iota::package::{Self};
7+
use iota::transfer::{Self};
8+
use iota::tx_context::{Self, TxContext};
99

1010
use token_bridge::create_wrapped::{Self};
1111

@@ -43,9 +43,9 @@ module coins::coin {
4343

4444
#[test_only]
4545
module coins::coin_tests {
46-
use sui::coin::{Self};
47-
use sui::package::{UpgradeCap};
48-
use sui::test_scenario::{Self};
46+
use iota::coin::{Self};
47+
use iota::package::{UpgradeCap};
48+
use iota::test_scenario::{Self};
4949
use token_bridge::create_wrapped::{Self, WrappedAssetSetup};
5050
use token_bridge::state::{Self};
5151
use token_bridge::token_bridge_scenario::{

target_chains/sui/vendor/wormhole_iota_testnet/examples/coins/sources/coin_10.move

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module coins::coin_10 {
22
use std::option;
3-
use sui::coin::{Self, TreasuryCap, CoinMetadata};
4-
use sui::transfer;
5-
use sui::tx_context::{Self, TxContext};
3+
use iota::coin::{Self, TreasuryCap, CoinMetadata};
4+
use iota::transfer;
5+
use iota::tx_context::{Self, TxContext};
66

77
/// The type identifier of coin. The coin will have a type
88
/// tag of kind: `Coin<package_object::coin_10::COIN_10>`
@@ -47,7 +47,7 @@ module coins::coin_10 {
4747

4848
#[test_only]
4949
module coins::coin_10_tests {
50-
use sui::test_scenario::{Self};
50+
use iota::test_scenario::{Self};
5151

5252
use coins::coin_10::{Self};
5353

target_chains/sui/vendor/wormhole_iota_testnet/examples/coins/sources/coin_8.move

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module coins::coin_8 {
22
use std::option::{Self};
3-
use sui::coin::{Self, TreasuryCap, CoinMetadata};
4-
use sui::transfer::{Self};
5-
use sui::tx_context::{Self, TxContext};
3+
use iota::coin::{Self, TreasuryCap, CoinMetadata};
4+
use iota::transfer::{Self};
5+
use iota::tx_context::{Self, TxContext};
66

77
/// The type identifier of coin. The coin will have a type
88
/// tag of kind: `Coin<package_object::coin_8::COIN_8>`
@@ -47,7 +47,7 @@ module coins::coin_8 {
4747

4848
#[test_only]
4949
module coins::coin_8_tests {
50-
use sui::test_scenario::{Self};
50+
use iota::test_scenario::{Self};
5151

5252
use coins::coin_8::{Self};
5353

target_chains/sui/vendor/wormhole_iota_testnet/examples/core_messages/sources/sender.move

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/// A simple contracts that demonstrates how to send messages with wormhole.
22
module core_messages::sender {
3-
use sui::clock::{Clock};
4-
use sui::coin::{Self};
5-
use sui::object::{Self, UID};
6-
use sui::transfer::{Self};
7-
use sui::tx_context::{TxContext};
3+
use iota::clock::{Clock};
4+
use iota::coin::{Self};
5+
use iota::object::{Self, UID};
6+
use iota::transfer::{Self};
7+
use iota::tx_context::{TxContext};
88
use wormhole::emitter::{Self, EmitterCap};
99
use wormhole::state::{State as WormholeState};
1010

@@ -74,7 +74,7 @@ module core_messages::sender {
7474

7575
#[test_only]
7676
module core_messages::sender_test {
77-
use sui::test_scenario::{Self};
77+
use iota::test_scenario::{Self};
7878
use wormhole::wormhole_scenario::{
7979
return_clock,
8080
return_state,

target_chains/sui/vendor/wormhole_iota_testnet/examples/templates/wrapped_coin/sources/coin.move

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module wrapped_coin::coin {
2-
use sui::transfer::{Self};
3-
use sui::tx_context::{Self, TxContext};
2+
use iota::transfer::{Self};
3+
use iota::tx_context::{Self, TxContext};
44

55
use token_bridge::create_wrapped::{Self};
66

target_chains/sui/vendor/wormhole_iota_testnet/token_bridge/sources/attest_token.move

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: Apache 2
22

33
/// This module implements the method `attest_token` which allows someone
4-
/// to send asset metadata of a coin type native to Sui. Part of this process
4+
/// to send asset metadata of a coin type native to Iota. Part of this process
55
/// is registering this asset in the `TokenRegistry`.
66
///
77
/// NOTE: If an asset has not been attested for, it cannot be bridged using
@@ -10,7 +10,7 @@
1010
/// See `asset_meta` module for serialization and deserialization of Wormhole
1111
/// message payload.
1212
module token_bridge::attest_token {
13-
use sui::coin::{CoinMetadata};
13+
use iota::coin::{CoinMetadata};
1414
use wormhole::publish_message::{MessageTicket};
1515

1616
use token_bridge::asset_meta::{Self};
@@ -26,7 +26,7 @@ module token_bridge::attest_token {
2626

2727
/// `attest_token` takes `CoinMetadata` of a coin type and generates a
2828
/// `MessageTicket` with encoded asset metadata for a foreign Token Bridge
29-
/// contract to consume and create a wrapped asset reflecting this Sui
29+
/// contract to consume and create a wrapped asset reflecting this Iota
3030
/// asset. Asset metadata is encoded using `AssetMeta`.
3131
///
3232
/// See `token_registry` and `asset_meta` module for more info.
@@ -110,8 +110,8 @@ module token_bridge::attest_token {
110110
module token_bridge::attest_token_tests {
111111
use std::ascii::{Self};
112112
use std::string::{Self};
113-
use sui::coin::{Self};
114-
use sui::test_scenario::{Self};
113+
use iota::coin::{Self};
114+
use iota::test_scenario::{Self};
115115
use wormhole::publish_message::{Self};
116116
use wormhole::state::{chain_id};
117117

target_chains/sui/vendor/wormhole_iota_testnet/token_bridge/sources/complete_transfer.move

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
/// See `transfer` module for serialization and deserialization of Wormhole
2929
/// message payload.
3030
module token_bridge::complete_transfer {
31-
use sui::balance::{Self, Balance};
32-
use sui::coin::{Self, Coin};
33-
use sui::tx_context::{Self, TxContext};
31+
use iota::balance::{Self, Balance};
32+
use iota::coin::{Self, Coin};
33+
use iota::tx_context::{Self, TxContext};
3434
use wormhole::external_address::{Self, ExternalAddress};
3535

3636
use token_bridge::native_asset::{Self};
@@ -44,7 +44,7 @@ module token_bridge::complete_transfer {
4444
// Requires `handle_complete_transfer`.
4545
friend token_bridge::complete_transfer_with_payload;
4646

47-
/// Transfer not intended to be received on Sui.
47+
/// Transfer not intended to be received on Iota.
4848
const E_TARGET_NOT_SUI: u64 = 0;
4949
/// Input token info does not match registered info.
5050
const E_CANONICAL_TOKEN_INFO_MISMATCH: u64 = 1;
@@ -133,7 +133,7 @@ module token_bridge::complete_transfer {
133133
/// wrapped asset or withdraws balance from native asset custody.
134134
///
135135
/// Depending on whether this coin is a Token Bridge wrapped asset or a
136-
/// natively existing asset on Sui, the coin is either minted or withdrawn
136+
/// natively existing asset on Iota, the coin is either minted or withdrawn
137137
/// from Token Bridge's custody.
138138
public(friend) fun verify_and_bridge_out<CoinType>(
139139
latest_only: &LatestOnly,
@@ -146,7 +146,7 @@ module token_bridge::complete_transfer {
146146
VerifiedAsset<CoinType>,
147147
Balance<CoinType>
148148
) {
149-
// Verify that the intended chain ID for this transfer is for Sui.
149+
// Verify that the intended chain ID for this transfer is for Iota.
150150
assert!(
151151
target_chain == wormhole::state::chain_id(),
152152
E_TARGET_NOT_SUI
@@ -197,8 +197,8 @@ module token_bridge::complete_transfer {
197197
public(friend) fun emit_transfer_redeemed(msg: &TokenBridgeMessage): u16 {
198198
let emitter_chain = vaa::emitter_chain(msg);
199199

200-
// Emit Sui event with `TransferRedeemed`.
201-
sui::event::emit(
200+
// Emit Iota event with `TransferRedeemed`.
201+
iota::event::emit(
202202
TransferRedeemed {
203203
emitter_chain,
204204
emitter_address: vaa::emitter_address(msg),
@@ -257,7 +257,7 @@ module token_bridge::complete_transfer {
257257
};
258258

259259
// Transfer tokens to the recipient.
260-
sui::transfer::public_transfer(
260+
iota::transfer::public_transfer(
261261
coin::from_balance(bridged_out, ctx),
262262
recipient
263263
);
@@ -277,8 +277,8 @@ module token_bridge::complete_transfer {
277277

278278
#[test_only]
279279
module token_bridge::complete_transfer_tests {
280-
use sui::coin::{Self, Coin};
281-
use sui::test_scenario::{Self};
280+
use iota::coin::{Self, Coin};
281+
use iota::test_scenario::{Self};
282282
use wormhole::state::{chain_id};
283283
use wormhole::wormhole_scenario::{parse_and_verify_vaa};
284284

@@ -1148,7 +1148,7 @@ module token_bridge::complete_transfer_tests {
11481148
test_scenario::next_tx(scenario, tx_relayer);
11491149

11501150
// NOTE: this call should revert since the target chain encoded is
1151-
// chain 69 instead of chain 21 (Sui).
1151+
// chain 69 instead of chain 21 (Iota).
11521152
let receipt =
11531153
authorize_transfer<COIN_WRAPPED_12>(
11541154
&mut token_bridge_state,

target_chains/sui/vendor/wormhole_iota_testnet/token_bridge/sources/complete_transfer_with_payload.move

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
/// See `transfer_with_payload` module for serialization and deserialization of
3333
/// Wormhole message payload.
3434
module token_bridge::complete_transfer_with_payload {
35-
use sui::coin::{Self, Coin};
36-
use sui::object::{Self};
37-
use sui::tx_context::{TxContext};
35+
use iota::coin::{Self, Coin};
36+
use iota::object::{Self};
37+
use iota::tx_context::{TxContext};
3838
use wormhole::emitter::{EmitterCap};
3939

4040
use token_bridge::complete_transfer::{Self};
@@ -183,9 +183,9 @@ module token_bridge::complete_transfer_with_payload {
183183

184184
#[test_only]
185185
module token_bridge::complete_transfer_with_payload_tests {
186-
use sui::coin::{Self};
187-
use sui::object::{Self};
188-
use sui::test_scenario::{Self};
186+
use iota::coin::{Self};
187+
use iota::object::{Self};
188+
use iota::test_scenario::{Self};
189189
use wormhole::emitter::{Self};
190190
use wormhole::state::{chain_id};
191191
use wormhole::wormhole_scenario::{new_emitter, parse_and_verify_vaa};
@@ -229,7 +229,7 @@ module token_bridge::complete_transfer_with_payload_tests {
229229
let wormhole_fee = 350;
230230
set_up_wormhole_and_token_bridge(scenario, wormhole_fee);
231231

232-
// Register Sui as a foreign emitter.
232+
// Register Iota as a foreign emitter.
233233
let expected_source_chain = 2;
234234
register_dummy_emitter(scenario, expected_source_chain);
235235

@@ -710,7 +710,7 @@ module token_bridge::complete_transfer_with_payload_tests {
710710
let wormhole_fee = 350;
711711
set_up_wormhole_and_token_bridge(scenario, wormhole_fee);
712712

713-
// Register Sui as a foreign emitter.
713+
// Register Iota as a foreign emitter.
714714
let expected_source_chain = 2;
715715
register_dummy_emitter(scenario, expected_source_chain);
716716

target_chains/sui/vendor/wormhole_iota_testnet/token_bridge/sources/create_wrapped.move

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
/// See `state` and `wrapped_asset` modules for more details.
2828
///
2929
/// References:
30-
/// https://examples.sui.io/basics/one-time-witness.html
30+
/// https://examples.iota.io/basics/one-time-witness.html
3131
module token_bridge::create_wrapped {
3232
use std::ascii::{Self};
3333
use std::option::{Self};
3434
use std::type_name::{Self};
35-
use sui::coin::{Self, TreasuryCap, CoinMetadata};
36-
use sui::object::{Self, UID};
37-
use sui::package::{UpgradeCap};
38-
use sui::transfer::{Self};
39-
use sui::tx_context::{TxContext};
35+
use iota::coin::{Self, TreasuryCap, CoinMetadata};
36+
use iota::object::{Self, UID};
37+
use iota::package::{UpgradeCap};
38+
use iota::transfer::{Self};
39+
use iota::tx_context::{TxContext};
4040

4141
use token_bridge::asset_meta::{Self};
4242
use token_bridge::normalized_amount::{max_decimals};
@@ -102,7 +102,7 @@ module token_bridge::create_wrapped {
102102
// resembles the same check for `coin::create_currency`.
103103
// Technically this check is redundant as it's performed by
104104
// `coin::create_currency` below, but it doesn't hurt.
105-
assert!(sui::types::is_one_time_witness(&witness), E_BAD_WITNESS);
105+
assert!(iota::types::is_one_time_witness(&witness), E_BAD_WITNESS);
106106

107107
// Ensure that the decimals passed into this method do not exceed max
108108
// decimals (see `normalized_amount` module).
@@ -174,7 +174,7 @@ module token_bridge::create_wrapped {
174174

175175
// `register_wrapped_asset` uses `token_registry::add_new_wrapped`,
176176
// which will check whether the asset has already been registered and if
177-
// the token chain ID is not Sui's.
177+
// the token chain ID is not Iota's.
178178
//
179179
// If both of these conditions are met, `register_wrapped_asset` will
180180
// succeed and the new wrapped coin will be registered.
@@ -242,7 +242,7 @@ module token_bridge::create_wrapped {
242242
);
243243

244244
let upgrade_cap =
245-
sui::package::test_publish(
245+
iota::package::test_publish(
246246
object::id_from_address(@token_bridge),
247247
ctx
248248
);
@@ -280,10 +280,10 @@ module token_bridge::create_wrapped {
280280

281281
#[test_only]
282282
module token_bridge::create_wrapped_tests {
283-
use sui::coin::{Self};
284-
use sui::test_scenario::{Self};
285-
use sui::test_utils::{Self};
286-
use sui::tx_context::{Self};
283+
use iota::coin::{Self};
284+
use iota::test_scenario::{Self};
285+
use iota::test_utils::{Self};
286+
use iota::tx_context::{Self};
287287
use wormhole::wormhole_scenario::{parse_and_verify_vaa};
288288

289289
use token_bridge::asset_meta::{Self};

target_chains/sui/vendor/wormhole_iota_testnet/token_bridge/sources/datatypes/normalized_amount.move

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/// For inbound transfers, this amount will be denormalized (scaled by the same
99
/// decimal difference).
1010
module token_bridge::normalized_amount {
11-
use sui::math::{Self};
11+
use iota::math::{Self};
1212
use wormhole::bytes32::{Self};
1313
use wormhole::cursor::{Cursor};
1414

0 commit comments

Comments
 (0)