sample

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 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 AccAddressFromConsAddress added in v0.0.8

func AccAddressFromConsAddress(validatorConsAddr string) string

AccAddressFromConsAddress returns an account address (with the Bech32PrefixForAccount prefix) from a given consensus address (with the Bech32PrefixForValidator 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 the validator consensus address.

TODO_MAINNET: Add E2E tests to validate this works as expected.

func ConsAddress added in v0.0.6

func ConsAddress() string

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 ValAddress added in v0.0.10

func ValAddress() string

ValAddress returns a sample validator address, which has the prefix of validators when converted to bech32. Validator addresses identify the validator operator on-chain account and are derived using secp256k1. 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