Skip to content

Commit

Permalink
fix: remove EnableDeckSelection feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-sirotin committed Sep 1, 2024
1 parent 6c4177c commit 707f607
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 23 deletions.
1 change: 0 additions & 1 deletion cmd/2sp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func main() {
game.WithStateMessagePeriod(config.StateMessagePeriod),
game.WithEnableSymmetricEncryption(config.EnableSymmetricEncryption),
game.WithClock(clockwork.NewRealClock()),
game.WithFeatureDeckSelection(config.FeatureDeckSelection()),
}

game := game.NewGame(options)
Expand Down
6 changes: 0 additions & 6 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ var wakuDiscV5 bool
var wakuDnsDiscovery bool
var demo bool
var version bool
var featureFlagEnableDeckSelection bool

var Logger *zap.Logger
var LogFilePath string
Expand Down Expand Up @@ -101,7 +100,6 @@ func ParseArguments() {
flag.BoolVar(&wakuDnsDiscovery, "waku.dnsdiscovery", true, "Enable DNS discovery")
flag.BoolVar(&demo, "demo", false, "Run demo and quit")
flag.BoolVar(&version, "version", false, "Print version and quit")
flag.BoolVar(&featureFlagEnableDeckSelection, "feature.deck", false, "Enable deck selection feature")
flag.Parse()

initialAction = strings.Join(flag.Args(), " ")
Expand Down Expand Up @@ -156,7 +154,3 @@ func Demo() bool {
}

func Version() bool { return version }

func FeatureDeckSelection() bool {
return featureFlagEnableDeckSelection
}
5 changes: 1 addition & 4 deletions pkg/game/features.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package game

type FeatureFlags struct {
EnableDeckSelection bool
}

func defaultFeatureFlags() FeatureFlags {
return FeatureFlags{
EnableDeckSelection: false,
}
return FeatureFlags{}
}

type codeControlFlags struct {
Expand Down
3 changes: 0 additions & 3 deletions pkg/game/game.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,6 @@ func (g *Game) hiddenCurrentState() *protocol.State {
}

func (g *Game) SetDeck(deck protocol.Deck) error {
if !g.features.EnableDeckSelection {
return errors.New("deck selection is disabled")
}
if !g.isDealer {
return errors.New("only dealer can set deck")
}
Expand Down
6 changes: 0 additions & 6 deletions pkg/game/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,3 @@ func WithAutoReveal(enabled bool, delay time.Duration) Option {
g.config.AutoRevealDelay = delay
}
}

func WithFeatureDeckSelection(enabled bool) Option {
return func(g *Game) {
g.features.EnableDeckSelection = enabled
}
}
3 changes: 0 additions & 3 deletions pkg/game/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func TestOptions(t *testing.T) {
publishStateLoop := gofakeit.Bool()
autoRevealEnabled := gofakeit.Bool()
autoRevealDelay := time.Duration(gofakeit.Int64())
enableDeckSelection := gofakeit.Bool()

options := []Option{
WithContext(ctx),
Expand All @@ -43,7 +42,6 @@ func TestOptions(t *testing.T) {
WithStateMessagePeriod(stateMessagePeriod),
WithPublishStateLoop(publishStateLoop),
WithAutoReveal(autoRevealEnabled, autoRevealDelay),
WithFeatureDeckSelection(enableDeckSelection),
}
game := NewGame(options)

Expand All @@ -60,7 +58,6 @@ func TestOptions(t *testing.T) {
require.Equal(t, publishStateLoop, game.config.PublishStateLoopEnabled)
require.Equal(t, autoRevealEnabled, game.config.AutoRevealEnabled)
require.Equal(t, autoRevealDelay, game.config.AutoRevealDelay)
require.Equal(t, enableDeckSelection, game.features.EnableDeckSelection)
}

func TestNoTransport(t *testing.T) {
Expand Down

0 comments on commit 707f607

Please sign in to comment.