blob

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0, BSD-2-Clause Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// request parameters
	ParamHash  = "hash"
	ParamField = "field"
	ParamBytes = "bytes"

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

	// function names
	FuncGetBlobInfo  = "getBlobInfo"
	FuncGetBlobField = "getBlobField"
	FuncStoreBlob    = "storeBlob"
	FuncListBlobs    = "listBlobs"
)
View Source
const (
	Name = "blob"
)

Variables

View Source
var (
	Interface = &coreutil.ContractInterface{
		Name:        Name,
		Description: description,
		ProgramHash: hashing.HashStrings(Name),
	}
)

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 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

Types

This section is empty.

Jump to

Keyboard shortcuts

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