Search in sources :

Example 6 with ExpirableTxnRecord

use of com.hedera.services.state.submerkle.ExpirableTxnRecord in project hedera-services by hashgraph.

the class BasicTransactionContextTest method hasExpectedCopyFields.

@Test
void hasExpectedCopyFields() {
    given(exchange.fcActiveRates()).willReturn(ExchangeRates.fromGrpc(ratesNow));
    given(accessor.getTxnId()).willReturn(txnId);
    given(accessor.getTxn()).willReturn(txn);
    given(txn.getMemo()).willReturn(memo);
    given(accessor.getHash()).willReturn(hash);
    setUpBuildingExpirableTxnRecord();
    // when:
    ExpirableTxnRecord record = subject.recordSoFar().build();
    // expect:
    assertEquals(memo, record.getMemo());
    assertArrayEquals(hash, record.asGrpc().getTransactionHash().toByteArray());
    assertEquals(txnId, record.asGrpc().getTransactionID());
    assertEquals(RichInstant.fromJava(now), record.getConsensusTimestamp());
}
Also used : ExpirableTxnRecord(com.hedera.services.state.submerkle.ExpirableTxnRecord) Test(org.junit.jupiter.api.Test)

Aggregations

ExpirableTxnRecord (com.hedera.services.state.submerkle.ExpirableTxnRecord)6 EntityId (com.hedera.services.state.submerkle.EntityId)4 MerkleAccount (com.hedera.services.state.merkle.MerkleAccount)3 ClassConstructorPair (com.swirlds.common.constructable.ClassConstructorPair)3 Test (org.junit.jupiter.api.Test)3 TxnReceipt (com.hedera.services.legacy.core.jproto.TxnReceipt)2 MerkleAccountState (com.hedera.services.state.merkle.MerkleAccountState)2 MerkleEntityId (com.hedera.services.state.merkle.MerkleEntityId)2 CurrencyAdjustments (com.hedera.services.state.submerkle.CurrencyAdjustments)2 EvmFnResult (com.hedera.services.state.submerkle.EvmFnResult)2 TxnId (com.hedera.services.state.submerkle.TxnId)2 EntityNum (com.hedera.services.utils.EntityNum)2 MerkleLong (com.swirlds.common.merkle.utility.MerkleLong)2 FCQueue (com.swirlds.fcqueue.FCQueue)2 ByteString (com.google.protobuf.ByteString)1 HederaAccountCustomizer (com.hedera.services.ledger.accounts.HederaAccountCustomizer)1 JKey (com.hedera.services.legacy.core.jproto.JKey)1 JKeyList (com.hedera.services.legacy.core.jproto.JKeyList)1 MerkleToken (com.hedera.services.state.merkle.MerkleToken)1 FcTokenAllowance (com.hedera.services.state.submerkle.FcTokenAllowance)1