Skip to content

Conversation

bznein
Copy link
Contributor

@bznein bznein commented Jul 18, 2024

Description

closes: #6567


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 the 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 and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/).
  • Added relevant godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog)
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

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.

Changes look good to me, @bznein. Maybe it would be worth adding a short e2e test and check that the balance of the account is zero after the transfer. Might be worth using 2 denoms in the e2e test.

@bznein
Copy link
Contributor Author

bznein commented Jul 19, 2024

Changes look good to me, @bznein. Maybe it would be worth adding a short e2e test and check that the balance of the account is zero after the transfer. Might be worth using 2 denoms in the e2e test.

Thanks Carlos! I've added the test, LMK if this is what you meant. FIY the test failed locally unless I manually built a new image and used that. I assume this would not happen in the CI.

@bznein bznein marked this pull request as ready for review July 19, 2024 11:01
@bznein bznein requested a review from crodriguezvega July 19, 2024 11:01
Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

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

this lgtm. thanks! 🙏 We should probably document this in the transfer docs too.

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Copy link
Contributor

@gjermundgaraba gjermundgaraba left a comment

Choose a reason for hiding this comment

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

Nice add-on! LGTM 🚀

@bznein bznein enabled auto-merge July 19, 2024 16:21
@crodriguezvega crodriguezvega added the priority PRs that need prompt reviews label Jul 22, 2024
@crodriguezvega crodriguezvega requested a review from srdtrk as a code owner July 23, 2024 07:14
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.

Thanks, @bznein. I left just one comment.

})

t.Run("send entire balance from B to A", func(t *testing.T) {
transferTxResp := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, sdk.NewCoins(sdk.NewCoin(chainBIBCToken.IBCDenom(), transfertypes.UnboundedSpendLimit())), chainBAddress, chainAAddress, s.GetTimeoutHeight(ctx, chainB), 0, "", nil)
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 transfer the whole balance for both the native chain B denom and the IBC denom? Just to test that it all works fine with multidenom.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, done

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.

Nice work, lgtm!

})

t.Run("send entire balance from B to A", func(t *testing.T) {
transferTxResp := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, sdk.NewCoins(sdk.NewCoin(chainBIBCToken.IBCDenom(), transfertypes.UnboundedSpendLimit())), chainBAddress, chainAAddress, s.GetTimeoutHeight(ctx, chainB), 0, "", nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not!

@bznein bznein added this pull request to the merge queue Jul 23, 2024
@crodriguezvega crodriguezvega removed this pull request from the merge queue due to a manual request Jul 23, 2024
@crodriguezvega
Copy link
Contributor

@bznein Before merging the PR, should we address the latest comments?

@bznein
Copy link
Contributor Author

bznein commented Jul 23, 2024

@bznein Before merging the PR, should we address the latest comments?

Ah! Yeah sorry I added it at some point thiking it was ready to get merged (but it wasn't) and never removed it!

Copy link

@bznein bznein added this pull request to the merge queue Jul 23, 2024
Merged via the queue into main with commit 92e1f38 Jul 23, 2024
72 of 74 checks passed
@bznein bznein deleted the bznein/6567/TransferOfEntireBalance branch July 23, 2024 09:33
mergify bot pushed a commit that referenced this pull request Jul 23, 2024
* Add possibility to transfer entire balance.

* Added entry to the Changelog.

* Added e2e test

* Added forwarding

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

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>

* Move UnboundedSpendLimit to token.go

* add documentation

* add test to compatibility matrices

* PR Feedback.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
(cherry picked from commit 92e1f38)

# Conflicts:
#	.github/compatibility-test-matrices/release-v9.0.x/transfer-v2-multidenom-chain-a.json
mergify bot pushed a commit that referenced this pull request Jul 23, 2024
* Add possibility to transfer entire balance.

* Added entry to the Changelog.

* Added e2e test

* Added forwarding

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

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>

* Move UnboundedSpendLimit to token.go

* add documentation

* add test to compatibility matrices

* PR Feedback.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
(cherry picked from commit 92e1f38)

# Conflicts:
#	.github/compatibility-test-matrices/main/transfer-v2-multidenom-chain-a.json
#	.github/compatibility-test-matrices/release-v9.0.x/transfer-v2-multidenom-chain-a.json
#	.github/compatibility-test-matrices/unreleased/transfer-v2-multidenom.json
#	CHANGELOG.md
#	docs/docs/02-apps/01-transfer/04-messages.md
#	docs/docs/02-apps/01-transfer/10-ICS20-v1/04-messages.md
#	e2e/tests/transfer/base_test.go
#	modules/apps/transfer/keeper/relay.go
#	modules/apps/transfer/keeper/relay_test.go
#	modules/apps/transfer/types/token.go
#	modules/apps/transfer/types/transfer_authorization.go
#	testing/chain.go
mergify bot pushed a commit that referenced this pull request Jul 23, 2024
* Add possibility to transfer entire balance.

* Added entry to the Changelog.

* Added e2e test

* Added forwarding

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

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>

* Move UnboundedSpendLimit to token.go

* add documentation

* add test to compatibility matrices

* PR Feedback.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
(cherry picked from commit 92e1f38)

# Conflicts:
#	.github/compatibility-test-matrices/main/transfer-v2-multidenom-chain-a.json
#	.github/compatibility-test-matrices/release-v9.0.x/transfer-v2-multidenom-chain-a.json
#	.github/compatibility-test-matrices/unreleased/transfer-v2-multidenom.json
#	CHANGELOG.md
#	docs/docs/02-apps/01-transfer/04-messages.md
#	docs/docs/02-apps/01-transfer/10-ICS20-v1/04-messages.md
#	e2e/tests/transfer/base_test.go
#	modules/apps/transfer/keeper/relay.go
#	modules/apps/transfer/keeper/relay_test.go
#	modules/apps/transfer/types/token.go
#	modules/apps/transfer/types/transfer_authorization.go
crodriguezvega added a commit that referenced this pull request Jul 25, 2024
…6929)

* (feat) Add possibility to transfer entire balance. (#6877)

* Add possibility to transfer entire balance.

* Added entry to the Changelog.

* Added e2e test

* Added forwarding

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

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>

* Move UnboundedSpendLimit to token.go

* add documentation

* add test to compatibility matrices

* PR Feedback.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
(cherry picked from commit 92e1f38)

# Conflicts:
#	.github/compatibility-test-matrices/main/transfer-v2-multidenom-chain-a.json
#	.github/compatibility-test-matrices/release-v9.0.x/transfer-v2-multidenom-chain-a.json
#	.github/compatibility-test-matrices/unreleased/transfer-v2-multidenom.json
#	CHANGELOG.md
#	docs/docs/02-apps/01-transfer/04-messages.md
#	docs/docs/02-apps/01-transfer/10-ICS20-v1/04-messages.md
#	e2e/tests/transfer/base_test.go
#	modules/apps/transfer/keeper/relay.go
#	modules/apps/transfer/keeper/relay_test.go
#	modules/apps/transfer/types/token.go
#	modules/apps/transfer/types/transfer_authorization.go
#	testing/chain.go

* fix conflicts

* lint

* delete docs

---------

Co-authored-by: Nikolas De Giorgis <nikolas.degiorgis@interchain.io>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
crodriguezvega added a commit that referenced this pull request Jul 25, 2024
…6930)

* (feat) Add possibility to transfer entire balance. (#6877)

* Add possibility to transfer entire balance.

* Added entry to the Changelog.

* Added e2e test

* Added forwarding

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

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>

* Move UnboundedSpendLimit to token.go

* add documentation

* add test to compatibility matrices

* PR Feedback.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
(cherry picked from commit 92e1f38)

# Conflicts:
#	.github/compatibility-test-matrices/main/transfer-v2-multidenom-chain-a.json
#	.github/compatibility-test-matrices/release-v9.0.x/transfer-v2-multidenom-chain-a.json
#	.github/compatibility-test-matrices/unreleased/transfer-v2-multidenom.json
#	CHANGELOG.md
#	docs/docs/02-apps/01-transfer/04-messages.md
#	docs/docs/02-apps/01-transfer/10-ICS20-v1/04-messages.md
#	e2e/tests/transfer/base_test.go
#	modules/apps/transfer/keeper/relay.go
#	modules/apps/transfer/keeper/relay_test.go
#	modules/apps/transfer/types/token.go
#	modules/apps/transfer/types/transfer_authorization.go

* fix conflicts

* remove unused code

---------

Co-authored-by: Nikolas De Giorgis <nikolas.degiorgis@interchain.io>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
crodriguezvega added a commit that referenced this pull request Jul 26, 2024
…6920)

* (feat) Add possibility to transfer entire balance. (#6877)

* Add possibility to transfer entire balance.

* Added entry to the Changelog.

* Added e2e test

* Added forwarding

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

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>

* Move UnboundedSpendLimit to token.go

* add documentation

* add test to compatibility matrices

* PR Feedback.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
(cherry picked from commit 92e1f38)

# Conflicts:
#	.github/compatibility-test-matrices/release-v9.0.x/transfer-v2-multidenom-chain-a.json

* delete e2e

* Revert "delete e2e"

This reverts commit 71db49e.

---------

Co-authored-by: Nikolas De Giorgis <nikolas.degiorgis@interchain.io>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
arnabmitra added a commit to provenance-io/ibc-go that referenced this pull request Mar 5, 2025
* Update CHANGELOG.md

* fix(ica-host): refactor newModuleQuerySafeAllowList to avoid panic (backport cosmos#6436) (cosmos#6520)

* fix(ica-host): refactor newModuleQuerySafeAllowList to avoid panic (cosmos#6436)

* fix(ica-host): refactor newModuleQuerySafeAllowList to avoid panic due to AllowUnresolvable field

* add changelog entry

* Apply suggestions from code review

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

---------

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
(cherry picked from commit a16c549)

# Conflicts:
#	CHANGELOG.md

* fix conflicts in changelog.

---------

Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com>
Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>

* deps(release/v8.3.x): bump SDK to v0.50.7 (cosmos#6614)

* deps: bump SDK to v0.50.7

* add changelog

* update changelog before v8.3.2 release

* Update CHANGELOG.md

* events: add channel ordering to write acknowledgement event (cosmos#6867) (cosmos#6871)

* docs: remove ordering from write ack event and non-hex data atrributes

* rever doc changes

* add ordering to write acknowledgement event

* Update events.md

(cherry picked from commit 352ba6e)

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

* (feat) Add possibility to transfer entire balance. (backport cosmos#6877) (cosmos#6930)

* (feat) Add possibility to transfer entire balance. (cosmos#6877)

* Add possibility to transfer entire balance.

* Added entry to the Changelog.

* Added e2e test

* Added forwarding

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

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>

* Move UnboundedSpendLimit to token.go

* add documentation

* add test to compatibility matrices

* PR Feedback.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
(cherry picked from commit 92e1f38)

# Conflicts:
#	.github/compatibility-test-matrices/main/transfer-v2-multidenom-chain-a.json
#	.github/compatibility-test-matrices/release-v9.0.x/transfer-v2-multidenom-chain-a.json
#	.github/compatibility-test-matrices/unreleased/transfer-v2-multidenom.json
#	CHANGELOG.md
#	docs/docs/02-apps/01-transfer/04-messages.md
#	docs/docs/02-apps/01-transfer/10-ICS20-v1/04-messages.md
#	e2e/tests/transfer/base_test.go
#	modules/apps/transfer/keeper/relay.go
#	modules/apps/transfer/keeper/relay_test.go
#	modules/apps/transfer/types/token.go
#	modules/apps/transfer/types/transfer_authorization.go

* fix conflicts

* remove unused code

---------

Co-authored-by: Nikolas De Giorgis <nikolas.degiorgis@interchain.io>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

* fix(state!): check upgrade compatibility in channel upgrade confirm (backport cosmos#6935) (cosmos#6944)

* fix(state!): check upgrade compatibility in channel upgrade confirm (cosmos#6935)

(cherry picked from commit 3a192be)

# Conflicts:
#	CHANGELOG.md

* fix conflicts

---------

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

* update changelog before v8.4.0 release

* retract v8.2.x and v8.3.x (cosmos#6965)

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>

* backport-v8.5.x: self client/consensus state removal from connection handshake (cosmos#7129)

* refactor: remove client/consensus state validation from connection handshake

* chore: generate proto deprecation notice

* add changelog

* refactor: remove unpacking from msg server

* deps(release/v8.5.x): bump ics23 to v0.11.0 (cosmos#7222)

* deps: bump ics23 to v0.11.0-rc.0

* deps: bump ics23 to v0.11.0

* deps: bump cosmos-sdk to v0.50.9 (backport cosmos#6828) (cosmos#7227)

* deps: bump cosmos-sdk to v0.50.9 (cosmos#6828)

* deps: bump cosmos-sdk to v0.50.8

* chore: update changelog

* deps: bump cosmossdk.io/client to v2.0.0-beta.3. bump x/upgrade to v0.1.4

* chore: make tidy-all

* test: bump to 3f6796fba413cca for testing purposes.

* deps: bump cosmos sdk to 0.50.9

* Update CHANGELOG.md

* chore: update CHANGELOG for submodules.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
(cherry picked from commit 3425726)

# Conflicts:
#	CHANGELOG.md
#	e2e/go.mod
#	e2e/go.sum
#	go.mod
#	go.sum
#	modules/apps/callbacks/CHANGELOG.md
#	modules/apps/callbacks/go.mod
#	modules/apps/callbacks/go.sum
#	modules/capability/CHANGELOG.md
#	modules/capability/go.mod
#	modules/light-clients/08-wasm/CHANGELOG.md
#	modules/light-clients/08-wasm/go.mod
#	modules/light-clients/08-wasm/go.sum
#	simapp/go.mod
#	simapp/go.sum

* fix conflicts

* callbacks: go mod tidy

* tidy

---------

Co-authored-by: Damian Nolan <damiannolan@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

* Update CHANGELOG.md

* Update CHANGELOG.md

* fix: attempt to fix panics for unresolvable imports by using GogoResolver (backport cosmos#7277) (cosmos#7281)

* fix: attempt to fix panics for unresolvable imports by using GogoResolver (cosmos#7277)

* fix: attempt to fix panics for unresolvable imports by using GogoResolver

* chore: add changelog

* chore: amend changelog

(cherry picked from commit 79ddda5)

# Conflicts:
#	CHANGELOG.md

* chore: address merge conflicts in changelog

---------

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* prepare changelog for v8.5.1 release

* Update CHANGELOG.md

* fix: avoid invalid identifier error when validate genesis (backport cosmos#7397) (cosmos#7403)

* fix: avoid invalid identifier error when validate genesis (cosmos#7397)

* fix: avoid invalid identifier error when validate genesis

that contains localhost client

* Apply suggestions from code review

* skip

(cherry picked from commit ff2b668)

# Conflicts:
#	CHANGELOG.md
#	modules/core/03-connection/types/genesis.go
#	modules/core/03-connection/types/genesis_test.go

* chore: changelog cleanup

* chore: fix imports

---------

Co-authored-by: mmsqe <mavis@crypto.com>
Co-authored-by: Colin Axnér <25233464+colin-axner@users.noreply.github.com>

* test: update block proposer in testing (backport cosmos#7430) (cosmos#7453)

* test: update block proposer in testing (cosmos#7430)

* Introduce two following changes to the `commitBlock` method in testing:
* increment the proposer priority of validators
* update the proposer address in the current header

* fix linter

(cherry picked from commit 64f33e0)

# Conflicts:
#	testing/chain.go

* why did you fail us here, mergify my boy

---------

Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com>
Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>

* Updating changelog for v8.5.2 (cosmos#7536)

* chore: backport json tags for Height for ibc client proto (cosmos#7868)

* chore: update changelog for v8.5.3 (cosmos#7876)

* Chore/revert ibc proto updates (cosmos#7887)

* Revert "chore: update changelog for v8.5.3 (cosmos#7876)"

This reverts commit c3af326.

* Revert "chore: backport json tags for Height for ibc client proto (cosmos#7868)"

This reverts commit b589a85.

* chore: retract v8.5.3 (cosmos#7888)

* chore: retract v8.5.3

* fix retract statement

* chore: update changelog and redact

* Merge commit from fork

rm test case

* chore: update redacted

* fix: remove packet data remarshaling (cosmos#8065)

* fix: remove packet data remarshaling

* chore: update upload artifact

* chore: update download artifact

* redact 8.6.0

* ignoring packages that have no tests, else make test and make test-all fail.

---------

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com>
Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Nikolas De Giorgis <nikolas.degiorgis@interchain.io>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
Co-authored-by: mmsqe <mavis@crypto.com>
Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com>
Co-authored-by: Cian Hatton <cian@interchain.io>
Co-authored-by: PaddyMc <paddymchale@hotmail.com>
Co-authored-by: Gjermund Garaba <gjermund@garaba.net>
Co-authored-by: Aditya <14364734+AdityaSripal@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority PRs that need prompt reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: IBC transfers of the entire balance of a particular denomination.
5 participants