Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: address solomachine testing refactor follow ups #6085

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1243,9 +1243,8 @@ func (suite *SoloMachineTestSuite) TestUpdateStateOnMisbehaviour() {

func (suite *SoloMachineTestSuite) TestVerifyClientMessageHeader() {
var (
clientMsg exported.ClientMessage
clientState *solomachine.ClientState
clientID string
clientID string
clientMsg exported.ClientMessage
damiannolan marked this conversation as resolved.
Show resolved Hide resolved
)

// test singlesig and multisig public keys
Expand Down Expand Up @@ -1342,7 +1341,6 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageHeader() {
suite.Require().NoError(err)
h.Signature = sig

clientState = cs
clientMsg = h
},
solomachine.ErrSignatureVerificationFailed,
Expand All @@ -1352,6 +1350,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageHeader() {
func() {
// store in temp before assigning to interface type
cs := sm.ClientState()

oldPubKey := sm.PublicKey
h := sm.CreateHeader(sm.Diversifier)

Expand All @@ -1360,23 +1359,18 @@ func (suite *SoloMachineTestSuite) TestVerifyClientMessageHeader() {
sig := sm.GenerateSignature(data)
h.Signature = sig

clientState = cs
clientMsg = h

suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientState(suite.chainA.GetContext(), clientID, sm.ClientState())
},
// TODO(jim): Doesn't fail on VerifySignature
clienttypes.ErrInvalidHeader,
solomachine.ErrSignatureVerificationFailed,
},
{
"failure: consensus state public key is nil - header",
func() {
clientState.ConsensusState.PublicKey = nil
clientMsg = sm.CreateHeader(sm.Diversifier)
suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientState(suite.chainA.GetContext(), clientID, sm.ClientState())
h := sm.CreateHeader(sm.Diversifier)
h.NewPublicKey = nil
clientMsg = h
},
// TODO(jim): Doesn't fail on VerifySignature
clienttypes.ErrInvalidHeader,
solomachine.ErrSignatureVerificationFailed,
Comment on lines -1374 to +1373
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reorganised the code here as it was triggering something similar.

damiannolan marked this conversation as resolved.
Show resolved Hide resolved
},
{
"failure: cannot find client state",
Expand Down
Loading