Documentation ¶
Index ¶
- Variables
- func DBMock() *badger.DB
- func EthMock(mocks MethodMocks) *httptest.Server
- func GetMockBaseFeeFunc(val *big.Int) func() (*big.Int, error)
- func GetOpsDiff(op1 *userop.UserOperation, op2 *userop.UserOperation) string
- func IsOpsEqual(op1 *userop.UserOperation, op2 *userop.UserOperation) bool
- func MockGetCode(addr common.Address) ([]byte, error)
- func MockGetCodeZero(addr common.Address) ([]byte, error)
- func MockGetNotStake(addr common.Address) (*entrypoint.IStakeManagerDepositInfo, error)
- func MockGetNotStakeZeroDeposit(addr common.Address) (*entrypoint.IStakeManagerDepositInfo, error)
- func MockGetStake(addr common.Address) (*entrypoint.IStakeManagerDepositInfo, error)
- func MockGetStakeZeroDeposit(addr common.Address) (*entrypoint.IStakeManagerDepositInfo, error)
- func MockValidInitUserOp() *userop.UserOperation
- type MethodMocks
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OneETH = big.NewInt(1000000000000000000) DefaultUnstakeDelaySec = uint32(86400) ValidAddress1 = common.HexToAddress("0x7357b8a705328FC283dF72D7Ac546895B596DC12") ValidAddress2 = common.HexToAddress("0x7357c9504B8686c008CCcD6ea47f1c21B7475dE3") ChainID = big.NewInt(1) MaxOpsForUnstakedSender = 1 StakedDepositInfo = &entrypoint.IStakeManagerDepositInfo{ Deposit: big.NewInt(OneETH.Int64()), Staked: true, Stake: big.NewInt(OneETH.Int64()), UnstakeDelaySec: DefaultUnstakeDelaySec, WithdrawTime: big.NewInt(time.Now().Unix()), } StakedZeroDepositInfo = &entrypoint.IStakeManagerDepositInfo{ Deposit: big.NewInt(0), Staked: true, Stake: big.NewInt(OneETH.Int64()), UnstakeDelaySec: DefaultUnstakeDelaySec, WithdrawTime: big.NewInt(time.Now().Unix()), } NonStakedDepositInfo = &entrypoint.IStakeManagerDepositInfo{ Deposit: big.NewInt(OneETH.Int64()), Staked: false, Stake: big.NewInt(0), UnstakeDelaySec: uint32(0), WithdrawTime: big.NewInt(0), } NonStakedZeroDepositInfo = &entrypoint.IStakeManagerDepositInfo{ Deposit: big.NewInt(0), Staked: false, Stake: big.NewInt(0), UnstakeDelaySec: uint32(0), WithdrawTime: big.NewInt(0), } )
View Source
var ( MockUserOpData = map[string]any{ "sender": "0xa13D69573f994bf662C2714560c44dd7266FC547", "nonce": "0x0", "initCode": "0xe19e9755942bb0bd0cccce25b1742596b8a8250b3bf2c3e700000000000000000000000078d4f01f56b982a3b03c4e127a5d3afa8ebee6860000000000000000000000008b388a082f370d8ac2e2b3997e9151168bd09ff50000000000000000000000000000000000000000000000000000000000000000", "callData": "0x80c5c7d0000000000000000000000000a13d69573f994bf662c2714560c44dd7266fc547000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000", "callGasLimit": "0x558c", "verificationGasLimit": "0x129727", "maxFeePerGas": "0xa862145e", "maxPriorityFeePerGas": "0xa8621440", "paymasterAndData": "0x", "preVerificationGas": "0xc650", "signature": "0xa925dcc5e5131636e244d4405334c25f034ebdd85c0cb12e8cdb13c15249c2d466d0bade18e2cafd3513497f7f968dcbb63e519acd9b76dcae7acd61f11aa8421b", } MockByteCode = common.Hex2Bytes("6080604052") )
Functions ¶
func EthMock ¶
func EthMock(mocks MethodMocks) *httptest.Server
EthMock returns a httptest.Server for mocking the return value of a JSON-RPC method call to an Ethereum node.
func GetMockBaseFeeFunc ¶ added in v0.2.0
func GetOpsDiff ¶
func GetOpsDiff(op1 *userop.UserOperation, op2 *userop.UserOperation) string
func IsOpsEqual ¶
func IsOpsEqual(op1 *userop.UserOperation, op2 *userop.UserOperation) bool
func MockGetNotStake ¶
func MockGetNotStake(addr common.Address) (*entrypoint.IStakeManagerDepositInfo, error)
func MockGetNotStakeZeroDeposit ¶
func MockGetNotStakeZeroDeposit(addr common.Address) (*entrypoint.IStakeManagerDepositInfo, error)
func MockGetStake ¶
func MockGetStake(addr common.Address) (*entrypoint.IStakeManagerDepositInfo, error)
func MockGetStakeZeroDeposit ¶
func MockGetStakeZeroDeposit(addr common.Address) (*entrypoint.IStakeManagerDepositInfo, error)
func MockValidInitUserOp ¶
func MockValidInitUserOp() *userop.UserOperation
Returns a valid initial userOperation for an EIP-4337 account.
Types ¶
type MethodMocks ¶
Click to show internal directories.
Click to hide internal directories.