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 ibc-gen-shielded to receive a non-Namada token #2311

Merged
merged 5 commits into from
Dec 29, 2023

Conversation

yito88
Copy link
Member

@yito88 yito88 commented Dec 19, 2023

Describe your changes

closes #2308
closes #2309
ibc-gen-shielded should get not only a Namada token but also a non-Namada token to transfer it from non-Namada chains

Indicate on which release or other PRs this topic is based on

v0.28.1

Checklist before merging to draft

  • I have added a changelog
  • Git history is in acceptable state

@yito88 yito88 requested review from sug0 and grarco December 19, 2023 10:50
sdk/src/rpc.rs Outdated
Comment on lines 1184 to 1191
None => {
return context
.wallet()
.await
.find_address(token.as_ref())
.map(|addr| addr.to_string())
.unwrap_or(token.as_ref().to_string());
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this the correct behavior? users could have populated their wallet with an alias that might coincide with some other chain's address format. it's odd, but certainly possible. perhaps we should document in the cli the order of parsing/look-ups

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. We shouldn't look up the token address with the wallet of the destination chain.

When ibc-gen-shielded is requested, a user is trying to send the token of another chain. A user should be able to get the raw address of the token on the source chain.

And, if the token address is invalid, though the proof will be generated, the following ibc-transfer will fail.

(When query_ibc_denom is called from ibc-transfer, the token should be parsed and this Err branch shouldn't be reached.)

@@ -0,0 +1,2 @@
- Non-Namada token can be given to ibc-gen-shielded
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we also need another changelog for the sdk updates

@yito88 yito88 requested review from sug0 and grarco December 22, 2023 13:29
grarco
grarco previously approved these changes Dec 22, 2023
Copy link
Collaborator

@grarco grarco left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

Fraccaman pushed a commit that referenced this pull request Dec 27, 2023
* origin/yuji/fix-ibc-gen-shielded:
  add SDK changelog
  fix parsing token address
  add changelog
  non-namada token to ibc-gen-shielded
@Fraccaman Fraccaman mentioned this pull request Dec 27, 2023
Fraccaman pushed a commit that referenced this pull request Dec 27, 2023
* origin/yuji/fix-ibc-gen-shielded:
  fix e2e test
  add SDK changelog
  fix parsing token address
  add changelog
  non-namada token to ibc-gen-shielded
Fraccaman pushed a commit that referenced this pull request Dec 27, 2023
brentstone added a commit that referenced this pull request Dec 29, 2023
* origin/yuji/fix-ibc-gen-shielded:
  fix e2e test
  add SDK changelog
  fix parsing token address
  add changelog
  non-namada token to ibc-gen-shielded
@brentstone brentstone merged commit 9313d1d into main Dec 29, 2023
13 of 15 checks passed
@brentstone brentstone deleted the yuji/fix-ibc-gen-shielded branch December 29, 2023 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants