Documentation
¶
Index ¶
- Variables
- func NewCommand(cfg Config) (*cobra.Command, error)
- func ReadExecutionErrorFromFile(data []byte) (*evm.ExecutionError, error)
- type Config
- type DecodedExecutionError
- type Deps
- type EnvironmentLoaderFunc
- type ErrDecoder
- type ErrSig
- type ProposalConfig
- type ProposalFlags
- type ProposalLoaderFunc
Constants ¶
This section is empty.
Variables ¶
var ErrOperationAlreadyExecuted = errors.New("operation already executed")
ErrOperationAlreadyExecuted is returned when an operation has already been executed.
Functions ¶
func NewCommand ¶
NewCommand creates a new mcms command with all subcommands.
func ReadExecutionErrorFromFile ¶
func ReadExecutionErrorFromFile(data []byte) (*evm.ExecutionError, error)
ReadExecutionErrorFromFile reads and parses an execution error from a JSON file.
Types ¶
type Config ¶
type Config struct {
// Logger is the logger to use for command output. Required.
Logger logger.Logger
// Domain is the domain context for the commands. Required.
Domain domain.Domain
// ProposalContextProvider creates proposal context for analysis. Required.
ProposalContextProvider analyzer.ProposalContextProvider
// Deps holds optional dependencies that can be overridden.
// If fields are nil, production defaults are used.
Deps Deps
}
Config holds the configuration for mcms commands.
type DecodedExecutionError ¶
type DecodedExecutionError struct {
RevertReason string
RevertReasonDecoded bool
UnderlyingReason string
UnderlyingReasonDecoded bool
}
DecodedExecutionError contains the decoded revert reasons from an ExecutionError.
type Deps ¶
type Deps struct {
// EnvironmentLoader loads a deployment environment.
EnvironmentLoader EnvironmentLoaderFunc
// ProposalLoader loads a proposal from a file.
ProposalLoader ProposalLoaderFunc
}
Deps holds optional dependencies that can be overridden for testing.
type EnvironmentLoaderFunc ¶
type EnvironmentLoaderFunc func( ctx context.Context, dom domain.Domain, envKey string, lggr logger.Logger, opts ...cldfenvironment.LoadEnvironmentOption, ) (cldf.Environment, error)
EnvironmentLoaderFunc loads a deployment environment.
type ErrDecoder ¶
type ErrDecoder struct {
// contains filtered or unexported fields
}
ErrDecoder indexes custom-error selectors across many ABIs.
func NewErrDecoder ¶
func NewErrDecoder(registry analyzer.EVMABIRegistry) (*ErrDecoder, error)
NewErrDecoder builds an index from EVM ABI registry.
type ErrSig ¶
type ErrSig struct {
TypeVer string
Name string
Inputs abi.Arguments
// contains filtered or unexported fields
}
ErrSig describes a resolved custom error.
type ProposalConfig ¶
type ProposalConfig struct {
Kind types.ProposalKind
Proposal mcms.Proposal
TimelockProposal *mcms.TimelockProposal // nil if not a timelock proposal
ChainSelector uint64
EnvStr string
Env cldf.Environment
ForkedEnv cldfenvironment.ForkedEnvironment // populated when Fork is true
Fork bool
ProposalCtx analyzer.ProposalContext
}
ProposalConfig holds the loaded proposal configuration.
func LoadProposalConfig ¶
func LoadProposalConfig( ctx context.Context, lggr logger.Logger, dom domain.Domain, deps *Deps, proposalCtxProvider analyzer.ProposalContextProvider, flags ProposalFlags, opts ...interface{}, ) (*ProposalConfig, error)
LoadProposalConfig loads and validates a proposal configuration.
type ProposalFlags ¶
type ProposalFlags struct {
ProposalPath string
ProposalKind string
Environment string
ChainSelector uint64
Fork bool
}
ProposalFlags contains common proposal-related flags.
type ProposalLoaderFunc ¶
type ProposalLoaderFunc func(kind types.ProposalKind, path string) (mcms.ProposalInterface, error)
ProposalLoaderFunc loads a proposal from a file.