Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env.sha3 unresolveable #16

Closed
NatPDeveloper opened this issue Aug 17, 2022 · 6 comments · Fixed by #21
Closed

env.sha3 unresolveable #16

NatPDeveloper opened this issue Aug 17, 2022 · 6 comments · Fixed by #21
Assignees
Milestone

Comments

@NatPDeveloper
Copy link

Description of error:

When you run leap with the new cdt without enabling the crypto feature you get env.sha3 unresolveable, even when not using the feature.

Steps to reproduce:

Try and deploy a new cdt contract without enabling the crypto feature.

Desired behavior:

No error and when the feature is being used, a better error code perhaps that specifies the feature that needs to be enabled.

@stephenpdeos stephenpdeos transferred this issue from AntelopeIO/leap Aug 18, 2022
@stephenpdeos
Copy link
Member

For now, we will include the crypto primitive host functions in a separate header file so this error doesn't occur for those not trying to use this feature.

@linh2931
Copy link
Member

@NatPDeveloper I started Leap release 3.1 without enabling crypto protocol feature, and pushed a simple contract compiled by CDT release/3.0's cdt-cpp; but I could not reproduce the problem. Could you share your contract and exact steps to reproduce the problem?

@NatPDeveloper
Copy link
Author

unable to reproduce at this time, not sure what changed will reopen if necessary

Repository owner moved this from Todo to Done in Team Backlog Aug 24, 2022
@benjiewheeler
Copy link

I'm facing this issue as well

Steps to reproduce:

On a fresh Ubuntu 18.04 VM

  • install leap leap-3.1.0-rc4-ubuntu18.04-x86_64.deb
  • install cdt cdt_3.0.0-rc2_amd64.deb
  • run a vanilla nodeos local chain
  • compile the contract cdt-cpp --abigen -I include -o dummy.wasm dummy.cpp
  • deploy it cleos set contract dummy $PWD dummy.wasm dummy.abi -p dummy@active
#include <eosio/crypto.hpp>
#include <eosio/eosio.hpp>
using namespace eosio;

CONTRACT dummy : public contract
{
public:
    using contract::contract;

    ACTION hi(name nm);

    using hi_action = action_wrapper<"hi"_n, &dummy::hi>;
};
#include "dummy.hpp"

ACTION dummy::hi(name nm)
{
    sha256("abc", 3);
}

If I comment this line sha256("abc", 3); and recompile and deploy, it works just fine

@NatPDeveloper NatPDeveloper reopened this Aug 29, 2022
@linh2931
Copy link
Member

linh2931 commented Aug 29, 2022

This should be fixed by #21. Not sure if you could build a CDT on https://github.com/AntelopeIO/cdt/tree/expose_crypto_primitives to give it a try before it is officially released.

@marijnbent
Copy link

where can I find cleos?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
5 participants