use of com.hederahashgraph.api.proto.java.ResponseCodeEnum.MESSAGE_SIZE_TOO_LARGE in project hedera-services by hashgraph.
the class ScheduleExecutionSpecs method scheduledSubmitFailedWithMsgSizeTooLargeStillPaysServiceFeeButHasNoImpact.
private HapiApiSpec scheduledSubmitFailedWithMsgSizeTooLargeStillPaysServiceFeeButHasNoImpact() {
String immutableTopic = "XXX";
String validSchedule = "withValidSize";
String invalidSchedule = "withInvalidSize";
String schedulePayer = "somebody";
String successTxn = "good", failedTxn = "bad";
AtomicReference<Map<AccountID, Long>> successFeesObs = new AtomicReference<>();
AtomicReference<Map<AccountID, Long>> failureFeesObs = new AtomicReference<>();
var maxValidLen = HapiSpecSetup.getDefaultNodeProps().getInteger("consensus.message.maxBytesAllowed");
return defaultHapiSpec("ScheduledSubmitFailedWithMsgSizeTooLargeStillPaysServiceFeeButHasNoImpact").given(createTopic(immutableTopic), cryptoCreate(schedulePayer)).when(scheduleCreate(validSchedule, submitMessageTo(immutableTopic).message(randomUppercase(maxValidLen))).designatingPayer(schedulePayer).via(successTxn).signedBy(DEFAULT_PAYER, schedulePayer), getTopicInfo(immutableTopic).hasSeqNo(1L), getTxnRecord(successTxn).scheduled().logged().revealingDebitsTo(successFeesObs::set), scheduleCreate(invalidSchedule, submitMessageTo(immutableTopic).message(randomUppercase(maxValidLen + 1))).designatingPayer(schedulePayer).via(failedTxn).signedBy(DEFAULT_PAYER, schedulePayer)).then(getTopicInfo(immutableTopic).hasSeqNo(1L), getTxnRecord(failedTxn).scheduled().hasPriority(recordWith().status(MESSAGE_SIZE_TOO_LARGE)).revealingDebitsTo(failureFeesObs::set), assertionsHold((spec, opLog) -> assertBasicallyIdentical(successFeesObs.get(), failureFeesObs.get(), 1.0)));
}
Aggregations