core

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 6 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// GasUsedEventCode is the event code for the gas used event.
	GasUsedEventCode = 1
)
View Source
const ModuleName = "core"

ModuleName is the core module name.

Variables

This section is empty.

Functions

func DecodeEvent added in v0.2.0

func DecodeEvent(event *types.Event) ([]client.DecodedEvent, error)

DecodeEvent decodes a core event.

Types

type EstimateGasQuery added in v0.2.0

type EstimateGasQuery struct {
	// Caller is the address of the caller for which to do estimation. If not specified the
	// authentication information from the passed transaction is used.
	Caller *types.CallerAddress `json:"caller,omitempty"`
	// Tx is the unsigned transaction to estimate.
	Tx *types.Transaction `json:"tx"`
}

EstimateGasQuery is the body of the core.EstimateGas query.

type Event added in v0.2.0

type Event struct {
	GasUsed *GasUsedEvent
}

Event is a core module event.

type GasCosts added in v0.2.0

type GasCosts struct {
	TxByte                   uint64 `json:"tx_byte"`
	AuthSignature            uint64 `json:"auth_signature"`
	AuthMultisigSigner       uint64 `json:"auth_multisig_signer"`
	CallformatX25519Deoxysii uint64 `json:"callformat_x25519_deoxysii"`
}

GasCosts are the consensus accounts module gas costs.

type GasUsedEvent added in v0.2.0

type GasUsedEvent struct {
	Amount uint64 `json:"amount"`
}

GasUsedEvent is a gas used event.

type Parameters added in v0.2.0

type Parameters struct {
	MaxBatchGas        uint64                                   `json:"max_batch_gas"`
	MaxTxSigners       uint32                                   `json:"max_tx_signers"`
	MaxMultisigSigners uint32                                   `json:"max_multisig_signers"`
	GasCosts           GasCosts                                 `json:"gas_costs"`
	MinGasPrice        map[types.Denomination]quantity.Quantity `json:"min_gas_price"`
}

Parameters are the parameters for the consensus accounts module.

type V1

type V1 interface {
	// Parameters queries the core module parameters.
	Parameters(ctx context.Context, round uint64) (*Parameters, error)

	// EstimateGas performs gas estimation for executing the given transaction.
	EstimateGas(ctx context.Context, round uint64, tx *types.Transaction) (uint64, error)

	// EstimateGasForCaller performs gas estimation for executing the given transaction as if the
	// caller specified by address had executed it.
	EstimateGasForCaller(ctx context.Context, round uint64, caller types.CallerAddress, tx *types.Transaction) (uint64, error)

	// MinGasPrice returns the minimum gas price.
	MinGasPrice(ctx context.Context) (map[types.Denomination]types.Quantity, error)

	// GetEvents returns all core events emitted in a given block.
	GetEvents(ctx context.Context, round uint64) ([]*Event, error)
}

V1 is the v1 core module interface.

func NewV1

func NewV1(rc client.RuntimeClient) V1

NewV1 generates a V1 client helper for the core module.

Jump to

Keyboard shortcuts

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