simple

package
v1.3.14 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MaxInFlight = "maxInFlight"

	Interval       = "interval"
	RetryInitDelay = "retry.initialDelay"
	RetryMaxDelay  = "retry.maxDelay"
	RetryFactor    = "retry.factor"

	FixedGasPrice          = "fixedGasPrice"    // when not using a gas station - will be treated as a raw JSON string, so can be numeric 123, or string "123", or object {"maxPriorityFeePerGas":123})
	ResubmitInterval       = "resubmitInterval" // warnings will be written to the log at this interval if mining has not occurred, and the TX will be resubmitted
	GasOracleConfig        = "gasOracle"
	GasOracleMode          = "mode"
	GasOracleMethod        = "method"
	GasOracleTemplate      = "template"
	GasOracleQueryInterval = "queryInterval"
)
View Source
const (
	GasOracleModeDisabled  = "disabled"
	GasOracleModeRESTAPI   = "restapi"
	GasOracleModeConnector = "connector"
)
View Source
const (
	ActionNone policyEngineAPIRequestType = iota
	ActionDelete
	ActionSuspend
	ActionResume
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RunContext added in v1.3.0

type RunContext struct {
	// Input
	context.Context
	TX            *apitypes.ManagedTX
	Receipt       *ffcapi.TransactionReceiptResponse
	Confirmations *apitypes.ConfirmationsNotification
	Confirmed     bool
	SyncAction    policyEngineAPIRequestType
	// Input/output
	SubStatus apitypes.TxSubStatus
	Info      *simplePolicyInfo // must be updated in-place and set UpdatedInfo to true as well as UpdateType = Update
	// Output
	UpdateType     UpdateType
	UpdatedInfo    bool
	TXUpdates      apitypes.TXUpdates
	HistoryUpdates []func(p txhandler.TransactionHistoryPersistence) error
}

RunContext is the context for an individual run of the simple policy loop, for an individual transaction. - Built from a snapshot of the mux-protected inflight state on input - Capturing the results from the run on output

func (*RunContext) AddSubStatusAction added in v1.3.0

func (ctx *RunContext) AddSubStatusAction(action apitypes.TxAction, info *fftypes.JSONAny, err *fftypes.JSONAny, actionOccurred *fftypes.FFTime)

func (*RunContext) SetSubStatus added in v1.3.0

func (ctx *RunContext) SetSubStatus(subStatus apitypes.TxSubStatus)

type TransactionHandlerFactory

type TransactionHandlerFactory struct{}

func (*TransactionHandlerFactory) InitConfig

func (f *TransactionHandlerFactory) InitConfig(conf config.Section)

func (*TransactionHandlerFactory) Name

func (*TransactionHandlerFactory) NewTransactionHandler

simpleTransactionHandler is a base transaction handler forming an example for extension: - It offers three ways of calculating gas price: use a fixed number, use the built-in API of a ethereum connector, use a RESTful gas oracle - It resubmits the transaction based on a configured interval until it succeed or fail

type UpdateType

type UpdateType int

UpdateType informs FFTM whether the transaction needs an update to be persisted after this execution of the policy engine

const (
	None   UpdateType = iota // Instructs that no update is necessary
	Update                   // Instructs that the transaction should be updated in persistence
	Delete                   // Instructs that the transaction should be removed completely from persistence - generally only returned when TX status is TxStatusDeleteRequested
)

Jump to

Keyboard shortcuts

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