Versions in this module Expand all Collapse all v0 v0.0.1 May 23, 2023 Changes in this version + const DefaultGasLimit + const DefaultGasPrice + var DefaultTimeout = time.Minute + func EcrecoverFromBlockhash(hash types.Hash, signature []byte) (types.Address, error) + func EthToWei(ethValue int64) *big.Int + func EthToWeiPrecise(ethValue int64, decimals int64) *big.Int + func GetAccountBalance(t *testing.T, address types.Address, rpcClient *jsonrpc.Client) *big.Int + func GetStakedAmount(from types.Address, rpcClient *jsonrpc.Client) (*big.Int, error) + func GetValidatorSet(from types.Address, rpcClient *jsonrpc.Client) ([]types.Address, error) + func MethodSig(name string) []byte + func MethodSigWithParams(nameWithParams string) []byte + func MultiJoin(t *testing.T, srvs ...*TestServer) + func MultiJoinSerial(t *testing.T, srvs []*TestServer) + func StakeAmount(from types.Address, senderKey *ecdsa.PrivateKey, amount *big.Int, ...) error + func ToLocalIPv4LibP2pAddr(port int, nodeID string) string + func UnstakeAmount(from types.Address, senderKey *ecdsa.PrivateKey, srv *TestServer) (*ethgo.Receipt, error) + func WaitForServersToSeal(servers []*TestServer, desiredHeight uint64) []error + func WaitUntilBlockMined(ctx context.Context, srv *TestServer, desiredHeight uint64) (uint64, error) + func WaitUntilPeerConnects(ctx context.Context, srv *TestServer, requiredNum int) (*proto.PeersListResponse, error) + func WaitUntilTxPoolFilled(ctx context.Context, srv *TestServer, requiredNum uint64) (*txpoolProto.TxnPoolStatusResp, error) + type AtomicErrors struct + func NewAtomicErrors(capacity int) AtomicErrors + func (a *AtomicErrors) Append(err error) + func (a *AtomicErrors) Errors() []error + type ConsensusType int + const ConsensusDev + const ConsensusDummy + const ConsensusIBFT + type IBFTServerConfigCallback func(index int, config *TestServerConfig) + type IBFTServersManager struct + func NewIBFTServersManager(t *testing.T, numNodes int, ibftDirPrefix string, ...) *IBFTServersManager + func (m *IBFTServersManager) GetServer(i int) *TestServer + func (m *IBFTServersManager) StartServers(ctx context.Context) + func (m *IBFTServersManager) StopServers() + type InitIBFTResult struct + Address string + NodeID string + type PredeployParams struct + ArtifactsPath string + ConstructorArgs []string + PredeployAddress string + type PreparedTransaction struct + From types.Address + Gas uint64 + GasPrice *big.Int + Input []byte + To *types.Address + Value *big.Int + type ReservedPort struct + func FindAvailablePort(from, to int) *ReservedPort + func FindAvailablePorts(n, from, to int) ([]ReservedPort, error) + func (p *ReservedPort) Close() error + func (p *ReservedPort) IsClosed() bool + func (p *ReservedPort) Port() int + type SrvAccount struct + Addr types.Address + Balance *big.Int + type TestServer struct + Config *TestServerConfig + func NewTestServer(t *testing.T, rootDir string, callback TestServerConfigCallback) *TestServer + func NewTestServers(t *testing.T, num int, conf func(*TestServerConfig)) []*TestServer + func (t *TestServer) CallJSONRPC(req map[string]interface{}) map[string]interface{} + func (t *TestServer) DeployContract(ctx context.Context, binary string, privateKey *ecdsa.PrivateKey) (ethgo.Address, error) + func (t *TestServer) GenerateGenesis() error + func (t *TestServer) GenesisPredeploy() error + func (t *TestServer) GetGasTotal(txHashes []ethgo.Hash) uint64 + func (t *TestServer) GetLatestBlockHeight() (uint64, error) + func (t *TestServer) GetStdout() io.Writer + func (t *TestServer) GrpcAddr() string + func (t *TestServer) HTTPJSONRPCURL() string + func (t *TestServer) IBFTOperator() ibftOp.IbftOperatorClient + func (t *TestServer) InvokeMethod(ctx context.Context, contractAddress types.Address, method string, ...) *ethgo.Receipt + func (t *TestServer) JSONRPC() *jsonrpc.Client + func (t *TestServer) JSONRPCAddr() string + func (t *TestServer) LibP2PAddr() string + func (t *TestServer) Operator() proto.SystemClient + func (t *TestServer) ReleaseReservedPorts() + func (t *TestServer) SecretsInit() (*InitIBFTResult, error) + func (t *TestServer) SendRawTx(ctx context.Context, tx *PreparedTransaction, signerKey *ecdsa.PrivateKey) (*ethgo.Receipt, error) + func (t *TestServer) SignTx(transaction *types.Transaction, privateKey *ecdsa.PrivateKey) (*types.Transaction, error) + func (t *TestServer) Start(ctx context.Context) error + func (t *TestServer) Stop() + func (t *TestServer) SwitchIBFTType(typ fork.IBFTType, from uint64, to, deployment *uint64) error + func (t *TestServer) Txn(key *wallet.Key) *Txn + func (t *TestServer) TxnPoolOperator() txpoolProto.TxnPoolOperatorClient + func (t *TestServer) WSJSONRPCURL() string + func (t *TestServer) WaitForReady(ctx context.Context) error + func (t *TestServer) WaitForReceipt(ctx context.Context, hash ethgo.Hash) (*ethgo.Receipt, error) + type TestServerConfig struct + BlockGasLimit uint64 + BlockGasTarget uint64 + BlockTime uint64 + Bootnodes []string + Consensus ConsensusType + DevInterval int + DevStakers []types.Address + EpochSize uint64 + GRPCPort int + GenesisValidatorBalance *big.Int + IBFTBaseTimeout uint64 + IBFTDir string + IBFTDirPrefix string + IsPos bool + JSONRPCPort int + LibP2PPort int + LogsDir string + MaxValidatorCount uint64 + MinValidatorCount uint64 + Name string + PredeployParams *PredeployParams + PremineAccts []*SrvAccount + PriceLimit *uint64 + ReservedPorts []ReservedPort + RootDir string + SaveLogs bool + ShowsLog bool + Signer *crypto.EIP155Signer + ValidatorType validators.ValidatorType + func (t *TestServerConfig) DataDir() string + func (t *TestServerConfig) Premine(addr types.Address, amount *big.Int) + func (t *TestServerConfig) PremineValidatorBalance(balance *big.Int) + func (t *TestServerConfig) PrivateKey() (*ecdsa.PrivateKey, error) + func (t *TestServerConfig) SetBlockGasTarget(target uint64) + func (t *TestServerConfig) SetBlockLimit(limit uint64) + func (t *TestServerConfig) SetBlockTime(blockTime uint64) + func (t *TestServerConfig) SetBootnodes(bootnodes []string) + func (t *TestServerConfig) SetConsensus(c ConsensusType) + func (t *TestServerConfig) SetDevInterval(interval int) + func (t *TestServerConfig) SetDevStakingAddresses(stakingAddresses []types.Address) + func (t *TestServerConfig) SetEpochSize(epochSize uint64) + func (t *TestServerConfig) SetIBFTBaseTimeout(baseTimeout uint64) + func (t *TestServerConfig) SetIBFTDir(ibftDir string) + func (t *TestServerConfig) SetIBFTDirPrefix(ibftDirPrefix string) + func (t *TestServerConfig) SetIBFTPoS(value bool) + func (t *TestServerConfig) SetLogsDir(dir string) + func (t *TestServerConfig) SetMaxValidatorCount(val uint64) + func (t *TestServerConfig) SetMinValidatorCount(val uint64) + func (t *TestServerConfig) SetName(name string) + func (t *TestServerConfig) SetPredeployParams(params *PredeployParams) + func (t *TestServerConfig) SetPriceLimit(priceLimit *uint64) + func (t *TestServerConfig) SetSaveLogs(f bool) + func (t *TestServerConfig) SetShowsLog(f bool) + func (t *TestServerConfig) SetSigner(signer *crypto.EIP155Signer) + func (t *TestServerConfig) SetValidatorType(vt validators.ValidatorType) + type TestServerConfigCallback func(*TestServerConfig) + type Txn struct + func (t *Txn) Complete() bool + func (t *Txn) Deploy(input []byte) *Txn + func (t *Txn) GasLimit(gas uint64) *Txn + func (t *Txn) GasPrice(price uint64) *Txn + func (t *Txn) NoFail(tt *testing.T) + func (t *Txn) Nonce(nonce uint64) *Txn + func (t *Txn) Receipt() *ethgo.Receipt + func (t *Txn) Send() (*Txn, error) + func (t *Txn) To(to ethgo.Address) *Txn + func (t *Txn) Transfer(to ethgo.Address, value *big.Int) *Txn + func (t *Txn) Value(value *big.Int) *Txn + func (t *Txn) Wait()