analyzer

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AllOperationTypesString

func AllOperationTypesString() []string

func FilterChangesBySubAccount

func FilterChangesBySubAccount(op *Operation, subAccountType SubAccountType) map[common.Address]*big.Int

func MatchChangesOnSubAccount

func MatchChangesOnSubAccount(op1 *Operation, op2 *Operation, subAccountType SubAccountType) bool

Types

type Account

type Account struct {
	Address    common.Address
	SubAccount SubAccount
}

func NewAccount

func NewAccount(addr common.Address, subAccount SubAccountType) Account

func NewVotingAccount

func NewVotingAccount(addr common.Address, subAccount SubAccountType, group common.Address) Account

type BalanceChange

type BalanceChange struct {
	Account Account
	Amount  *big.Int
}

type BalanceSet

type BalanceSet struct {
	// contains filtered or unexported fields
}

func NewBalanceSet

func NewBalanceSet() *BalanceSet

func (*BalanceSet) Add

func (bs *BalanceSet) Add(addr common.Address, value *big.Int) *BalanceSet

func (*BalanceSet) ToMap

func (bs *BalanceSet) ToMap() map[common.Address]*big.Int

type ChainParameters

type ChainParameters struct {
	ChainId   *big.Int
	EpochSize uint64
}

func (*ChainParameters) IsLastBlockOfEpoch

func (cp *ChainParameters) IsLastBlockOfEpoch(blockNumber uint64) bool

type Operation

type Operation struct {
	Type       OperationType
	Changes    []BalanceChange
	Successful bool
}

func ComputeEpochRewards

func ComputeEpochRewards(ctx context.Context, cc *client.CeloClient, db db.RosettaDBReader, header *types.Header) (*Operation, error)

func NewActiveVotes

func NewActiveVotes(addr common.Address, group common.Address, value *big.Int) *Operation

func NewAuthorizeSigner added in v0.6.2

func NewAuthorizeSigner(from common.Address, signer common.Address, authorizeOp OperationType) *Operation

func NewCreateAccount added in v0.6.1

func NewCreateAccount(from common.Address) *Operation

func NewEpochRewards

func NewEpochRewards(changes map[common.Address]*big.Int) *Operation

func NewFee

func NewFee(changes map[common.Address]*big.Int) *Operation

func NewLockGold

func NewLockGold(addr common.Address, lockedGoldAddr common.Address, value *big.Int) *Operation

func NewRelockGold

func NewRelockGold(addr common.Address, value *big.Int) *Operation

func NewRevokeActiveVotes

func NewRevokeActiveVotes(addr common.Address, group common.Address, value *big.Int) *Operation

func NewRevokePendingVotes

func NewRevokePendingVotes(addr common.Address, group common.Address, value *big.Int) *Operation

func NewSlash

func NewSlash(slashed common.Address, slasher common.Address, communityFund common.Address, lockedGoldAddr common.Address, penalty *big.Int, reward *big.Int) *Operation

func NewTransfer

func NewTransfer(from common.Address, to common.Address, value *big.Int, successful bool) *Operation

func NewUnlockGold

func NewUnlockGold(addr common.Address, value *big.Int) *Operation

func NewVote

func NewVote(addr common.Address, group common.Address, value *big.Int) *Operation

func NewWithdrawGold

func NewWithdrawGold(addr common.Address, lockedGoldAddr common.Address, value *big.Int) *Operation

type OperationType

type OperationType string
const (
	OpFee                        OperationType = "fee"
	OpTransfer                   OperationType = "transfer"
	OpCreateAccount              OperationType = "createAccount"
	OpAuthorizeVoteSigner        OperationType = "authorizeVoteSigner"
	OpAuthorizeValidatorSigner   OperationType = "authorizeValidatorSigner"
	OpAuthorizeAttestationSigner OperationType = "authorizeAttestationSigner"
	OpLockGold                   OperationType = "lockGold"
	OpUnlockGold                 OperationType = "unlockGold"
	OpRelockGold                 OperationType = "relockGold"
	OpWithdrawGold               OperationType = "withdrawGold"
	OpVote                       OperationType = "vote"
	OpActiveVotes                OperationType = "activateVotes"
	OpRevokePendingVotes         OperationType = "revokePendingVotes"
	OpRevokeActiveVotes          OperationType = "revokeActiveVotes"
	OpSlash                      OperationType = "slash"
	OpEpochRewards               OperationType = "epochRewards"
)

func (OperationType) String

func (ot OperationType) String() string

type SubAccount

type SubAccount struct {
	Identifier SubAccountType
	Metadata   map[string]interface{}
}

type SubAccountType

type SubAccountType string
const (
	AccMain                    SubAccountType = "Main"
	AccSigner                  SubAccountType = "AccountsAuthorizedSigner"
	AccLockedGoldNonVoting     SubAccountType = "LockedGoldNonVoting"
	AccLockedGoldVotingActive  SubAccountType = "LockedGoldVotingActive"
	AccLockedGoldVotingPending SubAccountType = "LockedGoldVotingPending"
	AccLockedGoldPending       SubAccountType = "LockedGoldPending"
)

type Tracer

type Tracer struct {
	// contains filtered or unexported fields
}

func NewTracer

func NewTracer(ctx context.Context, cc *client.CeloClient, db db.RosettaDBReader) *Tracer

func (*Tracer) TraceTransaction

func (tr *Tracer) TraceTransaction(blockHeader *types.Header, tx *types.Transaction, receipt *types.Receipt) ([]Operation, error)

func (*Tracer) TxGasDetails

func (tr *Tracer) TxGasDetails(blockHeader *types.Header, tx *types.Transaction, receipt *types.Receipt) (*Operation, error)

func (*Tracer) TxLockedGoldTransfers

func (tr *Tracer) TxLockedGoldTransfers(blockHeader *types.Header, tx *types.Transaction, receipt *types.Receipt) ([]Operation, error)

func (*Tracer) TxTransfers

func (tr *Tracer) TxTransfers(blockHeader *types.Header, tx *types.Transaction, receipt *types.Receipt) ([]Operation, error)

type Transfer

type Transfer struct {
	From   Account
	To     Account
	Value  *big.Int
	Status bool
}

Jump to

Keyboard shortcuts

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