github.com/lino-network/lino@v0.6.11/x/vote/model/ir.go (about)

     1  package model
     2  
     3  import (
     4  	linotypes "github.com/lino-network/lino/types"
     5  	"github.com/lino-network/lino/x/vote/types"
     6  )
     7  
     8  // VoterIR - pk: username
     9  type VoterIR struct {
    10  	Username          linotypes.AccountKey `json:"username"`
    11  	LinoStake         linotypes.Coin       `json:"lino_stake"`
    12  	LastPowerChangeAt int64                `json:"last_power_change_at"`
    13  	Interest          linotypes.Coin       `json:"interest"`
    14  	Duty              types.VoterDuty      `json:"duty"`
    15  	FrozenAmount      linotypes.Coin       `json:"frozen_amount"`
    16  }
    17  
    18  // LinoStakeStatIR - records the information needed by
    19  // lino power deposit, update and store daily.
    20  type LinoStakeStatIR struct {
    21  	TotalConsumptionFriction linotypes.Coin `json:"total_consumption_friction"`
    22  	UnclaimedFriction        linotypes.Coin `json:"unclaimed_friction"`
    23  	TotalLinoStake           linotypes.Coin `json:"total_lino_power"`
    24  	UnclaimedLinoStake       linotypes.Coin `json:"unclaimed_lino_power"`
    25  }
    26  
    27  // StakeStatDayIR - stake stats of a day, pk: day
    28  type StakeStatDayIR struct {
    29  	Day       int64           `json:"day"`
    30  	StakeStat LinoStakeStatIR `json:"stake_stat"`
    31  }
    32  
    33  // VoterTablesIR - state of voter
    34  type VoterTablesIR struct {
    35  	Version    int              `json:"version"`
    36  	Voters     []VoterIR        `json:"voters"`
    37  	StakeStats []StakeStatDayIR `json:"stake_stats"`
    38  }