Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify local network struct #639

Merged
merged 5 commits into from
Nov 13, 2024
Merged

Conversation

cam-schultz
Copy link
Contributor

@cam-schultz cam-schultz commented Nov 7, 2024

Why this should be merged

Cleans up the LocalNetwork struct to act as an extension to tmpnet.

How this works

  • Directly composes LocalNetwork with tmpnet.Network, rather than owning an instance. This automatically exposes all tmpnet.Network methods, allowing for greater flexibility.
  • Moves Teleporter-specific methods from LocalNetwork to TeleporterTestInfo
  • Removes a handful of redundant Teleporter utils methods, instead making them TeleporterTestInfo methods.
  • Construct the primary network and subnet SubnetTestInfo on demand, removing the need to consider stale state when modifying the network.

How this was tested

CI

How is this documented

N/A

Copy link
Contributor

@iansuvak iansuvak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Primarily went through the changes in the network.go and they LGTM.

@@ -41,16 +33,12 @@ import (

// Implements Network, pointing to the network setup in local_network_setup.go
type LocalNetwork struct {
primaryNetworkInfo *interfaces.SubnetTestInfo
subnetsInfo map[ids.ID]*interfaces.SubnetTestInfo
tmpnet.Network
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this change! Love it.

@cam-schultz cam-schultz merged commit fa9d24a into main Nov 13, 2024
17 checks passed
@cam-schultz cam-schultz deleted the simplify-local-network-struct branch November 13, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done ✅
Development

Successfully merging this pull request may close these issues.

3 participants