container

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: GPL-3.0 Imports: 12 Imported by: 4

Documentation

Overview

Package container contains RPC wrappers for NeoFS Container contract.

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 CommonBallot

type CommonBallot struct {
	ID     []byte
	Voters keys.PublicKeys
	Height *big.Int
}

CommonBallot is a contract-specific common.Ballot type used by its methods.

func (*CommonBallot) FromStackItem

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

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

type ContainerContainer

type ContainerContainer struct {
	Value []byte
	Sig   []byte
	Pub   *keys.PublicKey
	Token []byte
}

ContainerContainer is a contract-specific container.Container type used by its methods.

func (*ContainerContainer) FromStackItem

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

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

type ContainerContainerSizes

type ContainerContainerSizes struct {
	CID         []byte
	Estimations []*ContainerEstimation
}

ContainerContainerSizes is a contract-specific container.ContainerSizes type used by its methods.

func (*ContainerContainerSizes) FromStackItem

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

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

type ContainerEstimation

type ContainerEstimation struct {
	From *keys.PublicKey
	Size *big.Int
}

ContainerEstimation is a contract-specific container.Estimation type used by its methods.

func (*ContainerEstimation) FromStackItem

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

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

type ContainerExtendedACL

type ContainerExtendedACL struct {
	Value []byte
	Sig   []byte
	Pub   *keys.PublicKey
	Token []byte
}

ContainerExtendedACL is a contract-specific container.ExtendedACL type used by its methods.

func (*ContainerExtendedACL) FromStackItem

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

FromStackItem retrieves fields of ContainerExtendedACL 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) Delete

func (c *Contract) Delete(containerID []byte, signature []byte, token []byte) (util.Uint256, uint32, error)

Delete creates a transaction invoking `delete` 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) DeleteTransaction

func (c *Contract) DeleteTransaction(containerID []byte, signature []byte, token []byte) (*transaction.Transaction, error)

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

func (*Contract) DeleteUnsigned

func (c *Contract) DeleteUnsigned(containerID []byte, signature []byte, token []byte) (*transaction.Transaction, error)

DeleteUnsigned creates a transaction invoking `delete` 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) NewEpoch

func (c *Contract) NewEpoch(epochNum *big.Int) (util.Uint256, uint32, error)

NewEpoch creates a transaction invoking `newEpoch` 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) NewEpochTransaction

func (c *Contract) NewEpochTransaction(epochNum *big.Int) (*transaction.Transaction, error)

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

func (*Contract) NewEpochUnsigned

func (c *Contract) NewEpochUnsigned(epochNum *big.Int) (*transaction.Transaction, error)

NewEpochUnsigned creates a transaction invoking `newEpoch` 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) Put

func (c *Contract) Put(container []byte, signature []byte, publicKey *keys.PublicKey, token []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) PutContainerSize

func (c *Contract) PutContainerSize(epoch *big.Int, cid []byte, usedSize *big.Int, pubKey *keys.PublicKey) (util.Uint256, uint32, error)

PutContainerSize creates a transaction invoking `putContainerSize` 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) PutContainerSizeTransaction

func (c *Contract) PutContainerSizeTransaction(epoch *big.Int, cid []byte, usedSize *big.Int, pubKey *keys.PublicKey) (*transaction.Transaction, error)

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

func (*Contract) PutContainerSizeUnsigned

func (c *Contract) PutContainerSizeUnsigned(epoch *big.Int, cid []byte, usedSize *big.Int, pubKey *keys.PublicKey) (*transaction.Transaction, error)

PutContainerSizeUnsigned creates a transaction invoking `putContainerSize` 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) PutNamed

func (c *Contract) PutNamed(container []byte, signature []byte, publicKey *keys.PublicKey, token []byte, name string, zone string) (util.Uint256, uint32, error)

PutNamed creates a transaction invoking `putNamed` 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) PutNamedTransaction

func (c *Contract) PutNamedTransaction(container []byte, signature []byte, publicKey *keys.PublicKey, token []byte, name string, zone string) (*transaction.Transaction, error)

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

func (*Contract) PutNamedUnsigned

func (c *Contract) PutNamedUnsigned(container []byte, signature []byte, publicKey *keys.PublicKey, token []byte, name string, zone string) (*transaction.Transaction, error)

PutNamedUnsigned creates a transaction invoking `putNamed` 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) PutTransaction

func (c *Contract) PutTransaction(container []byte, signature []byte, publicKey *keys.PublicKey, token []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(container []byte, signature []byte, publicKey *keys.PublicKey, token []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) SetEACL

func (c *Contract) SetEACL(eACL []byte, signature []byte, publicKey *keys.PublicKey, token []byte) (util.Uint256, uint32, error)

SetEACL creates a transaction invoking `setEACL` 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) SetEACLTransaction

func (c *Contract) SetEACLTransaction(eACL []byte, signature []byte, publicKey *keys.PublicKey, token []byte) (*transaction.Transaction, error)

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

func (*Contract) SetEACLUnsigned

func (c *Contract) SetEACLUnsigned(eACL []byte, signature []byte, publicKey *keys.PublicKey, token []byte) (*transaction.Transaction, error)

SetEACLUnsigned creates a transaction invoking `setEACL` 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) StartContainerEstimation

func (c *Contract) StartContainerEstimation(epoch *big.Int) (util.Uint256, uint32, error)

StartContainerEstimation creates a transaction invoking `startContainerEstimation` 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) StartContainerEstimationTransaction

func (c *Contract) StartContainerEstimationTransaction(epoch *big.Int) (*transaction.Transaction, error)

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

func (*Contract) StartContainerEstimationUnsigned

func (c *Contract) StartContainerEstimationUnsigned(epoch *big.Int) (*transaction.Transaction, error)

StartContainerEstimationUnsigned creates a transaction invoking `startContainerEstimation` 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) StopContainerEstimation

func (c *Contract) StopContainerEstimation(epoch *big.Int) (util.Uint256, uint32, error)

StopContainerEstimation creates a transaction invoking `stopContainerEstimation` 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) StopContainerEstimationTransaction

func (c *Contract) StopContainerEstimationTransaction(epoch *big.Int) (*transaction.Transaction, error)

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

func (*Contract) StopContainerEstimationUnsigned

func (c *Contract) StopContainerEstimationUnsigned(epoch *big.Int) (*transaction.Transaction, error)

StopContainerEstimationUnsigned creates a transaction invoking `stopContainerEstimation` 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) Alias

func (c *ContractReader) Alias(cid []byte) (string, error)

Alias invokes `alias` method of contract.

func (*ContractReader) ContainersOf

func (c *ContractReader) ContainersOf(owner []byte) (uuid.UUID, result.Iterator, error)

ContainersOf invokes `containersOf` method of contract.

func (*ContractReader) ContainersOfExpanded

func (c *ContractReader) ContainersOfExpanded(owner []byte, _numOfIteratorItems int) ([]stackitem.Item, error)

ContainersOfExpanded is similar to ContainersOf (uses the same contract method), but can be useful if the server used doesn't support sessions and doesn't expand iterators. It creates a script that will get the specified number of result items from the iterator right in the VM and return them to you. It's only limited by VM stack and GAS available for RPC invocations.

func (*ContractReader) Count

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

Count invokes `count` method of contract.

func (*ContractReader) EACL

func (c *ContractReader) EACL(containerID []byte) (*ContainerExtendedACL, error)

EACL invokes `eACL` method of contract.

func (*ContractReader) Get

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

Get invokes `get` method of contract.

func (*ContractReader) GetContainerSize

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

GetContainerSize invokes `getContainerSize` method of contract.

func (*ContractReader) IterateAllContainerSizes

func (c *ContractReader) IterateAllContainerSizes(epoch *big.Int) (uuid.UUID, result.Iterator, error)

IterateAllContainerSizes invokes `iterateAllContainerSizes` method of contract.

func (*ContractReader) IterateAllContainerSizesExpanded

func (c *ContractReader) IterateAllContainerSizesExpanded(epoch *big.Int, _numOfIteratorItems int) ([]stackitem.Item, error)

IterateAllContainerSizesExpanded is similar to IterateAllContainerSizes (uses the same contract method), but can be useful if the server used doesn't support sessions and doesn't expand iterators. It creates a script that will get the specified number of result items from the iterator right in the VM and return them to you. It's only limited by VM stack and GAS available for RPC invocations.

func (*ContractReader) IterateContainerSizes

func (c *ContractReader) IterateContainerSizes(epoch *big.Int, cid util.Uint256) (uuid.UUID, result.Iterator, error)

IterateContainerSizes invokes `iterateContainerSizes` method of contract.

func (*ContractReader) IterateContainerSizesExpanded

func (c *ContractReader) IterateContainerSizesExpanded(epoch *big.Int, cid util.Uint256, _numOfIteratorItems int) ([]stackitem.Item, error)

IterateContainerSizesExpanded is similar to IterateContainerSizes (uses the same contract method), but can be useful if the server used doesn't support sessions and doesn't expand iterators. It creates a script that will get the specified number of result items from the iterator right in the VM and return them to you. It's only limited by VM stack and GAS available for RPC invocations.

func (*ContractReader) List

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

List invokes `list` method of contract.

func (*ContractReader) ListContainerSizes

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

ListContainerSizes invokes `listContainerSizes` method of contract.

func (*ContractReader) Owner

func (c *ContractReader) Owner(containerID []byte) ([]byte, error)

Owner invokes `owner` method of contract.

func (*ContractReader) Version

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

Version invokes `version` method of contract.

type DeleteSuccessEvent

type DeleteSuccessEvent struct {
	ContainerID []byte
}

DeleteSuccessEvent represents "DeleteSuccess" event emitted by the contract.

func DeleteSuccessEventsFromApplicationLog

func DeleteSuccessEventsFromApplicationLog(log *result.ApplicationLog) ([]*DeleteSuccessEvent, error)

DeleteSuccessEventsFromApplicationLog retrieves a set of all emitted events with "DeleteSuccess" name from the provided result.ApplicationLog.

func (*DeleteSuccessEvent) FromStackItem

func (e *DeleteSuccessEvent) FromStackItem(item *stackitem.Array) error

FromStackItem converts provided stackitem.Array to DeleteSuccessEvent or returns an error if it's not possible to do to so.

type Invoker

type Invoker interface {
	Call(contract util.Uint160, operation string, params ...any) (*result.Invoke, error)
	CallAndExpandIterator(contract util.Uint160, method string, maxItems int, params ...any) (*result.Invoke, error)
	TerminateSession(sessionID uuid.UUID) error
	TraverseIterator(sessionID uuid.UUID, iterator *result.Iterator, num int) ([]stackitem.Item, error)
}

Invoker is used by ContractReader to call various safe methods.

type LedgerBlock

type LedgerBlock struct {
	Hash               util.Uint256
	Version            *big.Int
	PrevHash           util.Uint256
	MerkleRoot         util.Uint256
	Timestamp          *big.Int
	Nonce              *big.Int
	Index              *big.Int
	NextConsensus      util.Uint160
	TransactionsLength *big.Int
}

LedgerBlock is a contract-specific ledger.Block type used by its methods.

func (*LedgerBlock) FromStackItem

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

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

type LedgerBlockSR

type LedgerBlockSR struct {
	Hash               util.Uint256
	Version            *big.Int
	PrevHash           util.Uint256
	MerkleRoot         util.Uint256
	Timestamp          *big.Int
	Nonce              *big.Int
	Index              *big.Int
	NextConsensus      util.Uint160
	TransactionsLength *big.Int
	PrevStateRoot      util.Uint256
}

LedgerBlockSR is a contract-specific ledger.BlockSR type used by its methods.

func (*LedgerBlockSR) FromStackItem

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

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

type LedgerTransaction

type LedgerTransaction struct {
	Hash            util.Uint256
	Version         *big.Int
	Nonce           *big.Int
	Sender          util.Uint160
	SysFee          *big.Int
	NetFee          *big.Int
	ValidUntilBlock *big.Int
	Script          []byte
}

LedgerTransaction is a contract-specific ledger.Transaction type used by its methods.

func (*LedgerTransaction) FromStackItem

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

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

type LedgerTransactionSigner

type LedgerTransactionSigner struct {
	Account          util.Uint160
	Scopes           *big.Int
	AllowedContracts []util.Uint160
	AllowedGroups    keys.PublicKeys
	Rules            []*LedgerWitnessRule
}

LedgerTransactionSigner is a contract-specific ledger.TransactionSigner type used by its methods.

func (*LedgerTransactionSigner) FromStackItem

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

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

type LedgerWitnessCondition

type LedgerWitnessCondition struct {
	Type  *big.Int
	Value any
}

LedgerWitnessCondition is a contract-specific ledger.WitnessCondition type used by its methods.

func (*LedgerWitnessCondition) FromStackItem

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

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

type LedgerWitnessRule

type LedgerWitnessRule struct {
	Action    *big.Int
	Condition *LedgerWitnessCondition
}

LedgerWitnessRule is a contract-specific ledger.WitnessRule type used by its methods.

func (*LedgerWitnessRule) FromStackItem

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

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

type ManagementABI

type ManagementABI struct {
	Methods []*ManagementMethod
	Events  []*ManagementEvent
}

ManagementABI is a contract-specific management.ABI type used by its methods.

func (*ManagementABI) FromStackItem

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

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

type ManagementContract

type ManagementContract struct {
	ID            *big.Int
	UpdateCounter *big.Int
	Hash          util.Uint160
	NEF           []byte
	Manifest      *ManagementManifest
}

ManagementContract is a contract-specific management.Contract type used by its methods.

func (*ManagementContract) FromStackItem

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

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

type ManagementEvent

type ManagementEvent struct {
	Name   string
	Params []*ManagementParameter
}

ManagementEvent is a contract-specific management.Event type used by its methods.

func (*ManagementEvent) FromStackItem

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

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

type ManagementGroup

type ManagementGroup struct {
	PublicKey *keys.PublicKey
	Signature []byte
}

ManagementGroup is a contract-specific management.Group type used by its methods.

func (*ManagementGroup) FromStackItem

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

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

type ManagementManifest

type ManagementManifest struct {
	Name               string
	Groups             []*ManagementGroup
	Features           map[string]string
	SupportedStandards []string
	ABI                *ManagementABI
	Permissions        []*ManagementPermission
	Trusts             []util.Uint160
	Extra              any
}

ManagementManifest is a contract-specific management.Manifest type used by its methods.

func (*ManagementManifest) FromStackItem

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

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

type ManagementMethod

type ManagementMethod struct {
	Name       string
	Params     []*ManagementParameter
	ReturnType *big.Int
	Offset     *big.Int
	Safe       bool
}

ManagementMethod is a contract-specific management.Method type used by its methods.

func (*ManagementMethod) FromStackItem

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

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

type ManagementParameter

type ManagementParameter struct {
	Name string
	Type *big.Int
}

ManagementParameter is a contract-specific management.Parameter type used by its methods.

func (*ManagementParameter) FromStackItem

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

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

type ManagementPermission

type ManagementPermission struct {
	Contract util.Uint160
	Methods  []string
}

ManagementPermission is a contract-specific management.Permission type used by its methods.

func (*ManagementPermission) FromStackItem

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

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

type PutSuccessEvent

type PutSuccessEvent struct {
	ContainerID util.Uint256
	PublicKey   *keys.PublicKey
}

PutSuccessEvent represents "PutSuccess" event emitted by the contract.

func PutSuccessEventsFromApplicationLog

func PutSuccessEventsFromApplicationLog(log *result.ApplicationLog) ([]*PutSuccessEvent, error)

PutSuccessEventsFromApplicationLog retrieves a set of all emitted events with "PutSuccess" name from the provided result.ApplicationLog.

func (*PutSuccessEvent) FromStackItem

func (e *PutSuccessEvent) FromStackItem(item *stackitem.Array) error

FromStackItem converts provided stackitem.Array to PutSuccessEvent or returns an error if it's not possible to do to so.

type SetEACLSuccessEvent

type SetEACLSuccessEvent struct {
	ContainerID []byte
	PublicKey   *keys.PublicKey
}

SetEACLSuccessEvent represents "SetEACLSuccess" event emitted by the contract.

func SetEACLSuccessEventsFromApplicationLog

func SetEACLSuccessEventsFromApplicationLog(log *result.ApplicationLog) ([]*SetEACLSuccessEvent, error)

SetEACLSuccessEventsFromApplicationLog retrieves a set of all emitted events with "SetEACLSuccess" name from the provided result.ApplicationLog.

func (*SetEACLSuccessEvent) FromStackItem

func (e *SetEACLSuccessEvent) FromStackItem(item *stackitem.Array) error

FromStackItem converts provided stackitem.Array to SetEACLSuccessEvent or returns an error if it's not possible to do to so.

type StartEstimationEvent

type StartEstimationEvent struct {
	Epoch *big.Int
}

StartEstimationEvent represents "StartEstimation" event emitted by the contract.

func StartEstimationEventsFromApplicationLog

func StartEstimationEventsFromApplicationLog(log *result.ApplicationLog) ([]*StartEstimationEvent, error)

StartEstimationEventsFromApplicationLog retrieves a set of all emitted events with "StartEstimation" name from the provided result.ApplicationLog.

func (*StartEstimationEvent) FromStackItem

func (e *StartEstimationEvent) FromStackItem(item *stackitem.Array) error

FromStackItem converts provided stackitem.Array to StartEstimationEvent or returns an error if it's not possible to do to so.

type StopEstimationEvent

type StopEstimationEvent struct {
	Epoch *big.Int
}

StopEstimationEvent represents "StopEstimation" event emitted by the contract.

func StopEstimationEventsFromApplicationLog

func StopEstimationEventsFromApplicationLog(log *result.ApplicationLog) ([]*StopEstimationEvent, error)

StopEstimationEventsFromApplicationLog retrieves a set of all emitted events with "StopEstimation" name from the provided result.ApplicationLog.

func (*StopEstimationEvent) FromStackItem

func (e *StopEstimationEvent) FromStackItem(item *stackitem.Array) error

FromStackItem converts provided stackitem.Array to StopEstimationEvent or returns an error if it's not possible to do to so.

Jump to

Keyboard shortcuts

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