Skip to content

Commit

Permalink
refactor: Rename callcode test files for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
drklee3 committed Oct 16, 2024
1 parent 99c2f6e commit 0e39988
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

contract TargetContract {
contract CallCodeTestContract {
uint256 public storageValue;

function getMsgInfo() external payable returns (address, uint256) {
Expand Down
7 changes: 4 additions & 3 deletions tests/e2e-evm/test/callcode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("CallCode", () => {

interface CallCodeContext {
lowLevelCaller: GetContractReturnType<ArtifactsMap["Caller"]["abi"]>;
implementationContract: GetContractReturnType<ArtifactsMap["TargetContract"]["abi"]>;
implementationContract: GetContractReturnType<ArtifactsMap["CallCodeTestContract"]["abi"]>;
}

interface callCodeTestCaseBase {
Expand Down Expand Up @@ -55,7 +55,7 @@ describe("CallCode", () => {
let ctx: CallCodeContext;

before("deploy called contract", async function () {
const contract = await hre.viem.deployContract("TargetContract");
const contract = await hre.viem.deployContract("CallCodeTestContract");
ctx = {
lowLevelCaller: lowLevelCaller,
implementationContract: contract,
Expand Down Expand Up @@ -152,7 +152,7 @@ describe("CallCode", () => {
}),
// msg.sender is the caller contract
wantSender: (ctx) => ctx.lowLevelCaller.address,
// msg.value is not preserved
// msg.value is not preserved via callcode
wantValue: 0n,
},
{
Expand All @@ -174,6 +174,7 @@ describe("CallCode", () => {
],
}),
}),
// Storage in caller contract
wantStorageContract: (ctx) => ctx.lowLevelCaller.address,
wantStorageValue: 2n,
},
Expand Down

0 comments on commit 0e39988

Please sign in to comment.