Возвращает вторичный индекс нужного типа.
#include <eosiolib/eosio.hpp>
using namespace std;
class addressbook: contract {
struct address {
string first_name;
string last_name;
string street;
string city;
uint64_t primary_key()
const {
return account_name; }
};
public:
addressbook(name receiver, name
code, datastream<const char*> ds):contract(receiver,
code, ds) {}
typedef eosio::multi_index< name(
"address"), address, indexed_by< name(
"zip"), const_mem_fun<address, uint64_t, &address::by_zip> > address_index;
void myaction() {
auto zip_index = addresses.get_index<name("zip")>();
auto itr = zip_index.find(zipnumb);
eosio::check(itr->account_name == name(
"dan"),
"Lock arf, Incorrect Record ");
}
}