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
//
// ValidationConfig
// Config
//
type ValidationConfig struct {
type Config struct {
trackGas bool
checkExitCode 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
}
func (v ValidationConfig) ValidateExitCode() bool {
func (v Config) ValidateExitCode() bool {
return v.checkExitCode
}
func (v ValidationConfig) ValidateReturnValue() bool {
func (v Config) ValidateReturnValue() bool {
return v.checkReturnValue
}

View File

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