Skip to content

Commit

Permalink
Fix tests?
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff-vball committed Jul 31, 2024
1 parent 0138aa2 commit 81705aa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/flows/teleporter_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func TeleporterRegistry(network interfaces.LocalNetwork) {
false,
)

// Update the subnets to use new Teleporter messengers
// Manually update the subnets to use new Teleporter messengers.
network.SetTeleporterContractAddress(newTeleporterAddress)
cChainInfo = network.GetPrimaryNetworkInfo()
subnetAInfo, subnetBInfo = utils.GetTwoSubnets(network)
Expand Down
2 changes: 1 addition & 1 deletion tests/local/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ var _ = ginkgo.Describe("[Teleporter integration tests]", func() {
func() {
flows.RelayerModifiesMessage(LocalNetworkInstance)
})
ginkgo.It("Teleporter registry",
ginkgo.FIt("Teleporter registry",
ginkgo.Label(upgradeabilityLabel),
func() {
flows.TeleporterRegistry(LocalNetworkInstance)
Expand Down
9 changes: 7 additions & 2 deletions tests/local/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"math/big"
"os"
"slices"
"sort"
"time"

"github.com/ava-labs/avalanchego/api/info"
Expand Down Expand Up @@ -44,7 +45,7 @@ type LocalNetwork struct {
primaryNetworkInfo *interfaces.SubnetTestInfo
subnetsInfo map[ids.ID]*interfaces.SubnetTestInfo

extraNodes []*tmpnet.Node // to add as more subnet vaidators in the tests
extraNodes []*tmpnet.Node // to add as more subnet validators in the tests

globalFundedKey *ecdsa.PrivateKey

Expand Down Expand Up @@ -339,11 +340,15 @@ func (n *LocalNetwork) DeployTeleporterRegistryContracts(
log.Info("Deployed TeleporterRegistry contracts to all subnets")
}

// Returns all subnet info sorted in lexicographic order of SubnetName.
func (n *LocalNetwork) GetSubnetsInfo() []interfaces.SubnetTestInfo {
subnetsInfo := make([]interfaces.SubnetTestInfo, 0, len(n.subnetsInfo))
for _, subnetInfo := range n.subnetsInfo {
subnetsInfo = append(subnetsInfo, *subnetInfo)
}
sort.Slice(subnetsInfo, func(i, j int) bool {
return subnetsInfo[i].SubnetName < subnetsInfo[j].SubnetName
})
return subnetsInfo
}

Expand Down Expand Up @@ -438,7 +443,7 @@ func (n *LocalNetwork) setAllSubnetValues() {
for _, subnetInfo := range n.subnetsInfo {
subnet := n.tmpnet.GetSubnet(subnetInfo.SubnetName)
Expect(subnet).ShouldNot(BeNil())
n.setSubnetValues(n.tmpnet.GetSubnet(subnetInfo.SubnetName))
n.setSubnetValues(subnet)
}

n.setPrimaryNetworkValues()
Expand Down

0 comments on commit 81705aa

Please sign in to comment.