-
Notifications
You must be signed in to change notification settings - Fork 2
feat(wallet): expose set_withdraw_vesting_route in the HP action list #60
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| using System.Text.Json.Nodes; | ||
| using EcencyApi.Handlers; | ||
| using Xunit; | ||
|
|
||
| namespace EcencyApi.Tests; | ||
|
|
||
| /// <summary> | ||
| /// The token action ids are a client-facing contract: web and mobile map them to | ||
| /// concrete wallet operations, and an id neither client recognizes either renders | ||
| /// nothing (web drops unknown ids) or renders an unlabeled control (mobile passes | ||
| /// them through). Pin the ids and their order. | ||
| /// </summary> | ||
| public class WalletActionsTests | ||
| { | ||
| private static string[] Ids(JsonArray actions) => | ||
| actions.Select(a => a!["id"]!.GetValue<string>()).ToArray(); | ||
|
|
||
| [Fact] | ||
| public void HpActions_AreTheChainOperationNamesInRenderOrder() | ||
| { | ||
| Assert.Equal( | ||
| new[] { "delegate_vesting_shares", "withdraw_vesting", "set_withdraw_vesting_route" }, | ||
| Ids(WalletApi.HpActions())); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void HiveActions_OnlyOfferSavingsWithdrawalWhenSavingsExist() | ||
| { | ||
| Assert.DoesNotContain("transfer_from_savings", Ids(WalletApi.BuildHiveActions(0))); | ||
| Assert.Contains("transfer_from_savings", Ids(WalletApi.BuildHiveActions(1.5))); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void HbdActions_OnlyOfferSavingsWithdrawalWhenSavingsExist() | ||
| { | ||
| Assert.DoesNotContain("transfer_from_savings", Ids(WalletApi.BuildHbdActions(0))); | ||
| Assert.Contains("transfer_from_savings", Ids(WalletApi.BuildHbdActions(1.5))); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -228,6 +228,10 @@ def norm_body(text): | |
| "Same request-delete rerouting as ::min.", | ||
| "/private-api/request-delete::badcode": | ||
| "Same request-delete rerouting as ::min.", | ||
| "/wallet-api/portfolio-v2::pop": | ||
| "The HP action list gained set_withdraw_vesting_route so clients can link " | ||
| "straight to the withdraw routes UI; the reference build emits only " | ||
| "delegate_vesting_shares and withdraw_vesting.", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the differential harness compares the populated Useful? React with 👍 / 👎.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Valid, fixed in 7633c76 by removing the entry rather than narrowing it. Confirmed the mechanism: Went further than narrowing the comparison because this case can never be body-compared anyway. Left a comment in its place explaining why the case is deliberately absent, so the next person does not re-add it. |
||
| } | ||
|
|
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.