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 Secp256k1RecoveryParam
- 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 ¶
func Translate_range_custom ¶
Types ¶
type Api ¶
type Api interface { // CanonicalAddress converts the human-readable address to a canonical representation. CanonicalAddress(human types.HumanAddress) (types.CanonicalAddress, error) // HumanAddress converts the canonical address to a human-readable representation. HumanAddress(canonical types.CanonicalAddress) (types.HumanAddress, error) // ValidateAddress validates the human-readable address performing CanonicalAddress and HumanAddress conversions. ValidateAddress(human types.HumanAddress) error // Debug sends the debug log message to the host which can either process or ignore it. Debug(msg string) // VerifySecp256k1Signature verifies the given message hash against the signature with the public key, using the secp256k1 ECDSA parametrization. // Returns true if the signature is valid, false otherwise. VerifySecp256k1Signature(hash, signature, publicKey []byte) (bool, error) // RecoverSecp256k1PubKey recovers a public key from the message hash agains the signature, using the secp256k1 ECDSA parametrization and recovery param (0/1). RecoverSecp256k1PubKey(hash, signature []byte, recoveryParam Secp256k1RecoveryParam) ([]byte, error) // VerifyEd25519Signature verifies the given message against the signature with the public key, using the ed25519 parametrization. // Returns true if the signature is valid, false otherwise. VerifyEd25519Signature(message, signature, publicKey []byte) (bool, error) // VerifyEd25519Signatures verifies given messages against signatures with the public keys, using the ed25519 parametrization. // Returns true if all signature are valid, false otherwise. VerifyEd25519Signatures(messages, signatures, publicKeys [][]byte) (bool, error) }
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 MemRegion ¶
func BuildSectionsRegion ¶
BuildSectionsRegion creates a new MemRegion with sections. Section format: data [uint8...] | size [uint32, big endian]
type QuerierWrapper ¶
type QuerierWrapper struct {
Querier
}
func (QuerierWrapper) Query ¶
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 ¶
func (q QuerierWrapper) QueryContractInfo(addr string) (*types.ContractInfo, error)
func (QuerierWrapper) QueryRaw ¶
func (q QuerierWrapper) QueryRaw(addr string, key []byte, resp JSONType) error
func (QuerierWrapper) QuerySmart ¶
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 Secp256k1RecoveryParam ¶
type Secp256k1RecoveryParam uint8
Secp256k1RecoveryParam is used by the RecoverSecp256k1PubKey and indicates whether or not the y-coordinate of the original VerifyingKey is odd.
const ( Secp256k1RecoveryParamYCoordIsOdd Secp256k1RecoveryParam = 0 Secp256k1RecoveryParamYCoordNotOdd Secp256k1RecoveryParam = 1 )
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.