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

tests: regression tests for types sent over wire as json #1160

Merged
merged 5 commits into from
Jul 19, 2023

Conversation

shaspitz
Copy link
Contributor

@shaspitz shaspitz commented Jul 18, 2023

Description

Adds regression tests for the types that are sent over the wire with IBC as JSON bytes. These tests use a hardcoded expected JSON schema that should never change lest we break the wire.

Note I've cherry-picked these tests into release/v1.0.x and they pass as expected, woot we haven't broken the wire

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • Included the correct type prefix in the PR title
  • Targeted the correct branch (see PR Targeting)
  • Provided a link to the relevant issue or specification
  • Reviewed "Files changed" and left comments if necessary
  • Confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • Confirmed the correct type prefix in the PR title
  • Confirmed all author checklist items have been addressed
  • Confirmed that this PR does not change production code

@shaspitz shaspitz requested a review from a team as a code owner July 18, 2023 19:35
// AcknowledgePacket is in reference to a packet originally sent from this (consumer) module.
packet := channeltypes.NewPacket(
packetData.GetBytes(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrong type was previously used in this test. I've adjusted it to use the proper consumer packet data type

@@ -48,11 +50,6 @@ func (mat VSCMaturedPacketData) ValidateBasic() error {
return nil
}

func (mat VSCMaturedPacketData) GetBytes() []byte {
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 and the other GetBytes methods should never be used. VSCMatured and SlashPacket data are both wrapped as ConsumerPacketData when sent over the wire. The ConsumerPacketData.GetBytes() method should be used and is tested in this PR

Copy link
Contributor

@MSalopek MSalopek left a comment

Choose a reason for hiding this comment

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

Thanks!

LGTM!

Copy link
Contributor

@mpoke mpoke left a comment

Choose a reason for hiding this comment

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

LGTM

@shaspitz shaspitz merged commit 7484dbc into main Jul 19, 2023
@shaspitz shaspitz deleted the shawn/wire-break-tests branch July 19, 2023 16:04
insumity pushed a commit that referenced this pull request Jul 24, 2023
* tests

* linting is the most important part of programming

---------

Co-authored-by: Marius Poke <[email protected]>
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