Skip to content

Commit

Permalink
Refactor read-tx witnesses.
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino committed Mar 21, 2023
1 parent 26af683 commit 578e843
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions lib/wallet/src/Cardano/Wallet/Read/Tx/Witnesses.hs
@@ -1,5 +1,6 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
Expand Down Expand Up @@ -67,13 +68,15 @@ deriving instance Show (WitnessesType era) => Show (Witnesses era)
deriving instance Eq (WitnessesType era) => Eq (Witnesses era)

getEraWitnesses :: EraFun Tx Witnesses
getEraWitnesses = EraFun
{ byronFun = \_ -> Witnesses ()
, shelleyFun = \_ -> Witnesses ()
, allegraFun = \_ -> Witnesses ()
, maryFun = onTx $ \tx -> Witnesses (tx ^. witsTxL)
, alonzoFun = onTx $ \tx -> Witnesses (tx ^. witsTxL)
, babbageFun = onTx $ \tx -> Witnesses (tx ^. witsTxL)
, conwayFun = onTx $ \tx -> Witnesses (tx ^. witsTxL)
}

getEraWitnesses =
EraFun
{ byronFun = \_ -> Witnesses ()
, shelleyFun = \_ -> Witnesses ()
, allegraFun = \_ -> Witnesses ()
, maryFun = maryWitnesses
, alonzoFun = maryWitnesses
, babbageFun = maryWitnesses
, conwayFun = maryWitnesses
}
where
maryWitnesses = onTx $ \tx -> Witnesses $ tx ^. witsTxL

0 comments on commit 578e843

Please sign in to comment.