mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-07-04 12:03:41 +02:00
cli/src/cli_key_search_result: Add prefix parameter to constructor.
This commit is contained in:
parent
554cfd5884
commit
52e255850a
2 changed files with 9 additions and 4 deletions
|
|
@ -21,6 +21,7 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <libeosio/WIF.hpp>
|
#include <libeosio/WIF.hpp>
|
||||||
#include <eoskeygen/core/dictionary.hpp>
|
#include <eoskeygen/core/dictionary.hpp>
|
||||||
|
|
@ -37,8 +38,9 @@ static size_t highlight(console::Color color, const std::string& str, size_t pos
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
CliKeySearchResult::CliKeySearchResult(const Dictionary& dict) :
|
CliKeySearchResult::CliKeySearchResult(const Dictionary& dict, const std::string& prefix) :
|
||||||
m_dict (dict)
|
m_dict (dict),
|
||||||
|
m_prefix (prefix)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -50,7 +52,7 @@ void CliKeySearchResult::onResult(const struct libeosio::ec_keypair* key, const
|
||||||
std::cout << "----" << std::endl;
|
std::cout << "----" << std::endl;
|
||||||
std::cout << "Found: " << pub.substr(result.pos, result.len) << std::endl;
|
std::cout << "Found: " << pub.substr(result.pos, result.len) << std::endl;
|
||||||
|
|
||||||
std::cout << "Public: EOS";
|
std::cout << "Public: " << m_prefix.substr(0, 3);
|
||||||
for(size_t i = 3; i < pub.length(); ) {
|
for(size_t i = 3; i < pub.length(); ) {
|
||||||
|
|
||||||
if (i == result.pos) {
|
if (i == result.pos) {
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
#ifndef EOSIOKEYGEN_KEY_SEARCH_HELPERS_H
|
#ifndef EOSIOKEYGEN_KEY_SEARCH_HELPERS_H
|
||||||
#define EOSIOKEYGEN_KEY_SEARCH_HELPERS_H
|
#define EOSIOKEYGEN_KEY_SEARCH_HELPERS_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
#include <libeosio/types.hpp>
|
#include <libeosio/types.hpp>
|
||||||
#include <eoskeygen/core/string.hpp>
|
#include <eoskeygen/core/string.hpp>
|
||||||
#include <eoskeygen/key_search.hpp>
|
#include <eoskeygen/key_search.hpp>
|
||||||
|
|
@ -36,13 +37,15 @@ class Dictionary;
|
||||||
class CliKeySearchResult : public IKeySearchResult
|
class CliKeySearchResult : public IKeySearchResult
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CliKeySearchResult(const Dictionary& dict);
|
CliKeySearchResult(const Dictionary& dict, const std::string& prefix);
|
||||||
|
|
||||||
virtual void onResult(const struct libeosio::ec_keypair* key, const struct KeySearch::result& result);
|
virtual void onResult(const struct libeosio::ec_keypair* key, const struct KeySearch::result& result);
|
||||||
|
|
||||||
protected :
|
protected :
|
||||||
|
|
||||||
const Dictionary& m_dict;
|
const Dictionary& m_dict;
|
||||||
|
|
||||||
|
std::string m_prefix;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace eoskeygen
|
} // namespace eoskeygen
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue