Fix undefined symbol linker error by moving sign
and secureHash
t…
#4084
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Move template definitions to .h file
Description
Moved the definitions of template methods
Signer::sign
andAddress::secureHash
from.cpp
to.h
files to resolve linker errors due to missing template instantiations. This change ensures that the compiler has access to the full implementation of these templates in the translation units where they are used.Error was fixed:
Undefined symbols for architecture x86_64: "std::__1::vector<unsigned char, std::__1::allocator<unsigned char>> TW::Waves::Address::secureHash<std::__1::vector<unsigned char, std::__1::allocator<unsigned char>>>(std::__1::vector<unsigned char, std::__1::allocator<unsigned char>> const&)", referenced from: TW::Waves::tests::WavesAddress_SecureHash_Test::TestBody() in AddressTests.cpp.o "void TW::Harmony::Signer::sign<TW::Harmony::Transaction>(TW::PrivateKey const&, std::__1::vector<unsigned char, std::__1::allocator<unsigned char>> const&, TW::Harmony::Transaction&) const", referenced from: TW::Harmony::HarmonySigner_SignAssumeLocalNet_Test::TestBody() in SignerTests.cpp.o ld: symbol(s) not found for architecture x86_64 c++: error: linker command failed with exit code 1 (use -v to see invocation)
How to test
Signer::sign
andAddress::secureHash
.Types of changes
Checklist