collector

package
v0.26.7-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: LGPL-3.0 Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddActivationTxBalanceTransfer

func AddActivationTxBalanceTransfer(c StatsCollector, tx *types.Transaction, amount *big.Int)

func AddBurnTxBurntCoins

func AddBurnTxBurntCoins(c StatsCollector, addr common.Address, tx *types.Transaction)

func AddContractBalanceUpdate added in v0.24.0

func AddContractBalanceUpdate(c StatsCollector, address common.Address, getCurrentBalance GetBalanceFunc, newBalance *big.Int, appState *appstate.AppState)

func AddContractBurntCoins added in v0.24.0

func AddContractBurntCoins(c StatsCollector, address common.Address, getAmount GetBalanceFunc)

func AddContractStake added in v0.24.0

func AddContractStake(c StatsCollector, amount *big.Int)

func AddContractTerminationBurntCoins added in v0.24.0

func AddContractTerminationBurntCoins(c StatsCollector, address common.Address, stake, refund *big.Int)

func AddFeeBurntCoins

func AddFeeBurntCoins(c StatsCollector, addr common.Address, feeAmount *big.Int, burntRate float32,
	tx *types.Transaction)

func AddFinalCommitteeReward

func AddFinalCommitteeReward(c StatsCollector, balanceDest, stakeDest common.Address, balance, stake *big.Int)

func AddFlipsReward

func AddFlipsReward(c StatsCollector, balanceDest, stakeDest common.Address, balance, stake *big.Int, flipsToReward []*types.FlipToReward)

func AddFoundationPayout

func AddFoundationPayout(c StatsCollector, addr common.Address, balance *big.Int)

func AddInvitationsReward

func AddInvitationsReward(c StatsCollector, balanceDest, stakeDest common.Address, balance, stake *big.Int, age uint16,
	txHash *common.Hash, epochHeight uint32, isSavedInviteWinner bool)

func AddInviteBurntCoins

func AddInviteBurntCoins(c StatsCollector, addr common.Address, amount *big.Int, tx *types.Transaction)

func AddKillInviteeTxStakeTransfer

func AddKillInviteeTxStakeTransfer(c StatsCollector, tx *types.Transaction, stake, stakeToTransfer *big.Int)

func AddKillTxStakeTransfer

func AddKillTxStakeTransfer(c StatsCollector, tx *types.Transaction, amount *big.Int)

func AddKilledBurntCoins

func AddKilledBurntCoins(c StatsCollector, addr common.Address, amount *big.Int)

func AddMintedCoins

func AddMintedCoins(c StatsCollector, amount *big.Int)

func AddMultisigCallAdd added in v0.24.0

func AddMultisigCallAdd(c StatsCollector, address common.Address, newState *byte)

func AddMultisigCallPush added in v0.24.0

func AddMultisigCallPush(c StatsCollector, dest common.Address, amount []byte, voteAddressCnt, voteAmountCnt int)

func AddMultisigCallSend added in v0.24.0

func AddMultisigCallSend(c StatsCollector, dest common.Address, amount []byte)

func AddMultisigDeploy added in v0.24.0

func AddMultisigDeploy(c StatsCollector, contractAddress common.Address, minVotes, maxVotes, state byte)

func AddMultisigTermination added in v0.24.0

func AddMultisigTermination(c StatsCollector, dest common.Address)

func AddOracleLockCallCheckOracleVoting added in v0.24.0

func AddOracleLockCallCheckOracleVoting(c StatsCollector, votedValue byte, err error)

func AddOracleLockCallPush added in v0.24.0

func AddOracleLockCallPush(c StatsCollector, success bool, oracleVotingResult byte, transfer *big.Int)

func AddOracleLockDeploy added in v0.24.0

func AddOracleLockDeploy(c StatsCollector, contractAddress common.Address, oracleVotingAddress common.Address,
	value byte, successAddress common.Address, failAddress common.Address)

func AddOracleLockTermination added in v0.24.0

func AddOracleLockTermination(c StatsCollector, dest common.Address)

func AddOracleVotingCallAddStake added in v0.24.0

func AddOracleVotingCallAddStake(c StatsCollector)

func AddOracleVotingCallFinish added in v0.24.0

func AddOracleVotingCallFinish(c StatsCollector, state byte, result *byte, fund, oracleReward, ownerReward *big.Int)

func AddOracleVotingCallProlongation added in v0.24.0

func AddOracleVotingCallProlongation(c StatsCollector, startBlock *uint64, epoch uint16, vrfSeed []byte, committeeSize, networkSize uint64,
	newEpochWithoutGrowth *byte, newProlongVoteCount *uint64)

func AddOracleVotingCallProlongationOld added in v0.25.3

func AddOracleVotingCallProlongationOld(c StatsCollector, startBlock *uint64, epoch uint16, vrfSeed []byte, committeeSize, networkSize uint64)

func AddOracleVotingCallStart added in v0.24.0

func AddOracleVotingCallStart(c StatsCollector, state byte, startBlock uint64, epoch uint16, votingMinPayment *big.Int, vrfSeed []byte,
	committeeSize uint64, networkSize int)

func AddOracleVotingCallVote added in v0.24.0

func AddOracleVotingCallVote(c StatsCollector, vote byte, salt []byte, newOptionVotes *uint64, newOptionAllVotes uint64,
	newSecretVotesCount *uint64, delegatee *common.Address, prevPoolVote []byte, newPrevOptionVotes *uint64)

func AddOracleVotingCallVoteOld added in v0.25.3

func AddOracleVotingCallVoteOld(c StatsCollector, vote byte, salt []byte)

func AddOracleVotingCallVoteProof added in v0.24.0

func AddOracleVotingCallVoteProof(c StatsCollector, voteHash []byte, newSecretVotesCount *uint64)

func AddOracleVotingCallVoteProofOld added in v0.25.3

func AddOracleVotingCallVoteProofOld(c StatsCollector, voteHash []byte)

func AddOracleVotingDeploy added in v0.24.0

func AddOracleVotingDeploy(c StatsCollector, contractAddress common.Address, startTime uint64,
	votingMinPayment *big.Int, fact []byte, state byte, votingDuration, publicVotingDuration uint64, winnerThreshold, quorum byte,
	committeeSize uint64, ownerFee byte)

func AddOracleVotingTermination added in v0.24.0

func AddOracleVotingTermination(c StatsCollector, fund, oracleReward, ownerReward *big.Int)

func AddPenaltyBurntCoins

func AddPenaltyBurntCoins(c StatsCollector, addr common.Address, amount *big.Int)

func AddProposerReward

func AddProposerReward(c StatsCollector, balanceDest, stakeDest common.Address, balance, stake *big.Int)

func AddRefundableOracleLockCallDeposit added in v0.24.0

func AddRefundableOracleLockCallDeposit(c StatsCollector, ownSum, sum, fee *big.Int)

func AddRefundableOracleLockCallPush added in v0.24.0

func AddRefundableOracleLockCallPush(c StatsCollector, state byte, oracleVotingExists bool, oracleVotingResult byte, oracleVotingResultErr error, transfer *big.Int, refundBlock uint64)

func AddRefundableOracleLockCallRefund added in v0.24.0

func AddRefundableOracleLockCallRefund(c StatsCollector, balance *big.Int, coef decimal.Decimal)

func AddRefundableOracleLockDeploy added in v0.24.0

func AddRefundableOracleLockDeploy(c StatsCollector, contractAddress common.Address, oracleVotingAddress common.Address,
	value byte, successAddress common.Address, successAddressErr error, failAddress common.Address, failAddressErr error,
	refundDelay, depositDeadline uint64, oracleVotingFee byte, state byte, sum *big.Int)

func AddRefundableOracleLockTermination added in v0.24.0

func AddRefundableOracleLockTermination(c StatsCollector, dest common.Address)

func AddReportedFlipsReward added in v0.22.0

func AddReportedFlipsReward(c StatsCollector, balanceDest, stakeDest common.Address, flipIdx int, balance, stake *big.Int)

func AddTimeLockCallTransfer added in v0.24.0

func AddTimeLockCallTransfer(c StatsCollector, dest common.Address, amount *big.Int)

func AddTimeLockDeploy added in v0.24.0

func AddTimeLockDeploy(c StatsCollector, contractAddress common.Address, timestamp uint64)

func AddTimeLockTermination added in v0.24.0

func AddTimeLockTermination(c StatsCollector, dest common.Address)

func AddTxFee added in v0.24.0

func AddTxFee(c StatsCollector, feeAmount *big.Int)

func AddTxReceipt added in v0.24.0

func AddTxReceipt(c StatsCollector, txReceipt *types.TxReceipt, appState *appstate.AppState)

func AddValidationReward

func AddValidationReward(c StatsCollector, balanceDest, stakeDest common.Address, age uint16, balance, stake *big.Int)

func AddZeroWalletFund

func AddZeroWalletFund(c StatsCollector, addr common.Address, balance *big.Int)

func AfterAddStake

func AfterAddStake(c StatsCollector, addr common.Address, amount *big.Int, appState *appstate.AppState)

func AfterSubPenalty

func AfterSubPenalty(c StatsCollector, addr common.Address, amount *big.Int, appState *appstate.AppState)

func BeforeClearPenalty

func BeforeClearPenalty(c StatsCollector, addr common.Address, appState *appstate.AppState)

func BeforeSetPenalty

func BeforeSetPenalty(c StatsCollector, addr common.Address, amount *big.Int, appState *appstate.AppState)

func BeginApplyingTx added in v0.24.0

func BeginApplyingTx(c StatsCollector, tx *types.Transaction, appState *appstate.AppState)

func BeginCommitteeRewardBalanceUpdate added in v0.20.0

func BeginCommitteeRewardBalanceUpdate(c StatsCollector, balanceDest, stakeDest common.Address, appState *appstate.AppState)

func BeginDustClearingBalanceUpdate added in v0.20.0

func BeginDustClearingBalanceUpdate(c StatsCollector, addr common.Address, appState *appstate.AppState)

func BeginEpochPenaltyResetBalanceUpdate added in v0.20.0

func BeginEpochPenaltyResetBalanceUpdate(c StatsCollector, addr common.Address, appState *appstate.AppState)

func BeginEpochRewardBalanceUpdate added in v0.20.0

func BeginEpochRewardBalanceUpdate(c StatsCollector, balanceDest, stakeDest common.Address, appState *appstate.AppState)

func BeginFailedValidationBalanceUpdate added in v0.20.0

func BeginFailedValidationBalanceUpdate(c StatsCollector, addr common.Address, appState *appstate.AppState)

func BeginPenaltyBalanceUpdate added in v0.20.0

func BeginPenaltyBalanceUpdate(c StatsCollector, addr common.Address, appState *appstate.AppState)

func BeginProposerRewardBalanceUpdate added in v0.20.0

func BeginProposerRewardBalanceUpdate(c StatsCollector, balanceDest, stakeDest common.Address, appState *appstate.AppState)

func BeginTxBalanceUpdate added in v0.20.0

func BeginTxBalanceUpdate(c StatsCollector, tx *types.Transaction, appState *appstate.AppState)

func BeginVerifiedStakeTransferBalanceUpdate added in v0.20.0

func BeginVerifiedStakeTransferBalanceUpdate(c StatsCollector, addrFrom, addrTo common.Address, appState *appstate.AppState)

func CompleteApplyingTx added in v0.24.0

func CompleteApplyingTx(c StatsCollector, appState *appstate.AppState)

func CompleteBalanceUpdate added in v0.20.0

func CompleteBalanceUpdate(c StatsCollector, appState *appstate.AppState)

func SetCommitteeRewardShare added in v0.20.0

func SetCommitteeRewardShare(c StatsCollector, amount *big.Int)

func SetMinScoreForInvite

func SetMinScoreForInvite(c StatsCollector, score float32)

func SetTotalFlipsReward

func SetTotalFlipsReward(c StatsCollector, amount *big.Int, share *big.Int)

func SetTotalFoundationPayouts

func SetTotalFoundationPayouts(c StatsCollector, amount *big.Int)

func SetTotalInvitationsReward

func SetTotalInvitationsReward(c StatsCollector, amount *big.Int, share *big.Int)

func SetTotalReward

func SetTotalReward(c StatsCollector, amount *big.Int)

func SetTotalValidationReward

func SetTotalValidationReward(c StatsCollector, amount *big.Int, share *big.Int)

func SetTotalZeroWalletFund

func SetTotalZeroWalletFund(c StatsCollector, amount *big.Int)

func SetValidation

func SetValidation(c StatsCollector, validation *statsTypes.ValidationStats)

func SetValidationResults added in v0.20.0

func SetValidationResults(c StatsCollector, validationResults *types.ValidationResults)

Types

type GetBalanceFunc added in v0.24.0

type GetBalanceFunc func(address common.Address) *big.Int

type StatsCollector

type StatsCollector interface {
	EnableCollecting()
	CompleteCollecting()

	SetValidation(validation *statsTypes.ValidationStats)
	SetMinScoreForInvite(score float32)

	SetValidationResults(authors *types.ValidationResults)

	SetTotalReward(amount *big.Int)
	SetTotalValidationReward(amount *big.Int, share *big.Int)
	SetTotalFlipsReward(amount *big.Int, share *big.Int)
	SetTotalInvitationsReward(amount *big.Int, share *big.Int)
	SetTotalFoundationPayouts(amount *big.Int)
	SetTotalZeroWalletFund(amount *big.Int)
	AddValidationReward(balanceDest, stakeDest common.Address, age uint16, balance, stake *big.Int)
	AddFlipsReward(balanceDest, stakeDest common.Address, balance, stake *big.Int, flipsToReward []*types.FlipToReward)
	AddReportedFlipsReward(balanceDest, stakeDest common.Address, flipIdx int, balance, stake *big.Int)
	AddInvitationsReward(balanceDest, stakeDest common.Address, balance, stake *big.Int, age uint16, txHash *common.Hash,
		epochHeight uint32, isSavedInviteWinner bool)
	AddFoundationPayout(addr common.Address, balance *big.Int)
	AddZeroWalletFund(addr common.Address, balance *big.Int)

	AddProposerReward(balanceDest, stakeDest common.Address, balance, stake *big.Int)
	AddFinalCommitteeReward(balanceDest, stakeDest common.Address, balance, stake *big.Int)

	AfterSubPenalty(addr common.Address, amount *big.Int, appState *appstate.AppState)
	BeforeClearPenalty(addr common.Address, appState *appstate.AppState)
	BeforeSetPenalty(addr common.Address, amount *big.Int, appState *appstate.AppState)

	AddMintedCoins(amount *big.Int)
	AddPenaltyBurntCoins(addr common.Address, amount *big.Int)
	AddInviteBurntCoins(addr common.Address, amount *big.Int, tx *types.Transaction)
	AddFeeBurntCoins(addr common.Address, feeAmount *big.Int, burntRate float32, tx *types.Transaction)
	AddKilledBurntCoins(addr common.Address, amount *big.Int)
	AddBurnTxBurntCoins(addr common.Address, tx *types.Transaction)

	AfterAddStake(addr common.Address, amount *big.Int, appState *appstate.AppState)

	AddActivationTxBalanceTransfer(tx *types.Transaction, amount *big.Int)
	AddKillTxStakeTransfer(tx *types.Transaction, amount *big.Int)
	AddKillInviteeTxStakeTransfer(tx *types.Transaction, stake, stakeToTransfer *big.Int)

	BeginVerifiedStakeTransferBalanceUpdate(addrFrom, addrTo common.Address, appState *appstate.AppState)
	BeginTxBalanceUpdate(tx *types.Transaction, appState *appstate.AppState)
	BeginProposerRewardBalanceUpdate(balanceDest, stakeDest common.Address, appState *appstate.AppState)
	BeginCommitteeRewardBalanceUpdate(balanceDest, stakeDest common.Address, appState *appstate.AppState)
	BeginEpochRewardBalanceUpdate(balanceDest, stakeDest common.Address, appState *appstate.AppState)
	BeginFailedValidationBalanceUpdate(addr common.Address, appState *appstate.AppState)
	BeginPenaltyBalanceUpdate(addr common.Address, appState *appstate.AppState)
	BeginEpochPenaltyResetBalanceUpdate(addr common.Address, appState *appstate.AppState)
	BeginDustClearingBalanceUpdate(addr common.Address, appState *appstate.AppState)
	CompleteBalanceUpdate(appState *appstate.AppState)

	SetCommitteeRewardShare(amount *big.Int)

	BeginApplyingTx(tx *types.Transaction, appState *appstate.AppState)
	CompleteApplyingTx(appState *appstate.AppState)
	AddTxFee(feeAmount *big.Int)

	AddContractStake(amount *big.Int)
	AddContractBalanceUpdate(address common.Address, getCurrentBalance GetBalanceFunc, newBalance *big.Int, appState *appstate.AppState)
	AddContractBurntCoins(address common.Address, getAmount GetBalanceFunc)
	AddContractTerminationBurntCoins(address common.Address, stake, refund *big.Int)

	AddOracleVotingDeploy(contractAddress common.Address, startTime uint64, votingMinPayment *big.Int,
		fact []byte, state byte, votingDuration, publicVotingDuration uint64, winnerThreshold, quorum byte, committeeSize uint64, ownerFee byte)
	AddOracleVotingCallStart(state byte, startBlock uint64, epoch uint16, votingMinPayment *big.Int, vrfSeed []byte, committeeSize uint64, networkSize int)
	AddOracleVotingCallVoteProofOld(voteHash []byte)
	AddOracleVotingCallVoteProof(voteHash []byte, newSecretVotesCount *uint64)
	AddOracleVotingCallVoteOld(vote byte, salt []byte)
	AddOracleVotingCallVote(vote byte, salt []byte, newOptionVotes *uint64, newOptionAllVotes uint64,
		newSecretVotesCount *uint64, delegatee *common.Address, prevPoolVote []byte, newPrevOptionVotes *uint64)
	AddOracleVotingCallFinish(state byte, result *byte, fund, oracleReward, ownerReward *big.Int)
	AddOracleVotingCallProlongationOld(startBlock *uint64, epoch uint16, vrfSeed []byte, committeeSize, networkSize uint64)
	AddOracleVotingCallProlongation(startBlock *uint64, epoch uint16, vrfSeed []byte, committeeSize, networkSize uint64,
		newEpochWithoutGrowth *byte, newProlongVoteCount *uint64)
	AddOracleVotingCallAddStake()
	AddOracleVotingTermination(fund, oracleReward, ownerReward *big.Int)

	AddOracleLockDeploy(contractAddress common.Address, oracleVotingAddress common.Address, value byte, successAddress common.Address,
		failAddress common.Address)
	AddOracleLockCallPush(success bool, oracleVotingResult byte, transfer *big.Int)
	AddOracleLockCallCheckOracleVoting(votedValue byte, err error)
	AddOracleLockTermination(dest common.Address)

	AddRefundableOracleLockDeploy(contractAddress common.Address, oracleVotingAddress common.Address, value byte,
		successAddress common.Address, successAddressErr error, failAddress common.Address, failAddressErr error,
		refundDelay, depositDeadline uint64, oracleVotingFee byte, state byte, sum *big.Int)
	AddRefundableOracleLockCallDeposit(ownSum, sum, fee *big.Int)
	AddRefundableOracleLockCallPush(state byte, oracleVotingExists bool, oracleVotingResult byte, oracleVotingResultErr error, transfer *big.Int, refundBlock uint64)
	AddRefundableOracleLockCallRefund(balance *big.Int, coef decimal.Decimal)
	AddRefundableOracleLockTermination(dest common.Address)

	AddMultisigDeploy(contractAddress common.Address, minVotes, maxVotes, state byte)
	AddMultisigCallAdd(address common.Address, newState *byte)
	AddMultisigCallSend(dest common.Address, amount []byte)
	AddMultisigCallPush(dest common.Address, amount []byte, voteAddressCnt, voteAmountCnt int)
	AddMultisigTermination(dest common.Address)

	AddTimeLockDeploy(contractAddress common.Address, timestamp uint64)
	AddTimeLockCallTransfer(dest common.Address, amount *big.Int)
	AddTimeLockTermination(dest common.Address)

	AddTxReceipt(txReceipt *types.TxReceipt, appState *appstate.AppState)

	RemoveMemPoolTx(tx *types.Transaction)
}

func NewStatsCollector

func NewStatsCollector() StatsCollector

Jump to

Keyboard shortcuts

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