@@ -66,7 +66,8 @@ void validateNullFeeCollectorOnFeeScheduleUpdate() {
66
66
readableAccountStore ,
67
67
readableTokenRelStore ,
68
68
writableTokenStore ,
69
- nullCollectorFee ))
69
+ nullCollectorFee ,
70
+ expiryValidator ))
70
71
.isInstanceOf (HandleException .class )
71
72
.has (responseCode (INVALID_CUSTOM_FEE_COLLECTOR ));
72
73
}
@@ -81,7 +82,8 @@ void validateMissingFeeCollectorOnFeeScheduleUpdate() {
81
82
readableAccountStore ,
82
83
readableTokenRelStore ,
83
84
writableTokenStore ,
84
- missingFeeCollectorFee ))
85
+ missingFeeCollectorFee ,
86
+ expiryValidator ))
85
87
.isInstanceOf (HandleException .class )
86
88
.has (responseCode (INVALID_CUSTOM_FEE_COLLECTOR ));
87
89
}
@@ -96,7 +98,8 @@ void validateDefaultInstanceOnFeeScheduleUpdate() {
96
98
readableAccountStore ,
97
99
readableTokenRelStore ,
98
100
writableTokenStore ,
99
- missingFeeCollectorFee ))
101
+ missingFeeCollectorFee ,
102
+ expiryValidator ))
100
103
.isInstanceOf (HandleException .class )
101
104
.has (responseCode (INVALID_CUSTOM_FEE_COLLECTOR ));
102
105
}
@@ -106,7 +109,12 @@ void validateDefaultInstanceOnFeeScheduleUpdate() {
106
109
void validateFixedFeeAndFractionalFeesOnFeeScheduleUpdate () {
107
110
assertThatNoException ()
108
111
.isThrownBy (() -> subject .validateForFeeScheduleUpdate (
109
- fungibleToken , readableAccountStore , readableTokenRelStore , writableTokenStore , customFees ));
112
+ fungibleToken ,
113
+ readableAccountStore ,
114
+ readableTokenRelStore ,
115
+ writableTokenStore ,
116
+ customFees ,
117
+ expiryValidator ));
110
118
}
111
119
112
120
@ Test
@@ -115,7 +123,12 @@ void royaltyFeeForFungibleTokenFailOnFeeScheduleUpdates() {
115
123
final List <CustomFee > feeWithRoyalty = new ArrayList <>();
116
124
feeWithRoyalty .add (withRoyaltyFee (royaltyFee ));
117
125
assertThatThrownBy (() -> subject .validateForFeeScheduleUpdate (
118
- fungibleToken , readableAccountStore , readableTokenRelStore , writableTokenStore , feeWithRoyalty ))
126
+ fungibleToken ,
127
+ readableAccountStore ,
128
+ readableTokenRelStore ,
129
+ writableTokenStore ,
130
+ feeWithRoyalty ,
131
+ expiryValidator ))
119
132
.isInstanceOf (HandleException .class )
120
133
.has (responseCode (CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE ));
121
134
}
@@ -132,7 +145,8 @@ void royaltyFeeForNonFungibleTokenSucceedsOnFeeScheduleUpdate() {
132
145
readableAccountStore ,
133
146
readableTokenRelStore ,
134
147
writableTokenStore ,
135
- feeWithRoyalty ));
148
+ feeWithRoyalty ,
149
+ expiryValidator ));
136
150
}
137
151
138
152
@ Test
@@ -150,7 +164,8 @@ void royaltyFeeFailsWithMissingTokenOnFeeScheduleUpdate() {
150
164
readableAccountStore ,
151
165
readableTokenRelStore ,
152
166
writableTokenStore ,
153
- feeWithRoyalty ))
167
+ feeWithRoyalty ,
168
+ expiryValidator ))
154
169
.isInstanceOf (HandleException .class )
155
170
.has (responseCode (INVALID_TOKEN_ID_IN_CUSTOM_FEES ));
156
171
}
@@ -174,7 +189,8 @@ void royaltyFeeFailsFungibleDenomOnFeeScheduleUpdate() {
174
189
readableAccountStore ,
175
190
readableTokenRelStore ,
176
191
writableTokenStore ,
177
- feeWithRoyalty ))
192
+ feeWithRoyalty ,
193
+ expiryValidator ))
178
194
.isInstanceOf (HandleException .class )
179
195
.has (responseCode (CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON ));
180
196
}
@@ -194,7 +210,8 @@ void missingTokenAssociationForRoyaltyFeeFailsOnFeeScheduleUpdate() {
194
210
List .of (withRoyaltyFee (royaltyFee
195
211
.copyBuilder ()
196
212
.fallbackFee (htsFixedFee )
197
- .build ()))))
213
+ .build ())),
214
+ expiryValidator ))
198
215
.isInstanceOf (HandleException .class )
199
216
.has (responseCode (TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR ));
200
217
}
@@ -209,7 +226,8 @@ void fractionalFeeForNonFungibleTokenFailsOnFeeScheduleUpdate() {
209
226
readableAccountStore ,
210
227
readableTokenRelStore ,
211
228
writableTokenStore ,
212
- feeWithFractional ))
229
+ feeWithFractional ,
230
+ expiryValidator ))
213
231
.isInstanceOf (HandleException .class )
214
232
.has (responseCode (CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON ));
215
233
}
@@ -226,7 +244,8 @@ void fixedFeeIsAllowedForNonFungibleTokenOnFeeScheduleUpdate() {
226
244
readableAccountStore ,
227
245
readableTokenRelStore ,
228
246
writableTokenStore ,
229
- feeWithFixed ));
247
+ feeWithFixed ,
248
+ expiryValidator ));
230
249
}
231
250
232
251
@ Test
@@ -242,7 +261,8 @@ void failsIfTokenRelationIsMissingInFixedFeeOnFeeScheduleUpdate() {
242
261
readableAccountStore ,
243
262
readableTokenRelStore ,
244
263
writableTokenStore ,
245
- List .of (withFixedFee (hbarFixedFee ), withFractionalFee (fractionalFee ))))
264
+ List .of (withFixedFee (hbarFixedFee ), withFractionalFee (fractionalFee )),
265
+ expiryValidator ))
246
266
.isInstanceOf (HandleException .class )
247
267
.has (responseCode (TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR ));
248
268
}
@@ -260,7 +280,8 @@ void failsIfTokenRelationIsMissingForFractionalFeeOnFeeScheduleUpdate() {
260
280
readableAccountStore ,
261
281
readableTokenRelStore ,
262
282
writableTokenStore ,
263
- List .of (withFractionalFee (fractionalFee ))))
283
+ List .of (withFractionalFee (fractionalFee )),
284
+ expiryValidator ))
264
285
.isInstanceOf (HandleException .class )
265
286
.has (responseCode (TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR ));
266
287
}
@@ -280,27 +301,38 @@ void validateTokenDenominationForFixedFeeOnFeeScheduleUpdate() {
280
301
readableAccountStore ,
281
302
readableTokenRelStore ,
282
303
writableTokenStore ,
283
- List .of (withFixedFee (newFee ))))
304
+ List .of (withFixedFee (newFee )),
305
+ expiryValidator ))
284
306
.isInstanceOf (HandleException .class )
285
307
.has (responseCode (CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON ));
286
308
}
287
309
288
310
@ Test
289
311
void nullParamsThrowOnFeeScheduleUpdate () {
290
312
assertThatThrownBy (() -> subject .validateForFeeScheduleUpdate (
291
- null , readableAccountStore , readableTokenRelStore , writableTokenStore , customFees ))
313
+ null ,
314
+ readableAccountStore ,
315
+ readableTokenRelStore ,
316
+ writableTokenStore ,
317
+ customFees ,
318
+ expiryValidator ))
292
319
.isInstanceOf (NullPointerException .class );
293
320
assertThatThrownBy (() -> subject .validateForFeeScheduleUpdate (
294
- fungibleToken , null , readableTokenRelStore , writableTokenStore , customFees ))
321
+ fungibleToken , null , readableTokenRelStore , writableTokenStore , customFees , expiryValidator ))
295
322
.isInstanceOf (NullPointerException .class );
296
323
assertThatThrownBy (() -> subject .validateForFeeScheduleUpdate (
297
- fungibleToken , readableAccountStore , null , writableTokenStore , customFees ))
324
+ fungibleToken , readableAccountStore , null , writableTokenStore , customFees , expiryValidator ))
298
325
.isInstanceOf (NullPointerException .class );
299
326
assertThatThrownBy (() -> subject .validateForFeeScheduleUpdate (
300
- fungibleToken , readableAccountStore , readableTokenRelStore , null , customFees ))
327
+ fungibleToken , readableAccountStore , readableTokenRelStore , null , customFees , expiryValidator ))
301
328
.isInstanceOf (NullPointerException .class );
302
329
assertThatThrownBy (() -> subject .validateForFeeScheduleUpdate (
303
- fungibleToken , readableAccountStore , readableTokenRelStore , writableTokenStore , null ))
330
+ fungibleToken ,
331
+ readableAccountStore ,
332
+ readableTokenRelStore ,
333
+ writableTokenStore ,
334
+ null ,
335
+ expiryValidator ))
304
336
.isInstanceOf (NullPointerException .class );
305
337
}
306
338
@@ -319,7 +351,8 @@ void failsIfFractionalFeeDenominatorIsSetToZero() {
319
351
readableAccountStore ,
320
352
readableTokenRelStore ,
321
353
writableTokenStore ,
322
- List .of (withFractionalFee (fractionalFeeWithZeroDenominator ))))
354
+ List .of (withFractionalFee (fractionalFeeWithZeroDenominator )),
355
+ expiryValidator ))
323
356
.isInstanceOf (HandleException .class )
324
357
.hasMessage ("FRACTION_DIVIDES_BY_ZERO" );
325
358
}
@@ -339,7 +372,8 @@ void failsIfFractionalFeeNumeratorIsNegative() {
339
372
readableAccountStore ,
340
373
readableTokenRelStore ,
341
374
writableTokenStore ,
342
- List .of (withFractionalFee (fractionalFeeWithNegativeNumerator ))))
375
+ List .of (withFractionalFee (fractionalFeeWithNegativeNumerator )),
376
+ expiryValidator ))
343
377
.isInstanceOf (HandleException .class )
344
378
.hasMessage ("CUSTOM_FEE_MUST_BE_POSITIVE" );
345
379
}
@@ -359,7 +393,8 @@ void failsIfFractionalFeeMinimumAmountIsNegative() {
359
393
readableAccountStore ,
360
394
readableTokenRelStore ,
361
395
writableTokenStore ,
362
- List .of (withFractionalFee (fractionalFeeWithNegativeMinimumAmount ))))
396
+ List .of (withFractionalFee (fractionalFeeWithNegativeMinimumAmount )),
397
+ expiryValidator ))
363
398
.isInstanceOf (HandleException .class )
364
399
.hasMessage ("CUSTOM_FEE_MUST_BE_POSITIVE" );
365
400
}
@@ -379,7 +414,8 @@ void failsIfFractionalFeeMaximumAmountIsNegative() {
379
414
readableAccountStore ,
380
415
readableTokenRelStore ,
381
416
writableTokenStore ,
382
- List .of (withFractionalFee (fractionalFeeWithNegativeMaximumAmount ))))
417
+ List .of (withFractionalFee (fractionalFeeWithNegativeMaximumAmount )),
418
+ expiryValidator ))
383
419
.isInstanceOf (HandleException .class )
384
420
.hasMessage ("CUSTOM_FEE_MUST_BE_POSITIVE" );
385
421
}
@@ -396,7 +432,8 @@ void failsIfHtsFixedFeeAmountIsNegative() {
396
432
readableAccountStore ,
397
433
readableTokenRelStore ,
398
434
writableTokenStore ,
399
- List .of (withFixedFee (htsFixedFeeWithNegativeAmount ))))
435
+ List .of (withFixedFee (htsFixedFeeWithNegativeAmount )),
436
+ expiryValidator ))
400
437
.isInstanceOf (HandleException .class )
401
438
.hasMessage ("CUSTOM_FEE_MUST_BE_POSITIVE" );
402
439
}
@@ -416,7 +453,8 @@ void failsIfFractionalFeeMaximumAmountIsLessThanMinimumAmount() {
416
453
readableAccountStore ,
417
454
readableTokenRelStore ,
418
455
writableTokenStore ,
419
- List .of (withFractionalFee (fractionalFeeWithWrongMinMaxAmount ))))
456
+ List .of (withFractionalFee (fractionalFeeWithWrongMinMaxAmount )),
457
+ expiryValidator ))
420
458
.isInstanceOf (HandleException .class )
421
459
.hasMessage ("FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT" );
422
460
}
@@ -430,7 +468,8 @@ void failsIfEmptyCustomFeesOnFeeScheduleUpdate() {
430
468
writableTokenStore ,
431
469
List .of (CustomFee .newBuilder ()
432
470
.feeCollectorAccountId (idFactory .newAccountId (accountNum .longValue ()))
433
- .build ())))
471
+ .build ()),
472
+ expiryValidator ))
434
473
.isInstanceOf (HandleException .class )
435
474
.hasMessage ("CUSTOM_FEE_NOT_FULLY_SPECIFIED" );
436
475
}
0 commit comments