accounts

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProtocolID is the ID of protocol
	ProtocolID = "accounts"
	// AccountHistoryTableName is the table name of account history
	AccountHistoryTableName = "account_history"
	// AccountBalanceViewName is the view name of account balance
	AccountBalanceViewName = "account_balance"
	// EpochAddressIndexName is the index name of epoch number and address on account history table
	EpochAddressIndexName = "epoch_address_index"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountBalance

type AccountBalance struct {
	EpochNumber   uint64
	Address       string
	BalanceChange string
}

AccountBalance defines the base schema of "account balance" view

type AccountHistory

type AccountHistory struct {
	EpochNumber uint64
	BlockHeight uint64
	ActionHash  string
	Address     string
	In          string
	Out         string
}

AccountHistory defines the base schema of "account history" table

type Protocol

type Protocol struct {
	Store        s.Store
	NumDelegates uint64
	NumSubEpochs uint64
}

Protocol defines the protocol of indexing blocks

func NewProtocol

func NewProtocol(store s.Store, numDelegates uint64, numSubEpochs uint64) *Protocol

NewProtocol creates a new protocol

func (*Protocol) CreateTables

func (p *Protocol) CreateTables(ctx context.Context) error

CreateTables creates tables

func (*Protocol) HandleBlock

func (p *Protocol) HandleBlock(ctx context.Context, tx *sql.Tx, blk *block.Block) error

HandleBlock handles blocks

func (*Protocol) Initialize

func (p *Protocol) Initialize(ctx context.Context, tx *sql.Tx, genesis *indexprotocol.Genesis) error

Initialize initializes actions protocol

Jump to

Keyboard shortcuts

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