Skip to content

Commit

Permalink
test: Ports key assignment to the driver on the PSS feature branch (#…
Browse files Browse the repository at this point in the history
…1628)

* Port key assignment to MBT driver

* Add comment and make var names clearer
  • Loading branch information
p-offtermatt authored and sainoe committed Mar 8, 2024
1 parent 41ec9b0 commit e82ee9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/mbt/driver/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,12 @@ func (s *Driver) setTime(chain ChainId, newTime time.Time) {
testChain.App.BeginBlock(abcitypes.RequestBeginBlock{Header: testChain.CurrentHeader})
}

func (s *Driver) AssignKey(chain ChainId, valIndex int64, value crypto.PublicKey) error {
func (s *Driver) AssignKey(chain ChainId, valIndex int64, key crypto.PublicKey) error {
stakingVal, found := s.stakingValidator(valIndex)
if !found {
return fmt.Errorf("validator with id %v not found on provider", valIndex)
}
return s.providerKeeper().AssignConsumerKey(s.providerCtx(), string(chain), stakingVal, value)
return s.providerKeeper().AssignConsumerKey(s.providerCtx(), string(chain), stakingVal, key)
}

// DeliverPacketToConsumer delivers a packet from the provider to the given consumer recipient.
Expand Down
4 changes: 4 additions & 0 deletions tests/mbt/driver/mbt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ func RunItfTrace(t *testing.T, path string) {
_, _, consumerPrivVals, err := integration.CreateValidators(len(consumerAddressesExpr))
require.NoError(t, err, "Error creating consumer signers")

// consumerAddrNames are the human readable names of consumer addresses in the model
// "realAddrs" are the addresses of the consumer keys on chain
// these maps relate the consumerAddrNames to the priv validators (from which one can get the real address)
// and from the real ddresses to the consumerAddrNames to allow converting between the two easily
consumerAddrNamesToPrivVals := make(map[string]cmttypes.PrivValidator, len(consumerAddressesExpr))
realAddrsToModelConsAddrs := make(map[string]string, len(consumerAddressesExpr))
i := 0
Expand Down

0 comments on commit e82ee9f

Please sign in to comment.