Skip to content

Commit

Permalink
Merge pull request #90 from Elements-Studio/fix-ci-err
Browse files Browse the repository at this point in the history
Fix ci test err
  • Loading branch information
element2050 authored Nov 30, 2022
2 parents 0dad231 + 088d0f3 commit ca94c57
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 16 deletions.
4 changes: 0 additions & 4 deletions aptos/bridge-mock/Move.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ version = "1.0.0"

[addresses]
bridge = "0xc755e4c8d7a6ab6d56f9289d97c43c1c94bde75ec09147c90d35cd1be61c8fb9"
move_std = "0x1"
aptos_framework = "0x1"
aptos_std = "0x1"
aptos_token = "0x3"

[dependencies]
AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "01108a2345b87d539d54a67b32db55193f9ace40", subdir = "aptos-move/framework/aptos-framework"}
2 changes: 2 additions & 0 deletions aptos/bridge/Move.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ version = "1.0.0"
bridge = "0xf22bede237a07e121b56d91a491eb7bcdfd1f5907926a9e58338f964a01b17fa"

[dependencies]
AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "01108a2345b87d539d54a67b32db55193f9ace40", subdir = "aptos-move/framework/aptos-framework"}

51 changes: 51 additions & 0 deletions aptos/bridge/sources/asset.move
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,55 @@ module bridge::asset {

struct WETH {}
struct WBTC {}



#[test_only]
use aptos_framework::coin::{Self};
#[test_only]
use aptos_framework::managed_coin;
#[test_only]
use std::signer;

#[test_only]
/// precision of USDT token.
const PRECISION: u8 = 6;


#[test_only]
public fun init(account: &signer) {
managed_coin::initialize<USDT>(
account,
b"USDT Coin",
b"USDT",
PRECISION,
true,
);
coin::register<USDT>(account);
}

#[test_only]
public fun mint(account: &signer, amount: u128) {
let dst_addr = signer::address_of(account);
managed_coin::mint<USDT>(account, dst_addr, (amount as u64))
}

#[test_only]
public fun init_usdc(account: &signer) {
managed_coin::initialize<USDC>(
account,
b"USDC Coin",
b"USDC",
PRECISION,
true,
);
coin::register<USDC>(account);
}

#[test_only]
public fun mint_usdc(account: &signer, amount: u128) {
let dst_addr = signer::address_of(account);
managed_coin::mint<USDC>(account, dst_addr, (amount as u64))
}

}
4 changes: 0 additions & 4 deletions aptos/core/Move.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ version = "1.0.0"
[addresses]
SwapAdmin = "0xc755e4c8d7a6ab6d56f9289d97c43c1c94bde75ec09147c90d35cd1be61c8fb9"
SwapFeeAdmin = "0xc755e4c8d7a6ab6d56f9289d97c43c1c94bde75ec09147c90d35cd1be61c8fb9"
move_std = "0x1"
aptos_framework = "0x1"
aptos_std = "0x1"
aptos_token = "0x3"

[dependencies]
AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "01108a2345b87d539d54a67b32db55193f9ace40", subdir = "aptos-move/framework/aptos-framework"}
Expand Down
4 changes: 0 additions & 4 deletions aptos/farming/Move.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ version = "1.0.0"

[addresses]
SwapAdmin = "0xc755e4c8d7a6ab6d56f9289d97c43c1c94bde75ec09147c90d35cd1be61c8fb9"
move_std = "0x1"
aptos_framework = "0x1"
aptos_std = "0x1"
aptos_token = "0x3"

[dependencies]
AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "01108a2345b87d539d54a67b32db55193f9ace40", subdir = "aptos-move/framework/aptos-framework"}
Expand Down
12 changes: 8 additions & 4 deletions aptos/farming/sources/Test.move
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ module SwapAdmin::Test {
}


#[test(sender=@SwapAdmin,framework=@aptos_framework,test1=@0x1234)]
public fun Test(sender:&signer,framework:&signer,test1:&signer)acquires AptosCoinCap {
#[test(sender=@SwapAdmin,framework=@aptos_framework,bridge=@bridge,test1=@0x1234)]
public fun Test(sender:&signer,framework:&signer,bridge:&signer,test1:&signer)acquires AptosCoinCap {
account::create_account_for_test(address_of(sender));
account::create_account_for_test(address_of(test1));
account::create_account_for_test(address_of(bridge));

framework_init(sender,framework);

Expand All @@ -70,8 +71,11 @@ module SwapAdmin::Test {

timestamp::update_global_time_for_test_secs(get_genesis_timestamp());

asset::init_usdc(sender);
asset::mint_usdc(sender, 1000 * 1000 * 1000 * 1000 * 1000);
asset::init_usdc(bridge);
asset::mint_usdc(bridge, 1000 * 1000 * 1000 * 1000 * 1000);

coin::register<asset::USDC>(sender);
coin::transfer<asset::USDC>(bridge, address_of(sender),1000 * 1000 * 1000 * 1000 * 1000);


starswap_init(sender);
Expand Down

0 comments on commit ca94c57

Please sign in to comment.