codec

package
v0.1.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountRAMDeltasToDEOS

func AccountRAMDeltasToDEOS(deltas []*eos.AccountRAMDelta) (out []*pbcodec.AccountRAMDelta)

func AccountRAMDeltasToEOS

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

func ActionToDEOS

func ActionToDEOS(action *eos.Action) *pbcodec.Action

func ActionToEOS

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

func ActionTraceToDEOS

func ActionTraceToDEOS(in eos.ActionTrace, execIndex uint32) (out *pbcodec.ActionTrace)

func ActionTraceToEOS

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

func ActionTracesToDEOS

func ActionTracesToDEOS(actionTraces []eos.ActionTrace) (out []*pbcodec.ActionTrace)

func ActionTracesToEOS

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

func ActivatedProtocolFeaturesToDEOS

func ActivatedProtocolFeaturesToDEOS(in map[string][]eos.HexBytes) *pbcodec.ActivatedProtocolFeatures

func AuthSequenceListToEOS

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

func AuthoritiesToDEOS

func AuthoritiesToDEOS(authority *eos.Authority) *pbcodec.Authority

func AuthorizationToDEOS

func AuthorizationToDEOS(authorization []eos.PermissionLevel) (out []*pbcodec.PermissionLevel)

func AuthorizationToEOS

func AuthorizationToEOS(authorization []*pbcodec.PermissionLevel) (out []eos.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 BlockHeaderToDEOS

func BlockHeaderToDEOS(blockHeader *eos.BlockHeader) *pbcodec.BlockHeader

func BlockHeaderToEOS

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

func BlockReaderFactory

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

func BlockSigningAuthorityToDEOS

func BlockSigningAuthorityToDEOS(authority *eos.BlockSigningAuthority) *pbcodec.BlockSigningAuthority

func BlockWriterFactory

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

func BlockrootMerkleToDEOS

func BlockrootMerkleToDEOS(merkle *eos.MerkleRoot) *pbcodec.BlockRootMerkle

func ChecksumToEOS

func ChecksumToEOS(in string) eos.Checksum256

func CreationTreeToDEOS

func CreationTreeToDEOS(tree CreationFlatTree) []*pbcodec.CreationFlatNode

func ErrorCodeToDEOS

func ErrorCodeToDEOS(in *eos.Uint64) uint64

func ErrorCodeToEOS

func ErrorCodeToEOS(in uint64) *eos.Uint64

func ExceptionToDEOS

func ExceptionToDEOS(in *eos.Except) *pbcodec.Exception

func ExceptionToEOS

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

func ExtensionsToDEOS

func ExtensionsToDEOS(in []*eos.Extension) (out []*pbcodec.Extension)

func ExtensionsToEOS

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

func ExtractEOSSignedTransactionFromReceipt

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

func GetPublicKeysFromSignedTransaction

func GetPublicKeysFromSignedTransaction(chainID eos.Checksum256, signedTransaction *eos.SignedTransaction) []string

Best effort to extract public keys from a signed transaction

func KeyWeightToDEOS

func KeyWeightToDEOS(keys []eos.KeyWeight) (out []*pbcodec.KeyWeight)

func KeyWeightsPToDEOS

func KeyWeightsPToDEOS(keys []*eos.KeyWeight) (out []*pbcodec.KeyWeight)

func PermissionLevelToDEOS

func PermissionLevelToDEOS(perm eos.PermissionLevel) *pbcodec.PermissionLevel

func PermissionLevelToEOS

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

func PermissionLevelWeightsToDEOS

func PermissionLevelWeightsToDEOS(weights []eos.PermissionLevelWeight) (out []*pbcodec.PermissionLevelWeight)

func PermissionLevelWeightsToEOS

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

func PermissionToDEOS

func PermissionToDEOS(perm *eos.Permission) *pbcodec.Permission

func ProducerAuthoritiesToDEOS

func ProducerAuthoritiesToDEOS(producerAuthorities []*eos.ProducerAuthority) (out []*pbcodec.ProducerAuthority)

func ProducerAuthoritiesToEOS

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

func ProducerKeysToDEOS

func ProducerKeysToDEOS(in []eos.ProducerKey) (out []*pbcodec.ProducerKey)

func ProducerKeysToEOS

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

func ProducerScheduleToDEOS

func ProducerScheduleToDEOS(e *eos.ProducerSchedule) *pbcodec.ProducerSchedule

func ProducerScheduleToEOS

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

func ProducerToLastImpliedIrbToDEOS

func ProducerToLastImpliedIrbToDEOS(in [][2]eos.EOSNameOrUint32) []*pbcodec.ProducerToLastImpliedIRB

func ProducerToLastProducedToDEOS

func ProducerToLastProducedToDEOS(in [][2]eos.EOSNameOrUint32) []*pbcodec.ProducerToLastProduced

func PublicKeysToEOS

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

func SignaturesToDEOS

func SignaturesToDEOS(in []ecc.Signature) (out []string)

func SignaturesToEOS

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

func SignedTransactionToDEOS

func SignedTransactionToDEOS(trx *eos.SignedTransaction) *pbcodec.SignedTransaction

func SignedTransactionToEOS

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

func TimestampToBlockTimestamp

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

func TimestampToJSONTime

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

func TransactionHeaderToDEOS

func TransactionHeaderToDEOS(trx *eos.TransactionHeader) *pbcodec.TransactionHeader

func TransactionHeaderToEOS

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

func TransactionReceiptToDEOS

func TransactionReceiptToDEOS(txReceipt *eos.TransactionReceipt) *pbcodec.TransactionReceipt

func TransactionToDEOS

func TransactionToDEOS(trx *eos.Transaction) *pbcodec.Transaction

func TransactionToEOS

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

func TransactionTraceToDEOS

func TransactionTraceToDEOS(in *eos.TransactionTrace) *pbcodec.TransactionTrace

func TransactionTraceToEOS

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

func WaitWeightsToDEOS

func WaitWeightsToDEOS(waits []eos.WaitWeight) (out []*pbcodec.WaitWeight)

Types

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) (*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) Read

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

type CreationFlatNode

type CreationFlatNode = [3]int

CreationFlatNode represents a flat node in a flat tree. It's a triplet slice where elements reprensents the following values, assuming `(<depthFirstWalkIndex>, <parentDepthFirstWalkIndex>, <executionActionIndex>)`:

The first value of the node is it's id, derived by doing a depth-first walk of the creation tree and incrementing an index at each node visited.

The second value is the parent index of the current node, the index is the index of the initial element of the `CreationFlatNode` slice.

The third value is the execution action index to get the actual execution traces from the actual execution tree (deep-first walking index in the execution tree).

type CreationFlatTree

type CreationFlatTree = []CreationFlatNode

CreationFlatTree represents the creation order tree in a flatten manners. The flat list is built by doing a deep-first walk of the creational tree, outputting at each traversal the `CreationNode` triplet `(index, creatorParentIndex, executionIndex)` where a parent of `-1` represents a root node.

For example, assuming a `CreationFlatTree` of the form:

[

[0, -1, 0],
[1, 0, 1],
[2, 0, 2],
[3, 2, 3],

]

Represents the following creational tree:

```

0
├── 1
└── 2
    └── 3

```

The tree can be reconstructed using the following quick Python.

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 eos.JSONTime `json:"earliest_allowed_activation_time"`
}

Jump to

Keyboard shortcuts

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