2

I am writing a smart contract that uses a multi index table with a member type double.

//@abi table tbltest i64
struct test{
    uint64_t uid;
    double margin;

    uuid_t primary_key() const { return uid; }

    EOSLIB_SERIALIZE(test,(uid)(margin))
};

When I try to generate an abi file using eosiocpp tool I get the following error

root@eos# eosiocpp -g test.abi test.cpp
3583446ms thread-0   main.cpp:105                  main                 ] 
999999 abi_generation_exception: Unable to generate abi
false: types can only be: vector, struct, class or a built-in type. (double)
type":"double"}
thread-0  abi_generator.cpp:606 add_type
{}
thread-0  abi_generator.cpp:290 handle_decl

If I change the type to uint64_t it works. But It generates an error if I use float or double. Why abi-generator does not support these types?

  • Maybe you should add the definition of your multi_index table, that we can analyze the cause of the error... Did you try to use the double as primary key? Documentation says only uint64_t is allowed to be the primary key... – TeeAttack42 Jun 2 '18 at 12:19
0

This issue in eosiocpp tool is resolved in the release version 1.0.2 as I am not getting this error now. I got this error previously in Dawn 4.0.0

| improve this answer | |
  • Can you tell me how you update your version to 1.0.2, Am also getting the same error while compiling my abi file. – Nirdesh Kumar Choudhary Aug 31 '18 at 5:31

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.