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: modify connection keeper GetTimestampAtHeight to use the client state interface function #1666

Merged

Conversation

charleenfei
Copy link
Contributor

Description

closes: #876


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.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@@ -34,4 +34,5 @@ var (
ErrInvalidSubstitute = sdkerrors.Register(SubModuleName, 27, "invalid client state substitute")
ErrInvalidUpgradeProposal = sdkerrors.Register(SubModuleName, 28, "invalid upgrade proposal")
ErrClientNotActive = sdkerrors.Register(SubModuleName, 29, "client is not active")
ErrClientStateNotFound = sdkerrors.Register(SubModuleName, 30, "client state not found")
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have ErrClientNotFound above so I think we can probably just use that!

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd also be okay with renaming ErrClientNotFound to ErrClientStateNotFound

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i'll do that, it's more explicit

Comment on lines 7 to 10
"github.com/stretchr/testify/suite"

"github.com/cosmos/ibc-go/v3/modules/core/03-connection/types"
"github.com/cosmos/ibc-go/v3/modules/core/exported"
ibctesting "github.com/cosmos/ibc-go/v3/testing"
"github.com/stretchr/testify/suite"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: the testify import should stay above and separated from ibc-go imports

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

Excellent work! :)

Agree with @damiannolan's comments

@@ -34,4 +34,5 @@ var (
ErrInvalidSubstitute = sdkerrors.Register(SubModuleName, 27, "invalid client state substitute")
ErrInvalidUpgradeProposal = sdkerrors.Register(SubModuleName, 28, "invalid upgrade proposal")
ErrClientNotActive = sdkerrors.Register(SubModuleName, 29, "client is not active")
ErrClientStateNotFound = sdkerrors.Register(SubModuleName, 30, "client state not found")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd also be okay with renaming ErrClientNotFound to ErrClientStateNotFound

@@ -177,6 +177,23 @@ func (suite *KeeperTestSuite) TestSendPacket() {
packet = types.NewPacket(ibctesting.MockPacketData, 1, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, disabledTimeoutHeight, timestamp)
channelCap = suite.chainA.GetChannelCapability(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID)
}, false},
{"timeout timestamp passed with solomachine", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we open an issue to add solomachine tests for timeout_test.go functions?

Copy link
Contributor

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

LGTM!

@charleenfei charleenfei merged commit 1617de7 into 02-client-refactor Jul 7, 2022
@charleenfei charleenfei deleted the charly/connection_keeper_getTimestampAtHeight branch July 7, 2022 13:48
oshorefueled pushed a commit to ComposableFi/ibc-go that referenced this pull request Aug 9, 2022
…t state interface function (cosmos#1666)

* updated connection keeper to use clientstate to get timestamp, updated tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants