Skip to content

Commit

Permalink
simulation test case
Browse files Browse the repository at this point in the history
  • Loading branch information
livingrockrises committed Aug 26, 2024
1 parent 3362262 commit a8bfcc1
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions test/foundry/smart-account/SA.Simulation.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import {SATestBase} from "../base/SATestBase.sol";

import {SmartAccount} from "sa/SmartAccount.sol";
import {MockEthSender} from "sa/test/mocks/MockEthSender.sol";
import {EntryPoint, IEntryPoint, UserOperation} from "aa-core/EntryPoint.sol";

contract Test {
event Log(string message);

function emitString(string calldata str) external {
emit Log(str);
}
}

contract SASimulationTest is SATestBase {
event Log(string message);
Test test = new Test();

function setUp() public virtual override {
super.setUp();
}

function testSimulationBartio() external {
vm.createSelectFork("https://bartio.rpc.berachain.com");
UserOperation memory op = UserOperation({
sender: 0x5F141ee1390D4c9d033a00CB940E509A4811a5E0,
nonce: 0x4b,
initCode: bytes(""),
callData: hex"0000189a000000000000000000000000cf29227477393728935bdbb86770f8f81b698f1a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004d09de08a00000000000000000000000000000000000000000000000000000000",
callGasLimit: 0xf4240,
verificationGasLimit: 0x4c4b40,
preVerificationGas: 0xf4240,
maxFeePerGas: 0xf4240,
maxPriorityFeePerGas: 0xf4240,
paymasterAndData: bytes(""),
signature: hex"0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000002fbffedd9b33f4e7156f2de8d48945e748900000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006bc2ecdae38113929293d241cf252d9186100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000003ebf9C3241E908D3A2dBf18251946C6ec9478767A5cf29227477393728935BdBB86770f8F81b698F1Ad09de08a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041eccdbd4d4883a13b111ac040c8da7228724584eb0b1c1d3262109e32b789592439bc6926682893d3cb4a2fa6fa7071c71be0cb7d9f99ca8560500d5dc607fc021b00000000000000000000000000000000000000000000000000000000000000"
});
EntryPoint(payable(0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789)).handleOps(toArray(op), payable(owner.addr));
}

}

0 comments on commit a8bfcc1

Please sign in to comment.