Skip to content

Commit

Permalink
Some renaming of shadowed names
Browse files Browse the repository at this point in the history
should probably be not reexported in H.C.Api
  • Loading branch information
abailly-iohk committed Jun 24, 2022
1 parent c04c120 commit d79d86f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions hydra-cardano-api/src/Hydra/Cardano/Api/TxBody.hs
Expand Up @@ -41,12 +41,12 @@ findRedeemerMinting ::
Tx Era ->
PolicyId ->
Maybe a
findRedeemerMinting (getTxBody -> ShelleyTxBody _ body _ scriptData _ _) policyId = do
findRedeemerMinting (getTxBody -> ShelleyTxBody _ body _ scriptData _ _) pid = do
idx <- strictMaybeToMaybe $ Ledger.indexOf needle haystack
let ptr = Ledger.RdmrPtr Ledger.Mint idx
lookupRedeemer ptr scriptData
where
needle = toLedgerScriptHash policyId
needle = toLedgerScriptHash pid
haystack = getField @"minted" body :: Set (Ledger.ScriptHash StandardCrypto)

findScriptMinting ::
Expand All @@ -55,11 +55,11 @@ findScriptMinting ::
Tx Era ->
PolicyId ->
Maybe (PlutusScript lang)
findScriptMinting (getTxBody -> ShelleyTxBody _ body scripts _ _ _) policyId = do
findScriptMinting (getTxBody -> ShelleyTxBody _ body scripts _ _ _) pid = do
_idx <- strictMaybeToMaybe $ Ledger.indexOf needle haystack
fromLedgerScript @_ @lang <$> find ((== needle) . Ledger.hashScript @(ShelleyLedgerEra Era)) scripts
where
needle = toLedgerScriptHash policyId
needle = toLedgerScriptHash pid
haystack = getField @"minted" body :: Set (Ledger.ScriptHash StandardCrypto)

--
Expand Down
2 changes: 1 addition & 1 deletion hydra-node/src/Hydra/Chain/Direct/Tx.hs
Expand Up @@ -10,7 +10,7 @@
-- thus we have not yet "reached" 'isomorphism'.
module Hydra.Chain.Direct.Tx where

import Hydra.Cardano.Api
import Hydra.Cardano.Api hiding (policyId)
import Hydra.Prelude

import qualified Cardano.Api.UTxO as UTxO
Expand Down
6 changes: 3 additions & 3 deletions hydra-node/src/Hydra/Ledger/Cardano/Builder.hs
Expand Up @@ -118,15 +118,15 @@ mintTokens script redeemer assets tx =
(t, m)

mintedTokens' =
mintedTokens <> valueFromList (fmap (first (AssetId policyId)) assets)
mintedTokens <> valueFromList (fmap (first (AssetId pid)) assets)

mintedWitnesses' =
BuildTxWith $ mintedWitnesses <> Map.singleton policyId mintingWitness
BuildTxWith $ mintedWitnesses <> Map.singleton pid mintingWitness

mintingWitness =
mkScriptWitness script NoScriptDatumForMint (toScriptData redeemer)

policyId =
pid =
PolicyId $ hashScript $ PlutusScript script

-- | Burn tokens with given plutus minting script and redeemer.
Expand Down

0 comments on commit d79d86f

Please sign in to comment.