diff --git a/src/main/java/org/fisco/bcos/sdk/v3/client/protocol/model/JsonTransactionResponse.java b/src/main/java/org/fisco/bcos/sdk/v3/client/protocol/model/JsonTransactionResponse.java index 4b01a941a..63b5af6d6 100644 --- a/src/main/java/org/fisco/bcos/sdk/v3/client/protocol/model/JsonTransactionResponse.java +++ b/src/main/java/org/fisco/bcos/sdk/v3/client/protocol/model/JsonTransactionResponse.java @@ -316,39 +316,22 @@ public String calculateHash(CryptoSuite cryptoSuite) throws ClientException { */ public String calculateHash(int cryptoSuiteType) throws ClientException { try { - // FIXME: core dump in here - // return TransactionStructBuilderJniObj.calcTransactionDataStructHash( - // cryptoSuiteType, - // new TransactionDataV2() - // .buildExtension(getExtension()) - // .buildValue(getValue()) - // .buildGasPrice(getGasPrice()) - // .buildGasLimit(getGasLimit()) - // .buildMaxFeePerGas(getMaxFeePerGas()) - // .buildMaxPriorityFeePerGas(getMaxPriorityFeePerGas()) - // .buildVersion(getVersion()) - // .buildGroupId(getGroupID()) - // .buildChainId(getChainID()) - // .buildTo(getTo()) - // .buildNonce(new String(Hex.decode(getNonce()))) - // .buildInput(Hex.decode(getInput())) - // .buildAbi(getAbi()) - // .buildBlockLimit(getBlockLimit())); - return TransactionBuilderV1JniObj.calcTransactionDataHashWithFullFields( - cryptoSuiteType, - (getVersion() == 0 ? TransactionVersion.V0 : TransactionVersion.V1), - getGroupID(), - getChainID(), - getTo(), - new String(Hex.decode(getNonce())), - Hex.decode(getInput()), - getAbi(), - getBlockLimit(), - getValue(), - getGasPrice(), - getGasLimit(), - getMaxFeePerGas(), - getMaxPriorityFeePerGas()); + return new TransactionDataV2() + .buildExtension(getExtension()) + .buildValue(getValue()) + .buildGasPrice(getGasPrice()) + .buildGasLimit(getGasLimit()) + .buildMaxFeePerGas(getMaxFeePerGas()) + .buildMaxPriorityFeePerGas(getMaxPriorityFeePerGas()) + .buildVersion(getVersion()) + .buildGroupId(getGroupID()) + .buildChainId(getChainID()) + .buildTo(getTo()) + .buildNonce(new String(Hex.decode(getNonce()))) + .buildInput(Hex.decode(getInput())) + .buildAbi(getAbi()) + .buildBlockLimit(getBlockLimit()) + .calculateHash(cryptoSuiteType); } catch (Exception e) { logger.warn( "calculate hash for the transaction failed, version: {}, transactionHash: {}, error info: {}",