Skip to content

Commit

Permalink
Merge branch 'release-1.3.0' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kyonRay committed Dec 25, 2023
2 parents f53b964 + 275b3b5 commit 6f92e5b
Show file tree
Hide file tree
Showing 5 changed files with 245 additions and 62 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ext {
junitVersion = '4.13.2'
commonsLang3Version = '3.12.0'

javaSDKVersion3 = "3.3.0"
javaSDKVersion3 = "3.6.0-SNAPSHOT"
javaSDKVersion2 = "2.9.1"
slf4jVersion = "1.7.32"
}
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/org/fisco/bcos/codegen/CodeGenMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,14 @@ static class PicocliRunner implements Runnable {

@Option(
names = {"-e", "--enableAsyncCall"},
description = "enable async call.")
description = "enable async call, only V3 enable.")
private boolean enableAsyncCall = false;

@Option(
names = {"-n", "--newTxManager"},
description = "use new transaction manager interface, only V3 enable.")
private boolean useNewTransactionManager = false;

@Override
public void run() {
if (version.equals(Version.V2)) {
Expand All @@ -125,7 +130,8 @@ public void run() {
abiFile,
destinationFileDir,
packageName,
enableAsyncCall)
enableAsyncCall,
useNewTransactionManager)
.generateJavaFiles();
} catch (Exception e) {
org.fisco.bcos.codegen.v3.utils.CodeGenUtils.exitError(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class ContractGenerator {
private String basePackageName;

private boolean enableAsyncCall = false;
private boolean useNewTransactionManager = false;

public ContractGenerator(
File binFile,
Expand All @@ -78,6 +79,18 @@ public ContractGenerator(
this.enableAsyncCall = enableAsyncCall;
}

public ContractGenerator(
File binFile,
File smBinFile,
File abiFile,
File destinationDir,
String basePackageName,
boolean enableAsyncCall,
boolean useNewTransactionManager) {
this(binFile, smBinFile, abiFile, destinationDir, basePackageName, enableAsyncCall);
this.useNewTransactionManager = useNewTransactionManager;
}

public void generateJavaFiles() throws CodeGenException, IOException, ClassNotFoundException {
// get binary
byte[] binary = CodeGenUtils.readBytes(this.binFile);
Expand All @@ -103,7 +116,8 @@ public void generateJavaFiles() throws CodeGenException, IOException, ClassNotFo
new String(abiBytes),
destinationDir.toString(),
basePackageName,
enableAsyncCall);
enableAsyncCall,
useNewTransactionManager);
}

private byte[] calculateWasmBytes(byte[] binary) throws IOException {
Expand Down
Loading

0 comments on commit 6f92e5b

Please sign in to comment.