outport

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: GPL-3.0 Imports: 3 Imported by: 7 modules, 60 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransactionHandlerWithGasAndFee

func NewTransactionHandlerWithGasAndFee(txHandler data.TransactionHandler, gasUsed uint64, fee *big.Int) data.TransactionHandlerWithGasUsedAndFee

NewTransactionHandlerWithGasAndFee returns a new instance of transactionHandlerWithGasAndFee which matches the interface

func WrapTxsMap

WrapTxsMap will wrap the provided transactions map in a map fo transactions with fee and gas used

Types

type AccountTokenData

type AccountTokenData struct {
	Nonce          uint64                      `json:"nonce"`
	Identifier     string                      `json:"identifier"`
	Balance        string                      `json:"balance"`
	Properties     string                      `json:"properties"`
	MetaData       *TokenMetaData              `json:"metadata,omitempty"`
	AdditionalData *AdditionalAccountTokenData `json:"additionalData,omitempty"`
}

AccountTokenData holds the data needed for indexing a token of an altered account

type AdditionalAccountData

type AdditionalAccountData struct {
	IsSender         bool   `json:"isSender,omitempty"`
	BalanceChanged   bool   `json:"balanceChanged,omitempty"`
	CurrentOwner     string `json:"currentOwner,omitempty"`
	UserName         string `json:"userName,omitempty"`
	DeveloperRewards string `json:"developerRewards,omitempty"`
}

AdditionalAccountData holds the additional data for an altered account

type AdditionalAccountTokenData

type AdditionalAccountTokenData struct {
	IsNFTCreate bool `json:"isNFTCreate,omitempty"`
}

AdditionalAccountTokenData holds the additional data for indexing a token of an altered account

type AlteredAccount

type AlteredAccount struct {
	Nonce          uint64                 `json:"nonce"`
	Address        string                 `json:"address"`
	Balance        string                 `json:"balance,omitempty"`
	Tokens         []*AccountTokenData    `json:"tokens"`
	AdditionalData *AdditionalAccountData `json:"additionalData,omitempty"`
}

AlteredAccount holds the data needed of an altered account in a block

type ArgsSaveBlockData

type ArgsSaveBlockData struct {
	HeaderHash             []byte
	Body                   data.BodyHandler
	Header                 data.HeaderHandler
	SignersIndexes         []uint64
	NotarizedHeadersHashes []string
	HeaderGasConsumption   HeaderGasConsumption
	TransactionsPool       *Pool
	AlteredAccounts        map[string]*AlteredAccount
	NumberOfShards         uint32
	IsImportDB             bool
}

ArgsSaveBlockData will contain all information that are needed to save block data

type FeeInfo

type FeeInfo struct {
	GasUsed        uint64
	Fee            *big.Int
	InitialPaidFee *big.Int
}

FeeInfo holds information about the fee and gas used

type HeaderGasConsumption

type HeaderGasConsumption struct {
	GasProvided    uint64
	GasRefunded    uint64
	GasPenalized   uint64
	MaxGasPerBlock uint64
}

HeaderGasConsumption holds the data needed to save the gas consumption of a header

type Pool

type Pool struct {
	Txs                                        map[string]data.TransactionHandlerWithGasUsedAndFee
	Scrs                                       map[string]data.TransactionHandlerWithGasUsedAndFee
	Rewards                                    map[string]data.TransactionHandlerWithGasUsedAndFee
	Invalid                                    map[string]data.TransactionHandlerWithGasUsedAndFee
	Receipts                                   map[string]data.TransactionHandlerWithGasUsedAndFee
	Logs                                       []*data.LogData
	ScheduledExecutedSCRSHashesPrevBlock       []string
	ScheduledExecutedInvalidTxsHashesPrevBlock []string
}

Pool will hold all types of transaction

type RoundInfo

type RoundInfo struct {
	Index            uint64
	SignersIndexes   []uint64
	BlockWasProposed bool
	ShardId          uint32
	Epoch            uint32
	Timestamp        time.Duration
}

RoundInfo is a structure containing block signers and shard id

type TokenMetaData

type TokenMetaData struct {
	Nonce      uint64   `json:"nonce"`
	Name       string   `json:"name"`
	Creator    string   `json:"creator"`
	Royalties  uint32   `json:"royalties"`
	Hash       []byte   `json:"hash"`
	URIs       [][]byte `json:"uris"`
	Attributes []byte   `json:"attributes"`
}

TokenMetaData is the api metaData struct for tokens

type TransactionHandlerWithGasAndFee

type TransactionHandlerWithGasAndFee struct {
	data.TransactionHandler
	FeeInfo
	ExecutionOrder int
}

TransactionHandlerWithGasAndFee holds a data.TransactionHandler and information about fee and gas used

func (*TransactionHandlerWithGasAndFee) GetExecutionOrder

func (t *TransactionHandlerWithGasAndFee) GetExecutionOrder() int

GetExecutionOrder will return the execution order of the TransactionHandler

func (*TransactionHandlerWithGasAndFee) GetFee

GetFee returns the fee of the transaction

func (*TransactionHandlerWithGasAndFee) GetGasUsed

func (t *TransactionHandlerWithGasAndFee) GetGasUsed() uint64

GetGasUsed returns the used gas of the transaction

func (*TransactionHandlerWithGasAndFee) GetInitialPaidFee

func (t *TransactionHandlerWithGasAndFee) GetInitialPaidFee() *big.Int

GetInitialPaidFee returns the initial paid fee of the transactions

func (*TransactionHandlerWithGasAndFee) GetTxHandler

GetTxHandler will return the TransactionHandler

func (*TransactionHandlerWithGasAndFee) SetExecutionOrder

func (t *TransactionHandlerWithGasAndFee) SetExecutionOrder(order int)

SetExecutionOrder will set the execution order of the TransactionHandler

func (*TransactionHandlerWithGasAndFee) SetFee

func (t *TransactionHandlerWithGasAndFee) SetFee(fee *big.Int)

SetFee sets the fee internally

func (*TransactionHandlerWithGasAndFee) SetGasUsed

func (t *TransactionHandlerWithGasAndFee) SetGasUsed(gasUsed uint64)

SetGasUsed sets the used gas internally

func (*TransactionHandlerWithGasAndFee) SetInitialPaidFee

func (t *TransactionHandlerWithGasAndFee) SetInitialPaidFee(fee *big.Int)

SetInitialPaidFee will set the initial paid fee

type ValidatorRatingInfo

type ValidatorRatingInfo struct {
	PublicKey string
	Rating    float32
}

ValidatorRatingInfo is a structure containing validator rating information

Jump to

Keyboard shortcuts

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