local_blockchain

package
v0.0.118 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2024 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const ENTRY_POINT_ADDRESS_V06 = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"

These addresses are hardcoded in the Paymaster contract and determined by CREATE2

Variables

This section is empty.

Functions

func BuildClient added in v0.0.118

func BuildClient(t *testing.T, rpcURL, bundlerURL url.URL, addresses Contracts, paymasterConfig userop.PaymasterConfig) userop.Client

func SendNative added in v0.0.40

func SendNative(ctx context.Context, node *EthNode, from, to Account, fundAmount *big.Int) error

func SetupPaymaster added in v0.0.118

func SetupPaymaster(ctx context.Context, t *testing.T, node *EthNode, bundler *BundlerNode) *url.URL

func WaitMined added in v0.0.40

func WaitMined(ctx context.Context, node *EthNode, tx *types.Transaction) (*types.Receipt, error)

Types

type Account

type Account struct {
	PrivateKey   *ecdsa.PrivateKey
	Address      common.Address
	TransactOpts *bind.TransactOpts
}

func NewAccount

func NewAccount(ctx context.Context, node *EthNode) (Account, error)

func NewAccountWithBalance

func NewAccountWithBalance(
	ctx context.Context,
	amount *big.Int,
	node *EthNode,
) (Account, error)

type BundlerNode

type BundlerNode struct {
	Container    testcontainers.Container
	LocalURL     url.URL
	ContainerURL url.URL
}

func NewBundler

func NewBundler(ctx context.Context, t *testing.T, node *EthNode, entryPoint common.Address) *BundlerNode

type Contracts

type Contracts struct {
	EntryPoint          common.Address
	ECDSAValidator      common.Address
	SessionKeyValidator common.Address
	Logic               common.Address
	Factory             common.Address
	Paymaster           common.Address
}

func SetupContracts

func SetupContracts(ctx context.Context, t *testing.T, node *EthNode) Contracts

type EthNode

type EthNode struct {
	Container    testcontainers.Container
	RPCClient    *rpc.Client
	Client       *ethclient.Client
	LocalURL     url.URL
	ContainerURL url.URL
	// contains filtered or unexported fields
}

func NewEthNode

func NewEthNode(ctx context.Context, t *testing.T) *EthNode

func (*EthNode) FundAccount added in v0.0.54

func (n *EthNode) FundAccount(ctx context.Context, to Account, amount *big.Int) error

type MockedClient added in v0.0.54

type MockedClient struct {
	ethclient.Client
	// contains filtered or unexported fields
}

func (*MockedClient) SendTransaction added in v0.0.54

func (m *MockedClient) SendTransaction(ctx context.Context, tx *types.Transaction) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL