Documentation ¶
Index ¶
- func AccAddressFromBech32(address, prefix string) (sdk.AccAddress, error)
- func AddressFromBech32(address, prefix string) (addr []byte, err error)
- func EncodeAddressToBech32(prefix string, address sdk.Address) (string, error)
- func GenerateAccAddressForTest() sdk.AccAddress
- func GenerateAddressForTestWithPrefix(prefix string) string
- func GenerateValAddressForTest() sdk.ValAddress
- func MustAccAddressFromBech32(address, prefix string) sdk.AccAddress
- func MustEncodeAddressToBech32(prefix string, address sdk.Address) string
- func MustValAddressFromBech32(address, prefix string) sdk.ValAddress
- func ValAddressFromBech32(address, prefix string) (sdk.ValAddress, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccAddressFromBech32 ¶
func AccAddressFromBech32(address, prefix string) (sdk.AccAddress, error)
AccAddressFromBech32 decodes a bech32 encoded address into an sdk.AccAddress, and validates the prefix (hrp). An empty prefix param skips the checking. Returns an error if address is zero-length, invalid or the prefix does not match.
func AddressFromBech32 ¶
AddressFromBech32 decodes a bech32 encoded address into a byte-slice, and validates the prefix (hrp). An empty prefix param skips the checking. Returns an error if address is zero-length, invalid or the prefix does not match.
func EncodeAddressToBech32 ¶
EncodeAddressToBech32 encodes an sdk.Address interface with the specified prefix. Identical behaviour to bech32.ConvertAndDecode(); added to addressutils for consistency. Error is thrown if encoding fails.
func GenerateAccAddressForTest ¶
func GenerateAccAddressForTest() sdk.AccAddress
GenerateAccAddressForTest generates a random sdk.AccAddress for test purposes.
func GenerateAddressForTestWithPrefix ¶
GenerateAddressForTestWithPrefix generates a random bech32 address with the specified prefix for test purposes.
func GenerateValAddressForTest ¶
func GenerateValAddressForTest() sdk.ValAddress
GenerateValAddressForTest generates a random sdk.ValAddress for test purposes.
func MustAccAddressFromBech32 ¶
func MustAccAddressFromBech32(address, prefix string) sdk.AccAddress
MustAccAddressFromBech32 decodes a bech32 encoded address into an sdk.AccAddress, and validates the prefix (hrp). An empty prefix param skips the checking. Panics if address is zero-length, invalid or the prefix does not match.
func MustEncodeAddressToBech32 ¶
EncodeAddressToBech32 encodes an sdk.Address interface with the specified prefix. Identical behaviour to bech32.ConvertAndDecode(); added to addressutils for consistency. Panics if encoding fails.
func MustValAddressFromBech32 ¶
func MustValAddressFromBech32(address, prefix string) sdk.ValAddress
MustValAddressFromBech32 decodes a bech32 encoded address into an sdk.ValAddress, and validates the prefix (hrp). An empty prefix param skips the checking. Panics if address is zero-length, invalid or the prefix does not match.
func ValAddressFromBech32 ¶
func ValAddressFromBech32(address, prefix string) (sdk.ValAddress, error)
ValAddressFromBech32 decodes a bech32 encoded address into an sdk.ValAddress, and validates the prefix (hrp). An empty prefix param skips the checking. Returns an error if address is zero-length, invalid or the prefix does not match.
Types ¶
This section is empty.