Skip to content

Commit

Permalink
Merge pull request #876 from WeBankBlockchain/lab-dev
Browse files Browse the repository at this point in the history
3.1.1 master
  • Loading branch information
CodingCattwo authored Jan 31, 2024
2 parents 76a1f00 + 80febb8 commit 5fea978
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repositories {
}


def spring_boot_version="2.7.10"
def spring_boot_version="2.7.17"
List spring_boot =[
"org.springframework.boot:spring-boot-starter-web:$spring_boot_version",
"org.springframework.boot:spring-boot-autoconfigure:$spring_boot_version",
Expand Down Expand Up @@ -110,6 +110,8 @@ dependencies {
compile 'com.google.guava:guava:30.0-jre'
compile 'org.yaml:snakeyaml:2.0'
compile 'javax.validation:validation-api:2.0.1.Final'
compile 'io.netty:netty-all:4.1.100.Final'
compile 'org.apache.commons:commons-text:1.10.0'

testCompile("org.springframework.boot:spring-boot-starter-test:$spring_boot_version") {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ public class ConstantCode {
public static final RetCode OPEN_TABLE_FAILED = RetCode.mark(201673,"Open table failed, please check the existence of the table");
public static final RetCode NOT_SET_METHOD_AUTH_TYPE = RetCode.mark(201674,"The contract method auth type not set, please set method auth type first.");
public static final RetCode CHAIN_AUTH_NOT_ENABLE = RetCode.mark(201675, "auth of the chain not enable");
public static final RetCode GOVERNOR_CANNOT_REMOVE_YOURSELF = RetCode.mark(201676, "you cannot remove yourself");

/* bfs path */
public static final RetCode BFS_INVALID_PATH = RetCode.mark(201680, "the PATH is invalid.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,14 @@ public String handleRetcodeAndReceipt(TransactionReceipt receipt, boolean isWasm
.equals("you must be governor")) {
return new BaseResponse(ConstantCode.MUST_BE_GOVERNOR,
sdkRetCode.getMessage()).toString();
}else if (receipt.getMessage()
} else if (receipt.getMessage()
.equals("Only proposer can revoke")) {
return new BaseResponse(ConstantCode.MUST_BE_PROPOSER,
sdkRetCode.getMessage()).toString();
} else if (receipt.getMessage()
.contains("remove yourself")) {
return new BaseResponse(ConstantCode.GOVERNOR_CANNOT_REMOVE_YOURSELF,
sdkRetCode.getMessage()).toString();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,30 @@ private List<Object> getConfigList(String groupId) {
systemConfigCount.setConfigKey(PrecompiledUtils.TxCountLimit);
systemConfigCount.setConfigValue(txCountLimit);
systemConfigCount.setGroupId(groupId);
list.add(systemConfigCount);

String txGasLimit = web3ApiService.getWeb3j(groupId)
.getSystemConfigByKey(PrecompiledUtils.TxGasLimit).getSystemConfig().getValue();
ReqQuerySysConfigInfo systemConfigGas = new ReqQuerySysConfigInfo();
systemConfigGas.setConfigKey(PrecompiledUtils.TxGasLimit);
systemConfigGas.setConfigValue(txGasLimit);
systemConfigGas.setGroupId(groupId);
list.add(systemConfigGas);

String authCheckStatus = web3ApiService.getWeb3j(groupId)
.getSystemConfigByKey(PrecompiledUtils.AuthCheckStatus).getSystemConfig().getValue();
ReqQuerySysConfigInfo systemConfigAuth = new ReqQuerySysConfigInfo();
systemConfigAuth.setConfigKey(PrecompiledUtils.AuthCheckStatus);
systemConfigAuth.setConfigValue(authCheckStatus);
systemConfigAuth.setGroupId(groupId);
// 3.3.0之后才有该配置
try {
String authCheckStatus = web3ApiService.getWeb3j(groupId)
.getSystemConfigByKey(PrecompiledUtils.AuthCheckStatus).getSystemConfig()
.getValue();
ReqQuerySysConfigInfo systemConfigAuth = new ReqQuerySysConfigInfo();
systemConfigAuth.setConfigKey(PrecompiledUtils.AuthCheckStatus);
systemConfigAuth.setConfigValue(authCheckStatus);
systemConfigAuth.setGroupId(groupId);
list.add(systemConfigAuth);
} catch (Exception ex) {
log.warn("fisco bcos version lower than 3.3.0 (<3.3.0) not support get auth_check_status config");
}

list.add(systemConfigCount);
list.add(systemConfigGas);
list.add(systemConfigAuth);
return list;
}

Expand Down

0 comments on commit 5fea978

Please sign in to comment.