use of com.hedera.services.queries.answering.AnswerFunctions 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.queries.answering.AnswerFunctions in project hedera-services by hashgraph.
the class GetAccountRecordsResourceUsageTest method setup.
@BeforeEach
private void setup() {
aValue = MerkleAccountFactory.newAccount().get();
aValue.records().offer(recordOne());
aValue.records().offer(recordTwo());
final MutableStateChildren children = new MutableStateChildren();
children.setAccounts(accounts);
view = new StateView(null, null, children, null);
subject = new GetAccountRecordsResourceUsage(new AnswerFunctions(dynamicProperties), usageEstimator);
}
use of com.hedera.services.queries.answering.AnswerFunctions 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.queries.answering.AnswerFunctions in project hedera-services by hashgraph.
the class GetAccountRecordsAnswerTest method setup.
@BeforeEach
private void setup() throws Exception {
payerAccount = MerkleAccountFactory.newAccount().accountKeys(COMPLEX_KEY_ACCOUNT_KT).proxy(asAccount("1.2.3")).senderThreshold(1_234L).receiverThreshold(4_321L).receiverSigRequired(true).balance(555L).autoRenewPeriod(1_000_000L).expirationTime(9_999_999L).get();
payerAccount.records().offer(recordOne());
payerAccount.records().offer(recordTwo());
accounts = mock(MerkleMap.class);
given(accounts.get(EntityNum.fromAccountId(asAccount(target)))).willReturn(payerAccount);
final MutableStateChildren children = new MutableStateChildren();
children.setAccounts(accounts);
view = new StateView(null, null, children, null);
optionValidator = mock(OptionValidator.class);
subject = new GetAccountRecordsAnswer(new AnswerFunctions(dynamicProperties), optionValidator);
}
Aggregations