Created
May 21, 2015 18:39
-
-
Save nkaretnikov/2931b3634f6501cbe0f5 to your computer and use it in GitHub Desktop.
expected project balance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(old_shares, old_share_value, expected_share_value) <- testDB $ do | |
old_project_shares <- fetchProjectSharesDB project_id | |
old_user_shares <- getBy (UniquePledge user_id project_id) >>= \case | |
Nothing -> return 0 | |
Just p -> return $ pledgeFundedShares $ entityVal p | |
return ( old_user_shares | |
, projectComputeShareValue old_project_shares | |
, projectComputeShareValue $ | |
shares : delete old_user_shares old_project_shares ) | |
let expected_project_balance = | |
accountBalance project_account | |
- (old_shares *$ old_share_value) | |
+ (shares *$ expected_share_value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment