Search in sources :

Example 11 with StateView

use of com.hedera.services.context.primitives.StateView 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);
}
Also used : MutableStateChildren(com.hedera.services.context.MutableStateChildren) OptionValidator(com.hedera.services.txns.validation.OptionValidator) MerkleMap(com.swirlds.merkle.map.MerkleMap) StateView(com.hedera.services.context.primitives.StateView) AnswerFunctions(com.hedera.services.queries.answering.AnswerFunctions) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

StateView (com.hedera.services.context.primitives.StateView)11 MutableStateChildren (com.hedera.services.context.MutableStateChildren)10 BeforeEach (org.junit.jupiter.api.BeforeEach)8 MerkleMap (com.swirlds.merkle.map.MerkleMap)6 NodeLocalProperties (com.hedera.services.context.properties.NodeLocalProperties)4 AnswerFunctions (com.hedera.services.queries.answering.AnswerFunctions)4 OptionValidator (com.hedera.services.txns.validation.OptionValidator)4 RecordCache (com.hedera.services.records.RecordCache)2 MerkleTokenRelStatus (com.hedera.services.state.merkle.MerkleTokenRelStatus)2 NetworkInfo (com.hedera.services.config.NetworkInfo)1 AliasManager (com.hedera.services.ledger.accounts.AliasManager)1 MerkleAccountTokens (com.hedera.services.state.merkle.MerkleAccountTokens)1 MerkleToken (com.hedera.services.state.merkle.MerkleToken)1 FcTokenAllowance (com.hedera.services.state.submerkle.FcTokenAllowance)1 FcTokenAllowanceId (com.hedera.services.state.submerkle.FcTokenAllowanceId)1 ScheduleStore (com.hedera.services.store.schedule.ScheduleStore)1 TokenStore (com.hedera.services.store.tokens.TokenStore)1 EntityNum (com.hedera.services.utils.EntityNum)1 CryptoGetInfoQuery (com.hederahashgraph.api.proto.java.CryptoGetInfoQuery)1 CryptoGetInfoResponse (com.hederahashgraph.api.proto.java.CryptoGetInfoResponse)1