Skip to content

Commit

Permalink
Merge branch 'release-0.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
fpelliccioni committed Jun 1, 2020
2 parents 336f335 + 4d9e3a7 commit f7608a4
Show file tree
Hide file tree
Showing 267 changed files with 1,462 additions and 2,551 deletions.
63 changes: 6 additions & 57 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,7 @@ if (ENABLE_SHARED)
endif()

set(knuth_infrastructure_sources_just_legacy
# src/machine/interpreter.cpp
src/machine/number.cpp #Fernando: commented for the moment...
# src/machine/opcode.cpp
# src/machine/operation.cpp
# src/machine/program.cpp

src/config/authority.cpp
src/config/base16.cpp
Expand All @@ -336,7 +332,6 @@ set(knuth_infrastructure_sources_just_legacy
src/config/hash160.cpp
src/config/hash256.cpp
src/config/parameter.cpp
# src/config/parser.cpp
src/config/printer.cpp
src/config/sodium.cpp

Expand All @@ -356,7 +351,7 @@ set(knuth_infrastructure_sources_just_legacy
src/math/secp256k1_initializer.cpp
src/math/secp256k1_initializer.hpp
src/math/sip_hash.cpp
# src/math/stealth.cpp #Depends on chain::script

src/math/external/aes256.h
src/math/external/crypto_scrypt.h
src/math/external/hmac_sha256.h
Expand Down Expand Up @@ -415,35 +410,12 @@ set(knuth_infrastructure_sources_just_legacy
src/utility/threadpool.cpp
src/utility/work.cpp

# src/wallet/bitcoin_uri.cpp #Depends on wallet::payment_address
src/wallet/dictionary.cpp
# src/wallet/ec_private.cpp #Depends on wallet::payment_address
# src/wallet/ec_public.cpp #Depends on wallet::payment_address
# src/wallet/ek_private.cpp #Depends on wallet::payment_address
# src/wallet/ek_public.cpp
# src/wallet/ek_token.cpp
# src/wallet/encrypted_keys.cpp
src/wallet/hd_private.cpp
src/wallet/hd_public.cpp
# src/wallet/message.cpp
src/wallet/mini_keys.cpp
src/wallet/mnemonic.cpp
# src/wallet/parse_encrypted_keys/parse_encrypted_key.hpp
# src/wallet/parse_encrypted_keys/parse_encrypted_key.ipp
# src/wallet/parse_encrypted_keys/parse_encrypted_prefix.hpp
# src/wallet/parse_encrypted_keys/parse_encrypted_prefix.ipp
# src/wallet/parse_encrypted_keys/parse_encrypted_private.cpp
# src/wallet/parse_encrypted_keys/parse_encrypted_private.hpp
# src/wallet/parse_encrypted_keys/parse_encrypted_public.cpp
# src/wallet/parse_encrypted_keys/parse_encrypted_public.hpp
# src/wallet/parse_encrypted_keys/parse_encrypted_token.cpp # #include <kth/infrastructure/chain/script.hpp>
# src/wallet/parse_encrypted_keys/parse_encrypted_token.hpp
# src/wallet/payment_address.cpp

# src/wallet/select_outputs.cpp # #include <kth/infrastructure/chain/points_value.hpp>
# src/wallet/stealth_address.cpp # #include <kth/infrastructure/chain/script.hpp>
# src/wallet/stealth_receiver.cpp # #include <kth/infrastructure/chain/script.hpp>
# src/wallet/stealth_sender.cpp # #include <kth/infrastructure/chain/script.hpp>

src/wallet/uri.cpp
)

Expand Down Expand Up @@ -519,7 +491,7 @@ target_include_directories(kth-infrastructure PUBLIC
$<INSTALL_INTERFACE:include>)

if (NOT ENABLE_SHARED)
target_compile_definitions(kth-infrastructure PUBLIC -DBI_STATIC) #TODO(fernando): manage with Conan????
target_compile_definitions(kth-infrastructure PUBLIC -DKI_STATIC) #TODO(fernando): manage with Conan????
endif()

target_compile_definitions(kth-infrastructure PUBLIC -DKTH_PROJECT_VERSION="${KTH_PROJECT_VERSION}") #TODO(fernando): manage with Conan????
Expand Down Expand Up @@ -612,17 +584,12 @@ if (WITH_TESTS)

test/main.cpp

# test/math/big_number.cpp
# test/math/big_number.hppcompact
test/math/checksum.cpp
test/math/elliptic_curve.cpp
test/math/hash.cpp
test/math/hash.hpp
# test/math/hash_number.cpp
# test/math/limits.cpp
# test/math/script_number.cpp
# test/math/script_number.hpp
# test/math/stealth.cpp

test/message/network_address.cpp

test/unicode/unicode.cpp
test/unicode/unicode_istream.cpp
Expand Down Expand Up @@ -728,7 +695,7 @@ _group_sources(knuth_infrastructure_test "${CMAKE_CURRENT_LIST_DIR}/test")
# merkle_block_tests
# message_tests
mnemonic_tests
# network_address_tests
network_address_tests
# not_found_tests
# output_tests
parameter_tests
Expand Down Expand Up @@ -819,10 +786,7 @@ set(_knuth_infrastructure_headers

kth/infrastructure/machine/interpreter.hpp
kth/infrastructure/machine/number.hpp
# kth/infrastructure/machine/opcode.hpp
# kth/infrastructure/machine/operation.hpp
kth/infrastructure/machine/program.hpp
# kth/infrastructure/machine/rule_fork.hpp
kth/infrastructure/machine/script_pattern.hpp
kth/infrastructure/machine/sighash_algorithm.hpp
kth/infrastructure/machine/script_version.hpp
Expand All @@ -838,7 +802,6 @@ set(_knuth_infrastructure_headers
kth/infrastructure/config/hash160.hpp
kth/infrastructure/config/hash256.hpp
kth/infrastructure/config/parameter.hpp
# kth/infrastructure/config/parser.hpp
kth/infrastructure/config/printer.hpp
kth/infrastructure/config/settings.hpp
kth/infrastructure/config/sodium.hpp
Expand Down Expand Up @@ -866,19 +829,15 @@ set(_knuth_infrastructure_headers

kth/infrastructure/impl/machine/interpreter.ipp
kth/infrastructure/impl/machine/number.ipp
# kth/infrastructure/impl/machine/operation.ipp
kth/infrastructure/impl/machine/program.ipp

kth/infrastructure/math/checksum.hpp
kth/infrastructure/math/crypto.hpp
kth/infrastructure/math/elliptic_curve.hpp
kth/infrastructure/math/hash.hpp
# kth/infrastructure/math/limits.hpp
kth/infrastructure/math/stealth.hpp
kth/infrastructure/math/uint256.hpp



kth/infrastructure/impl/utility/array_slice.ipp
kth/infrastructure/impl/utility/collection.ipp
kth/infrastructure/impl/utility/data.ipp
Expand Down Expand Up @@ -950,8 +909,6 @@ set(_knuth_infrastructure_headers
kth/infrastructure/utility/work.hpp
kth/infrastructure/utility/writer.hpp

# kth/infrastructure/wallet/bitcoin_uri.hpp

kth/infrastructure/wallet/cashaddr.hpp

kth/infrastructure/wallet/dictionary.hpp
Expand All @@ -963,18 +920,10 @@ set(_knuth_infrastructure_headers
kth/infrastructure/wallet/encrypted_keys.hpp
kth/infrastructure/wallet/hd_private.hpp
kth/infrastructure/wallet/hd_public.hpp
# kth/infrastructure/wallet/message.hpp
kth/infrastructure/wallet/mini_keys.hpp
kth/infrastructure/wallet/mnemonic.hpp
# kth/infrastructure/wallet/payment_address.hpp
kth/infrastructure/wallet/qrcode.hpp
# kth/infrastructure/wallet/select_outputs.hpp
# kth/infrastructure/wallet/stealth_address.hpp
# kth/infrastructure/wallet/stealth_receiver.hpp
# kth/infrastructure/wallet/stealth_sender.hpp
kth/infrastructure/wallet/uri.hpp
# kth/infrastructure/wallet/uri_reader.hpp
# kth/infrastructure/wallet/transaction_functions.hpp

kth/infrastructure.hpp
)
Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ def package_info(self):
self.cpp_info.libs.append("wsock32")

if not self.is_shared:
self.cpp_info.defines.append("BI_STATIC")
self.cpp_info.defines.append("KI_STATIC")
35 changes: 18 additions & 17 deletions examples/main.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
// Copyright (c) 2016-2020 Knuth Project developers.
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <cstdlib>
#include <string>
#include <kth/infrastructure.hpp>

KTH_USE_MAIN

int bc::main(int argc, char* argv[]) {
int kth::main(int argc, char* argv[]) {
return 0;
}

// int bc::main(int argc, char* argv[]) {
// int kth::main(int argc, char* argv[]) {

// data_chunk out;
// data_sink ostream(out);
Expand Down Expand Up @@ -137,12 +138,12 @@ int bc::main(int argc, char* argv[]) {
// }


// int bc::main(int argc, char* argv[])
// int kth::main(int argc, char* argv[])
// {
// bc::wallet::payment_address const address1("1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu"); // Legacy Address Format
// //bc::wallet::payment_address const address2("bitcoincash:qpzry9x8gf2tvdw0s3jn54khce6mua7lcw20ayyn"); // CashAddrFormat Invalid
// //bc::wallet::payment_address const address2("bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a"); // CashAddrFormat
// bc::wallet::payment_address const address2("bitcoincash:ppm2qsznhks23z7629mms6s4cwef74vcwvn0h829pq"); // CashAddrFormat
// kth::infrastructure::wallet::payment_address const address1("1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu"); // Legacy Address Format
// //kth::infrastructure::wallet::payment_address const address2("bitcoincash:qpzry9x8gf2tvdw0s3jn54khce6mua7lcw20ayyn"); // CashAddrFormat Invalid
// //kth::infrastructure::wallet::payment_address const address2("bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a"); // CashAddrFormat
// kth::infrastructure::wallet::payment_address const address2("bitcoincash:ppm2qsznhks23z7629mms6s4cwef74vcwvn0h829pq"); // CashAddrFormat



Expand All @@ -157,34 +158,34 @@ int bc::main(int argc, char* argv[]) {
// }

//// Testing out our http://utf8everywhere.org implementation.
//int bc::main(int argc, char* argv[])
//int kth::main(int argc, char* argv[])
//{
// // Windows utf8 everywhere demonstration.
// set_utf8_stdio();
//
// bc::cout << "output : acción.кошка.日本国" << std::endl;
// bc::cerr << "error : acción.кошка.日本国" << std::endl;
// kth::cout << "output : acción.кошка.日本国" << std::endl;
// kth::cerr << "error : acción.кошка.日本国" << std::endl;
//
// bc::cout << "Enter text to input..." << std::endl;
// kth::cout << "Enter text to input..." << std::endl;
// std::string console;
// bc::cin >> console;
// bc::cout << "input[0] : " << console << std::endl;
// kth::cin >> console;
// kth::cout << "input[0] : " << console << std::endl;
//
// if (argc > 1)
// bc::cout << "argv[1] : " << argv[1] << std::endl;
// kth::cout << "argv[1] : " << argv[1] << std::endl;
//
//#ifdef _MSC_VER
// if (environ[0] != nullptr)
// bc::cout << "environ[0] : " << environ[0] << std::endl;
// kth::cout << "environ[0] : " << environ[0] << std::endl;
//#endif
//
// // Extracting Satoshi's words.
// auto const block = bc::chain::block::genesis_mainnet();
// auto const block = kth::chain::block::genesis_mainnet();
// auto const& tx = block.transactions().front();
// auto const& input = tx.inputs().front();
// auto const script = input.script().to_data(false);
// std::string message(script.begin() + sizeof(uint64_t), script.end());
// bc::cout << message << std::endl;
// kth::cout << message << std::endl;
//
// return EXIT_SUCCESS;
//}
6 changes: 1 addition & 5 deletions include/kth/infrastructure.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) 2016-2020 Knuth Project developers.
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef KTH_INFRASTRUCTURE_INFRASTRUCTURE_HPP_
#define KTH_INFRASTRUCTURE_INFRASTRUCTURE_HPP_

Expand Down Expand Up @@ -61,12 +62,7 @@
#include <kth/infrastructure/log/features/timer.hpp>
#endif // defined(KTH_LOG_LIBRARY_BOOST)

// #include <kth/infrastructure/machine/interpreter.hpp>
#include <kth/infrastructure/machine/number.hpp>
// #include <kth/infrastructure/machine/opcode.hpp>
// #include <kth/infrastructure/machine/operation.hpp>
// #include <kth/infrastructure/machine/program.hpp>
// #include <kth/infrastructure/machine/rule_fork.hpp>
#include <kth/infrastructure/machine/script_pattern.hpp>
#include <kth/infrastructure/machine/script_version.hpp>
#include <kth/infrastructure/machine/sighash_algorithm.hpp>
Expand Down
5 changes: 3 additions & 2 deletions include/kth/infrastructure/compat.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) 2016-2020 Knuth Project developers.
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef KTH_INFRASTRUCTURE_COMPAT_H
#define KTH_INFRASTRUCTURE_COMPAT_H

Expand All @@ -13,9 +14,9 @@
#endif

#ifdef _MSC_VER
#define BI_C_INLINE __inline
#define KI_C_INLINE __inline
#else
#define BI_C_INLINE inline
#define KI_C_INLINE inline
#endif

#endif
1 change: 1 addition & 0 deletions include/kth/infrastructure/compat.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) 2016-2020 Knuth Project developers.
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef KTH_INFRASTRUCTURE_COMPAT_HPP
#define KTH_INFRASTRUCTURE_COMPAT_HPP

Expand Down
7 changes: 4 additions & 3 deletions include/kth/infrastructure/config/authority.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) 2016-2020 Knuth Project developers.
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef KTH_INFRASTUCTURE_CONFIG_AUTHORITY_HPP
#define KTH_INFRASTUCTURE_CONFIG_AUTHORITY_HPP

Expand All @@ -13,13 +14,13 @@
#include <kth/infrastructure/message/network_address.hpp>
#include <kth/infrastructure/utility/asio.hpp>

namespace kth::config {
namespace kth::infrastructure::config {

/**
* Serialization helper for a network authority.
* This is a container for a {ip address, port} tuple.
*/
class BI_API authority {
class KI_API authority {
public:
/**
* A list of authorities.
Expand Down Expand Up @@ -165,6 +166,6 @@ class BI_API authority {
uint16_t port_{0};
};

} // namespace kth::config
} // namespace kth::infrastructure::config

#endif
9 changes: 4 additions & 5 deletions include/kth/infrastructure/config/base16.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) 2016-2020 Knuth Project developers.
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef KTH_INFRASTUCTURE_CONFIG_BASE16_HPP
#define KTH_INFRASTUCTURE_CONFIG_BASE16_HPP

Expand All @@ -12,14 +13,13 @@
#include <kth/infrastructure/define.hpp>
#include <kth/infrastructure/utility/data.hpp>

namespace kth {
namespace config {
namespace kth::infrastructure::config {

/**
* Serialization helper for base16 encoded data.
*/
//TODO(fernando): make a generic class for baseX
class BI_API base16 {
class KI_API base16 {
public:

base16() = default;
Expand Down Expand Up @@ -83,7 +83,6 @@ class BI_API base16 {
data_chunk value_;
};

} // namespace config
} // namespace kth
} // namespace kth::infrastructure::config

#endif
Loading

0 comments on commit f7608a4

Please sign in to comment.