@@ -142,10 +142,11 @@ private FeeCharging.Validation getFinalPayerValidation(
142
142
}
143
143
return switch (duplicateStatus ) {
144
144
case DUPLICATE -> newPayerDuplicateError (creatorId , payer );
145
- case NO_DUPLICATE -> dispatch .preHandleResult ().status () == SO_FAR_SO_GOOD
146
- ? validation
147
- : newPayerUniqueError (
148
- creatorId , payer , dispatch .preHandleResult ().responseCode ());
145
+ case NO_DUPLICATE ->
146
+ dispatch .preHandleResult ().status () == SO_FAR_SO_GOOD
147
+ ? validation
148
+ : newPayerUniqueError (
149
+ creatorId , payer , dispatch .preHandleResult ().responseCode ());
149
150
};
150
151
}
151
152
@@ -208,9 +209,17 @@ private Account getPayerAccount(
208
209
final var account = accountStore .getAccountById (accountID );
209
210
return switch (category ) {
210
211
case USER , NODE , BATCH_INNER -> {
211
- if (account == null || account .deleted () || account .smartContract ()) {
212
- throw new IllegalStateException ("Category " + category
213
- + " payer account should have resulted in failure upstream " + account );
212
+ if (account == null ) {
213
+ throw new IllegalStateException (
214
+ String .format ("Category %s payer account with id %s does not exists" , category , accountID ));
215
+ }
216
+ if (account .deleted ()) {
217
+ throw new IllegalStateException (
218
+ String .format ("Category %s payer account with id %s is deleted" , category , accountID ));
219
+ }
220
+ if (account .smartContract ()) {
221
+ throw new IllegalStateException (String .format (
222
+ "Category %s payer account with id %s is a smart contract" , category , accountID ));
214
223
}
215
224
yield account ;
216
225
}
0 commit comments