안녕하세요 caver-java 를 사용중입니다. requestSmartContractExecution 요청 중 에러에 대해 문의드립니다.
Bad request 오류가 계속 나서 혹시 제가 작성한 ContractExecutionTransactionRequest 값 안에 오류가 날 항목이 있는지 문의드립니다.
input값은 이상 없는 점 확인하였습니다.
원본 소스
String input = contract.encodeABI(exchangeKlayPos, buyCoinAddr, new BigDecimal(caver.utils.convertToPeb(buycount_coin, Utils.KlayUnit.KLAY)).toBigInteger() , Arrays.asList()); | |||
---|---|---|---|
// | System.out.print(input); | ||
ContractExecutionTransactionRequest request = new ContractExecutionTransactionRequest(); | |||
request.setFrom(myKasAddr); | |||
request.setTo(factory_address); | |||
request.setGas((long) 2000000); | |||
request.setSubmit(true); | |||
request.setValue(100000000000); | |||
request.setNonce((long) 1041); | |||
request.setInput(input); | |||
TransactionResult result = caver.kas.wallet.requestSmartContractExecution(request); | |||
System.out.println(result.getTransactionHash()); |
에러
xyz.groundx.caver_ext_kas.rest_client.io.swagger.client.ApiException: Bad Request
at xyz.groundx.caver_ext_kas.rest_client.io.swagger.client.ApiClient.handleResponse(ApiClient.java:923)
at xyz.groundx.caver_ext_kas.rest_client.io.swagger.client.ApiClient.execute(ApiClient.java:839)
at xyz.groundx.caver_ext_kas.rest_client.io.swagger.client.api.wallet.api.BasicTxApi.contractExecutionTransactionWithHttpInfo(BasicTxApi.java:810)
at xyz.groundx.caver_ext_kas.rest_client.io.swagger.client.api.wallet.api.BasicTxApi.contractExecutionTransaction(BasicTxApi.java:795)
at xyz.groundx.caver_ext_kas.kas.wallet.Wallet.requestSmartContractExecution(Wallet.java:907)
at smart.Fin.run(SmartContract.java:138)