Changeset View
Changeset View
Standalone View
Standalone View
src/util/message.cpp
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
uint256 MessageHash(const std::string &message) { | uint256 MessageHash(const std::string &message) { | ||||
CHashWriter hasher(SER_GETHASH, 0); | CHashWriter hasher(SER_GETHASH, 0); | ||||
hasher << MESSAGE_MAGIC << message; | hasher << MESSAGE_MAGIC << message; | ||||
return hasher.GetHash(); | return hasher.GetHash(); | ||||
} | } | ||||
std::string SigningResultString(const SigningResult res) { | |||||
switch (res) { | |||||
case SigningResult::OK: | |||||
return "No error"; | |||||
case SigningResult::PRIVATE_KEY_NOT_AVAILABLE: | |||||
return "Private key not available"; | |||||
case SigningResult::SIGNING_FAILED: | |||||
return "Sign failed"; | |||||
// no default case, so the compiler can warn about missing cases | |||||
} | |||||
assert(false); | |||||
} |