안녕하세요!
바오밥에서 클레이 전송시, 예상수수료를 보여주기 위해 estimate Gas를 호출하는데 다음과 같은 에러가 나고 있습니다.
특이한 점은 개발 당시에는 정상 동작(2~3주전) 확인했던 부분인데, 동적가스비 정책이 바오밥에 반영 된 이후부터 해당 함수에서 에러가 나고 있습니다.
현재는 메인넷은 정상동작하며, 바오밥에서만 에러가 나고있습니다.
에러는 다음과 같습니다.
nodeError: (1 element)
- desc: “err: insufficient balance of the fee payer to pay for gas (supplied gas 500000010499)”
estimageGas 호출하기 위한 준비는 다음과 같이 하고 있습니다.
func estimateGasToTransferKlay(fromAddress: EthereumAddress,
toAddress: EthereumAddress,
toAmount: String) throws -> BigUInt {
do {
guard let contract = web3Api.createContract(abiString: Web3.Utils.coldWalletABI,
at: toAddress,
abiVersion: 2) else { throw TransactionError.errorTransferKlay }
guard let amount = Web3.Utils.parseToBigUInt(toAmount, units: .eth) else { throw TransactionError.errorTransferKlay }
let gasPrice = try getGasPrice()
// dump(gasPrice)
// dump(try convertPebToKlay(balance: gasPrice))
var options = TransactionOptions.defaultOptions
options.value = amount
options.from = fromAddress
options.gasPrice = .manual(gasPrice)
options.gasLimit = .manual(100000)
guard let tx = contract.write(
"fallback",
parameters: [AnyObject](),
extraData: Data(),
transactionOptions: options) else { throw TransactionError.errorTransferKlay }
let gas = try tx.estimateGas()
return gas * gasPrice
} catch {
throw error
}
}
estimateGas를 호출하기 위한 값들을 세팅하고 estimateGas를 호출하고있습니다.
에러상에는 잔액이 충분하지 않다고 하는데, fromAddress에 9000KLAY 넘게 있습니다ㅠ
혹시 세팅하는 부분에서 추가로 해주어야 할 부분이나 잘못된 부분이 있을까요?
노드에서 나고 있는 에러인지라, 어떠한 에러인지 도움을 구하고자 질문 올려봅니다ㅠ