common

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: GPL-3.0 Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	QuotaCoinName = "quota"
	TokenDec      = 1000000000000000000

	Bech32MainPrefix = "sgn"

	// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
	Bech32PrefixAccAddr = Bech32MainPrefix
	// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key
	Bech32PrefixAccPub = Bech32MainPrefix + sdk.PrefixPublic
	// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address
	Bech32PrefixValAddr = Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixOperator
	// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key
	Bech32PrefixValPub = Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic
	// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address
	Bech32PrefixConsAddr = Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixConsensus
	// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key
	Bech32PrefixConsPub = Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic
)
View Source
const (
	FlagConfig  = "config"
	FlagCLIHome = "cli-home"

	FlagStartMonitor = "startMonitor"

	FlagEthGateway         = "eth.gateway"
	FlagEthCelrAddress     = "eth.contracts.celr_address"
	FlagEthDPoSAddress     = "eth.contracts.dpos_address"
	FlagEthSGNAddress      = "eth.contracts.sgn_address"
	FlagEthLedgerAddress   = "eth.contracts.ledger_address"
	FlagEthKeystore        = "eth.keystore"
	FlagEthPassphrase      = "eth.passphrase"
	FlagEthPollInterval    = "eth.poll_interval"
	FlagEthBlockDelay      = "eth.block_delay"
	FlagEthChainID         = "eth.chain_id"
	FlagEthCheckInterval   = "eth.check_interval"
	FlagEthMinGasPriceGwei = "eth.min_gas_price_gwei"
	FlagEthAddGasPriceGwei = "eth.add_gas_price_gwei"

	FlagSgnValidatorAccount = "sgn.validator_account"
	FlagSgnTransactors      = "sgn.transactors"
	FlagSgnPassphrase       = "sgn.passphrase"
	FlagSgnPubKey           = "sgn.pubkey"
	FlagSgnChainID          = "sgn.chain_id"
	FlagSgnNodeURI          = "sgn.node_uri"
	FlagSgnBaseGasPrice     = "sgn.base_gas_price"
	FlagSgnTimeoutCommit    = "sgn.timeout_commit"
	FlagSgnKeyringBackend   = "sgn.keyring_backend"
	FlagSgnExecuteSlash     = "sgn.execute_slash"

	FlagLogLevel = "log.level"
	FlagLogColor = "log.color"
)

Variables

View Source
var (
	ErrRecordNotFound = errors.New("record not found")
)

err constants for various errors

Functions

func GetCommands added in v0.2.3

func GetCommands(cmds ...*cobra.Command) []*cobra.Command

func NewCommission added in v0.2.0

func NewCommission(ethClient *mainchain.EthClient, commissionRate *big.Int) (staking.Commission, error)

func NewEthClientFromConfig added in v0.2.3

func NewEthClientFromConfig() (*mainchain.EthClient, error)

func NewQueryCLIContext added in v0.2.3

func NewQueryCLIContext(cdc *codec.Codec) context.CLIContext

func ParseTransactorAddrs added in v0.2.3

func ParseTransactorAddrs(ts []string) ([]sdk.AccAddress, error)

func PostCommands added in v0.2.3

func PostCommands(cmds ...*cobra.Command) []*cobra.Command

func RobustQuery added in v0.2.0

func RobustQuery(cliCtx context.CLIContext, route string) ([]byte, error)

func RobustQueryWithData added in v0.2.0

func RobustQueryWithData(cliCtx context.CLIContext, route string, data []byte) ([]byte, error)

func SetupUserPassword added in v0.2.3

func SetupUserPassword() error

func UnmarshalSignedSimplexStateBytes added in v0.2.0

func UnmarshalSignedSimplexStateBytes(input []byte) (*chain.SignedSimplexState, *entity.SimplexPaymentChannel, error)

Types

type ParamChange added in v0.2.0

type ParamChange struct {
	Record   sdk.Int `json:"record"`
	NewValue sdk.Int `json:"new_value"`
}

func NewParamChange added in v0.2.0

func NewParamChange(record, newValue sdk.Int) ParamChange

func (ParamChange) String added in v0.2.0

func (p ParamChange) String() string

implement fmt.Stringer

type Sig

type Sig struct {
	Signer string `json:"signer"`
	Sig    []byte `json:"sig"`
}

func AddSig

func AddSig(sigs []Sig, msg []byte, sig []byte, expectedSigner string) ([]Sig, error)

func NewSig

func NewSig(signer string, sig []byte) Sig

func (Sig) String

func (r Sig) String() string

implement fmt.Stringer

Jump to

Keyboard shortcuts

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