blockchain

package
v0.0.0-...-f23e49c Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAddress = errors.New("invalid address")

ErrInvalidAddress signals that the provided address is invalid

View Source
var ErrNilAddress = errors.New("nil address")

ErrNilAddress signals that the provided address is nil

View Source
var ErrNilShardCoordinator = errors.New("nil shard coordinator")

ErrNilShardCoordinator signals that the provided shard coordinator is nil

Functions

func NewAddressGenerator

func NewAddressGenerator(coordinator *shardCoordinator) (*addressGenerator, error)

NewAddressGenerator

func NewElrondProxy

func NewElrondProxy(url string, client HTTPClient) *elrondProxy

NewElrondProxy initializes and returns an ElrondProxy object

func NewShardCoordinator

func NewShardCoordinator(numOfShardsWithoutMeta uint32, currentShard uint32) (*shardCoordinator, error)

NewShardCoordinator returns a shard coordinator instance that is able to execute sharding-related operations

Types

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is the interface we expect to call in order to do the HTTP requests

type ProxyHandler

type ProxyHandler interface {
	ExecuteVMQuery(vmRequest *data.VmValueRequest) (*data.VmValuesResponseData, error)
	GetNetworkConfig() (*data.NetworkConfig, error)
	GetNetworkEconomics() (*data.NetworkEconomics, error)
	GetAccount(address addressHandler) (*data.Account, error)
	SendTransaction(tx *data.Transaction) (string, error)
	RequestTransactionCost(tx *data.Transaction) (*data.TxCostResponseData, error)
	GetTransactionStatus(hash string) (string, error)
	GetTransactionInfo(hash string) (*data.TransactionInfo, error)
	GetTransactionInfoWithResults(hash string) (*data.TransactionInfo, error)
	GetLatestHyperblockNonce() (uint64, error)
	GetHyperblockByNonce(nonce uint64) (*data.Hyperblock, error)
	GetHyperblockByHash(hash string) (*data.Hyperblock, error)
}

ProxyHandler will handle different implementations of proxy client

Jump to

Keyboard shortcuts

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