Skip to content

Commit

Permalink
Fix one test case with input from aptos
Browse files Browse the repository at this point in the history
  • Loading branch information
axiongsupra committed May 30, 2024
1 parent 437832d commit b6a5557
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,10 @@ module supra_framework::multisig_account {
#[test_only]
use std::string::utf8;
use std::features;
#[test_only]
use supra_framework::coin::{destroy_mint_cap, destroy_burn_cap};
#[test_only]
use supra_framework::supra_coin;

#[test_only]
const PAYLOAD: vector<u8> = vector[1, 2, 3];
Expand Down Expand Up @@ -1175,6 +1179,18 @@ module supra_framework::multisig_account {
chain_id::initialize_for_test(framework_signer, 1);
}

#[test_only]
fun setup_disabled() {
let framework_signer = &create_signer(@0x1);
features::change_feature_flags(
framework_signer, vector[], vector[features::get_multisig_accounts_feature()]);
timestamp::set_time_has_started_for_testing(framework_signer);
chain_id::initialize_for_test(framework_signer, 1);
let (burn, mint) = supra_coin::initialize_for_test(framework_signer);
destroy_mint_cap(mint);
destroy_burn_cap(burn);
}

#[test(owner_1 = @0x123, owner_2 = @0x124, owner_3 = @0x125)]
public entry fun test_end_to_end(
owner_1: &signer, owner_2: &signer, owner_3: &signer) acquires MultisigAccount {
Expand Down Expand Up @@ -1289,8 +1305,9 @@ module supra_framework::multisig_account {
#[expected_failure(abort_code = 0xD000E, location = Self)]
public entry fun test_create_with_without_feature_flag_enabled_should_fail(
owner: &signer) acquires MultisigAccount {
setup_disabled();
create_account(address_of(owner));
create(owner, 2, vector[], vector[]);
create(owner, 1, vector[], vector[]);
}

#[test(owner_1 = @0x123, owner_2 = @0x124, owner_3 = @0x125)]
Expand Down

0 comments on commit b6a5557

Please sign in to comment.