40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { Blockchain, SandboxContract, TreasuryContract } from '@ton/sandbox';
|
|
import { Cell, toNano } from '@ton/core';
|
|
import { Bridge } from '../wrappers/Bridge';
|
|
import '@ton/test-utils';
|
|
import { compile } from '@ton/blueprint';
|
|
|
|
describe('Bridge', () => {
|
|
let code: Cell;
|
|
|
|
beforeAll(async () => {
|
|
code = await compile('Bridge');
|
|
});
|
|
|
|
let blockchain: Blockchain;
|
|
let deployer: SandboxContract<TreasuryContract>;
|
|
let bridge: SandboxContract<Bridge>;
|
|
|
|
beforeEach(async () => {
|
|
blockchain = await Blockchain.create();
|
|
|
|
bridge = blockchain.openContract(Bridge.createFromConfig({}, code));
|
|
|
|
deployer = await blockchain.treasury('deployer');
|
|
|
|
const deployResult = await bridge.sendDeploy(deployer.getSender(), toNano('0.05'));
|
|
|
|
expect(deployResult.transactions).toHaveTransaction({
|
|
from: deployer.address,
|
|
to: bridge.address,
|
|
deploy: true,
|
|
success: true,
|
|
});
|
|
});
|
|
|
|
it('should deploy', async () => {
|
|
// the check is done inside beforeEach
|
|
// blockchain and bridge are ready to use
|
|
});
|
|
});
|