decode

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressFromPubKey

func AddressFromPubKey(pk []byte) (string, error)

Types

type Addresses

type Addresses map[string]*storage.Address

func NewAddress

func NewAddress() Addresses

func (Addresses) Get

func (a Addresses) Get(address string) (*storage.Address, bool)

func (Addresses) Set

func (a Addresses) Set(address string, height types.Level, change decimal.Decimal, asset string, actionCount int, signedTxCount int) *storage.Address

func (Addresses) UpdateNonce

func (a Addresses) UpdateNonce(address string, nonce uint32)

type Context

type Context struct {
	Addresses      Addresses
	Rollups        Rollups
	Validators     Validators
	RollupAddress  map[string]*storage.RollupAddress
	AddressActions map[string]*storage.AddressAction
	SupplyChange   decimal.Decimal
	BytesInBlock   int64
	GasUsed        int64
	GasWanted      int64
	DataSize       int64
	ActionTypes    storageTypes.Bits
	Constants      map[string]*storage.Constant
	Bridges        map[string]*storage.Bridge
	Fees           []*storage.Fee
	Proposer       string
}

func NewContext

func NewContext() Context

func (*Context) AddBridge

func (ctx *Context) AddBridge(b *storage.Bridge)

func (*Context) AddFee

func (ctx *Context) AddFee(fee *storage.Fee)

func (*Context) AddGenericConstant

func (ctx *Context) AddGenericConstant(key, value string)

func (*Context) BridgesArray

func (ctx *Context) BridgesArray() []*storage.Bridge

func (*Context) ConstantsArray

func (ctx *Context) ConstantsArray() []*storage.Constant

type DecodedTx

type DecodedTx struct {
	Tx          *astria.SignedTransaction
	UnsignedTx  *astria.UnsignedTransaction
	Actions     []storage.Action
	Signer      *storage.Address
	ActionTypes storageTypes.Bits
}

func Tx

func Tx(b types.BlockData, index int, ctx *Context) (d DecodedTx, err error)

type Rollups

type Rollups map[string]*storage.Rollup

func NewRollups

func NewRollups() Rollups

func (Rollups) Set

func (r Rollups) Set(rollupId []byte, height types.Level, size int) *storage.Rollup

type Validators

type Validators map[string]*storage.Validator

func NewValidators

func NewValidators() Validators

func (Validators) Set

func (v Validators) Set(pubKey []byte, power int64, address string, height types.Level) *storage.Validator

Jump to

Keyboard shortcuts

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