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

send packet transfer CLI #495

Merged
merged 42 commits into from
Jan 5, 2021
Merged

send packet transfer CLI #495

merged 42 commits into from
Jan 5, 2021

Conversation

ancazamfir
Copy link
Collaborator

@ancazamfir ancazamfir commented Jan 4, 2021

Closes: #470

Description

  • Added the CLI. For example:
    tx raw packet-send ibc-0 ibc-1 transfer channel-0 9999 111 -n 3
    Initiates three 9999 samoleans ics-20 transfer messages on ibc-0 to be eventually sent to ibc-1, on channel-0 with timeout height offset of 111.

  • The CLI doesn't use the runtime as we need it to work concurrently with a running relayer (using instead the CosmosSDKChain::bootstrap())

  • The ics20-fungible-token-transfer is moved under the application module.


For contributor use:

  • Updated the Unreleased section of CHANGELOG.md with the issue.
  • If applicable: Unit tests written, added test to CI.
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments.
  • Re-reviewed Files changed in the Github PR explorer.

ancazamfir and others added 30 commits December 12, 2020 21:07
@ancazamfir ancazamfir requested a review from romac as a code owner January 4, 2021 12:00
@ancazamfir ancazamfir changed the title Anca/send cli send packet CLI Jan 4, 2021
@ancazamfir ancazamfir marked this pull request as draft January 4, 2021 12:04
@codecov-io
Copy link

codecov-io commented Jan 4, 2021

Codecov Report

Merging #495 (68fe607) into master (b1b37f5) will increase coverage by 15.9%.
The diff coverage is 56.4%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #495      +/-   ##
=========================================
+ Coverage    13.6%   29.6%   +15.9%     
=========================================
  Files          69     160      +91     
  Lines        3752   12814    +9062     
  Branches     1374    5018    +3644     
=========================================
+ Hits          513    3800    +3287     
- Misses       2618    8323    +5705     
- Partials      621     691      +70     
Impacted Files Coverage Δ
...application/ics20_fungible_token_transfer/error.rs 0.0% <0.0%> (ø)
...pplication/ics20_fungible_token_transfer/events.rs 0.0% <ø> (ø)
...ion/ics20_fungible_token_transfer/msgs/transfer.rs 0.0% <0.0%> (ø)
modules/src/events.rs 0.0% <0.0%> (ø)
modules/src/ics02_client/events.rs 0.0% <0.0%> (ø)
modules/src/ics02_client/msgs.rs 0.0% <0.0%> (ø)
modules/src/ics02_client/raw.rs 0.0% <0.0%> (ø)
modules/src/ics03_connection/error.rs 13.6% <0.0%> (-19.7%) ⬇️
modules/src/ics03_connection/events.rs 0.0% <0.0%> (ø)
modules/src/ics04_channel/error.rs 75.0% <ø> (+50.0%) ⬆️
... and 289 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 379dd98...68fe607. Read the comment docs.

@ancazamfir ancazamfir marked this pull request as ready for review January 5, 2021 12:33
@ancazamfir ancazamfir changed the title send packet CLI send packet transfer CLI Jan 5, 2021
@ancazamfir ancazamfir changed the base branch from master to adi/326_adr05 January 5, 2021 12:51
@ancazamfir ancazamfir changed the base branch from adi/326_adr05 to master January 5, 2021 12:51
/// the channel by which the packet will be sent
pub source_channel: ChannelId,
/// the tokens to be transferred
pub token: Option<ibc_proto::cosmos::base::v1beta1::Coin>,
Copy link
Member

@romac romac Jan 5, 2021

Choose a reason for hiding this comment

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

At some point (perhaps in a later PR), we should define this Coin type as a domain type (ie. an instance of the Protobuf trait) rather than rely on the protobuf definition directly.

Copy link
Member

@adizere adizere left a comment

Choose a reason for hiding this comment

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

Done with reading the code. Just had 1 comment.
Still trying out the CLI...

Copy link
Member

@adizere adizere left a comment

Choose a reason for hiding this comment

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

Aside from minor comments (all of which can be fixed later), looks good!

relayer/src/transfer.rs Outdated Show resolved Hide resolved
relayer/src/transfer.rs Show resolved Hide resolved
@ancazamfir ancazamfir merged commit 453c1da into master Jan 5, 2021
@ancazamfir ancazamfir deleted the anca/send_cli branch January 5, 2021 17:24
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* Move ics20 in application

* Add send packet cli
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.

Add ability to send transfer packets from the CLI for testing purposes
4 participants