clean up validation config

This commit is contained in:
frrist 2020-02-28 15:18:37 -08:00
parent 72132c851b
commit bd91008462
2 changed files with 18 additions and 11 deletions

View File

@ -1,24 +1,31 @@
package validation package validation
// //
// ValidationConfig // Config
// //
type ValidationConfig struct { type Config struct {
trackGas bool trackGas bool
checkExitCode bool checkExitCode bool
checkReturnValue bool checkReturnValue bool
} }
func (v ValidationConfig) ValidateGas() bool { func NewConfig(gas, exit, ret bool) *Config {
return &Config{
trackGas: gas,
checkExitCode: exit,
checkReturnValue: ret,
}
}
func (v Config) ValidateGas() bool {
return v.trackGas return v.trackGas
} }
func (v ValidationConfig) ValidateExitCode() bool { func (v Config) ValidateExitCode() bool {
return v.checkExitCode return v.checkExitCode
} }
func (v ValidationConfig) ValidateReturnValue() bool { func (v Config) ValidateReturnValue() bool {
return v.checkReturnValue return v.checkReturnValue
} }

View File

@ -39,9 +39,9 @@ func (f *Factories) NewRandomnessSource() vstate.RandomnessSource {
} }
func (f *Factories) NewValidationConfig() vstate.ValidationConfig { func (f *Factories) NewValidationConfig() vstate.ValidationConfig {
return &ValidationConfig{ trackGas := false
trackGas: false, checkExit := true
checkExitCode: true, checkRet := false
checkReturnValue: false, // ignore gas and return value assertions
} return NewConfig(trackGas, checkExit, checkRet)
} }