mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Naming changes and reintroducing key prefix to contract libraries. (#202)
This commit is contained in:
@@ -196,9 +196,8 @@ int main(int argc, char **argv)
|
||||
hplog::init();
|
||||
|
||||
LOG_INFO << "Hot Pocket " << util::HP_VERSION;
|
||||
LOG_INFO << "Role: "
|
||||
<< (conf::cfg.node.role == conf::ROLE::OBSERVER ? "Observer" : "Validator");
|
||||
LOG_INFO << "Public key: " << conf::cfg.node.pub_key_hex.substr(2); // Public key without 'ed' prefix.
|
||||
LOG_INFO << "Role: " << (conf::cfg.node.role == conf::ROLE::OBSERVER ? "Observer" : "Validator");
|
||||
LOG_INFO << "Public key: " << conf::cfg.node.pub_key_hex;
|
||||
LOG_INFO << "Contract: " << conf::cfg.contract.id << " (" << conf::cfg.contract.version << ")";
|
||||
|
||||
if (ledger::init() == -1 ||
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace msg::controlmsg::json
|
||||
|
||||
for (const auto &v : d[field_name].array_range())
|
||||
{
|
||||
std::string hex_pubkey = "ed" + v.as<std::string>();
|
||||
std::string_view hex_pubkey = v.as<std::string_view>();
|
||||
std::string bin_pubkey;
|
||||
bin_pubkey.resize(crypto::PFXD_PUBKEY_BYTES);
|
||||
if (util::hex2bin(
|
||||
|
||||
@@ -258,7 +258,7 @@ namespace sc
|
||||
|
||||
std::ostringstream os;
|
||||
os << "{\"version\":\"" << util::HP_VERSION
|
||||
<< "\",\"pubkey\":\"" << conf::cfg.node.pub_key_hex.substr(2)
|
||||
<< "\",\"pubkey\":\"" << conf::cfg.node.pub_key_hex
|
||||
<< "\",\"ts\":" << ctx.args.time
|
||||
<< ",\"readonly\":" << (ctx.args.readonly ? "true" : "false");
|
||||
|
||||
@@ -440,8 +440,8 @@ namespace sc
|
||||
std::string pubkeyhex;
|
||||
util::bin2hex(
|
||||
pubkeyhex,
|
||||
reinterpret_cast<const unsigned char *>(npl_msg.pubkey.data()) + 1, // Skip first byte for key type prefix.
|
||||
npl_msg.pubkey.length() - 1);
|
||||
reinterpret_cast<const unsigned char *>(npl_msg.pubkey.data()),
|
||||
npl_msg.pubkey.length());
|
||||
|
||||
// Writing the public key to the contract's fd (Skip first byte for key type prefix).
|
||||
if (write(writefd, pubkeyhex.data(), pubkeyhex.size()) == -1)
|
||||
|
||||
@@ -166,8 +166,8 @@ namespace unl
|
||||
std::string pubkeyhex;
|
||||
util::bin2hex(
|
||||
pubkeyhex,
|
||||
reinterpret_cast<const unsigned char *>(pk->data()) + 1,
|
||||
pk->length() - 1);
|
||||
reinterpret_cast<const unsigned char *>(pk->data()),
|
||||
pk->length());
|
||||
|
||||
os << "\"" << pubkeyhex << "\"";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user