Skip to content

Commit

Permalink
move TxIn and TxId to core
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared Corduan committed Oct 11, 2021
1 parent ef2040e commit dde7fc5
Show file tree
Hide file tree
Showing 45 changed files with 271 additions and 202 deletions.
Expand Up @@ -57,13 +57,13 @@ import Cardano.Ledger.Shelley.Scripts (ScriptHash (..))
import Cardano.Ledger.Shelley.TxBody
( DelegCert (..),
Delegation (..),
TxIn (..),
Wdrl (..),
getRwdCred,
witKeyHash,
)
import Cardano.Ledger.Shelley.UTxO (UTxO (..), getScriptHash, scriptCred)
import Cardano.Ledger.ShelleyMA.Timelocks (evalTimelock)
import Cardano.Ledger.TxIn (TxIn (..))
import Cardano.Slotting.EpochInfo (EpochInfo)
import Cardano.Slotting.Time (SystemStart)
import Data.Coders
Expand Down
3 changes: 2 additions & 1 deletion eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxos.hs
Expand Up @@ -57,8 +57,9 @@ import qualified Cardano.Ledger.Shelley.LedgerState as Shelley
import Cardano.Ledger.Shelley.PParams (Update)
import Cardano.Ledger.Shelley.Rules.Ppup (PPUP, PPUPEnv (..), PpupPredicateFailure)
import Cardano.Ledger.Shelley.Rules.Utxo (UtxoEnv (..))
import Cardano.Ledger.Shelley.TxBody (DCert, TxIn (..), Wdrl)
import Cardano.Ledger.Shelley.TxBody (DCert, Wdrl)
import Cardano.Ledger.Shelley.UTxO (balance, totalDeposits)
import Cardano.Ledger.TxIn (TxIn (..))
import Cardano.Ledger.Val as Val
import Control.Iterate.SetAlgebra (eval, (∪), (⋪), (◁))
import Control.Monad.Except (MonadError (throwError))
Expand Down
3 changes: 2 additions & 1 deletion eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Tx.hs
Expand Up @@ -135,8 +135,9 @@ import Cardano.Ledger.SafeHash
import Cardano.Ledger.Shelley.Address.Bootstrap (BootstrapWitness)
import Cardano.Ledger.Shelley.Delegation.Certificates (DCert (..))
import Cardano.Ledger.Shelley.Scripts (ScriptHash)
import Cardano.Ledger.Shelley.TxBody (TxIn (..), Wdrl (..), WitVKey, unWdrl)
import Cardano.Ledger.Shelley.TxBody (Wdrl (..), WitVKey, unWdrl)
import qualified Cardano.Ledger.Shelley.UTxO as Shelley
import Cardano.Ledger.TxIn (TxIn (..))
import Cardano.Ledger.Val (Val (coin, (<+>), (<×>)))
import Control.DeepSeq (NFData (..))
import qualified Data.ByteString.Lazy as LBS
Expand Down
3 changes: 2 additions & 1 deletion eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxBody.hs
Expand Up @@ -113,8 +113,9 @@ import Cardano.Ledger.Shelley.CompactAddr (CompactAddr, compactAddr, decompactAd
import Cardano.Ledger.Shelley.Delegation.Certificates (DCert)
import Cardano.Ledger.Shelley.PParams (Update)
import Cardano.Ledger.Shelley.Scripts (ScriptHash)
import Cardano.Ledger.Shelley.TxBody (TxIn (..), Wdrl (Wdrl), unWdrl)
import Cardano.Ledger.Shelley.TxBody (Wdrl (Wdrl), unWdrl)
import Cardano.Ledger.ShelleyMA.Timelocks (ValidityInterval (..), ppValidityInterval)
import Cardano.Ledger.TxIn (TxIn (..))
import Cardano.Ledger.Val
( DecodeNonNegative,
decodeMint,
Expand Down
3 changes: 1 addition & 2 deletions eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs
Expand Up @@ -52,13 +52,12 @@ import Cardano.Ledger.Shelley.TxBody
Delegation (..),
PoolCert (..),
PoolParams (..),
TxId (..),
TxIn (..),
Wdrl (..),
WitVKey (..),
)
import Cardano.Ledger.Shelley.UTxO (UTxO (..))
import Cardano.Ledger.ShelleyMA.Timelocks (ValidityInterval (..))
import Cardano.Ledger.TxIn (TxId (..), TxIn (..))
import Cardano.Ledger.Val (Val (..))
import Cardano.Slotting.EpochInfo (EpochInfo, epochInfoSlotToUTCTime)
import Cardano.Slotting.Slot (EpochNo (..), SlotNo (..))
Expand Down
Expand Up @@ -52,10 +52,11 @@ import Cardano.Ledger.Keys (KeyHash, KeyRole (Witness))
import Cardano.Ledger.Mary (MaryEra)
import Cardano.Ledger.Mary.Value (AssetName (..), PolicyID (..), Value, policies, valueFromList)
import Cardano.Ledger.Shelley.PParams (Update)
import Cardano.Ledger.Shelley.TxBody (DCert, TxIn, Wdrl)
import Cardano.Ledger.Shelley.TxBody (DCert, Wdrl)
import Cardano.Ledger.Shelley.UTxO (UTxO (..), balance)
import Cardano.Ledger.ShelleyMA.AuxiliaryData as Mary (pattern AuxiliaryData)
import Cardano.Ledger.ShelleyMA.Timelocks (Timelock (..))
import Cardano.Ledger.TxIn (TxIn)
import Cardano.Ledger.Val (Val (coin), adaOnly, (<+>), (<×>))
import Cardano.Slotting.Slot (SlotNo (..))
import Control.Iterate.SetAlgebra (eval, (◁))
Expand Down
Expand Up @@ -74,11 +74,11 @@ import Cardano.Ledger.Shelley.Constraints (TransValue)
import Cardano.Ledger.Shelley.PParams (Update)
import Cardano.Ledger.Shelley.TxBody
( DCert (..),
TxIn (..),
TxOut (..),
Wdrl (..),
)
import Cardano.Ledger.ShelleyMA.Timelocks (ValidityInterval (..), ppValidityInterval)
import Cardano.Ledger.TxIn (TxIn (..))
import Cardano.Ledger.Val
( DecodeMint (..),
DecodeNonNegative,
Expand Down
Expand Up @@ -37,12 +37,13 @@ import Cardano.Ledger.Shelley.Constraints
)
import Cardano.Ledger.Shelley.PParams (PParams, PParams' (..), Update)
import Cardano.Ledger.Shelley.Tx (pattern Tx, pattern WitnessSet)
import Cardano.Ledger.Shelley.TxBody (DCert, TxIn, TxOut (..), Wdrl)
import Cardano.Ledger.Shelley.TxBody (DCert, TxOut (..), Wdrl)
import Cardano.Ledger.ShelleyMA.Timelocks (Timelock (..))
import Cardano.Ledger.ShelleyMA.TxBody
( TxBody (..),
ValidityInterval (ValidityInterval),
)
import Cardano.Ledger.TxIn (TxIn)
import Cardano.Ledger.Val (Val (zero), (<+>))
import Cardano.Slotting.Slot (SlotNo (SlotNo))
import Control.Monad (replicateM)
Expand Down
Expand Up @@ -11,7 +11,7 @@ import qualified Cardano.Ledger.Shelley.API as S
import Cardano.Ledger.Shelley.LedgerState ()
import Cardano.Ledger.Shelley.PParams (emptyPParams)
import Cardano.Ledger.Shelley.Tx (hashScript, scriptWits)
import Cardano.Ledger.Shelley.UTxO (txid)
import Cardano.Ledger.TxIn (txid)
import qualified Cardano.Ledger.Val as Val
import Cardano.Slotting.Slot (SlotNo (..))
import Control.Monad.Except (runExcept)
Expand Down
Expand Up @@ -30,17 +30,13 @@ import Cardano.Ledger.Shelley.Tx
WitnessSetHKD (..),
hashScript,
)
import Cardano.Ledger.Shelley.TxBody
( TxId,
TxIn (..),
TxOut (..),
Wdrl (..),
)
import Cardano.Ledger.Shelley.UTxO (UTxO (..), makeWitnessesVKey, txid)
import Cardano.Ledger.Shelley.TxBody (TxOut (..), Wdrl (..))
import Cardano.Ledger.Shelley.UTxO (UTxO (..), makeWitnessesVKey)
import Cardano.Ledger.ShelleyMA.Rules.Utxo (UtxoPredicateFailure (..))
import Cardano.Ledger.ShelleyMA.Timelocks (Timelock (..), ValidityInterval (..))
import Cardano.Ledger.ShelleyMA.TxBody (TxBody (..))
import Cardano.Ledger.Slot (SlotNo (..))
import Cardano.Ledger.TxIn (TxId, TxIn (..), txid)
import Cardano.Ledger.Val ((<+>), (<->))
import qualified Cardano.Ledger.Val as Val
import Control.Exception (ErrorCall (ErrorCall), evaluate, try)
Expand Down
Expand Up @@ -33,7 +33,6 @@ import Cardano.Ledger.Shelley.TxBody
( DCert (..),
DelegCert (..),
RewardAcnt (..),
TxIn (..),
TxOut (..),
Wdrl (..),
)
Expand All @@ -44,6 +43,7 @@ import Cardano.Ledger.ShelleyMA.Timelocks
)
import Cardano.Ledger.ShelleyMA.TxBody (TxBody (..))
import Cardano.Ledger.Slot (EpochNo (..), SlotNo (..))
import Cardano.Ledger.TxIn (TxIn (..))
import qualified Cardano.Ledger.Val as Val
import Codec.CBOR.Encoding (Tokens (..))
import qualified Data.ByteString.Char8 as BS
Expand Down
4 changes: 1 addition & 3 deletions eras/shelley/impl/src/Cardano/Ledger/Pretty.hs
Expand Up @@ -138,12 +138,9 @@ import Cardano.Ledger.Shelley.TxBody
StakePoolRelay (..),
TxBody (..),
TxBodyRaw (..),
TxId (..),
TxIn (..),
TxOut (..),
Wdrl (..),
WitVKey (..),
viewTxIn,
)
import Cardano.Ledger.Shelley.UTxO (UTxO (..))
import Cardano.Ledger.Slot
Expand All @@ -153,6 +150,7 @@ import Cardano.Ledger.Slot
EpochSize (..),
SlotNo (..),
)
import Cardano.Ledger.TxIn (TxId (..), TxIn (..), viewTxIn)
import Cardano.Protocol.TPraos (IndividualPoolStake (..), PoolDistr (..))
import Cardano.Protocol.TPraos.BHeader
( BHBody (..),
Expand Down
3 changes: 1 addition & 2 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Types.hs
Expand Up @@ -128,7 +128,6 @@ import Cardano.Ledger.Shelley.StabilityWindow as X
import Cardano.Ledger.Shelley.Tx as X
( Tx (..),
TxBody (..),
TxIn (..),
TxOut (..),
WitnessSet,
)
Expand All @@ -143,14 +142,14 @@ import Cardano.Ledger.Shelley.TxBody as X
Ptr (..),
StakeCreds (..),
StakePoolRelay (..),
TxId (..),
Wdrl (..),
WitVKey (..),
)
import Cardano.Ledger.Shelley.UTxO as X
( UTxO (..),
balance,
)
import Cardano.Ledger.TxIn as X (TxId (..), TxIn (..))
import Cardano.Protocol.TPraos as X
( PoolDistr (..),
individualPoolStake,
Expand Down
3 changes: 2 additions & 1 deletion eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Wallet.hs
Expand Up @@ -97,9 +97,10 @@ import Cardano.Ledger.Shelley.Rewards
)
import Cardano.Ledger.Shelley.Rules.NewEpoch (calculatePoolDistr)
import Cardano.Ledger.Shelley.Tx (Tx (..), WitnessSet, WitnessSetHKD (..))
import Cardano.Ledger.Shelley.TxBody (DCert, PoolParams (..), TxIn (..), WitVKey (..))
import Cardano.Ledger.Shelley.TxBody (DCert, PoolParams (..), WitVKey (..))
import Cardano.Ledger.Shelley.UTxO (UTxO (..), balance)
import Cardano.Ledger.Slot (epochInfoSize)
import Cardano.Ledger.TxIn (TxIn (..))
import Cardano.Ledger.Val ((<->))
import qualified Cardano.Ledger.Val as Val
import Cardano.Protocol.TPraos
Expand Down
4 changes: 2 additions & 2 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/BlockChain.hs
Expand Up @@ -94,9 +94,9 @@ import Cardano.Ledger.Serialization
encodeFoldableMapEncoder,
)
import Cardano.Ledger.Shelley.EpochBoundary (BlocksMade (..))
import Cardano.Ledger.Shelley.Tx (Tx, TxIn (..), segwitTx)
import Cardano.Ledger.Shelley.UTxO (txid)
import Cardano.Ledger.Shelley.Tx (Tx, segwitTx)
import Cardano.Ledger.Slot (SlotNo (..))
import Cardano.Ledger.TxIn (TxIn (..), txid)
import qualified Cardano.Protocol.TPraos.BHeader as TP
import Cardano.Slotting.Slot (WithOrigin (..))
import Control.Monad (unless)
Expand Down
3 changes: 2 additions & 1 deletion eras/shelley/impl/src/Cardano/Ledger/Shelley/Genesis.hs
Expand Up @@ -49,8 +49,9 @@ import Cardano.Ledger.Serialization
import Cardano.Ledger.Shelley.Constraints (UsesTxOut (..))
import Cardano.Ledger.Shelley.PParams
import Cardano.Ledger.Shelley.StabilityWindow
import Cardano.Ledger.Shelley.TxBody (PoolParams (..), TxId (..), TxIn (..))
import Cardano.Ledger.Shelley.TxBody (PoolParams (..))
import Cardano.Ledger.Shelley.UTxO
import Cardano.Ledger.TxIn (TxId (..), TxIn (..))
import qualified Cardano.Ledger.Val as Val
import Cardano.Prelude (forceElemsToWHNF)
import Cardano.Slotting.EpochInfo
Expand Down
Expand Up @@ -199,7 +199,6 @@ import Cardano.Ledger.Shelley.TxBody
Ptr (..),
RewardAcnt (..),
TransTxId,
TxIn (..),
Wdrl (..),
WitVKey (..),
getRwdCred,
Expand All @@ -219,6 +218,7 @@ import Cardano.Ledger.Slot
EpochSize (..),
SlotNo (..),
)
import Cardano.Ledger.TxIn (TxIn (..))
import Cardano.Ledger.Val ((<+>), (<->), (<×>))
import qualified Cardano.Ledger.Val as Val
import Cardano.Protocol.TPraos (PoolDistr (..))
Expand Down
3 changes: 2 additions & 1 deletion eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Utxow.hs
Expand Up @@ -85,8 +85,9 @@ import Cardano.Ledger.Shelley.Tx
hashScript,
validateScript,
)
import Cardano.Ledger.Shelley.TxBody (DCert, EraIndependentTxBody, TxIn, Wdrl)
import Cardano.Ledger.Shelley.TxBody (DCert, EraIndependentTxBody, Wdrl)
import Cardano.Ledger.Shelley.UTxO (UTxO, scriptsNeeded)
import Cardano.Ledger.TxIn (TxIn)
import Control.Monad (when)
import Control.Monad.Trans.Reader (asks)
import Control.SetAlgebra (eval, (∩))
Expand Down
3 changes: 1 addition & 2 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/Tx.hs
Expand Up @@ -83,12 +83,11 @@ import Cardano.Ledger.Shelley.Address.Bootstrap (BootstrapWitness)
import Cardano.Ledger.Shelley.Scripts
import Cardano.Ledger.Shelley.TxBody
( TxBody (..),
TxId (..),
TxIn (..),
TxOut (..),
WitVKey (..),
witKeyHash,
)
import Cardano.Ledger.TxIn (TxId (..), TxIn (..))
import qualified Data.ByteString.Lazy as BSL
import qualified Data.ByteString.Short as SBS
import Data.Coders
Expand Down

0 comments on commit dde7fc5

Please sign in to comment.