blob

package
v1.0.2-legacy-migration Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// variable names of standard blob's field
	// user-defined field must be different
	VarFieldProgramBinary      = "p"
	VarFieldVMType             = "v"
	VarFieldProgramDescription = "d"
)

state variables

View Source
const (
	ParamHash  = "hash"
	ParamField = "field"
	ParamBytes = "bytes"
)

request parameters

View Source
const DirectoryPrefix = "d"

Variables

View Source
var (
	FuncStoreBlob = coreutil.Func("storeBlob")

	ViewGetBlobInfo  = coreutil.ViewFunc("getBlobInfo")
	ViewGetBlobField = coreutil.ViewFunc("getBlobField")
	ViewListBlobs    = coreutil.ViewFunc("listBlobs")
)
View Source
var Processor = Contract.Processor(nil,
	FuncStoreBlob.WithHandler(storeBlob),
	ViewGetBlobField.WithHandler(getBlobField),
	ViewGetBlobInfo.WithHandler(getBlobInfo),
	ViewListBlobs.WithHandler(listBlobs),
)

Functions

func DecodeDirectory

func DecodeDirectory(blobs dict.Dict) (map[hashing.HashValue]uint32, error)

func DecodeSize

func DecodeSize(size []byte) (uint32, error)

func DecodeSizesMap

func DecodeSizesMap(sizes dict.Dict) (map[string]uint32, error)

func EncodeSize

func EncodeSize(size uint32) []byte

func FieldValueKey added in v0.3.0

func FieldValueKey(blobHash hashing.HashValue, fieldName string) []byte

FieldValueKey returns key of the blob field value in the SC state.

func GetBlobSizes

func GetBlobSizes(state kv.KVStore, blobHash hashing.HashValue) *collections.Map

GetBlobSizes retrieves the writeable blob field-size map from the state

func GetBlobSizesR

func GetBlobSizesR(state kv.KVStoreReader, blobHash hashing.HashValue) *collections.ImmutableMap

GetBlobSizesR retrieves the blob field-size map from the read-only state

func GetBlobValues

func GetBlobValues(state kv.KVStore, blobHash hashing.HashValue) *collections.Map

GetBlobValues retrieves the blob field-value map from the state

func GetBlobValuesR

func GetBlobValuesR(state kv.KVStoreReader, blobHash hashing.HashValue) *collections.ImmutableMap

GetBlobValuesR retrieves the blob field-value map from the read-only state

func GetDirectory

func GetDirectory(state kv.KVStore) *collections.Map

GetDirectory retrieves the blob directory from the state

func GetDirectoryR

func GetDirectoryR(state kv.KVStoreReader) *collections.ImmutableMap

GetDirectoryR retrieves the blob directory from the read-only state

func LocateProgram

func LocateProgram(state kv.KVStoreReader, programHash hashing.HashValue) (string, []byte, error)

func MustGetBlobHash

func MustGetBlobHash(fields dict.Dict) hashing.HashValue

MustGetBlobHash deterministically hashes map of binary values

func SetInitialState added in v1.0.3

func SetInitialState(state kv.KVStore)

Types

This section is empty.

Jump to

Keyboard shortcuts

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