clean up validation config
This commit is contained in:
parent
72132c851b
commit
bd91008462
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user