Search in sources :

Example 1 with RecordParserProperties

use of com.hedera.mirror.importer.parser.record.RecordParserProperties in project hedera-mirror-node by hashgraph.

the class TransactionSignatureTest method setup.

@BeforeEach
void setup() {
    CommonParserProperties commonParserProperties = new CommonParserProperties();
    EntityProperties entityProperties = new EntityProperties();
    RecordParserProperties parserProperties = new RecordParserProperties();
    entityRecordItemListener = new EntityRecordItemListener(commonParserProperties, entityProperties, addressBookService, nonFeeTransferExtractionStrategy, entityIdService, entityListener, transactionHandlerFactory, fileDataRepository, parserProperties, contractResultService);
    defaultSignatureMap = getDefaultSignatureMap();
    defaultTransactionSignatures = defaultSignatureMap.getSigPairList().stream().map(pair -> {
        TransactionSignature transactionSignature = new TransactionSignature();
        transactionSignature.setConsensusTimestamp(CONSENSUS_TIMESTAMP);
        transactionSignature.setEntityId(ENTITY_ID);
        transactionSignature.setPublicKeyPrefix(pair.getPubKeyPrefix().toByteArray());
        transactionSignature.setSignature(pair.getEd25519().toByteArray());
        transactionSignature.setType(SignaturePair.SignatureCase.ED25519.getNumber());
        return transactionSignature;
    }).collect(Collectors.toList());
    transactionSignatures = entityProperties.getPersist().getTransactionSignatures();
    doReturn(ENTITY_ID).when(transactionHandler).getEntity(any(RecordItem.class));
    doReturn(transactionHandler).when(transactionHandlerFactory).get(any(TransactionType.class));
}
Also used : TransactionType(com.hedera.mirror.common.domain.transaction.TransactionType) CommonParserProperties(com.hedera.mirror.importer.parser.CommonParserProperties) RecordParserProperties(com.hedera.mirror.importer.parser.record.RecordParserProperties) TransactionSignature(com.hedera.mirror.common.domain.transaction.TransactionSignature) RecordItem(com.hedera.mirror.common.domain.transaction.RecordItem) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

RecordItem (com.hedera.mirror.common.domain.transaction.RecordItem)1 TransactionSignature (com.hedera.mirror.common.domain.transaction.TransactionSignature)1 TransactionType (com.hedera.mirror.common.domain.transaction.TransactionType)1 CommonParserProperties (com.hedera.mirror.importer.parser.CommonParserProperties)1 RecordParserProperties (com.hedera.mirror.importer.parser.record.RecordParserProperties)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1