You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.4 KiB
36 lines
1.4 KiB
2 years ago
|
import { toNano, beginCell } from "ton";
|
||
|
import { ContractSystem } from "ton-emulator";
|
||
|
import {TONB} from '../output/jetton_TONB';
|
||
|
import { default_content } from '../utils/config';
|
||
|
import { TONBWallet } from '../output/jetton_TONBWallet';
|
||
|
|
||
|
describe('jetton', () => {
|
||
|
it('should deploy', async () => {
|
||
|
|
||
|
// Create jetton
|
||
|
let system = await ContractSystem.create();
|
||
|
let owner = system.treasure('owner');
|
||
|
|
||
|
let contract = system.open(await TONB.fromInit(owner.address, default_content));
|
||
|
let tracker = system.track(contract.address);
|
||
|
let wallet_contract = system.open(await TONBWallet.fromInit(contract.address, owner.address));
|
||
|
let wallet_tracker = system.track(wallet_contract.address);
|
||
|
|
||
|
// Mint
|
||
|
let res1 = await contract.send(owner, { value: toNano(1) }, { $$type: 'Deposit', amount: toNano(1000000) });
|
||
|
let res = await system.run();
|
||
|
console.log(res1)
|
||
|
console.log(res)
|
||
|
expect(tracker.events()).toMatchSnapshot();
|
||
|
expect(wallet_tracker.events()).toMatchSnapshot();
|
||
|
console.log(await wallet_contract.getGetWalletData());
|
||
|
|
||
|
// Check owner
|
||
|
expect((await contract.getOwner()).toString()).toEqual(owner.address.toString());
|
||
|
|
||
|
// Data
|
||
|
let data = await contract.getGetJettonData();
|
||
|
// console.warn(data);
|
||
|
console.log(tracker.events())
|
||
|
});
|
||
|
});
|