Skip to content

Commit

Permalink
Change expect msg within integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Keszey Dániel authored and Keszey Dániel committed Feb 27, 2023
1 parent b14a791 commit ee3c68d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions packages/protocol/test/bridge/Bridge.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe("integrationbridge:Bridge", function () {
l2Bridge
.connect(l2Signer)
.processMessage(m, ethers.constants.HashZero)
).to.be.revertedWith("B:forbidden");
).to.be.revertedWith("B_FORBIDDEN()");
});

it("should throw if message.destChainId is not equal to current block.chainId", async function () {
Expand All @@ -196,7 +196,7 @@ describe("integrationbridge:Bridge", function () {

await expect(
l2Bridge.processMessage(m, ethers.constants.HashZero)
).to.be.revertedWith("B:destChainId");
).to.be.revertedWith("B_WRONG_CHAIN_ID()");
});

it("should throw if messageStatus of message is != NEW", async function () {
Expand All @@ -212,7 +212,7 @@ describe("integrationbridge:Bridge", function () {
// recalling this process should be prevented as it's status is no longer NEW
await expect(
l2Bridge.processMessage(message, signalProof)
).to.be.revertedWith("B:status");
).to.be.revertedWith("B_STATUS_MISMTACH()");
});

it("should throw if message signalproof is not valid", async function () {
Expand All @@ -233,7 +233,7 @@ describe("integrationbridge:Bridge", function () {

await expect(
l2Bridge.processMessage(m, signalProof)
).to.be.revertedWith("B:notReceived");
).to.be.revertedWith("B_SIGNAL_NOT_RECEIVED()");
});

it("should throw if message has not been received", async function () {
Expand Down Expand Up @@ -276,7 +276,7 @@ describe("integrationbridge:Bridge", function () {

await expect(
l2Bridge.processMessage(message, signalProof)
).to.be.revertedWith("B:notReceived");
).to.be.revertedWith("B_SIGNAL_NOT_RECEIVED");
});

it("processes a message when the signal has been verified from the sending chain", async () => {
Expand Down Expand Up @@ -445,7 +445,7 @@ describe("integrationbridge:Bridge", function () {
enabledDestChainId,
ethers.constants.HashZero
)
).to.be.revertedWith("B:destChainId");
).to.be.revertedWith("B_WRONG_CHAIN_ID()");
});

it("should revert if msgHash == 0", async function () {
Expand All @@ -455,7 +455,7 @@ describe("integrationbridge:Bridge", function () {
srcChainId,
ethers.constants.HashZero
)
).to.be.revertedWith("B:msgHash");
).to.be.revertedWith("B_MSG_HASH_NULL()");
});

it("should return false if headerHash hasn't been synced", async function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/test/genesis/generate_genesis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ action("Generate Genesis", function () {
},
ethers.utils.randomBytes(1024)
)
).to.be.revertedWith("B:forbidden");
).to.be.revertedWith("B_FORBIDDEN");
});

it("TokenVault", async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe("integration:SignalService", function () {
signal,
signalProof
)
).to.be.revertedWith("B:srcChainId");
).to.be.revertedWith("B_WRONG_CHAIN_ID()");
});

it("should revert if app == AddressZero", async function () {
Expand Down Expand Up @@ -151,7 +151,7 @@ describe("integration:SignalService", function () {
signal,
signalProof
)
).to.be.revertedWith("B:app");
).to.be.revertedWith("B_NULL_APP_ADDR()");
});

it("should revert if signal == HashZero", async function () {
Expand Down Expand Up @@ -190,7 +190,7 @@ describe("integration:SignalService", function () {
ethers.constants.HashZero,
signalProof
)
).to.be.revertedWith("B:signal");
).to.be.revertedWith("B_ZERO_SIGNAL()");
});

it("should pass and return true", async function () {
Expand Down

0 comments on commit ee3c68d

Please sign in to comment.