Documentation
¶
Index ¶
- func BlockDecoder(blk *bstream.Block) (interface{}, error)
- func BlockFromProto(b *pbcodec.Block) (*bstream.Block, error)
- func CanonicalHex(input string) string
- func ConcatHex(with0x bool, in ...string) (out string)
- func DecodeHex(input string) ([]byte, error)
- func FromHeader(header *BlockHeader) *pbcodec.BlockHeader
- func FromHex(input string, tag string) []byte
- func FromInt32(input string, tag string) int32
- func FromUint32(input string, tag string) uint32
- func FromUint64(input string, tag string) uint64
- func Has0xPrefix(input string) bool
- func MustBalanceChangeReasonFromString(reason string) pbcodec.BalanceChange_Reason
- func MustGasChangeReasonFromString(reason string) pbcodec.GasChange_Reason
- func MustGasEventIDFromString(reason string) pbcodec.GasEvent_Id
- func PBcodecLogToEOS(pblog *pbcodec.Log) *eth.Log
- func PrefixedHex(input string) string
- func SanitizeHex(input string) string
- func SplitInBoundedChunks(line string, count int) ([]string, error)
- func SplitInChunks(line string, count int) ([]string, error)
- func ToTimestamp(t time.Time) *tspb.Timestamp
- type BlockHeader
- type BlockReader
- type BlockWriter
- type ConsoleReader
- type Hash
- type HexBytes
- type Log
- type NilProducer
- type Producer
- type Uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockDecoder ¶
func CanonicalHex ¶
CanonicalHex receives an input and return it's canonical form, i.e. the single unique well-formed which in our case is an all-lower case version with even number of characters.
The only differences with `SanitizeHexInput` here is an additional call to `strings.ToLower` before returning the result.
func FromHeader ¶
func FromHeader(header *BlockHeader) *pbcodec.BlockHeader
func FromUint32 ¶
func FromUint64 ¶
func Has0xPrefix ¶
func MustBalanceChangeReasonFromString ¶
func MustBalanceChangeReasonFromString(reason string) pbcodec.BalanceChange_Reason
func MustGasChangeReasonFromString ¶
func MustGasChangeReasonFromString(reason string) pbcodec.GasChange_Reason
func MustGasEventIDFromString ¶
func MustGasEventIDFromString(reason string) pbcodec.GasEvent_Id
func PBcodecLogToEOS ¶
func PrefixedHex ¶
PrefixedHex is CanonicalHex but with 0x prefix
func SanitizeHex ¶
SanitizeHex removes the prefix `0x` if it exists and ensures there is an even number of characters in the string, padding on the left of the string is it's not the case.
func SplitInBoundedChunks ¶
splitInBoundedChunks split the line in `count` chunks and returns the slice `chunks[1:count]` (so exclusive end), but will accumulate all trailing chunks within the last (for free-form strings, or JSON objects)
func SplitInChunks ¶
splitInChunks split the line in `count` chunks and returns the slice `chunks[1:count]` (so exclusive end), but verifies that there are only exactly `count` chunks, and nothing more.
Types ¶
type BlockHeader ¶
type BlockHeader struct {
Hash HexBytes `json:"hash"`
ParentHash HexBytes `json:"parentHash"`
UncleHash HexBytes `json:"sha3Uncles"`
Coinbase HexBytes `json:"miner"`
Root HexBytes `json:"stateRoot"`
TxHash HexBytes `json:"transactionsRoot"`
ReceiptHash HexBytes `json:"receiptsRoot"`
Bloom HexBytes `json:"logsBloom"`
Difficulty HexBytes `json:"difficulty"`
Number Uint64 `json:"number"`
GasLimit Uint64 `json:"gasLimit"`
GasUsed Uint64 `json:"gasUsed"`
Time Uint64 `json:"timestamp"`
Extra HexBytes `json:"extraData"`
MixDigest HexBytes `json:"mixHash"`
Nonce Uint64 `json:"nonce"`
}
type BlockReader ¶
type BlockReader struct {
// contains filtered or unexported fields
}
BlockReader reads the dbin format where each element is assumed to be a `bstream.Block`.
func NewBlockReader ¶
func NewBlockReader(reader io.Reader) (out *BlockReader, err error)
type BlockWriter ¶
type BlockWriter struct {
// contains filtered or unexported fields
}
BlockWriter reads the dbin format where each element is assumed to be a `bstream.Block`.
func NewBlockWriter ¶
func NewBlockWriter(writer io.Writer) (*BlockWriter, error)
type ConsoleReader ¶
type ConsoleReader struct {
// contains filtered or unexported fields
}
ConsoleReader is what reads the `geth` output directly. It builds up some LogEntry objects. See `LogReader to read those entries .
func NewConsoleReader ¶
func NewConsoleReader(lines chan string, producer Producer) (*ConsoleReader, error)
func (*ConsoleReader) Close ¶
func (c *ConsoleReader) Close()
func (*ConsoleReader) ProcessData ¶
func (c *ConsoleReader) ProcessData(reader io.Reader) error
func (*ConsoleReader) ReadBlock ¶
func (c *ConsoleReader) ReadBlock() (out *bstream.Block, err error)
func (ConsoleReader) ReadTransaction ¶
func (c ConsoleReader) ReadTransaction() (trace *pbcodec.TransactionTrace, err error)
type NilProducer ¶
type NilProducer struct{}
func (NilProducer) Send ¶
func (n NilProducer) Send(block *pbcodec.Block)