use of com.hedera.services.utils.PlatformTxnAccessor in project hedera-services by hashgraph.
the class HederaToPlatformSigOpsTest method doesNothingToTxnIfAllSigsAreRational.
@Test
void doesNothingToTxnIfAllSigsAreRational() throws Exception {
wellBehavedOrdersAndSigSources();
platformTxn = new PlatformTxnAccessor(PlatformTxnFactory.withClearFlag(platformTxn.getPlatformTxn()));
platformTxn.getPlatformTxn().addAll(asValid(expectedSigsWithNoErrors()).toArray(new TransactionSignature[0]));
final SyncVerifier syncVerifier = l -> {
throw new AssertionError("All sigs were verified async!");
};
final var rationalization = new Rationalization(syncVerifier, keyOrdering, new ReusableBodySigningFactory());
rationalization.performFor(platformTxn);
assertFalse(rationalization.usedSyncVerification());
assertEquals(OK, rationalization.finalStatus());
assertEquals(expectedSigsWithNoErrors(), platformTxn.getPlatformTxn().getSignatures());
assertTrue(allVerificationStatusesAre(VerificationStatus.VALID::equals));
assertFalse(((PlatformTxnFactory.TransactionWithClearFlag) platformTxn.getPlatformTxn()).hasClearBeenCalled());
}
Aggregations