audit

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package audit contains RPC wrappers for NeoFS Audit contract.

Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor interface {
	Invoker

	MakeCall(contract util.Uint160, method string, params ...any) (*transaction.Transaction, error)
	MakeRun(script []byte) (*transaction.Transaction, error)
	MakeUnsignedCall(contract util.Uint160, method string, attrs []transaction.Attribute, params ...any) (*transaction.Transaction, error)
	MakeUnsignedRun(script []byte, attrs []transaction.Attribute) (*transaction.Transaction, error)
	SendCall(contract util.Uint160, method string, params ...any) (util.Uint256, uint32, error)
	SendRun(script []byte) (util.Uint256, uint32, error)
}

Actor is used by Contract to call state-changing methods.

type AuditAuditHeader

type AuditAuditHeader struct {
	Epoch *big.Int
	CID   []byte
	From  *keys.PublicKey
}

AuditAuditHeader is a contract-specific audit.AuditHeader type used by its methods.

func (*AuditAuditHeader) FromStackItem

func (res *AuditAuditHeader) FromStackItem(item stackitem.Item) error

FromStackItem retrieves fields of AuditAuditHeader from the given stackitem.Item or returns an error if it's not possible to do to so.

type Contract

type Contract struct {
	ContractReader
	// contains filtered or unexported fields
}

Contract implements all contract methods.

func New

func New(actor Actor, hash util.Uint160) *Contract

New creates an instance of Contract using provided contract hash and the given Actor.

func (*Contract) Put

func (c *Contract) Put(rawAuditResult []byte) (util.Uint256, uint32, error)

Put creates a transaction invoking `put` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) PutTransaction

func (c *Contract) PutTransaction(rawAuditResult []byte) (*transaction.Transaction, error)

PutTransaction creates a transaction invoking `put` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) PutUnsigned

func (c *Contract) PutUnsigned(rawAuditResult []byte) (*transaction.Transaction, error)

PutUnsigned creates a transaction invoking `put` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

func (*Contract) Update

func (c *Contract) Update(script []byte, manifest []byte, data any) (util.Uint256, uint32, error)

Update creates a transaction invoking `update` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.

func (*Contract) UpdateTransaction

func (c *Contract) UpdateTransaction(script []byte, manifest []byte, data any) (*transaction.Transaction, error)

UpdateTransaction creates a transaction invoking `update` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.

func (*Contract) UpdateUnsigned

func (c *Contract) UpdateUnsigned(script []byte, manifest []byte, data any) (*transaction.Transaction, error)

UpdateUnsigned creates a transaction invoking `update` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.

type ContractReader

type ContractReader struct {
	// contains filtered or unexported fields
}

ContractReader implements safe contract methods.

func NewReader

func NewReader(invoker Invoker, hash util.Uint160) *ContractReader

NewReader creates an instance of ContractReader using provided contract hash and the given Invoker.

func (*ContractReader) Get

func (c *ContractReader) Get(id []byte) ([]byte, error)

Get invokes `get` method of contract.

func (*ContractReader) List

func (c *ContractReader) List() ([][]byte, error)

List invokes `list` method of contract.

func (*ContractReader) ListByCID

func (c *ContractReader) ListByCID(epoch *big.Int, cid []byte) ([][]byte, error)

ListByCID invokes `listByCID` method of contract.

func (*ContractReader) ListByEpoch

func (c *ContractReader) ListByEpoch(epoch *big.Int) ([][]byte, error)

ListByEpoch invokes `listByEpoch` method of contract.

func (*ContractReader) ListByNode

func (c *ContractReader) ListByNode(epoch *big.Int, cid []byte, key *keys.PublicKey) ([][]byte, error)

ListByNode invokes `listByNode` method of contract.

func (*ContractReader) Version

func (c *ContractReader) Version() (*big.Int, error)

Version invokes `version` method of contract.

type Invoker

type Invoker interface {
	Call(contract util.Uint160, operation string, params ...any) (*result.Invoke, error)
}

Invoker is used by ContractReader to call various safe methods.

Jump to

Keyboard shortcuts

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