helpers

package
v0.0.0-...-3da4c06 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: LGPL-3.0 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 astratypes.Signer, shard uint32, nonce, gasLimit uint64, gasPrice, amount *big.Int, data []byte,
) (*astratypes.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 astratypes.Signer, fromShard, toShard uint32, nonce, gasLimit uint64,
	gasPrice, amount *big.Int, data []byte,
) (*astratypes.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