This repository has been archived by the owner on May 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 346
/
deploy.go
52 lines (46 loc) · 2.12 KB
/
deploy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package def
import (
validation "github.com/go-ozzo/ozzo-validation"
"github.com/hyperledger/burrow/deploy/def/rule"
"github.com/hyperledger/burrow/execution/evm/abi"
)
const DefaultOutputFile = "deploy.output.json"
type DeployArgs struct {
Address string `mapstructure:"," json:"," yaml:"," toml:","`
BinPath string `mapstructure:"," json:"," yaml:"," toml:","`
CurrentOutput string `mapstructure:"," json:"," yaml:"," toml:","`
Debug bool `mapstructure:"," json:"," yaml:"," toml:","`
DefaultAmount string `mapstructure:"," json:"," yaml:"," toml:","`
DefaultFee string `mapstructure:"," json:"," yaml:"," toml:","`
DefaultGas string `mapstructure:"," json:"," yaml:"," toml:","`
DefaultOutput string `mapstructure:"," json:"," yaml:"," toml:","`
DefaultSets []string `mapstructure:"," json:"," yaml:"," toml:","`
Path string `mapstructure:"," json:"," yaml:"," toml:","`
Verbose bool `mapstructure:"," json:"," yaml:"," toml:","`
YAMLPath string `mapstructure:"," json:"," yaml:"," toml:","`
Jobs int `mapstructure:"," json:"," yaml:"," toml:","`
ProposeVerify bool `mapstructure:"," json:"," yaml:"," toml:","`
ProposeVote bool `mapstructure:"," json:"," yaml:"," toml:","`
ProposeCreate bool `mapstructure:"," json:"," yaml:"," toml:","`
AllSpecs *abi.AbiSpec `mapstructure:"," json:"," yaml:"," toml:","`
}
func (do *DeployArgs) Validate() error {
return validation.ValidateStruct(do,
validation.Field(&do.DefaultAmount, rule.Uint64),
validation.Field(&do.DefaultFee, rule.Uint64),
validation.Field(&do.DefaultGas, rule.Uint64),
)
}
type Playbook struct {
Account string
Jobs []*Job
Path string `mapstructure:"-" json:"-" yaml:"-" toml:"-"`
BinPath string `mapstructure:"-" json:"-" yaml:"-" toml:"-"`
// If we're in a proposal or meta job, reference our parent script
Parent *Playbook `mapstructure:"-" json:"-" yaml:"-" toml:"-"`
}
func (pkg *Playbook) Validate() error {
return validation.ValidateStruct(pkg,
validation.Field(&pkg.Jobs),
)
}