From 1d7cd737ca42022454a5f288fddb4fc2af22cde2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Sousa?= Date: Wed, 17 Apr 2024 19:30:13 +0100 Subject: [PATCH 1/9] logs for debugging --- scripts/utils.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/utils.js b/scripts/utils.js index 58cf84fd..078959fa 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -50,7 +50,12 @@ function getConfig(packagePath, envAlias) { function setConfig(packagePath, envAlias, config) { if(!configs[packagePath]) { + if (fs.existsSync(`${__dirname}/../info/${packagePath}.json`)) { + console.log(`config for ${packagePath} is:`); + console.log(fs.readFileSync(`${__dirname}/../info/${packagePath}.json`)); + } configs[packagePath] = fs.existsSync(`${__dirname}/../info/${packagePath}.json`) ? require(`${__dirname}/../info/${packagePath}.json`) : {}; + console.log(configs[packagePath]); } configs[packagePath][envAlias] = config; From 882f23f1b0ab1a16f836acf53a2bce8b5e56e76a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Sousa?= Date: Wed, 17 Apr 2024 19:36:59 +0100 Subject: [PATCH 2/9] addendum --- scripts/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils.js b/scripts/utils.js index 078959fa..cbed92eb 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -52,7 +52,7 @@ function setConfig(packagePath, envAlias, config) { if(!configs[packagePath]) { if (fs.existsSync(`${__dirname}/../info/${packagePath}.json`)) { console.log(`config for ${packagePath} is:`); - console.log(fs.readFileSync(`${__dirname}/../info/${packagePath}.json`)); + console.log(fs.readFileSync(`${__dirname}/../info/${packagePath}.json`, 'utf8')); } configs[packagePath] = fs.existsSync(`${__dirname}/../info/${packagePath}.json`) ? require(`${__dirname}/../info/${packagePath}.json`) : {}; console.log(configs[packagePath]); From 3e4ffcb80dcc612e86e50bc09409d56188f25489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Sousa?= Date: Wed, 17 Apr 2024 19:40:08 +0100 Subject: [PATCH 3/9] addendum --- scripts/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/utils.js b/scripts/utils.js index cbed92eb..4c3e65f0 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -51,8 +51,8 @@ function getConfig(packagePath, envAlias) { function setConfig(packagePath, envAlias, config) { if(!configs[packagePath]) { if (fs.existsSync(`${__dirname}/../info/${packagePath}.json`)) { - console.log(`config for ${packagePath} is:`); - console.log(fs.readFileSync(`${__dirname}/../info/${packagePath}.json`, 'utf8')); + const content = fs.readFileSync(`${__dirname}/../info/${packagePath}.json`, 'utf8'); + console.log(`config for ${packagePath} is: "${content}"`); } configs[packagePath] = fs.existsSync(`${__dirname}/../info/${packagePath}.json`) ? require(`${__dirname}/../info/${packagePath}.json`) : {}; console.log(configs[packagePath]); From 2c43f209728396eaea2f5e6c5bb503dce78fbad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Sousa?= Date: Wed, 17 Apr 2024 19:48:36 +0100 Subject: [PATCH 4/9] test --- scripts/utils.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/utils.js b/scripts/utils.js index 4c3e65f0..d8b420e0 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -50,12 +50,11 @@ function getConfig(packagePath, envAlias) { function setConfig(packagePath, envAlias, config) { if(!configs[packagePath]) { - if (fs.existsSync(`${__dirname}/../info/${packagePath}.json`)) { - const content = fs.readFileSync(`${__dirname}/../info/${packagePath}.json`, 'utf8'); - console.log(`config for ${packagePath} is: "${content}"`); + try { + configs[packagePath] = require(`${__dirname}/../info/${packagePath}.json`); + } catch(e) { + configs[packagePath] = {}; } - configs[packagePath] = fs.existsSync(`${__dirname}/../info/${packagePath}.json`) ? require(`${__dirname}/../info/${packagePath}.json`) : {}; - console.log(configs[packagePath]); } configs[packagePath][envAlias] = config; From 73020b6642e0fcc7848250d647efeb3075ff5c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Sousa?= Date: Wed, 17 Apr 2024 22:18:02 +0100 Subject: [PATCH 5/9] improve error parsing --- move/axelar/Move.toml | 4 ++-- scripts/utils.js | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/move/axelar/Move.toml b/move/axelar/Move.toml index 94957137..265399dc 100644 --- a/move/axelar/Move.toml +++ b/move/axelar/Move.toml @@ -1,11 +1,11 @@ [package] name = "Axelar" version = "0.0.1" -published-at = "0x8a75ac2fd52e8da52da590b2143ae74f945683b2b8d505eb91925598d834afe4" +published-at = "0xf39b12b334eb0711fb6897f758fea3e100533899cfb35cecfc6e1fd690dcd8c7" edition = "2024.alpha" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/mainnet" } [addresses] -axelar = "0x8a75ac2fd52e8da52da590b2143ae74f945683b2b8d505eb91925598d834afe4" \ No newline at end of file +axelar = "0x0" \ No newline at end of file diff --git a/scripts/utils.js b/scripts/utils.js index d8b420e0..f76bc1c0 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -53,7 +53,14 @@ function setConfig(packagePath, envAlias, config) { try { configs[packagePath] = require(`${__dirname}/../info/${packagePath}.json`); } catch(e) { - configs[packagePath] = {}; + switch (e.code) { + case 'MODULE_NOT_FOUND': + case undefined: + configs[packagePath] = {}; + break; + default: + throw e; + } } } configs[packagePath][envAlias] = config; From 193574b2f970d6a3b3f7004e461baf4858a41fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Sousa?= Date: Wed, 17 Apr 2024 22:18:59 +0100 Subject: [PATCH 6/9] cleanup --- move/axelar/Move.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/move/axelar/Move.toml b/move/axelar/Move.toml index 265399dc..94957137 100644 --- a/move/axelar/Move.toml +++ b/move/axelar/Move.toml @@ -1,11 +1,11 @@ [package] name = "Axelar" version = "0.0.1" -published-at = "0xf39b12b334eb0711fb6897f758fea3e100533899cfb35cecfc6e1fd690dcd8c7" +published-at = "0x8a75ac2fd52e8da52da590b2143ae74f945683b2b8d505eb91925598d834afe4" edition = "2024.alpha" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/mainnet" } [addresses] -axelar = "0x0" \ No newline at end of file +axelar = "0x8a75ac2fd52e8da52da590b2143ae74f945683b2b8d505eb91925598d834afe4" \ No newline at end of file From 151993fd3bdb471fcb3bac4b06cc2df42fcca615 Mon Sep 17 00:00:00 2001 From: Foivos Date: Thu, 18 Apr 2024 07:12:25 +0300 Subject: [PATCH 7/9] update sui version --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8b8a5898..474c2d03 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,7 +15,7 @@ jobs: - name: Download and Install Sui Binary run: | - wget https://github.com/MystenLabs/sui/releases/download/mainnet-v1.19.1/sui-mainnet-v1.19.1-ubuntu-x86_64.tgz + wget https://github.com/MystenLabs/sui/releases/download/mainnet-v1.22.0/sui-mainnet-v1.22.0-ubuntu-x86_64.tgz tar -xvf sui-mainnet-v1.19.1-ubuntu-x86_64.tgz sudo mv ./target/release/sui-test-validator-ubuntu-x86_64 /usr/local/bin/sui-test-validator sudo mv ./target/release/sui-ubuntu-x86_64 /usr/local/bin/sui From 530b2567be9f51360b99e564a145114a4bd02143 Mon Sep 17 00:00:00 2001 From: Foivos Date: Thu, 18 Apr 2024 07:13:26 +0300 Subject: [PATCH 8/9] fix tests workflow --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 474c2d03..06488f4e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,12 +16,12 @@ jobs: - name: Download and Install Sui Binary run: | wget https://github.com/MystenLabs/sui/releases/download/mainnet-v1.22.0/sui-mainnet-v1.22.0-ubuntu-x86_64.tgz - tar -xvf sui-mainnet-v1.19.1-ubuntu-x86_64.tgz + tar -xvf sui-mainnet-v1.22.0-ubuntu-x86_64.tgz sudo mv ./target/release/sui-test-validator-ubuntu-x86_64 /usr/local/bin/sui-test-validator sudo mv ./target/release/sui-ubuntu-x86_64 /usr/local/bin/sui - name: Cleanup - run: rm -rf sui-mainnet-v1.19.1-ubuntu-x86_64.tgz + run: rm -rf sui-mainnet-v1.22.0-ubuntu-x86_64.tgz - name: Setup Node uses: actions/setup-node@v3 From cf6c8d639f6d60d7d33ee6f111d1662ba0410b28 Mon Sep 17 00:00:00 2001 From: Foivos Date: Thu, 18 Apr 2024 07:22:44 +0300 Subject: [PATCH 9/9] fix tests --- move/abi/sources/abi.move | 1 - move/its/sources/discovery.move | 12 +++++++----- move/its/tests/coin_init_test.move | 3 --- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/move/abi/sources/abi.move b/move/abi/sources/abi.move index 1ec4eca6..252088e1 100644 --- a/move/abi/sources/abi.move +++ b/move/abi/sources/abi.move @@ -1,5 +1,4 @@ module abi::abi { - use std::vector; public struct AbiReader has copy, drop { bytes: vector, diff --git a/move/its/sources/discovery.move b/move/its/sources/discovery.move index 04e153d2..2fe393ed 100644 --- a/move/its/sources/discovery.move +++ b/move/its/sources/discovery.move @@ -183,8 +183,9 @@ module its::discovery { let type_arg = std::type_name::get(); its.test_add_registered_coin_type(its::token_id::from_address(token_id), type_arg); - let call_info = get_call_info(&its, payload); - assert!(get_call_info(&its, payload) == get_interchain_transfer_tx(&its, &abi::new_reader(payload)), 1); + let mut tx_block = get_call_info(&its, payload); + assert!(tx_block == vector[get_interchain_transfer_tx(&its, &abi::new_reader(payload))], 1); + let call_info = vector::pop_back(&mut tx_block); assert!(call_info.function().package_id() == its_package_id(), 2); assert!(call_info.function().module_name() == ascii::string(b"service"), 3); @@ -235,7 +236,7 @@ module its::discovery { let payload = writer.into_bytes(); its.test_add_registered_coin_type(its::token_id::from_address(token_id), std::type_name::get()); - assert!(get_call_info(&its, payload) == get_interchain_transfer_tx(&its, &abi::new_reader(payload)), 1); + assert!(get_call_info(&its, payload) == vector[get_interchain_transfer_tx(&its, &abi::new_reader(payload))], 1); sui::test_utils::destroy(its); sui::test_utils::destroy(discovery); @@ -266,9 +267,10 @@ module its::discovery { let type_arg = std::type_name::get(); its.test_add_unregistered_coin_type(its::token_id::unregistered_token_id(&ascii::string(symbol), (decimals as u8)), type_arg); - let call_info = get_call_info(&its, payload); - assert!(get_call_info(&its, payload) == get_deploy_interchain_token_tx(&its, &abi::new_reader(payload)), 1); + let mut tx_block = get_call_info(&its, payload); + assert!(tx_block == vector[get_deploy_interchain_token_tx(&its, &abi::new_reader(payload))], 1); + let call_info = vector::pop_back(&mut tx_block); assert!(call_info.function().package_id() == its_package_id(), 2); assert!(call_info.function().module_name() == ascii::string(b"service"), 3); assert!(call_info.function().name() == ascii::string(b"receive_deploy_interchain_token"), 4); diff --git a/move/its/tests/coin_init_test.move b/move/its/tests/coin_init_test.move index a9b16210..306648d1 100644 --- a/move/its/tests/coin_init_test.move +++ b/move/its/tests/coin_init_test.move @@ -1,10 +1,7 @@ #[test_only] module its::thecool1234coin___ { - use sui::tx_context::{Self, TxContext}; use sui::coin; - use std::option; use sui::url::{Url}; - use sui::transfer; public struct THECOOL1234COIN___ has drop{