2020-02-27 22:17:08 +00:00
|
|
|
package validation
|
|
|
|
|
|
|
|
//
|
2020-02-28 23:18:37 +00:00
|
|
|
// Config
|
2020-02-27 22:17:08 +00:00
|
|
|
//
|
|
|
|
|
2020-02-28 23:18:37 +00:00
|
|
|
type Config struct {
|
2020-02-27 22:17:08 +00:00
|
|
|
trackGas bool
|
|
|
|
checkExitCode bool
|
|
|
|
checkReturnValue bool
|
2020-03-27 22:26:34 +00:00
|
|
|
checkState bool
|
2020-02-27 22:17:08 +00:00
|
|
|
}
|
|
|
|
|
2020-03-27 22:26:34 +00:00
|
|
|
func NewConfig(gas, exit, ret, state bool) *Config {
|
2020-02-28 23:18:37 +00:00
|
|
|
return &Config{
|
|
|
|
trackGas: gas,
|
|
|
|
checkExitCode: exit,
|
|
|
|
checkReturnValue: ret,
|
2020-03-27 22:26:34 +00:00
|
|
|
checkState: state,
|
2020-02-28 23:18:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (v Config) ValidateGas() bool {
|
2020-02-27 22:17:08 +00:00
|
|
|
return v.trackGas
|
|
|
|
}
|
|
|
|
|
2020-02-28 23:18:37 +00:00
|
|
|
func (v Config) ValidateExitCode() bool {
|
2020-02-27 22:17:08 +00:00
|
|
|
return v.checkExitCode
|
|
|
|
}
|
|
|
|
|
2020-02-28 23:18:37 +00:00
|
|
|
func (v Config) ValidateReturnValue() bool {
|
2020-02-27 22:17:08 +00:00
|
|
|
return v.checkReturnValue
|
|
|
|
}
|
2020-03-27 22:26:34 +00:00
|
|
|
|
|
|
|
func (v Config) ValidateStateRoot() bool {
|
|
|
|
return v.checkState
|
|
|
|
}
|