Skip to content

Commit d97dcf2

Browse files
authored
<fix>(auth): fix proposal status. (#436)
1 parent b427c1c commit d97dcf2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

sdk-transaction/src/main/java/org/fisco/bcos/sdk/contract/auth/po/ProposalStatus.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
public enum ProposalStatus {
44
NOT_ENOUGH_VOTE("notEnoughVotes"),
5-
SUCCESS("success"),
5+
FINISHED("finished"),
66
FAILED("failed"),
77
REVOKE("revoke"),
88
UNKNOWN("unknown");
@@ -22,7 +22,7 @@ public static ProposalStatus fromInt(int status) {
2222
case 1:
2323
return NOT_ENOUGH_VOTE;
2424
case 2:
25-
return SUCCESS;
25+
return FINISHED;
2626
case 3:
2727
return FAILED;
2828
case 4:

src/integration-test/java/org/fisco/bcos/sdk/precompiled/PrecompiledTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import org.fisco.bcos.sdk.model.RetCode;
5151
import org.fisco.bcos.sdk.model.TransactionReceipt;
5252
import org.fisco.bcos.sdk.transaction.model.exception.ContractException;
53+
import org.fisco.bcos.sdk.utils.Hex;
5354
import org.fisco.bcos.sdk.utils.Numeric;
5455
import org.fisco.bcos.sdk.utils.StringUtils;
5556
import org.fisco.bcos.sdk.utils.ThreadPoolService;
@@ -143,7 +144,7 @@ public void test2CnsService() throws ConfigException, ContractException, JniExce
143144

144145
CryptoKeyPair cryptoKeyPair = client.getCryptoSuite().getCryptoKeyPair();
145146
HelloWorld helloWorld = HelloWorld.deploy(client, cryptoKeyPair);
146-
String contractAddress = helloWorld.getContractAddress().toLowerCase();
147+
String contractAddress = Hex.trimPrefix(helloWorld.getContractAddress().toLowerCase());
147148
String contractName = "HelloWorld";
148149
String contractVersion = String.valueOf(Math.random());
149150
CnsService cnsService = new CnsService(client, cryptoKeyPair);
@@ -199,7 +200,7 @@ public void test2CnsService() throws ConfigException, ContractException, JniExce
199200
}
200201
// insert anther cns for other contract
201202
HelloWorld helloWorld2 = HelloWorld.deploy(client, cryptoKeyPair);
202-
String contractAddress2 = helloWorld2.getContractAddress().toLowerCase();
203+
String contractAddress2 = Hex.trimPrefix(helloWorld2.getContractAddress().toLowerCase());
203204
String contractName2 = "hello";
204205
retCode = cnsService.registerCNS(contractName2, contractVersion, contractAddress2, "");
205206
if (retCode.getCode() == PrecompiledRetCode.CODE_SUCCESS.getCode()) {

0 commit comments

Comments
 (0)