0

I ran eosio-init on the newest CDT (1.7) and made a -bare project.

newtest.cpp

#include "newtest.hpp"
ACTION newtest::hi( name nm ) {
   /* fill in action body */
   print_f("Name : %\n",nm);
}

newtest.hpp

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

CONTRACT newtest : public contract {
   public:
      using contract::contract;

      ACTION hi( name nm );

      using hi_action = action_wrapper<"hi"_n, &newtest::hi>;
};

When I run eosio-cpp -abigen newtest.cpp:

/tmp/newtest.cpp:8:10: fatal error: 'eosiolib/datastream.hpp' file not found
#include <eosiolib/datastream.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

I tried also including #include <eosiolib/crypto.h>, but this isn't found.

How do I go about doing crypto functions like sha256 in EOS?

Thanks!

0

The correct library is now #include <eosio/crypto.hpp>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.