Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
barrasso committed May 25, 2023
1 parent fbc15c9 commit c6f9196
Showing 1 changed file with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ethers } from 'ethers';

import { bootstrap } from '../../bootstrap';

describe.only('CcipReceiverModule', function () {
describe('CcipReceiverModule', function () {
const { signers, systems } = bootstrap();

let owner: ethers.Signer, user1: ethers.Signer, user2: ethers.Signer, FakeCcip: ethers.Signer;
Expand All @@ -16,7 +16,11 @@ describe.only('CcipReceiverModule', function () {
before('set ccip settings', async () => {
await systems()
.Core.connect(owner)
.configureChainlinkCrossChain(await FakeCcip.getAddress(), ethers.constants.AddressZero, ethers.constants.AddressZero);
.configureChainlinkCrossChain(
await FakeCcip.getAddress(),
ethers.constants.AddressZero,
ethers.constants.AddressZero
);
});

describe('ccipReceive()', () => {
Expand All @@ -36,26 +40,30 @@ describe.only('CcipReceiverModule', function () {

it('fails if message sender on other chain is not self', async () => {
await assertRevert(
systems().Core.connect(FakeCcip).ccipReceive({
messageId: ethers.constants.HashZero,
sourceChainId: 0,
sender: ethers.utils.defaultAbiCoder.encode(['address'], [await FakeCcip.getAddress()]),
data: '0x',
tokenAmounts: [],
}),
systems()
.Core.connect(FakeCcip)
.ccipReceive({
messageId: ethers.constants.HashZero,
sourceChainId: 0,
sender: ethers.utils.defaultAbiCoder.encode(['address'], [await FakeCcip.getAddress()]),
data: '0x',
tokenAmounts: [],
}),
'Unauthorized(',
systems().Core
);
});

it('forwards message to specified caller', async () => {
const tx = await systems().Core.connect(FakeCcip).ccipReceive({
messageId: ethers.constants.HashZero,
sourceChainId: 0,
sender: ethers.utils.defaultAbiCoder.encode(['address'], [systems().Core.address]),
data: systems().Core.interface.encodeFunctionData('_recvCreateCrossChainPool', [100,5]),
tokenAmounts: [],
});
const tx = await systems()
.Core.connect(FakeCcip)
.ccipReceive({
messageId: ethers.constants.HashZero,
sourceChainId: 0,
sender: ethers.utils.defaultAbiCoder.encode(['address'], [systems().Core.address]),
data: systems().Core.interface.encodeFunctionData('_recvCreateCrossChainPool', [100, 5]),
tokenAmounts: [],
});

//console.log(await tx.wait());

Expand Down

0 comments on commit c6f9196

Please sign in to comment.