testchain

package
v0.95.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const ValidatorsCount = 4

ValidatorsCount returns number of validators in the testchain.

Variables

This section is empty.

Functions

func CommitteeAddress

func CommitteeAddress() string

CommitteeAddress return committee address as string.

func CommitteeScriptHash

func CommitteeScriptHash() util.Uint160

CommitteeScriptHash returns committee address as Uint160.

func CommitteeSize

func CommitteeSize() int

CommitteeSize returns testchain committee size.

func CommitteeVerificationScript

func CommitteeVerificationScript() []byte

CommitteeVerificationScript returns script hash of the committee multisig address.

func IDToOrder

func IDToOrder(id int) int

IDToOrder returns node's order in privnet.

func MultisigAddress

func MultisigAddress() string

MultisigAddress return consensus address as string.

func MultisigScriptHash

func MultisigScriptHash() util.Uint160

MultisigScriptHash returns consensus address as Uint160.

func MultisigVerificationScript

func MultisigVerificationScript() []byte

MultisigVerificationScript returns script hash of the consensus multisig address.

func Network

func Network() netmode.Magic

Network returns test chain network's magic number.

func NewBlock

func NewBlock(t *testing.T, bc blockchainer.Blockchainer, offset uint32, primary uint32, txs ...*transaction.Transaction) *block.Block

NewBlock creates new block for the given blockchain with the given offset (usually, 1), primary node index and transactions.

func NewDeployTx

func NewDeployTx(bc blockchainer.Blockchainer, name string, sender util.Uint160, r gio.Reader, confFile *string) (*transaction.Transaction, util.Uint160, []byte, error)

NewDeployTx returns new deployment tx for contract with name with Go code read from r.

func NewTransferFromOwner

func NewTransferFromOwner(bc blockchainer.Blockchainer, contractHash, to util.Uint160, amount int64,
	nonce, validUntil uint32) (*transaction.Transaction, error)

NewTransferFromOwner returns transaction transferring funds from NEO and GAS owner.

func PrivateKey

func PrivateKey(i int) *keys.PrivateKey

PrivateKey returns private key of node #i.

func PrivateKeyByID

func PrivateKeyByID(id int) *keys.PrivateKey

PrivateKeyByID returns private keys of a node with the specified id.

func Sign

func Sign(h hash.Hashable) []byte

Sign signs data by all consensus nodes and returns invocation script.

func SignCommittee

func SignCommittee(h hash.Hashable) []byte

SignCommittee signs data by a majority of committee members.

func SignTx

SignTx signs provided transactions with validator keys.

func SignTxCommittee added in v0.93.0

func SignTxCommittee(bc blockchainer.Blockchainer, txs ...*transaction.Transaction) error

SignTxCommittee signs transactions by committee.

func Size

func Size() int

Size returns testchain initial validators amount.

func WIF

func WIF(i int) string

WIF returns unencrypted wif of the specified validator.

Types

This section is empty.

Jump to

Keyboard shortcuts

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