void unpack( const fc::value& v, fc::signature_t& s ) { try { auto ve = from_base58(fc::value_cast<fc::string>(v)); s = fc::raw::unpack<signature_t>(ve); } catch ( ... ) { wlog( "error unpacking signature" ); } }
void unpack( const fc::value& v, fc::private_key_t& s ) { try { auto ve = from_base58(fc::value_cast<fc::string>(v)); s = fc::raw::unpack<private_key_t>(ve); } catch ( ... ) { wlog( "error unpacking private_key" ); } }
bool p2sh_from_base58(bool *test_net, struct ripemd160 *p2sh, const char *base58, size_t len) { u8 version; if (!from_base58(&version, p2sh, base58, len)) return false; if (version == 196) *test_net = true; else if (version == 5) *test_net = false; else return false; return true; }
bool bitcoin_from_base58(bool *test_net, struct bitcoin_address *addr, const char *base58, size_t len) { u8 version; if (!from_base58(&version, &addr->addr, base58, len)) return false; if (version == 111) *test_net = true; else if (version == 0) *test_net = false; else return false; return true; }
bool ripemd_from_base58(u8 *version, struct ripemd160 *ripemd160, const char *base58) { return from_base58(version, ripemd160, base58, strlen(base58)); }