Comments (5)
This is a common developer mistake and currently can be a big devx detractor.
from near-api-js.
In NAJ, when we receive the arguments, we can check the arguments. We need contract metadata.
from near-api-js.
This needs design. Estimate is for following up with other teams to find out how to do this.
from near-api-js.
Just for the record, currently, the error message is less cryptic:
Error: Error: Querying call/dev-1614893283391-2068372/get_status failed: wasm execution failed with error: FunctionCallError(HostError(GuestPanic { panic_msg: "panicked at \'Failed to deserialize input from JSON.: Error(\"missing field `account_id`\", line: 1, column: 40)\', src/lib.rs:22:1" })).
{
"error": "wasm execution failed with error: FunctionCallError(HostError(GuestPanic { panic_msg: \"panicked at \\'Failed to deserialize input from JSON.: Error(\\\"missing field `account_id`\\\", line: 1, column: 40)\\', src/lib.rs:22:1\" }))",
"logs": [],
"block_height": 38844509,
"block_hash": "APNzn7CxYTr2hdV7d29Gtt8KaWgBrGxTiif6pydVHK9n"
}
at JsonRpcProvider.query (/usr/lib/node_modules/near-shell/node_modules/near-api-js/lib/providers/json-rpc-provider.js:67:19)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async Account.viewFunction (/usr/lib/node_modules/near-shell/node_modules/near-api-js/lib/account.js:272:24)
at async exports.callViewFunction (/usr/lib/node_modules/near-shell/index.js:64:48)
at async Object.handler (/usr/lib/node_modules/near-shell/utils/exit-on-error.js:37:9)
Yet, it depends on how the contract itself reports the error. JSON parser in Rust provides a helpful message while JSON parser in AssemblyScript might be not that friendly. If AssemblyScript contracts still just crash without any message, we need to address it on the near-sdk-as level.
That said, these are errors from inside the smart contract, these two are generated by JSON parser compiled into the contract.
To do anything with that, we need to define some sort of error API layer for the smart contracts just like we discuss the events API, and come up with some helpful magic for the end-users on the SDK side.
from near-api-js.
Downgrading to P2 since it's not near-api-js
issue.
Further actions:
- wait for near/near-sdk-as#443 to close
- check if the new error is readable, has
type
, and clear to understand - close this issue
from near-api-js.
Related Issues (20)
- Security: Supply chain protection is bad
- Get result of an execution plan
- Rework 'accounts' package tests due to removal of top-level account creation functionality
- functionCall arguments formated in Json only HOT 28
- The `wallet.requestSignIn` stopped working on v3.0.0 HOT 2
- Replace crypto-browserify with another library
- Error: Length of buffer does not match length of ASN.1 sequence HOT 31
- Error: Unable to resolve module http from ./node_modules/@near-js/providers/lib/fetch.js http could not be found within the project HOT 2
- Get correct publicKey from biometric getKeys using indexer HOT 1
- Support nearcore 1.37 HOT 1
- [Error] createAccount don't work on testnet. HOT 8
- How to get the account balance based on a particular block or date HOT 4
- SignedDelegate is not working
- Biometric createKey failing with Bitwarden password manager "expected βidβ or βrawIdβ field" HOT 6
- Passkeys/webauthn popup not triggering in Chrome HOT 11
- Account.sendMoney transaction execution level
- Updating RPC error schema HOT 2
- yarn + latest wallet selector + latest near-api-js == error HOT 6
- Error sending signed transaction with v4.0.3 HOT 5
- `provider.sendTransaction(signedTx)` always fails for FailoverRpcProvider HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from near-api-js.