Skip to content

Commit

Permalink
Add delegation field to type WalletStateUpdate.
Browse files Browse the repository at this point in the history
This represents any stake delegation that may have occurred during the
transition from one wallet state to another wallet state.
  • Loading branch information
jonathanknowles committed Nov 20, 2019
1 parent dacdd11 commit 75111f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/core/src/Cardano/Wallet/Primitive/Model.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import Cardano.Wallet.Primitive.Types
, EpochLength (..)
, FeePolicy (..)
, Hash (..)
, PoolId (..)
, SlotLength (..)
, SlotParameters (SlotParameters)
, StartTime (..)
Expand Down Expand Up @@ -279,6 +280,8 @@ data WalletStateUpdate s = WalletStateUpdate
-- ^ The updated state of the wallet.
, transactions :: ![(Tx, TxMeta)]
-- ^ Transactions that occur during the state transition.
, delegation :: !(Maybe PoolId)
-- ^ Any stake delegation that occurs during the state transition.
} deriving (Generic, Show, Eq)

-- | Apply a single block to the wallet. This is the primary way of making a
Expand All @@ -292,6 +295,8 @@ applyBlock w@(Wallet !u _ s bp) !b = WalletStateUpdate
{ initialState = w
, updatedState = Wallet u' (b ^. #header) s' bp
, transactions = txs
, delegation = Nothing
-- TODO: Determine whether any stake delegation has occurred.
}
where
((txs, u'), s') = prefilterBlock b u s
Expand Down

0 comments on commit 75111f5

Please sign in to comment.