@@ -90,43 +90,32 @@ setScriptDataHash costModels rs ds tx@(Transaction { body, witnessSet })
90
90
attachDatum :: PlutusData -> Transaction -> Transaction
91
91
attachDatum d = attachDatums [ d ]
92
92
93
- attachDatums
94
- :: Array PlutusData -> Transaction -> Transaction
93
+ attachDatums :: Array PlutusData -> Transaction -> Transaction
95
94
attachDatums [] tx = tx
96
95
attachDatums datums tx@(Transaction { witnessSet: TransactionWitnessSet ws }) =
97
- do
98
- updateTxWithWitnesses tx $ TransactionWitnessSet $ ws
99
- { plutusData = nub $ ws.plutusData <> datums }
96
+ updateTxWithWitnesses tx $ TransactionWitnessSet $ ws
97
+ { plutusData = nub $ ws.plutusData <> datums
98
+ }
100
99
101
100
-- | Attach a `PlutusScript` to a transaction by modifying its existing witness
102
101
-- | set
103
- attachPlutusScript
104
- :: PlutusScript -> Transaction -> Transaction
102
+ attachPlutusScript :: PlutusScript -> Transaction -> Transaction
105
103
attachPlutusScript ps = attachPlutusScripts [ ps ]
106
104
107
- attachPlutusScripts
108
- :: Array PlutusScript
109
- -> Transaction
110
- -> Transaction
105
+ attachPlutusScripts :: Array PlutusScript -> Transaction -> Transaction
111
106
attachPlutusScripts ps tx@(Transaction { witnessSet: TransactionWitnessSet ws }) =
112
- do
113
- updateTxWithWitnesses tx
114
- $ TransactionWitnessSet
115
- $ ws { plutusScripts = nub $ ws.plutusScripts <> ps }
107
+ updateTxWithWitnesses tx $ TransactionWitnessSet $ ws
108
+ { plutusScripts = nub $ ws.plutusScripts <> ps
109
+ }
116
110
117
111
-- | Attach a `NativeScript` to a transaction by modifying its existing witness
118
112
-- | set
119
- attachNativeScript
120
- :: NativeScript -> Transaction -> Transaction
113
+ attachNativeScript :: NativeScript -> Transaction -> Transaction
121
114
attachNativeScript ns tx@(Transaction { witnessSet: TransactionWitnessSet ws }) =
122
- do
123
- updateTxWithWitnesses tx
124
- $ TransactionWitnessSet
125
- $ ws { nativeScripts = nub $ ws.nativeScripts <> [ ns ] }
115
+ updateTxWithWitnesses tx $ TransactionWitnessSet $ ws
116
+ { nativeScripts = nub $ ws.nativeScripts <> [ ns ]
117
+ }
126
118
127
- updateTxWithWitnesses
128
- :: Transaction
129
- -> TransactionWitnessSet
130
- -> Transaction
131
- updateTxWithWitnesses tx@(Transaction t) ws =
132
- over Transaction _ { witnessSet = t.witnessSet <> ws } tx
119
+ updateTxWithWitnesses :: Transaction -> TransactionWitnessSet -> Transaction
120
+ updateTxWithWitnesses tx ws =
121
+ over Transaction _ { witnessSet = ws } tx
0 commit comments