types

package
v0.0.0-...-ed80a23 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// default bond denomination
	DefaultBondDenom = DefaultDenom

	// Delay, in blocks, between when validator updates are returned to the
	// consensus-engine and when they are applied. For example, if
	// ValidatorUpdateDelay is set to X, and if a validator set update is
	// returned with new validators at the end of block 10, then the new
	// validators are expected to sign blocks beginning at block 11+X.
	//
	// This value is constant as this should not change without a hard fork.
	// For Tendermint this should be set to 1 block, for more details see:
	// https://tendermint.com/docs/spec/abci/apps.html#endblock
	ValidatorUpdateDelay int64 = 1
)

staking constants

View Source
const (
	Unbonded  BondStatus = 0x00
	Unbonding BondStatus = 0x01
	Bonded    BondStatus = 0x02

	BondStatusUnbonded  = "Unbonded"
	BondStatusUnbonding = "Unbonding"
	BondStatusBonded    = "Bonded"
)

staking constants

View Source
const (
	OneCoin          = 1000000 //1BCC = 1000000ubcc
	Coin             = "BCC"
	DefaultDenom     = "ubcc"
	DaysPerYear      = 360
	DaysPerQuarter   = 90
	BlockTime        = 10 //seconds
	BlocksPerHour    = 3600 / BlockTime
	BlocksPerDay     = (3600 / BlockTime) * 24
	BlocksPerQuarter = BlocksPerDay * DaysPerQuarter
	BlocksPerYear    = BlocksPerDay * DaysPerYear

	DefaultMintStartValue  = 4 * OneCoin         //minting 4 BCC per block
	DefaultMaxEmission     = 100000000 * OneCoin //100 000 000 BCC
	DefaultMintingInterval = 100                 //Add coins to fee pool every 100 block to decrease blockchain fast growing

	DefaultMaxGas      = -1
	DefaultMinGasPrice = "0.25ubcc"

	DefaultMinValidatorSelfDelegation = 4000000 * OneCoin //minimum tokens to be a validator
	DefaultValidatorDelegateEnabled   = false

	// AddrLen defines a valid address length
	AddrLen = 20
	// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
	Bech32MainPrefix = "boco"

	// Boco in https://github.com/satoshilabs/slips/blob/master/slip-0044.md
	CoinType = 3020 //0x80000BCC

	// BIP44Prefix is the parts of the BIP44 HD path that are fixed by
	// what we used during the fundraiser.
	FullFundraiserPath = "44'/3020'/0'/0/0"

	// PrefixAccount is the prefix for account keys
	PrefixAccount = "acc"
	// PrefixValidator is the prefix for validator keys
	PrefixValidator = "val"
	// PrefixConsensus is the prefix for consensus keys
	PrefixConsensus = "cons"
	// PrefixPublic is the prefix for public keys
	PrefixPublic = "pub"
	// PrefixOperator is the prefix for operator keys
	PrefixOperator = "oper"

	// PrefixAddress is the prefix for addresses
	PrefixAddress = "addr"

	// 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 + PrefixPublic
	// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address
	Bech32PrefixValAddr = Bech32MainPrefix + PrefixValidator + PrefixOperator
	// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key
	Bech32PrefixValPub = Bech32MainPrefix + PrefixValidator + PrefixOperator + PrefixPublic
	// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address
	Bech32PrefixConsAddr = Bech32MainPrefix + PrefixValidator + PrefixConsensus
	// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key
	Bech32PrefixConsPub = Bech32MainPrefix + PrefixValidator + PrefixConsensus + PrefixPublic
)

Variables

View Source
var PowerReduction = sdk.NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(6), nil))

PowerReduction is the amount of staking tokens required for 1 unit of consensus-engine power

Functions

func TokensFromConsensusPower

func TokensFromConsensusPower(power int64) sdk.Int

TokensFromConsensusPower - convert input power to tokens

func TokensToConsensusPower

func TokensToConsensusPower(tokens sdk.Int) int64

TokensToConsensusPower - convert input tokens to potential consensus-engine power

Types

type BondStatus

type BondStatus byte

BondStatus is the status of a validator

func (BondStatus) Equal

func (b BondStatus) Equal(b2 BondStatus) bool

Equal compares two BondStatus instances

func (BondStatus) String

func (b BondStatus) String() string

String implements the Stringer interface for BondStatus.

Directories

Path Synopsis
Package errors implements custom error interfaces for cosmos-sdk.
Package errors implements custom error interfaces for cosmos-sdk.
Package module contains application module patterns and associated "manager" functionality.
Package module contains application module patterns and associated "manager" functionality.
Package rest provides HTTP types and primitives for REST requests validation and responses handling.
Package rest provides HTTP types and primitives for REST requests validation and responses handling.

Jump to

Keyboard shortcuts

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