|
|
|
@ -43,10 +43,11 @@ describe('jetton', () => {
|
|
|
|
|
expect((foundation_events[8] as any).messages[0].value).toBeGreaterThan(toNano('5.9')); |
|
|
|
|
expect((foundation_events[8] as any).messages[0].value).toBeLessThan(toNano('6.1')); |
|
|
|
|
}); |
|
|
|
|
it('should be able to create a vote for blacklisting', async () => { |
|
|
|
|
it('should be able to create a vote for blacklisting and redistribution', async () => { |
|
|
|
|
let system = await ContractSystem.create(); |
|
|
|
|
let owner = system.treasure('owner'); |
|
|
|
|
let someadmin = system.treasure('someadmin'); |
|
|
|
|
let someadmin2 = system.treasure('someadmin2'); |
|
|
|
|
let pseudostaking_contract = system.open(await PseudoStaking.fromInit()); |
|
|
|
|
let tonb = system.open(await TONB.fromInit(owner.address, default_content, pseudostaking_contract.address)); |
|
|
|
|
let foundation = system.open(await Foundation.fromInit( |
|
|
|
@ -87,5 +88,26 @@ describe('jetton', () => {
|
|
|
|
|
tonb_events = tonb_tracker.events(); |
|
|
|
|
expect((tonb_events[5] as any).messages[0].to).toEqual(addressBook['owner']); |
|
|
|
|
expect((tonb_events[5] as any).messages[0].value).toBeGreaterThan(toNano('99')); |
|
|
|
|
await foundation.send(someadmin, { value: toNano('1.1') }, { |
|
|
|
|
$$type: "InitiateDistributionVote", |
|
|
|
|
adminIndex: 1n, quorum_percent: 50n, vote_time: 0n, |
|
|
|
|
distribution: createDistribution([owner.address, someadmin.address, someadmin2.address], [40n, 40n, 20n]) |
|
|
|
|
}); |
|
|
|
|
await system.run(); |
|
|
|
|
await foundation.send(someadmin, { value: toNano('1.1') }, { $$type: "VoteMsg", vote: 1n, adminIndex: 1n, voteId: 1n }); |
|
|
|
|
await foundation.send(owner, { value: toNano('1.1') }, { $$type: "VoteMsg", vote: 1n, adminIndex: 0n, voteId: 1n }); |
|
|
|
|
await system.run(); |
|
|
|
|
await foundation.send(someadmin, { value: toNano('1.1') }, { $$type: "FinishVote", voteId: 1n }); |
|
|
|
|
await system.run(); |
|
|
|
|
v = await foundation.getNthVote(1n) as any; |
|
|
|
|
foundation_events = foundation_tracker.events(); |
|
|
|
|
expect(v.votes.get(0n)).toEqual(1n); |
|
|
|
|
expect(v.votes.get(1n)).toEqual(1n); |
|
|
|
|
expect(v.ended).toBeTruthy(); |
|
|
|
|
expect(v.result).toBeTruthy(); |
|
|
|
|
let admin_list = await foundation.getAdminList(); |
|
|
|
|
expect(admin_list.addresses.get(2n)).toBeDefined(); |
|
|
|
|
let admin_percents = await foundation.getAdminPercents(); |
|
|
|
|
expect(admin_percents.get(2n)).toEqual(20n); |
|
|
|
|
}); |
|
|
|
|
}); |