Documentation ¶
Index ¶
- Constants
- func AdvanceTo(eth layer1.Client, target uint64)
- func CreateAccounts(unitTestDirectory string, numAccounts int) (string, string, []accounts.Account)
- func FundAccounts(eth layer1.Client, watcher transaction.Watcher, logger *logrus.Entry) error
- func GenerateHardhatConfig(tempDir, hardhatPath, endPoint string) string
- func GetAccountsWithoutOutKeyStore(n int) ([]ecdsa.PublicKey, []common.Address)
- func GetAdminAccount() (common.Address, *ecdsa.PrivateKey)
- func GetHardhatBinPath() string
- func GetHardhatPackagePath() string
- func GetProjectRootPath() string
- func InitializePrivateKeys(n int) []*ecdsa.PrivateKey
- func MineBlocks(endPoint string, blocksToMine uint64)
- func MineFinalityDelayBlocks(client layer1.Client)
- func ResetHardhatConfigs(endPoint string)
- func ResetHardhatNode(endPoint string)
- func SendCommandViaRPC(url, command string, params ...interface{}) error
- func SetAutoMine(endPoint string, autoMine bool)
- func SetBlockInterval(endPoint string, intervalInMilliSeconds uint64)
- func SetCommandStdOut(cmd *exec.Cmd)
- func SetNextBlockBaseFee(endPoint string, target uint64)
- func SetupPrivateKeys(n int) []*ecdsa.PrivateKey
- func WaitGroupReceipts(t *testing.T, client layer1.Client, ...)
- type ClientFixture
- type Hardhat
- func (h *Hardhat) Close() error
- func (h *Hardhat) DeployFactoryAndContracts(tmpDir, baseFilesDir string) (string, error)
- func (h *Hardhat) IsHardHatRunning() (bool, error)
- func (h *Hardhat) RegisterValidators(factoryAddress string, validators []string) error
- func (h *Hardhat) WaitForHardHatNode(ctx context.Context) error
Constants ¶
const ( TestAdminPrivateKey string = "6aea45ee1273170fb525da34015e4f20ba39fe792f486ba74020bcacc9badfc1" SmartContractsRelativeFolder string = "bridge" )
Test admin private key. DONT USE THIS ON MAINNET!!!!
Variables ¶
This section is empty.
Functions ¶
func CreateAccounts ¶
CreateAccounts creates the privateKeys and accounts for a given number of accounts. The first created account will be always the hardhat admin account.
func FundAccounts ¶
func GenerateHardhatConfig ¶
func GetAdminAccount ¶
func GetAdminAccount() (common.Address, *ecdsa.PrivateKey)
GetAdminAccount gets the admin account for the hardhat node. If that admin account is changed in the hardhat configs change this.
func GetHardhatBinPath ¶
func GetHardhatBinPath() string
func GetHardhatPackagePath ¶
func GetHardhatPackagePath() string
GetHardhatPackagePath return the bridge folder path.
func GetProjectRootPath ¶
func GetProjectRootPath() string
func InitializePrivateKeys ¶
func InitializePrivateKeys(n int) []*ecdsa.PrivateKey
func MineBlocks ¶
MineBlocks mines a certain number of hardhat blocks.
func MineFinalityDelayBlocks ¶
Mine finality delay blocks + 1.
func ResetHardhatConfigs ¶
func ResetHardhatConfigs(endPoint string)
ResetHardhatConfigs resets the hardhat configs to automine true and basefee 100GWei.
func ResetHardhatNode ¶
func ResetHardhatNode(endPoint string)
ResetHardhatNode resets hardhat node from scratch.
func SendCommandViaRPC ¶
SendCommandViaRPC sends a command to the hardhat server via an RPC call.
func SetAutoMine ¶
SetAutoMine enables/disables hardhat autoMine.
func SetBlockInterval ¶
SetBlockInterval sets the interval between hardhat blocks. In case interval is 0, we enter in manual mode and blocks can only be mined explicitly by calling `MineBlocks`. This function disables autoMine.
func SetCommandStdOut ¶
SetCommandStdOut If ENABLE_SCRIPT_LOG env variable is set as 'true' the command will show scripts logs.
func SetNextBlockBaseFee ¶
SetNextBlockBaseFee sets the the Base fee for the next hardhat block. Can be used to make tx stale.
func SetupPrivateKeys ¶
func SetupPrivateKeys(n int) []*ecdsa.PrivateKey
SetupPrivateKeys computes deterministic private keys for testing.
func WaitGroupReceipts ¶
func WaitGroupReceipts(t *testing.T, client layer1.Client, receiptResponses []transaction.ReceiptResponse)
Types ¶
type ClientFixture ¶
type ClientFixture struct { Client layer1.Client Contracts layer1.AllSmartContracts Watcher transaction.Watcher MonitorDb *db.Database FactoryAddress string TempDir string KeyStorePath string PassCodePath string Logger *logrus.Entry }
func NewClientFixture ¶
func (*ClientFixture) Close ¶
func (c *ClientFixture) Close()
type Hardhat ¶
type Hardhat struct {
// contains filtered or unexported fields
}