Skip to content

Commit

Permalink
got tests compiling with correct submodules installed
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivaanshK committed Sep 5, 2024
1 parent 3eee044 commit 8c1cf12
Show file tree
Hide file tree
Showing 5 changed files with 592 additions and 15 deletions.
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
auto_detect_solc = false
block_timestamp = 1_680_220_800 # March 31, 2023 at 00:00 GMT
bytecode_hash = "none"
evm_version = "cancun" # See https://www.evmdiff.com/features?name=PUSH0&kind=opcode
gas_reports = ["*"]
optimizer = true
optimizer_runs = 1_000_000
Expand Down
11 changes: 2 additions & 9 deletions test/base/TestBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import { Test } from "forge-std/src/Test.sol";
import { Vm } from "forge-std/src/Vm.sol";

import "@solady/src/utils/ECDSA.sol";
import { TestHelper, IEntryPoint, EntryPoint } from "@nexus/test/foundry/utils/TestHelper.t.sol";
import "./TestHelper.sol";

import { IAccount } from "@account-abstraction/contracts/interfaces/IAccount.sol";
import { Exec } from "@account-abstraction/contracts/utils/Exec.sol";
import { IPaymaster } from "@account-abstraction/contracts/interfaces/IPaymaster.sol";
import { PackedUserOperation } from "@nexus/contracts/Nexus.sol";

import { Nexus } from "@nexus/contracts/Nexus.sol";
import { CheatCodes } from "@nexus/test/foundry/utils/CheatCodes.sol";
Expand Down Expand Up @@ -43,20 +42,14 @@ abstract contract TestBase is CheatCodes, TestHelper, BaseEventsAndErrors {
// Setup Functions
// -----------------------------------------
/// @notice Initializes the testing environment with wallets, contracts, and accounts
function setupTestEnvironment() internal virtual {
function setupPaymasterTestEnvironment() internal virtual {
/// Initializes the testing environment
setupPredefinedWallets();
setupPaymasterPredefinedWallets();
deployTestContracts();
deployNexusForPredefinedWallets();
}

function createAndFundWallet(string memory name, uint256 amount) internal returns (Vm.Wallet memory) {
Vm.Wallet memory wallet = newWallet(name);
vm.deal(wallet.addr, amount);
return wallet;
}

function setupPaymasterPredefinedWallets() internal {
PAYMASTER_OWNER = createAndFundWallet("PAYMASTER_OWNER", 1000 ether);
PAYMASTER_SIGNER = createAndFundWallet("PAYMASTER_SIGNER", 1000 ether);
Expand Down
Loading

0 comments on commit 8c1cf12

Please sign in to comment.