Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Returning WAST from get_code is no longer supported #390

Closed
stefanzarembinski opened this issue Oct 10, 2018 · 4 comments
Closed

Returning WAST from get_code is no longer supported #390

stefanzarembinski opened this issue Oct 10, 2018 · 4 comments
Labels

Comments

@stefanzarembinski
Copy link

Version of EOSJS
eosjs@20.0.0-beta1

Describe the bug
rpc.get_code(account_name) fails with the this error message:
... Error: Returning WAST from get_code is no longer supported ...

To Reproduce

  1. Execute this code:
    const eosjs = require('eosjs');
    const fetch = require('node-fetch');
    const rpc = new eosjs.Rpc.JsonRpc('http://127.0.0.1:8888', { fetch });

(async (account_name) => {
result = await rpc.get_code(account_name);
console.log(result)
})("eosio")

  1. See error message:
    (node:1590) UnhandledPromiseRejectionWarning: Error: Returning WAST from get_code is no longer supported
    at new RpcError (/mnt/c/Workspaces/EOS/eosfactory/node_modules/eosjs/dist/eosjs-rpcerror.js:22:28)
    at JsonRpc. (/mnt/c/Workspaces/EOS/eosfactory/node_modules/eosjs/dist/eosjs-jsonrpc.js:117:35)
    at step (/mnt/c/Workspaces/EOS/eosfactory/node_modules/eosjs/dist/eosjs-jsonrpc.js:35:23)
    at Object.next (/mnt/c/Workspaces/EOS/eosfactory/node_modules/eosjs/dist/eosjs-jsonrpc.js:16:53)
    ..........................

Expected behavior
Obvious

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. UBUNTU]
  • Browser [e.g. Node]
  • Version [e.g. 16]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@tbfleming tbfleming added the bug label Oct 26, 2018
@Shrey33
Copy link

Shrey33 commented Nov 9, 2018

@stefanzarembinski Hello,
Can you please elaborate on the problem? Getting WAST via get_code was deprecated in 1.2.0 and removed in 1.2.2.

@stefanzarembinski
Copy link
Author

Getting WAST via get_code was deprecated in 1.2.0 and removed in 1.2.2. Yet the
'rpc.get_code(account_name)' function seems to ignore the fact, and attempts to return
WAST, running into troubles.

To reproduce, having a node listening, with a node prompt, do:

const eosjs = require('eosjs');
undefined
const fetch = require('node-fetch');
undefined
const rpc = new eosjs.Rpc.JsonRpc('http://127.0.0.1:8888', { fetch });
undefined
(async (account_name) => {
... result = await rpc.get_code(account_name);
... console.log(result)
... })("eosio")
Promise {
,
domain:
Domain {
domain: null,
_events:
{ removeListener: [Function: updateExceptionCapture],
newListener: [Function: updateExceptionCapture],
error: [Function: debugDomainError] },
_eventsCount: 3,
_maxListeners: undefined,
members: [] } }
(node:802) UnhandledPromiseRejectionWarning: Error: Returning WAST from get_code is no longer supported
at new RpcError (/mnt/c/Workspaces/EOS/eosfactory/node_modules/eosjs/dist/eosjs-rpcerror.js:22:28)
at JsonRpc. (/mnt/c/Workspaces/EOS/eosfactory/node_modules/eosjs/dist/eosjs-jsonrpc.js:117:35)
at step (/mnt/c/Workspaces/EOS/eosfactory/node_modules/eosjs/dist/eosjs-jsonrpc.js:35:23)
at Object.next (/mnt/c/Workspaces/EOS/eosfactory/node_modules/eosjs/dist/eosjs-jsonrpc.js:16:53)
at fulfilled (/mnt/c/Workspaces/EOS/eosfactory/node_modules/eosjs/dist/eosjs-jsonrpc.js:7:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:802) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:802) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@stefanzarembinski
Copy link
Author

I see, this can be misleading:
To reproduce, having a node listening, with a node prompt

I mean:
... having a local eosio node running ...

@GreenBusDriver GreenBusDriver mentioned this issue Oct 4, 2019
2 tasks
GreenBusDriver added a commit that referenced this issue Oct 4, 2019
@GreenBusDriver
Copy link
Contributor

Added argument to default code_as_wasm to true, to be consistent with how things work today...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants