handler

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetServiceEventWhitelist added in v0.17.1

func GetServiceEventWhitelist() []string

func IsServiceEvent added in v0.17.1

func IsServiceEvent(event cadence.Event, chain flow.Chain) bool

Types

type AuthorizedAccountsForContractDeploymentFunc added in v0.17.1

type AuthorizedAccountsForContractDeploymentFunc func() []common.Address

type ContractHandler

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

ContractHandler handles all interaction with smart contracts such as get/set/update it also captures all changes as deltas and only commit them when called so smart contract updates can be delayed until end of the tx execution

func NewContractHandler

func NewContractHandler(accounts *state.Accounts,
	restrictedDeploymentEnabled bool,
	authorizedAccounts AuthorizedAccountsForContractDeploymentFunc) *ContractHandler

func (*ContractHandler) Commit

func (*ContractHandler) GetContract

func (h *ContractHandler) GetContract(address runtime.Address, name string) (code []byte, err error)

func (*ContractHandler) GetContractNames

func (h *ContractHandler) GetContractNames(address runtime.Address) (names []string, err error)

func (*ContractHandler) HasUpdates

func (h *ContractHandler) HasUpdates() bool

func (*ContractHandler) RemoveContract

func (h *ContractHandler) RemoveContract(address runtime.Address, name string, signingAccounts []runtime.Address) (err error)

func (*ContractHandler) Rollback

func (h *ContractHandler) Rollback() error

func (*ContractHandler) SetContract

func (h *ContractHandler) SetContract(address runtime.Address, name string, code []byte, signingAccounts []runtime.Address) (err error)

func (*ContractHandler) UpdateKeys

func (h *ContractHandler) UpdateKeys() []programs.ContractUpdateKey

type EventCollection added in v0.17.1

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

func NewEventCollection added in v0.17.1

func NewEventCollection() *EventCollection

func (*EventCollection) AppendEvent added in v0.17.1

func (e *EventCollection) AppendEvent(event flow.Event, size uint64)

func (*EventCollection) AppendServiceEvent added in v0.17.1

func (e *EventCollection) AppendServiceEvent(event flow.Event, size uint64)

func (*EventCollection) Child added in v0.17.1

func (e *EventCollection) Child() *EventCollection

func (*EventCollection) Events added in v0.17.1

func (e *EventCollection) Events() []flow.Event

func (*EventCollection) Merge added in v0.17.1

func (e *EventCollection) Merge(other *EventCollection)

Merge merges another event collection into this event collection

func (*EventCollection) ServiceEvents added in v0.17.1

func (e *EventCollection) ServiceEvents() []flow.Event

func (*EventCollection) TotalByteSize added in v0.17.1

func (e *EventCollection) TotalByteSize() uint64

type EventHandler added in v0.17.1

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

EventHandler collect events, separates out service events, and enforces event size limits

func NewEventHandler added in v0.17.1

func NewEventHandler(chain flow.Chain,
	eventCollectionEnabled bool,
	serviceEventCollectionEnabled bool,
	eventCollectionByteSizeLimit uint64) *EventHandler

NewEventHandler constructs a new EventHandler

func (*EventHandler) EmitEvent added in v0.17.1

func (h *EventHandler) EmitEvent(event cadence.Event,
	txID flow.Identifier,
	txIndex uint32,
	payer flow.Address) error

func (*EventHandler) EventCollection added in v0.17.1

func (h *EventHandler) EventCollection() *EventCollection

func (*EventHandler) Events added in v0.17.1

func (h *EventHandler) Events() []flow.Event

func (*EventHandler) ServiceEvents added in v0.17.1

func (h *EventHandler) ServiceEvents() []flow.Event

type ProgramsHandler added in v0.15.0

type ProgramsHandler struct {
	Programs *programs.Programs
	// contains filtered or unexported fields
}

ProgramsHandler manages operations using Programs storage. It's separation of concern for hostEnv Cadence contract guarantees that Get/Set methods will be called in a LIFO manner, so we use stack based approach here. During successful execution stack should be cleared naturally, making cleanup method essentially no-op. But if something goes wrong, all nested views must be merged in order to make sure they are recorded

func NewProgramsHandler added in v0.15.0

func NewProgramsHandler(programs *programs.Programs, stateHolder *state.StateHolder) *ProgramsHandler

func (*ProgramsHandler) Cleanup added in v0.15.0

func (h *ProgramsHandler) Cleanup() error

func (*ProgramsHandler) Get added in v0.15.0

func (h *ProgramsHandler) Get(location common.Location) (*interpreter.Program, bool)

func (*ProgramsHandler) Set added in v0.15.0

func (h *ProgramsHandler) Set(location common.Location, program *interpreter.Program) error

Jump to

Keyboard shortcuts

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