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

include/libeosio/WIF.hpp: pass wif_codec_t to wif_print_key() and make it default to K1.

This commit is contained in:
Henrik Hautakoski 2023-04-04 13:30:07 +02:00
parent 18f35c66b5
commit 2f56e8b43d
2 changed files with 4 additions and 4 deletions

View file

@ -78,7 +78,7 @@ bool wif_pub_decode(ec_pubkey_t& pub, const std::string& data);
/**
* Prints an EC keypair in WIF format to standard out.
*/
void wif_print_key(const struct ec_keypair *key, const std::string& prefix = WIF_PUB_LEG);
void wif_print_key(const struct ec_keypair *key, const wif_codec_t& codec = WIF_CODEC_K1);
/**
* Signatures

View file

@ -123,10 +123,10 @@ bool wif_pub_decode(ec_pubkey_t& pub, const std::string& data) {
return decoder(buf, pub);
}
void wif_print_key(const struct ec_keypair *key, const std::string& prefix) {
void wif_print_key(const struct ec_keypair *key, const wif_codec_t& codec) {
std::cout << "Public: " << wif_pub_encode(key->pub, prefix) << std::endl;
std::cout << "Private: " << wif_priv_encode(key->secret, prefix) << std::endl;
std::cout << "Public: " << wif_pub_encode(key->pub, codec.pub) << std::endl;
std::cout << "Private: " << wif_priv_encode(key->secret, codec.pvt) << std::endl;
}
bool wif_sig_decode(ec_signature_t& sig, const std::string& data) {