Documentation ¶
Index ¶
- Constants
- func Compose(typ string, subAddresses []Addressable) ([]byte, error)
- func Derive(address []byte, key []byte) []byte
- func Hash(typ string, key []byte) []byte
- func LengthPrefix(bz []byte) ([]byte, error)
- func Module(moduleName string, key []byte) []byte
- func MustLengthPrefix(bz []byte) []byte
- type Addressable
Constants ¶
View Source
const Len = sha256.Size
Len is the length of base addresses
View Source
const MaxAddrLen = 255
MaxAddrLen is the maximum allowed length (in bytes) for an address.
Variables ¶
This section is empty.
Functions ¶
func Compose ¶ added in v0.46.0
func Compose(typ string, subAddresses []Addressable) ([]byte, error)
Compose creates a new address based on sub addresses.
func Derive ¶ added in v0.46.0
Derive derives a new address from the main `address` and a derivation `key`.
func LengthPrefix ¶
LengthPrefix prefixes the address bytes with its length, this is used for example for variable-length components in store keys.
func Module ¶ added in v0.46.0
Module is a specialized version of a composed address for modules. Each module account is constructed from a module name and module account key.
func MustLengthPrefix ¶
MustLengthPrefix is LengthPrefix with panic on error.
Types ¶
type Addressable ¶ added in v0.46.0
type Addressable interface {
Address() []byte
}
Addressable represents any type from which we can derive an address.
Click to show internal directories.
Click to hide internal directories.