Search in sources :

Example 1 with MockAccountNumbers

use of com.hedera.services.config.MockAccountNumbers 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);
}
Also used : PlatformTxnAccessor(com.hedera.services.utils.PlatformTxnAccessor) Consumer(java.util.function.Consumer) TransactionContext(com.hedera.services.context.TransactionContext) IntFunction(java.util.function.IntFunction) HFileMeta(com.hedera.services.files.HFileMeta) ExchangeRates(com.hedera.services.state.submerkle.ExchangeRates) GlobalDynamicProperties(com.hedera.services.context.properties.GlobalDynamicProperties) JContractIDKey(com.hedera.services.legacy.core.jproto.JContractIDKey) MockAccountNumbers(com.hedera.services.config.MockAccountNumbers) BiPredicate(java.util.function.BiPredicate) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

MockAccountNumbers (com.hedera.services.config.MockAccountNumbers)1 TransactionContext (com.hedera.services.context.TransactionContext)1 GlobalDynamicProperties (com.hedera.services.context.properties.GlobalDynamicProperties)1 HFileMeta (com.hedera.services.files.HFileMeta)1 JContractIDKey (com.hedera.services.legacy.core.jproto.JContractIDKey)1 ExchangeRates (com.hedera.services.state.submerkle.ExchangeRates)1 PlatformTxnAccessor (com.hedera.services.utils.PlatformTxnAccessor)1 BiPredicate (java.util.function.BiPredicate)1 Consumer (java.util.function.Consumer)1 IntFunction (java.util.function.IntFunction)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1