Documentation ¶
Index ¶
- Variables
- func GetTransactionType(to, input string, internal bool) models.TransactionType
- func ParseInt(s string) (v int64)
- func ParseUInt(s string) (v uint64)
- type Action
- type Block
- type Client
- type ClientMock
- func (c *ClientMock) AddLogsFromJson(trx_json string)
- func (c *ClientMock) AddTracesFromJson(hash, traces_json string)
- func (c *ClientMock) AddTransactionFromJson(trx_json string)
- func (c *ClientMock) Close()
- func (c *ClientMock) GetBalanceAtBlock(address string, blockNumber uint64) (balance string, err error)
- func (c *ClientMock) GetBlockByNumber(number uint64) (blk Block, err error)
- func (c *ClientMock) GetChainStats() (ns storage.FinalizationData, err error)
- func (c *ClientMock) GetDagBlockByHash(hash string) (dag DagBlock, err error)
- func (c *ClientMock) GetGenesis() (genesis GenesisObject, err error)
- func (c *ClientMock) GetLatestPeriod() (p uint64, e error)
- func (c *ClientMock) GetPbftBlockWithDagBlocks(period uint64) (pbftWithDags PbftBlockWithDags, err error)
- func (c *ClientMock) GetPeriodDagBlocks(period uint64) (dags []DagBlock, err error)
- func (c *ClientMock) GetPeriodTransactions(p uint64) (trx []Transaction, err error)
- func (c *ClientMock) GetPreviousBlockCertVotes(period uint64) (vr VotesResponse, err error)
- func (c *ClientMock) GetTransactionByHash(hash string) (trx Transaction, err error)
- func (c *ClientMock) GetValidatorsAtBlock(uint64) (validators []dpos_interface.DposInterfaceValidatorData, err error)
- func (c *ClientMock) SubscribeNewHeads() (chan Block, *rpc.ClientSubscription, error)
- func (c *ClientMock) TraceBlockTransactions(num uint64) (traces []TransactionTrace, err error)
- type DagBlock
- type DposConfig
- type EventLog
- type GenesisObject
- type PbftBlockWithDags
- type PbftConfig
- type TraceEntry
- type TraceEntryResult
- type Transaction
- type TransactionTrace
- type Vote
- type VotesResponse
- type WsClient
- func (client *WsClient) Close()
- func (client *WsClient) GetBalanceAtBlock(address string, blockNumber uint64) (balance string, err error)
- func (client *WsClient) GetBlockByNumber(number uint64) (blk Block, err error)
- func (client *WsClient) GetChainId() *big.Int
- func (client *WsClient) GetChainStats() (fd storage.FinalizationData, err error)
- func (client *WsClient) GetDagBlockByHash(hash string) (dag DagBlock, err error)
- func (client *WsClient) GetGenesis() (genesis GenesisObject, err error)
- func (client *WsClient) GetLatestPeriod() (uint64, error)
- func (client *WsClient) GetPbftBlockWithDagBlocks(period uint64) (pbftWithDags PbftBlockWithDags, err error)
- func (client *WsClient) GetPeriodDagBlocks(period uint64) (dags []DagBlock, err error)
- func (client *WsClient) GetPeriodTransactions(number uint64) (trxs []Transaction, err error)
- func (client *WsClient) GetPreviousBlockCertVotes(period uint64) (vr VotesResponse, err error)
- func (client *WsClient) GetTransactionByHash(hash string) (trx Transaction, err error)
- func (client *WsClient) GetValidatorsAtBlock(block_num uint64) (validators []dpos_interface.DposInterfaceValidatorData, err error)
- func (client *WsClient) SubscribeNewHeads() (chan Block, *rpc.ClientSubscription, error)
- func (client *WsClient) TraceBlockTransactions(number uint64) (traces []TransactionTrace, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotImplemented = fmt.Errorf("Not implemented")
Functions ¶
func GetTransactionType ¶ added in v0.2.1
func GetTransactionType(to, input string, internal bool) models.TransactionType
Types ¶
type Block ¶
type Client ¶ added in v0.2.1
type Client interface { GetBlockByNumber(number uint64) (blk Block, err error) GetLatestPeriod() (uint64, error) TraceBlockTransactions(number uint64) (traces []TransactionTrace, err error) GetTransactionByHash(hash string) (trx Transaction, err error) GetPeriodTransactions(period uint64) (trxs []Transaction, err error) GetPbftBlockWithDagBlocks(period uint64) (pbftWithDags PbftBlockWithDags, err error) GetDagBlockByHash(hash string) (dag DagBlock, err error) GetPeriodDagBlocks(period uint64) (dags []DagBlock, err error) GetPreviousBlockCertVotes(period uint64) (vr VotesResponse, err error) GetValidatorsAtBlock(block_num uint64) (validators []dpos_interface.DposInterfaceValidatorData, err error) GetGenesis() (genesis GenesisObject, err error) GetChainStats() (ns storage.FinalizationData, err error) SubscribeNewHeads() (chan Block, *rpc.ClientSubscription, error) GetBalanceAtBlock(address string, blockNumber uint64) (balance string, err error) // Close disconnects from the node Close() }
type ClientMock ¶ added in v0.2.1
type ClientMock struct { Traces map[string][]TransactionTrace Transactions map[string]Transaction BlockTransactions map[uint64][]string EventLogs map[string][]EventLog }
func MakeMockClient ¶ added in v0.2.1
func MakeMockClient() *ClientMock
func (*ClientMock) AddLogsFromJson ¶ added in v0.2.1
func (c *ClientMock) AddLogsFromJson(trx_json string)
func (*ClientMock) AddTracesFromJson ¶ added in v0.2.1
func (c *ClientMock) AddTracesFromJson(hash, traces_json string)
func (*ClientMock) AddTransactionFromJson ¶ added in v0.2.1
func (c *ClientMock) AddTransactionFromJson(trx_json string)
func (*ClientMock) Close ¶ added in v0.2.1
func (c *ClientMock) Close()
func (*ClientMock) GetBalanceAtBlock ¶ added in v0.2.1
func (c *ClientMock) GetBalanceAtBlock(address string, blockNumber uint64) (balance string, err error)
func (*ClientMock) GetBlockByNumber ¶ added in v0.2.1
func (c *ClientMock) GetBlockByNumber(number uint64) (blk Block, err error)
func (*ClientMock) GetChainStats ¶ added in v0.2.1
func (c *ClientMock) GetChainStats() (ns storage.FinalizationData, err error)
func (*ClientMock) GetDagBlockByHash ¶ added in v0.2.1
func (c *ClientMock) GetDagBlockByHash(hash string) (dag DagBlock, err error)
func (*ClientMock) GetGenesis ¶ added in v0.2.1
func (c *ClientMock) GetGenesis() (genesis GenesisObject, err error)
func (*ClientMock) GetLatestPeriod ¶ added in v0.2.1
func (c *ClientMock) GetLatestPeriod() (p uint64, e error)
func (*ClientMock) GetPbftBlockWithDagBlocks ¶ added in v0.2.1
func (c *ClientMock) GetPbftBlockWithDagBlocks(period uint64) (pbftWithDags PbftBlockWithDags, err error)
func (*ClientMock) GetPeriodDagBlocks ¶ added in v0.2.1
func (c *ClientMock) GetPeriodDagBlocks(period uint64) (dags []DagBlock, err error)
func (*ClientMock) GetPeriodTransactions ¶ added in v0.2.1
func (c *ClientMock) GetPeriodTransactions(p uint64) (trx []Transaction, err error)
func (*ClientMock) GetPreviousBlockCertVotes ¶ added in v0.2.1
func (c *ClientMock) GetPreviousBlockCertVotes(period uint64) (vr VotesResponse, err error)
func (*ClientMock) GetTransactionByHash ¶ added in v0.2.1
func (c *ClientMock) GetTransactionByHash(hash string) (trx Transaction, err error)
func (*ClientMock) GetValidatorsAtBlock ¶ added in v0.2.1
func (c *ClientMock) GetValidatorsAtBlock(uint64) (validators []dpos_interface.DposInterfaceValidatorData, err error)
func (*ClientMock) SubscribeNewHeads ¶ added in v0.2.1
func (c *ClientMock) SubscribeNewHeads() (chan Block, *rpc.ClientSubscription, error)
func (*ClientMock) TraceBlockTransactions ¶ added in v0.2.1
func (c *ClientMock) TraceBlockTransactions(num uint64) (traces []TransactionTrace, err error)
type DagBlock ¶ added in v0.2.1
type DposConfig ¶ added in v0.2.1
type DposConfig struct { BlocksPerYear string `json:"blocks_per_year"` DagProposersReward string `json:"dag_proposers_reward"` MaxBlockAuthorReward string `json:"max_block_author_reward"` YieldPercentage string `json:"yield_percentage"` InitialValidators []initialValidator `json:"initial_validators"` }
type GenesisObject ¶
type GenesisObject struct { DagGenesisBlock DagBlock `json:"dag_genesis_block"` InitialBalances map[string]string `json:"initial_balances"` Pbft PbftConfig `json:"pbft"` Dpos DposConfig `json:"dpos"` }
func (*GenesisObject) ToChainConfig ¶ added in v0.2.1
func (g *GenesisObject) ToChainConfig() (c *common.ChainConfig)
type PbftBlockWithDags ¶ added in v0.2.1
type PbftConfig ¶ added in v0.2.1
type TraceEntry ¶ added in v0.2.1
type TraceEntry struct { Action Action `json:"action"` Subtraces uint16 `json:"subtraces"` TraceAddress []uint16 `json:"traceAddress"` Type string `json:"type"` Result TraceEntryResult `json:"result"` }
type TraceEntryResult ¶ added in v0.2.1
type Transaction ¶ added in v0.2.1
type Transaction struct { models.Transaction Logs []EventLog `json:"logs"` BlockNumber string `json:"blockNumber"` Nonce string `json:"nonce"` GasPrice string `json:"gasPrice"` GasUsed string `json:"gasUsed"` Status string `json:"status"` TransactionIndex string `json:"transactionIndex"` Input string `json:"input"` ContractAddress string `json:"contractAddress"` }
func (*Transaction) ExtractLogs ¶ added in v0.2.1
func (t *Transaction) ExtractLogs() (logs []models.EventLog)
func (*Transaction) GetFee ¶ added in v0.2.1
func (t *Transaction) GetFee() *big.Int
func (*Transaction) ToModelWithTimestamp ¶ added in v0.2.1
func (t *Transaction) ToModelWithTimestamp(timestamp uint64) (trx models.Transaction)
type TransactionTrace ¶ added in v0.2.1
type TransactionTrace struct {
Trace []TraceEntry `json:"trace"`
}
type VotesResponse ¶ added in v0.2.1
type WsClient ¶
WsClient is a struct that connects to a Taraxa node.
func NewWsClient ¶
NewWsClient creates a new instance of the WsClient struct.
func (*WsClient) GetBalanceAtBlock ¶ added in v0.2.1
func (*WsClient) GetBlockByNumber ¶
func (*WsClient) GetChainId ¶ added in v0.2.1
func (*WsClient) GetChainStats ¶
func (client *WsClient) GetChainStats() (fd storage.FinalizationData, err error)
func (*WsClient) GetDagBlockByHash ¶
func (*WsClient) GetGenesis ¶
func (client *WsClient) GetGenesis() (genesis GenesisObject, err error)
func (*WsClient) GetLatestPeriod ¶
func (*WsClient) GetPbftBlockWithDagBlocks ¶
func (client *WsClient) GetPbftBlockWithDagBlocks(period uint64) (pbftWithDags PbftBlockWithDags, err error)
func (*WsClient) GetPeriodDagBlocks ¶ added in v0.2.1
func (*WsClient) GetPeriodTransactions ¶ added in v0.2.1
func (client *WsClient) GetPeriodTransactions(number uint64) (trxs []Transaction, err error)
func (*WsClient) GetPreviousBlockCertVotes ¶ added in v0.2.1
func (client *WsClient) GetPreviousBlockCertVotes(period uint64) (vr VotesResponse, err error)
func (*WsClient) GetTransactionByHash ¶
func (client *WsClient) GetTransactionByHash(hash string) (trx Transaction, err error)
TODO: Optimize this. We are making two requests here, so its pretty slow
func (*WsClient) GetValidatorsAtBlock ¶ added in v0.2.1
func (client *WsClient) GetValidatorsAtBlock(block_num uint64) (validators []dpos_interface.DposInterfaceValidatorData, err error)
func (*WsClient) SubscribeNewHeads ¶
func (client *WsClient) SubscribeNewHeads() (chan Block, *rpc.ClientSubscription, error)
func (*WsClient) TraceBlockTransactions ¶ added in v0.2.1
func (client *WsClient) TraceBlockTransactions(number uint64) (traces []TransactionTrace, err error)
Click to show internal directories.
Click to hide internal directories.