Skip to content

Commit 855dd93

Browse files
committed
added test changes
1 parent ac1b574 commit 855dd93

File tree

1 file changed

+60
-2
lines changed

1 file changed

+60
-2
lines changed
Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,71 @@
11
import assert from 'assert';
2-
import { integrationBootstrap } from './bootstrap';
2+
import { ethers } from 'ethers';
3+
import { WormholeChainSelector, integrationBootstrap } from './bootstrap';
4+
import { typedValues } from '../helpers/object';
5+
import { WormholeMock__factory } from '../generated/typechain';
36

47
describe('cross chain nft distribution', function () {
58
const { chains } = integrationBootstrap();
69

7-
it('allows onwer mint nft', async function () {
10+
before('register emitters', async function () {
11+
for (const chain of typedValues(chains)) {
12+
const _chains = [
13+
WormholeChainSelector.mothership,
14+
WormholeChainSelector.satellite1,
15+
WormholeChainSelector.satellite2,
16+
];
17+
const _emitters = [
18+
chains.mothership.GovernanceProxy.address,
19+
chains.satellite1.GovernanceProxy.address,
20+
chains.satellite2.GovernanceProxy.address,
21+
];
22+
await chain.GovernanceProxy.connect(chain.signer).setRegisteredEmitters(_chains, _emitters);
23+
}
24+
});
25+
26+
it('allows owner mint nft', async function () {
827
for (const chain of Object.values(chains)) {
928
const ownerAddress = await chain.signer.getAddress();
1029
assert.equal((await chain.CouncilToken.balanceOf(ownerAddress)).toString(), '1');
1130
}
1231
});
32+
33+
it.only('dimisses members', async function () {
34+
const ownerAddress = await chains.mothership.signer.getAddress();
35+
const tx = await chains.mothership.GovernanceProxy.dismissMembers([await chains.mothership.signer.getAddress()]);
36+
// const rx = await tx.wait();
37+
38+
// // TODO use json abi here
39+
// const abi = [
40+
// 'event LogMessagePublished(address indexed sender, uint64 sequence, uint32 nonce, bytes payload, uint8 consistencyLevel)',
41+
// ];
42+
// const iface = new ethers.utils.Interface(abi);
43+
44+
// console.log("rx: ",rx)
45+
46+
// // Parsing the last event from the receipt
47+
// const events = [];
48+
49+
// for (const evt of rx.events!) {
50+
// try {
51+
// events.push(iface.parseLog(evt));
52+
// } catch (_) {
53+
// // If the event is not parsed is not the one we are looking for
54+
// }
55+
// }
56+
57+
// if (events.length === 0) {
58+
// throw new Error('Could not find cross chain event');
59+
// }
60+
61+
// console.log(events)
62+
63+
// await chains.satellite1.WormholeRelayerMock.deliver(
64+
// [encodedValue1],
65+
// event?.args?.payload,
66+
// await voter.satellite1.getAddress(),
67+
// []
68+
// );
69+
70+
})
1371
});

0 commit comments

Comments
 (0)