Documentation
¶
Index ¶
- func RequireDeployerKeyBalance(ctx context.Context, allChains map[uint64]evm.Chain, ...) error
- type ChangeSet
- type ChangeSetImpl
- type Configurations
- type ConfiguredChangeSet
- type EnvInputOption
- type PostProcessingChangeSet
- type PostProcessingChangeSetImpl
- type PostProcessor
- type TypedJSON
- type WrappedChangeSet
- func (f WrappedChangeSet[C]) With(config C) ConfiguredChangeSet
- func (f WrappedChangeSet[C]) WithConfigFrom(configProvider func() (C, error)) ConfiguredChangeSet
- func (f WrappedChangeSet[C]) WithConfigResolver(resolver resolvers.ConfigResolver) ConfiguredChangeSet
- func (f WrappedChangeSet[C]) WithEnvInput(opts ...EnvInputOption[C]) ConfiguredChangeSet
- func (f WrappedChangeSet[C]) WithJSON(_ C, inputStr string) ConfiguredChangeSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequireDeployerKeyBalance ¶
func RequireDeployerKeyBalance(ctx context.Context, allChains map[uint64]evm.Chain, minBalancesByChain map[uint64]*big.Int) error
RequireDeployerKeyBalance checks if the deployer key has a minimum balance on all chains. Useful to consider as a check in the beginning of a changeset to prevent running out of funds.
Types ¶
type ChangeSetImpl ¶
type ChangeSetImpl[C any] struct { // Present only when the migration was wired with // Configure(...).WithConfigResolver(...) ConfigResolver resolvers.ConfigResolver // contains filtered or unexported fields }
func (ChangeSetImpl[C]) Apply ¶
func (ccs ChangeSetImpl[C]) Apply(env deployment.Environment) (deployment.ChangesetOutput, error)
func (ChangeSetImpl[C]) Configurations ¶
func (ccs ChangeSetImpl[C]) Configurations() (Configurations, error)
func (ChangeSetImpl[C]) ThenWith ¶
func (ccs ChangeSetImpl[C]) ThenWith(postProcessor PostProcessor) PostProcessingChangeSet
ThenWith adds post-processing to a configured changeset
type Configurations ¶
type Configurations struct { InputChainOverrides []uint64 // Present only when the migration was wired with // Configure(...).WithConfigResolver(...) ConfigResolver resolvers.ConfigResolver }
Configurations holds options for a configured changeset
type ConfiguredChangeSet ¶
type ConfiguredChangeSet interface { ChangeSet ThenWith(postProcessor PostProcessor) PostProcessingChangeSet }
type EnvInputOption ¶
type EnvInputOption[C any] func(options *envInputOptions[C])
EnvInputOption is a function that configures WithEnvInput.
func InputModifierFunc ¶
func InputModifierFunc[C any](modifier func(c C) (C, error)) EnvInputOption[C]
InputModifierFunc allows providing a custom function to update the input. The return value of the modifier function is used as the final input for the changeset.
type PostProcessingChangeSet ¶
type PostProcessingChangeSet internalChangeSet
type PostProcessingChangeSetImpl ¶
type PostProcessingChangeSetImpl[C any] struct { // contains filtered or unexported fields }
func (PostProcessingChangeSetImpl[C]) Apply ¶
func (ccs PostProcessingChangeSetImpl[C]) Apply(env deployment.Environment) (deployment.ChangesetOutput, error)
func (PostProcessingChangeSetImpl[C]) Configurations ¶
func (ccs PostProcessingChangeSetImpl[C]) Configurations() (Configurations, error)
type PostProcessor ¶
type PostProcessor func(e deployment.Environment, config deployment.ChangesetOutput) (deployment.ChangesetOutput, error)
type TypedJSON ¶
type TypedJSON struct { Payload json.RawMessage `json:"payload"` ChainOverrides []uint64 `json:"chainOverrides"` // Optional field for chain overrides }
inputObject is a JSON object with a "payload" field that contains the actual input data for a Durable Pipeline.
type WrappedChangeSet ¶
type WrappedChangeSet[C any] struct { // contains filtered or unexported fields }
WrappedChangeSet simply wraps a deployment.ChangeSetV2 to use it in the fluent interface, which hosts the "With" function, so you can write `ConfigureLegacy(myChangeSet).With(aConfig)` in a typesafe way, and pass that into the ChangeSets.Add() function.
func Configure ¶
func Configure[C any](operation deployment.ChangeSetV2[C]) WrappedChangeSet[C]
Configure begins a chain of functions that pairs a deployment.ChangeSetV2 to a config, for registration as a migration.
func ConfigureLegacy
deprecated
func ConfigureLegacy[C any](operation deployment.ChangeSet[C]) WrappedChangeSet[C]
ConfigureLegacy begins a chain of functions that pairs a legacy (pure function) deployment.ChangeSet to a config, for registration as a migration.
Deprecated: This wraps the deprecated deployment.ChangeSet. Should use deployment.ChangeSetV2
func (WrappedChangeSet[C]) With ¶
func (f WrappedChangeSet[C]) With(config C) ConfiguredChangeSet
With returns a fully configured changeset, which pairs a deployment.ChangeSet with its configuration. It also allows extensions, such as a PostProcessing function.
func (WrappedChangeSet[C]) WithConfigFrom ¶
func (f WrappedChangeSet[C]) WithConfigFrom(configProvider func() (C, error)) ConfiguredChangeSet
WithConfigFrom takes a provider function which returns a config or an error, and stores the error (if any) in the configured changeset. This is then used to abort execution with a cleaner message than a panic. This allows for more robust error handling to happen for complex configs, factored into a function, without needing to use the "mustGetConfig" pattern
func (WrappedChangeSet[C]) WithConfigResolver ¶
func (f WrappedChangeSet[C]) WithConfigResolver(resolver resolvers.ConfigResolver) ConfiguredChangeSet
WithConfigResolver uses a registered config resolver to generate the configuration. It reads input from the DURABLE_PIPELINE_INPUT environment variable (JSON format) and uses the specified resolver to generate the typed configuration.
func (WrappedChangeSet[C]) WithEnvInput ¶
func (f WrappedChangeSet[C]) WithEnvInput(opts ...EnvInputOption[C]) ConfiguredChangeSet
WithEnvInput returns a fully configured changeset, which pairs a deployment.ChangeSet with its configuration based on the input defined in durable_pipelines/inputs for durable pipelines. It also allows extensions, such as a PostProcessing function. Options: - InputModifierFunc: allows providing a custom function to update the input.
func (WrappedChangeSet[C]) WithJSON ¶
func (f WrappedChangeSet[C]) WithJSON(_ C, inputStr string) ConfiguredChangeSet
WithJSON returns a fully configured changeset, which pairs a deployment.ChangeSet with its configuration based a JSON input. It also allows extensions, such as a PostProcessing function. InputStr must be a JSON object with a "payload" field that contains the actual input data for a Durable Pipeline. Example:
{ "payload": { "chainSelector": 123456789, "value": 100 } }
Note: Prefer WithEnvInput for durable_pipelines.go