actions

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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProtocolID is the ID of protocol
	ProtocolID = "actions"
	// ActionHistoryTableName is the table name of action history
	ActionHistoryTableName = "action_history"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionHistory

type ActionHistory struct {
	ActionType    string
	ActionHash    string
	ReceiptHash   string
	BlockHeight   uint64
	From          string
	To            string
	GasPrice      string
	GasConsumed   uint64
	Nonce         uint64
	Amount        string
	ReceiptStatus string
}

ActionHistory defines the base schema of "action history" table

type ActionInfo

type ActionInfo struct {
	ActionType  string
	ActionHash  string
	ReceiptHash hash.Hash256
	From        string
	To          string
	GasPrice    string
	Nonce       uint64
	Amount      string
}

ActionInfo defines an action's information

type Protocol

type Protocol struct {
	Store s.Store
}

Protocol defines the protocol of indexing blocks

func NewProtocol

func NewProtocol(store s.Store) *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(context.Context, *sql.Tx, *indexprotocol.Genesis) error

Initialize initializes actions protocol

type ReceiptInfo

type ReceiptInfo struct {
	ReceiptHash   string
	GasConsumed   uint64
	ReceiptStatus string
}

ReceiptInfo defines a receipt's information

Jump to

Keyboard shortcuts

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