mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
5a66807989
* First take at updating everything to v5 * Patch gRPC gateway to use prysm v5 Fix patch * Update go ssz --------- Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
45 lines
950 B
Go
45 lines
950 B
Go
package cmd
|
|
|
|
import (
|
|
"flag"
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/config/params"
|
|
"github.com/prysmaticlabs/prysm/v5/testing/assert"
|
|
"github.com/prysmaticlabs/prysm/v5/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)
|
|
}
|