models

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockAction

type BlockAction struct {
	ID          uint64          `gorm:"primary_key;" sql:"type:bigint"`
	ActionHash  string          `gorm:"size:64;not null;index:,length:9"`
	ActionType  string          `gorm:"size:32;not null;index"`
	BlockHeight uint64          `gorm:"unsigned;index" sql:"type:bigint"`
	From        string          `gorm:"size:42;not null;default:'';index:,length:9"`
	To          string          `gorm:"size:42;not null;default:'';index:,length:9"`
	GasPrice    decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
	GasLimit    uint64          `gorm:"type:int4;unsigned;not null;default:0"`
	Nonce       uint64          `gorm:"type:int8;unsigned;not null;default:0"`
	Amount      decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
}

func (BlockAction) TableName

func (BlockAction) TableName() string

type Candidate

type Candidate struct {
	ID              uint64          `gorm:"primary_key;" sql:"type:bigint"`
	BlockHeight     uint64          `gorm:"not null;unsigned;index" sql:"type:bigint"`
	Name            string          `gorm:"size:42;not null;default:'';index"`
	OperatorAddress string          `gorm:"size:42;not null;default:'';"`
	RewardAddress   string          `gorm:"size:42;not null;default:'';"`
	OwnerAddress    string          `gorm:"size:42;not null;default:'';"`
	Amount          decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
	Duration        uint32          `gorm:"not null;" sql:"type:bigint"`
	ActType         string
	AutoStake       bool
	Payload         []byte
}

func (*Candidate) FetchByName

func (m *Candidate) FetchByName(name string) (*Candidate, error)

func (*Candidate) FetchByNameWithHeight

func (m *Candidate) FetchByNameWithHeight(name string, height uint64) error

func (Candidate) TableName

func (Candidate) TableName() string

type Candidates

type Candidates []Candidate

func GetAllCandidates

func GetAllCandidates() (Candidates, error)

func (Candidates) ByOwnerAddress

func (m Candidates) ByOwnerAddress(addr string) (Candidate, error)

type Delegate

type Delegate struct {
	ID              uint64 `gorm:"primary_key;" sql:"type:bigint"`
	BlockHeight     uint64 `gorm:"unsigned;index" sql:"type:bigint"`
	OperatorAddress string `gorm:"size:42;not null;default:'';"`
	RewardAddress   string `gorm:"size:42;not null;default:'';"`
	OwnerAddress    string `gorm:"size:42;not null;default:'';"`
	Candidate       string `gorm:"size:42;not null;default:'';"`
	Active          bool   `gorm:"type:bool;not null;default:false"`
	Name            string `gorm:"size:42;not null;default:'';"`
	// Rank            int             `gorm:"type:int2;unsigned;not null;default:0"`
	StakeAmount decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
	VoteWeight  decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
	Probated    bool            `gorm:"type:bool;not null;default:false"`
	SelfStake   bool
}

func (Delegate) TableName

func (Delegate) TableName() string

type Probation

type Probation struct {
	ID            uint64 `gorm:"primary_key;" sql:"type:bigint"`
	BlockHeight   uint64 `gorm:"not null;unsigned;index" sql:"type:bigint"`
	EpochNumber   uint64 `gorm:"not null;unsigned;index" sql:"type:bigint"`
	Address       string `gorm:"size:42;not null;default:'';"`
	IntensityRate uint32 `gorm:"type:int;not null;default:0;"`
	Count         uint64 `gorm:"not null;" sql:"type:bigint"`
}

func (Probation) GetCountByEpochNum

func (m Probation) GetCountByEpochNum(epochNum uint64) (uint64, error)

func (Probation) TableName

func (Probation) TableName() string

type StakingAction

type StakingAction struct {
	ID           uint64          `gorm:"primary_key;" sql:"type:bigint"`
	BlockHeight  uint64          `gorm:"unsigned;index" sql:"type:bigint"`
	BucketID     uint64          `gorm:"unsigned;index"`
	OwnerAddress string          `gorm:"size:42;not null;default:'';index:,length:9"`
	Candidate    string          `gorm:"size:42;not null;default:'';index:,length:9"`
	ForwardTo    string          `gorm:"size:42;not null;default:'';"` //store Governace Forward To Address
	Amount       decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
	ActType      string          `gorm:"size:42;not null;default:'';index"`
	Sender       string          `gorm:"size:42;not null;default:'';index:,length:9"`
	ActHash      string
	AutoStake    bool
	Duration     uint32
}

func (StakingAction) TableName

func (StakingAction) TableName() string

Jump to

Keyboard shortcuts

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