From fe90bee259d3fc2d0f44caada425a214d84c2f7d Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Fri, 29 Nov 2024 12:55:42 +0100 Subject: [PATCH] feat(target_chains/aptos): update libs + toolchain to 4.5.0 --- .github/workflows/ci-aptos-contract.yml | 4 ++-- target_chains/aptos/contracts/Move.toml | 12 ++++++------ target_chains/aptos/contracts/sources/pyth.move | 6 ++++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-aptos-contract.yml b/.github/workflows/ci-aptos-contract.yml index 0a5247c78e..8480f92c6b 100644 --- a/.github/workflows/ci-aptos-contract.yml +++ b/.github/workflows/ci-aptos-contract.yml @@ -21,10 +21,10 @@ jobs: - uses: actions/checkout@v3 - name: Download CLI - run: wget https://github.com/aptos-labs/aptos-core/releases/download/aptos-cli-v3.1.0/aptos-cli-3.1.0-Ubuntu-22.04-x86_64.zip + run: wget https://github.com/aptos-labs/aptos-core/releases/download/aptos-cli-v4.5.0/aptos-cli-4.5.0-Ubuntu-22.04-x86_64.zip - name: Unzip CLI - run: unzip aptos-cli-3.1.0-Ubuntu-22.04-x86_64.zip + run: unzip aptos-cli-4.5.0-Ubuntu-22.04-x86_64.zip - name: Run tests run: ./aptos move test diff --git a/target_chains/aptos/contracts/Move.toml b/target_chains/aptos/contracts/Move.toml index 4ff4523252..01a40bdaab 100644 --- a/target_chains/aptos/contracts/Move.toml +++ b/target_chains/aptos/contracts/Move.toml @@ -4,12 +4,12 @@ version = "0.0.1" upgrade_policy = "compatible" [dependencies] -AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-framework/", rev = "6f83bc6d02207298b2dee91133d75538789bf582" } -MoveStdlib = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/move-stdlib/", rev = "6f83bc6d02207298b2dee91133d75538789bf582" } -AptosStdlib = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-stdlib/", rev = "6f83bc6d02207298b2dee91133d75538789bf582" } -AptosToken = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-token/", rev = "6f83bc6d02207298b2dee91133d75538789bf582" } -Wormhole = { git = "https://github.com/wormhole-foundation/wormhole.git", subdir = "aptos/wormhole", rev = "b8676f09a6e4a92bbaecb5f3d59b5e9b778de082" } -Deployer = { git = "https://github.com/wormhole-foundation/wormhole.git", subdir = "aptos/deployer", rev = "b8676f09a6e4a92bbaecb5f3d59b5e9b778de082" } +AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-framework/", rev = "47f0bf397eb5ca43257bfa775a6b28e7b7faf8b3" } +MoveStdlib = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/move-stdlib/", rev = "47f0bf397eb5ca43257bfa775a6b28e7b7faf8b3" } +AptosStdlib = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-stdlib/", rev = "47f0bf397eb5ca43257bfa775a6b28e7b7faf8b3" } +AptosToken = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-token/", rev = "47f0bf397eb5ca43257bfa775a6b28e7b7faf8b3" } +Wormhole = { git = "https://github.com/ali-bahjati/wormhole.git", subdir = "aptos/wormhole", rev = "aptos/upgrade-4.5.0" } +Deployer = { git = "https://github.com/ali-bahjati/wormhole.git", subdir = "aptos/deployer", rev = "aptos/upgrade-4.5.0" } [addresses] pyth = "_" diff --git a/target_chains/aptos/contracts/sources/pyth.move b/target_chains/aptos/contracts/sources/pyth.move index a831643061..0aa501d630 100644 --- a/target_chains/aptos/contracts/sources/pyth.move +++ b/target_chains/aptos/contracts/sources/pyth.move @@ -551,6 +551,8 @@ module pyth::pyth_test { data_sources: vector, update_fee: u64, to_mint: u64): (BurnCapability, MintCapability, Coin) { + let (burn_capability, mint_capability) = aptos_coin::initialize_for_test(aptos_framework); + // Initialize wormhole with a large message collection fee wormhole::wormhole_test::setup(100000); @@ -563,7 +565,6 @@ module pyth::pyth_test { let (_pyth, signer_capability) = account::create_resource_account(&deployer, b"pyth"); pyth::init_test(signer_capability, stale_price_threshold, governance_emitter_chain_id, governance_emitter_address, data_sources, update_fee); - let (burn_capability, mint_capability) = aptos_coin::initialize_for_test(aptos_framework); let coins = coin::mint(to_mint, &mint_capability); (burn_capability, mint_capability, coins) } @@ -753,6 +754,8 @@ module pyth::pyth_test { to_mint: u64 ): (BurnCapability, MintCapability, Coin) { let aptos_framework_account = std::account::create_account_for_test(@aptos_framework); + let (burn_capability, mint_capability) = aptos_coin::initialize_for_test(aptos_framework); + std::timestamp::set_time_has_started_for_testing(&aptos_framework_account); wormhole::init_test( 22, @@ -777,7 +780,6 @@ module pyth::pyth_test { data_sources, 50); - let (burn_capability, mint_capability) = aptos_coin::initialize_for_test(aptos_framework); let coins = coin::mint(to_mint, &mint_capability); (burn_capability, mint_capability, coins) }