Skip to content

Commit

Permalink
Modify revert to check the revert message and refactor staticPart
Browse files Browse the repository at this point in the history
  • Loading branch information
moisses89 committed Jun 15, 2022
1 parent a8a5c54 commit 890deef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/integration/gnosisSafeNestedSafes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ describe("NestedSafes", async () => {
const handlerSafe1 = handler.attach(safe1.address)
const handlerSafe2 = handler.attach(safe2.address)
let staticPart = "0x"
const staticPartSafe1 = "000000000000000000000000" + safe1.address.slice(2) + "0000000000000000000000000000000000000000000000000000000000000082" + "00" // r, s, v
const staticPartSafe2 = "000000000000000000000000" + safe2.address.slice(2) + "0000000000000000000000000000000000000000000000000000000000000142" + "00" // r, s, v
if (safe1.address < safe2.address) {
staticPart += "000000000000000000000000" + safe1.address.slice(2) + "0000000000000000000000000000000000000000000000000000000000000082" + "00" // r, s, v
staticPart += "000000000000000000000000" + safe2.address.slice(2) + "0000000000000000000000000000000000000000000000000000000000000142" + "00" // r, s, v
staticPart += staticPartSafe1 + staticPartSafe2
} else {
staticPart += "000000000000000000000000" + safe2.address.slice(2) + "0000000000000000000000000000000000000000000000000000000000000142" + "00" // r, s, v
staticPart += "000000000000000000000000" + safe1.address.slice(2) + "0000000000000000000000000000000000000000000000000000000000000082" + "00" // r, s, v
staticPart += staticPartSafe2 + staticPartSafe1
}
return {
safe1,
Expand Down Expand Up @@ -132,7 +132,7 @@ describe("NestedSafes", async () => {

// Should revert with message hash not approved
await expect(parentSafe.execTransaction(to, value, data, operation, 0, 0, 0, AddressZero, AddressZero, signature),
"Transaction should fail because hash is not approved").to.be.reverted;
"Transaction should fail because hash is not approved").to.be.revertedWith("Hash not approved");

// Approve transaction from safe2
await executeContractCallWithSigners(safe2, signLib, "signMessage", [messageData], [user3, user4], true)
Expand Down

0 comments on commit 890deef

Please sign in to comment.