Skip to content

Commit 04363b2

Browse files
committed
Merge branch 'master' into reinis/acx-3579-h-01-forced-use-of-claim-accounts-for-all-relayers-in
2 parents 690929d + 86f17ee commit 04363b2

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

test/evm/hardhat/fixtures/HubPool.Fixture.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export const hubPoolFixture = hre.deployments.createFixture(async ({ ethers }) =
88
return await deployHubPool(ethers);
99
});
1010

11+
// Silence warnings from openzeppelin/hardhat-upgrades for this fixture.
12+
hre.upgrades.silenceWarnings();
13+
1114
export async function deployHubPool(ethers: any, spokePoolName = "MockSpokePool") {
1215
const [signer, crossChainAdmin] = await ethers.getSigners();
1316

test/evm/hardhat/fixtures/SpokePool.Fixture.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export const spokePoolFixture = hre.deployments.createFixture(async ({ ethers })
1616
return await deploySpokePool(ethers);
1717
});
1818

19+
// Silence warnings from openzeppelin/hardhat-upgrades for this fixture.
20+
hre.upgrades.silenceWarnings();
21+
1922
// Have a separate function that deploys the contract and returns the contract addresses. This is called by the fixture
2023
// to have standard fixture features. It is also exported as a function to enable non-snapshoted deployments.
2124
export async function deploySpokePool(

test/svm/SvmSpoke.HandleReceiveMessage.ts

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ describe("svm_spoke.handle_receive_message", () => {
2626
let usedNonces: web3.PublicKey;
2727
let selfAuthority: web3.PublicKey;
2828
let eventAuthority: web3.PublicKey;
29-
const firstNonce = 1;
3029
const attestation = Buffer.alloc(0);
31-
let nonce = firstNonce;
30+
let nonce = 0;
3231
let remainingAccounts: web3.AccountMeta[];
3332
const cctpMessageversion = 0;
3433
let destinationCaller = new web3.PublicKey(new Uint8Array(32)); // We don't use permissioned caller.
@@ -57,10 +56,15 @@ describe("svm_spoke.handle_receive_message", () => {
5756
[Buffer.from("message_transmitter")],
5857
messageTransmitterProgram.programId
5958
);
60-
[usedNonces] = web3.PublicKey.findProgramAddressSync(
61-
[Buffer.from("used_nonces"), Buffer.from(remoteDomain.toString()), Buffer.from(firstNonce.toString())],
62-
messageTransmitterProgram.programId
63-
);
59+
usedNonces = await messageTransmitterProgram.methods
60+
.getNoncePda({
61+
nonce: new BN(nonce.toString()),
62+
sourceDomain: remoteDomain.toNumber(),
63+
})
64+
.accounts({
65+
messageTransmitter: messageTransmitterState,
66+
})
67+
.view();
6468
[selfAuthority] = web3.PublicKey.findProgramAddressSync([Buffer.from("self_authority")], program.programId);
6569
[eventAuthority] = web3.PublicKey.findProgramAddressSync([Buffer.from("__event_authority")], program.programId);
6670

@@ -145,10 +149,15 @@ describe("svm_spoke.handle_receive_message", () => {
145149

146150
it("Block Wrong Source Domain", async () => {
147151
const sourceDomain = 666;
148-
[receiveMessageAccounts.usedNonces] = web3.PublicKey.findProgramAddressSync(
149-
[Buffer.from("used_nonces"), Buffer.from(sourceDomain.toString()), Buffer.from(firstNonce.toString())],
150-
messageTransmitterProgram.programId
151-
);
152+
receiveMessageAccounts.usedNonces = await messageTransmitterProgram.methods
153+
.getNoncePda({
154+
nonce: new BN(nonce.toString()),
155+
sourceDomain,
156+
})
157+
.accounts({
158+
messageTransmitter: messageTransmitterState,
159+
})
160+
.view();
152161

153162
const calldata = ethereumIface.encodeFunctionData("pauseDeposits", [true]);
154163
const messageBody = Buffer.from(calldata.slice(2), "hex");

0 commit comments

Comments
 (0)