Skip to content

Commit

Permalink
[move-examples] fix locked_coins (#15872)
Browse files Browse the repository at this point in the history
  • Loading branch information
lightmark authored Feb 3, 2025
1 parent e0002dd commit b60cde7
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions aptos-move/move-examples/defi/sources/locked_coins.move
Original file line number Diff line number Diff line change
Expand Up @@ -265,34 +265,25 @@ module defi::locked_coins {
});
}

#[test_only]
use std::string;
#[test_only]
use aptos_framework::account;
#[test_only]
use aptos_framework::coin::BurnCapability;
#[test_only]
use aptos_framework::aptos_coin::AptosCoin;
use aptos_framework::aptos_coin::{Self, AptosCoin};
#[test_only]
use aptos_framework::aptos_account;

#[test_only]
fun setup(aptos_framework: &signer, sponsor: &signer): BurnCapability<AptosCoin> {
timestamp::set_time_has_started_for_testing(aptos_framework);
let (burn_cap, mint_cap) = aptos_coin::initialize_for_test(aptos_framework);

let (burn_cap, freeze_cap, mint_cap) = coin::initialize<AptosCoin>(
aptos_framework,
string::utf8(b"TC"),
string::utf8(b"TC"),
8,
false,
);
account::create_account_for_test(signer::address_of(sponsor));
coin::register<AptosCoin>(sponsor);
let coins = coin::mint<AptosCoin>(2000, &mint_cap);
coin::deposit(signer::address_of(sponsor), coins);
coin::destroy_mint_cap(mint_cap);
coin::destroy_freeze_cap(freeze_cap);

burn_cap
}
Expand Down

0 comments on commit b60cde7

Please sign in to comment.