utils

package
v0.26.18 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressSliceToCadenceValue added in v0.17.1

func AddressSliceToCadenceValue(addresses []common.Address) cadence.Value

func CadenceValueToAddressSlice added in v0.25.0

func CadenceValueToAddressSlice(value cadence.Value) (addresses []common.Address, ok bool)

func CadenceValueToWeights added in v0.25.2

func CadenceValueToWeights(value cadence.Value) (map[uint]uint64, bool)

CadenceValueToWeights converts a cadence value to a map of weights used for metering

func FlowAddressSliceToCadenceAddressSlice added in v0.17.1

func FlowAddressSliceToCadenceAddressSlice(addresses []flow.Address) []common.Address

Types

type MapLedger

type MapLedger struct {
	Registers       map[string]flow.RegisterEntry
	RegisterTouches map[string]bool
	RegisterUpdated map[string]bool
}

A MapLedger is a naive ledger storage implementation backed by a simple map.

This implementation is designed for testing purposes.

func NewMapLedger

func NewMapLedger() *MapLedger

NewMapLedger returns an instance of map ledger (should only be used for testing)

func (*MapLedger) Delete

func (m *MapLedger) Delete(owner, controller, key string) error

func (*MapLedger) Get

func (m *MapLedger) Get(owner, controller, key string) (flow.RegisterValue, error)

func (*MapLedger) Set

func (m *MapLedger) Set(owner, controller, key string, value flow.RegisterValue) error

func (*MapLedger) Touch

func (m *MapLedger) Touch(owner, controller, key string) error

type SimpleView

type SimpleView struct {
	Parent *SimpleView
	Ledger *MapLedger
}

SimpleView provides a simple view for testing purposes.

func NewSimpleView

func NewSimpleView() *SimpleView

func (*SimpleView) AllRegisters added in v0.16.0

func (v *SimpleView) AllRegisters() []flow.RegisterID

returns all the registers that has been touched

func (*SimpleView) Delete

func (v *SimpleView) Delete(owner, controller, key string) error

func (*SimpleView) DropDelta

func (v *SimpleView) DropDelta()

func (*SimpleView) Get

func (v *SimpleView) Get(owner, controller, key string) (flow.RegisterValue, error)

func (*SimpleView) MergeView

func (v *SimpleView) MergeView(o state.View) error

func (*SimpleView) NewChild

func (v *SimpleView) NewChild() state.View

func (*SimpleView) RegisterUpdates added in v0.16.0

func (v *SimpleView) RegisterUpdates() ([]flow.RegisterID, []flow.RegisterValue)

func (*SimpleView) Set

func (v *SimpleView) Set(owner, controller, key string, value flow.RegisterValue) error

func (*SimpleView) Touch

func (v *SimpleView) Touch(owner, controller, key string) error

Jump to

Keyboard shortcuts

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