-
Notifications
You must be signed in to change notification settings - Fork 17
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
UDC dialog for depositing and withdrawing tokens #606
Conversation
Codecov Report
@@ Coverage Diff @@
## master #606 +/- ##
==========================================
+ Coverage 95.87% 95.92% +0.05%
==========================================
Files 88 91 +3
Lines 2252 2381 +129
Branches 307 317 +10
==========================================
+ Hits 2159 2284 +125
- Misses 51 55 +4
Partials 42 42
Continue to review full report at Codecov.
|
fxLayout="row" | ||
fxLayoutAlign="center start" | ||
[formGroup]="form" | ||
(keyup.enter)="onEnter($event)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is keyup.enter
the best event for forms? Doesn´t it have a more generic submit which would streamline how forms submission is performed? just curious, as handling key events directly for forms seems quite spartane
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could get it working without the enter event by appropriately using the form tag and setting type="submit"
on the button. Thanks for the hint. I also improved this on other parts of the WebUI.
retryWhen((errors) => | ||
errors.pipe(switchMapTo(this.raidenService.rpcConnected$)) | ||
), | ||
shareReplay(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a headsup: share*
operators can be a little dangerous sometimes, because they only stay hot while they have at least one subscriber; since this seems to be a readonly observable, this would be just an optimization, but in places where you use it as source to actions, it´s important to keep this fact in mind. Good job here, nice usage of the operators
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the shareReplay
operator always staying hot without the refCount
argument set to true?
filter((withdrawPlan) => withdrawPlan.amount.isGreaterThan(0)) | ||
); | ||
const blockNumber$ = defer(() => | ||
from<Promise<number>>(this.raidenConfig.web3.eth.getBlockNumber()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: defer
already from
its result, no need to from
inside. If doing so, it´s a nice practice to mark the function as async
to ensure it returns an observable, because if for some reason it eventually returns something else like an array or undefined
(for mocks), you may end up with an observable which doesn´t do what you´d expect.
return interval(15000).pipe( | ||
startWith(0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick:
return interval(15000).pipe( | |
startWith(0), | |
return timer(0, 15000).pipe( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, some suggestions only, but overall seems solid, thanks for implementing this
ceb626b
to
103ceec
Compare
Shows a notification when the current block number allows to complete a planned withdrawa
103ceec
to
fb54f0f
Compare
Closes #556, Closes #195
This adds a dialog for depositing to and withdrawing from UDC.
The dialog is the
UserDepositDialogComponent
, which is opened from the Header. The dialog uses a another new component for letting the user input deposit / withdraw values. This is theDepositWithdrawFormComponent
, that is created when the user clicks the deposit or the plan withdraw button in the dialog. Interaction with the UDC is done through theUserDepositService
. I created the respective functions for that in an earlier PR.Some changes to the
UserDepositService
were necessary, for example for polling the withdraw plans on-chain. There is also an observable for fetching blocks until the planned withdraw is ready, which creates a notification when the withdraw can be executed. That makes it necessary to subscribe to it from the AppComponent.