From ccf24af7d3d7675b65824a4b8052a95f71564efc Mon Sep 17 00:00:00 2001
From: Philip Offtermatt
Date: Wed, 6 Mar 2024 11:09:48 +0100
Subject: [PATCH] Take into account comments
---
tests/mbt/driver/mbt_test.go | 11 ++++-------
tests/mbt/driver/setup.go | 10 ----------
tests/mbt/model/ccv.qnt | 2 +-
tests/mbt/model/ccv_model.qnt | 2 +-
4 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/tests/mbt/driver/mbt_test.go b/tests/mbt/driver/mbt_test.go
index b1d8afbdcf..df748ea11f 100644
--- a/tests/mbt/driver/mbt_test.go
+++ b/tests/mbt/driver/mbt_test.go
@@ -209,11 +209,11 @@ func RunItfTrace(t *testing.T, path string) {
for index, state := range trace.States {
t.Log("Height modulo epoch length:", driver.providerChain().CurrentHeader.Height%blocksPerEpoch)
- t.Log("Model height:", ProviderHeight(state.VarValues["currentState"].Value.(itf.MapExprType))%modelBlocksPerEpoch)
+ t.Log("Model height modulo epoch length:", ProviderHeight(state.VarValues["currentState"].Value.(itf.MapExprType))%modelBlocksPerEpoch)
t.Logf("Reading state %v of trace %v", index, path)
// store the height of the provider state before each step.
- // The height should only pass an epoch when there passes an epoch in the model, too,
+ // The height should only pass an epoch when it passes an epoch in the model, too,
// otherwise there is an error, and blocksPerEpoch needs to be increased.
// See the comment for blocksPerEpoch above.
heightBeforeStep := driver.providerHeight()
@@ -273,8 +273,8 @@ func RunItfTrace(t *testing.T, path string) {
// we need at least 2 blocks, because for a packet sent at height H, the receiving chain
// needs a header of height H+1 to accept the packet
- // so, we do `blocksPerEpoch` time advancements with a very small increment,
- // and then increment the rest of the time
+ // so, we do two blocks, one with a very small increment,
+ // and then another to increment the rest of the time
runningConsumersBefore := driver.runningConsumers()
driver.endAndBeginBlock("provider", 1*time.Nanosecond)
@@ -558,9 +558,6 @@ func ComparePacketQueues(
consumer string,
timeOffset time.Time,
) {
- if consumer == "consumer1" {
- return
- }
t.Helper()
ComparePacketQueue(t, driver, currentModelState, PROVIDER, consumer, timeOffset)
ComparePacketQueue(t, driver, currentModelState, consumer, PROVIDER, timeOffset)
diff --git a/tests/mbt/driver/setup.go b/tests/mbt/driver/setup.go
index a794dce297..c0020a4095 100644
--- a/tests/mbt/driver/setup.go
+++ b/tests/mbt/driver/setup.go
@@ -397,16 +397,6 @@ func (s *Driver) ConfigureNewPath(consumerChain, providerChain *ibctesting.TestC
// their channel, and are ready for anything to happen.
s.consumerKeeper(consumerChainId).SetProviderChannel(s.ctx(consumerChainId), consumerEndPoint.ChannelID)
- // Commit a block on the consumer to get a header
- lastConsumerHeader, _ := simibc.EndBlock(consumerChain, func() {})
-
- // Begin a block on the consumer to get it ready for testing
- simibc.BeginBlock(consumerChain, 5)
-
- // Update the client on the provider with the latest consumer header
- err = simibc.UpdateReceiverClient(consumerEndPoint, providerEndPoint, lastConsumerHeader, false)
- require.NoError(s.t, err, "Error updating client on consumer for chain %v", consumerChain.ChainID)
-
// path is ready to go
return path
}
diff --git a/tests/mbt/model/ccv.qnt b/tests/mbt/model/ccv.qnt
index adcbbd3e54..2a81fe3a2d 100644
--- a/tests/mbt/model/ccv.qnt
+++ b/tests/mbt/model/ccv.qnt
@@ -89,7 +89,7 @@ module ccv_types {
// Stores VscPackets which have been sent but where the provider has *not received a response yet*.
sentVscPacketsToConsumer: Chain -> List[VscPacket],
- // stores for which consumer chains, in this epoch, the validator set is considered to have changed and we thus need to send a vscPacket to the consumer chains.
+ // stores for which consumer chains, in this epoch, the validator set is considered to have changed and we thus need to send a VscPacket to the consumer chains.
consumersWithPowerChangesInThisEpoch: Set[Chain],
// stores, for each consumer chain, its current status -
diff --git a/tests/mbt/model/ccv_model.qnt b/tests/mbt/model/ccv_model.qnt
index d37159f174..b9913c0a35 100644
--- a/tests/mbt/model/ccv_model.qnt
+++ b/tests/mbt/model/ccv_model.qnt
@@ -542,7 +542,7 @@ module ccv_model {
// change voting power on provider again
VotingPowerChange("node1", 50).then(
// end the epoch
- EndProviderEpoch(3 * Second, Set(), Set())
+ EndProviderEpoch(1 * Second, Set(), Set())
)
.then(
// deliver packet to consumer1