std

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const REGION_HEAD_SIZE uint32 = 12

Variables

This section is empty.

Functions

func Deallocate

func Deallocate(pointer unsafe.Pointer)

func Package_message

func Package_message(msg []byte) unsafe.Pointer

func SafeAdd added in v0.2.0

func SafeAdd(a, b uint64) (uint64, error)

func SafeDiv added in v0.2.0

func SafeDiv(a, b uint64) (uint64, error)

func SafeMul added in v0.2.0

func SafeMul(a, b uint64) (uint64, error)

func SafeSub added in v0.2.0

func SafeSub(a, b uint64) (uint64, error)

func TranslateToRegion

func TranslateToRegion(b []byte, ptr uintptr) uintptr

func TranslateToSlice

func TranslateToSlice(ptr uintptr) []byte

func Translate_range_custom

func Translate_range_custom(ptr uintptr) []byte

Types

type Api

type Api interface {
	CanonicalAddress(human string) (types.CanonicalAddr, error)
	HumanAddress(canonical types.CanonicalAddr) (string, error)
	ValidateAddress(human string) error
	Debug(msg string)
}

type Deps

type Deps struct {
	Storage Storage
	Api     Api
	Querier Querier
}

=========== Deps --> context =======

type Iterator

type Iterator interface {
	Next() (key, value []byte, err error)
}

type JSONType added in v0.2.0

type JSONType interface {
	MarshalJSON() ([]byte, error)
	UnmarshalJSON([]byte) error
}

type MemRegion

type MemRegion struct {
	Offset   uint32
	Capacity uint32
	Length   uint32
}

func Build_region

func Build_region(size uint32, len uint32) (unsafe.Pointer, *MemRegion)

type Order

type Order uint32
const (
	Ascending  Order = 1
	Descending Order = 2
)

type Querier

type Querier interface {
	RawQuery(request []byte) ([]byte, error)
}

type QuerierWrapper

type QuerierWrapper struct {
	Querier
}

func (QuerierWrapper) QueryAllBalances

func (q QuerierWrapper) QueryAllBalances(addr string) ([]types.Coin, error)

func (QuerierWrapper) QueryBalance

func (q QuerierWrapper) QueryBalance(addr string, denom string) (types.Coin, error)

type ReadonlyStorage

type ReadonlyStorage interface {
	Get(key []byte) (value []byte, err error)
	Range(start, end []byte, order Order) (Iterator, error)
}

type SliceHeader_Go

type SliceHeader_Go struct {
	Data uintptr
	Len  int
	Cap  int
}

type SliceHeader_tinyGo

type SliceHeader_tinyGo struct {
	Data uintptr
	Len  uintptr
	Cap  uintptr
}

type Storage

type Storage interface {
	ReadonlyStorage

	Set(key, value []byte) error
	Remove(key []byte) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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