From eb3263292454201f791c78edfdec2b66dcee8ef5 Mon Sep 17 00:00:00 2001 From: Akshay Date: Thu, 29 Jun 2023 12:30:15 +0200 Subject: [PATCH] [#4] Rename test fallback receiver contracts --- ...lReceiver.sol => TestFallbackReceiver.sol} | 4 ++-- test/SafeProtocolMediator.spec.ts | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) rename contracts/test/{TestDelegateCallReceiver.sol => TestFallbackReceiver.sol} (87%) diff --git a/contracts/test/TestDelegateCallReceiver.sol b/contracts/test/TestFallbackReceiver.sol similarity index 87% rename from contracts/test/TestDelegateCallReceiver.sol rename to contracts/test/TestFallbackReceiver.sol index e42fa8ae..56dc3a5c 100644 --- a/contracts/test/TestDelegateCallReceiver.sol +++ b/contracts/test/TestFallbackReceiver.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: LGPL-3.0-only pragma solidity ^0.8.18; -contract TestDelegateCallReceiver { +contract TestFallbackReceiver { address public immutable ethReceiver; constructor(address _ethReceiver) { @@ -17,7 +17,7 @@ contract TestDelegateCallReceiver { } } -contract TestDelegateCallReverter { +contract TestFallbackReceiverReverter { receive() external payable { revert(); } diff --git a/test/SafeProtocolMediator.spec.ts b/test/SafeProtocolMediator.spec.ts index fec4b96e..9b69f0c4 100644 --- a/test/SafeProtocolMediator.spec.ts +++ b/test/SafeProtocolMediator.spec.ts @@ -352,8 +352,8 @@ describe("SafeProtocolMediator", async () => { it("Should run a transaction from root access enabled module", async () => { const { safeProtocolMediator, safe } = await loadFixture(deployContractsFixture); - const testDelegateCallReceiver = await ( - await hre.ethers.getContractFactory("TestDelegateCallReceiver") + const testFallbackReceiver = await ( + await hre.ethers.getContractFactory("TestFallbackReceiver") ).deploy(user2.address); // Enable module @@ -371,7 +371,7 @@ describe("SafeProtocolMediator", async () => { // TODO: Replace with builder function const safeTx = { action: { - to: await testDelegateCallReceiver.getAddress(), + to: await testFallbackReceiver.getAddress(), value: hre.ethers.parseEther("1"), data: "0x", }, @@ -415,8 +415,8 @@ describe("SafeProtocolMediator", async () => { it("Should revert with ModuleRequiresRootAccess", async () => { const { safeProtocolMediator, safe } = await loadFixture(deployContractsFixture); - const testDelegateCallReceiver = await ( - await hre.ethers.getContractFactory("TestDelegateCallReceiver") + const testFallbackReceiver = await ( + await hre.ethers.getContractFactory("TestFallbackReceiver") ).deploy(user2.address); // Enable module @@ -429,7 +429,7 @@ describe("SafeProtocolMediator", async () => { // TODO: Replace with builder function const safeTx = { action: { - to: await testDelegateCallReceiver.getAddress(), + to: await testFallbackReceiver.getAddress(), value: hre.ethers.parseEther("1"), data: "0x", }, @@ -446,7 +446,7 @@ describe("SafeProtocolMediator", async () => { it("Should emit RootAccessActionExecutionFailed when root access action execution fails", async () => { const { safeProtocolMediator, safe } = await loadFixture(deployContractsFixture); - const testDelegateCallReceiver = await (await hre.ethers.getContractFactory("TestDelegateCallReverter")).deploy(); + const testFallbackReceiver = await (await hre.ethers.getContractFactory("TestFallbackReceiverReverter")).deploy(); // Enable module const module = await (await hre.ethers.getContractFactory("TestModuleWithRootAccess")).deploy(); @@ -456,7 +456,7 @@ describe("SafeProtocolMediator", async () => { // TODO: Replace with builder function const safeTx = { action: { - to: await testDelegateCallReceiver.getAddress(), + to: await testFallbackReceiver.getAddress(), value: hre.ethers.parseEther("1"), data: "0x", }, @@ -473,7 +473,7 @@ describe("SafeProtocolMediator", async () => { it("Should emit ModuleRequiresRootAccess for a root access module", async () => { const { safeProtocolMediator, safe } = await loadFixture(deployContractsFixture); - const testDelegateCallReceiver = await (await hre.ethers.getContractFactory("TestDelegateCallReverter")).deploy(); + const testFallbackReceiver = await (await hre.ethers.getContractFactory("TestFallbackReceiverReverter")).deploy(); // Enable module const module = await (await hre.ethers.getContractFactory("TestModuleWithRootAccess")).deploy(); @@ -488,7 +488,7 @@ describe("SafeProtocolMediator", async () => { // TODO: Replace with builder function const safeTx = { action: { - to: await testDelegateCallReceiver.getAddress(), + to: await testFallbackReceiver.getAddress(), value: hre.ethers.parseEther("1"), data: "0x", },