types

package
v0.0.0-...-c626c17 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CompressionNone = CompressionType(iota)
	CompressionZlib
)
View Source
const EosioRootKey = "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"

var isActiveGenesis bool = false var instance = &GenesisState{}

Variables

for treeset

View Source
var BlockNumType = reflect.TypeOf(uint32(0))

for treeset

View Source
var SizeOfWordT = SizeOf(WordT{})

Functions

func DowngradeCast

func DowngradeCast(val eos_math.Uint128) int64

func IntegerDivideCeil

func IntegerDivideCeil(num uint64, den uint64) uint64

func IsIntegral

func IsIntegral(T interface{}) bool

func IsSame

func IsSame(T interface{}, compType interface{}) bool

func Merkle

func Merkle(ids []DigestType) DigestType

func MultiWithRatio

func MultiWithRatio(value uint64, ratio Ratio) uint64

func NewPermissionLevel

func NewPermissionLevel(in string) (out PermissionLevel, err error)

func NumFromID

func NumFromID(id *common.BlockIdType) uint32

func SizeOf

func SizeOf(T interface{}) int

func TransactionIDtoSenderID

func TransactionIDtoSenderID(tid common.TransactionIdType) eos_math.Uint128

func UpdateElasticLimit

func UpdateElasticLimit(currentLimit uint64, averageUsage uint64, params ElasticLimitParameters) uint64

func Validate

func Validate(auth Authority) bool

Types

type AccountResourceLimit

type AccountResourceLimit struct {
	Used      int64 `json:"used"`
	Available int64 `json:"available"`
	Max       int64 `json:"max"`
}

type Action

type Action struct {
	Account       common.AccountName       `json:"account"`
	Name          common.ActionName        `json:"name"`
	Authorization []common.PermissionLevel `json:"authorization,omitempty"`
	Data          common.HexBytes          `json:"data"`
}

Action

func (Action) DataAs

func (a Action) DataAs(t interface{})

type ActionReceipt

type ActionReceipt struct {
	Receiver       common.AccountName             `json:"receiver"`
	ActDigest      crypto.Sha256                  `json:"act_digest"`
	GlobalSequence uint64                         `json:"global_sequence"`
	RecvSequence   uint64                         `json:"recv_sequence"`
	AuthSequence   generated.AccountNameUint64Map `json:"auth_sequence"`
	CodeSequence   common.Vuint32                 `json:"code_sequence"`
	AbiSequence    common.Vuint32                 `json:"abi_sequence"`
}

func (*ActionReceipt) Digest

func (a *ActionReceipt) Digest() crypto.Sha256

type ActionTrace

type ActionTrace struct {
	BaseActionTrace
	InlineTraces []ActionTrace
}

type Authority

type Authority struct {
	Threshold uint32                  `json:"threshold"`
	Keys      []KeyWeight             `json:"keys"`
	Accounts  []PermissionLevelWeight `json:"accounts"`
	Waits     []WaitWeight            `json:"waits"`
}

func NewAuthority

func NewAuthority(k ecc.PublicKey, delaySec uint32) (a Authority)

func (Authority) Equals

func (auth Authority) Equals(author Authority) bool

func (Authority) String

func (auth Authority) String() string

func (*Authority) ToSharedAuthority

func (auth *Authority) ToSharedAuthority() SharedAuthority

type AuthorityChecker

type AuthorityChecker struct {
	CheckTime           *func()
	ProvidedKeys        []ecc.PublicKey
	ProvidedPermissions generated.PermissionLevelSet
	UsedKeys            []bool
	ProvidedDelay       Microseconds
	RecursionDepthLimit uint16
	Visitor             WeightTallyVisitor
	// contains filtered or unexported fields
}

func MakeAuthChecker

func MakeAuthChecker(pta PermissionToAuthorityFunc,
	recursionDepthLimit uint16,
	providedKeys *generated.PublicKeySet,
	providedPermission *generated.PermissionLevelSet,
	providedDelay Microseconds,
	checkTime *func()) AuthorityChecker

func (*AuthorityChecker) AllKeysUsed

func (ac *AuthorityChecker) AllKeysUsed() bool

func (*AuthorityChecker) GetUnusedKeys

func (ac *AuthorityChecker) GetUnusedKeys() generated.PublicKeySet

func (*AuthorityChecker) GetUsedKeys

func (ac *AuthorityChecker) GetUsedKeys() generated.PublicKeySet

func (*AuthorityChecker) PermissionStatusInCache

func (ac *AuthorityChecker) PermissionStatusInCache(permissions PermissionCacheType, level *PermissionLevel) PermissionCacheStatus

func (*AuthorityChecker) SatisfiedAcd

func (ac *AuthorityChecker) SatisfiedAcd(authority *SharedAuthority, cachedPerms *PermissionCacheType, depth uint16) bool

func (*AuthorityChecker) SatisfiedLc

func (ac *AuthorityChecker) SatisfiedLc(permission *PermissionLevel, cachedPerms *PermissionCacheType) bool

func (*AuthorityChecker) SatisfiedLoc

func (ac *AuthorityChecker) SatisfiedLoc(permission *PermissionLevel,
	overrideProvidedDelay Microseconds,
	cachedPerms *PermissionCacheType) bool

type BaseActionTrace

type BaseActionTrace struct {
	Receipt          ActionReceipt
	Act              Action
	ContextFree      bool //default false
	Elapsed          common.Microseconds
	CpuUsage         uint64
	Console          string
	TotalCpuUsage    uint64                   /// total of inline_traces[x].cpu_usage + cpu_usage
	TrxId            common.TransactionIdType ///< the transaction that generated this action
	BlockNum         uint32
	BlockTime        BlockTimeStamp
	ProducerBlockId  common.BlockIdType
	AccountRamDeltas AccountDeltaSet

	Except Exception
}

func NewBaseActionTrace

func NewBaseActionTrace(ar *ActionReceipt) *BaseActionTrace

type BlockHeader

type BlockHeader struct {
	Timestamp        BlockTimeStamp              `json:"timestamp"`
	Producer         common.AccountName          `json:"producer"`
	Confirmed        uint16                      `json:"confirmed"`
	Previous         common.BlockIdType          `multiIndex:"byPrevious,orderedUnique" json:"previous"`
	TransactionMRoot common.CheckSum256Type      `json:"transaction_mroot"`
	ActionMRoot      common.CheckSum256Type      `json:"action_mroot"`
	ScheduleVersion  uint32                      `json:"schedule_version"`
	NewProducers     *SharedProducerScheduleType `json:"new_producers" eos:"optional"`
	HeaderExtensions []Extension                 `json:"header_extensions"`
}

func NewBlockHeader

func NewBlockHeader() *BlockHeader

func (*BlockHeader) BlockID

func (b *BlockHeader) BlockID() common.BlockIdType

func (*BlockHeader) BlockNumber

func (b *BlockHeader) BlockNumber() uint32

func (*BlockHeader) Digest

func (b *BlockHeader) Digest() crypto.Sha256

func (BlockHeader) IsEmpty

func (b BlockHeader) IsEmpty() bool

type BlockHeaderState

type BlockHeaderState struct {
	ID                               common.IdType        `multiIndex:"id,increment" json:"id"`
	BlockId                          common.BlockIdType   `multiIndex:"byId,orderedUnique" json:"block_id"`
	BlockNum                         uint32               `multiIndex:"block_num,orderedUnique:byLibBlockNum,orderedUnique"`
	Header                           SignedBlockHeader    `multiIndex:"inline" json:"header"`
	DposProposedIrreversibleBlocknum uint32               `json:"dpos_proposed_irreversible_blocknum"`
	DposIrreversibleBlocknum         uint32               `multiIndex:"byLibBlockNum,orderedUnique" json:"dpos_irreversible_blocknum"`
	BftIrreversibleBlocknum          uint32               `multiIndex:"byLibBlockNum,orderedUnique" json:"bft_irreversible_blocknum"`
	PendingScheduleLibNum            uint32               `json:"pending_schedule_lib_num"`
	PendingScheduleHash              crypto.Sha256        `json:"pending_schedule_hash"`
	PendingSchedule                  ProducerScheduleType `json:"pending_schedule"`
	ActiveSchedule                   ProducerScheduleType `json:"active_schedule"`
	BlockrootMerkle                  IncrementalMerkle    `json:"blockroot_merkle"`
	ProducerToLastProduced           AccountNameUint32Map `json:"producer_to_last_produced"`
	ProducerToLastImpliedIrb         AccountNameUint32Map `json:"producer_to_last_implied_irb"`
	BlockSigningKey                  ecc.PublicKey        `json:"block_signing_key"`
	ConfirmCount                     []uint8              `json:"confirm_count"`
	Confirmations                    []HeaderConfirmation `json:"confirmations"`
}

func (*BlockHeaderState) AddConfirmation

func (b *BlockHeaderState) AddConfirmation(conf *HeaderConfirmation)

func (*BlockHeaderState) CalcDposLastIrreversible

func (b *BlockHeaderState) CalcDposLastIrreversible() uint32

func (*BlockHeaderState) GenerateNext

func (b *BlockHeaderState) GenerateNext(when BlockTimeStamp) *BlockHeaderState

func (*BlockHeaderState) GetScheduledProducer

func (b *BlockHeaderState) GetScheduledProducer(t BlockTimeStamp) ProducerKey

func (BlockHeaderState) IsEmpty

func (b BlockHeaderState) IsEmpty() bool

func (*BlockHeaderState) MaybePromotePending

func (b *BlockHeaderState) MaybePromotePending() bool

func (*BlockHeaderState) Next

*

  • Transitions the current header state into the next header state given the supplied signed block header. *
  • Given a signed block header, generate the expected template based upon the header time,
  • then validate that the provided header matches the template. *
  • If the header specifies new_producers then apply them accordingly.

func (*BlockHeaderState) SetConfirmed

func (b *BlockHeaderState) SetConfirmed(numPrevBlocks uint16)

func (*BlockHeaderState) SetNewProducers

func (b *BlockHeaderState) SetNewProducers(pending SharedProducerScheduleType)

func (*BlockHeaderState) SigDigest

func (b *BlockHeaderState) SigDigest() crypto.Sha256

func (*BlockHeaderState) Sign

func (b *BlockHeaderState) Sign(signer func(sha256 crypto.Sha256) ecc.Signature)

func (*BlockHeaderState) Signee

func (b *BlockHeaderState) Signee() ecc.PublicKey

type BlockState

type BlockState struct {
	BlockHeaderState `multiIndex:"inline"`
	SignedBlock      *SignedBlock `multiIndex:"inline"`
	Validated        bool         `json:"validated"`
	InCurrentChain   bool         `json:"in_current_chain"`
	Trxs             []*TransactionMetadata
}

func NewBlockState

func NewBlockState(cur *BlockHeaderState) *BlockState

func NewBlockState2

func NewBlockState2(prev *BlockHeaderState, when BlockTimeStamp) *BlockState

func NewBlockState3

func NewBlockState3(prev *BlockHeaderState, b *SignedBlock, trust bool) *BlockState

func (*BlockState) IsEmpty

func (b *BlockState) IsEmpty() bool

type BlockStatus

type BlockStatus uint8
const (
	Irreversible BlockStatus = iota ///< this block has already been applied before by this node and is considered irreversible
	Validated                       ///< this is a complete block signed by a valid producer and has been previously applied by this node and therefore validated but it is not yet irreversible
	Complete                        ///< this is a complete block signed by a valid producer but is not yet irreversible nor has it yet been applied by this node
	Incomplete                      ///< this is an incomplete block (either being produced by a producer or speculatively produced by a node)
)

type BlockTimeStamp

type BlockTimeStamp uint32

func MaxBlockTime

func MaxBlockTime() BlockTimeStamp

func MinBlockTime

func MinBlockTime() BlockTimeStamp

func NewBlockTimeStamp

func NewBlockTimeStamp(t common.TimePoint) BlockTimeStamp

func NewBlockTimeStampSec

func NewBlockTimeStampSec(ts common.TimePointSec) BlockTimeStamp

func (BlockTimeStamp) MarshalJSON

func (t BlockTimeStamp) MarshalJSON() ([]byte, error)

func (BlockTimeStamp) Next

func (t BlockTimeStamp) Next() BlockTimeStamp

func (BlockTimeStamp) String

func (t BlockTimeStamp) String() string

func (BlockTimeStamp) ToTimePoint

func (t BlockTimeStamp) ToTimePoint() common.TimePoint

func (*BlockTimeStamp) UnmarshalJSON

func (t *BlockTimeStamp) UnmarshalJSON(data []byte) error

type CachedPubKey

type CachedPubKey struct {
	TrxID  common.TransactionIdType `json:"trx_id"`
	PubKey ecc.PublicKey            `json:"pub_key"`
	Sig    ecc.Signature            `json:"sig"`
}

type ChainConfig

type ChainConfig struct {
	MaxBlockNetUsage               uint64
	TargetBlockNetUsagePct         uint32
	MaxTransactionNetUsage         uint32
	BasePerTransactionNetUsage     uint32
	NetUsageLeeway                 uint32
	ContextFreeDiscountNetUsageNum uint32
	ContextFreeDiscountNetUsageDen uint32

	MaxBlockCpuUsage       uint32
	TargetBlockCpuUsagePct uint32
	MaxTransactionCpuUsage uint32
	MinTransactionCpuUsage uint32

	MaxTrxLifetime              uint32
	DeferredTrxExpirationWindow uint32
	MaxTrxDelay                 uint32
	MaxInlineActionSize         uint32
	MaxInlineActionDepth        uint16
	MaxAuthorityDepth           uint16
}

func (ChainConfig) IsEmpty

func (c ChainConfig) IsEmpty() bool

func (*ChainConfig) Validate

func (c *ChainConfig) Validate()

type CompressionType

type CompressionType uint8

func (CompressionType) MarshalJSON

func (c CompressionType) MarshalJSON() ([]byte, error)

func (CompressionType) String

func (c CompressionType) String() string

func (*CompressionType) UnmarshalJSON

func (c *CompressionType) UnmarshalJSON(data []byte) error

type ContractTypesInterface

type ContractTypesInterface interface {
	GetAccount() common.AccountName
	GetName() common.ActionName
}

type DeferredReference

type DeferredReference struct {
	Sender   common.AccountName `json:"sender"`
	SenderID eos_math.Uint128   `json:"sender_id"`
}

func NewDeferredReference

func NewDeferredReference(sender common.AccountName, senderID eos_math.Uint128) *DeferredReference

type DeferredTransaction

type DeferredTransaction struct {
	*SignedTransaction

	SenderID     eos_math.Uint128    `json:"sender_id"` // ID assigned by sender of generated, accessible via WASM api when executing normal or error
	Sender       common.AccountName  `json:"sender"`    // receives error handler callback
	Payer        common.AccountName  `json:"payer"`
	ExecuteAfter common.TimePointSec `json::execute_after` // delayed execution
}

*

  • When a transaction is generated it can be scheduled to occur
  • in the future. It may also fail to execute for some reason in
  • which case the sender needs to be notified. When the sender
  • sends a transaction they will assign it an ID which will be
  • passed back to the sender if the transaction fails for some
  • reason.

func NewDeferredTransaction

func NewDeferredTransaction(senderID eos_math.Uint128, sender common.AccountName, payer common.AccountName,
	executeAfter common.TimePointSec, txn *SignedTransaction) *DeferredTransaction

type ElasticLimitParameters

type ElasticLimitParameters struct {
	Target        uint64 `json:"target"`
	Max           uint64 `json:"max"`
	Periods       uint32 `json:"periods"`
	MaxMultiplier uint32 `json:"max_multiplier"`
	ContractRate  Ratio  `json:"contract_rate"`
	ExpandRate    Ratio  `json:"expand_rate"`
}

func (ElasticLimitParameters) Validate

func (e ElasticLimitParameters) Validate()

type ExponentialMovingAverageAccumulator

type ExponentialMovingAverageAccumulator struct {
	LastOrdinal uint32 `json:"last_ordinal"`
	ValueEx     uint64 `json:"value_ex"`
	Consumed    uint64 `json:"consumed"`
}

func (*ExponentialMovingAverageAccumulator) Add

func (ema *ExponentialMovingAverageAccumulator) Add(units uint64, ordinal uint32, windowSize uint32)

func (*ExponentialMovingAverageAccumulator) Average

type Extension

type Extension struct {
	Type uint16          `json:"type"`
	Data common.HexBytes `json:"data"`
}

type FixedKey

type FixedKey struct {
	Size common.SizeT
	// contains filtered or unexported fields
}

func (FixedKey) EnableFirstWord

func (f FixedKey) EnableFirstWord(first interface{}) bool

func (*FixedKey) GetArray

func (f *FixedKey) GetArray() []WordT

func (*FixedKey) MakeFromWordSequence

func (f *FixedKey) MakeFromWordSequence(first interface{}, rest ...interface{}) *FixedKey

func (*FixedKey) SetFromWordSequence

func (f *FixedKey) SetFromWordSequence(arr []interface{})

type GenesisState

type GenesisState struct {
	InitialTimestamp     common.TimePoint `json:"initial_timestamp"`
	InitialKey           ecc.PublicKey    `json:"initial_key"`
	InitialConfiguration ChainConfig      `json:"initial_configuration"`
}

func NewGenesisState

func NewGenesisState() *GenesisState

func (*GenesisState) ComputeChainID

func (g *GenesisState) ComputeChainID() common.ChainIdType

func (*GenesisState) Initial

func (g *GenesisState) Initial() ChainConfig

type HeaderConfirmation

type HeaderConfirmation struct {
	BlockId           common.BlockIdType `json:"block_id"`
	Producer          common.AccountName `json:"producer"`
	ProducerSignature ecc.Signature      `json:"producers_signature"`
}

type IncrementalMerkle

type IncrementalMerkle struct {
	NodeCount   uint64       `json:"node_count"`
	ActiveNodes []DigestType `json:"active_nodes"`
}

func (*IncrementalMerkle) Append

func (m *IncrementalMerkle) Append(digest DigestType) DigestType

*

  • Add a node to the incremental tree and recalculate the _active_nodes so they
  • are prepared for the next append. *
  • The algorithm for this is to start at the new node and retreat through the tree
  • for any node that is the concatenation of a fully-realized node and a partially
  • realized node we must record the value of the fully-realized node in the new
  • _active_nodes so that the next append can fetch it. Fully realized nodes and
  • Fully implied nodes do not have an effect on the _active_nodes. *
  • For convention _AND_ to allow appends when the _node_count is a power-of-2, the
  • current root of the incremental tree is always appended to the end of the new
  • _active_nodes. *
  • In practice, this can be done iteratively by recording any "left" value that
  • is to be combined with an implied node. *
  • If the appended node is a "left" node in its pair, it will immediately push itself
  • into the new active nodes list. *
  • If the new node is a "right" node it will begin collapsing upward in the tree,
  • reading and discarding the "left" node data from the old active nodes list, until
  • it becomes a "left" node. It must then push the "top" of its current collapsed
  • sub-tree into the new active nodes list. *
  • Once any value has been added to the new active nodes, all remaining "left" nodes
  • should be present in the order they are needed in the previous active nodes as an
  • artifact of the previous append. As they are read from the old active nodes, they
  • will need to be copied in to the new active nodes list as they are still needed
  • for future appends. *
  • As a result, if an append collapses the entire tree while always being the "right"
  • node, the new list of active nodes will be empty and by definition the tree contains
  • a power-of-2 number of nodes. *
  • Regardless of the contents of the new active nodes list, the top "collapsed" value
  • is appended. If this tree is _not_ a power-of-2 number of nodes, this node will
  • not be used in the next append but still serves as a conventional place to access
  • the root of the current tree. If this _is_ a power-of-2 number of nodes, this node
  • will be needed during then collapse phase of the next append so, it serves double
  • duty as a legitimate active node and the conventional storage location of the root. * *
  • @param digest - the node to add
  • @return - the new root

func (IncrementalMerkle) GetRoot

func (m IncrementalMerkle) GetRoot() DigestType

*

  • return the current root of the incremental merkle *
  • @return

func (IncrementalMerkle) IsEmpty

func (i IncrementalMerkle) IsEmpty() bool

type KeyWeight

type KeyWeight struct {
	Key    ecc.PublicKey `json:"key"`
	Weight WeightType    `json:"weight"`
}

func (KeyWeight) Compare

func (key KeyWeight) Compare(kw KeyWeight) bool

func (KeyWeight) String

func (key KeyWeight) String() string

type MetaPermission

type MetaPermission []interface{}

func (MetaPermission) Len

func (m MetaPermission) Len() int

func (MetaPermission) Less

func (m MetaPermission) Less(i, j int) bool

func (MetaPermission) Sort

func (m MetaPermission) Sort()

func (MetaPermission) Swap

func (m MetaPermission) Swap(i, j int)

type Optional

type Optional struct {
	Valid bool
	Pair  map[common.ChainIdType][]ecc.PublicKey
}

type PackedTransaction

type PackedTransaction struct {
	Signatures            []ecc.Signature `json:"signatures"`
	Compression           CompressionType `json:"compression"` // in C++, it's an enum, not sure how it Binary-marshals..
	PackedContextFreeData common.HexBytes `json:"packed_context_free_data"`
	PackedTrx             common.HexBytes `json:"packed_trx"`
	UnpackedTrx           *Transaction    `json:"transaction" eos:"-"`
}

PackedTransaction represents a fully packed transaction, with signatures, and all. They circulate like that on the P2P net, and that's how they are stored.

func NewPackedTransactionBySignedTrx

func NewPackedTransactionBySignedTrx(t *SignedTransaction, compression CompressionType) *PackedTransaction

compression := CompressionNone

func NewPackedTransactionByTrx

func NewPackedTransactionByTrx(t *Transaction, compression CompressionType) *PackedTransaction

func (*PackedTransaction) Expiration

func (p *PackedTransaction) Expiration() common.TimePointSec

func (*PackedTransaction) GetContextFreeData

func (p *PackedTransaction) GetContextFreeData() []common.HexBytes

func (*PackedTransaction) GetPrunableSize

func (p *PackedTransaction) GetPrunableSize() uint32

func (*PackedTransaction) GetRawTransaction

func (p *PackedTransaction) GetRawTransaction() common.HexBytes

func (*PackedTransaction) GetSignedTransaction

func (p *PackedTransaction) GetSignedTransaction() (signedTrx *SignedTransaction)

func (*PackedTransaction) GetTransaction

func (p *PackedTransaction) GetTransaction() *Transaction

func (*PackedTransaction) GetUncachedID

func (p *PackedTransaction) GetUncachedID() common.TransactionIdType

func (*PackedTransaction) GetUnprunableSize

func (p *PackedTransaction) GetUnprunableSize() (size uint32)

func (*PackedTransaction) ID

func (PackedTransaction) IsEmpty

func (p PackedTransaction) IsEmpty() bool

func (*PackedTransaction) PackedDigest

func (p *PackedTransaction) PackedDigest() common.DigestType

func (*PackedTransaction) SetTransaction

func (p *PackedTransaction) SetTransaction(t *Transaction, compression CompressionType)

func (*PackedTransaction) SetTransactionWithCFD

func (p *PackedTransaction) SetTransactionWithCFD(t *SignedTransaction, cfd *[]common.HexBytes, compression CompressionType)

type Permission

type Permission struct {
	PermName     string    `json:"perm_name"`
	Parent       string    `json:"parent"`
	RequiredAuth Authority `json:"required_auth"`
}

type PermissionCacheStatus

type PermissionCacheStatus uint64
const (
	BeingEvaluated PermissionCacheStatus
	PermissionUnsatisfied
	PermissionSatisfied
)

type PermissionCacheType

type PermissionCacheType = map[PermissionLevel]PermissionCacheStatus

type PermissionLevelWeight

type PermissionLevelWeight struct {
	Permission PermissionLevel `json:"permission"`
	Weight     WeightType      `json:"weight"`
}

func (PermissionLevelWeight) String

func (permLevel PermissionLevelWeight) String() string

type PermissionToAuthorityFunc

type PermissionToAuthorityFunc func(*PermissionLevel) SharedAuthority

type ProducerConfirmation

type ProducerConfirmation struct {
	BlockID     common.BlockIdType
	BlockDigest [4]uint64
	Producer    common.AccountName
	Sig         ecc.Signature
}

type ProducerKey

type ProducerKey struct {
	ProducerName    common.AccountName `json:"producer_name"`
	BlockSigningKey ecc.PublicKey      `json:"block_signing_key"`
}

type ProducerScheduleType

type ProducerScheduleType struct {
	Version   uint32        `json:"version"`
	Producers []ProducerKey `json:"producers"`
}

func (*ProducerScheduleType) GetProducerKey

func (ps *ProducerScheduleType) GetProducerKey(p common.AccountName) (ecc.PublicKey, bool)

func (ProducerScheduleType) IsEmpty

func (p ProducerScheduleType) IsEmpty() bool

type Ratio

type Ratio struct {
	Numerator   uint64 `json:"numerator"`
	Denominator uint64 `json:"denominator"`
}

type SharedAuthority

type SharedAuthority struct {
	Threshold uint32
	Keys      []KeyWeight             `json:"keys"`
	Accounts  []PermissionLevelWeight `json:"accounts"`
	Waits     []WaitWeight            `json:"waits"`
}

func (SharedAuthority) Equals

func (sharedAuth SharedAuthority) Equals(sharedAuthor SharedAuthority) bool

func (SharedAuthority) GetBillableSize

func (sharedAuth SharedAuthority) GetBillableSize() uint64

func (*SharedAuthority) ToAuthority

func (sharedAuth *SharedAuthority) ToAuthority() Authority

type SharedProducerScheduleType

type SharedProducerScheduleType struct {
	Version   uint32
	Producers []ProducerKey
}

func (*SharedProducerScheduleType) Clear

func (spst *SharedProducerScheduleType) Clear()

func (SharedProducerScheduleType) IsEmpty

func (p SharedProducerScheduleType) IsEmpty() bool

func (*SharedProducerScheduleType) ProducerScheduleType

func (s *SharedProducerScheduleType) ProducerScheduleType() *ProducerScheduleType

func (*SharedProducerScheduleType) SharedProducerScheduleType

type SignedBlock

type SignedBlock struct {
	SignedBlockHeader `multiIndex:"inline"`
	Transactions      []TransactionReceipt `json:"transactions"`
	BlockExtensions   []Extension          `json:"block_extensions"`
}

func NewSignedBlock

func NewSignedBlock() *SignedBlock

func NewSignedBlock1

func NewSignedBlock1(h *SignedBlockHeader) *SignedBlock

func (SignedBlock) IsEmpty

func (s SignedBlock) IsEmpty() bool

type SignedBlockHeader

type SignedBlockHeader struct {
	BlockHeader       `multiIndex:"inline"`
	ProducerSignature ecc.Signature `json:"-"`
}

func NewSignedBlockHeader

func NewSignedBlockHeader() *SignedBlockHeader

func (SignedBlockHeader) IsEmpty

func (s SignedBlockHeader) IsEmpty() bool

type SignedTransaction

type SignedTransaction struct {
	Transaction

	Signatures      []ecc.Signature   `json:"signatures"`
	ContextFreeData []common.HexBytes `json:"context_free_data"`
}

func NewSignedTransaction

func NewSignedTransaction(tx *Transaction, signature []ecc.Signature, contextFreeData []common.HexBytes) *SignedTransaction

func NewSignedTransactionNil

func NewSignedTransactionNil() *SignedTransaction

func (*SignedTransaction) GetSignatureKeys

func (st *SignedTransaction) GetSignatureKeys(chainID *common.ChainIdType, allowDeplicateKeys bool, useCache bool) PublicKeySet

allowDeplicateKeys =false,useCache=true

func (*SignedTransaction) Sign

func (*SignedTransaction) SignWithoutAppend

func (s *SignedTransaction) SignWithoutAppend(key ecc.PrivateKey, chainID *common.ChainIdType) ecc.Signature

func (*SignedTransaction) String

func (s *SignedTransaction) String() string

type SigningKeysType

type SigningKeysType struct {
	ID        common.ChainIdType
	PublicKey PublicKeySet
}

func (*SigningKeysType) IsEmpty

func (s *SigningKeysType) IsEmpty() bool

type Transaction

type Transaction struct {
	// WARN: is a `variant` in C++, can be a SignedTransaction or a Transaction.
	TransactionHeader

	ContextFreeActions    []*Action    `json:"context_free_actions"`
	Actions               []*Action    `json:"actions"`
	TransactionExtensions []*Extension `json:"transaction_extensions"`
}

Transaction consits of a set of messages which must all be applied or all are rejected. These messages have access to data within the given read and write scopes.

func (*Transaction) FirstAuthorizor

func (tx *Transaction) FirstAuthorizor() common.AccountName

func (*Transaction) GetSignatureKeys

func (t *Transaction) GetSignatureKeys(signatures []ecc.Signature, chainID *common.ChainIdType, cfd []common.HexBytes,
	allowDuplicateKeys bool, useCache bool) PublicKeySet

allowDuplicateKeys = false useCache= true

func (*Transaction) ID

func (Transaction) IsEmtpy

func (t Transaction) IsEmtpy() bool

func (*Transaction) SigDigest

func (t *Transaction) SigDigest(chainID *common.ChainIdType, cfd []common.HexBytes) *common.DigestType

func (*Transaction) TotalActions

func (t *Transaction) TotalActions() uint32

type TransactionHeader

type TransactionHeader struct {
	Expiration     common.TimePointSec `json:"expiration"`
	RefBlockNum    uint16              `json:"ref_block_num"`
	RefBlockPrefix uint32              `json:"ref_block_prefix"`

	MaxNetUsageWords common.Vuint32 `json:"max_net_usage_words" eos:"vuint32"`
	MaxCpuUsageMS    uint8          `json:"max_cpu_usage_ms"`
	DelaySec         common.Vuint32 `json:"delay_sec" eos:"vuint32"` // number of secs to delay, making it cancellable for that duration
}

*

  • TransactionHeader contains the fixed-sized data

  • associated with each transaction. It is separated from

  • the transaction body to facilitate partial parsing of

  • transactions without requiring dynamic memory allocation. *

  • All transactions have an expiration time after which they

  • may no longer be included in the blockchain. Once a block

  • with a block_header::timestamp greater than expiration is

  • deemed irreversible, then a user can safely trust the transaction

  • will never be included. *

  • Each region is an independent blockchain, it is included as routing

  • information for inter-blockchain communication. A contract in this

  • region might generate or authorize a transaction intended for a foreign

  • region.

func (TransactionHeader) GetRefBlocknum

func (t TransactionHeader) GetRefBlocknum(headBlocknum uint32) uint32

func (TransactionHeader) IsEmpty

func (t TransactionHeader) IsEmpty() bool

func (*TransactionHeader) SetReferenceBlock

func (t *TransactionHeader) SetReferenceBlock(referenceBlock *common.BlockIdType)

func (TransactionHeader) Validate

func (t TransactionHeader) Validate()

func (TransactionHeader) VerifyReferenceBlock

func (t TransactionHeader) VerifyReferenceBlock(referenceBlock *common.BlockIdType) bool

type TransactionMetadata

type TransactionMetadata struct {
	ID          common.TransactionIdType `json:"id"`
	SignedID    common.TransactionIdType `json:"signed_id"`
	Trx         *SignedTransaction       `json:"trx"`
	PackedTrx   *PackedTransaction       `json:"packed_trx"`
	SigningKeys SigningKeysType          `json:"signing_keys"`
	Accepted    bool                     `json:"accepted"`
	Implicit    bool                     `json:"implicit"`
	Scheduled   bool                     `json:"scheduled"`
}

func NewTransactionMetadata

func NewTransactionMetadata(ptrx *PackedTransaction) *TransactionMetadata

func NewTransactionMetadataBySignedTrx

func NewTransactionMetadataBySignedTrx(t *SignedTransaction, c CompressionType) *TransactionMetadata

func (*TransactionMetadata) RecoverKeys

func (t *TransactionMetadata) RecoverKeys(chainID *common.ChainIdType) *PublicKeySet

func (*TransactionMetadata) TotalActions

func (t *TransactionMetadata) TotalActions() uint32

type TransactionReceipt

type TransactionReceipt struct {
	TransactionReceiptHeader
	Trx TransactionWithID `json:"trx" eos:"trxID"`
}

func NewTransactionReceipt

func NewTransactionReceipt() *TransactionReceipt

func NewTransactionReceiptWithID

func NewTransactionReceiptWithID(tid common.TransactionIdType) *TransactionReceipt

func NewTransactionReceiptWithPtrx

func NewTransactionReceiptWithPtrx(ptrx PackedTransaction) *TransactionReceipt

func (*TransactionReceipt) Digest

func (t *TransactionReceipt) Digest() common.DigestType

type TransactionReceiptHeader

type TransactionReceiptHeader struct {
	Status        TransactionStatus `json:"status"`
	CpuUsageUs    uint32            `json:"cpu_usage_us"`
	NetUsageWords common.Vuint32    `json:"net_usage_words" eos:"vuint32"`
}

func NewTransactionReceiptHeader

func NewTransactionReceiptHeader() *TransactionReceiptHeader

func NewTransactionReceiptHeader1

func NewTransactionReceiptHeader1(status TransactionStatus) *TransactionReceiptHeader

func (TransactionReceiptHeader) IsEmpty

func (t TransactionReceiptHeader) IsEmpty() bool

type TransactionStatus

type TransactionStatus uint8
const (
	TransactionStatusExecuted TransactionStatus = iota ///< succeed, no error handler executed
	TransactionStatusSoftFail                          ///< objectively failed (not executed), error handler executed
	TransactionStatusHardFail                          ///< objectively failed and error handler objectively failed thus no state change
	TransactionStatusDelayed                           ///< transaction delayed
	TransactionStatusExpired
	TransactionStatusUnknown = TransactionStatus(255)
)

func (TransactionStatus) MarshalJSON

func (s TransactionStatus) MarshalJSON() (data []byte, err error)

func (TransactionStatus) String

func (s TransactionStatus) String() string

func (*TransactionStatus) UnmarshalJSON

func (s *TransactionStatus) UnmarshalJSON(data []byte) error

type TransactionTrace

type TransactionTrace struct {
	ID              common.TransactionIdType
	BlockNum        uint32
	BlockTime       BlockTimeStamp
	ProducerBlockId common.BlockIdType
	Receipt         TransactionReceiptHeader
	Elapsed         common.Microseconds
	NetUsage        uint64
	Scheduled       bool //false
	ActionTraces    []ActionTrace
	FailedDtrxTrace *TransactionTrace

	Except    Exception
	ExceptPtr Exception
}

func (TransactionTrace) IsEmpty

func (t TransactionTrace) IsEmpty() bool

type TransactionWithID

type TransactionWithID struct {
	PackedTransaction *PackedTransaction       `json:"packed_transaction" eos:"tag0"`
	TransactionID     common.TransactionIdType `json:"transaction_id" eos:"tag1"`
}

func (TransactionWithID) MarshalJSON

func (t TransactionWithID) MarshalJSON() ([]byte, error)

func (*TransactionWithID) UnmarshalJSON

func (t *TransactionWithID) UnmarshalJSON(data []byte) error

type UsageAccumulator

type UsageAccumulator struct {
	ExponentialMovingAverageAccumulator
}

type WaitWeight

type WaitWeight struct {
	WaitSec uint32     `json:"wait_sec"`
	Weight  WeightType `json:"weight"`
}

func (WaitWeight) String

func (wait WaitWeight) String() string

type WeightTallyVisitor

type WeightTallyVisitor struct {
	Checker           *AuthorityChecker
	CachedPermissions *PermissionCacheType
	RecursionDepth    uint16
	TotalWeight       uint32
}

func (*WeightTallyVisitor) Visit

func (wtv *WeightTallyVisitor) Visit(permission interface{}) uint32

func (*WeightTallyVisitor) VisitKeyWeight

func (wtv *WeightTallyVisitor) VisitKeyWeight(permission KeyWeight) uint32

func (*WeightTallyVisitor) VisitPermissionLevelWeight

func (wtv *WeightTallyVisitor) VisitPermissionLevelWeight(permission PermissionLevelWeight) uint32

func (*WeightTallyVisitor) VisitWaitWeight

func (wtv *WeightTallyVisitor) VisitWaitWeight(permission WaitWeight) uint32

type WeightType

type WeightType uint16

func (WeightType) String

func (weight WeightType) String() string

type WordT

type WordT = Uint128

func ConvertToWordT

func ConvertToWordT(T interface{}) WordT

Directories

Path Synopsis
Package treeset implements a Tree backed by a red-black Tree.
Package treeset implements a Tree backed by a red-black Tree.

Jump to

Keyboard shortcuts

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