types

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: Apache-2.0 Imports: 16 Imported by: 31

Documentation

Index

Constants

View Source
const BTCHeaderHashLen = 32
View Source
const BTCHeaderLen = 80

Variables

This section is empty.

Functions

func GetBaseBTCHeaderHeight

func GetBaseBTCHeaderHeight() uint64

func GetBaseBTCHeaderHex

func GetBaseBTCHeaderHex() string

func GetMaxDifficulty

func GetMaxDifficulty() big.Int

func ParseKeyNameFromConfig

func ParseKeyNameFromConfig(opts servertypes.AppOptions) string

func Reverse

func Reverse(s interface{})

func ValidateBTCHeader

func ValidateBTCHeader(header *wire.BlockHeader, powLimit *big.Int) error

ValidateBTCHeader Perform the checks that [checkBlockHeaderSanity](https://github.com/btcsuite/btcd/blob/master/blockchain/validate.go#L430) of btcd does

We skip the "timestamp should not be 2 hours into the future" check since this might introduce undeterministic behavior

Types

type BTCHeaderBytes

type BTCHeaderBytes []byte

func GetBaseBTCHeaderBytes

func GetBaseBTCHeaderBytes() BTCHeaderBytes

func NewBTCHeaderBytesFromBlockHeader

func NewBTCHeaderBytesFromBlockHeader(header *wire.BlockHeader) BTCHeaderBytes

func NewBTCHeaderBytesFromBytes

func NewBTCHeaderBytesFromBytes(header []byte) (BTCHeaderBytes, error)

func NewBTCHeaderBytesFromHex

func NewBTCHeaderBytesFromHex(hex string) (BTCHeaderBytes, error)

func (*BTCHeaderBytes) Bits

func (m *BTCHeaderBytes) Bits() uint32

func (*BTCHeaderBytes) Difficulty

func (m *BTCHeaderBytes) Difficulty() *big.Int

func (*BTCHeaderBytes) Eq

func (m *BTCHeaderBytes) Eq(other *BTCHeaderBytes) bool

func (*BTCHeaderBytes) FromBlockHeader

func (m *BTCHeaderBytes) FromBlockHeader(header *wire.BlockHeader)

func (*BTCHeaderBytes) HasParent

func (m *BTCHeaderBytes) HasParent(header *BTCHeaderBytes) bool

func (*BTCHeaderBytes) Hash

func (BTCHeaderBytes) Marshal

func (m BTCHeaderBytes) Marshal() ([]byte, error)

func (BTCHeaderBytes) MarshalHex

func (m BTCHeaderBytes) MarshalHex() string

func (BTCHeaderBytes) MarshalJSON

func (m BTCHeaderBytes) MarshalJSON() ([]byte, error)

func (BTCHeaderBytes) MarshalTo

func (m BTCHeaderBytes) MarshalTo(data []byte) (int, error)

func (BTCHeaderBytes) MustMarshal

func (m BTCHeaderBytes) MustMarshal() []byte

func (*BTCHeaderBytes) ParentHash

func (m *BTCHeaderBytes) ParentHash() *BTCHeaderHashBytes

func (*BTCHeaderBytes) Size

func (m *BTCHeaderBytes) Size() int

func (*BTCHeaderBytes) Time

func (m *BTCHeaderBytes) Time() time.Time

func (BTCHeaderBytes) ToBlockHeader

func (m BTCHeaderBytes) ToBlockHeader() *wire.BlockHeader

func (*BTCHeaderBytes) Unmarshal

func (m *BTCHeaderBytes) Unmarshal(data []byte) error

func (*BTCHeaderBytes) UnmarshalHex

func (m *BTCHeaderBytes) UnmarshalHex(header string) error

func (*BTCHeaderBytes) UnmarshalJSON

func (m *BTCHeaderBytes) UnmarshalJSON(bz []byte) error

type BTCHeaderHashBytes

type BTCHeaderHashBytes []byte

func NewBTCHeaderHashBytesFromBytes

func NewBTCHeaderHashBytesFromBytes(hash []byte) (BTCHeaderHashBytes, error)

func NewBTCHeaderHashBytesFromChainhash

func NewBTCHeaderHashBytesFromChainhash(chHash *chainhash.Hash) BTCHeaderHashBytes

func NewBTCHeaderHashBytesFromHex

func NewBTCHeaderHashBytesFromHex(hex string) (BTCHeaderHashBytes, error)

func (*BTCHeaderHashBytes) Eq

func (*BTCHeaderHashBytes) FromChainhash

func (m *BTCHeaderHashBytes) FromChainhash(hash *chainhash.Hash)

func (BTCHeaderHashBytes) Marshal

func (m BTCHeaderHashBytes) Marshal() ([]byte, error)

func (*BTCHeaderHashBytes) MarshalHex

func (m *BTCHeaderHashBytes) MarshalHex() string

func (BTCHeaderHashBytes) MarshalJSON

func (m BTCHeaderHashBytes) MarshalJSON() ([]byte, error)

func (BTCHeaderHashBytes) MarshalTo

func (m BTCHeaderHashBytes) MarshalTo(data []byte) (int, error)

func (BTCHeaderHashBytes) MustMarshal

func (m BTCHeaderHashBytes) MustMarshal() []byte

func (*BTCHeaderHashBytes) Size

func (m *BTCHeaderHashBytes) Size() int

func (*BTCHeaderHashBytes) String

func (m *BTCHeaderHashBytes) String() string

func (BTCHeaderHashBytes) ToChainhash

func (m BTCHeaderHashBytes) ToChainhash() *chainhash.Hash

func (*BTCHeaderHashBytes) Unmarshal

func (m *BTCHeaderHashBytes) Unmarshal(bz []byte) error

func (*BTCHeaderHashBytes) UnmarshalHex

func (m *BTCHeaderHashBytes) UnmarshalHex(hash string) error

func (*BTCHeaderHashBytes) UnmarshalJSON

func (m *BTCHeaderHashBytes) UnmarshalJSON(bz []byte) error

type BtcConfig

type BtcConfig struct {
	// contains filtered or unexported fields
}

func ParseBtcOptionsFromConfig

func ParseBtcOptionsFromConfig(opts servertypes.AppOptions) BtcConfig

func (*BtcConfig) CheckpointTag

func (c *BtcConfig) CheckpointTag() txformat.BabylonTag

func (*BtcConfig) PowLimit

func (c *BtcConfig) PowLimit() big.Int

func (*BtcConfig) ReduceMinDifficulty

func (c *BtcConfig) ReduceMinDifficulty() bool

func (*BtcConfig) RetargetAdjustmentFactor

func (c *BtcConfig) RetargetAdjustmentFactor() int64

type SupportedBtcNetwork

type SupportedBtcNetwork string
const (
	BtcMainnet SupportedBtcNetwork = "mainnet"
	BtcTestnet SupportedBtcNetwork = "testnet"
	BtcSimnet  SupportedBtcNetwork = "simnet"
	BtcRegtest SupportedBtcNetwork = "regtest"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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