eos icon indicating copy to clipboard operation
eos copied to clipboard

Runtime Error Processing WASM

Open amActiveHello opened this issue 8 years ago • 6 comments

1、debug.cpp is: image 2、debg.hpp image 3、but console is image 4、log is image 5、in /usr/local/eosio/include/eosiolib/contracts.dox illustrate image 5、whent i modify to image it produce the same error

amActiveHello avatar Aug 06 '18 02:08 amActiveHello

you need to compile your cpp into wast using eosiocpp first.

taokayan avatar Aug 07 '18 03:08 taokayan

I aready have compiled use eosiocpp: eosiocpp -o debug.wast debug.cpp eosiocpp -g debug.abi debug.cpp But still occure the above error

amActiveHello avatar Aug 07 '18 08:08 amActiveHello

from your logs looks like cleos failed to locate your wast file, please try to use set code and set abi instead of set contract:

cleos set code account wastFileFullPath cleos set abi account abiFileFullPath

taokayan avatar Aug 07 '18 09:08 taokayan

1、when use cleos set code account wastFileFullPath cleos set abi account abiFileFullPath set code still have the same error: image 2、log error still is: image 3、debug.cpp image 4、debug.hpp image

amActiveHello avatar Aug 07 '18 09:08 amActiveHello

Your function signature is not correct, please refer to the MARCO:

#define EOSIO_ABI( TYPE, MEMBERS ) \
extern "C" { \
   void apply( uint64_t receiver, uint64_t code, uint64_t action ) { \
      auto self = receiver; \
      if( action == N(onerror)) { \
         /* onerror is only valid if it is for the "eosio" code account and authorized by "eosio"'s "active permission */ \
         eosio_assert(code == N(eosio), "onerror action's are only valid from the \"eosio\" system account"); \
      } \
      if( code == self || action == N(onerror) ) { \
         TYPE thiscontract( self ); \
         switch( action ) { \
            EOSIO_API( TYPE, MEMBERS ) \
         } \
         /* does not allow destructor of thiscontract to run: eosio_exit(0); */ \
      } \
   } \
} \

taokayan avatar Aug 07 '18 09:08 taokayan

now ,when i modify debug.cpp , set code && set abi are ok, but generated another error , although i use -p debug: Error 3050000: Action validate exception image image 2、on the other hand,in the tutorials, it's --acope is aredly not apply image

amActiveHello avatar Aug 07 '18 10:08 amActiveHello