sample

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccAddress

func AccAddress() string

AccAddress returns a sample account address

func AccAddressAndPubKey

func AccAddressAndPubKey() (string, cryptotypes.PubKey)

AccAddressAndPubKey returns a sample account address and public key

func AccAddressAndPubKeyEd25519 added in v0.0.8

func AccAddressAndPubKeyEd25519() (string, cryptotypes.PubKey)

AccAddressAndPubKeyEd25519 returns a sample account address and public key

func AccAddressFromConsBech32 added in v0.0.11

func AccAddressFromConsBech32(consBech32 string) string

AccAddressFromConsBech32 returns an account address (with the Bech32PrefixForAccount prefix) from a given consensus address (with the Bech32PrefixForConsensus prefix).

Reference: see initSDKConfig in `cmd/poktrolld/cmd`.

Use case: in the native cosmos SDK mint module, we set inflation_rate_change to 0 because Pocket Network has a custom inflation mechanism. Data availability and block validation is a small part of the network's utility, so the majority of inflation comes from the relays serviced. Therefore, the validator's (block producer's) rewards are proportional to that as well. For this reason, we need a helper function to identify the proposer address from its validator consensus address (ed255519).

func ConsAddress added in v0.0.6

func ConsAddress() cosmostypes.ConsAddress

ConsAddress returns a sample consensus node address, which has the prefix of consensus nodes when converted to bech32. Consensus addresses identify the validator node in the consensus engine and are derived using ed25519. See: https://docs.cosmos.network/main/learn/beginner/accounts#addresses

func ConsAddressBech32 added in v0.0.11

func ConsAddressBech32() string

ConsAddressBech32 returns a bech32-encoded sample consensus node address, which has the prefix of consensus nodes when converted to bech32. Consensus addresses identify the validator node in the consensus engine and are derived using ed25519. See: https://docs.cosmos.network/main/learn/beginner/accounts#addresses

Types

This section is empty.

Jump to

Keyboard shortcuts

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