Skip to content

Commit

Permalink
Minor fixes based on PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
p-offtermatt committed Dec 15, 2023
1 parent 357541f commit 73ba96f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 2 additions & 5 deletions tests/mbt/driver/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ func (s *Driver) consumerPower(i int64, chain ChainId) (int64, error) {
return v.Power, nil
}

// consumerTokens returns the number of tokens that the validator with
// id (ix) i has delegated to it in total on the provider chain
// providerPower returns the power(=number of bonded tokens) of the i-th validator on the provider.
func (s *Driver) providerPower(i int64) (int64, error) {
v, found := s.providerStakingKeeper().GetValidator(s.ctx(PROVIDER), s.validator(i))
if !found {
Expand Down Expand Up @@ -181,9 +180,8 @@ func (s *Driver) packetQueue(sender, receiver ChainId) []simibc.Packet {
res, ok := outboxPackets[string(sender)]
if !ok {
return []simibc.Packet{}
} else {
return res
}
return res
}

func (s *Driver) getStateString() string {
Expand Down Expand Up @@ -345,7 +343,6 @@ func (s *Driver) endAndBeginBlock(chain ChainId, timeAdvancement time.Duration)
}

func (s *Driver) runningConsumers() []providertypes.Chain {
// consumers that are still consumers on the provider
consumersOnProvider := s.providerKeeper().GetAllConsumerChains(s.providerCtx())

consumersWithIntactChannel := make([]providertypes.Chain, 0)
Expand Down
6 changes: 3 additions & 3 deletions tests/mbt/driver/model_viewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ func GetSendingTimeForPacket(packetExpr itf.MapExprType) int64 {
func VscSendTimestamps(curStateExpr itf.MapExprType, consumer string) []int64 {
sentVscPackets := ProviderState(curStateExpr)["sentVscPacketsToConsumer"].Value.(itf.MapExprType)[consumer].Value.(itf.ListExprType)

res := make([]int64, 0)
for _, packetExpr := range sentVscPackets {
res = append(res, GetSendingTimeForPacket(packetExpr.Value.(itf.MapExprType)))
res := make([]int64, len(sentVscPackets))
for i, packetExpr := range sentVscPackets {
res[i] = GetSendingTimeForPacket(packetExpr.Value.(itf.MapExprType))
}
return res
}

0 comments on commit 73ba96f

Please sign in to comment.