Skip to content

Commit 65d9374

Browse files
committed
move contender service conversion logic to components.go
1 parent b7fb2b4 commit 65d9374

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

playground/components.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,14 @@ type Contender struct {
817817
TargetChain string // defaults to "el", may be any chain name in a recipe's spec
818818
}
819819

820+
// Converts a `ContenderContext` into a `Contender` service. `Enabled` is ignored.
821+
func (cc *ContenderContext) Contender() *Contender {
822+
return &Contender{
823+
ExtraArgs: cc.ExtraArgs,
824+
TargetChain: cc.TargetChain,
825+
}
826+
}
827+
820828
func (c *Contender) Name() string {
821829
return "contender"
822830
}

playground/manifest.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,6 @@ func ReadManifest(outputFolder string) (*Manifest, error) {
609609

610610
func (svcManager *Manifest) RunContenderIfEnabled() {
611611
if svcManager.ctx.Contender.Enabled {
612-
svcManager.AddService("contender", &Contender{
613-
ExtraArgs: svcManager.ctx.Contender.ExtraArgs,
614-
TargetChain: svcManager.ctx.Contender.TargetChain,
615-
})
612+
svcManager.AddService("contender", svcManager.ctx.Contender.Contender())
616613
}
617614
}

0 commit comments

Comments
 (0)