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

fix update client bug and reduce complexity #421

Merged
merged 3 commits into from
Feb 11, 2021
Merged

Conversation

colin-axner
Copy link
Contributor

No description provided.

@@ -91,13 +94,9 @@ func (c *Chain) InjectTrustedFields(dst *Chain, header *tmclient.Header) (*tmcli
// make copy of header stored in mop
h := *(header)

dstH, err := dst.GetLatestLightHeight()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this logic didn't make any sense. We should just query using the latest state possible

func (c *Chain) UpdateClient(header ibcexported.Header) sdk.Msg {
// UpdateClient creates an sdk.Msg to update the client on src with data pulled from dst.
func (c *Chain) UpdateClient(dst *Chain) (sdk.Msg, error) {
header, err := dst.GetIBCUpdateHeader(c)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

++ so much code reduction with this one addition

Copy link
Collaborator

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

utACK

@colin-axner colin-axner merged commit 79c9ba7 into master Feb 11, 2021
@colin-axner colin-axner deleted the colin/update-fix branch February 11, 2021 11:57
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.

2 participants