From 109c604f15739dfa5f7042f5dea1d5bdb03ffd50 Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Fri, 8 Mar 2024 16:31:43 +0800 Subject: [PATCH] (build,V3): fix v3 generate error in transaction manager, upgrade to v1.4.0. (#32) --- build.gradle | 4 ++-- .../bcos/codegen/v3/wrapper/ContractWrapper.java | 12 +++++++----- .../fisco/bcos/codegen/v3/test/CodeGenV3Test.java | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 065c847..4082ccd 100644 --- a/build.gradle +++ b/build.gradle @@ -31,7 +31,7 @@ ext { commonsLang3Version = '3.12.0' javaSDKVersion3 = "3.6.0" - javaSDKVersion2 = "2.10.0-SNAPSHOT" + javaSDKVersion2 = "2.10.0" slf4jVersion = "1.7.32" } @@ -50,7 +50,7 @@ sourceSets { // integrationTest.mustRunAfter test allprojects { group = 'org.fisco-bcos.code-generator' - version = '1.4.0-SNAPSHOT' + version = '1.4.0' apply plugin: 'maven-publish' apply plugin: 'idea' apply plugin: 'eclipse' diff --git a/src/main/java/org/fisco/bcos/codegen/v3/wrapper/ContractWrapper.java b/src/main/java/org/fisco/bcos/codegen/v3/wrapper/ContractWrapper.java index 8dfc2e5..2e2ed25 100644 --- a/src/main/java/org/fisco/bcos/codegen/v3/wrapper/ContractWrapper.java +++ b/src/main/java/org/fisco/bcos/codegen/v3/wrapper/ContractWrapper.java @@ -690,11 +690,13 @@ private MethodSpec buildConstructor() { CONTRACT_ADDRESS, CLIENT, ContractWrapper.CREDENTIAL); - toReturn.addStatement( - "this.$N = new $T($N)", - ContractWrapper.TRANSACTION_MANAGER, - ProxySignTransactionManager.class, - CLIENT); + if (this.transactionVersion == CodeGenMain.TransactionVersion.V1.getV()) { + toReturn.addStatement( + "this.$N = new $T($N)", + ContractWrapper.TRANSACTION_MANAGER, + ProxySignTransactionManager.class, + CLIENT); + } return toReturn.build(); } diff --git a/src/test/java/org/fisco/bcos/codegen/v3/test/CodeGenV3Test.java b/src/test/java/org/fisco/bcos/codegen/v3/test/CodeGenV3Test.java index 8e09bfa..0ea09ad 100644 --- a/src/test/java/org/fisco/bcos/codegen/v3/test/CodeGenV3Test.java +++ b/src/test/java/org/fisco/bcos/codegen/v3/test/CodeGenV3Test.java @@ -32,7 +32,7 @@ public class CodeGenV3Test { public static Collection data() { return Arrays.asList( new Object[][] { - {false}, {true}, + {true}, {false}, }); }