mirror of
https://github.com/eosswedenorg/libantelope
synced 2026-06-19 04:50:03 +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:
parent
18f35c66b5
commit
2f56e8b43d
2 changed files with 4 additions and 4 deletions
|
|
@ -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.
|
* 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
|
* Signatures
|
||||||
|
|
|
||||||
|
|
@ -123,10 +123,10 @@ bool wif_pub_decode(ec_pubkey_t& pub, const std::string& data) {
|
||||||
return decoder(buf, pub);
|
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 << "Public: " << wif_pub_encode(key->pub, codec.pub) << std::endl;
|
||||||
std::cout << "Private: " << wif_priv_encode(key->secret, prefix) << 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) {
|
bool wif_sig_decode(ec_signature_t& sig, const std::string& data) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue