안녕하세요
기존 AccountUpdate를 통해 업데이트를 성공했었는데
수수료를 대납해야하는 케이스가 생겨서 유닛테스트를 진행하다가 오류가 발생하여 문의드립니다.
keyring은 동일하게 만들었고 샘플로 알려주신 소스에서 AccountUpdate클래스를 만드는 부분만 수정해서 테스트를 했습니다
FeeDelegatedAccountUpdate accountUpdate = new FeeDelegatedAccountUpdate.Builder()
.setKlaytnCall(caver.rpc.klay)
.setFrom(targetKeyring.getAddress())
.setAccount(account)
.setGas(GAS_LIMIT)
.setFeePayer(feePayerKeyring.getAddress())
.build();
caver.wallet.sign(targetKeyring.getAddress(), accountUpdate);
caver.wallet.signAsFeePayer(feePayerKeyring.getAddress(), accountUpdate);
// 결과값 확인
String decoded = accountUpdate.getRLPEncoding();
Bytes32 sendResult = caver.rpc.klay.sendRawTransaction(decoded).send();
String txHash = sendResult.getResult();
TransactionReceiptProcessor receiptProcessor = new PollingTransactionReceiptProcessor(caver, 1000, 15);
TransactionReceipt.TransactionReceiptData receiptData = receiptProcessor.waitForTransactionReceipt(txHash);
log.info("### receiptData : {}",objectToString(receiptData));
이렇게 구현했는데 caver.wallet.signAsFeePayer()
를 안해주면 "Invalid FeePayer"가 발생하고
caver.wallet.signAsFeePayer()
를 해주면
] - 21-11-15 20:19:42:869 DEBUG org.web3j.protocol.http.HttpService:284 - <-- END HTTP (40-byte body)
[] - 21-11-15 20:19:43:874 DEBUG org.web3j.protocol.http.HttpService:169 - --> POST https://api.baobab.klaytn.net:8651/
[] - 21-11-15 20:19:43:875 DEBUG org.web3j.protocol.http.HttpService:176 - Content-Type: application/json; charset=utf-8
[] - 21-11-15 20:19:43:875 DEBUG org.web3j.protocol.http.HttpService:179 - Content-Length: 143
[] - 21-11-15 20:19:43:875 DEBUG org.web3j.protocol.http.HttpService:208 -
[] - 21-11-15 20:19:43:875 DEBUG org.web3j.protocol.http.HttpService:210 - {"jsonrpc":"2.0","method":"klay_getTransactionReceipt","params":["0x43fabc39c6a8652b6270e7ac7a5c9b031096de39adbd640ee41122901a645ea6"],"id":13}
[] - 21-11-15 20:19:43:875 DEBUG org.web3j.protocol.http.HttpService:211 - --> END POST (143-byte body)
[] - 21-11-15 20:19:43:879 DEBUG org.web3j.protocol.http.HttpService:233 - <-- 200 https://api.baobab.klaytn.net:8651/ (4ms)
[] - 21-11-15 20:19:43:879 DEBUG org.web3j.protocol.http.HttpService:294 - date: Mon, 15 Nov 2021 11:19:43 GMT
[] - 21-11-15 20:19:43:880 DEBUG org.web3j.protocol.http.HttpService:294 - content-type: application/json
[] - 21-11-15 20:19:43:880 DEBUG org.web3j.protocol.http.HttpService:294 - content-length: 40
[] - 21-11-15 20:19:43:880 DEBUG org.web3j.protocol.http.HttpService:294 - server: fasthttp
[] - 21-11-15 20:19:43:880 DEBUG org.web3j.protocol.http.HttpService:294 - vary: Origin
[] - 21-11-15 20:19:43:880 DEBUG org.web3j.protocol.http.HttpService:276 -
[] - 21-11-15 20:19:43:880 DEBUG org.web3j.protocol.http.HttpService:277 - {"jsonrpc":"2.0","id":13,"result":null}
[] - 21-11-15 20:19:43:880 DEBUG org.web3j.protocol.http.HttpService:284 - <-- END HTTP (40-byte body)
[] - 21-11-15 20:19:44:885 DEBUG org.web3j.protocol.http.HttpService:169 - --> POST https://api.baobab.klaytn.net:8651/
[] - 21-11-15 20:19:44:886 DEBUG org.web3j.protocol.http.HttpService:176 - Content-Type: application/json; charset=utf-8
[] - 21-11-15 20:19:44:886 DEBUG org.web3j.protocol.http.HttpService:179 - Content-Length: 143
[] - 21-11-15 20:19:44:886 DEBUG org.web3j.protocol.http.HttpService:208 -
[] - 21-11-15 20:19:44:886 DEBUG org.web3j.protocol.http.HttpService:210 - {"jsonrpc":"2.0","method":"klay_getTransactionReceipt","params":["0x43fabc39c6a8652b6270e7ac7a5c9b031096de39adbd640ee41122901a645ea6"],"id":14}
[] - 21-11-15 20:19:44:886 DEBUG org.web3j.protocol.http.HttpService:211 - --> END POST (143-byte body)
[] - 21-11-15 20:19:44:903 DEBUG org.web3j.protocol.http.HttpService:233 - <-- 200 https://api.baobab.klaytn.net:8651/ (16ms)
[] - 21-11-15 20:19:44:903 DEBUG org.web3j.protocol.http.HttpService:294 - date: Mon, 15 Nov 2021 11:19:45 GMT
[] - 21-11-15 20:19:44:903 DEBUG org.web3j.protocol.http.HttpService:294 - content-type: application/json
[] - 21-11-15 20:19:44:903 DEBUG org.web3j.protocol.http.HttpService:294 - content-length: 40
[] - 21-11-15 20:19:44:903 DEBUG org.web3j.protocol.http.HttpService:294 - server: fasthttp
[] - 21-11-15 20:19:44:903 DEBUG org.web3j.protocol.http.HttpService:294 - vary: Origin
[] - 21-11-15 20:19:44:903 DEBUG org.web3j.protocol.http.HttpService:276 -
[] - 21-11-15 20:19:44:904 DEBUG org.web3j.protocol.http.HttpService:277 - {"jsonrpc":"2.0","id":14,"result":null}
[] - 21-11-15 20:19:44:904 DEBUG org.web3j.protocol.http.HttpService:284 - <-- END HTTP (40-byte body)
[] - 21-11-15 20:19:45:905 DEBUG org.web3j.protocol.http.HttpService:169 - --> POST https://api.baobab.klaytn.net:8651/
[] - 21-11-15 20:19:45:905 DEBUG org.web3j.protocol.http.HttpService:176 - Content-Type: application/json; charset=utf-8
[] - 21-11-15 20:19:45:905 DEBUG org.web3j.protocol.http.HttpService:179 - Content-Length: 143
[] - 21-11-15 20:19:45:905 DEBUG org.web3j.protocol.http.HttpService:208 -
[] - 21-11-15 20:19:45:905 DEBUG org.web3j.protocol.http.HttpService:210 - {"jsonrpc":"2.0","method":"klay_getTransactionReceipt","params":["0x43fabc39c6a8652b6270e7ac7a5c9b031096de39adbd640ee41122901a645ea6"],"id":15}
[] - 21-11-15 20:19:45:905 DEBUG org.web3j.protocol.http.HttpService:211 - --> END POST (143-byte body)
[] - 21-11-15 20:19:45:910 DEBUG org.web3j.protocol.http.HttpService:233 - <-- 200 https://api.baobab.klaytn.net:8651/ (4ms)
[] - 21-11-15 20:19:45:910 DEBUG org.web3j.protocol.http.HttpService:294 - date: Mon, 15 Nov 2021 11:19:46 GMT
[] - 21-11-15 20:19:45:910 DEBUG org.web3j.protocol.http.HttpService:294 - content-type: application/json
[] - 21-11-15 20:19:45:910 DEBUG org.web3j.protocol.http.HttpService:294 - content-length: 40
[] - 21-11-15 20:19:45:910 DEBUG org.web3j.protocol.http.HttpService:294 - server: fasthttp
[] - 21-11-15 20:19:45:910 DEBUG org.web3j.protocol.http.HttpService:294 - vary: Origin
[] - 21-11-15 20:19:45:910 DEBUG org.web3j.protocol.http.HttpService:276 -
[] - 21-11-15 20:19:45:910 DEBUG org.web3j.protocol.http.HttpService:277 - {"jsonrpc":"2.0","id":15,"result":null}
[] - 21-11-15 20:19:45:910 DEBUG org.web3j.protocol.http.HttpService:284 - <-- END HTTP (40-byte body)
[] - 21-11-15 20:19:46:914 DEBUG org.web3j.protocol.http.HttpService:169 - --> POST https://api.baobab.klaytn.net:8651/
[] - 21-11-15 20:19:46:914 DEBUG org.web3j.protocol.http.HttpService:176 - Content-Type: application/json; charset=utf-8
[] - 21-11-15 20:19:46:914 DEBUG org.web3j.protocol.http.HttpService:179 - Content-Length: 143
[] - 21-11-15 20:19:46:914 DEBUG org.web3j.protocol.http.HttpService:208 -
[] - 21-11-15 20:19:46:915 DEBUG org.web3j.protocol.http.HttpService:210 - {"jsonrpc":"2.0","method":"klay_getTransactionReceipt","params":["0x43fabc39c6a8652b6270e7ac7a5c9b031096de39adbd640ee41122901a645ea6"],"id":16}
[] - 21-11-15 20:19:46:915 DEBUG org.web3j.protocol.http.HttpService:211 - --> END POST (143-byte body)
[] - 21-11-15 20:19:46:920 DEBUG org.web3j.protocol.http.HttpService:233 - <-- 200 https://api.baobab.klaytn.net:8651/ (5ms)
[] - 21-11-15 20:19:46:920 DEBUG org.web3j.protocol.http.HttpService:294 - date: Mon, 15 Nov 2021 11:19:47 GMT
[] - 21-11-15 20:19:46:920 DEBUG org.web3j.protocol.http.HttpService:294 - content-type: application/json
[] - 21-11-15 20:19:46:920 DEBUG org.web3j.protocol.http.HttpService:294 - content-length: 40
[] - 21-11-15 20:19:46:920 DEBUG org.web3j.protocol.http.HttpService:294 - server: fasthttp
[] - 21-11-15 20:19:46:921 DEBUG org.web3j.protocol.http.HttpService:294 - vary: Origin
[] - 21-11-15 20:19:46:921 DEBUG org.web3j.protocol.http.HttpService:276 -
[] - 21-11-15 20:19:46:921 DEBUG org.web3j.protocol.http.HttpService:277 - {"jsonrpc":"2.0","id":16,"result":null}
[] - 21-11-15 20:19:46:921 DEBUG org.web3j.protocol.http.HttpService:284 - <-- END HTTP (40-byte body)
[] - 21-11-15 20:19:47:922 DEBUG org.web3j.protocol.http.HttpService:169 - --> POST https://api.baobab.klaytn.net:8651/
[] - 21-11-15 20:19:47:922 DEBUG org.web3j.protocol.http.HttpService:176 - Content-Type: application/json; charset=utf-8
[] - 21-11-15 20:19:47:922 DEBUG org.web3j.protocol.http.HttpService:179 - Content-Length: 143
[] - 21-11-15 20:19:47:922 DEBUG org.web3j.protocol.http.HttpService:208 -
[] - 21-11-15 20:19:47:922 DEBUG org.web3j.protocol.http.HttpService:210 - {"jsonrpc":"2.0","method":"klay_getTransactionReceipt","params":["0x43fabc39c6a8652b6270e7ac7a5c9b031096de39adbd640ee41122901a645ea6"],"id":17}
[] - 21-11-15 20:19:47:922 DEBUG org.web3j.protocol.http.HttpService:211 - --> END POST (143-byte body)
[] - 21-11-15 20:19:47:928 DEBUG org.web3j.protocol.http.HttpService:233 - <-- 200 https://api.baobab.klaytn.net:8651/ (5ms)
[] - 21-11-15 20:19:47:928 DEBUG org.web3j.protocol.http.HttpService:294 - date: Mon, 15 Nov 2021 11:19:48 GMT
[] - 21-11-15 20:19:47:928 DEBUG org.web3j.protocol.http.HttpService:294 - content-type: application/json
[] - 21-11-15 20:19:47:928 DEBUG org.web3j.protocol.http.HttpService:294 - content-length: 40
[] - 21-11-15 20:19:47:928 DEBUG org.web3j.protocol.http.HttpService:294 - server: fasthttp
[] - 21-11-15 20:19:47:928 DEBUG org.web3j.protocol.http.HttpService:294 - vary: Origin
[] - 21-11-15 20:19:47:929 DEBUG org.web3j.protocol.http.HttpService:276 -
[] - 21-11-15 20:19:47:929 DEBUG org.web3j.protocol.http.HttpService:277 - {"jsonrpc":"2.0","id":17,"result":null}
[] - 21-11-15 20:19:47:929 DEBUG org.web3j.protocol.http.HttpService:284 - <-- END HTTP (40-byte body)
[] - 21-11-15 20:19:48:935 DEBUG org.web3j.protocol.http.HttpService:169 - --> POST https://api.baobab.klaytn.net:8651/
[] - 21-11-15 20:19:48:935 DEBUG org.web3j.protocol.http.HttpService:176 - Content-Type: application/json; charset=utf-8
[] - 21-11-15 20:19:48:935 DEBUG org.web3j.protocol.http.HttpService:179 - Content-Length: 143
[] - 21-11-15 20:19:48:935 DEBUG org.web3j.protocol.http.HttpService:208 -
[] - 21-11-15 20:19:48:935 DEBUG org.web3j.protocol.http.HttpService:210 - {"jsonrpc":"2.0","method":"klay_getTransactionReceipt","params":["0x43fabc39c6a8652b6270e7ac7a5c9b031096de39adbd640ee41122901a645ea6"],"id":18}
[] - 21-11-15 20:19:48:935 DEBUG org.web3j.protocol.http.HttpService:211 - --> END POST (143-byte body)
[] - 21-11-15 20:19:48:941 DEBUG org.web3j.protocol.http.HttpService:233 - <-- 200 https://api.baobab.klaytn.net:8651/ (5ms)
[] - 21-11-15 20:19:48:941 DEBUG org.web3j.protocol.http.HttpService:294 - date: Mon, 15 Nov 2021 11:19:49 GMT
[] - 21-11-15 20:19:48:941 DEBUG org.web3j.protocol.http.HttpService:294 - content-type: application/json
[] - 21-11-15 20:19:48:941 DEBUG org.web3j.protocol.http.HttpService:294 - content-length: 40
[] - 21-11-15 20:19:48:941 DEBUG org.web3j.protocol.http.HttpService:294 - server: fasthttp
[] - 21-11-15 20:19:48:942 DEBUG org.web3j.protocol.http.HttpService:294 - vary: Origin
[] - 21-11-15 20:19:48:942 DEBUG org.web3j.protocol.http.HttpService:276 -
[] - 21-11-15 20:19:48:942 DEBUG org.web3j.protocol.http.HttpService:277 - {"jsonrpc":"2.0","id":18,"result":null}
[] - 21-11-15 20:19:48:942 DEBUG org.web3j.protocol.http.HttpService:284 - <-- END HTTP (40-byte body)
[] - 21-11-15 20:19:49:946 DEBUG org.web3j.protocol.http.HttpService:169 - --> POST https://api.baobab.klaytn.net:8651/
[] - 21-11-15 20:19:49:947 DEBUG org.web3j.protocol.http.HttpService:176 - Content-Type: application/json; charset=utf-8
[] - 21-11-15 20:19:49:947 DEBUG org.web3j.protocol.http.HttpService:179 - Content-Length: 143
[] - 21-11-15 20:19:49:947 DEBUG org.web3j.protocol.http.HttpService:208 -
[] - 21-11-15 20:19:49:947 DEBUG org.web3j.protocol.http.HttpService:210 - {"jsonrpc":"2.0","method":"klay_getTransactionReceipt","params":["0x43fabc39c6a8652b6270e7ac7a5c9b031096de39adbd640ee41122901a645ea6"],"id":19}
[] - 21-11-15 20:19:49:947 DEBUG org.web3j.protocol.http.HttpService:211 - --> END POST (143-byte body)
[] - 21-11-15 20:19:49:953 DEBUG org.web3j.protocol.http.HttpService:233 - <-- 200 https://api.baobab.klaytn.net:8651/ (5ms)
[] - 21-11-15 20:19:49:953 DEBUG org.web3j.protocol.http.HttpService:294 - date: Mon, 15 Nov 2021 11:19:50 GMT
[] - 21-11-15 20:19:49:953 DEBUG org.web3j.protocol.http.HttpService:294 - content-type: application/json
[] - 21-11-15 20:19:49:953 DEBUG org.web3j.protocol.http.HttpService:294 - content-length: 40
[] - 21-11-15 20:19:49:953 DEBUG org.web3j.protocol.http.HttpService:294 - server: fasthttp
[] - 21-11-15 20:19:49:953 DEBUG org.web3j.protocol.http.HttpService:294 - vary: Origin
[] - 21-11-15 20:19:49:953 DEBUG org.web3j.protocol.http.HttpService:276 -
[] - 21-11-15 20:19:49:954 DEBUG org.web3j.protocol.http.HttpService:277 - {"jsonrpc":"2.0","id":19,"result":null}
위와 같은 에러가 발생하면서 org.web3j.protocol.exceptions.TransactionException: Transaction receipt was not generated after 15 seconds for transaction: 0x43fabc39c6a8652b6270e7ac7a5c9b031096de39adbd640ee41122901a645ea6
이런 에러가 찍혀있습니다
feePayer의 주소는 공통으로 사용하는 feePayer 주소가 맞는 것은 확인하였고
Klay가 많은 지갑주소로도 테스트를 했는데 동일하게 에러가 발생했습니다.
이 부분은 어떤 오류인지 알 수 있을까요??