Skip to content

Commit

Permalink
bugfix-FISCO-BCOS#580,sol2java.sh 生成java代码编译报错, 修复合约参数构造循环i错误的没有递增,
Browse files Browse the repository at this point in the history
  • Loading branch information
dwzhan committed Jun 1, 2022
1 parent 2c4bfbb commit 561b977
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,7 @@ private String addParameters(
MethodSpec.Builder methodBuilder, List<ABIDefinition.NamedType> namedTypes) {
List<ParameterSpec> inputParameterTypes = buildParameterTypes(namedTypes);
List<ParameterSpec> nativeInputParameterTypes = new ArrayList<>(inputParameterTypes.size());
int i = 0;
for (ParameterSpec parameterSpec : inputParameterTypes) {
for (int i = 0; i < inputParameterTypes.size(); i++) {
final TypeName typeName;
if (namedTypes.get(i).getType().equals("tuple")) {
typeName = structClassNameMap.get(namedTypes.get(i).structIdentifier());
Expand All @@ -495,7 +494,7 @@ private String addParameters(
}

nativeInputParameterTypes.add(
ParameterSpec.builder(typeName, parameterSpec.name).build());
ParameterSpec.builder(typeName, inputParameterTypes.get(i).name).build());
}
methodBuilder.addParameters(nativeInputParameterTypes);
return Collection.join(
Expand Down

0 comments on commit 561b977

Please sign in to comment.