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

test: add unwind + forwarding to sender test #6905

Merged
merged 8 commits into from
Aug 12, 2024

Conversation

vishal-kanna
Copy link
Contributor

closes: #6878

Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

Thank you for the PR, @vishal-kanna. The test you added in this PR is not exactly what was meant in the issue. You should take a look at the tests in relay_forwarding_test.go. The idea is to write an integration test like those. The setup of the test should send tokens from A to B and then on B we should set forwarding to types.NewForwarding(true, types.NewHop(pathAtoB.EndpointA.ChannelConfig.PortID, pathAtoB.EndpointA.ChannelID)). This basically will send the tokens first back to A (unwind them) and them forward them back to chain B. Let us know if you have questions or need any help. Taking the tests in the file I mentioned as reference about should give you an idea of how to write the test.

@vishal-kanna vishal-kanna marked this pull request as draft July 23, 2024 06:52
@crodriguezvega crodriguezvega changed the title chore: added unit test test: add unwind + forwarding to sender test Aug 9, 2024
@crodriguezvega crodriguezvega added the priority PRs that need prompt reviews label Aug 9, 2024
@crodriguezvega crodriguezvega marked this pull request as ready for review August 9, 2024 13:05
@@ -56,7 +56,7 @@ func ParseChannelIDFromEvents(events []abci.Event) (string, error) {
return "", errors.New("channel identifier event attribute not found")
}

// ParsePacketFromEvents parses events emitted from a MsgRecvPacket and returns
// ParsePacketFromEvents parses events emitted from a send packet and returns
Copy link
Contributor

Choose a reason for hiding this comment

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

Small typo fixed.

@crodriguezvega crodriguezvega added this pull request to the merge queue Aug 12, 2024
Merged via the queue into cosmos:main with commit 3f34f29 Aug 12, 2024
79 of 80 checks passed
mergify bot pushed a commit that referenced this pull request Aug 12, 2024
* chore: added unit test

* chore: added unit test

* wip

* take test to finish line

* Update modules/apps/transfer/keeper/relay_forwarding_test.go

Co-authored-by: Nikolas De Giorgis <[email protected]>

* fix typo

---------

Co-authored-by: Carlos Rodriguez <[email protected]>
Co-authored-by: Nikolas De Giorgis <[email protected]>
(cherry picked from commit 3f34f29)
crodriguezvega added a commit that referenced this pull request Aug 14, 2024
* chore: added unit test

* chore: added unit test

* wip

* take test to finish line

* Update modules/apps/transfer/keeper/relay_forwarding_test.go

Co-authored-by: Nikolas De Giorgis <[email protected]>

* fix typo

---------

Co-authored-by: Carlos Rodriguez <[email protected]>
Co-authored-by: Nikolas De Giorgis <[email protected]>
(cherry picked from commit 3f34f29)

Co-authored-by: Vishal Potpelliwar <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-v9.0.x priority PRs that need prompt reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a unit test which sets unwind to true and has forwarding hops which forwards back to itself
4 participants