Skip to content

Commit c354cef

Browse files
committed
fix: only expose necessary ap
1 parent 440cb30 commit c354cef

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

framework/components/blockchain/blockchain.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ type Output struct {
7272
}
7373

7474
type NetworkSpecificData struct {
75-
SuiAccount *SuiWalletInfo
76-
TonGlobalConfigURL string `toml:"global_config_url"`
75+
SuiAccount *SuiWalletInfo
7776
}
7877

7978
// Node represents blockchain node output, URLs required for connection locally and inside docker network

framework/components/blockchain/ton.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,6 @@ func newTon(in *Input) (*Output, error) {
119119
httpHost, _ := httpCtr.Host(ctx)
120120
httpPort, _ := httpCtr.MappedPort(ctx, nat.Port(fmt.Sprintf("%s/tcp", DefaultTonSimpleServerPort)))
121121

122-
// discover lite‐server addr
123-
liteCtr, _ := stack.ServiceContainer(ctx, "genesis")
124-
liteHost, _ := liteCtr.Host(ctx)
125-
litePort, _ := liteCtr.MappedPort(ctx, nat.Port(fmt.Sprintf("%s/tcp", DefaultTonLiteServerPort)))
126-
127122
return &Output{
128123
UseCache: true,
129124
ChainID: in.ChainID,
@@ -132,11 +127,8 @@ func newTon(in *Input) (*Output, error) {
132127
ContainerName: containerName,
133128
// Note: in case we need 1+ validators, we need to modify the compose file
134129
Nodes: []*Node{{
135-
// Note: define if we need more access other than lite client(tonutils-go only needs lite client)
136-
ExternalHTTPUrl: fmt.Sprintf("%s:%s", liteHost, litePort.Port()),
130+
// Note: define if we need more access other than the global config(tonutils-go only uses liteclients defined in the config)
131+
ExternalHTTPUrl: fmt.Sprintf("%s:%s", httpHost, httpPort.Port()),
137132
}},
138-
NetworkSpecificData: &NetworkSpecificData{
139-
TonGlobalConfigURL: fmt.Sprintf("http://%s:%s/localhost.global.config.json", httpHost, httpPort.Port()),
140-
},
141133
}, nil
142134
}

framework/examples/myproject/smoke_ton_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package examples
22

33
import (
4+
"fmt"
45
"strings"
56
"testing"
67

@@ -25,10 +26,9 @@ func TestTonSmoke(t *testing.T) {
2526
require.NoError(t, err)
2627

2728
var client ton.APIClientWrapped
28-
2929
t.Run("setup:connect", func(t *testing.T) {
3030
connectionPool := liteclient.NewConnectionPool()
31-
cfg, cferr := liteclient.GetConfigFromUrl(t.Context(), bc.NetworkSpecificData.TonGlobalConfigURL)
31+
cfg, cferr := liteclient.GetConfigFromUrl(t.Context(), fmt.Sprintf("http://%s/localhost.global.config.json", bc.Nodes[0].ExternalHTTPUrl))
3232

3333
require.NoError(t, cferr, "Failed to get config from URL")
3434
caerr := connectionPool.AddConnectionsFromConfig(t.Context(), cfg)

0 commit comments

Comments
 (0)