use of com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_CHUNK_NUMBER in project hedera-services by hashgraph.
the class ScheduleExecutionSpecs method scheduledSubmitFailedWithInvalidChunkNumberStillPaysServiceFeeButHasNoImpact.
private HapiApiSpec scheduledSubmitFailedWithInvalidChunkNumberStillPaysServiceFeeButHasNoImpact() {
String immutableTopic = "XXX";
String validSchedule = "withValidChunkNumber";
String invalidSchedule = "withInvalidChunkNumber";
String schedulePayer = "somebody";
String successTxn = "good", failedTxn = "bad";
AtomicReference<Map<AccountID, Long>> successFeesObs = new AtomicReference<>();
AtomicReference<Map<AccountID, Long>> failureFeesObs = new AtomicReference<>();
AtomicReference<TransactionID> initialTxnId = new AtomicReference<>();
return defaultHapiSpec("ScheduledSubmitFailedWithInvalidChunkNumberStillPaysServiceFeeButHasNoImpact").given(createTopic(immutableTopic), cryptoCreate(schedulePayer)).when(withOpContext((spec, opLog) -> {
var subOp = usableTxnIdNamed(successTxn).payerId(schedulePayer);
allRunFor(spec, subOp);
initialTxnId.set(spec.registry().getTxnId(successTxn));
}), sourcing(() -> scheduleCreate(validSchedule, submitMessageTo(immutableTopic).chunkInfo(3, 1, scheduledVersionOf(initialTxnId.get()))).txnId(successTxn).logged().signedBy(schedulePayer)), getTopicInfo(immutableTopic).hasSeqNo(1L), getTxnRecord(successTxn).scheduled().logged().revealingDebitsTo(successFeesObs::set), scheduleCreate(invalidSchedule, submitMessageTo(immutableTopic).chunkInfo(3, 111, schedulePayer)).via(failedTxn).logged().payingWith(schedulePayer)).then(getTopicInfo(immutableTopic).hasSeqNo(1L), getTxnRecord(failedTxn).scheduled().hasPriority(recordWith().status(INVALID_CHUNK_NUMBER)).revealingDebitsTo(failureFeesObs::set), assertionsHold((spec, opLog) -> Assertions.assertEquals(successFeesObs.get(), failureFeesObs.get())));
}
Aggregations