1
0
Fork 0
mirror of https://github.com/eosswedenorg/libantelope synced 2026-06-16 03:34:56 +02:00

include/libeosio/WIF.hpp: declare all WIF_ constant strings as extern and set them in WIF.cpp

This commit is contained in:
Henrik Hautakoski 2023-04-04 13:26:45 +02:00
parent 33d3440f53
commit 86d75df2ec
2 changed files with 11 additions and 5 deletions

View file

@ -32,11 +32,11 @@ namespace libeosio {
/**
* Key prefixes. (strings that is not equal to these prefixes are treated as legacy format.)
*/
const std::string WIF_PUB_LEG = "EOS";
const std::string WIF_PUB_K1 = "PUB_K1_";
const std::string WIF_PVT_LEG = "";
const std::string WIF_PVT_K1 = "PVT_K1_";
const std::string WIF_SIG_K1 = "SIG_K1_";
extern const std::string WIF_PUB_LEG;
extern const std::string WIF_PUB_K1;
extern const std::string WIF_PVT_LEG;
extern const std::string WIF_PVT_K1;
extern const std::string WIF_SIG_K1;
/**
* Encode an EC private key to WIF String.

View file

@ -30,6 +30,12 @@
namespace libeosio {
const std::string WIF_PUB_LEG = "EOS";
const std::string WIF_PUB_K1 = "PUB_K1_";
const std::string WIF_PVT_LEG = "";
const std::string WIF_PVT_K1 = "PVT_K1_";
const std::string WIF_SIG_K1 = "SIG_K1_";
std::string wif_priv_encode(const ec_privkey_t& priv, const std::string& prefix) {
checksum_t check;