|
50 | 50 | import org.fisco.bcos.sdk.model.RetCode; |
51 | 51 | import org.fisco.bcos.sdk.model.TransactionReceipt; |
52 | 52 | import org.fisco.bcos.sdk.transaction.model.exception.ContractException; |
| 53 | +import org.fisco.bcos.sdk.utils.Hex; |
53 | 54 | import org.fisco.bcos.sdk.utils.Numeric; |
54 | 55 | import org.fisco.bcos.sdk.utils.StringUtils; |
55 | 56 | import org.fisco.bcos.sdk.utils.ThreadPoolService; |
@@ -143,7 +144,7 @@ public void test2CnsService() throws ConfigException, ContractException, JniExce |
143 | 144 |
|
144 | 145 | CryptoKeyPair cryptoKeyPair = client.getCryptoSuite().getCryptoKeyPair(); |
145 | 146 | HelloWorld helloWorld = HelloWorld.deploy(client, cryptoKeyPair); |
146 | | - String contractAddress = helloWorld.getContractAddress().toLowerCase(); |
| 147 | + String contractAddress = Hex.trimPrefix(helloWorld.getContractAddress().toLowerCase()); |
147 | 148 | String contractName = "HelloWorld"; |
148 | 149 | String contractVersion = String.valueOf(Math.random()); |
149 | 150 | CnsService cnsService = new CnsService(client, cryptoKeyPair); |
@@ -199,7 +200,7 @@ public void test2CnsService() throws ConfigException, ContractException, JniExce |
199 | 200 | } |
200 | 201 | // insert anther cns for other contract |
201 | 202 | HelloWorld helloWorld2 = HelloWorld.deploy(client, cryptoKeyPair); |
202 | | - String contractAddress2 = helloWorld2.getContractAddress().toLowerCase(); |
| 203 | + String contractAddress2 = Hex.trimPrefix(helloWorld2.getContractAddress().toLowerCase()); |
203 | 204 | String contractName2 = "hello"; |
204 | 205 | retCode = cnsService.registerCNS(contractName2, contractVersion, contractAddress2, ""); |
205 | 206 | if (retCode.getCode() == PrecompiledRetCode.CODE_SUCCESS.getCode()) { |
|
0 commit comments