From e4f5570f1a13c67bbc305e436a4baacc2f3cd2bf Mon Sep 17 00:00:00 2001 From: Paul <108695806+pxrl@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:30:02 +0100 Subject: [PATCH 1/3] chore: Bump constants (#761) For new Lisk token definitions. --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ad90edd0b..4129d827c 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "pre-commit-hook": "sh scripts/preCommitHook.sh" }, "dependencies": { - "@across-protocol/constants": "^3.1.19", + "@across-protocol/constants": "^3.1.20", "@coral-xyz/anchor": "^0.30.1", "@defi-wonderland/smock": "^2.3.4", "@eth-optimism/contracts": "^0.5.40", diff --git a/yarn.lock b/yarn.lock index 22a0c4a35..37b02a3ef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@across-protocol/constants@^3.1.19": - version "3.1.19" - resolved "https://registry.yarnpkg.com/@across-protocol/constants/-/constants-3.1.19.tgz#3c29b52ec5f2eece93a6abd50d580668b03dd7b3" - integrity sha512-XOFF+o64TDn57xNfUB38kWy8lYyE9lB7PBdyoMOadsXx00HC3KMznFi/paLRKT1iZ50vDwHp00tNZbr7Z7umzA== +"@across-protocol/constants@^3.1.20": + version "3.1.20" + resolved "https://registry.yarnpkg.com/@across-protocol/constants/-/constants-3.1.20.tgz#305bd41f5644b7db5d9fd12a6a6b4bbbbe2fd016" + integrity sha512-B5RsvuOQsZdFgLk0WcFZGmoivm6g6gv95a+YKVBydcxZkNxAsyP065UQEDAmvRXvPhqGyehhd52515Xa/3bzyg== "@across-protocol/contracts@^0.1.4": version "0.1.4" From ebc569f2fa162209d70e79bc2b9ca2497455e307 Mon Sep 17 00:00:00 2001 From: Pablo Maldonado Date: Tue, 3 Dec 2024 18:54:03 +0000 Subject: [PATCH 2/3] fix(svm): linter issues (#787) Signed-off-by: Pablo Maldonado --- test/svm/SvmSpoke.Bundle.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/svm/SvmSpoke.Bundle.ts b/test/svm/SvmSpoke.Bundle.ts index 40e799e17..82ba950ae 100644 --- a/test/svm/SvmSpoke.Bundle.ts +++ b/test/svm/SvmSpoke.Bundle.ts @@ -279,7 +279,7 @@ describe("svm_spoke.bundle", () => { assert.isFalse(event.deferredRefunds, "deferredRefunds should be false"); assertSE(event.caller, owner, "caller should match"); - event = events.find((event) => event.name === "tokensBridged").data; + event = events.find((event) => event.name === "tokensBridged")?.data; assertSE(event.amountToReturn, relayerRefundLeaves[0].amountToReturn, "amountToReturn should match"); assertSE(event.chainId, chainId, "chainId should match"); From 739e2d01528db1004558c2eb57a4b2fd8559c457 Mon Sep 17 00:00:00 2001 From: Pablo Maldonado Date: Tue, 3 Dec 2024 20:26:17 +0000 Subject: [PATCH 3/3] fix(svm): random seed collision tests (#788) * fix(svm): random seed collision tests Signed-off-by: Pablo Maldonado * refactor: comment Signed-off-by: Pablo Maldonado --------- Signed-off-by: Pablo Maldonado --- test/svm/SvmSpoke.common.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/svm/SvmSpoke.common.ts b/test/svm/SvmSpoke.common.ts index dc452ef99..4fe0a9ec6 100644 --- a/test/svm/SvmSpoke.common.ts +++ b/test/svm/SvmSpoke.common.ts @@ -7,6 +7,7 @@ import { SvmSpoke } from "../../target/types/svm_spoke"; import { evmAddressToPublicKey } from "../../src/SvmUtils"; import { assert } from "chai"; import { SlowFillLeaf } from "./utils"; +import { randomBytes } from "crypto"; const provider = anchor.AnchorProvider.env(); const program = anchor.workspace.SvmSpoke as Program; @@ -41,7 +42,7 @@ const initializeState = async ( fillDeadlineBuffer: BN; } ) => { - const actualSeed = seed || new BN(Math.floor(Math.random() * 1000000)); + const actualSeed = seed || new BN(randomBytes(8).toString("hex"), 16); // Generate a random u64 const seeds = [Buffer.from("state"), actualSeed.toArrayLike(Buffer, "le", 8)]; const [state] = PublicKey.findProgramAddressSync(seeds, program.programId); if (!initialState) {