@Test
public void testMngNonceTransfer() throws Exception {
String testPrivateKey = "0x07f2066d045c19f72479cf3079a8161244bb3a9d0899a3487b6ec00c13596360";
String method = "transfer";
AbstractKeyring feePayerKeyring = createFromPrivateKey("0x48ca767f0e1b17ec1dd41f0471548d7d935d5a53fc4808eaa4bdcf3bdac88a23");
Caver caver = caverProvider.get();
Contract tokenContract = caver.contract.create(token.getAbi());
AbstractKeyring senderKeyring = createFromPrivateKey(testPrivateKey);
// caver 객체에 sender, feePayer 설정
tokenTokenUtils.gettokenToken().setSender(senderKeyring);
tokenTokenUtils.gettokenToken().setFeePayer(feePayerKeyring);
// defaultSendOption객체에 senderKeyring, feePayerKeyring 초기값 설정
token.getDefaultSendOptions().setFrom(senderKeyring.getAddress());
token.getDefaultSendOptions().setFeeDelegation(true);
token.getDefaultSendOptions().setFeePayer(feePayerKeyring.getAddress());
String toAddress = "0x980e41f0a74f1c3d749b8ec54d9e3de3279e1feb";
String amount = caver.utils.convertToPeb("1", Utils.KlayUnit.KLAY);
String input = tokenContract.encodeABI("transfer", toAddress, amount);
SendOptions sendOptions = determineSendOptions(token, token.getDefaultSendOptions(), method, Arrays.asList(toAddress, amount));
FeeDelegatedSmartContractExecution fdsce = new FeeDelegatedSmartContractExecution.Builder()
.setKlaytnCall(caver.rpc.klay)
.setFrom(senderKeyring.getAddress())
.setTo(toAddress)
.setGas(sendOptions.getGas())
.setInput(input)
.setNonce("test")
.build();
// Decoding하지 않고 sign(), signAsFeePayer()를 수행
caver.wallet.sign(senderKeyring.getAddress(), fdsce);
caver.wallet.signAsFeePayer(feePayerKeyring.getAddress(), fdsce);
String decoded = fdsce.getRLPEncoding();
Bytes32 txHash_executed = caver.rpc.klay.sendRawTransaction(decoded).send();
log.info("========= {}", objectToString(txHash_executed));
}
jUnit으로 위의 소스를 실행해봤습니다
그때 아래와 같은 오류가 발했습니다.
{
"id" : 3,
"jsonrpc" : "2.0",
"result" : null,
"error" : {
"code" : -32000,
"message" : "not a program account (e.g., an account having code and storage)",
"data" : null
},
"rawResponse" : null
}
chainID는 1001이고 contractAddress는 정상적으로 조회되는것도 확인했습니다.
이 오류가 어떤 오류인지 알수 있을까요??