Skip to content

Commit 953e662

Browse files
authored
Merge pull request #439 from kyonRay/release-3.1.0
<feat&fix>(auth): add interface to get latest proposal, fix auth retCode desc.
2 parents 34cf306 + 8030ba8 commit 953e662

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

sdk-core/src/main/java/org/fisco/bcos/sdk/model/PrecompiledRetCode.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,18 @@ public class PrecompiledRetCode {
125125
public static final RetCode CODE_INVALID_NODEID = new RetCode(-51100, "Invalid node ID");
126126

127127
// PermissionPrecompiled -51099 ~ -51000
128-
public static final RetCode CODE_COMMITTEE_PERMISSION =
128+
public static final RetCode CODE_TABLE_AUTH_TYPE_DECODE_ERROR =
129+
new RetCode(-51004, "Auth map decode error.");
130+
public static final RetCode CODE_TABLE_ERROR_AUTH_TYPE =
131+
new RetCode(-51003, "Error auth type input.");
132+
public static final RetCode CODE_TABLE_AUTH_TYPE_NOT_EXIST =
129133
new RetCode(
130-
-51004,
131-
"The committee permission control by ChainGovernancePrecompiled are recommended");
132-
public static final RetCode CODE_CONTRACT_NOT_EXIST =
133-
new RetCode(-51003, "The contract doesn't exist");
134-
public static final RetCode CODE_TABLE_NAME_OVERFLOW =
135-
new RetCode(-51002, "The table name string length exceeds the maximum limit");
134+
-51002,
135+
"The contract method auth type not set, please set method auth type first.");
136136
public static final RetCode CODE_TABLE_AUTH_ROW_NOT_EXIST =
137-
new RetCode(-51001, "The table auth not exist");
137+
new RetCode(-51001, "The contract method auth not exist");
138138
public static final RetCode CODE_TABLE_AGENT_ROW_NOT_EXIST =
139-
new RetCode(-51000, "The table agent not exist");
139+
new RetCode(-51000, "The contract admin not exist");
140140

141141
// Common error code among all precompiled contracts -50199 ~ -50100
142142
public static final RetCode CODE_TABLE_OPEN_ERROR = new RetCode(-50105, "Open table error");

sdk-service/src/test/java/org/fisco/bcos/sdk/test/precompiled/PrecompiledRetCodeTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ public void testGetPrecompiledResponse() {
8181
PrecompiledRetCode.CODE_LAST_SEALER.getMessage());
8282
checkResponse(PrecompiledRetCode.CODE_INVALID_NODEID.getCode(),
8383
PrecompiledRetCode.CODE_INVALID_NODEID.getMessage());
84-
checkResponse(PrecompiledRetCode.CODE_COMMITTEE_PERMISSION.getCode(),
85-
PrecompiledRetCode.CODE_COMMITTEE_PERMISSION.getMessage());
86-
checkResponse(PrecompiledRetCode.CODE_CONTRACT_NOT_EXIST.getCode(),
87-
PrecompiledRetCode.CODE_CONTRACT_NOT_EXIST.getMessage());
88-
checkResponse(PrecompiledRetCode.CODE_TABLE_NAME_OVERFLOW.getCode(),
89-
PrecompiledRetCode.CODE_TABLE_NAME_OVERFLOW.getMessage());
84+
checkResponse(PrecompiledRetCode.CODE_TABLE_AUTH_TYPE_DECODE_ERROR.getCode(),
85+
PrecompiledRetCode.CODE_TABLE_AUTH_TYPE_DECODE_ERROR.getMessage());
86+
checkResponse(PrecompiledRetCode.CODE_TABLE_ERROR_AUTH_TYPE.getCode(),
87+
PrecompiledRetCode.CODE_TABLE_ERROR_AUTH_TYPE.getMessage());
88+
checkResponse(PrecompiledRetCode.CODE_TABLE_AUTH_TYPE_NOT_EXIST.getCode(),
89+
PrecompiledRetCode.CODE_TABLE_AUTH_TYPE_NOT_EXIST.getMessage());
9090
checkResponse(PrecompiledRetCode.CODE_TABLE_AGENT_ROW_NOT_EXIST.getCode(),
9191
PrecompiledRetCode.CODE_TABLE_AGENT_ROW_NOT_EXIST.getMessage());
9292
checkResponse(PrecompiledRetCode.CODE_ADDRESS_INVALID.getCode(),

sdk-transaction/src/main/java/org/fisco/bcos/sdk/contract/auth/manager/AuthManager.java

+9
Original file line numberDiff line numberDiff line change
@@ -298,4 +298,13 @@ public BigInteger setMethodAuth(
298298
return contractAuthPrecompiled.getCloseMethodAuthOutput(receipt).getValue1();
299299
}
300300
}
301+
302+
/**
303+
* get proposal count
304+
*
305+
* @return count
306+
*/
307+
public BigInteger proposalCount() throws ContractException {
308+
return this.proposalManager._proposalCount();
309+
}
301310
}

0 commit comments

Comments
 (0)