Search in sources :

Example 11 with ContractResult

use of com.hedera.mirror.common.domain.contract.ContractResult in project hedera-mirror-node by hashgraph.

the class ContractCallTransactionHandlerTest method updateContractResultNonContractCallTransaction.

@Test
void updateContractResultNonContractCallTransaction() {
    ContractResult contractResult = ContractResult.builder().build();
    var recordItem = recordItemBuilder.contractCreate().build();
    transactionHandler.updateContractResult(contractResult, recordItem);
    assertThat(contractResult).returns(null, ContractResult::getAmount).returns(null, ContractResult::getGasLimit).returns(null, ContractResult::getFunctionParameters);
}
Also used : ContractResult(com.hedera.mirror.common.domain.contract.ContractResult) Test(org.junit.jupiter.api.Test)

Example 12 with ContractResult

use of com.hedera.mirror.common.domain.contract.ContractResult in project hedera-mirror-node by hashgraph.

the class ContractCreateTransactionHandlerTest method updateContractResultEmptyContractCallFunctionParams.

@Test
void updateContractResultEmptyContractCallFunctionParams() {
    ContractResult contractResult = new ContractResult();
    var recordItem = recordItemBuilder.contractCreate().build();
    transactionHandler.updateContractResult(contractResult, recordItem);
    var transaction = recordItem.getTransactionBody().getContractCreateInstance();
    assertThat(contractResult).returns(transaction.getInitialBalance(), ContractResult::getAmount).returns(transaction.getGas(), ContractResult::getGasLimit).returns(DomainUtils.toBytes(transaction.getConstructorParameters()), ContractResult::getFunctionParameters);
}
Also used : ContractResult(com.hedera.mirror.common.domain.contract.ContractResult) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

ContractResult (com.hedera.mirror.common.domain.contract.ContractResult)12 Test (org.junit.jupiter.api.Test)10 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)6 Contract (com.hedera.mirror.common.domain.contract.Contract)4 ContractLog (com.hedera.mirror.common.domain.contract.ContractLog)4 ContractStateChange (com.hedera.mirror.common.domain.contract.ContractStateChange)4 EntityId (com.hedera.mirror.common.domain.entity.EntityId)4 ContractLoginfo (com.hederahashgraph.api.proto.java.ContractLoginfo)4 Range (com.google.common.collect.Range)3 ByteString (com.google.protobuf.ByteString)3 BytesValue (com.google.protobuf.BytesValue)3 Int32Value (com.google.protobuf.Int32Value)3 StringValue (com.google.protobuf.StringValue)3 AccountIdConverter (com.hedera.mirror.common.converter.AccountIdConverter)3 EntityType (com.hedera.mirror.common.domain.entity.EntityType)3 RecordFile (com.hedera.mirror.common.domain.transaction.RecordFile)3 RecordItem (com.hedera.mirror.common.domain.transaction.RecordItem)3 DomainUtils (com.hedera.mirror.common.util.DomainUtils)3 DomainUtils.toBytes (com.hedera.mirror.common.util.DomainUtils.toBytes)3 TestUtils (com.hedera.mirror.importer.TestUtils)3