@@ -275,21 +275,24 @@ public boolean validate() throws ContractValidateException {
275
275
throw new ContractValidateException ("no delegatedFrozenBalance(BANDWIDTH)" );
276
276
}
277
277
278
- String errorMessage = "AcquiredDelegatedFrozenBalanceForBandwidth[" + receiverCapsule
279
- .getAcquiredDelegatedFrozenBalanceForBandwidth () + "] < delegatedBandwidth["
280
- + delegatedResourceCapsule .getFrozenBalanceForBandwidth ()
281
- + "],this should never happen" ;
282
-
283
278
if (dbManager .getDynamicPropertiesStore ().getAllowTvmConstantinople () == 0 ) {
284
279
if (receiverCapsule .getAcquiredDelegatedFrozenBalanceForBandwidth ()
285
280
< delegatedResourceCapsule .getFrozenBalanceForBandwidth ()) {
286
- throw new ContractValidateException (errorMessage );
281
+ throw new ContractValidateException (
282
+ "AcquiredDelegatedFrozenBalanceForBandwidth[" + receiverCapsule
283
+ .getAcquiredDelegatedFrozenBalanceForBandwidth () + "] < delegatedBandwidth["
284
+ + delegatedResourceCapsule .getFrozenBalanceForBandwidth ()
285
+ + "]" );
287
286
}
288
287
} else {
289
288
if (receiverCapsule != null && receiverCapsule .getType () != AccountType .Contract
290
289
&& receiverCapsule .getAcquiredDelegatedFrozenBalanceForBandwidth ()
291
290
< delegatedResourceCapsule .getFrozenBalanceForBandwidth ()) {
292
- throw new ContractValidateException (errorMessage );
291
+ throw new ContractValidateException (
292
+ "AcquiredDelegatedFrozenBalanceForBandwidth[" + receiverCapsule
293
+ .getAcquiredDelegatedFrozenBalanceForBandwidth () + "] < delegatedBandwidth["
294
+ + delegatedResourceCapsule .getFrozenBalanceForBandwidth ()
295
+ + "]" );
293
296
}
294
297
}
295
298
@@ -301,20 +304,24 @@ public boolean validate() throws ContractValidateException {
301
304
if (delegatedResourceCapsule .getFrozenBalanceForEnergy () <= 0 ) {
302
305
throw new ContractValidateException ("no delegateFrozenBalance(Energy)" );
303
306
}
304
- errorMessage = "AcquiredDelegatedFrozenBalanceForEnergy[" + receiverCapsule
305
- .getAcquiredDelegatedFrozenBalanceForEnergy () + "] < delegatedEnergy["
306
- + delegatedResourceCapsule .getFrozenBalanceForEnergy () +
307
- "],this should never happen" ;
308
307
if (dbManager .getDynamicPropertiesStore ().getAllowTvmConstantinople () == 0 ) {
309
308
if (receiverCapsule .getAcquiredDelegatedFrozenBalanceForEnergy ()
310
309
< delegatedResourceCapsule .getFrozenBalanceForEnergy ()) {
311
- throw new ContractValidateException (errorMessage );
310
+ throw new ContractValidateException (
311
+ "AcquiredDelegatedFrozenBalanceForEnergy[" + receiverCapsule
312
+ .getAcquiredDelegatedFrozenBalanceForEnergy () + "] < delegatedEnergy["
313
+ + delegatedResourceCapsule .getFrozenBalanceForEnergy () +
314
+ "]" );
312
315
}
313
316
} else {
314
317
if (receiverCapsule != null && receiverCapsule .getType () != AccountType .Contract
315
318
&& receiverCapsule .getAcquiredDelegatedFrozenBalanceForEnergy ()
316
319
< delegatedResourceCapsule .getFrozenBalanceForEnergy ()) {
317
- throw new ContractValidateException (errorMessage );
320
+ throw new ContractValidateException (
321
+ "AcquiredDelegatedFrozenBalanceForEnergy[" + receiverCapsule
322
+ .getAcquiredDelegatedFrozenBalanceForEnergy () + "] < delegatedEnergy["
323
+ + delegatedResourceCapsule .getFrozenBalanceForEnergy () +
324
+ "]" );
318
325
}
319
326
}
320
327
0 commit comments