-
Notifications
You must be signed in to change notification settings - Fork 625
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
Cherry-pick: Add MsgRegisterCounterparty Struct and Handler from ibc-lite #6982
Cherry-pick: Add MsgRegisterCounterparty Struct and Handler from ibc-lite #6982
Conversation
* imp: added counterparty client store * imp: added provide counterparty to proto * imp: ran 'make proto-all' * imp: added logic to counterparty client * imp: fix proto * imp: fix proto * imp: ran 'make proto-all' * feat: finished counterparty client logic
Once that commit is in, we should also remove the newly added fields to CreateClient. They are unnecessary as we can get them done in a MultiMsg |
@@ -43,7 +44,13 @@ func (k *Keeper) CreateClient(goCtx context.Context, msg *clienttypes.MsgCreateC | |||
return nil, err | |||
} | |||
|
|||
return &clienttypes.MsgCreateClientResponse{ClientId: clientID}, nil | |||
k.ClientKeeper.SetCreator(ctx, clientID, msg.Signer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this logic since we can do it in a MultiMsg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AdityaSripal the creator setting k.ClientKeeper.SetCreator(ctx, clientID, msg.Signer)
should be removed too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe so? Should only remove the counterparty being set, creator is needed for the provide msg (but we can delete it from state there, possibly in follow up)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sorry we should keep this logic my bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also be able to add an assetion in the test func for this handler that asserts creator is set as expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems we only have indirect testing for this? see no TestCreateClient
in msg_server_test.go
|
||
testCounterpartyID := "counterparty-1" | ||
suite.keeper.SetCounterparty(suite.ctx, testClientID, testCounterpartyID) | ||
merklePathPrefix := commitmenttypes.NewMerklePath("ibc", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to change to bytes as mentioned by github. i believe there's a commit serdar has bumping the version. But you should probably just copy over those changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is still wip, I'm having troubles fixing the commitmenttypes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some initial comments!
@@ -43,7 +44,13 @@ func (k *Keeper) CreateClient(goCtx context.Context, msg *clienttypes.MsgCreateC | |||
return nil, err | |||
} | |||
|
|||
return &clienttypes.MsgCreateClientResponse{ClientId: clientID}, nil | |||
k.ClientKeeper.SetCreator(ctx, clientID, msg.Signer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe so? Should only remove the counterparty being set, creator is needed for the provide msg (but we can delete it from state there, possibly in follow up)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Minor fixes needed and then tests for the top-level msg server and then I think we're good to go!
@@ -43,7 +44,13 @@ func (k *Keeper) CreateClient(goCtx context.Context, msg *clienttypes.MsgCreateC | |||
return nil, err | |||
} | |||
|
|||
return &clienttypes.MsgCreateClientResponse{ClientId: clientID}, nil | |||
k.ClientKeeper.SetCreator(ctx, clientID, msg.Signer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sorry we should keep this logic my bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some more things on second go, looking great!
Co-authored-by: DimitrisJim <[email protected]>
Co-authored-by: DimitrisJim <[email protected]>
Co-authored-by: colin axnér <[email protected]>
…idate Counterparty type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
// Verify that the retrieved creator matches the expected creator | ||
suite.Require().True(found, "GetCreator did not return stored creator") | ||
suite.Require().Equal(expectedCreator, retrievedCreator, "Creator is not retrieved correctly") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could add a delete here to test that as well
Quality Gate passed for 'ibc-go'Issues Measures |
Cherry Picking Serdar PR from ibc-lite branch
imp: added counterparty client store
imp: added provide counterparty to proto
imp: ran 'make proto-all'
imp: added logic to counterparty client
imp: fix proto
imp: fix proto
imp: ran 'make proto-all'
feat: finished counterparty client logic
Description
Closes #6967
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.