-
Notifications
You must be signed in to change notification settings - Fork 105
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
bonds: UI updates and import/export #2200
Conversation
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.
During registration, on the wallet funding screen, it allows you to only deposit the amount required for 1 bond, but then when it's time to post the bond, it will reject if there is not enough for the second bond. Either we should allow the user to not have to reserve enough for the second bond, or not go to the next page.
Another issue I found was when exporting the account. I exported, created a fresh dexc with the same seed, then imported. The imported server did not show up, but after I restarted the dexc, I could see it. Might be a pre-existing issue.
"Confirm Registration": "Confirm Registration", | ||
"app_pw_reg": "Enter your app password to confirm DEX registration.", | ||
"reg_confirm_submit": `When you submit this form, funds will be spent from your wallet to pay the registration fee.`, | ||
"Skip Registration": "No account (view-only mode)", |
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.
Should these be re-translated as well?
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.
Would be nice if we had a "stale" flag like with the notifications because some of these aren't bad still.
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.
Removed some and flagged some others with comments if they were still accurate.
@@ -396,7 +396,9 @@ func (c *Core) rotateBonds(ctx context.Context) { | |||
|
|||
bondAsset := bondAssets[bondAssetID] | |||
if bondAsset == nil { | |||
c.log.Warnf("Bond asset %d not supported by DEX %v", bondAssetID, dc.acct.host) | |||
if targetTier > 0 { | |||
c.log.Warnf("Bond asset %d not supported by DEX %v", bondAssetID, dc.acct.host) |
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.
Would this only happen if the dex stopped supporting a bond asset they previously used to support?
Yeah, this is the annoying |
This was one of the things I was still considering. You're absolutely right of course, with the current UI. What I was pondering is a new user that might want to post a single bond without maintenance. Seeing as we'll need to add a check box for that and probably handle other edges, I think we can put that idea on the back burner until 1.0 or maybe 0.6.1. The normal user will have a maintained account. Will change the wallet wait form so it waits for the amount that it suggests, which accounts for the overlap with maintenance running. |
"1 Sync the Blockchain": "1: Zsynchronizuj blockchain", | ||
"Progress": "Postęp", | ||
"remaining": "pozostało", | ||
"2 Fund the Registration Fee": "2: Wnieś opłatę rejestracyjną", |
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 couldn't see a way to tame gofmt here, not without leaving these incorrect translations.
2d1e13f
to
e6547ec
Compare
The need to restart after import should also be resolved @martonp but I've not tested that. If the required changes somehow turn out to be much bigger we'll have to punt on this. |
The import basically works now, but if there was an active bond then it is not able to do a refund
I think this will require a more extensive change. |
It's not a huge deal, but I think the text |
Was there really no refund tx in the log or did you remove it for brevity? I don't see why it wouldn't be exported and imported given RefundTx []byte `json:"refundTx"` but it really needs to be. |
Oh wait, I think the server may have reported an unknown bond there. I guess I'll toy with this some more. |
Ah I need to update the |
a133419
to
bcb8286
Compare
Yeesh, finally got bond import working. General cases:
In the last two points above, this is an unfortunate consequence of how we switched from storing the bond private key in the DB to storing the key index since that is only helpful if the app seed is unchanged. Since the backup refund tx pays to the old wallet, this is suboptimal, but at least they can restore the wallet if they had the original seed. |
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, all the import cases work well. Could optionally export the bond private keys so they can be used when imported with a dexc that was initialized with another seed. It's probably a niche use case though so probably not worth the time.
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.
// TODO: less heavy handed approach to append or update | ||
// dc.acct.{bonds,pendingBonds,expiredBonds}, using server config... |
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 the more sophisticated technique to roughly 1) add the bond to appropriate map, 2) update tier, and 3) call monitorBondConfs
?
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.
add or update. Probably other error prone stuff.
Also, connect acct on import. On import detect and log foreign account keys. Import now tries to merge bonds if the account already exists. If the account ID and dex pubkey do not match, import is blocked.
client/{asset,core} This adds the BondsFeeBuffer asset.Bonder method to return a generous estimate (e.g. 150%) of how much extra the user should fund their wallet to successfully post their initial bond with ReserveBondFunds. This also adds a Core method to obtain this amount for a bond wallet. client/webserver Add the "/bondsfeebuffer" endpoint, which is intended to inform the UI's WalletWaitForm.
This silences a spammy log message that is show when a DEX server does not support the user's selected bond asset AND bond maintenance is enabled for that server. This would only happen if they were using bonds with that server and it had then stopped supporting that asset.
This rewords the UI's registration forms for the fee->bond change. This also changes the wallet funding step to use the new /bondsfeebuffer http API endpoint. The overlap factor (2) is *advised* at the level of the frontend, assuming the user wants uninterrupted bond maintainance. However, the wallet fail form will allow proceeding with the just bond amount plus a fee buffer. RESERVES DEFICIT may show in balance if the user posts a single bond and then decided to enable bond maintanence (target tier). remove stale web translations
This PR contains: