Skip to content

Commit

Permalink
Merge pull request #33 from kyonRay/main
Browse files Browse the repository at this point in the history
Release v1.4.0
  • Loading branch information
kyonRay authored Mar 8, 2024
2 parents a69ad7d + 109c604 commit 2279b84
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 12 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ext {
commonsLang3Version = '3.12.0'

javaSDKVersion3 = "3.6.0"
javaSDKVersion2 = "2.9.1"
javaSDKVersion2 = "2.10.0"
slf4jVersion = "1.7.32"
}

Expand All @@ -50,7 +50,7 @@ sourceSets {
// integrationTest.mustRunAfter test
allprojects {
group = 'org.fisco-bcos.code-generator'
version = '1.3.0'
version = '1.4.0'
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: 'eclipse'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1648,8 +1648,11 @@ private List<TypeSpec> buildStructTypes(List<ABIDefinition> functionDefinitions)
if (internalType == null || internalType.isEmpty()) {
structName = "Struct" + structCounter;
} else {
if (namedType.getType().equals("tuple[]") && internalType.endsWith("[]")) {
internalType = internalType.substring(0, internalType.lastIndexOf("["));
// struct array, such as struct[2], struct[], struct[][], struct[2][]
if (namedType.getType().matches("tuple(\\[\\d*\\])+")
&& internalType.endsWith("]")
&& internalType.matches(".*(\\[\\d*\\])+")) {
internalType = internalType.substring(0, internalType.indexOf("["));
}
if (internalType.contains(".")) {
structName = internalType.substring(internalType.lastIndexOf(".") + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,11 @@ private List<TypeSpec> buildStructTypes(List<ABIDefinition> functionDefinitions)
if (internalType == null || internalType.isEmpty()) {
structName = "Struct" + structCounter;
} else {
if (namedType.getType().equals("tuple[]") && internalType.endsWith("[]")) {
internalType = internalType.substring(0, internalType.lastIndexOf("["));
// struct array, such as struct[2], struct[], struct[][], struct[2][]
if (namedType.getType().matches("tuple(\\[\\d*\\])+")
&& internalType.endsWith("]")
&& internalType.matches(".*(\\[\\d*\\])+")) {
internalType = internalType.substring(0, internalType.indexOf("["));
}
if (isWasm) {
structName = internalType.substring(internalType.lastIndexOf(".") + 1);
Expand Down Expand Up @@ -687,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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ public void complexABICodeGen() throws IOException {
codeGenTest(COMPLEX_ABI_FILE, COMPLEX_NAME);
}

@Test
public void complexABICodeGen2() throws IOException {
final String COMPLEX_ABI_FILE = "ComplexCodecTest2.abi";
final String COMPLEX_NAME = "ComplexCodecTest";
codeGenTest(COMPLEX_ABI_FILE, COMPLEX_NAME);
}

@Test
public void tableABICodeGen() throws IOException {
final String ABI_FILE = "Table.abi";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class CodeGenV3Test {
public static Collection<Object[]> data() {
return Arrays.asList(
new Object[][] {
{false}, {true},
{true}, {false},
});
}

Expand Down Expand Up @@ -88,6 +88,13 @@ public void complexABICodeGen() throws IOException {
codeGenTest(COMPLEX_ABI_FILE, COMPLEX_NAME);
}

@Test
public void complexABICodeGen2() throws IOException {
final String COMPLEX_ABI_FILE = "ComplexCodecTest2.abi";
final String COMPLEX_NAME = "ComplexCodecTest";
codeGenTest(COMPLEX_ABI_FILE, COMPLEX_NAME);
}

@Test
public void tableABICodeGen() throws IOException {
final String ABI_FILE = "Table.abi";
Expand Down
Loading

0 comments on commit 2279b84

Please sign in to comment.