Skip to content

Commit

Permalink
tmpnet: Break config.go up into coherent parts
Browse files Browse the repository at this point in the history
- Move NetworkConfig functionality to Network
- Move NodeConfig functionality to Node
- Move FlagsMap to flags.go
- Move genesis helpers to genesis.go
- Move NodeURI and key generation to utils.go
- Remove redundant node_test.go
  • Loading branch information
marun committed Dec 11, 2023
1 parent 19dca4a commit 2597b74
Show file tree
Hide file tree
Showing 10 changed files with 502 additions and 515 deletions.
2 changes: 1 addition & 1 deletion tests/fixture/e2e/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func NewTestEnvironment(flagVars *FlagVars) *TestEnvironment {
network = StartNetwork(flagVars.AvalancheGoExecPath(), DefaultNetworkDir)
}

uris := network.GetURIs()
uris := tmpnet.GetNodeURIs(network.Nodes)
require.NotEmpty(uris, "network contains no nodes")
tests.Outf("{{green}}network URIs: {{/}} %+v\n", uris)

Expand Down
14 changes: 8 additions & 6 deletions tests/fixture/tmpnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ repositories.
The functionality in this package is grouped by logical purpose into
the following non-test files:

| Filename | Types | Purpose |
|:------------|:--------|:----------------------------------------------|
| defaults.go | <none> | Default configuration |
| network.go | Network | Network-level orchestration and configuration |
| node.go | Node | Node-level orchestration and configuration |
| util.go | <none> | Shared utility functions |
| Filename | Types | Purpose |
|:------------------|:------------|:-----------------------------------------------|
| defaults.go | | Defines common default configuration |
| flags.go | FlagsMap | Simplifies configuration of avalanchego flags |
| genesis.go | | Creates test genesis |
| network.go | Network | Orchestrates and configures temporary networks |
| node.go | Node | Orchestrates and configures nodes |
| utils.go | | Defines shared utility functions |

## Usage

Expand Down
Loading

0 comments on commit 2597b74

Please sign in to comment.