GithubHelp home page GithubHelp logo

Comments (13)

shrimpliu avatar shrimpliu commented on June 9, 2024

I also encountered this problem.

from eosjs.

luckycoder99 avatar luckycoder99 commented on June 9, 2024

Since the console.log is outputting "Assembling WASM..." the trace appears to be from structs.js

 if(/^\s*\(module/.test(code)) {
        console.log('Assembling WASM...')
        const wasm = Buffer.from(binaryen.parseText(code).emitBinary())
        result.code = wasm
      } else {
        result.code = object.code

So this seems to be prior to hitting the blockchain. I also don't see the eos.setcode unit test in src/index.test.js which has all the passing unit tests. Perhaps @jcalfee has some suggestions for a workaround?

from eosjs.

jcalfee avatar jcalfee commented on June 9, 2024

I'll add a unit test..

from eosjs.

luckycoder99 avatar luckycoder99 commented on June 9, 2024

Thanks James! Appreciate any help here...

from eosjs.

jcalfee avatar jcalfee commented on June 9, 2024

So far the unit test is able to deploy the currency contract using eosjs with binaryen.

There are some complications making the unit test but unrelated. a) exchange contract deploy exceeds the maximum network usage, b) re-deploying the same wast rejected..

Since your wast files starts with "(module" it should be valid web assembly text format. The error is really between your wast file and binaryen. The wast file is not the format you write by hand but rather the 1st compilation of your program. The binaryen is a second pass on the wast file. I believe eosio has a program that converts c++ to this wast file. Is that what your using?

from eosjs.

jcalfee avatar jcalfee commented on June 9, 2024

I tested using [email protected] ..

from eosjs.

jcalfee avatar jcalfee commented on June 9, 2024

There was an unrelated error in the ABI structs fixed in the comment above (the eosjs-json upgrade) .. I'll push a release later today.

from eosjs.

jcalfee avatar jcalfee commented on June 9, 2024

Published: [email protected] .. Let us know more about how you created your wast file..

from eosjs.

luckycoder99 avatar luckycoder99 commented on June 9, 2024

Thanks for getting on this so fast.

I'm going to investigate this more later and provide more color with the new release. I was creating both the abi and the wast files using eosiocpp. So the files were output using 'eosiocpp -o hello.wast hello.cpp' and 'eosiocpp -g hello.abi hello.cpp'. These files generate with a few warnings, however. Once these files are created, I'm able to successfully deploy the contract via cleos using these files. The trouble comes when using these same files with the setcode command and fs/binaryen.

If you are able to deploy with the new version,, that's good news. I'll take a look at the new release and report back on this thread. Let me know if you need more details to reproduce anything.

from eosjs.

luckycoder99 avatar luckycoder99 commented on June 9, 2024

More to do. Just a quick update. The error is gone when using the previous version of binaryen (v37). The latest version with standard npm install binaryen (v46) seemed to cause the error. Will continue investigating...

from eosjs.

tbfleming avatar tbfleming commented on June 9, 2024

This sounds related to EOSIO/eos#2187

from eosjs.

luckycoder99 avatar luckycoder99 commented on June 9, 2024

Solved. It works with binaryen v37. You are the best.

from eosjs.

shrimpliu avatar shrimpliu commented on June 9, 2024

It works with binaryen v37. Failed to use v46 before.

from eosjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.