Getting an error when the code reaches this particular function.

Is there something obvious I am missing here? Kindly Note this is Deferred transaction

Please ask if anything else is required from my side.

void mainloan::checkdaily(uint64_t loan_id){

  auto itr = loan_table.find(loan_id);
  auto borrower=itr->borr_name;
  time_point tday;

  eosio::transaction t {};
    "calipd"_n, //fuction for calculating interest per day on principle amount 
    eosio::print("transaction sent.");
    defer_table.emplace(get_self(),[&](auto &df){
      df.df_id = defer_table.available_primary_key();


 error: static_assert failed "Something went wrong. Please report this issue to the github along with the structure you're reflecting."


Change std::make_tuple(itr) to std::make_tuple(*itr). The type of itr is const_iterator and it's not serializable.

  • how do i get to know about all this, bcoz even in documentation it was given as it is Sep 5 '19 at 13:48
  • Block.one is improving documentation widely. You can wait until it is done or I don't think there is another clue except for code itself.
    – conr2d
    Sep 5 '19 at 14:08
  • This is more of a basic cpp convention than something block one needs to document specifically. cplusplus.com/doc/tutorial/pointers the ITR is a pointer and the * is a dereference operator that gives access to the actual contents of the variable contained in the memory referenced by the pointer. By the way, you can tell ITR is a pointer by your use of the -> operator on it. Sep 5 '19 at 19:16

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.