Skip to content

Commit

Permalink
Merge branch 'main' into fallback-handler-comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mmv08 authored Jan 9, 2025
2 parents ce37a8c + 77bab0d commit 735f749
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions test/accessors/SimulateTxAccessor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ describe("SimulateTxAccessor", () => {
const accessorAddress = await accessor.getAddress();
const tx = await buildContractCall(safe, "getOwners", [], 0);
const simulationData = accessor.interface.encodeFunctionData("simulate", [tx.to, tx.value, tx.data, tx.operation]);
const acccessibleData = await simulator.simulate.staticCall(accessorAddress, simulationData);
const simulation = accessor.interface.decodeFunctionResult("simulate", acccessibleData);
const accessibleData = await simulator.simulate.staticCall(accessorAddress, simulationData);
const simulation = accessor.interface.decodeFunctionResult("simulate", accessibleData);
expect(safe.interface.decodeFunctionResult("getOwners", simulation.returnData)[0]).to.be.deep.eq([user1.address]);
expect(simulation.success).to.be.true;
expect(simulation.estimate).to.be.lte(10000n);
Expand All @@ -69,8 +69,8 @@ describe("SimulateTxAccessor", () => {
const userBalance = await hre.ethers.provider.getBalance(user2.address);
const tx = await buildContractCall(interactor, "sendAndReturnBalance", [user2.address, ethers.parseEther("1")], 0, true);
const simulationData = accessor.interface.encodeFunctionData("simulate", [tx.to, tx.value, tx.data, tx.operation]);
const acccessibleData = await simulator.simulate.staticCall(accessorAddress, simulationData);
const simulation = accessor.interface.decodeFunctionResult("simulate", acccessibleData);
const accessibleData = await simulator.simulate.staticCall(accessorAddress, simulationData);
const simulation = accessor.interface.decodeFunctionResult("simulate", accessibleData);
expect(interactor.interface.decodeFunctionResult("sendAndReturnBalance", simulation.returnData)[0]).to.be.deep.eq(
userBalance + ethers.parseEther("1"),
);
Expand All @@ -85,8 +85,8 @@ describe("SimulateTxAccessor", () => {
const accessorAddress = await accessor.getAddress();
const tx = await buildContractCall(interactor, "sendAndReturnBalance", [user2.address, ethers.parseEther("1")], 0, true);
const simulationData = accessor.interface.encodeFunctionData("simulate", [tx.to, tx.value, tx.data, tx.operation]);
const acccessibleData = await simulator.simulate.staticCall(accessorAddress, simulationData);
const simulation = accessor.interface.decodeFunctionResult("simulate", acccessibleData);
const accessibleData = await simulator.simulate.staticCall(accessorAddress, simulationData);
const simulation = accessor.interface.decodeFunctionResult("simulate", accessibleData);
expect(simulation.returnData).to.be.deep.eq(
"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f5472616e73666572206661696c65640000000000000000000000000000000000",
);
Expand Down
4 changes: 2 additions & 2 deletions test/core/Safe.Execution.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ describe("Safe", () => {
if (hre.network.zksync) {
// This test fails in zksync because of (allegedly) enormous gas cost differences
// a call to useGas(8) costs ~400k gas in evm but ~28m gas in zksync.
// I suspect the gas cost difference to play a role but the zksync docs do not mention any numbers so i cant confirm this:
// I suspect the gas cost difference to play a role but the zksync docs do not mention any numbers so i can't confirm this:
// https://docs.zksync.io/zk-stack/concepts/fee-mechanism
// From zkSync team:
// Update: in-memory node when in standalone mode assumes very high l1 gas price resulting in a very high gas consumption,
Expand Down Expand Up @@ -333,7 +333,7 @@ describe("Safe", () => {
if (hre.network.zksync) {
// This test fails in zksync because of (allegedly) enormous gas cost differences
// a call to useGas(8) costs ~400k gas in evm but ~28m gas in zksync.
// I suspect the gas cost difference to play a role but the zksync docs do not mention any numbers so i cant confirm this:
// I suspect the gas cost difference to play a role but the zksync docs do not mention any numbers so i can't confirm this:
// https://docs.zksync.io/zk-stack/concepts/fee-mechanism
// From zkSync team:
// Update: in-memory node when in standalone mode assumes very high l1 gas price resulting in a very high gas consumption,
Expand Down
18 changes: 9 additions & 9 deletions test/core/Safe.Setup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ describe("Safe", () => {
/* solhint-enable no-inline-assembly */
}
}`;
const testIntializer = await deployContractFromSource(user1, source);
const testIntializerAddress = await testIntializer.getAddress();
const initData = testIntializer.interface.encodeFunctionData("init", ["0x42baddad"]);
const testInitializer = await deployContractFromSource(user1, source);
const testInitializerAddress = await testInitializer.getAddress();
const initData = testInitializer.interface.encodeFunctionData("init", ["0x42baddad"]);
await expect(
template.setup(
[user1.address, user2.address, user3.address],
2,
testIntializerAddress,
testInitializerAddress,
initData,
AddressOne,
AddressZero,
Expand All @@ -247,7 +247,7 @@ describe("Safe", () => {
),
)
.to.emit(template, "SafeSetup")
.withArgs(safeMsgSender, [user1.address, user2.address, user3.address], 2, testIntializerAddress, AddressOne);
.withArgs(safeMsgSender, [user1.address, user2.address, user3.address], 2, testInitializerAddress, AddressOne);
await expect(await template.domainSeparator()).to.be.eq(calculateSafeDomainSeparator(templateAddress, await chainId()));
await expect(await template.getOwners()).to.be.deep.eq([user1.address, user2.address, user3.address]);
await expect(await template.getThreshold()).to.eq(2n);
Expand All @@ -272,14 +272,14 @@ describe("Safe", () => {
require(false, "Computer says nah");
}
}`;
const testIntializer = await deployContractFromSource(user1, source);
const testIntializerAddress = await testIntializer.getAddress();
const initData = testIntializer.interface.encodeFunctionData("init", ["0x42baddad"]);
const testInitializer = await deployContractFromSource(user1, source);
const testInitializerAddress = await testInitializer.getAddress();
const initData = testInitializer.interface.encodeFunctionData("init", ["0x42baddad"]);
await expect(
template.setup(
[user1.address, user2.address, user3.address],
2,
testIntializerAddress,
testInitializerAddress,
initData,
AddressZero,
AddressZero,
Expand Down
6 changes: 3 additions & 3 deletions test/libraries/SafeToL2Setup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ describe("SafeToL2Setup", () => {
signers: [user1],
safeToL2SetupLib,
} = await setupTests();
const safeSingeltonAddress = await safeSingleton.getAddress();
const safeSingletonAddress = await safeSingleton.getAddress();
const safeL2SingletonAddress = await safeL2.getAddress();
const safeToL2SetupCall = safeToL2SetupLib.interface.encodeFunctionData("setupToL2", [safeL2SingletonAddress]);

Expand All @@ -247,12 +247,12 @@ describe("SafeToL2Setup", () => {
]);
const safeAddress = await proxyFactory.createProxyWithNonce.staticCall(safeSingleton.target, setupData, 0);

await expect(proxyFactory.createProxyWithNonce(safeSingeltonAddress, setupData, 0)).to.not.emit(
await expect(proxyFactory.createProxyWithNonce(safeSingletonAddress, setupData, 0)).to.not.emit(
safeToL2SetupLib.attach(safeAddress),
"ChangedMasterCopy",
);
const singletonInStorage = await hre.ethers.provider.getStorage(safeAddress, ethers.zeroPadValue("0x00", 32));
expect(sameHexString(singletonInStorage, ethers.zeroPadValue(safeSingeltonAddress, 32))).to.be.true;
expect(sameHexString(singletonInStorage, ethers.zeroPadValue(safeSingletonAddress, 32))).to.be.true;
});
});
});

0 comments on commit 735f749

Please sign in to comment.