Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix undefined symbol linker error by moving sign and secureHash t… #4084

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/Harmony/Signer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,6 @@ CollectRewards Signer::buildUnsignedCollectRewards(const Proto::SigningInput &in
return CollectRewards(delegatorAddr);
}

template <typename T>
void Signer::sign(const PrivateKey& privateKey, const Data& hash, T& transaction) const noexcept {
auto tuple = sign(chainID, privateKey, hash);
transaction.r = std::get<0>(tuple);
transaction.s = std::get<1>(tuple);
transaction.v = std::get<2>(tuple);
}

Data Signer::rlpNoHash(const Transaction& transaction, const bool include_vrs) const noexcept {
auto nonce = store(transaction.nonce);
auto gasPrice = store(transaction.gasPrice);
Expand Down
7 changes: 6 additions & 1 deletion src/Harmony/Signer.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ class Signer {

/// Signs the given transaction.
template <typename T>
void sign(const PrivateKey &privateKey, const Data &hash, T &transaction) const noexcept;
void sign(const PrivateKey &privateKey, const Data &hash, T &transaction) noexcept {
auto tuple = sign(chainID, privateKey, hash);
transaction.r = std::get<0>(tuple);
transaction.s = std::get<1>(tuple);
transaction.v = std::get<2>(tuple);
}

/// Signs a hash with the given private key for the given chain identifier.
///
Expand Down
5 changes: 0 additions & 5 deletions src/Waves/Address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@

namespace TW::Waves {

template <typename T>
Data Address::secureHash(const T &data) {
return Hash::keccak256(Hash::blake2b(data, 32));
}

bool Address::isValid(const Data& decoded) {
if (decoded.size() != Address::size) {
return false;
Expand Down
4 changes: 3 additions & 1 deletion src/Waves/Address.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ class Address : public Base58Address<26> {
static const signed char testnet = 'T';

template <typename T>
static Data secureHash(const T &data);
static Data secureHash(const T &data) {
return Hash::keccak256(Hash::blake2b(data, 32));
}

/// Determines whether a string makes a valid address.
static bool isValid(const std::string& string);
Expand Down
Loading