Documentation
¶
Index ¶
- Variables
- type BlockSync
- type PEGPricingPhase
- type Pegnet
- func (p *Pegnet) Init() error
- func (p *Pegnet) InsertGradeBlock(tx *sql.Tx, eblock *factom.EBlock, graded grader.GradedBlock) error
- func (p *Pegnet) InsertRates(tx *sql.Tx, height uint32, rates []opr.AssetUint, phase PEGPricingPhase) error
- func (p *Pegnet) InsertSynced(tx *sql.Tx, bs *BlockSync) error
- func (p Pegnet) MarkHeightSynced(tx QueryAble, height uint32) error
- func (p *Pegnet) SelectIssuances() (map[fat2.PTicker]uint64, error)
- func (p *Pegnet) SelectPreviousWinners(ctx context.Context, height uint32) ([]string, error)
- func (Pegnet) SelectSynced(ctx context.Context, tx QueryAble) (*BlockSync, error)
- type QueryAble
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // PegnetdSyncVersion is an indicator of the version of pegnetd // at each height synced. This version number can differ from the tagged // version, and is likely only to be updated at hard forks. It is used to // detect if a pegnetd was updated late, and therefore has an invalid state. // // Each fork should increment this number by at least 1 PegnetdSyncVersion = 1 )
Functions ¶
This section is empty.
Types ¶
type PEGPricingPhase ¶
type PEGPricingPhase int
const ( PEGPriceIsZero PEGPricingPhase // PEG == 0 PEGPriceIsEquation // PEG == MarketCap / Peg Supply PEGPriceIsFloating // PEG == ExchRate )
type Pegnet ¶
func (*Pegnet) InsertGradeBlock ¶
func (*Pegnet) InsertRates ¶
func (p *Pegnet) InsertRates(tx *sql.Tx, height uint32, rates []opr.AssetUint, phase PEGPricingPhase) error
InsertRates adds all asset rates as rows, computing the rate for PEG if necessary
func (Pegnet) MarkHeightSynced ¶
func (*Pegnet) SelectIssuances ¶
func (*Pegnet) SelectPreviousWinners ¶
type QueryAble ¶
type QueryAble interface {
Exec(query string, args ...interface{}) (sql.Result, error)
Prepare(query string) (*sql.Stmt, error)
Query(query string, args ...interface{}) (*sql.Rows, error)
QueryRow(query string, args ...interface{}) *sql.Row
QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
}
QueryAble is so we can swap db and tx interactions
Click to show internal directories.
Click to hide internal directories.