eos
eos copied to clipboard
Get table rows does not work with multindex account_name
The rows are not shown when I use account_name column to store as key of multiindex. The transaction is executed, but when running get table from cleos or get_table_rows from http api it returns no rows
// @abi table
struct psase {
uint64_t purchaser;
asset irespobought;
asset eospaid;
uint64_t primary_key() const { return purchaser; }
EOSLIB_SERIALIZE(psase, (purchaser)(irespobought)(eospaid))
};
typedef multi_index<N(psase), psase> psases;
void irespoicoico::addpurchase(account_name purchaser, asset irespobought, asset eospaid)
{
psases p(_self, _self);
auto iter = p.find(purchaser);
if (iter == p.end()) {
p.emplace(configs(_self, _self).get().application, [&](auto& row) {
row.purchaser = purchaser;
row.irespobought = irespobought;
row.eospaid = eospaid;
});
}
else {
p.modify(iter, configs(_self, _self).get().application, [&](auto& row) {
row.irespobought = irespobought;
row.eospaid = eospaid;
});
}
}
Can you provide your get table command with parameters?
Sorry. It works. Fogot to add method to EOSIO_API