diff --git a/tests/antithesis/avalanchego/gencomposeconfig/main.go b/tests/antithesis/avalanchego/gencomposeconfig/main.go index 7425a3df9bb..689375859c1 100644 --- a/tests/antithesis/avalanchego/gencomposeconfig/main.go +++ b/tests/antithesis/avalanchego/gencomposeconfig/main.go @@ -7,14 +7,16 @@ import ( "log" "github.com/ava-labs/avalanchego/tests/antithesis" - "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" ) -const baseImageName = "antithesis-avalanchego" +const ( + baseImageName = "antithesis-avalanchego" + NumNodes = 6 +) // Creates docker-compose.yml and its associated volumes in the target path. func main() { - network := tmpnet.LocalNetworkOrPanic() + network := antithesis.CreateNetwork(NumNodes) if err := antithesis.GenerateComposeConfig(network, baseImageName, "" /* runtimePluginDir */); err != nil { log.Fatalf("failed to generate compose config: %v", err) } diff --git a/tests/antithesis/avalanchego/main.go b/tests/antithesis/avalanchego/main.go index 52c19ed3027..6abfb984bfb 100644 --- a/tests/antithesis/avalanchego/main.go +++ b/tests/antithesis/avalanchego/main.go @@ -39,7 +39,7 @@ import ( xbuilder "github.com/ava-labs/avalanchego/wallet/chain/x/builder" ) -const NumKeys = 5 +const NumKeys = 6 func main() { tc := tests.NewTestContext() diff --git a/tests/antithesis/network.go b/tests/antithesis/network.go new file mode 100644 index 00000000000..7bdb335b7b2 --- /dev/null +++ b/tests/antithesis/network.go @@ -0,0 +1,15 @@ +// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +package antithesis + +import ( + "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" +) + +// Creates a network with the given number of nodes. +func CreateNetwork(nodesCount int) *tmpnet.Network { + network := tmpnet.NewDefaultNetwork("antithesis-network") + network.Nodes = tmpnet.NewNodesOrPanic(nodesCount) + return network +} diff --git a/tests/antithesis/xsvm/gencomposeconfig/main.go b/tests/antithesis/xsvm/gencomposeconfig/main.go index e038daac089..c3c89630f3c 100644 --- a/tests/antithesis/xsvm/gencomposeconfig/main.go +++ b/tests/antithesis/xsvm/gencomposeconfig/main.go @@ -12,11 +12,14 @@ import ( "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" ) -const baseImageName = "antithesis-xsvm" +const ( + baseImageName = "antithesis-xsvm" + NumNodes = 6 +) // Creates docker-compose.yml and its associated volumes in the target path. func main() { - network := tmpnet.LocalNetworkOrPanic() + network := antithesis.CreateNetwork(NumNodes) network.Subnets = []*tmpnet.Subnet{ subnet.NewXSVMOrPanic("xsvm", genesis.VMRQKey, network.Nodes...), } diff --git a/tests/antithesis/xsvm/main.go b/tests/antithesis/xsvm/main.go index a51a3e88f50..18242830766 100644 --- a/tests/antithesis/xsvm/main.go +++ b/tests/antithesis/xsvm/main.go @@ -31,7 +31,7 @@ import ( ) const ( - NumKeys = 5 + NumKeys = 6 PollingInterval = 50 * time.Millisecond )