Skip to content

Commit

Permalink
[#4] Rename test fallback receiver contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-ap committed Jun 29, 2023
1 parent c5ff7e9 commit eb32632
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -17,7 +17,7 @@ contract TestDelegateCallReceiver {
}
}

contract TestDelegateCallReverter {
contract TestFallbackReceiverReverter {
receive() external payable {
revert();
}
Expand Down
20 changes: 10 additions & 10 deletions test/SafeProtocolMediator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
},
Expand Down Expand Up @@ -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
Expand All @@ -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",
},
Expand All @@ -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();
Expand All @@ -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",
},
Expand All @@ -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();
Expand All @@ -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",
},
Expand Down

0 comments on commit eb32632

Please sign in to comment.