diff --git a/packages/actions/.coverage_map.mvcov b/packages/actions/.coverage_map.mvcov new file mode 100644 index 0000000..5d01bc2 Binary files /dev/null and b/packages/actions/.coverage_map.mvcov differ diff --git a/packages/actions/tests/treasury_tests.move b/packages/actions/tests/treasury_tests.move index 2a46cac..21a7524 100644 --- a/packages/actions/tests/treasury_tests.move +++ b/packages/actions/tests/treasury_tests.move @@ -135,7 +135,7 @@ fun test_deposit_owned() { let auth = multisig::authenticate(&extensions, &account, b"".to_string(), scenario.ctx()); treasury::open(auth, &mut account, b"Degen".to_string(), scenario.ctx()); - let id = keep_coin(OWNER, 5, &mut scenario); + let id = keep_coin(account.addr(), 5, &mut scenario); let auth = multisig::authenticate(&extensions, &account, role(b"Deposit", b"Degen"), scenario.ctx()); treasury::deposit_owned( auth, diff --git a/packages/config/.coverage_map.mvcov b/packages/config/.coverage_map.mvcov new file mode 100644 index 0000000..0be86f6 Binary files /dev/null and b/packages/config/.coverage_map.mvcov differ diff --git a/packages/extensions/.coverage_map.mvcov b/packages/extensions/.coverage_map.mvcov new file mode 100644 index 0000000..b61e71c Binary files /dev/null and b/packages/extensions/.coverage_map.mvcov differ diff --git a/packages/protocol/.coverage_map.mvcov b/packages/protocol/.coverage_map.mvcov new file mode 100644 index 0000000..5c335ee Binary files /dev/null and b/packages/protocol/.coverage_map.mvcov differ diff --git a/packages/protocol/tests/coin_operations_tests.move b/packages/protocol/tests/coin_operations_tests.move index f04c4f3..a0c989f 100644 --- a/packages/protocol/tests/coin_operations_tests.move +++ b/packages/protocol/tests/coin_operations_tests.move @@ -55,6 +55,15 @@ fun full_role(): String { full_role } +fun keep_coin(addr: address, amount: u64, scenario: &mut Scenario): ID { + let coin = coin::mint_for_testing(amount, scenario.ctx()); + let id = object::id(&coin); + transfer::public_transfer(coin, addr); + + scenario.next_tx(OWNER); + id +} + // === Tests === #[test] @@ -98,21 +107,14 @@ fun test_merge_2_coins_and_split() { let (mut scenario, extensions, mut account) = start(); let account_address = account.addr(); - let coin1 = coin::mint_for_testing(60, scenario.ctx()); - transfer::public_transfer(coin1, account_address); - scenario.next_tx(OWNER); - let receiving1 = ts::most_recent_receiving_ticket>(&object::id(&account)); + let id1 = keep_coin(account_address, 60, &mut scenario); + let id2 = keep_coin(account_address, 40, &mut scenario); - let coin2 = coin::mint_for_testing(40, scenario.ctx()); - transfer::public_transfer(coin2, account_address); - scenario.next_tx(OWNER); - let receiving2 = ts::most_recent_receiving_ticket>(&object::id(&account)); - let auth = auth::new(&extensions, full_role(), account.addr(), version::current()); let merge_coin_id = coin_operations::merge_and_split( &auth, &mut account, - vector[receiving1, receiving2], + vector[ts::receiving_ticket_by_id(id1), ts::receiving_ticket_by_id(id2)], vector[100], scenario.ctx() );