lotus/chain/validation/config.go

38 lines
601 B
Go
Raw Permalink Normal View History

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
checkState bool
2020-02-27 22:17:08 +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,
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
}
func (v Config) ValidateStateRoot() bool {
return v.checkState
}