Documentation ¶
Index ¶
- Constants
- Variables
- func IsCommonDenominator(name string) bool
- type AppContext
- type ArgReference
- type CallCmdSpec
- type CallCmds
- type ConfigSpec
- type ContractInstanceSpec
- func (spec *ContractInstanceSpec) BoundContract() *ethfw.BoundContract
- func (spec *ContractInstanceSpec) FetchTokenSymbol(ctx AppContext) string
- func (spec *ContractInstanceSpec) IsDeployed() bool
- func (spec *ContractInstanceSpec) TokenSymbol() string
- func (spec *ContractInstanceSpec) Validate(ctx AppContext, name string, src *sol.Contract) bool
- type ContractSpec
- type Contracts
- type Evaler
- type ExprType
- type ExtendedValue
- type FieldName
- type Inventory
- type InventorySpec
- type ParamSpec
- type ParamType
- type Spec
- type TargetCommandSpec
- type TargetSpec
- type Targets
- type Valuer
- type ViewCmdSpec
- type ViewCmds
- type WalletFieldReference
- type WalletSpec
- type Wallets
- func (wallets Wallets) GetAll(rx *regexp.Regexp) []*WalletSpec
- func (wallets Wallets) GetOne(rx *regexp.Regexp, hash string) *WalletSpec
- func (wallets Wallets) NameOf(address string) string
- func (wallets Wallets) Validate(ctx AppContext, spec *Spec) bool
- func (wallets Wallets) WalletSpec(name string) (*WalletSpec, bool)
- type WriteCmdSpec
- type WriteCmds
Constants ¶
View Source
const ZeroAddress = "0x0"
Variables ¶
View Source
var DefaultConfigSpec = &ConfigSpec{ ChainID: "1", GasPrice: ethfw.Gwei(8).String(), GasLimit: "10000000", AwaitTimeout: "10m", }
View Source
var PlaceholderAddr = common.BytesToAddress([]byte("0xEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"))
Functions ¶
func IsCommonDenominator ¶
Types ¶
type AppContext ¶
func NewAppContext ¶
func (AppContext) AppCommand ¶
func (ctx AppContext) AppCommand() string
func (AppContext) AppCommandArgs ¶
func (ctx AppContext) AppCommandArgs() []string
func (AppContext) KeyCache ¶
func (ctx AppContext) KeyCache() ethfw.KeyCache
func (AppContext) NodeGroup ¶
func (ctx AppContext) NodeGroup() string
func (AppContext) SolcCompiler ¶
func (ctx AppContext) SolcCompiler() sol.Compiler
func (AppContext) SpecDir ¶
func (ctx AppContext) SpecDir() string
type ArgReference ¶
type ArgReference struct {
ArgID int
}
type CallCmdSpec ¶
type CallCmdSpec struct { ParamSpec `yaml:",inline"` Description string `yaml:"desc"` Wallet string `yaml:"wallet"` Method string `yaml:"method"` // contains filtered or unexported fields }
func (*CallCmdSpec) ArgCount ¶
func (spec *CallCmdSpec) ArgCount() int
func (*CallCmdSpec) CountArgsUsing ¶
func (spec *CallCmdSpec) CountArgsUsing(set map[int]struct{})
func (*CallCmdSpec) MatchingWallets ¶
func (spec *CallCmdSpec) MatchingWallets() []*WalletSpec
func (*CallCmdSpec) Validate ¶
func (spec *CallCmdSpec) Validate(ctx AppContext, name string, root *Spec) bool
type CallCmds ¶
type CallCmds map[string]*CallCmdSpec
func (CallCmds) CallCmdSpec ¶
func (cmds CallCmds) CallCmdSpec(name string) (*CallCmdSpec, bool)
type ConfigSpec ¶
type ConfigSpec struct { GasPrice string `yaml:"gasPrice"` GasLimit string `yaml:"gasLimit"` ChainID string `yaml:"chainID"` AwaitTimeout string `yaml:"awaitTimeout"` SpecDir string `yaml:"-"` }
func (*ConfigSpec) AwaitTimeoutDuration ¶
func (spec *ConfigSpec) AwaitTimeoutDuration() (time.Duration, error)
func (*ConfigSpec) ChainIDInt ¶
func (spec *ConfigSpec) ChainIDInt() (*big.Int, bool)
func (*ConfigSpec) GasLimitInt ¶
func (spec *ConfigSpec) GasLimitInt() (uint64, error)
func (*ConfigSpec) GasPriceInt ¶
func (spec *ConfigSpec) GasPriceInt() (*big.Int, bool)
func (*ConfigSpec) Validate ¶
func (spec *ConfigSpec) Validate() bool
type ContractInstanceSpec ¶
type ContractInstanceSpec struct { Name string `yaml:"contract"` Address string `yaml:"address"` // contains filtered or unexported fields }
func (*ContractInstanceSpec) BoundContract ¶
func (spec *ContractInstanceSpec) BoundContract() *ethfw.BoundContract
func (*ContractInstanceSpec) FetchTokenSymbol ¶
func (spec *ContractInstanceSpec) FetchTokenSymbol(ctx AppContext) string
func (*ContractInstanceSpec) IsDeployed ¶
func (spec *ContractInstanceSpec) IsDeployed() bool
func (*ContractInstanceSpec) TokenSymbol ¶
func (spec *ContractInstanceSpec) TokenSymbol() string
func (*ContractInstanceSpec) Validate ¶
func (spec *ContractInstanceSpec) Validate(ctx AppContext, name string, src *sol.Contract) bool
type ContractSpec ¶
type ContractSpec struct { Name string `yaml:"name"` SolPath string `yaml:"sol"` SolAllowPaths []string `yaml:"allow"` Instances []*ContractInstanceSpec `yaml:"instances"` // contains filtered or unexported fields }
func (*ContractSpec) Validate ¶
func (spec *ContractSpec) Validate(ctx AppContext, name string) bool
type Contracts ¶
type Contracts map[string]*ContractSpec
func (Contracts) ContractSpec ¶
func (contracts Contracts) ContractSpec(name string) (*ContractSpec, bool)
func (Contracts) FindByTokenSymbol ¶
func (contracts Contracts) FindByTokenSymbol(symbol string) (*ContractInstanceSpec, bool)
type ExtendedValue ¶
type InventorySpec ¶
type InventorySpec []string
func (*InventorySpec) Validate ¶
func (spec *InventorySpec) Validate(ctx AppContext, groupName string) bool
type ParamSpec ¶
type ParamSpec struct { Params []interface{} `yaml:"params"` // contains filtered or unexported fields }
func (*ParamSpec) CountArgsUsing ¶
func (*ParamSpec) ParamValues ¶
func (spec *ParamSpec) ParamValues() []interface{}
type ParamType ¶
type ParamType string
const ( ParamTypeString ParamType = "string" ParamTypeInt ParamType = "int" ParamTypeInt8 ParamType = "int8" ParamTypeInt16 ParamType = "int16" ParamTypeInt32 ParamType = "int32" ParamTypeInt64 ParamType = "int64" ParamTypeInt128 ParamType = "int128" ParamTypeInt256 ParamType = "int256" ParamTypeUInt ParamType = "uint" ParamTypeUInt8 ParamType = "uint8" ParamTypeUInt16 ParamType = "uint16" ParamTypeUInt32 ParamType = "uint32" ParamTypeUInt64 ParamType = "uint64" ParamTypeUInt128 ParamType = "uint128" ParamTypeUInt256 ParamType = "uint256" ParamTypeBoolean ParamType = "bool" ParamTypeAddress ParamType = "address" ParamTypeByte ParamType = "byte" ParamTypeBytes ParamType = "bytes" )
type Spec ¶
type Spec struct { Config *ConfigSpec `yaml:"CONFIG"` Inventory Inventory `yaml:"INVENTORY"` Wallets Wallets `yaml:"WALLETS"` Contracts Contracts `yaml:"CONTRACTS"` Targets Targets `yaml:"TARGETS"` ViewCmds ViewCmds `yaml:"VIEW"` WriteCmds WriteCmds `yaml:"WRITE"` CallCmds CallCmds `yaml:"CALL"` // contains filtered or unexported fields }
func (*Spec) CountArgsUsing ¶
func (*Spec) Validate ¶
func (spec *Spec) Validate(ctx AppContext) bool
type TargetCommandSpec ¶
type TargetCommandSpec string
func (TargetCommandSpec) IsDeferred ¶
func (spec TargetCommandSpec) IsDeferred() bool
func (TargetCommandSpec) Name ¶
func (spec TargetCommandSpec) Name() string
type TargetSpec ¶
type TargetSpec []TargetCommandSpec
func (TargetSpec) ArgCount ¶
func (spec TargetSpec) ArgCount(root *Spec) int
func (TargetSpec) CmdNames ¶
func (spec TargetSpec) CmdNames() []string
func (TargetSpec) Validate ¶
func (spec TargetSpec) Validate(ctx AppContext, name string, root *Spec) bool
type Targets ¶
type Targets map[string]TargetSpec
func (Targets) TargetSpec ¶
func (targets Targets) TargetSpec(name string) (TargetSpec, bool)
type Valuer ¶
type Valuer string
func (Valuer) CountArgsUsing ¶
func (Valuer) Parse ¶
func (v Valuer) Parse(ctx AppContext, root *Spec, additionalDenominators []string) (*ExtendedValue, error)
type ViewCmdSpec ¶
type ViewCmdSpec struct { ParamSpec `yaml:",inline"` Description string `yaml:"desc"` Wallet string `yaml:"wallet"` Method string `yaml:"method"` Instance *ContractInstanceSpec `yaml:"instance"` // contains filtered or unexported fields }
func (*ViewCmdSpec) ArgCount ¶
func (spec *ViewCmdSpec) ArgCount() int
func (*ViewCmdSpec) CountArgsUsing ¶
func (spec *ViewCmdSpec) CountArgsUsing(set map[int]struct{})
func (*ViewCmdSpec) MatchingWallets ¶
func (spec *ViewCmdSpec) MatchingWallets() []*WalletSpec
func (*ViewCmdSpec) Validate ¶
func (spec *ViewCmdSpec) Validate(ctx AppContext, name string, root *Spec) bool
type ViewCmds ¶
type ViewCmds map[string]*ViewCmdSpec
func (ViewCmds) ViewCmdSpec ¶
func (cmds ViewCmds) ViewCmdSpec(name string) (*ViewCmdSpec, bool)
type WalletFieldReference ¶
type WalletSpec ¶
type WalletSpec struct { Address string `yaml:"address"` PrivKey string `yaml:"privkey"` Password string `yaml:"password"` KeyStore string `yaml:"keystore"` KeyFile string `yaml:"keyfile"` Balance *big.Int `yaml:"-"` // contains filtered or unexported fields }
func (*WalletSpec) FieldValue ¶
func (spec *WalletSpec) FieldValue(name FieldName) interface{}
func (*WalletSpec) HasField ¶
func (spec *WalletSpec) HasField(name FieldName) bool
func (*WalletSpec) PrivKeyECDSA ¶
func (spec *WalletSpec) PrivKeyECDSA() *ecdsa.PrivateKey
func (*WalletSpec) Validate ¶
func (spec *WalletSpec) Validate(ctx AppContext, name string) bool
type Wallets ¶
type Wallets map[string]*WalletSpec
func (Wallets) WalletSpec ¶
func (wallets Wallets) WalletSpec(name string) (*WalletSpec, bool)
type WriteCmdSpec ¶
type WriteCmdSpec struct { ParamSpec `yaml:",inline"` Description string `yaml:"desc"` Wallet string `yaml:"wallet"` Sticky string `yaml:"sticky"` To string `yaml:"to"` Value Valuer `yaml:"value"` Method string `yaml:"method"` Instance *ContractInstanceSpec `yaml:"instance"` // contains filtered or unexported fields }
func (*WriteCmdSpec) ArgCount ¶
func (spec *WriteCmdSpec) ArgCount() int
func (*WriteCmdSpec) CountArgsUsing ¶
func (spec *WriteCmdSpec) CountArgsUsing(set map[int]struct{})
func (*WriteCmdSpec) MatchingWallet ¶
func (spec *WriteCmdSpec) MatchingWallet() *WalletSpec
func (*WriteCmdSpec) Validate ¶
func (spec *WriteCmdSpec) Validate(ctx AppContext, name string, root *Spec) bool
type WriteCmds ¶
type WriteCmds map[string]*WriteCmdSpec
func (WriteCmds) WriteCmdSpec ¶
func (cmds WriteCmds) WriteCmdSpec(name string) (*WriteCmdSpec, bool)
Click to show internal directories.
Click to hide internal directories.