eos icon indicating copy to clipboard operation
eos copied to clipboard

New hello world example compiling but throwing error when pushing to it

Open ZeroPointThree17 opened this issue 8 years ago • 2 comments

Following tutorial here: https://github.com/EOSIO/eos/blob/master/TUTORIAL.md

Following tutorial from top to bottom, but am stuck on this step:

root@ubuntu-c-4-8gib-nyc3-01:~/eos/contracts/hello# cleos push action hello.code hi '["user"]' -p user
Error 3030000: transaction validation exception
Ensure that your transaction satisfy the contract's constraint!
Error Details:
size > 0:

My hello.cpp is as follows:

#include <eosiolib/eosio.hpp>
#include <eosiolib/print.hpp>
using namespace eosio;

class hello : public eosio::contract {
 public:
     using contract::contract;

     /// @abi action
     void hi( account_name user ) {
             print( "Hello, ", name{user} );
     }
};

EOSIO_ABI( hello, (hi) )

Made sure hello.code, user users exist, as they are created while following the tutorial (among the many other steps taken in the tutorial, which I also performed). Made sure eosiocpp generated the wast and abi and deployed the contract as in the tutorial. No issues at all until this step.

This is on the master branch cloned as of 1 hour ago.

ZeroPointThree17 avatar Apr 02 '18 22:04 ZeroPointThree17

Can you provide the every steps you have done ? and give some results for under questions:

first: try ~/eos/contracts/hello# cleos push action hello.code hi '["user"]' --permission hello.code@active

  1. cleos wallet open && cleos wallet list && unlock your account
  2. cleos get code ${yours}

wilddylan avatar Apr 03 '18 01:04 wilddylan

@WildDylan

This was related to: https://github.com/EOSIO/eos/issues/2029

After fixing that issue, my abi generated correctly. I then added another print statement in hello.cpp so that it could be considered a change in code (otherwise it wouldnt let me redeploy if the code hadn't changed). I was able to redeploy and push a message to the contract.

Closing this issue as my problem is now fixed.

ZeroPointThree17 avatar Apr 03 '18 02:04 ZeroPointThree17