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

cli: implement channel deposit, close, settle and fix some issues with channels interface #1903

Merged
merged 8 commits into from
Jul 16, 2020

Conversation

andrevmatos
Copy link
Contributor

Part of #1692

Short description
Extend the channel part of the CLI:

  • balance field contains what is called capacity on the SDK, i.e. the amount which can still be transferred on the channel
  • state contains a different set of strings: opened, closed, settled, so we need to adapt our more descriptive state to these
  • all numbes are serialized as strings, including small ones like id, settleTimeout and revealTimeout
  • implement PATCH method on the channels endpoint:
    • body with { "state": "closed"|"settled" } respectively closes and settles the channel
    • body with { "total_deposit": "<number>" } deposits amout which takes the total deposit to the requested amount
    • body with { "total_withdral": "<number>" } withdraws amount which brings total withdraw to the requested amount

Definition of Done

  • Steps to manually test the change have been documented
  • Acceptance criteria are met
  • Change has been manually tested by the reviewer (dApp)

Steps to manually test the change (dApp)

  1. Test calling actions on a channel with the respective PATCH on the API

@andrevmatos andrevmatos added the cli 🔤 Command-line SDK-based Node.js Client issues label Jul 15, 2020
@andrevmatos andrevmatos self-assigned this Jul 15, 2020
@github-actions
Copy link

You modified raiden-ts/src,
Please remember to add a change log entry at raiden-ts/CHANGELOG.md if necessary.

@codecov
Copy link

codecov bot commented Jul 15, 2020

Codecov Report

Merging #1903 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1903   +/-   ##
=======================================
  Coverage   95.66%   95.66%           
=======================================
  Files         155      155           
  Lines        5791     5791           
  Branches     1090     1089    -1     
=======================================
  Hits         5540     5540           
  Misses        193      193           
  Partials       58       58           
Flag Coverage Δ
#dapp 91.76% <ø> (ø)
#sdk 97.28% <100.00%> (ø)
#sdk_e2e 65.57% <100.00%> (+0.02%) ⬆️
#sdk_unit 86.47% <0.00%> (ø)
Impacted Files Coverage Δ
raiden-ts/src/raiden.ts 91.42% <100.00%> (ø)

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 ab940b0...98890fc. Read the comment docs.

Copy link
Contributor

@weilbith weilbith left a comment

Choose a reason for hiding this comment

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

Thanks for implementing this feature. I was kinda afraid to do so back then. Happy that is comes now.

raiden-cli/src/utils/channels.ts Outdated Show resolved Hide resolved
raiden-cli/src/utils/channels.ts Show resolved Hide resolved
raiden-cli/src/routes/channels.ts Show resolved Hide resolved
raiden-cli/src/routes/channels.ts Outdated Show resolved Hide resolved
raiden-cli/src/routes/channels.ts Outdated Show resolved Hide resolved
raiden-cli/src/routes/channels.ts Show resolved Hide resolved
raiden-cli/src/routes/channels.ts Outdated Show resolved Hide resolved
raiden-cli/src/routes/channels.ts Outdated Show resolved Hide resolved
raiden-cli/src/routes/channels.ts Outdated Show resolved Hide resolved
raiden-cli/src/routes/channels.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@weilbith weilbith left a comment

Choose a reason for hiding this comment

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

Thanks that you did all the adjustments according to my review requests. I highly appreciate that!! 🙏

@andrevmatos andrevmatos merged commit dfce08a into master Jul 16, 2020
@andrevmatos andrevmatos deleted the feature/extend_cli branch July 16, 2020 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli 🔤 Command-line SDK-based Node.js Client issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants