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 2c66ba6
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/flows/teleporter_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"

"github.com/ava-labs/subnet-evm/accounts/abi/bind"
teleportermessenger "github.com/ava-labs/teleporter/abi-bindings/go/teleporter/TeleporterMessenger"
"github.com/ava-labs/teleporter/tests/interfaces"
"github.com/ava-labs/teleporter/tests/utils"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -125,6 +126,9 @@ func TeleporterRegistry(network interfaces.LocalNetwork) {
Expect(minTeleporterVersionUpdatedEvent.OldMinTeleporterVersion.Cmp(minTeleporterVersion)).Should(Equal(0))
Expect(minTeleporterVersionUpdatedEvent.NewMinTeleporterVersion.Cmp(latestVersionB)).Should(Equal(0))

cChainInfo = network.GetPrimaryNetworkInfo()
subnetAInfo, subnetBInfo = utils.GetTwoSubnets(network)

// Send a message using old Teleporter version to test messenger with updated minimum Teleporter version.
// Message should fail since we updated minimum Teleporter version.
utils.SendExampleCrossChainMessageAndVerify(
Expand All @@ -142,8 +146,16 @@ func TeleporterRegistry(network interfaces.LocalNetwork) {

// Update the subnets to use new Teleporter messengers
network.SetTeleporterContractAddress(newTeleporterAddress)
cChainInfo = network.GetPrimaryNetworkInfo()
subnetAInfo, subnetBInfo = utils.GetTwoSubnets(network)
teleporterMessengerA, err := teleportermessenger.NewTeleporterMessenger(
newTeleporterAddress, subnetAInfo.RPCClient,
)
Expect(err).Should(BeNil())
subnetAInfo.TeleporterMessenger = teleporterMessengerA
teleporterMessengerC, err := teleportermessenger.NewTeleporterMessenger(
newTeleporterAddress, cChainInfo.RPCClient,
)
Expect(err).Should(BeNil())
cChainInfo.TeleporterMessenger = teleporterMessengerC

utils.SendExampleCrossChainMessageAndVerify(
ctx,
Expand Down

0 comments on commit 2c66ba6

Please sign in to comment.