0

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){
  require_auth(_self);

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

  eosio::transaction t {};
  t.actions.emplace_back(
    permission_level(_self,"active"_n),
    _self,
    "calipd"_n, //fuction for calculating interest per day on principle amount 
    std::make_tuple(itr));
    t.delay_sec=20;//86400;
    t.send(now(),_self);
    eosio::print("transaction sent.");
    defer_table.emplace(get_self(),[&](auto &df){
      df.df_id = defer_table.available_primary_key();
      df.transaction_date=tday;
    });

}```




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

1

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 – guruprakash gupta Sep 5 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 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. – netuoso - EOS Titan Sep 5 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.