Skip to content

Remove duplicate scripts when building transaction body for Mary, Alonzo and Babbage #4953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cardano-api/src/Cardano/Api/TxBody.hs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ import qualified Data.ByteString.Lazy as LBS
import Data.Foldable (for_, toList)
import Data.Function (on)
import Data.List (intercalate, sortBy)
import qualified Data.List as List
import qualified Data.List.NonEmpty as NonEmpty
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
Expand Down Expand Up @@ -3378,7 +3379,7 @@ makeShelleyTransactionBody era@ShelleyBasedEraMary
TxScriptValidityNone
where
scripts :: [Ledger.Script StandardMary]
scripts = catMaybes
scripts = List.nub $ catMaybes
[ toShelleyScript <$> scriptWitnessScript scriptwitness
| (_, AnyScriptWitness scriptwitness)
<- collectTxBodyScriptWitnesses txbodycontent
Expand Down Expand Up @@ -3443,7 +3444,7 @@ makeShelleyTransactionBody era@ShelleyBasedEraAlonzo
witnesses = collectTxBodyScriptWitnesses txbodycontent

scripts :: [Ledger.Script StandardAlonzo]
scripts = catMaybes
scripts = List.nub $ catMaybes
[ toShelleyScript <$> scriptWitnessScript scriptwitness
| (_, AnyScriptWitness scriptwitness) <- witnesses
]
Expand Down Expand Up @@ -3551,7 +3552,7 @@ makeShelleyTransactionBody era@ShelleyBasedEraBabbage
witnesses = collectTxBodyScriptWitnesses txbodycontent

scripts :: [Ledger.Script StandardBabbage]
scripts = catMaybes
scripts = List.nub $ catMaybes
[ toShelleyScript <$> scriptWitnessScript scriptwitness
| (_, AnyScriptWitness scriptwitness) <- witnesses
]
Expand Down