near-api-js icon indicating copy to clipboard operation
near-api-js copied to clipboard

Exceeding gas doesn't show correct error

Open ilblackdragon opened this issue 4 years ago • 2 comments

Calling any transaction with too much attached gas leads to unclear error:

near call testnet create_account '' --gas 1000000000000000000 --accountId illia

Leads to error Error submitting heartbeat: InvalidTxError: {} while error from RPC has all the details:

{“jsonrpc”:“2.0",“error”:{“code”:-32000,“message”:“Server error”,“data”:{“TxExecutionError”:{“InvalidTxError”:{“ActionsValidation”:{“TotalPrepaidGasExceeded”:{“total_prepaid_gas”:1000000000000000000,“limit”:300000000000000}}}}}},“id”:126}

ilblackdragon avatar Jul 22 '20 08:07 ilblackdragon

Downgrading to P2 since it's not near-api-js issue. Further actions:

  • wait for https://github.com/near/nearcore/issues/4025 to be fixed
  • add an error message for TotalPrepaidGasExceeded in near-api-js (if needed)
  • test and close this issue

volovyks avatar Mar 11 '21 13:03 volovyks

https://github.com/near/near-api-js/issues/321 was a duplicate of this issue. Check comments about preventing call on near-api-js side.

volovyks avatar Mar 11 '21 14:03 volovyks

Issue no longer exists in current release:

Error: {"kind":{"ActionsValidation":{"TotalPrepaidGasExceeded":{"limit":300000000000000,"total_prepaid_gas":1000000000000000000}}}}
    at parseRpcError (https://xdskw.csb.app/node_modules/near-api-js/lib/utils/rpc_errors.js:24:19)
    at JsonRpcProvider.eval (https://xdskw.csb.app/node_modules/near-api-js/lib/providers/json-rpc-provider.js:355:66)
    at [Generator.next](http://generator.next/) (<anonymous>)
    at fulfilled (https://xdskw.csb.app/node_modules/near-api-js/lib/providers/json-rpc-provider.js:5:58)

esaminu avatar Sep 05 '22 20:09 esaminu