Search in sources :

Example 26 with Timestamp

use of com.hederahashgraph.api.proto.java.Timestamp in project hedera-mirror-node by hashgraph.

the class AbstractTransactionHandlerTest method getDefaultTransactionRecord.

protected TransactionRecord.Builder getDefaultTransactionRecord() {
    TransactionRecord.Builder builder = TransactionRecord.newBuilder();
    if (isCrudTransactionHandler(transactionHandler)) {
        Timestamp consensusTimestamp = transactionHandler.getType().getEntityOperation() == EntityOperation.CREATE ? CREATED_TIMESTAMP : MODIFIED_TIMESTAMP;
        builder.setConsensusTimestamp(consensusTimestamp);
    }
    return builder.setReceipt(getTransactionReceipt(ResponseCodeEnum.SUCCESS));
}
Also used : TransactionRecord(com.hederahashgraph.api.proto.java.TransactionRecord) Timestamp(com.hederahashgraph.api.proto.java.Timestamp)

Aggregations

Timestamp (com.hederahashgraph.api.proto.java.Timestamp)26 Test (org.junit.jupiter.api.Test)12 Instant (java.time.Instant)8 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)8 EntityId (com.hedera.mirror.common.domain.entity.EntityId)5 DomainUtils (com.hedera.mirror.common.util.DomainUtils)5 Consumer (java.util.function.Consumer)5 Range (com.google.common.collect.Range)4 Entity (com.hedera.mirror.common.domain.entity.Entity)4 EntityType (com.hedera.mirror.common.domain.entity.EntityType)4 ACCOUNT (com.hedera.mirror.common.domain.entity.EntityType.ACCOUNT)4 NftTransferId (com.hedera.mirror.common.domain.token.NftTransferId)4 Transaction (com.hedera.mirror.common.domain.transaction.Transaction)4 AccountID (com.hederahashgraph.api.proto.java.AccountID)4 Duration (com.hederahashgraph.api.proto.java.Duration)4 ResponseCodeEnum (com.hederahashgraph.api.proto.java.ResponseCodeEnum)4 TransactionBody (com.hederahashgraph.api.proto.java.TransactionBody)4 TransactionRecord (com.hederahashgraph.api.proto.java.TransactionRecord)4 AbstractEntity (com.hedera.mirror.common.domain.entity.AbstractEntity)3 EntityIdEndec (com.hedera.mirror.common.domain.entity.EntityIdEndec)3