@@ -43,7 +43,12 @@ var UtxoValidationRules = []common.UtxoValidationRuleFunc{
43
43
}
44
44
45
45
// 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 {
47
52
tmpPparams , ok := pp .(* AlonzoProtocolParameters )
48
53
if ! ok {
49
54
return errors .New ("pparams are not expected type" )
@@ -72,7 +77,12 @@ func UtxoValidateOutputTooBigUtxo(tx common.Transaction, slot uint64, _ common.L
72
77
}
73
78
74
79
// 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 {
76
86
tmpPparams , ok := pp .(* AlonzoProtocolParameters )
77
87
if ! ok {
78
88
return errors .New ("pparams are not expected type" )
@@ -86,7 +96,8 @@ func UtxoValidateExUnitsTooBigUtxo(tx common.Transaction, slot uint64, ls common
86
96
totalSteps += redeemer .ExUnits .Steps
87
97
totalMemory += redeemer .ExUnits .Memory
88
98
}
89
- if totalSteps <= tmpPparams .MaxTxExUnits .Steps && totalMemory <= tmpPparams .MaxTxExUnits .Memory {
99
+ if totalSteps <= tmpPparams .MaxTxExUnits .Steps &&
100
+ totalMemory <= tmpPparams .MaxTxExUnits .Memory {
90
101
return nil
91
102
}
92
103
return ExUnitsTooBigUtxoError {
@@ -98,24 +109,49 @@ func UtxoValidateExUnitsTooBigUtxo(tx common.Transaction, slot uint64, ls common
98
109
}
99
110
}
100
111
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 {
102
118
return allegra .UtxoValidateOutsideValidityIntervalUtxo (tx , slot , ls , pp )
103
119
}
104
120
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 {
106
127
return shelley .UtxoValidateInputSetEmptyUtxo (tx , slot , ls , pp )
107
128
}
108
129
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 {
110
136
tmpPparams , ok := pp .(* AlonzoProtocolParameters )
111
137
if ! ok {
112
138
return errors .New ("pparams are not expected type" )
113
139
}
114
- return shelley .UtxoValidateFeeTooSmallUtxo (tx , slot , ls , & tmpPparams .ShelleyProtocolParameters )
140
+ return shelley .UtxoValidateFeeTooSmallUtxo (
141
+ tx ,
142
+ slot ,
143
+ ls ,
144
+ & tmpPparams .ShelleyProtocolParameters ,
145
+ )
115
146
}
116
147
117
148
// 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 {
119
155
tmpPparams , ok := pp .(* AlonzoProtocolParameters )
120
156
if ! ok {
121
157
return errors .New ("pparams are not expected type" )
@@ -147,7 +183,12 @@ func UtxoValidateInsufficientCollateral(tx common.Transaction, slot uint64, ls c
147
183
}
148
184
149
185
// 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 {
151
192
tmpTx , ok := tx .(* AlonzoTransaction )
152
193
if ! ok {
153
194
return errors .New ("transaction is not expected type" )
@@ -178,7 +219,12 @@ func UtxoValidateCollateralContainsNonAda(tx common.Transaction, slot uint64, ls
178
219
}
179
220
180
221
// 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 {
182
228
tmpTx , ok := tx .(* AlonzoTransaction )
183
229
if ! ok {
184
230
return errors .New ("transaction is not expected type" )
@@ -193,42 +239,92 @@ func UtxoValidateNoCollateralInputs(tx common.Transaction, slot uint64, ls commo
193
239
return NoCollateralInputsError {}
194
240
}
195
241
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 {
197
248
return shelley .UtxoValidateBadInputsUtxo (tx , slot , ls , pp )
198
249
}
199
250
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 {
201
257
tmpPparams , ok := pp .(* AlonzoProtocolParameters )
202
258
if ! ok {
203
259
return errors .New ("pparams are not expected type" )
204
260
}
205
- return shelley .UtxoValidateValueNotConservedUtxo (tx , slot , ls , & tmpPparams .ShelleyProtocolParameters )
261
+ return shelley .UtxoValidateValueNotConservedUtxo (
262
+ tx ,
263
+ slot ,
264
+ ls ,
265
+ & tmpPparams .ShelleyProtocolParameters ,
266
+ )
206
267
}
207
268
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 {
209
275
tmpPparams , ok := pp .(* AlonzoProtocolParameters )
210
276
if ! ok {
211
277
return errors .New ("pparams are not expected type" )
212
278
}
213
- return shelley .UtxoValidateOutputTooSmallUtxo (tx , slot , ls , & tmpPparams .ShelleyProtocolParameters )
279
+ return shelley .UtxoValidateOutputTooSmallUtxo (
280
+ tx ,
281
+ slot ,
282
+ ls ,
283
+ & tmpPparams .ShelleyProtocolParameters ,
284
+ )
214
285
}
215
286
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 {
217
293
return shelley .UtxoValidateOutputBootAddrAttrsTooBig (tx , slot , ls , pp )
218
294
}
219
295
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 {
221
302
return shelley .UtxoValidateWrongNetwork (tx , slot , ls , pp )
222
303
}
223
304
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 {
225
311
return shelley .UtxoValidateWrongNetworkWithdrawal (tx , slot , ls , pp )
226
312
}
227
313
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 {
229
320
tmpPparams , ok := pp .(* AlonzoProtocolParameters )
230
321
if ! ok {
231
322
return errors .New ("pparams are not expected type" )
232
323
}
233
- return shelley .UtxoValidateMaxTxSizeUtxo (tx , slot , ls , & tmpPparams .ShelleyProtocolParameters )
324
+ return shelley .UtxoValidateMaxTxSizeUtxo (
325
+ tx ,
326
+ slot ,
327
+ ls ,
328
+ & tmpPparams .ShelleyProtocolParameters ,
329
+ )
234
330
}
0 commit comments