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

feat(cli): add command to perform ics20 withdrawals #1631

Merged
merged 4 commits into from
Oct 16, 2024

Conversation

quasystaty1
Copy link
Contributor

@quasystaty1 quasystaty1 commented Oct 3, 2024

Summary

Adds Ics20Withdrawal command to the cli for Ics20Withdrawal action

Background

part of adding all sequencer actions as cli commands.

Changes

  • adds astria-cli sequencer ics20-withdrawal command

Testing

  • There will be a follow-up PR to add CLI test after the ongoing test refactor is completed.
  • Tested by performing a manual withdrawal to an IBC chain. Refunds the sender address on failure, which was tested by sending an Ics20Withdrawal with an invalid asset.

Related Issues

part of #1474
closes #1623

@quasystaty1 quasystaty1 requested a review from a team as a code owner October 3, 2024 20:58
@quasystaty1 quasystaty1 requested a review from noot October 3, 2024 20:58
@quasystaty1 quasystaty1 force-pushed the quasystaty1/ENG-904/cli/ics20withdrawal branch from 4967960 to 5f58098 Compare October 3, 2024 21:07
Copy link
Contributor

@sambukowski sambukowski left a comment

Choose a reason for hiding this comment

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

LGTM, just nits on doc comments for flags

#[arg(long, default_value = None)]
pub(crate) bridge_address: Option<Address>,
#[arg(long, action(ArgAction::SetTrue))]
pub(crate) use_compact: bool,
Copy link
Member

Choose a reason for hiding this comment

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

What is compact?

Copy link
Contributor

Choose a reason for hiding this comment

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

should have been "compat" for the compatibility addresses. this has been fixed.

@SuperFluffy SuperFluffy changed the title feat(cli): Ics20Withdrawal command feat(cli): add command to perform ics20 withdrawals Oct 9, 2024
@sambukowski sambukowski added the cli pertaining to the cli label Oct 9, 2024
crates/astria-cli/src/sequencer/ics20_withdrawal.rs Outdated Show resolved Hide resolved
crates/astria-cli/src/sequencer/ics20_withdrawal.rs Outdated Show resolved Hide resolved
crates/astria-cli/src/sequencer/ics20_withdrawal.rs Outdated Show resolved Hide resolved
crates/astria-cli/src/sequencer/ics20_withdrawal.rs Outdated Show resolved Hide resolved
Comment on lines 44 to 46
/// The address to refund on timeout, if unset refunds the signer
#[arg(long)]
return_address: Address,
Copy link
Contributor

Choose a reason for hiding this comment

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

We'd need to make this field an Option to allow it to be unset. Just now, the command will fail if --return-address is not specified.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we set the return address to the sender address by default if --return-address is not specified?

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense to me, yes. But if others disagree, we need to update the comment to not say ", if unset refunds the signer".

crates/astria-cli/src/sequencer/ics20_withdrawal.rs Outdated Show resolved Hide resolved
@quasystaty1 quasystaty1 requested a review from Fraser999 October 16, 2024 11:16
@quasystaty1 quasystaty1 added this pull request to the merge queue Oct 16, 2024
Merged via the queue into main with commit 6b25c19 Oct 16, 2024
47 checks passed
@quasystaty1 quasystaty1 deleted the quasystaty1/ENG-904/cli/ics20withdrawal branch October 16, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli pertaining to the cli
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(cli): ICS20 Withdrawal commands
4 participants