@@ -43,7 +43,12 @@ var UtxoValidationRules = []common.UtxoValidationRuleFunc{
4343}
4444
4545// UtxoValidateOutputTooBigUtxo ensures that transaction output values are not too large
46- func UtxoValidateOutputTooBigUtxo (tx common.Transaction , slot uint64 , _ common.LedgerState , pp common.ProtocolParameters ) error {
46+ func UtxoValidateOutputTooBigUtxo (
47+ tx common.Transaction ,
48+ slot uint64 ,
49+ _ common.LedgerState ,
50+ pp common.ProtocolParameters ,
51+ ) error {
4752 tmpPparams , ok := pp .(* AlonzoProtocolParameters )
4853 if ! ok {
4954 return errors .New ("pparams are not expected type" )
@@ -72,7 +77,12 @@ func UtxoValidateOutputTooBigUtxo(tx common.Transaction, slot uint64, _ common.L
7277}
7378
7479// UtxoValidateExUnitsTooBigUtxo ensures that ExUnits for a transaction do not exceed the maximum specified via protocol parameters
75- func UtxoValidateExUnitsTooBigUtxo (tx common.Transaction , slot uint64 , ls common.LedgerState , pp common.ProtocolParameters ) error {
80+ func UtxoValidateExUnitsTooBigUtxo (
81+ tx common.Transaction ,
82+ slot uint64 ,
83+ ls common.LedgerState ,
84+ pp common.ProtocolParameters ,
85+ ) error {
7686 tmpPparams , ok := pp .(* AlonzoProtocolParameters )
7787 if ! ok {
7888 return errors .New ("pparams are not expected type" )
@@ -86,7 +96,8 @@ func UtxoValidateExUnitsTooBigUtxo(tx common.Transaction, slot uint64, ls common
8696 totalSteps += redeemer .ExUnits .Steps
8797 totalMemory += redeemer .ExUnits .Memory
8898 }
89- if totalSteps <= tmpPparams .MaxTxExUnits .Steps && totalMemory <= tmpPparams .MaxTxExUnits .Memory {
99+ if totalSteps <= tmpPparams .MaxTxExUnits .Steps &&
100+ totalMemory <= tmpPparams .MaxTxExUnits .Memory {
90101 return nil
91102 }
92103 return ExUnitsTooBigUtxoError {
@@ -98,24 +109,49 @@ func UtxoValidateExUnitsTooBigUtxo(tx common.Transaction, slot uint64, ls common
98109 }
99110}
100111
101- func UtxoValidateOutsideValidityIntervalUtxo (tx common.Transaction , slot uint64 , ls common.LedgerState , pp common.ProtocolParameters ) error {
112+ func UtxoValidateOutsideValidityIntervalUtxo (
113+ tx common.Transaction ,
114+ slot uint64 ,
115+ ls common.LedgerState ,
116+ pp common.ProtocolParameters ,
117+ ) error {
102118 return allegra .UtxoValidateOutsideValidityIntervalUtxo (tx , slot , ls , pp )
103119}
104120
105- func UtxoValidateInputSetEmptyUtxo (tx common.Transaction , slot uint64 , ls common.LedgerState , pp common.ProtocolParameters ) error {
121+ func UtxoValidateInputSetEmptyUtxo (
122+ tx common.Transaction ,
123+ slot uint64 ,
124+ ls common.LedgerState ,
125+ pp common.ProtocolParameters ,
126+ ) error {
106127 return shelley .UtxoValidateInputSetEmptyUtxo (tx , slot , ls , pp )
107128}
108129
109- func UtxoValidateFeeTooSmallUtxo (tx common.Transaction , slot uint64 , ls common.LedgerState , pp common.ProtocolParameters ) error {
130+ func UtxoValidateFeeTooSmallUtxo (
131+ tx common.Transaction ,
132+ slot uint64 ,
133+ ls common.LedgerState ,
134+ pp common.ProtocolParameters ,
135+ ) error {
110136 tmpPparams , ok := pp .(* AlonzoProtocolParameters )
111137 if ! ok {
112138 return errors .New ("pparams are not expected type" )
113139 }
114- return shelley .UtxoValidateFeeTooSmallUtxo (tx , slot , ls , & tmpPparams .ShelleyProtocolParameters )
140+ return shelley .UtxoValidateFeeTooSmallUtxo (
141+ tx ,
142+ slot ,
143+ ls ,
144+ & tmpPparams .ShelleyProtocolParameters ,
145+ )
115146}
116147
117148// UtxoValidateInsufficientCollateral ensures that there is sufficient collateral provided
118- func UtxoValidateInsufficientCollateral (tx common.Transaction , slot uint64 , ls common.LedgerState , pp common.ProtocolParameters ) error {
149+ func UtxoValidateInsufficientCollateral (
150+ tx common.Transaction ,
151+ slot uint64 ,
152+ ls common.LedgerState ,
153+ pp common.ProtocolParameters ,
154+ ) error {
119155 tmpPparams , ok := pp .(* AlonzoProtocolParameters )
120156 if ! ok {
121157 return errors .New ("pparams are not expected type" )
@@ -147,7 +183,12 @@ func UtxoValidateInsufficientCollateral(tx common.Transaction, slot uint64, ls c
147183}
148184
149185// UtxoValidateCollateralContainsNonAda ensures that collateral inputs don't contain non-ADA
150- func UtxoValidateCollateralContainsNonAda (tx common.Transaction , slot uint64 , ls common.LedgerState , pp common.ProtocolParameters ) error {
186+ func UtxoValidateCollateralContainsNonAda (
187+ tx common.Transaction ,
188+ slot uint64 ,
189+ ls common.LedgerState ,
190+ pp common.ProtocolParameters ,
191+ ) error {
151192 tmpTx , ok := tx .(* AlonzoTransaction )
152193 if ! ok {
153194 return errors .New ("transaction is not expected type" )
@@ -178,7 +219,12 @@ func UtxoValidateCollateralContainsNonAda(tx common.Transaction, slot uint64, ls
178219}
179220
180221// UtxoValidateNoCollateralInputs ensures that collateral inputs are provided when redeemers are present
181- func UtxoValidateNoCollateralInputs (tx common.Transaction , slot uint64 , ls common.LedgerState , pp common.ProtocolParameters ) error {
222+ func UtxoValidateNoCollateralInputs (
223+ tx common.Transaction ,
224+ slot uint64 ,
225+ ls common.LedgerState ,
226+ pp common.ProtocolParameters ,
227+ ) error {
182228 tmpTx , ok := tx .(* AlonzoTransaction )
183229 if ! ok {
184230 return errors .New ("transaction is not expected type" )
@@ -193,42 +239,92 @@ func UtxoValidateNoCollateralInputs(tx common.Transaction, slot uint64, ls commo
193239 return NoCollateralInputsError {}
194240}
195241
196- func UtxoValidateBadInputsUtxo (tx common.Transaction , slot uint64 , ls common.LedgerState , pp common.ProtocolParameters ) error {
242+ func UtxoValidateBadInputsUtxo (
243+ tx common.Transaction ,
244+ slot uint64 ,
245+ ls common.LedgerState ,
246+ pp common.ProtocolParameters ,
247+ ) error {
197248 return shelley .UtxoValidateBadInputsUtxo (tx , slot , ls , pp )
198249}
199250
200- func UtxoValidateValueNotConservedUtxo (tx common.Transaction , slot uint64 , ls common.LedgerState , pp common.ProtocolParameters ) error {
251+ func UtxoValidateValueNotConservedUtxo (
252+ tx common.Transaction ,
253+ slot uint64 ,
254+ ls common.LedgerState ,
255+ pp common.ProtocolParameters ,
256+ ) error {
201257 tmpPparams , ok := pp .(* AlonzoProtocolParameters )
202258 if ! ok {
203259 return errors .New ("pparams are not expected type" )
204260 }
205- return shelley .UtxoValidateValueNotConservedUtxo (tx , slot , ls , & tmpPparams .ShelleyProtocolParameters )
261+ return shelley .UtxoValidateValueNotConservedUtxo (
262+ tx ,
263+ slot ,
264+ ls ,
265+ & tmpPparams .ShelleyProtocolParameters ,
266+ )
206267}
207268
208- func UtxoValidateOutputTooSmallUtxo (tx common.Transaction , slot uint64 , ls common.LedgerState , pp common.ProtocolParameters ) error {
269+ func UtxoValidateOutputTooSmallUtxo (
270+ tx common.Transaction ,
271+ slot uint64 ,
272+ ls common.LedgerState ,
273+ pp common.ProtocolParameters ,
274+ ) error {
209275 tmpPparams , ok := pp .(* AlonzoProtocolParameters )
210276 if ! ok {
211277 return errors .New ("pparams are not expected type" )
212278 }
213- return shelley .UtxoValidateOutputTooSmallUtxo (tx , slot , ls , & tmpPparams .ShelleyProtocolParameters )
279+ return shelley .UtxoValidateOutputTooSmallUtxo (
280+ tx ,
281+ slot ,
282+ ls ,
283+ & tmpPparams .ShelleyProtocolParameters ,
284+ )
214285}
215286
216- func UtxoValidateOutputBootAddrAttrsTooBig (tx common.Transaction , slot uint64 , ls common.LedgerState , pp common.ProtocolParameters ) error {
287+ func UtxoValidateOutputBootAddrAttrsTooBig (
288+ tx common.Transaction ,
289+ slot uint64 ,
290+ ls common.LedgerState ,
291+ pp common.ProtocolParameters ,
292+ ) error {
217293 return shelley .UtxoValidateOutputBootAddrAttrsTooBig (tx , slot , ls , pp )
218294}
219295
220- func UtxoValidateWrongNetwork (tx common.Transaction , slot uint64 , ls common.LedgerState , pp common.ProtocolParameters ) error {
296+ func UtxoValidateWrongNetwork (
297+ tx common.Transaction ,
298+ slot uint64 ,
299+ ls common.LedgerState ,
300+ pp common.ProtocolParameters ,
301+ ) error {
221302 return shelley .UtxoValidateWrongNetwork (tx , slot , ls , pp )
222303}
223304
224- func UtxoValidateWrongNetworkWithdrawal (tx common.Transaction , slot uint64 , ls common.LedgerState , pp common.ProtocolParameters ) error {
305+ func UtxoValidateWrongNetworkWithdrawal (
306+ tx common.Transaction ,
307+ slot uint64 ,
308+ ls common.LedgerState ,
309+ pp common.ProtocolParameters ,
310+ ) error {
225311 return shelley .UtxoValidateWrongNetworkWithdrawal (tx , slot , ls , pp )
226312}
227313
228- func UtxoValidateMaxTxSizeUtxo (tx common.Transaction , slot uint64 , ls common.LedgerState , pp common.ProtocolParameters ) error {
314+ func UtxoValidateMaxTxSizeUtxo (
315+ tx common.Transaction ,
316+ slot uint64 ,
317+ ls common.LedgerState ,
318+ pp common.ProtocolParameters ,
319+ ) error {
229320 tmpPparams , ok := pp .(* AlonzoProtocolParameters )
230321 if ! ok {
231322 return errors .New ("pparams are not expected type" )
232323 }
233- return shelley .UtxoValidateMaxTxSizeUtxo (tx , slot , ls , & tmpPparams .ShelleyProtocolParameters )
324+ return shelley .UtxoValidateMaxTxSizeUtxo (
325+ tx ,
326+ slot ,
327+ ls ,
328+ & tmpPparams .ShelleyProtocolParameters ,
329+ )
234330}
0 commit comments