use of com.hedera.services.utils.PlatformTxnAccessor in project hedera-services by hashgraph.
the class PrecheckUtilsTest method transferWithoutTargetNodeIsNotQueryPayment.
@Test
void transferWithoutTargetNodeIsNotQueryPayment() throws Throwable {
given(nodeInfo.selfAccount()).willReturn(node);
final var txn = new PlatformTxnAccessor(from(newSignedCryptoTransfer().transfers(tinyBarsFromTo("0.0.1024", "0.0.2048", 1_000L)).get())).getTxn();
assertFalse(subject.test(txn));
}
use of com.hedera.services.utils.PlatformTxnAccessor in project hedera-services by hashgraph.
the class TxnAwareRatesManagerTest method setup.
@BeforeEach
private void setup() {
attr = new HFileMeta(false, new JContractIDKey(1, 2, 3), Instant.now().getEpochSecond());
PlatformTxnAccessor accessor = mock(PlatformTxnAccessor.class);
given(accessor.getSignedTxnWrapper()).willReturn(Transaction.getDefaultInstance());
txnCtx = mock(TransactionContext.class);
given(txnCtx.accessor()).willReturn(accessor);
midnightRates = mock(ExchangeRates.class);
postUpdateCb = mock(Consumer.class);
intradayLimit = mock(BiPredicate.class);
intradayLimitFactory = mock(IntFunction.class);
given(intradayLimitFactory.apply(actualLimit)).willReturn(intradayLimit);
properties = mock(GlobalDynamicProperties.class);
given(properties.ratesIntradayChangeLimitPercent()).willReturn(actualLimit);
subject = new TxnAwareRatesManager(new MockFileNumbers(), new MockAccountNumbers(), properties, txnCtx, () -> midnightRates, postUpdateCb, intradayLimitFactory);
}
use of com.hedera.services.utils.PlatformTxnAccessor in project hedera-services by hashgraph.
the class PrecheckUtilsTest method queryPaymentsMustBeCryptoTransfers.
@Test
void queryPaymentsMustBeCryptoTransfers() throws Throwable {
final var txn = new PlatformTxnAccessor(from(newSignedCryptoUpdate("0.0.2").get())).getTxn();
assertFalse(subject.test(txn));
}
use of com.hedera.services.utils.PlatformTxnAccessor in project hedera-services by hashgraph.
the class PrecheckUtilsTest method queryPaymentTransfersToTargetNode.
@Test
void queryPaymentTransfersToTargetNode() throws Throwable {
given(nodeInfo.selfAccount()).willReturn(node);
final var txn = new PlatformTxnAccessor(from(newSignedCryptoTransfer().transfers(tinyBarsFromTo(nodeId, "0.0.2048", 1_000L)).get())).getTxn();
assertFalse(subject.test(txn));
}
use of com.hedera.services.utils.PlatformTxnAccessor in project hedera-services by hashgraph.
the class HederaToPlatformSigOpsTest method setup.
@BeforeEach
private void setup() throws Throwable {
allSigBytes = mock(PubKeyToSigBytes.class);
keyOrdering = mock(SigRequirements.class);
platformTxn = new PlatformTxnAccessor(PlatformTxnFactory.from(newSignedSystemDelete().get()));
}
Aggregations