Documentation
¶
Index ¶
- Constants
- Variables
- func Deallocate(pointer unsafe.Pointer)
- func Package_message(msg []byte) unsafe.Pointer
- func TranslateToRegion(b []byte, ptr uintptr) uintptr
- func TranslateToSlice(ptr uintptr) []byte
- func TranslateToString(ptr uintptr) string
- func Translate_range_custom(ptr uintptr) []byte
- type Api
- type Deps
- type Iterator
- type JSONType
- type MemRegion
- type Order
- type Querier
- type QuerierWrapper
- func (q QuerierWrapper) Query(query types.ToQuery, result JSONType) error
- func (q QuerierWrapper) QueryAllBalances(addr string) ([]types.Coin, error)
- func (q QuerierWrapper) QueryBalance(addr string, denom string) (types.Coin, error)
- func (q QuerierWrapper) QueryContractInfo(addr string) (*types.ContractInfo, error)
- func (q QuerierWrapper) QueryRaw(addr string, key []byte, resp JSONType) error
- func (q QuerierWrapper) QuerySmart(addr string, msg JSONType, resp JSONType) error
- type ReadonlyStorage
- type SliceHeader_Go
- type SliceHeader_tinyGo
- type Storage
Constants ¶
View Source
const REGION_HEAD_SIZE uint32 = 12
Variables ¶
View Source
var ErrIteratorDone = errors.New("iterator is done")
This is a special, placeholder to signal iteration is finished
Functions ¶
func Deallocate ¶
func Package_message ¶
func TranslateToRegion ¶
func TranslateToSlice ¶
func TranslateToString ¶ added in v0.3.0
func Translate_range_custom ¶
Types ¶
type Api ¶
type Api interface {
CanonicalAddress(human types.HumanAddress) (types.CanonicalAddress, error)
HumanAddress(canonical types.CanonicalAddress) (types.HumanAddress, error)
ValidateAddress(human types.HumanAddress) error
Debug(msg string)
}
type Deps ¶
type Deps struct {
// Storage provides access to the data persistence layer at write and read level.
Storage Storage
// Api provides access to common utilities such as address
// parsing and verification.
Api Api
// Querier is used to query information from other contracts.
Querier Querier
}
Deps contains the dependencies passed to a contract's mutating entrypoints.
type QuerierWrapper ¶
type QuerierWrapper struct {
Querier
}
func (QuerierWrapper) Query ¶ added in v0.4.0
func (q QuerierWrapper) Query(query types.ToQuery, result JSONType) error
func (QuerierWrapper) QueryAllBalances ¶
func (q QuerierWrapper) QueryAllBalances(addr string) ([]types.Coin, error)
func (QuerierWrapper) QueryBalance ¶
func (QuerierWrapper) QueryContractInfo ¶ added in v0.4.0
func (q QuerierWrapper) QueryContractInfo(addr string) (*types.ContractInfo, error)
func (QuerierWrapper) QueryRaw ¶ added in v0.4.0
func (q QuerierWrapper) QueryRaw(addr string, key []byte, resp JSONType) error
func (QuerierWrapper) QuerySmart ¶ added in v0.4.0
func (q QuerierWrapper) QuerySmart(addr string, msg JSONType, resp JSONType) error
type ReadonlyStorage ¶
type ReadonlyStorage interface {
// Get gets the value of the provided key. If value is nil then the key does not exist.
Get(key []byte) (value []byte)
// Range ranges from start to end byte prefixes with the provided Order flag.
Range(start, end []byte, order Order) (iterator Iterator)
}
ReadonlyStorage defines the behaviour of a KV with only read capabilities.
type SliceHeader_Go ¶
type SliceHeader_tinyGo ¶
type Storage ¶
type Storage interface {
ReadonlyStorage
// Set sets the key and value.
Set(key, value []byte)
// Remove removes the value from the db.
Remove(key []byte)
}
Storage defines the behaviour of a KV with read and write capabilities.
Click to show internal directories.
Click to hide internal directories.