Skip to content

Commit

Permalink
Expose testcontainer.Container so code can clean up it's containers
Browse files Browse the repository at this point in the history
  • Loading branch information
smickovskid authored and archseer committed Jan 10, 2025
1 parent 3e4d216 commit a665d07
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions framework/components/blockchain/anvil.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func newAnvil(in *Input) (*Output, error) {
Family: "evm",
ChainID: in.ChainID,
ContainerName: containerName,
Container: c,
Nodes: []*Node{
{
HostWSUrl: fmt.Sprintf("ws://%s:%s", host, mp.Port()),
Expand Down
1 change: 1 addition & 0 deletions framework/components/blockchain/besu.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func newBesu(in *Input) (*Output, error) {
ChainID: in.ChainID,
Family: "evm",
ContainerName: containerName,
Container: c,
Nodes: []*Node{
{
HostHTTPUrl: fmt.Sprintf("http://%s:%s", host, mp.Port()),
Expand Down
12 changes: 7 additions & 5 deletions framework/components/blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package blockchain

import (
"fmt"
"github.com/testcontainers/testcontainers-go"
)

// Input is a blockchain network configuration params
Expand Down Expand Up @@ -29,11 +30,12 @@ type Input struct {

// Output is a blockchain network output, ChainID and one or more nodes that forms the network
type Output struct {
UseCache bool `toml:"use_cache"`
Family string `toml:"family"`
ContainerName string `toml:"container_name"`
ChainID string `toml:"chain_id"`
Nodes []*Node `toml:"nodes"`
UseCache bool `toml:"use_cache"`
Family string `toml:"family"`
ContainerName string `toml:"container_name"`
Container testcontainers.Container `toml:"-"`
ChainID string `toml:"chain_id"`
Nodes []*Node `toml:"nodes"`
}

// Node represents blockchain node output, URLs required for connection locally and inside docker network
Expand Down
1 change: 1 addition & 0 deletions framework/components/blockchain/geth.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ func newGeth(in *Input) (*Output, error) {
Family: "evm",
ChainID: in.ChainID,
ContainerName: containerName,
Container: c,
Nodes: []*Node{
{
HostHTTPUrl: fmt.Sprintf("http://%s:%s", host, mp.Port()),
Expand Down
1 change: 1 addition & 0 deletions framework/components/blockchain/solana.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func newSolana(in *Input) (*Output, error) {
UseCache: true,
Family: "solana",
ContainerName: containerName,
Container: c,
Nodes: []*Node{
{
HostWSUrl: fmt.Sprintf("ws://%s:%s", host, in.WSPort),
Expand Down

0 comments on commit a665d07

Please sign in to comment.