Skip to content

Instantly share code, notes, and snippets.

@damirka
Created October 4, 2022 20:18
Show Gist options
  • Save damirka/9fdfb8b72a70b2313de96c4e42335a5f to your computer and use it in GitHub Desktop.
Save damirka/9fdfb8b72a70b2313de96c4e42335a5f to your computer and use it in GitHub Desktop.
#[test_only]
module 0x0::tc_tests {
use sui::coin;
use sui::test_scenario::{Self as tc, next_tx, ctx};
struct TC_TESTS has drop {}
fun people(): (address) { (@0xABC) }
#[test]
fun test_create_coin() {
let (dude) = people();
let test = &mut tc::begin(&dude);
next_tx(test, &dude); {
let treasury = coin::create_currency(TC_TESTS {}, ctx(test));
sui::transfer::transfer(treasury, dude);
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment