blockwitness

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusPublished = iota
	StatusReceived
)
View Source
const (
	TableName = `block_witness`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockWitness

type BlockWitness struct {
	gorm.Model
	Height      int64 `gorm:"index:idx_height,unique"`
	WitnessData string
	Status      int64
}

func (*BlockWitness) TableName

func (*BlockWitness) TableName() string

type BlockWitnessModel

type BlockWitnessModel interface {
	CreateBlockWitnessTable() error
	DropBlockWitnessTable() error
	GetLatestBlockWitnessHeight() (height int64, err error)
	GetBlockWitnessByHeight(height int64) (witness *BlockWitness, err error)
	UpdateBlockWitnessStatus(witness *BlockWitness, status int64) error
	GetLatestBlockWitness() (witness *BlockWitness, err error)
	CreateBlockWitness(witness *BlockWitness) error
}

func NewBlockWitnessModel

func NewBlockWitnessModel(db *gorm.DB) BlockWitnessModel

Jump to

Keyboard shortcuts

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