1

error encountered when compile the contracts with cdt 1.8.1, any idea?

/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/bin/../include/boost/pfr/detail/core17_generated.hpp:38:9: error:
type 'swaps_row' decomposes into 2 elements, but only 1 names were provided
auto& [a] = val;
^
/usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/bin/../include/boost/pfr/detail/core17_generated.hpp:1032:30: note:
in instantiation of function template specialization
'boost::pfr::detail::tie_as_tuple<swaps_row>' requested here
return boost::pfr::detail::tie_as_tuple(val, fields_count_tag{});
1

Add EOSLIB_SERIALIZE macro manually.

struct swaps_row {
  TYPE a;
  TYPE b;
  TYPE c;

  uint64_t primary_key() const { return XXX; }

  EOSLIB_SERIALIZE(swaps_row, (a)(b)(c)) // Like this!
};

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.