Skip to content

Commit e923992

Browse files
committed
feat: return container from ton bc
1 parent 1239aee commit e923992

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

book/src/framework/components/blockchains/ton.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ func TestTonSmoke(t *testing.T) {
4848

4949
bc, err := blockchain.NewBlockchainNetwork(in.BlockchainA)
5050
require.NoError(t, err)
51+
// we can also explicitly terminate the container after the test
52+
defer bc.Container.Terminate(t.Context())
5153

5254
var client ton.APIClientWrapped
5355

framework/components/blockchain/ton.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ func newTon(in *Input) (*Output, error) {
123123
Type: in.Type,
124124
Family: FamilyTon,
125125
ContainerName: name,
126+
Container: c,
126127
Nodes: []*Node{{
127128
// Note: define if we need more access other than the global config(tonutils-go only uses liteclients defined in the config)
128129
ExternalHTTPUrl: fmt.Sprintf("%s:%s", "localhost", ports.SimpleServer),

framework/examples/myproject/smoke_ton_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ func TestTonSmoke(t *testing.T) {
2424

2525
bc, err := blockchain.NewBlockchainNetwork(in.BlockchainA)
2626
require.NoError(t, err)
27+
// we can also explicitly terminate the container after the test
28+
defer bc.Container.Terminate(t.Context())
2729

2830
var client ton.APIClientWrapped
2931
t.Run("setup:connect", func(t *testing.T) {

0 commit comments

Comments
 (0)