Documentation ¶
Index ¶
- func AddRowToSnapshot(snapshot *Snapshot, spr *SnapshotPostgresRow)
- func AddSnapshotColumn(db *sql.DB, columnName string)
- func CheckIntegrity(as Snapshot, ss SystemSnapshot) bool
- func CreateSnapshotStatusRow(db *sql.DB, blockNumber *big.Int, blockTimestamp string)
- func DumpCommissionsSnapshotData(db *sql.DB, cs CommissionsSnapshot, blockNumber *big.Int) error
- func DumpRewardsSnapshotData(db *sql.DB, rs RewardsSnapshot, blockNumber *big.Int) error
- func DumpSnapshotData(db *sql.DB, snapshot Snapshot, blockNumber *big.Int) error
- func DumpSystemSnapshotData(db *sql.DB, ss SystemSnapshot, blockNumber *big.Int) error
- func DumpVotesSnapshotData(db *sql.DB, vs VotesSnapshot, blockNumber *big.Int) error
- func FetchSnapshotAddresses(db *sql.DB, blockNumber *big.Int) ([]string, error)
- func FlushAllSnapshots(db *sql.DB)
- func GenerateAndStoreBlockSnapshots(db *sql.DB, blockNumber *big.Int, rpcClient *rpc.Client)
- func GenerateAndStoreGenesisSnapshot(db *sql.DB, blockNumber *big.Int, rpcClient *rpc.Client)
- func PrettyPrint(v interface{}) (err error)
- func SameDateOfTimestamps(ts1, ts2 string) bool
- func SnapshotCommissionsAccountLevel(blockNumber *big.Int, previousSnapshotBlockNumber *big.Int) (AccountCommissions, CommissionsSnapshot)
- func SnapshotRewardsAccountLevel(blockNumber *big.Int, previousSnapshotBlockNumber *big.Int) (AccountRewards, RewardsSnapshot)
- func UTCTime(timestampHex string) time.Time
- type AccountCommissions
- type AccountRewards
- type AccountSnapshot
- type AccountSnapshotRow
- type AccountVotesDistribution
- type AccountVotesSnapshot
- type Address
- type BlockNumber
- type CommissionsSnapshot
- type CommissionsSnapshotRow
- type DelegationRow
- type RewardsSnapshot
- type RewardsSnapshotRow
- type Snapshot
- type SnapshotDate
- type SnapshotPostgresRow
- type SnapshotRow
- type SystemSnapshot
- type SystemSnapshotRow
- type VotesSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRowToSnapshot ¶
func AddRowToSnapshot(snapshot *Snapshot, spr *SnapshotPostgresRow)
func AddSnapshotColumn ¶
func CheckIntegrity ¶
func CheckIntegrity(as Snapshot, ss SystemSnapshot) bool
func CreateSnapshotStatusRow ¶
func DumpRewardsSnapshotData ¶
func DumpSnapshotData ¶
func DumpSystemSnapshotData ¶
func DumpVotesSnapshotData ¶
func FetchSnapshotAddresses ¶
func FlushAllSnapshots ¶
func PrettyPrint ¶
func PrettyPrint(v interface{}) (err error)
func SameDateOfTimestamps ¶
func SnapshotCommissionsAccountLevel ¶
func SnapshotCommissionsAccountLevel(blockNumber *big.Int, previousSnapshotBlockNumber *big.Int) (AccountCommissions, CommissionsSnapshot)
func SnapshotRewardsAccountLevel ¶
func SnapshotRewardsAccountLevel(blockNumber *big.Int, previousSnapshotBlockNumber *big.Int) (AccountRewards, RewardsSnapshot)
Types ¶
type AccountCommissions ¶
type AccountRewards ¶
type AccountSnapshot ¶
type AccountSnapshot map[BlockNumber]*AccountSnapshotRow
AccountSnapshot is helper type for fetching historical snapshot data of an account
func FetchAccountSnapshot ¶
func FetchAccountSnapshot(db *sql.DB, account string) (AccountSnapshot, error)
type AccountSnapshotRow ¶
type AccountSnapshotRow struct { //AddColumnWork GoldTokenBalance string LockedGoldBalance string NonVotingLockedGoldBalance string PendingWithdrawalGoldBalance string CeloUSDValue string Reward string Commission string }
AccountSnapshotRow is helper type for fetching historical snapshot data of an account
type AccountVotesDistribution ¶
type AccountVotesDistribution = contract.AccountVotesDistribution
type AccountVotesSnapshot ¶
type AccountVotesSnapshot map[BlockNumber][]*DelegationRow
func FetchAccountVotesSnapshot ¶
func FetchAccountVotesSnapshot(db *sql.DB, account string) (AccountVotesSnapshot, error)
type BlockNumber ¶
type BlockNumber = string
type CommissionsSnapshot ¶
type CommissionsSnapshot = []*CommissionsSnapshotRow
type CommissionsSnapshotRow ¶
type DelegationRow ¶
type RewardsSnapshot ¶
type RewardsSnapshot = []*RewardsSnapshotRow
type RewardsSnapshotRow ¶
type Snapshot ¶
type Snapshot map[Address]SnapshotRow
func SnapshotAccountLevel ¶
type SnapshotDate ¶
SnapshotInfo is a tuple representing a snapshot's date and block number
func DatesOfCompletedSnapshots ¶
func DatesOfCompletedSnapshots(db *sql.DB) ([]*SnapshotDate, error)
type SnapshotPostgresRow ¶
type SnapshotPostgresRow struct { Address string GoldTokenBalance string LockedGoldBalance string NonVotingLockedGoldBalance string PendingWithdrawalGoldBalance string CeloUSDValue string Reward string Commission string }
This type acts as a bridge between Postgres row and Golang SnapshotRow
type SnapshotRow ¶
type SnapshotRow struct { GoldTokenBalance *big.Int LockedGoldBalance *big.Int NonVotingLockedGoldBalance *big.Int PendingWithdrawalGoldBalance *big.Int CeloUSDValue *big.Int Reward *big.Int Commission *big.Int }
func GenerateNewSnapshotRowWithDetails ¶
func GenerateNewSnapshotRowWithDetails(address string, blockNumber *big.Int) SnapshotRow
type SystemSnapshot ¶
type SystemSnapshot struct { GoldTokenSupply *big.Int TotalLockedGoldBalance *big.Int NonVotingLockedGoldBalance *big.Int TotalCeloUSDValue *big.Int }
func SnapshotSystemLevel ¶
func SnapshotSystemLevel(rpcClient *rpc.Client, blockNumber *big.Int) SystemSnapshot
type SystemSnapshotRow ¶
type SystemSnapshotRow struct { BlockNumber string SnapshotDate string GoldTokenSupply string TotalLockedGoldBalance string NonVotingLockedGoldBalance string TotalCeloUSDValue string }
func FetchAllSystemSnapshots ¶
func FetchAllSystemSnapshots(db *sql.DB) ([]*SystemSnapshotRow, error)
type VotesSnapshot ¶
type VotesSnapshot = map[Address]*AccountVotesDistribution
func VotesSnapshotAccountLevel ¶
func VotesSnapshotAccountLevel(blockNumber *big.Int) VotesSnapshot
Click to show internal directories.
Click to hide internal directories.