use of com.hedera.services.files.HFileMeta 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.files.HFileMeta in project hedera-services by hashgraph.
the class ValidatingCallbackInterceptorTest method setup.
@BeforeEach
private void setup() {
attr = new HFileMeta(false, new JContractIDKey(1, 2, 3), Instant.now().getEpochSecond());
validator = mock(Predicate.class);
postUpdateCb = mock(Consumer.class);
properties = mock(PropertySource.class);
given(properties.getLongProperty(numProperty)).willReturn(actualNum);
subject = new ValidatingCallbackInterceptor(applicablePriority, numProperty, properties, postUpdateCb, validator);
}
use of com.hedera.services.files.HFileMeta in project hedera-services by hashgraph.
the class FileAppendTransitionLogicTest method setup.
@BeforeEach
private void setup() throws Throwable {
wacl = TxnHandlingScenario.SIMPLE_NEW_WACL_KT.asJKey();
attr = new HFileMeta(false, wacl, 2_000_000L);
deletedAttr = new HFileMeta(true, wacl, 2_000_000L);
immutableAttr = new HFileMeta(false, StateView.EMPTY_WACL, 2_000_000L);
accessor = mock(PlatformTxnAccessor.class);
txnCtx = mock(TransactionContext.class);
networkCtx = mock(MerkleNetworkContext.class);
hfs = mock(HederaFs.class);
given(hfs.exists(target)).willReturn(true);
given(hfs.exists(deleted)).willReturn(true);
given(hfs.exists(special)).willReturn(true);
given(hfs.exists(immutable)).willReturn(true);
given(hfs.exists(missing)).willReturn(false);
given(hfs.getattr(target)).willReturn(attr);
given(hfs.getattr(deleted)).willReturn(deletedAttr);
given(hfs.getattr(immutable)).willReturn(immutableAttr);
subject = new FileAppendTransitionLogic(hfs, numbers, txnCtx, () -> networkCtx);
}
use of com.hedera.services.files.HFileMeta in project hedera-services by hashgraph.
the class FileSysDelTransitionLogicTest method setup.
@BeforeEach
private void setup() throws Throwable {
wacl = TxnHandlingScenario.SIMPLE_NEW_WACL_KT.asJKey();
attr = new HFileMeta(false, wacl, oldExpiry);
deletedAttr = new HFileMeta(true, wacl, oldExpiry);
accessor = mock(PlatformTxnAccessor.class);
txnCtx = mock(TransactionContext.class);
sigImpactHistorian = mock(SigImpactHistorian.class);
oldExpiries = mock(Map.class);
hfs = mock(HederaFs.class);
given(hfs.exists(tbd)).willReturn(true);
given(hfs.exists(deleted)).willReturn(true);
given(hfs.exists(missing)).willReturn(false);
given(hfs.getattr(tbd)).willReturn(attr);
given(hfs.getattr(deleted)).willReturn(deletedAttr);
subject = new FileSysDelTransitionLogic(hfs, sigImpactHistorian, oldExpiries, txnCtx);
}
use of com.hedera.services.files.HFileMeta in project hedera-services by hashgraph.
the class FileSysUndelTransitionLogicTest method setup.
@BeforeEach
private void setup() throws Throwable {
wacl = TxnHandlingScenario.SIMPLE_NEW_WACL_KT.asJKey();
attr = new HFileMeta(false, wacl, currExpiry);
deletedAttr = new HFileMeta(true, wacl, currExpiry);
accessor = mock(PlatformTxnAccessor.class);
txnCtx = mock(TransactionContext.class);
oldExpiries = mock(Map.class);
sigImpactHistorian = mock(SigImpactHistorian.class);
hfs = mock(HederaFs.class);
given(hfs.exists(undeleted)).willReturn(true);
given(hfs.exists(deleted)).willReturn(true);
given(hfs.exists(missing)).willReturn(false);
given(hfs.getattr(undeleted)).willReturn(attr);
given(hfs.getattr(deleted)).willReturn(deletedAttr);
subject = new FileSysUndelTransitionLogic(hfs, sigImpactHistorian, oldExpiries, txnCtx);
}
Aggregations