codec

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Copyright 2019 dfuse Platform Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2019 dfuse Platform Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountRAMDeltasToEOS

func AccountRAMDeltasToEOS(deltas []*pbcodec.AccountRAMDelta) (out []*zsw.AccountRAMDelta)

func ActionToEOS

func ActionToEOS(action *pbcodec.Action) (out *zsw.Action)

func ActionTraceToEOS

func ActionTraceToEOS(in *pbcodec.ActionTrace) (out zsw.ActionTrace)

func ActionTracesToEOS

func ActionTracesToEOS(actionTraces []*pbcodec.ActionTrace) (out []zsw.ActionTrace)

func AuthSequenceListToEOS

func AuthSequenceListToEOS(in []*pbcodec.AuthSequence) (out []zsw.TransactionTraceAuthSequence)

func AuthSequenceToEOS

func AuthSequenceToEOS(in *pbcodec.AuthSequence) zsw.TransactionTraceAuthSequence

func AuthoritiesToEOS

func AuthoritiesToEOS(authority *pbcodec.Authority) zsw.Authority

func AuthorizationToEOS

func AuthorizationToEOS(authorization []*pbcodec.PermissionLevel) (out []zsw.PermissionLevel)

func BlockDecoder

func BlockDecoder(blk *bstream.Block) (interface{}, error)

BlockDecoder transforms a `bstream.Block` payload into a proper `deth.Block` value

func BlockFromProto

func BlockFromProto(b *pbcodec.Block) (*bstream.Block, error)

func BlockHeaderToEOS

func BlockHeaderToEOS(in *pbcodec.BlockHeader) *zsw.BlockHeader

func BlockReaderFactory

func BlockReaderFactory(reader io.Reader) (bstream.BlockReader, error)

func BlockSigningAuthorityToEOS

func BlockSigningAuthorityToEOS(in *pbcodec.BlockSigningAuthority) *zsw.BlockSigningAuthority

func BlockWriterFactory

func BlockWriterFactory(writer io.Writer) (bstream.BlockWriter, error)

func BlockstoreStartBlockResolver

func BlockstoreStartBlockResolver(blocksStore dstore.Store) bstream.StartBlockResolver

func ChecksumToEOS

func ChecksumToEOS(in string) zsw.Checksum256

func DeduplicateTransactionTrace

func DeduplicateTransactionTrace(trx *pbcodec.TransactionTrace)

func ErrorCodeToEOS

func ErrorCodeToEOS(in uint64) *zsw.Uint64

func ExceptionToEOS

func ExceptionToEOS(in *pbcodec.Exception) *zsw.Except

func ExtensionsToEOS

func ExtensionsToEOS(in []*pbcodec.Extension) (out []*zsw.Extension)

func ExtractEOSSignedTransactionFromReceipt

func ExtractEOSSignedTransactionFromReceipt(trxReceipt *pbcodec.TransactionReceipt) (*zsw.SignedTransaction, error)

func KeyWeightsPToEOS

func KeyWeightsPToEOS(keys []*pbcodec.KeyWeight) (out []*zsw.KeyWeight)

func KeyWeightsToEOS

func KeyWeightsToEOS(keys []*pbcodec.KeyWeight) (out []zsw.KeyWeight)

func LogContextToEOS

func LogContextToEOS(in *pbcodec.Exception_LogContext) *zsw.ExceptLogContext

func PermissionLevelToEOS

func PermissionLevelToEOS(perm *pbcodec.PermissionLevel) zsw.PermissionLevel

func PermissionLevelWeightsToEOS

func PermissionLevelWeightsToEOS(weights []*pbcodec.PermissionLevelWeight) (out []zsw.PermissionLevelWeight)

func ProducerAuthoritiesToEOS

func ProducerAuthoritiesToEOS(producerAuthorities []*pbcodec.ProducerAuthority) (out []*zsw.ProducerAuthority)

func ProducerAuthorityScheduleToEOS

func ProducerAuthorityScheduleToEOS(in *pbcodec.ProducerAuthoritySchedule) *zsw.ProducerAuthoritySchedule

func ProducerKeysToEOS

func ProducerKeysToEOS(in []*pbcodec.ProducerKey) (out []zsw.ProducerKey)

func ProducerScheduleToEOS

func ProducerScheduleToEOS(in *pbcodec.ProducerSchedule) *zsw.ProducerSchedule

func PublicKeysToEOS

func PublicKeysToEOS(in []string) (out []*ecc.PublicKey)

func ReduplicateTransactionTrace

func ReduplicateTransactionTrace(trx *pbcodec.TransactionTrace)

func SignaturesToEOS

func SignaturesToEOS(in []string) []ecc.Signature

func SignedTransactionToEOS

func SignedTransactionToEOS(trx *pbcodec.SignedTransaction) *zsw.SignedTransaction

func TimestampToBlockTimestamp

func TimestampToBlockTimestamp(in *timestamp.Timestamp) zsw.BlockTimestamp

func TimestampToJSONTime

func TimestampToJSONTime(in *timestamp.Timestamp) zsw.JSONTime

func TransactionHeaderToEOS

func TransactionHeaderToEOS(trx *pbcodec.TransactionHeader) *zsw.TransactionHeader

func TransactionReceiptHeaderToEOS

func TransactionReceiptHeaderToEOS(in *pbcodec.TransactionReceiptHeader) *zsw.TransactionReceiptHeader

func TransactionStatusToEOS

func TransactionStatusToEOS(in pbcodec.TransactionStatus) zsw.TransactionStatus

func TransactionToEOS

func TransactionToEOS(trx *pbcodec.Transaction) *zsw.Transaction

func TransactionTraceToEOS

func TransactionTraceToEOS(in *pbcodec.TransactionTrace) (out *zsw.TransactionTrace)

func WaitWeightsToEOS

func WaitWeightsToEOS(waits []*pbcodec.WaitWeight) (out []zsw.WaitWeight)

Types

type ABICache

type ABICache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type ABIDecoder

type ABIDecoder struct {
	// contains filtered or unexported fields
}

ABIDecoder holds the ABI cache, controls it and process transaction on the fly parallel decoding the various elements that needs ABI decoding in-place in the data structure.

The ABI decoder is the one that controls the locking of the cache, so all locking of the cache should be performed by the decoder. The idea here is to have full control of the locking, so we can write-lock the cache and add multiple ABIs inside a single locking session, than resume with the read. That is to improve lock-contention.

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)

func (*BlockReader) Read

func (l *BlockReader) Read() (*bstream.Block, 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)

func (*BlockWriter) Write

func (w *BlockWriter) Write(block *bstream.Block) error

type ConsoleReader

type ConsoleReader struct {
	// contains filtered or unexported fields
}

ConsoleReader is what reads the `nodeos` output directly. It builds up some LogEntry objects. See `LogReader to read those entries .

func NewConsoleReader

func NewConsoleReader(reader io.Reader, opts ...ConsoleReaderOption) (*ConsoleReader, error)

TODO: At some point, the interface of a ConsoleReader should be re-done.

Indeed, the `ConsoleReader` could simply receive each line already split
since the upstream caller is already doing this job it self. This way, we
would have a single split job instead of two. Only the upstream would split
the line and the console reader would simply process each line, one at a time.

func (*ConsoleReader) Close

func (l *ConsoleReader) Close()

func (*ConsoleReader) Done

func (l *ConsoleReader) Done() <-chan interface{}

func (*ConsoleReader) Read

func (l *ConsoleReader) Read() (out interface{}, err error)

type ConsoleReaderOption

type ConsoleReaderOption interface {
	// contains filtered or unexported methods
}

func LimitConsoleLength

func LimitConsoleLength(maxByteCount int) ConsoleReaderOption

LimitConsoleLength ensure that `Console` field on `pbcodec.ActionTrace` are never bigger than `maxByteCount` bytes.

This is sadly incomplete as failing deferred transaction can still log out of band via the standard nodeos logging mecanism.

type PermOp

type PermOp struct {
	Operation   string            `json:"op"`
	ActionIndex int               `json:"action_idx"`
	OldPerm     *permissionObject `json:"old,omitempty"`
	NewPerm     *permissionObject `json:"new,omitempty"`
}

type Specification

type Specification struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type SubjectiveRestrictions

type SubjectiveRestrictions struct {
	Enable                        bool         `json:"enable"`
	PreactivationRequired         bool         `json:"preactivation_required"`
	EarliestAllowedActivationTime zsw.JSONTime `json:"earliest_allowed_activation_time"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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