use of com.hedera.services.records.RecordCache in project hedera-services by hashgraph.
the class GetTxnRecordAnswerTest method setup.
@BeforeEach
private void setup() {
recordCache = mock(RecordCache.class);
accounts = mock(MerkleMap.class);
nodeProps = mock(NodeLocalProperties.class);
final MutableStateChildren children = new MutableStateChildren();
children.setAccounts(accounts);
view = new StateView(null, null, children, null);
optionValidator = mock(OptionValidator.class);
answerFunctions = mock(AnswerFunctions.class);
subject = new GetTxnRecordAnswer(recordCache, optionValidator, answerFunctions);
}
use of com.hedera.services.records.RecordCache in project hedera-services by hashgraph.
the class GetTxnRecordResourceUsageTest method setup.
@BeforeEach
private void setup() {
desiredRecord = mock(TransactionRecord.class);
usageEstimator = mock(CryptoFeeBuilder.class);
recordCache = mock(RecordCache.class);
final var children = new MutableStateChildren();
view = new StateView(null, null, children, null);
answerFunctions = mock(AnswerFunctions.class);
given(answerFunctions.txnRecord(recordCache, satisfiableAnswerOnly)).willReturn(Optional.of(desiredRecord));
given(answerFunctions.txnRecord(recordCache, satisfiableAnswerOnlyWithDups)).willReturn(Optional.of(desiredRecord));
given(answerFunctions.txnRecord(recordCache, satisfiableCostAnswer)).willReturn(Optional.of(desiredRecord));
given(answerFunctions.txnRecord(recordCache, unsatisfiable)).willReturn(Optional.empty());
given(recordCache.getDuplicateRecords(targetTxnId)).willReturn(List.of(desiredRecord));
subject = new GetTxnRecordResourceUsage(recordCache, answerFunctions, usageEstimator);
}
use of com.hedera.services.records.RecordCache in project hedera-services by hashgraph.
the class PlatformSubmissionManagerTest method setup.
@BeforeEach
void setup() throws InvalidProtocolBufferException {
platform = mock(Platform.class);
recordCache = mock(RecordCache.class);
speedometers = mock(MiscSpeedometers.class);
accessor = new SignedTxnAccessor(signedTxn);
uncheckedAccessor = new SignedTxnAccessor(uncheckedSubTxn);
invalidUncheckedAccessor = new SignedTxnAccessor(invalidUncheckedSubTxn);
subject = new PlatformSubmissionManager(platform, recordCache, speedometers);
}
Aggregations