-
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
Add property tests for migrationPlanToSelectionWithdrawals
.
#2654
Add property tests for migrationPlanToSelectionWithdrawals
.
#2654
Conversation
aa63bc8
to
5c1cd04
Compare
pidB = PoolId "B" | ||
pidUnknown = PoolId "unknown" | ||
knownPools = Set.fromList [pidA, pidB] | ||
next = WalletDelegationNext |
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.
This where
clause is a bit annoying: it should belong to the pool delegation tests, but its scope covers the entire property test suite for this module.
} | ||
deriving (Generic, Eq, Ord) | ||
deriving anyclass (NFData, Hashable) | ||
deriving (Read, Show) via (Quiet Address) |
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.
This makes the output of show
much more concise for values of type Address
.
Instead of:
Address { unAddress = "XXXX" }
We now have:
Address "XXXX"
This makes the output of `show` much more concise for values of type `Address`. Instead of: ```hs Address { unAddress = "XXXX" } ``` We now have: ```hs Address "XXXX" ```
This commit makes `migrationPlanToSelectionWithdrawals` assign target addresses in an order that precisely matches the order specified by the user. For example, suppose the user specifies the following target addresses: >>> [a1, a2, a3] These addresses will be assigned to the generated outputs in the following predictable cyclic order: >>> [a1, a2, a3, a1, a2, a3, .. ]
…outputs. In particular, we test that inputs and outputs are preserved in the correct order.
5c1cd04
to
ff468a0
Compare
@@ -1887,7 +1889,7 @@ migrationPlanToSelectionWithdrawals plan rewardWithdrawal outputAddressesToCycle | |||
|
|||
outputAddressesRemaining :: [Address] | |||
outputAddressesRemaining = | |||
drop (length $ view #outputs migrationSelection) outputAddresses | |||
drop (length outputsCovered) outputAddresses |
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 this a fix, or is it equivalent?
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 this a fix, or is it equivalent?
It's equivalent.
I guess, strictly speaking, this should be in a separate commit, as it isn't part of the fix. But it seems too minor to create a separate commit just for that.
bors r+ |
Build succeeded: |
Issue Number
ADP-840
Overview
This PR:
migrationPlanToSelectionWithdrawals
function.Background
Before this PR, the order in which target addresses were assigned to outputs was not cyclical, as expected: