proof

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

Documentation

Index

Constants

View Source
const (
	NotSent = iota
	NotConfirmed
	Confirmed
)
View Source
const (
	TableName = "proof"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Proof

type Proof struct {
	gorm.Model
	ProofInfo   string
	BlockNumber int64 `gorm:"index:idx_number,unique"`
	Status      int64
}

func (*Proof) TableName

func (*Proof) TableName() string

type ProofModel

type ProofModel interface {
	CreateProofTable() error
	DropProofTable() error
	CreateProof(row *Proof) error
	GetProofsBetween(start int64, end int64) (proofs []*Proof, err error)
	GetLatestProof() (p *Proof, err error)
	GetLatestConfirmedProof() (p *Proof, err error)
	GetProofByBlockHeight(height int64) (p *Proof, err error)
	UpdateProofsInTransact(tx *gorm.DB, m map[int64]int) error
}

func NewProofModel

func NewProofModel(db *gorm.DB) ProofModel

Jump to

Keyboard shortcuts

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