cosmosutil

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ChainConfigDir = "config"
)
View Source
const GentxFilename = "gentx.json"

Variables

This section is empty.

Functions

func ChangeAddressPrefix

func ChangeAddressPrefix(address, newPrefix string) (string, error)

ChangeAddressPrefix returns the address with another prefix

func GetAddressPrefix

func GetAddressPrefix(address string) (string, error)

GetAddressPrefix returns the bech 32 prefix used by the address

func VerifyPeerFormat

func VerifyPeerFormat(peer launchtypes.Peer) bool

VerifyPeerFormat checks if the peer address format is valid

Types

type GentxInfo

type GentxInfo struct {
	DelegatorAddress string
	PubKey           ed25519.PubKey
	SelfDelegation   sdk.Coin
	Memo             string
}

GentxInfo represents the basic info about gentx file

func GentxFromPath

func GentxFromPath(path string) (info GentxInfo, gentx []byte, err error)

GentxFromPath returns GentxInfo from the json file

func ParseGentx

func ParseGentx(gentx []byte) (info GentxInfo, file []byte, err error)

ParseGentx returns GentxInfo and the gentx file in bytes TODO refector. no need to return file, it's already given as gentx in the argument.

type StargateGentx

type StargateGentx struct {
	Body struct {
		Messages []struct {
			DelegatorAddress string `json:"delegator_address"`
			ValidatorAddress string `json:"validator_address"`
			PubKey           struct {
				Type string `json:"@type"`
				Key  string `json:"key"`
			} `json:"pubkey"`
			Value struct {
				Denom  string `json:"denom"`
				Amount string `json:"amount"`
			} `json:"value"`
		} `json:"messages"`
		Memo string `json:"memo"`
	} `json:"body"`
}

StargateGentx represents the stargate gentx file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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