Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Mar 15, 2024
1 parent 7762759 commit d6abbbe
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions types/mempool/priority_nonce_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,21 @@ type signerExtractionAdapter struct {
}

func (a signerExtractionAdapter) GetSigners(tx sdk.Tx) ([]mempool.SignerData, error) {
if a.UseOld {
sigs, err := tx.(signing.SigVerifiableTx).GetSignaturesV2()
if err != nil {
return nil, err
}
signerData := make([]mempool.SignerData, len(sigs))
for _, sig := range sigs {
signerData = append(signerData, mempool.SignerData{
Signer: sig.PubKey.Address().Bytes(),
Sequence: sig.Sequence,
})
}
return signerData, nil
if !a.UseOld {
return mempool.NewDefaultSignerExtractionAdapter().GetSigners(tx)
}
sigs, err := tx.(signing.SigVerifiableTx).GetSignaturesV2()
if err != nil {
return nil, err
}
signerData := make([]mempool.SignerData, len(sigs))
for _, sig := range sigs {
signerData = append(signerData, mempool.SignerData{
Signer: sig.PubKey.Address().Bytes(),
Sequence: sig.Sequence,
})
}
signerData, err := mempool.NewDefaultSignerExtractionAdapter().GetSigners(tx)
return signerData, err
return signerData, nil
}

func (s *MempoolTestSuite) TestPriorityNonceTxOrderWithAdapter() {
Expand Down

0 comments on commit d6abbbe

Please sign in to comment.