@@ -172,7 +172,6 @@ func createAllShardsAllValidatorsCfg(
172
172
173
173
func (s * ShardedSuite ) start (
174
174
cfg * nilservice.Config ,
175
- networkConfigOverrides network.ConfigOverrides ,
176
175
port int ,
177
176
shardCfgGen func (
178
177
* ShardedSuite ,
@@ -181,6 +180,7 @@ func (s *ShardedSuite) start(
181
180
* network.Config ,
182
181
map [InstanceId ]* keys.ValidatorKeysManager ,
183
182
) * nilservice.Config ,
183
+ options ... network.Option ,
184
184
) {
185
185
s .T ().Helper ()
186
186
s .Context , s .ctxCancel = context .WithCancel (context .Background ())
@@ -196,7 +196,7 @@ func (s *ShardedSuite) start(
196
196
instanceCount := cfg .NShards - 1
197
197
networkConfigs , p2pAddresses := network .GenerateConfigs (s .T (), instanceCount , port )
198
198
for _ , networkConfig := range networkConfigs {
199
- networkConfigOverrides . ApplyToConfig ( networkConfig )
199
+ s . Require (). NoError ( networkConfig . Apply ( options ... ) )
200
200
}
201
201
keysManagers := make (map [InstanceId ]* keys.ValidatorKeysManager )
202
202
s .Instances = make ([]Instance , instanceCount )
@@ -255,16 +255,16 @@ func (s *ShardedSuite) start(
255
255
s .waitShardsTick (cfg .NShards )
256
256
}
257
257
258
- func (s * ShardedSuite ) Start (cfg * nilservice.Config , networkConfigOverrides network. ConfigOverrides , port int ) {
258
+ func (s * ShardedSuite ) Start (cfg * nilservice.Config , port int , options ... network. Option ) {
259
259
s .T ().Helper ()
260
260
261
- s .start (cfg , networkConfigOverrides , port , createOneShardOneValidatorCfg )
261
+ s .start (cfg , port , createOneShardOneValidatorCfg , options ... )
262
262
}
263
263
264
264
func (s * ShardedSuite ) StartShardAllValidators (cfg * nilservice.Config , port int ) {
265
265
s .T ().Helper ()
266
266
267
- s .start (cfg , network. ConfigOverrides {}, port , createAllShardsAllValidatorsCfg )
267
+ s .start (cfg , port , createAllShardsAllValidatorsCfg )
268
268
}
269
269
270
270
func (s * ShardedSuite ) connectToInstances (nm * network.Manager ) {
@@ -288,13 +288,13 @@ func (s *ShardedSuite) GetNShards() uint32 {
288
288
}
289
289
290
290
type ArchiveNodeConfig struct {
291
- Ctx context.Context
292
- Wg * sync.WaitGroup
293
- AllowDbDrop bool
294
- Port int
295
- WithBootstrapPeers bool
296
- DisableConsensus bool
297
- NetworkConfigOverrides network.ConfigOverrides
291
+ Ctx context.Context
292
+ Wg * sync.WaitGroup
293
+ AllowDbDrop bool
294
+ Port int
295
+ WithBootstrapPeers bool
296
+ DisableConsensus bool
297
+ NetworkOptions [] network.Option
298
298
}
299
299
300
300
func (s * ShardedSuite ) RunArchiveNode (params * ArchiveNodeConfig ) (* nilservice.Config , network.AddrInfo , chan error ) {
@@ -311,7 +311,7 @@ func (s *ShardedSuite) RunArchiveNode(params *ArchiveNodeConfig) (*nilservice.Co
311
311
312
312
s .Require ().NotEmpty (s .Instances )
313
313
netCfg , addr := network .GenerateConfig (s .T (), params .Port )
314
- params . NetworkConfigOverrides . ApplyToConfig (netCfg )
314
+ s . Require (). NoError (netCfg . Apply ( params . NetworkOptions ... ) )
315
315
serviceName := fmt .Sprintf ("archive-%d" , params .Port )
316
316
317
317
cfg := & nilservice.Config {
0 commit comments