1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-07-04 12:03:41 +02:00

gui/src/GenerateWindow.cpp: Check Settings::shouldGenerateFioKeys() if we should use "FIO" or "EOS" prefix.

This commit is contained in:
Henrik Hautakoski 2021-05-07 13:38:32 +02:00
parent 8c9047d716
commit 6bd84b1d8d

View file

@ -28,6 +28,7 @@
#include <QGuiApplication> #include <QGuiApplication>
#include <libeosio/ec.hpp> #include <libeosio/ec.hpp>
#include <libeosio/WIF.hpp> #include <libeosio/WIF.hpp>
#include "Settings.hpp"
#include "GenerateWindow.hpp" #include "GenerateWindow.hpp"
void _initKeyWidget(QLineEdit& w) { void _initKeyWidget(QLineEdit& w) {
@ -91,12 +92,13 @@ m_btn_copy_both ("Copy keys")
void GenerateWindow::generate_key() void GenerateWindow::generate_key()
{ {
std::string pubstr, privstr; std::string pubstr;
struct libeosio::ec_keypair pair; struct libeosio::ec_keypair pair;
libeosio::ec_generate_key(&pair); libeosio::ec_generate_key(&pair);
m_pub.setText(QString::fromStdString(libeosio::wif_pub_encode(pair.pub))); pubstr = libeosio::wif_pub_encode(pair.pub, Settings::shouldGenerateFioKeys() ? "FIO" : "EOS");
m_pub.setText(QString::fromStdString(pubstr));
m_priv.setText(QString::fromStdString(libeosio::wif_priv_encode(pair.secret))); m_priv.setText(QString::fromStdString(libeosio::wif_priv_encode(pair.secret)));
} }