message: identity_test contract switched to new dispatcher
diff: -#include <eosiolib/chain.h>
  +#include <eosiolib/action.h>
  +#include <eosiolib/contract.hpp>
  #include <eosiolib/dispatcher.hpp>
  -#include <eosiolib/singleton.hpp>
  -#include <eosiolib/vector.hpp>
  -
  #include <identity/interface.hpp>
  namespace identity_test {
  @@ -12,57 +10,26 @@ namespace identity_test {
  using std::string;
  using std::vector;
  - class contract {
  + class contract : public eosio::contract {
  public:
  - static const uint64_t code = N(identitytest);
  - typedef identity::identity_name identity_name;
  - typedef identity::property_name property_name;
  -
  - struct get_owner_for_identity : public action_meta< code, N(getowner) >
  - {
  - uint64_t identity;
  -
  - EOSLIB_SERIALIZE( get_owner_for_identity, (identity) )
  - };
  -
  - struct get_identity_for_account : public action_meta< code, N(getidentity) >
  - {
  - account_name account ;
  -
  - EOSLIB_SERIALIZE( get_identity_for_account, (account) )
  - };
  -
  + static constexpr uint64_t code = N(identitytest);
  typedef singleton<N(result), uint64_t> result_table;
  - static void on( uint64_t receiver, const get_owner_for_identity& c ) {
  + using eosio::contract::contract;
  +
  + void get_owner_for_identity( const uint64_t identity ) {
  identity::interface iface( N(identity) );
  - account_name owner = iface.get_owner_for_identity(receiver, c.identity);
  + account_name owner = iface.get_owner_for_identity(current_receiver(), identity);
  result_table( code, 0 ).set( owner, code ); //use scope = 0 for simplicity
  }
  - static void on( uint64_t receiver, const get_identity_for_account& c ) {
  + void get_identity_for_account( const account_name account ) {
  identity::interface iface( N(identity) );
  - identity_name idnt = iface.get_identity_for_account(receiver, c.account);
  + identity::identity_name idnt = iface.get_identity_for_account(current_receiver(), account);
  result_table( code, 0 ).set(idnt, code ); //use scope = 0 for simplicity
  }
  -
  - static void apply( uint64_t receiver, account_name c, action_name act) {
  - if( code == N(identitytest) ) {
  - if ( act == N(getowner) ) {
  - contract::on( receiver, eosio::unpack_action_data<get_owner_for_identity>() );
  - } else if ( act == N(getidentity) ) {
  - contract::on( receiver, eosio::unpack_action_data<get_identity_for_account>() );
  - }
  - }
  - }
  -
  };
  } /// namespace identity
  -extern "C" {
  - /// The apply method implements the dispatch of events to this contract
  - void apply( uint64_t receiver, uint64_t code, uint64_t action ) {
  - identity_test::contract::apply( receiver, code, action );
  - }
  -}
  +EOSIO_ABI( identity_test::contract, (get_owner_for_identity)(get_identity_for_account) );
  