1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-06-19 04:10:03 +02:00

Decouple key_search_result() and KeySearch class with an interface.

This commit is contained in:
Henrik Hautakoski 2020-03-19 18:12:33 +01:00
parent a417390bb7
commit d9634f334b
8 changed files with 84 additions and 25 deletions

View file

@ -0,0 +1,50 @@
/**
* MIT License
*
* Copyright (c) 2019-2020 EOS Sw/eden
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef EOSIOKEYGEN_KEY_SEARCH_HELPERS_H
#define EOSIOKEYGEN_KEY_SEARCH_HELPERS_H
#include <eoskeygen/core/string.h>
#include <eoskeygen/crypto/types.h>
#include <eoskeygen/key_search.h>
#include <eoskeygen/key_search_result.h>
namespace eoskeygen {
class Dictionary;
class CliKeySearchResult : public IKeySearchResult
{
public:
CliKeySearchResult(const Dictionary& dict);
virtual void onResult(const struct ec_keypair* key, const struct KeySearch::result& result);
protected :
const Dictionary& m_dict;
};
} // namespace eoskeygen
#endif /* EOSIOKEYGEN_KEY_SEARCH_HELPERS_H */