relayer: fix messageTest + rm lib/forge-std + rm lib/openzeppelin (#3044) (#3089)

* relayer: fix messageTest + rm lib/forge-std + rm lib/openzeppelin

* save

* useLastRun -> false

Co-authored-by: Joe Howarth <jhowarth@jumptrading.com>
This commit is contained in:
derpy-duck 2023-06-14 11:09:42 -04:00 committed by GitHub
parent 3c0fecc3fa
commit 0fbfa816ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 11 deletions

View File

@ -86,4 +86,4 @@ test-forge: dependencies
forge test
clean:
rm -rf ganache.log .env node_modules build flattened build-forge ethers-contracts
rm -rf ganache.log .env node_modules build flattened build-forge ethers-contracts lib/forge-std lib/openzeppelin-contracts

View File

@ -1,6 +1,6 @@
{
"description": "This file contains the addresses for the contracts on each chain. If useLastRun is true, this file will be ignored, and the addresses will be taken from the lastrun.json of the deployment scripts.",
"useLastRun": true,
"useLastRun": false,
"deliveryProviders": [
{
"chainId": 6,

View File

@ -22,9 +22,9 @@ export async function sendMessage(
const sourceRelayer = await getWormholeRelayer(sourceChain);
const sourceProvider = await sourceRelayer.getDefaultDeliveryProvider();
const relayQuote = await (
await sourceRelayer.quoteGas(targetChain.chainId, 2000000, sourceProvider)
).add(10000000000);
const relayQuote = await await sourceRelayer[
"quoteEVMDeliveryPrice(uint16,uint256,uint256,address)"
](targetChain.chainId, 0, 2000000, sourceProvider);
console.log("relay quote: " + relayQuote);
const mockIntegration = getMockIntegration(sourceChain);
@ -38,10 +38,11 @@ export async function sendMessage(
const tx = await mockIntegration.sendMessage(
Buffer.from(sentMessage),
targetChain.chainId,
targetAddress,
2000000,
0,
{
gasLimit: 1000000,
value: relayQuote,
value: relayQuote[0],
}
);
const rx = await tx.wait();
@ -79,19 +80,19 @@ async function queryMessageOnTarget(
sentMessage: string,
targetChain: ChainInfo
): Promise<boolean> {
let messageHistory: string[][] = [];
let messageHistory: string[] = [];
const targetIntegration = getMockIntegration(targetChain);
let notFound = true;
for (let i = 0; i < 20 && notFound; i++) {
await new Promise<void>((resolve) => setTimeout(() => resolve(), 2000));
const messageHistoryResp = await targetIntegration.getMessageHistory();
messageHistory = messageHistoryResp.map((messages) =>
messages.map((message) => ethers.utils.toUtf8String(message))
messageHistory = messageHistoryResp.map((message) =>
ethers.utils.toUtf8String(message)
);
notFound = !messageHistory
.slice(messageHistory.length - 20)
.find((msgs) => msgs.find((m) => m === sentMessage));
.find((msg) => msg === sentMessage);
process.stdout.write("..");
}
console.log("");