helpers

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Hosts - host combinations
	Hosts []Host
	// Topics - p2p topics
	Topics []string
	// Bootnodes - p2p bootnodes
	Bootnodes []string
)

Functions

func CreateTestContractCreationTransaction

func CreateTestContractCreationTransaction(
	signer hmytypes.Signer, shard uint32, nonce, gasLimit uint64, gasPrice, amount *big.Int, data []byte,
) (*hmytypes.Transaction, error)

CreateTestContractCreationTransaction creates a pre-signed contract creation transaction

func CreateTestStakingTransaction

func CreateTestStakingTransaction(
	payloadMaker func() (stakingTypes.Directive, interface{}), key *ecdsa.PrivateKey,
	nonce, gasLimit uint64, gasPrice *big.Int,
) (*stakingTypes.StakingTransaction, error)

CreateTestStakingTransaction creates a pre-signed staking transaction

func CreateTestTransaction

func CreateTestTransaction(
	signer hmytypes.Signer, fromShard, toShard uint32, nonce, gasLimit uint64,
	gasPrice, amount *big.Int, data []byte,
) (*hmytypes.Transaction, error)

CreateTestTransaction creates a pre-signed transaction

func GenerateHost

func GenerateHost(address string, port string) (p2p.Host, *bls.PublicKey, error)

GenerateHost - test helper to generate a new host

func GeneratePeer

func GeneratePeer(address string, port string) (p2p.Peer, error)

GeneratePeer - test helper to generate a new peer

func GeneratePrivateKey

func GeneratePrivateKey() (privateKey libp2p_crypto.PrivKey, publicKey libp2p_crypto.PubKey, err error)

GeneratePrivateKey - test helper to generate a new private key to be used for p2p

func GetMessageFromStakingTx

func GetMessageFromStakingTx(tx *stakingTypes.StakingTransaction) (map[string]interface{}, error)

GetMessageFromStakingTx gets the staking message, as seen by the rpc layer

Types

type Host

type Host struct {
	IP   string
	Port string
}

Host - struct for representing a host (IP / Port)

Jump to

Keyboard shortcuts

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