mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 19:40:37 +00:00
d077483577
* v3 import renamings * tidy * fmt * rev * Update beacon-chain/core/epoch/precompute/reward_penalty_test.go * Update beacon-chain/core/helpers/validators_test.go * Update beacon-chain/db/alias.go * Update beacon-chain/db/alias.go * Update beacon-chain/db/alias.go * Update beacon-chain/db/iface/BUILD.bazel * Update beacon-chain/db/kv/kv.go * Update beacon-chain/db/kv/state.go * Update beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go * Update beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go * Update beacon-chain/sync/initial-sync/service.go * fix deps * fix bad replacements * fix bad replacements * change back * gohashtree version * fix deps Co-authored-by: Nishant Das <nishdas93@gmail.com> Co-authored-by: Potuz <potuz@prysmaticlabs.com>
45 lines
950 B
Go
45 lines
950 B
Go
package cmd
|
|
|
|
import (
|
|
"flag"
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/v3/config/params"
|
|
"github.com/prysmaticlabs/prysm/v3/testing/assert"
|
|
"github.com/prysmaticlabs/prysm/v3/testing/require"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
func TestOverrideConfig(t *testing.T) {
|
|
cfg := &Flags{
|
|
MinimalConfig: true,
|
|
}
|
|
reset := InitWithReset(cfg)
|
|
defer reset()
|
|
c := Get()
|
|
assert.Equal(t, true, c.MinimalConfig)
|
|
}
|
|
|
|
func TestDefaultConfig(t *testing.T) {
|
|
cfg := &Flags{
|
|
MaxRPCPageSize: params.BeaconConfig().DefaultPageSize,
|
|
}
|
|
c := Get()
|
|
assert.DeepEqual(t, c, cfg)
|
|
|
|
reset := InitWithReset(cfg)
|
|
defer reset()
|
|
c = Get()
|
|
assert.DeepEqual(t, c, cfg)
|
|
}
|
|
|
|
func TestConfigureBeaconConfig(t *testing.T) {
|
|
app := cli.App{}
|
|
set := flag.NewFlagSet("test", 0)
|
|
set.Bool(MinimalConfigFlag.Name, true, "test")
|
|
context := cli.NewContext(&app, set, nil)
|
|
require.NoError(t, ConfigureBeaconChain(context))
|
|
c := Get()
|
|
assert.Equal(t, true, c.MinimalConfig)
|
|
}
|