2020-01-15 23:41:40 +00:00
|
|
|
package featureconfig
|
2019-03-21 02:57:25 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"testing"
|
|
|
|
|
2020-05-31 06:44:34 +00:00
|
|
|
"github.com/urfave/cli/v2"
|
2019-03-21 02:57:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestInitFeatureConfig(t *testing.T) {
|
2020-01-15 23:41:40 +00:00
|
|
|
cfg := &Flags{
|
2020-06-23 15:41:20 +00:00
|
|
|
SkipBLSVerify: true,
|
2019-03-21 02:57:25 +00:00
|
|
|
}
|
2020-01-15 23:41:40 +00:00
|
|
|
Init(cfg)
|
2020-06-23 15:41:20 +00:00
|
|
|
if c := Get(); !c.SkipBLSVerify {
|
|
|
|
t.Errorf("SkipBLSVerify in FeatureFlags incorrect. Wanted true, got false")
|
2019-03-21 02:57:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestConfigureBeaconConfig(t *testing.T) {
|
2020-03-19 21:46:44 +00:00
|
|
|
app := cli.App{}
|
2019-03-21 02:57:25 +00:00
|
|
|
set := flag.NewFlagSet("test", 0)
|
2020-06-23 15:41:20 +00:00
|
|
|
set.Bool(skipBLSVerifyFlag.Name, true, "test")
|
2020-03-19 21:46:44 +00:00
|
|
|
context := cli.NewContext(&app, set, nil)
|
2020-01-15 23:41:40 +00:00
|
|
|
ConfigureBeaconChain(context)
|
2020-06-23 15:41:20 +00:00
|
|
|
if c := Get(); !c.SkipBLSVerify {
|
|
|
|
t.Errorf("SkipBLSVerify in FeatureFlags incorrect. Wanted true, got false")
|
2019-03-21 02:57:25 +00:00
|
|
|
}
|
|
|
|
}
|