-
Notifications
You must be signed in to change notification settings - Fork 217
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
Test migration of SeaHorses failing due to insufficient ada #2652
Conversation
@jonathanknowles I saw the |
lib/core-integration/src/Test/Integration/Scenario/API/Shelley/Migrations.hs
Outdated
Show resolved
Hide resolved
@@ -196,18 +197,21 @@ spec = describe "SHELLEY_MIGRATIONS" $ do | |||
(errMsg404NoWallet $ sourceWallet ^. walletId) | |||
] | |||
|
|||
|
|||
it "SHELLEY_CREATE_MIGRATION_PLAN_04 - \ | |||
\Cannot create a plan for a wallet that only contains dust." |
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 guess with this PR this might technically not be a dust wallet?, but it should at least be a wallet of Freerider
s
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.
For a wallet of just ada values, we could define "dust" as an ada value that can't be an input to a singleton transaction.
Each value would need to be less than output minimum ada quantity + base cost of tx + marginal cost of tx input.
Also: maybe you don't even need the tokens for a test like this? Just the right amount of ada? |
2069746
to
b913667
Compare
Hi @Anviking. Thanks for creating this! I agree with you that it would be ideal to have a test with a real dust wallet, or a wallet that cannot be fully migrated because it's dominated by freerider entries. An interesting case, perhaps worth testing, would be where the UTxO has too many entries to fit into a single transaction, but the migration algorithm cannot construct a second transaction because all the non-freerider entries are used up in the first transaction. That would allow us to have coverage for a partial migration. Perhaps we can have a call about it on Monday? By the way, have a nice weekend! |
0d5d0a3
to
1a6eab6
Compare
lib/core-integration/src/Test/Integration/Scenario/API/Shelley/Migrations.hs
Outdated
Show resolved
Hide resolved
lib/core-integration/src/Test/Integration/Scenario/API/Shelley/Migrations.hs
Show resolved
Hide resolved
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!
If you have time, it would be great to add checks that we have a non-zero balance in:
SHELLEY_CREATE_MIGRATION_PLAN_04
BYRON_CREATE_MIGRATION_PLAN_04
Of course, these are slightly different tests, but they are designed to drive the same condition, which is a non-empty wallet cannot be migrated, even partly.
1. Allow specifying the per-bundle ada quantity when minting SeaHorses through the test infrastructure. 2. Test that we can get the wallet to 403 when trying to migrate, despite having a non-zero balance.
1a6eab6
to
70bf4f9
Compare
bors r+ |
@jonathanknowles I tried adding a similar balance check to the byron version, but it failed 🤔 --- a/lib/core-integration/src/Test/Integration/Scenario/API/Byron/Migrations.hs
+++ b/lib/core-integration/src/Test/Integration/Scenario/API/Byron/Migrations.hs
@@ -202,6 +202,15 @@ spec = describe "BYRON_MIGRATIONS" $ do
let ep = Link.createMigrationPlan @'Byron sourceWallet
response <- request @(ApiWalletMigrationPlan n) ctx ep Default
(Json [json|{addresses: #{targetAddressIds}}|])
+
+ eventually "dust wallet has funds" $
+ request @ApiWallet ctx
+ (Link.getWallet @'Shelley sourceWallet) Default Empty
+ >>= flip verify
+ [ expectField (#balance . #available . #getQuantity)
+ (.> 0)
+ ]
+
verify response
[ expectResponseCode HTTP.status403
, expectErrorMessage 🤦♂️ -> wait I see why |
to BYRON_CREATE_MIGRATION_PLAN_04
Canceled. |
bors r+ |
Build succeeded: |
Issue Number
#2644
Overview
pendingWith
to enableSHELLEY_CREATE_MIGRATION_PLAN_04 - Cannot create a plan for a wallet that only contains dust.
Comments