Documentation
¶
Overview ¶
Package commands contains common commands that can be injected into each domain's CLI application.
Index ¶
- Constants
- func GetContractCreationTx(ctx context.Context, endpoint string, addressStr string, apiKey string) (string, error)
- func GetContractCreationTxFallback(ctx context.Context, endpoint string, addressStr string, apiKey string) (string, error)
- func IsContractVerified(ctx context.Context, endpoint string, addressStr string, apiKey string) (bool, error)
- type APIResponse
- type AddressTxListResponse
- type Commands
- func (c Commands) NewDurablePipelineCmds(domain dom.Domain, ...) *cobra.Command
- func (c Commands) NewEnvCmds(domain domain.Domain) *cobra.Command
- func (c Commands) NewEvmCmds(domain domain.Domain) *cobra.Command
- func (c Commands) NewJDCmds(domain domain.Domain) *cobra.Command
- func (c Commands) NewMigrationCmds(domain domain.Domain, loadFunc LoadRegistryFunc, ...) *cobra.Command
- func (c Commands) NewStateCmds(dom domain.Domain, config StateConfig) *cobra.Command
- type ContractABIResponse
- type ContractCreationResult
- type ContractCreationTxResponse
- type ContractToVerify
- type ContractsToVerify
- type DecodeProposalCtxProvider
- type LoadRegistryFunc
- type NodeSet
- type NodeView
- type ProposalView
- type StateConfig
Constants ¶
const ( // BytecodeOffset takes a length-128 hex string sample at the end of the contract bytecode to compare in transaction data. // 128 hex (64 bytes) provides both minimum collision risk with encoded constructor args, and minimum mismatch risk with transaction init data. BytecodeOffset = 128 )
Variables ¶
This section is empty.
Functions ¶
func GetContractCreationTx ¶ added in v0.42.0
func GetContractCreationTx(ctx context.Context, endpoint string, addressStr string, apiKey string) (string, error)
GetContractCreationTx finds contract creation tx by querying getcontractcreation action. It is a short-cut provided by most Etherscan instances.
func GetContractCreationTxFallback ¶ added in v0.42.0
func GetContractCreationTxFallback(ctx context.Context, endpoint string, addressStr string, apiKey string) (string, error)
GetContractCreationTxFallback finds contract creation tx by searching tx history. Some Etherscan instances may not support getcontractcreation action, we can fall back to parsing transaction history. Example offenders are Avax Fuji Etherscan and BSC Testnet Etherscan
Types ¶
type APIResponse ¶ added in v0.42.0
type AddressTxListResponse ¶ added in v0.42.0
type AddressTxListResponse struct { APIResponse Result []struct { BlockNumber string `json:"blockNumber"` TimeStamp string `json:"timeStamp"` Hash string `json:"hash"` } `json:"result"` }
type Commands ¶
type Commands struct {
// contains filtered or unexported fields
}
Commands provides a set of common commands that can be integrated into Domain-specific CLIs.
func NewCommands ¶
NewCommands creates a new instance of Commands.
func (Commands) NewDurablePipelineCmds ¶ added in v0.44.0
func (c Commands) NewDurablePipelineCmds( domain dom.Domain, loadMigration func(envName string) (*cs.ChangesetsRegistry, error), decodeProposalCtxProvider func(env fdeployment.Environment) (analyzer.ProposalContext, error), loadConfigResolvers *fresolvers.ConfigResolverManager) *cobra.Command
TODO: envLoader needs to be refactored to an interface so we can mock it for testing to avoid using real backends
func (Commands) NewEnvCmds ¶
NewEnvCmds creates a new set of commands for managing environment.
func (Commands) NewEvmCmds ¶ added in v0.42.0
NewEvmCmds creates EVM-related commands for managing gas, nonces, and node funding.
func (Commands) NewJDCmds ¶ added in v0.42.0
NewJDCmds holds the commands related to job distributor.
func (Commands) NewMigrationCmds ¶ added in v0.44.0
func (c Commands) NewMigrationCmds( domain domain.Domain, loadFunc LoadRegistryFunc, decodeProposalContext DecodeProposalCtxProvider, ) *cobra.Command
NewMigrationCmds creates a new set of commands for managing migrations.
func (Commands) NewStateCmds ¶
NewStateCmds creates a new set of commands for state environment.
type ContractABIResponse ¶ added in v0.42.0
type ContractABIResponse struct { APIResponse Result string `json:"result"` }
type ContractCreationResult ¶ added in v0.42.0
type ContractCreationTxResponse ¶ added in v0.42.0
type ContractCreationTxResponse struct { APIResponse Result json.RawMessage `json:"result"` }
type ContractToVerify ¶ added in v0.42.0
type ContractsToVerify ¶ added in v0.42.0
type ContractsToVerify struct {
Contracts []ContractToVerify `toml:"contracts"`
}
type DecodeProposalCtxProvider ¶ added in v0.44.0
type DecodeProposalCtxProvider func(env deployment.Environment) (analyzer.ProposalContext, error)
DecodeProposalCtxProvider is a function type that adds decoding context based on the environment.
type LoadRegistryFunc ¶ added in v0.44.0
type LoadRegistryFunc func(envKey string) (*changeset.ChangesetsRegistry, error)
LoadRegistryFunc is a function type that loads the migrations registry for a given environment key.
type NodeView ¶ added in v0.42.0
type NodeView struct { *nodev1.Node // CreatedAt is the creation timestamp of the node CreatedAt string `json:"created_at"` // UpdatedAt is the last updated timestamp of the node UpdatedAt string `json:"updated_at"` // Jobs maps a job UUID to a list of proposal views Jobs map[string][]ProposalView `json:"jobs,omitempty"` }
NodeView is a view of a node that optionally includes a map of jobs.
type ProposalView ¶ added in v0.42.0
type ProposalView struct { ID string `json:"id"` JobID string `json:"job_id"` Status string `json:"status"` Revision int64 `json:"revision"` DeliveryStatus string `json:"delivery_status"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` AckedAt string `json:"acked_at"` ResponseReceivedAt string `json:"response_received_at"` }
ProposalView is the viewable version of a proposal.
type StateConfig ¶
type StateConfig struct {
ViewState deployment.ViewStateV2
}