Skip to content

Commit 42a6cc9

Browse files
author
Ilan
committed
Use with/without ws flag
1 parent 508e24b commit 42a6cc9

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

framework/components/blockchain/anvil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func defaultAnvil(in *Input) {
2525
// newAnvil deploy foundry anvil node
2626
func newAnvil(in *Input) (*Output, error) {
2727
defaultAnvil(in)
28-
req := baseRequest(in, false)
28+
req := baseRequest(in, WithoutWsEndpoint)
2929

3030
req.Image = in.Image
3131
req.AlwaysPullImage = in.PullImage

framework/components/blockchain/anvil_zksync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ RUN curl -L https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/in
4343
// see: https://foundry-book.zksync.io/getting-started/installation#using-foundry-with-docker
4444
func newAnvilZksync(in *Input) (*Output, error) {
4545
defaultAnvilZksync(in)
46-
req := baseRequest(in, false)
46+
req := baseRequest(in, WithoutWsEndpoint)
4747

4848
tempDir, err := os.MkdirTemp(".", "anvil-zksync-dockercontext")
4949
if err != nil {

framework/components/blockchain/besu.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func defaultBesu(in *Input) {
2323

2424
func newBesu(in *Input) (*Output, error) {
2525
defaultBesu(in)
26-
req := baseRequest(in, true)
26+
req := baseRequest(in, WithWsEndpoint)
2727

2828
req.Image = in.Image
2929
req.AlwaysPullImage = in.PullImage

framework/components/blockchain/containers.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ import (
1313
"github.com/smartcontractkit/chainlink-testing-framework/framework"
1414
)
1515

16-
func baseRequest(in *Input, useWS bool) testcontainers.ContainerRequest {
16+
type ExposeWs = bool
17+
18+
const (
19+
WithWsEndpoint ExposeWs = true
20+
WithoutWsEndpoint ExposeWs = false
21+
)
22+
23+
func baseRequest(in *Input, useWS ExposeWs) testcontainers.ContainerRequest {
1724
containerName := framework.DefaultTCName("blockchain-node")
1825
bindPort := fmt.Sprintf("%s/tcp", in.Port)
1926
exposedPorts := []string{bindPort}

framework/components/blockchain/geth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func defaultGeth(in *Input) {
7878

7979
func newGeth(in *Input) (*Output, error) {
8080
defaultGeth(in)
81-
req := baseRequest(in, false)
81+
req := baseRequest(in, WithoutWsEndpoint)
8282
defaultCmd := []string{
8383
"--http.corsdomain=*",
8484
"--http.vhosts=*",

0 commit comments

Comments
 (0)