Documentation
¶
Overview ¶
Copyright (c) 2018 Clearmatics Technologies Ltd
Copyright (c) 2018 Clearmatics Technologies Ltd ¶
Copyright (c) 2018 Clearmatics Technologies Ltd ¶
Copyright (c) 2018 Clearmatics Technologies Ltd
Index ¶
- func BlockNumberByTransactionHash(ctx context.Context, c *rpc.Client, txHash common.Hash) (*string, *types.Transaction, error)
- func Client(url string) *ethclient.Client
- func ClientRPC(url string) *rpc.Client
- func ConvertAndAppend(c *ishell.Context, input string, argument *abi.Argument, output []interface{}) ([]interface{}, error)
- func ConvertToBool(value string) (bool, error)
- func ConvertToInt(signed bool, size int, value string) (interface{}, error)
- func ConvertToType(str string, typ *abi.Type) (interface{}, error)
- func EncodeBlock(blockInterface interface{}) (h []byte)
- func EncodeExtraData(blockHeader Header) (prefix []byte)
- func EncodePrefix(blockHeader Header) (prefix []byte)
- func GenerateInterface(blockHeader Header) (rest interface{})
- func GenerateProof(ctx context.Context, client *rpc.Client, txHash common.Hash) (txTriggerPath []byte, txTriggerRLP []byte, txTriggerProofArr []byte, ...)
- func GetBlockTxReceipts(ec *ethclient.Client, block *types.Block) []*types.Receipt
- func GetNonce(client *ethclient.Client, auth *bind.TransactOpts)
- func Proof(trie *trie.Trie, path []byte) []byte
- func ReceiptTrie(receipts []*types.Receipt) *trie.Trie
- func StringToBytes32(input string) (output [32]byte, err error)
- func TxTrie(transactions []*types.Transaction) *trie.Trie
- type Header
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockNumberByTransactionHash ¶
func BlockNumberByTransactionHash(ctx context.Context, c *rpc.Client, txHash common.Hash) (*string, *types.Transaction, error)
BlockNumberByTransactionHash gets a block number by a transaction hash in that block
func ClientRPC ¶
ClientRPC RPC Client gets an RPC client (useful to get the block number out of a transaction)
func ConvertAndAppend ¶
func ConvertToBool ¶
MUST CHECK RETURNED ERROR ELSE WILL RETURN FALSE FOR ANY ERRONEOUS INPUT
func EncodeExtraData ¶
EncodeExtraData calculate prefix of the extraData with the signature
func EncodePrefix ¶
EncodePrefix calculate prefix of the entire signed block
func GenerateInterface ¶
func GenerateInterface(blockHeader Header) (rest interface{})
GenerateInterface Creates an interface for a block
func GenerateProof ¶
func GetBlockTxReceipts ¶
GetBlockTxReceipts get the receipts for all the transactions in a block
func ReceiptTrie ¶
ReceiptTrie generate trie for receipts TODO: the argument should be of type interface so that this is a generic function
func StringToBytes32 ¶
Needed to convert transaction strings into the correct format
Types ¶
type Header ¶
type Header struct {
ParentHash string `json:"parentHash"`
UncleHash string `json:"sha3Uncles"`
Coinbase string `json:"miner"`
Root string `json:"stateRoot"`
TxHash string `json:"transactionsRoot"`
ReceiptHash string `json:"receiptsRoot"`
Bloom string `json:"logsBloom"`
Difficulty string `json:"difficulty"`
Number string `json:"number"`
GasLimit string `json:"gasLimit"`
GasUsed string `json:"gasUsed"`
Time string `json:"timestamp"`
Extra string `json:"extraData"`
MixDigest string `json:"mixHash"`
Nonce string `json:"nonce"`
}
Header used to marshall blocks into a string based struct