model

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const TableNamePreifx = "userproof"

Variables

This section is empty.

Functions

This section is empty.

Types

type UserConfig

type UserConfig struct {
	AccountIndex  uint32
	AccountIdHash string
	TotalEquity   *big.Int
	TotalDebt     *big.Int
	Assets        []utils.AccountAsset
	Root          string
	Proof         [][]byte
}

type UserProof

type UserProof struct {
	AccountIndex    uint32 `gorm:"index:idx_int,unique"`
	AccountId       string `gorm:"index:idx_str,unique"`
	AccountLeafHash string
	TotalEquity     string
	TotalDebt       string
	Assets          string
	Proof           string
	Config          string
}

type UserProofModel

type UserProofModel interface {
	CreateUserProofTable() error
	DropUserProofTable() error
	CreateUserProofs(rows []UserProof) error
	GetUserProofByIndex(id uint32) (*UserProof, error)
	GetUserProofById(id string) (*UserProof, error)
	GetLatestAccountIndex() (uint32, error)
}

func NewUserProofModel

func NewUserProofModel(db *gorm.DB, suffix string) UserProofModel

Jump to

Keyboard shortcuts

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