Documentation ¶
Index ¶
- Constants
- func CommitteeAddress() string
- func CommitteeScriptHash() util.Uint160
- func CommitteeSize() int
- func CommitteeVerificationScript() []byte
- func IDToOrder(id int) int
- func MultisigAddress() string
- func MultisigScriptHash() util.Uint160
- func MultisigVerificationScript() []byte
- func Network() netmode.Magic
- func NewBlock(t *testing.T, bc Ledger, offset uint32, primary uint32, ...) *block.Block
- func NewDeployTx(bc Ledger, name string, sender util.Uint160, r gio.Reader, confFile *string) (*transaction.Transaction, util.Uint160, []byte, error)
- func NewTransferFromOwner(bc Ledger, contractHash, to util.Uint160, amount int64, ...) (*transaction.Transaction, error)
- func PrivateKey(i int) *keys.PrivateKey
- func PrivateKeyByID(id int) *keys.PrivateKey
- func Sign(h hash.Hashable) []byte
- func SignCommittee(h hash.Hashable) []byte
- func SignTx(bc Ledger, txs ...*transaction.Transaction) error
- func SignTxCommittee(bc Ledger, txs ...*transaction.Transaction) error
- func Size() int
- func WIF(i int) string
- type Ledger
Constants ¶
const ValidatorsCount = 4
ValidatorsCount returns the 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 ¶
CommitteeScriptHash returns committee address as Uint160.
func CommitteeVerificationScript ¶
func CommitteeVerificationScript() []byte
CommitteeVerificationScript returns script hash of the committee multisig address.
func MultisigAddress ¶
func MultisigAddress() string
MultisigAddress return consensus address as string.
func MultisigScriptHash ¶
MultisigScriptHash returns consensus address as Uint160.
func MultisigVerificationScript ¶
func MultisigVerificationScript() []byte
MultisigVerificationScript returns script hash of the consensus multisig address.
func NewBlock ¶
func NewBlock(t *testing.T, bc Ledger, offset uint32, primary uint32, txs ...*transaction.Transaction) *block.Block
NewBlock creates a new block for the given blockchain with the given offset (usually, 1), primary node index and transactions.
func NewDeployTx ¶
func NewDeployTx(bc Ledger, name string, sender util.Uint160, r gio.Reader, confFile *string) (*transaction.Transaction, util.Uint160, []byte, error)
NewDeployTx returns a new deployment transaction for a contract with the source from r and a name equal to the filename without '.go' suffix.
func NewTransferFromOwner ¶
func NewTransferFromOwner(bc Ledger, contractHash, to util.Uint160, amount int64, nonce, validUntil uint32) (*transaction.Transaction, error)
NewTransferFromOwner returns a transaction transferring funds from NEO and GAS owner.
func PrivateKey ¶
func PrivateKey(i int) *keys.PrivateKey
PrivateKey returns the 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 SignCommittee ¶
SignCommittee signs data by a majority of committee members.
func SignTx ¶
func SignTx(bc Ledger, txs ...*transaction.Transaction) error
SignTx signs the provided transactions with validator keys.
func SignTxCommittee ¶ added in v0.93.0
func SignTxCommittee(bc Ledger, txs ...*transaction.Transaction) error
SignTxCommittee signs transactions by committee.
Types ¶
type Ledger ¶ added in v0.99.1
type Ledger interface { BlockHeight() uint32 FeePerByte() int64 GetBaseExecFee() int64 GetHeader(hash util.Uint256) (*block.Header, error) GetHeaderHash(uint32) util.Uint256 HeaderHeight() uint32 ManagementContractHash() util.Uint160 }
Ledger is an interface that abstracts the implementation of the blockchain.