├── secp256k1-zkp ├── obj │ └── .gitignore ├── autogen.sh ├── TODO ├── libsecp256k1.pc.in ├── .gitignore └── src │ ├── ecdh.h │ ├── java │ ├── org_bitcoin_NativeSecp256k1.h │ └── org_bitcoin_NativeSecp256k1.c │ ├── num_gmp.h │ ├── num_impl.h │ ├── scalar_8x32.h │ └── scalar_4x64.h ├── libraries ├── glua │ ├── language_server.md │ ├── language_server.cpp │ ├── init_debugger_info.db │ ├── lstate.cpp │ ├── ltable.cpp │ ├── lmathlib.cpp │ ├── lparser.cpp │ ├── ltablib.cpp │ ├── sample.bytes │ ├── lremote_debugger.cpp │ ├── lprefix.cpp │ ├── wrong_byte_code.bytes │ ├── ltype_checker_type_info.cpp │ ├── README.md │ ├── .gitignore │ ├── glua_astparser.cpp │ ├── glua_vm.cpp │ ├── glua_api_types.cpp │ ├── glua_loader.cpp │ └── ljsonrpclib.cpp ├── include │ ├── UnitTest++ │ │ ├── UnitTest++.h │ │ ├── TimeHelpers.h │ │ ├── TestSuite.h │ │ ├── ReportAssert.h │ │ ├── RequireMacros.h │ │ ├── CurrentTest.h │ │ ├── Posix │ │ │ └── TimeHelpers.h │ │ ├── AssertException.h │ │ ├── RequiredCheckException.h │ │ ├── UnitTestPP.h │ │ ├── TestList.h │ │ ├── TestReporterStdout.h │ │ ├── TestReporter.h │ │ ├── ExceptionMacros.h │ │ ├── Test.h │ │ ├── TestDetails.h │ │ ├── RequiredCheckTestReporter.h │ │ ├── Win32 │ │ │ └── TimeHelpers.h │ │ └── ThrowingTestReporter.h │ ├── glua │ │ ├── lobject.h │ │ ├── glua_astparser.h │ │ ├── glua_debug_file.h │ │ ├── glua_tokenparser.h │ │ ├── lremote_debugger.h │ │ ├── glua_api_types.h │ │ ├── ltype_checker_type_info.h │ │ ├── lua.hpp │ │ ├── lrepl.h │ │ ├── glua_parser.h │ │ ├── glua_common.h │ │ ├── glua_vm.h │ │ ├── glua_disassemble.h │ │ ├── glua_compat.h │ │ ├── glua_loader.h │ │ ├── tichainlib.h │ │ ├── lundump.h │ │ └── lcompile.h │ ├── blockchain │ │ ├── Address.hpp │ │ ├── Exceptions.hpp │ │ ├── Transaction.hpp │ │ ├── ContractOperations.hpp │ │ ├── TransactionEvaluationState.hpp │ │ ├── api_extern.hpp │ │ ├── GenesisJson.hpp │ │ ├── SlateOperations.hpp │ │ ├── ImessageOperations.hpp │ │ ├── Checkpoints.hpp │ │ └── TransactionOperations.hpp │ ├── wallet │ │ ├── WalletImpl.hpp │ │ ├── WalletEntrys.hpp │ │ ├── Url.hpp │ │ ├── url.hpp.in │ │ └── Config.hpp │ ├── contract_engine │ │ ├── contract_engine.hpp │ │ └── contract_engine_builder.hpp │ ├── utilities │ │ ├── Words.hpp │ │ ├── StringEscape.hpp │ │ ├── GitRevision.hpp │ │ ├── CommonApi.hpp │ │ └── KeyConversion.hpp │ ├── client │ │ └── build_info.hpp.in │ ├── db │ │ ├── Fwd.hpp │ │ └── Exception.hpp │ ├── rpc │ │ ├── Exceptions.hpp │ │ └── RpcClientApi.hpp │ ├── api │ │ └── ConversionFunctions.hpp │ └── net │ │ ├── Upnp.hpp │ │ └── ChainServerCommands.hpp ├── fc │ ├── include │ │ └── fc │ │ │ ├── vector.hpp │ │ │ ├── any.hpp │ │ │ ├── compress │ │ │ ├── zlib.hpp │ │ │ ├── smaz.hpp │ │ │ └── lzma.hpp │ │ │ ├── network │ │ │ ├── resolve.hpp │ │ │ ├── ntp.hpp │ │ │ └── tcp_socket_io_hooks.hpp │ │ │ ├── git_revision.hpp │ │ │ ├── interprocess │ │ │ └── signals.hpp │ │ │ ├── crypto │ │ │ ├── rand.hpp │ │ │ ├── base32.hpp │ │ │ ├── base36.hpp │ │ │ ├── salsa20.hpp │ │ │ ├── scrypt.hpp │ │ │ ├── digest.hpp │ │ │ ├── base58.hpp │ │ │ ├── hex.hpp │ │ │ ├── base64.hpp │ │ │ └── dh.hpp │ │ │ ├── io │ │ │ ├── console.hpp │ │ │ └── raw_unpack_file.hpp │ │ │ ├── vector_fwd.hpp │ │ │ ├── thread │ │ │ ├── scoped_lock.hpp │ │ │ └── priority.hpp │ │ │ ├── noncopyable.hpp │ │ │ ├── aligned.hpp │ │ │ ├── container │ │ │ ├── deque_fwd.hpp │ │ │ └── flat_fwd.hpp │ │ │ ├── platform_independence.hpp │ │ │ ├── wait_any.hpp │ │ │ ├── utf8.hpp │ │ │ └── log │ │ │ └── gelf_appender.hpp │ ├── tests │ │ ├── rpc.cpp │ │ ├── ecc_test.interop.data │ │ ├── sleep.cpp │ │ ├── lzma_test.cpp │ │ └── compress.cpp │ ├── vendor │ │ ├── cyoencode-1.0.2 │ │ │ └── src │ │ │ │ └── build.sh │ │ ├── easylzma │ │ │ └── src │ │ │ │ ├── README │ │ │ │ ├── pavlov │ │ │ │ ├── 7zVersion.h │ │ │ │ ├── 7zCrc.h │ │ │ │ ├── 7zBuf.c │ │ │ │ ├── Alloc.h │ │ │ │ ├── 7zBuf.h │ │ │ │ ├── Bcj2.h │ │ │ │ └── 7zCrc.c │ │ │ │ ├── lzma_header.h │ │ │ │ └── lzip_header.h │ │ ├── scrypt-jane │ │ │ ├── example.c │ │ │ ├── CMakeLists.txt │ │ │ ├── scrypt-jane-test.c │ │ │ ├── code │ │ │ │ └── scrypt-conf.h │ │ │ └── test-speed.sh │ │ ├── udt4 │ │ │ └── CMakeLists.txt │ │ └── boost_1.51 │ │ │ ├── include │ │ │ └── boost │ │ │ │ └── process.hpp │ │ │ └── libs │ │ │ └── context │ │ │ └── fcontext.cpp │ ├── .gitmodules │ ├── src │ │ ├── byteswap.hpp │ │ ├── io │ │ │ ├── datastream.cpp │ │ │ └── varint.cpp │ │ ├── git_revision.cpp.in │ │ ├── utf8 │ │ │ └── ReleaseNotes │ │ ├── compress │ │ │ └── zlib.cpp │ │ ├── thread │ │ │ └── non_preemptable_scope_check.cpp │ │ ├── crypto │ │ │ ├── _elliptic_impl_priv.hpp │ │ │ ├── salsa20.cpp │ │ │ ├── rand.cpp │ │ │ ├── scrypt.cpp │ │ │ └── base32.cpp │ │ ├── interprocess │ │ │ └── signals.cpp │ │ ├── network │ │ │ └── resolve.cpp │ │ ├── utf8.cpp │ │ └── shared_ptr.cpp │ ├── .gitignore │ ├── ntp_test.cpp │ └── README.md ├── rpc │ └── RpcServer.cpp ├── wallet │ ├── Wallet.cpp │ ├── WalletDb.cpp │ └── TransactionLedger.cpp ├── blockchain │ ├── Transaction.cpp │ ├── ChainDatabase.cpp │ ├── ChainInterface.cpp │ ├── tichain_lua_api.cpp │ ├── StorageOperations.cpp │ ├── ContractOperations.cpp │ ├── TransactionEvaluationState.cpp │ ├── TransactionOperations.cpp │ └── ImessageOperations.cpp ├── contract_engine │ ├── glua_contract_engine.cpp │ └── contract_engine.cpp ├── access.glua ├── leveldb │ ├── .gitignore │ ├── AUTHORS │ ├── util │ │ ├── filter_policy.cc │ │ ├── hash.h │ │ └── options.cc │ ├── port │ │ ├── README │ │ ├── port.h │ │ └── win │ │ │ └── stdint.h │ ├── NEWS │ ├── TODO │ ├── helpers │ │ └── memenv │ │ │ └── memenv.h │ └── db │ │ └── db_iter.h ├── TiApp │ └── App.py ├── client │ ├── Messages.cpp │ └── DebugApi.cpp ├── utilities │ └── GitRevision.cpp └── api │ └── ConversionFunctions.cpp ├── fc ├── include │ └── fc │ │ ├── vector.hpp │ │ ├── any.hpp │ │ ├── compress │ │ ├── zlib.hpp │ │ ├── smaz.hpp │ │ └── lzma.hpp │ │ ├── network │ │ ├── resolve.hpp │ │ ├── ntp.hpp │ │ └── tcp_socket_io_hooks.hpp │ │ ├── git_revision.hpp │ │ ├── interprocess │ │ └── signals.hpp │ │ ├── crypto │ │ ├── rand.hpp │ │ ├── base32.hpp │ │ ├── base36.hpp │ │ ├── salsa20.hpp │ │ ├── scrypt.hpp │ │ ├── digest.hpp │ │ ├── base58.hpp │ │ ├── hex.hpp │ │ ├── base64.hpp │ │ └── dh.hpp │ │ ├── io │ │ ├── console.hpp │ │ └── raw_unpack_file.hpp │ │ ├── vector_fwd.hpp │ │ ├── thread │ │ ├── scoped_lock.hpp │ │ └── priority.hpp │ │ ├── noncopyable.hpp │ │ ├── aligned.hpp │ │ ├── container │ │ ├── deque_fwd.hpp │ │ └── flat_fwd.hpp │ │ ├── platform_independence.hpp │ │ ├── wait_any.hpp │ │ ├── utf8.hpp │ │ └── log │ │ └── gelf_appender.hpp ├── tests │ ├── rpc.cpp │ ├── ecc_test.interop.data │ ├── sleep.cpp │ ├── lzma_test.cpp │ └── compress.cpp ├── vendor │ ├── cyoencode-1.0.2 │ │ └── src │ │ │ └── build.sh │ ├── websocketpp │ │ ├── websocketpp │ │ │ └── CMakeLists.txt │ │ ├── examples │ │ │ ├── CMakeLists.txt │ │ │ ├── debug_server │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── SConscript │ │ │ ├── echo_server │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── SConscript │ │ │ ├── print_server │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── print_server.cpp │ │ │ │ └── SConscript │ │ │ ├── sip_client │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── README.txt │ │ │ │ └── SConscript │ │ │ ├── telemetry_client │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── SConscript │ │ │ ├── telemetry_server │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── SConscript │ │ │ ├── testee_client │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── SConscript │ │ │ ├── utility_client │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── SConscript │ │ │ ├── echo_server_tls │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── SConscript │ │ │ ├── echo_server_both │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── SConscript │ │ │ ├── dev │ │ │ │ └── SConscript │ │ │ ├── testee_server │ │ │ │ └── SConscript │ │ │ ├── iostream_server │ │ │ │ └── SConscript │ │ │ ├── broadcast_server │ │ │ │ └── SConscript │ │ │ ├── subprotocol_server │ │ │ │ └── SConscript │ │ │ └── debug_client │ │ │ │ └── SConscript │ │ ├── tutorials │ │ │ ├── chat_tutorial │ │ │ │ └── chat_tutorial.md │ │ │ └── broadcast_tutorial │ │ │ │ └── broadcast_tutorial.md │ │ ├── websocketpp-config.cmake.in │ │ ├── websocketpp-configVersion.cmake.in │ │ ├── .travis.yml │ │ ├── .gitattributes │ │ └── test │ │ │ ├── http │ │ │ └── SConscript │ │ │ ├── logger │ │ │ └── SConscript │ │ │ └── endpoint │ │ │ └── SConscript │ ├── easylzma │ │ └── src │ │ │ ├── README │ │ │ ├── pavlov │ │ │ ├── 7zVersion.h │ │ │ ├── 7zCrc.h │ │ │ ├── 7zBuf.c │ │ │ ├── Alloc.h │ │ │ ├── 7zBuf.h │ │ │ ├── Bcj2.h │ │ │ └── 7zCrc.c │ │ │ ├── lzma_header.h │ │ │ └── lzip_header.h │ ├── scrypt-jane │ │ ├── example.c │ │ ├── CMakeLists.txt │ │ ├── scrypt-jane-test.c │ │ ├── code │ │ │ └── scrypt-conf.h │ │ └── test-speed.sh │ ├── udt4 │ │ └── CMakeLists.txt │ └── boost_1.51 │ │ ├── include │ │ └── boost │ │ │ └── process.hpp │ │ └── libs │ │ └── context │ │ └── fcontext.cpp ├── .gitmodules ├── src │ ├── byteswap.hpp │ ├── io │ │ ├── datastream.cpp │ │ └── varint.cpp │ ├── git_revision.cpp.in │ ├── utf8 │ │ └── ReleaseNotes │ ├── compress │ │ └── zlib.cpp │ ├── thread │ │ └── non_preemptable_scope_check.cpp │ ├── crypto │ │ ├── _elliptic_impl_priv.hpp │ │ ├── salsa20.cpp │ │ ├── rand.cpp │ │ ├── scrypt.cpp │ │ └── base32.cpp │ ├── interprocess │ │ └── signals.cpp │ ├── network │ │ └── resolve.cpp │ ├── utf8.cpp │ └── shared_ptr.cpp ├── .gitignore ├── ntp_test.cpp └── README.md ├── windows └── Ti_Value.v12.suo ├── whitepaper ├── White paper of TV V2.0.pdf └── White paper of TV CH V2.0.pdf ├── leveldb ├── .gitignore ├── AUTHORS ├── util │ ├── filter_policy.cc │ ├── hash.h │ └── options.cc ├── port │ ├── README │ ├── port.h │ └── win │ │ └── stdint.h ├── NEWS ├── TODO ├── helpers │ └── memenv │ │ └── memenv.h ├── db │ └── db_iter.h └── table │ └── merger.h ├── utilities ├── include │ └── bts │ │ └── utilities │ │ ├── words.hpp │ │ ├── string_escape.hpp │ │ ├── git_revision.hpp │ │ └── key_conversion.hpp └── git_revision.cpp.in ├── miniupnpc ├── miniupnpcstrings.h ├── miniupnpcstrings.h.cmake ├── declspec.h ├── minissdpc.h ├── minisoap.h ├── connecthostport.h ├── miniupnpctypes.h ├── upnperrors.h ├── receivedata.h └── miniwget.h ├── db ├── CMakeLists.txt └── include │ └── bts │ └── db │ └── exception.hpp └── .gitignore /secp256k1-zkp/obj/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libraries/glua/language_server.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libraries/glua/language_server.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fc/include/fc/vector.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/UnitTest++.h: -------------------------------------------------------------------------------- 1 | #include "UnitTestPP.h" -------------------------------------------------------------------------------- /libraries/fc/include/fc/vector.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | -------------------------------------------------------------------------------- /secp256k1-zkp/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | autoreconf -if --warnings=all 4 | -------------------------------------------------------------------------------- /fc/tests/rpc.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | int main( int argc, char** argv ) 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /fc/vendor/cyoencode-1.0.2/src/build.sh: -------------------------------------------------------------------------------- 1 | gcc test.c CyoEncode.c CyoDecode.c -o test 2 | 3 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/websocketpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | init_target("websocketpp") 2 | final_target () 3 | -------------------------------------------------------------------------------- /libraries/fc/tests/rpc.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | int main( int argc, char** argv ) 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /libraries/fc/vendor/cyoencode-1.0.2/src/build.sh: -------------------------------------------------------------------------------- 1 | gcc test.c CyoEncode.c CyoDecode.c -o test 2 | 3 | -------------------------------------------------------------------------------- /libraries/glua/init_debugger_info.db: -------------------------------------------------------------------------------- 1 | add,@tests_typed/full_correct_typed.glua,14,17,20,22,25,30,50; 2 | -------------------------------------------------------------------------------- /libraries/glua/lstate.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/glua/lstate.cpp -------------------------------------------------------------------------------- /libraries/glua/ltable.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/glua/ltable.cpp -------------------------------------------------------------------------------- /windows/Ti_Value.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/windows/Ti_Value.v12.suo -------------------------------------------------------------------------------- /libraries/glua/lmathlib.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/glua/lmathlib.cpp -------------------------------------------------------------------------------- /libraries/glua/lparser.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/glua/lparser.cpp -------------------------------------------------------------------------------- /libraries/glua/ltablib.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/glua/ltablib.cpp -------------------------------------------------------------------------------- /libraries/glua/sample.bytes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/glua/sample.bytes -------------------------------------------------------------------------------- /libraries/rpc/RpcServer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/rpc/RpcServer.cpp -------------------------------------------------------------------------------- /libraries/wallet/Wallet.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/wallet/Wallet.cpp -------------------------------------------------------------------------------- /fc/tests/ecc_test.interop.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/fc/tests/ecc_test.interop.data -------------------------------------------------------------------------------- /libraries/wallet/WalletDb.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/wallet/WalletDb.cpp -------------------------------------------------------------------------------- /libraries/include/glua/lobject.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/include/glua/lobject.h -------------------------------------------------------------------------------- /libraries/glua/lremote_debugger.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/glua/lremote_debugger.cpp -------------------------------------------------------------------------------- /fc/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vendor/websocketpp"] 2 | path = vendor/websocketpp 3 | url = https://github.com/zaphoyd/websocketpp 4 | -------------------------------------------------------------------------------- /libraries/blockchain/Transaction.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/blockchain/Transaction.cpp -------------------------------------------------------------------------------- /libraries/glua/lprefix.cpp: -------------------------------------------------------------------------------- 1 | #define lprefix_cpp 2 | 3 | #include "glua/lprefix.h" 4 | #include 5 | #include 6 | -------------------------------------------------------------------------------- /libraries/glua/wrong_byte_code.bytes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/glua/wrong_byte_code.bytes -------------------------------------------------------------------------------- /whitepaper/White paper of TV V2.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/whitepaper/White paper of TV V2.0.pdf -------------------------------------------------------------------------------- /libraries/blockchain/ChainDatabase.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/blockchain/ChainDatabase.cpp -------------------------------------------------------------------------------- /libraries/blockchain/ChainInterface.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/blockchain/ChainInterface.cpp -------------------------------------------------------------------------------- /libraries/blockchain/tichain_lua_api.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/blockchain/tichain_lua_api.cpp -------------------------------------------------------------------------------- /libraries/fc/tests/ecc_test.interop.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/fc/tests/ecc_test.interop.data -------------------------------------------------------------------------------- /libraries/include/blockchain/Address.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/include/blockchain/Address.hpp -------------------------------------------------------------------------------- /libraries/include/glua/glua_astparser.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/include/glua/glua_astparser.h -------------------------------------------------------------------------------- /libraries/include/glua/glua_debug_file.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/include/glua/glua_debug_file.h -------------------------------------------------------------------------------- /libraries/include/wallet/WalletImpl.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/include/wallet/WalletImpl.hpp -------------------------------------------------------------------------------- /libraries/wallet/TransactionLedger.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/wallet/TransactionLedger.cpp -------------------------------------------------------------------------------- /whitepaper/White paper of TV CH V2.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/whitepaper/White paper of TV CH V2.0.pdf -------------------------------------------------------------------------------- /libraries/blockchain/StorageOperations.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/blockchain/StorageOperations.cpp -------------------------------------------------------------------------------- /libraries/fc/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vendor/websocketpp"] 2 | path = vendor/websocketpp 3 | url = https://github.com/zaphoyd/websocketpp 4 | -------------------------------------------------------------------------------- /libraries/glua/ltype_checker_type_info.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/glua/ltype_checker_type_info.cpp -------------------------------------------------------------------------------- /libraries/include/glua/glua_tokenparser.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/include/glua/glua_tokenparser.h -------------------------------------------------------------------------------- /libraries/include/glua/lremote_debugger.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/include/glua/lremote_debugger.h -------------------------------------------------------------------------------- /libraries/include/wallet/WalletEntrys.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/include/wallet/WalletEntrys.hpp -------------------------------------------------------------------------------- /libraries/blockchain/ContractOperations.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/blockchain/ContractOperations.cpp -------------------------------------------------------------------------------- /libraries/include/blockchain/Exceptions.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/include/blockchain/Exceptions.hpp -------------------------------------------------------------------------------- /libraries/include/blockchain/Transaction.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/include/blockchain/Transaction.hpp -------------------------------------------------------------------------------- /libraries/include/glua/glua_api_types.h: -------------------------------------------------------------------------------- 1 | #ifndef glua_api_types_h 2 | #define glua_api_types_h 3 | 4 | #include 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /libraries/contract_engine/glua_contract_engine.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/contract_engine/glua_contract_engine.cpp -------------------------------------------------------------------------------- /libraries/include/glua/ltype_checker_type_info.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/include/glua/ltype_checker_type_info.h -------------------------------------------------------------------------------- /libraries/blockchain/TransactionEvaluationState.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/blockchain/TransactionEvaluationState.cpp -------------------------------------------------------------------------------- /libraries/include/blockchain/ContractOperations.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/include/blockchain/ContractOperations.hpp -------------------------------------------------------------------------------- /libraries/access.glua: -------------------------------------------------------------------------------- 1 | type Storage = {} 2 | var M = Contract() 3 | function M:init() 4 | end 5 | function M:GetAccess() 6 | return true 7 | end 8 | return M -------------------------------------------------------------------------------- /libraries/include/contract_engine/contract_engine.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/include/contract_engine/contract_engine.hpp -------------------------------------------------------------------------------- /fc/include/fc/any.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | // TODO: define this without using boost 6 | typedef boost::any any; 7 | } 8 | -------------------------------------------------------------------------------- /libraries/include/blockchain/TransactionEvaluationState.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tivalueproject/TiValue/HEAD/libraries/include/blockchain/TransactionEvaluationState.hpp -------------------------------------------------------------------------------- /libraries/fc/include/fc/any.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | // TODO: define this without using boost 6 | typedef boost::any any; 7 | } 8 | -------------------------------------------------------------------------------- /libraries/include/utilities/Words.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef const char* ConstCharRawPtr; 4 | extern const ConstCharRawPtr word_list[]; 5 | extern const uint32_t word_list_size; 6 | -------------------------------------------------------------------------------- /secp256k1-zkp/TODO: -------------------------------------------------------------------------------- 1 | * Unit tests for fieldelem/groupelem, including ones intended to 2 | trigger fieldelem's boundary cases. 3 | * Complete constant-time operations for signing/keygen 4 | -------------------------------------------------------------------------------- /leveldb/.gitignore: -------------------------------------------------------------------------------- 1 | build_config.mk 2 | *.a 3 | *.o 4 | *.dylib* 5 | *.so 6 | *.so.* 7 | *_test 8 | db_bench 9 | leveldbutil 10 | Release 11 | Debug 12 | Benchmark 13 | vs2010.* 14 | -------------------------------------------------------------------------------- /utilities/include/bts/utilities/words.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef const char* const_char_ptr; 4 | extern const const_char_ptr word_list[]; 5 | extern const uint32_t word_list_size; 6 | -------------------------------------------------------------------------------- /fc/include/fc/compress/zlib.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace fc 6 | { 7 | 8 | string zlib_compress(const string& in); 9 | 10 | } // namespace fc 11 | -------------------------------------------------------------------------------- /libraries/glua/README.md: -------------------------------------------------------------------------------- 1 | glua 2 | ===== 3 | 4 | glua�����ں�������������lua5.3.2�����Բ����н϶����� 5 | 6 | 7 | # Dependencies 8 | 9 | * boost 1.55 10 | 11 | * 宏增加WIN32 12 | 13 | * 命令行考虑增加/W4 -------------------------------------------------------------------------------- /libraries/include/UnitTest++/TimeHelpers.h: -------------------------------------------------------------------------------- 1 | #include "Config.h" 2 | 3 | #if defined UNITTEST_POSIX 4 | #include "Posix/TimeHelpers.h" 5 | #else 6 | #include "Win32/TimeHelpers.h" 7 | #endif 8 | -------------------------------------------------------------------------------- /libraries/leveldb/.gitignore: -------------------------------------------------------------------------------- 1 | build_config.mk 2 | *.a 3 | *.o 4 | *.dylib* 5 | *.so 6 | *.so.* 7 | *_test 8 | db_bench 9 | leveldbutil 10 | Release 11 | Debug 12 | Benchmark 13 | vs2010.* 14 | -------------------------------------------------------------------------------- /miniupnpc/miniupnpcstrings.h: -------------------------------------------------------------------------------- 1 | #ifndef MINIUPNPCSTRINGS_H_INCLUDED 2 | #define MINIUPNPCSTRINGS_H_INCLUDED 3 | 4 | #define OS_STRING "Linux" 5 | #define MINIUPNPC_VERSION_STRING "1.7" 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /libraries/glua/.gitignore: -------------------------------------------------------------------------------- 1 | /x64 2 | /Debug 3 | /Release 4 | *~ 5 | *.out 6 | *.ldf 7 | /tmp_to_run 8 | /*.vcxproj 9 | /*.vcxproj.filters 10 | /*.vcxproj.user 11 | /*.sln 12 | /.vs 13 | /.vscode 14 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/compress/zlib.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace fc 6 | { 7 | 8 | string zlib_compress(const string& in); 9 | 10 | } // namespace fc 11 | -------------------------------------------------------------------------------- /libraries/include/wallet/Url.hpp: -------------------------------------------------------------------------------- 1 | /* This is an autogenerated file, based on url.hpp.in 2 | Do not edit url.hpp directly! Edit url.hpp.in */ 3 | 4 | #pragma once 5 | 6 | #define CUSTOM_URL_SCHEME "TiValue" 7 | -------------------------------------------------------------------------------- /libraries/include/blockchain/api_extern.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | namespace TiValue{ 4 | namespace client{ 5 | extern Client* g_client; 6 | extern bool g_client_quit; 7 | } 8 | } -------------------------------------------------------------------------------- /fc/vendor/easylzma/src/README: -------------------------------------------------------------------------------- 1 | pavlov/ - contains original lzma compress/decompress source from Igor Pavlov 2 | easylzma/ - contains the public api of this library 3 | ./ - contains the implementation of this wrapper library 4 | -------------------------------------------------------------------------------- /libraries/include/client/build_info.hpp.in: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #cmakedefine GOP_CLIENT_JENKINS_BUILD_NUMBER @GOP_CLIENT_JENKINS_BUILD_NUMBER@ 4 | #cmakedefine GOP_CLIENT_JENKINS_BUILD_URL "@GOP_CLIENT_JENKINS_BUILD_URL@" 5 | -------------------------------------------------------------------------------- /fc/include/fc/network/resolve.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc 6 | { 7 | std::vector resolve( const std::string& host, uint16_t port ); 8 | } 9 | -------------------------------------------------------------------------------- /libraries/include/wallet/url.hpp.in: -------------------------------------------------------------------------------- 1 | /* This is an autogenerated file, based on url.hpp.in 2 | Do not edit url.hpp directly! Edit url.hpp.in */ 3 | 4 | #pragma once 5 | 6 | #define CUSTOM_URL_SCHEME "@CUSTOM_URL_SCHEME@" 7 | -------------------------------------------------------------------------------- /libraries/fc/vendor/easylzma/src/README: -------------------------------------------------------------------------------- 1 | pavlov/ - contains original lzma compress/decompress source from Igor Pavlov 2 | easylzma/ - contains the public api of this library 3 | ./ - contains the implementation of this wrapper library 4 | -------------------------------------------------------------------------------- /fc/include/fc/git_revision.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | 6 | extern const char* const git_revision_sha; 7 | extern const uint32_t git_revision_unix_timestamp; 8 | 9 | } // end namespace fc 10 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/network/resolve.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc 6 | { 7 | std::vector resolve( const std::string& host, uint16_t port ); 8 | } 9 | -------------------------------------------------------------------------------- /miniupnpc/miniupnpcstrings.h.cmake: -------------------------------------------------------------------------------- 1 | #ifndef MINIUPNPCSTRINGS_H_INCLUDED 2 | #define MINIUPNPCSTRINGS_H_INCLUDED 3 | 4 | #define OS_STRING "${CMAKE_SYSTEM_NAME}" 5 | #define MINIUPNPC_VERSION_STRING "${MINIUPNPC_VERSION}" 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /db/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/bts/db/*.hpp") 2 | add_library( bts_db upgrade_leveldb.cpp ${HEADERS} ) 3 | target_link_libraries( bts_db fc leveldb ) 4 | target_include_directories( bts_db PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 5 | -------------------------------------------------------------------------------- /fc/include/fc/interprocess/signals.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc 5 | { 6 | /// handler will be called from ASIO thread 7 | void set_signal_handler( std::function handler, int signal_num ); 8 | } 9 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/git_revision.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | 6 | extern const char* const git_revision_sha; 7 | extern const uint32_t git_revision_unix_timestamp; 8 | 9 | } // end namespace fc 10 | -------------------------------------------------------------------------------- /libraries/contract_engine/contract_engine.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace blockchain 4 | { 5 | namespace contract_engine 6 | { 7 | ContractEngine::~ContractEngine() 8 | { 9 | 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /fc/include/fc/compress/smaz.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | 6 | std::string smaz_compress( const std::string& in ); 7 | std::string smaz_decompress( const std::string& compressed ); 8 | 9 | } // namespace fc 10 | -------------------------------------------------------------------------------- /fc/include/fc/crypto/rand.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace fc { 4 | 5 | /* provides access to the OpenSSL random number generator */ 6 | void rand_bytes(char* buf, int count); 7 | void rand_pseudo_bytes(char* buf, int count); 8 | } // namespace fc 9 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/interprocess/signals.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc 5 | { 6 | /// handler will be called from ASIO thread 7 | void set_signal_handler( std::function handler, int signal_num ); 8 | } 9 | -------------------------------------------------------------------------------- /fc/include/fc/io/console.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace fc 3 | { 4 | /** enables / disables echoing of console input, useful for 5 | * entering passwords on the console. 6 | */ 7 | void set_console_echo( bool enable_echo ); 8 | } // namespace fc 9 | -------------------------------------------------------------------------------- /fc/include/fc/vector_fwd.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _FC_VECTOR_FWD_HPP_ 2 | #define _FC_VECTOR_FWD_HPP_ 3 | #if 0 4 | #include 5 | #else 6 | namespace fc { 7 | template class vector; 8 | }; 9 | #endif 10 | 11 | #endif // _FC_VECTOR_FWD_HPP_ 12 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/compress/smaz.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | 6 | std::string smaz_compress( const std::string& in ); 7 | std::string smaz_decompress( const std::string& compressed ); 8 | 9 | } // namespace fc 10 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/rand.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace fc { 4 | 5 | /* provides access to the OpenSSL random number generator */ 6 | void rand_bytes(char* buf, int count); 7 | void rand_pseudo_bytes(char* buf, int count); 8 | } // namespace fc 9 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/TestSuite.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TESTSUITE_H 2 | #define UNITTEST_TESTSUITE_H 3 | 4 | namespace UnitTestSuite 5 | { 6 | inline char const* GetSuiteName () 7 | { 8 | return "DefaultSuite"; 9 | } 10 | } 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/io/console.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace fc 3 | { 4 | /** enables / disables echoing of console input, useful for 5 | * entering passwords on the console. 6 | */ 7 | void set_console_echo( bool enable_echo ); 8 | } // namespace fc 9 | -------------------------------------------------------------------------------- /libraries/glua/glua_astparser.cpp: -------------------------------------------------------------------------------- 1 | #include "glua/glua_astparser.h" 2 | #include "glua/lparser.h" 3 | #include "glua/lfunc.h" 4 | #include "glua/lobject.h" 5 | 6 | namespace glua { 7 | namespace parser { 8 | 9 | 10 | } // end of glua::parser 11 | } -------------------------------------------------------------------------------- /utilities/include/bts/utilities/string_escape.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace bts { namespace utilities { 6 | 7 | std::string escape_string_for_c_source_code(const std::string& input); 8 | 9 | } } // end namespace bts::utilities 10 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/vector_fwd.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _FC_VECTOR_FWD_HPP_ 2 | #define _FC_VECTOR_FWD_HPP_ 3 | #if 0 4 | #include 5 | #else 6 | namespace fc { 7 | template class vector; 8 | }; 9 | #endif 10 | 11 | #endif // _FC_VECTOR_FWD_HPP_ 12 | -------------------------------------------------------------------------------- /libraries/include/glua/lua.hpp: -------------------------------------------------------------------------------- 1 | // lua.hpp 2 | // Lua header files for C++ 3 | // <> not supplied automatically because Lua also compiles as C++ 4 | 5 | extern "C" { 6 | #include "glua/lua.h" 7 | #include "glua/lualib.h" 8 | #include "glua/lauxlib.h" 9 | } 10 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file (GLOB SDIRS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *) 2 | foreach (SUBDIR ${SDIRS}) 3 | if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIR}/CMakeLists.txt") 4 | add_subdirectory (${SUBDIR}) 5 | endif () 6 | endforeach () 7 | -------------------------------------------------------------------------------- /fc/src/byteswap.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef _MSC_VER 4 | # include 5 | # define bswap_64(x) _byteswap_uint64(x) 6 | #elif defined(__APPLE__) 7 | # include 8 | # define bswap_64(x) OSSwapInt64(x) 9 | #else 10 | # include 11 | #endif 12 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/debug_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (debug_server) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/echo_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (echo_server) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/print_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (print_server) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/sip_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (sip_client) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/telemetry_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (telemetry_client) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/telemetry_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (telemetry_server) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/testee_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (testee_client) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/utility_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (utility_client) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | -------------------------------------------------------------------------------- /libraries/fc/src/byteswap.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef _MSC_VER 4 | # include 5 | # define bswap_64(x) _byteswap_uint64(x) 6 | #elif defined(__APPLE__) 7 | # include 8 | # define bswap_64(x) OSSwapInt64(x) 9 | #else 10 | # include 11 | #endif 12 | -------------------------------------------------------------------------------- /libraries/include/utilities/StringEscape.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace TiValue { 6 | namespace utilities { 7 | 8 | std::string escape_string_for_c_source_code(const std::string& input); 9 | 10 | } 11 | } // end namespace TiValue::utilities 12 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/tutorials/chat_tutorial/chat_tutorial.md: -------------------------------------------------------------------------------- 1 | Chat Tutorial 2 | ============= 3 | 4 | Goals of this tutorial: 5 | - Implement a realtime websocket chat server 6 | 7 | 8 | Server 9 | - Nicknames 10 | - Channels 11 | - Subprotocol 12 | - Origin restrictions 13 | - HTTP statistics page 14 | -------------------------------------------------------------------------------- /libraries/glua/glua_vm.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace glua 4 | { 5 | namespace vm 6 | { 7 | VM::VM() 8 | { 9 | 10 | } 11 | 12 | VM::~VM() 13 | { 14 | 15 | } 16 | 17 | void VM::execute(VMStateP state) 18 | { 19 | // TODO 20 | } 21 | 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fc/vendor/easylzma/src/pavlov/7zVersion.h: -------------------------------------------------------------------------------- 1 | #define MY_VER_MAJOR 4 2 | #define MY_VER_MINOR 63 3 | #define MY_VER_BUILD 0 4 | #define MY_VERSION "4.63" 5 | #define MY_DATE "2008-12-31" 6 | #define MY_COPYRIGHT ": Igor Pavlov : Public domain" 7 | #define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " : " MY_DATE 8 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/ReportAssert.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_ASSERT_H 2 | #define UNITTEST_ASSERT_H 3 | 4 | #include "HelperMacros.h" 5 | 6 | namespace UnitTest { 7 | 8 | UNITTEST_LINKAGE void ReportAssert(char const* description, char const* filename, int lineNumber); 9 | 10 | } 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /fc/include/fc/thread/scoped_lock.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace fc { 4 | template 5 | class scoped_lock { 6 | public: 7 | scoped_lock( T& l ):_lock(l) { _lock.lock(); } 8 | ~scoped_lock() { _lock.unlock(); } 9 | T& _lock; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /fc/vendor/easylzma/src/lzma_header.h: -------------------------------------------------------------------------------- 1 | #ifndef __EASYLZMA_LZMA_HEADER__ 2 | #define __EASYLZMA_LZMA_HEADER__ 3 | 4 | #include "common_internal.h" 5 | 6 | /* LZMA-Alone header format gleaned from reading Igor's code */ 7 | 8 | void initializeLZMAFormatHandler(struct elzma_format_handler * hand); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /libraries/TiApp/App.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import socket 3 | import time 4 | import sys 5 | import json 6 | import functools 7 | import os 8 | import random 9 | from App_core import * 10 | from tdfs_thread import * 11 | from Cmd_Loop import * 12 | if __name__ == '__main__': 13 | client() 14 | -------------------------------------------------------------------------------- /libraries/fc/vendor/easylzma/src/pavlov/7zVersion.h: -------------------------------------------------------------------------------- 1 | #define MY_VER_MAJOR 4 2 | #define MY_VER_MINOR 63 3 | #define MY_VER_BUILD 0 4 | #define MY_VERSION "4.63" 5 | #define MY_DATE "2008-12-31" 6 | #define MY_COPYRIGHT ": Igor Pavlov : Public domain" 7 | #define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " : " MY_DATE 8 | -------------------------------------------------------------------------------- /fc/include/fc/noncopyable.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace fc 4 | { 5 | class noncopyable 6 | { 7 | public: 8 | noncopyable(){} 9 | private: 10 | noncopyable( const noncopyable& ) = delete; 11 | noncopyable& operator=( const noncopyable& ) = delete; 12 | }; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /fc/vendor/scrypt-jane/example.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "scrypt-jane.h" 3 | 4 | 5 | int main(void) { 6 | unsigned char digest[16]; 7 | int i; 8 | scrypt("pw", 2, "salt", 4, 0, 0, 0, digest, 16); 9 | for (i = 0; i < sizeof(digest); i++) 10 | printf("%02x, ", digest[i]); 11 | printf("\n"); 12 | return 0; 13 | } -------------------------------------------------------------------------------- /libraries/fc/include/fc/thread/scoped_lock.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace fc { 4 | template 5 | class scoped_lock { 6 | public: 7 | scoped_lock( T& l ):_lock(l) { _lock.lock(); } 8 | ~scoped_lock() { _lock.unlock(); } 9 | T& _lock; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /libraries/fc/vendor/easylzma/src/lzma_header.h: -------------------------------------------------------------------------------- 1 | #ifndef __EASYLZMA_LZMA_HEADER__ 2 | #define __EASYLZMA_LZMA_HEADER__ 3 | 4 | #include "common_internal.h" 5 | 6 | /* LZMA-Alone header format gleaned from reading Igor's code */ 7 | 8 | void initializeLZMAFormatHandler(struct elzma_format_handler * hand); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /fc/include/fc/crypto/base32.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc 6 | { 7 | std::vector from_base32( const fc::string& b32 ); 8 | fc::string to_base32( const std::vector& vec ); 9 | fc::string to_base32( const char* data, size_t len ); 10 | } 11 | -------------------------------------------------------------------------------- /fc/include/fc/crypto/base36.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc 6 | { 7 | std::vector from_base36( const fc::string& b36 ); 8 | fc::string to_base36( const std::vector& vec ); 9 | fc::string to_base36( const char* data, size_t len ); 10 | } 11 | -------------------------------------------------------------------------------- /fc/include/fc/crypto/salsa20.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc 5 | { 6 | void salsa20_encrypt( const fc::sha256& key, uint64_t iv, const char* plain, char* cipher, uint64_t len ); 7 | void salsa20_decrypt( const fc::sha256& key, uint64_t iv, const char* cipher, char* plain, uint64_t len ); 8 | } 9 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/websocketpp-config.cmake.in: -------------------------------------------------------------------------------- 1 | # - Config file for the websocketpp package 2 | # It defines the following variables 3 | # WEBSOCKETPP_FOUND - indicates that the module was found 4 | # WEBSOCKETPP_INCLUDE_DIR - include directories 5 | 6 | set(WEBSOCKETPP_FOUND TRUE) 7 | set(WEBSOCKETPP_INCLUDE_DIR "@INSTALL_INCLUDE_DIR@") 8 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/noncopyable.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace fc 4 | { 5 | class noncopyable 6 | { 7 | public: 8 | noncopyable(){} 9 | private: 10 | noncopyable( const noncopyable& ) = delete; 11 | noncopyable& operator=( const noncopyable& ) = delete; 12 | }; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /libraries/fc/vendor/scrypt-jane/example.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "scrypt-jane.h" 3 | 4 | 5 | int main(void) { 6 | unsigned char digest[16]; 7 | int i; 8 | scrypt("pw", 2, "salt", 4, 0, 0, 0, digest, 16); 9 | for (i = 0; i < sizeof(digest); i++) 10 | printf("%02x, ", digest[i]); 11 | printf("\n"); 12 | return 0; 13 | } -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/base32.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc 6 | { 7 | std::vector from_base32( const fc::string& b32 ); 8 | fc::string to_base32( const std::vector& vec ); 9 | fc::string to_base32( const char* data, size_t len ); 10 | } 11 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/base36.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc 6 | { 7 | std::vector from_base36( const fc::string& b36 ); 8 | fc::string to_base36( const std::vector& vec ); 9 | fc::string to_base36( const char* data, size_t len ); 10 | } 11 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/salsa20.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc 5 | { 6 | void salsa20_encrypt( const fc::sha256& key, uint64_t iv, const char* plain, char* cipher, uint64_t len ); 7 | void salsa20_decrypt( const fc::sha256& key, uint64_t iv, const char* cipher, char* plain, uint64_t len ); 8 | } 9 | -------------------------------------------------------------------------------- /libraries/include/db/Fwd.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace TiValue { 5 | namespace db { 6 | 7 | class peer; 8 | typedef std::shared_ptr peer_ptr; 9 | 10 | class peer_ram; 11 | typedef std::shared_ptr peer_ram_ptr; 12 | 13 | } 14 | } // namespace TiValue::db 15 | -------------------------------------------------------------------------------- /libraries/include/glua/lrepl.h: -------------------------------------------------------------------------------- 1 | #ifndef lrepl_h 2 | #define lrepl_h 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "glua/lua.h" 9 | 10 | /* 11 | ** Do the REPL: repeatedly read (load) a line, evaluate (call) it, and 12 | ** print any results. 13 | */ 14 | void luaL_doREPL(lua_State *L); 15 | 16 | #endif -------------------------------------------------------------------------------- /miniupnpc/declspec.h: -------------------------------------------------------------------------------- 1 | #ifndef DECLSPEC_H_INCLUDED 2 | #define DECLSPEC_H_INCLUDED 3 | 4 | #if defined(_WIN32) && !defined(STATICLIB) 5 | #ifdef MINIUPNP_EXPORTS 6 | #define LIBSPEC __declspec(dllexport) 7 | #else 8 | #define LIBSPEC __declspec(dllimport) 9 | #endif 10 | #else 11 | #define LIBSPEC 12 | #endif 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /utilities/include/bts/utilities/git_revision.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace bts { namespace utilities { 5 | 6 | extern const char* const git_revision_sha; 7 | extern const uint32_t git_revision_unix_timestamp; 8 | extern const char* const git_revision_description; 9 | 10 | } } // end namespace bts::utilities 11 | -------------------------------------------------------------------------------- /fc/include/fc/crypto/scrypt.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | 6 | void scrypt_derive_key( const std::vector& passphrase, const std::vector& salt, 7 | unsigned int n, unsigned int r, unsigned int p, std::vector& key ); 8 | 9 | } // namespace fc 10 | -------------------------------------------------------------------------------- /libraries/include/glua/glua_parser.h: -------------------------------------------------------------------------------- 1 | /** 2 | * if we need change lua syntax too mutch, reimplement the parser 3 | * @author 4 | */ 5 | 6 | #ifndef glua_parser_h 7 | #define glua_parser_h 8 | 9 | #include "glua/lprefix.h" 10 | 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #include "glua/lua.h" 17 | 18 | #endif -------------------------------------------------------------------------------- /fc/vendor/scrypt-jane/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) 2 | set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -no-integrated-as" ) 3 | endif() 4 | 5 | add_definitions( -DSCRYPT_SALSA ) 6 | add_definitions( -DSCRYPT_SHA256 ) 7 | 8 | set( scrypt_sources 9 | scrypt-jane.c 10 | ) 11 | 12 | add_library( scrypt ${scrypt_sources} ) 13 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/echo_server_tls/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | 6 | if (OPENSSL_FOUND) 7 | 8 | init_target (echo_server_tls) 9 | 10 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 11 | 12 | link_boost () 13 | link_openssl() 14 | final_target () 15 | endif() 16 | -------------------------------------------------------------------------------- /leveldb/AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file like so: 2 | # Name or Organization 3 | 4 | Google Inc. 5 | 6 | # Initial version authors: 7 | Jeffrey Dean 8 | Sanjay Ghemawat 9 | 10 | # Partial list of contributors: 11 | Kevin Regan 12 | Johan Bilien 13 | -------------------------------------------------------------------------------- /fc/include/fc/aligned.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace fc { 3 | 4 | template 5 | struct aligned { 6 | union { 7 | T _align; 8 | char _data[S]; 9 | } _store; 10 | operator char*() { return _store._data; } 11 | operator const char*()const { return _store._data; } 12 | }; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /fc/vendor/easylzma/src/lzip_header.h: -------------------------------------------------------------------------------- 1 | #ifndef __EASYLZMA_LZIP_HEADER__ 2 | #define __EASYLZMA_LZIP_HEADER__ 3 | 4 | #include "common_internal.h" 5 | 6 | /* lzip file format documented here: 7 | * http://download.savannah.gnu.org/releases-noredirect/lzip/manual/ */ 8 | 9 | void initializeLZIPFormatHandler(struct elzma_format_handler * hand); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/echo_server_both/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | 6 | if (OPENSSL_FOUND) 7 | 8 | init_target (echo_server_both) 9 | 10 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 11 | 12 | link_boost () 13 | link_openssl() 14 | final_target () 15 | endif() 16 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/scrypt.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | 6 | void scrypt_derive_key( const std::vector& passphrase, const std::vector& salt, 7 | unsigned int n, unsigned int r, unsigned int p, std::vector& key ); 8 | 9 | } // namespace fc 10 | -------------------------------------------------------------------------------- /libraries/fc/vendor/scrypt-jane/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) 2 | set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -no-integrated-as" ) 3 | endif() 4 | 5 | add_definitions( -DSCRYPT_SALSA ) 6 | add_definitions( -DSCRYPT_SHA256 ) 7 | 8 | set( scrypt_sources 9 | scrypt-jane.c 10 | ) 11 | 12 | add_library( scrypt ${scrypt_sources} ) 13 | -------------------------------------------------------------------------------- /libraries/leveldb/AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file like so: 2 | # Name or Organization 3 | 4 | Google Inc. 5 | 6 | # Initial version authors: 7 | Jeffrey Dean 8 | Sanjay Ghemawat 9 | 10 | # Partial list of contributors: 11 | Kevin Regan 12 | Johan Bilien 13 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/aligned.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace fc { 3 | 4 | template 5 | struct aligned { 6 | union { 7 | T _align; 8 | char _data[S]; 9 | } _store; 10 | operator char*() { return _store._data; } 11 | operator const char*()const { return _store._data; } 12 | }; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /libraries/fc/vendor/easylzma/src/lzip_header.h: -------------------------------------------------------------------------------- 1 | #ifndef __EASYLZMA_LZIP_HEADER__ 2 | #define __EASYLZMA_LZIP_HEADER__ 3 | 4 | #include "common_internal.h" 5 | 6 | /* lzip file format documented here: 7 | * http://download.savannah.gnu.org/releases-noredirect/lzip/manual/ */ 8 | 9 | void initializeLZIPFormatHandler(struct elzma_format_handler * hand); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /libraries/include/blockchain/GenesisJson.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace TiValue { 7 | namespace blockchain { 8 | 9 | GenesisState get_builtin_genesis_block_config(); 10 | fc::sha256 get_builtin_genesis_block_state_hash(); 11 | 12 | } 13 | } // TiValue::blockchain 14 | 15 | -------------------------------------------------------------------------------- /fc/src/io/datastream.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | NO_RETURN void fc::detail::throw_datastream_range_error(char const* method, size_t len, int64_t over) 5 | { 6 | FC_THROW_EXCEPTION( out_of_range_exception, "${method} datastream of length ${len} over by ${over}", ("method",fc::string(method))("len",len)("over",over) ); 7 | } 8 | -------------------------------------------------------------------------------- /fc/include/fc/container/deque_fwd.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace fc { 6 | 7 | namespace raw { 8 | template 9 | void pack( Stream& s, const std::deque& value ); 10 | template 11 | void unpack( Stream& s, std::deque& value ); 12 | } 13 | } // namespace fc 14 | -------------------------------------------------------------------------------- /fc/include/fc/crypto/digest.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | 8 | template 9 | fc::sha256 digest( const T& value ) 10 | { 11 | fc::sha256::encoder enc; 12 | fc::raw::pack( enc, value ); 13 | return enc.result(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /fc/tests/sleep.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main( int argc, char** argv ) 5 | { 6 | fc::thread test("test"); 7 | auto result = test.async( [=]() { 8 | while( true ) 9 | { 10 | fc::usleep( fc::microseconds(1000) ); 11 | } 12 | }); 13 | char c; 14 | std::cin >> c; 15 | test.quit(); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /libraries/fc/src/io/datastream.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | NO_RETURN void fc::detail::throw_datastream_range_error(char const* method, size_t len, int64_t over) 5 | { 6 | FC_THROW_EXCEPTION( out_of_range_exception, "${method} datastream of length ${len} over by ${over}", ("method",fc::string(method))("len",len)("over",over) ); 7 | } 8 | -------------------------------------------------------------------------------- /libraries/include/utilities/GitRevision.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace TiValue { 5 | namespace utilities { 6 | 7 | extern const char* const git_revision_sha; 8 | extern const uint32_t git_revision_unix_timestamp; 9 | extern const char* const git_revision_description; 10 | 11 | } 12 | } // end namespace TiValue::utilities 13 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/container/deque_fwd.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace fc { 6 | 7 | namespace raw { 8 | template 9 | void pack( Stream& s, const std::deque& value ); 10 | template 11 | void unpack( Stream& s, std::deque& value ); 12 | } 13 | } // namespace fc 14 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/digest.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | 8 | template 9 | fc::sha256 digest( const T& value ) 10 | { 11 | fc::sha256::encoder enc; 12 | fc::raw::pack( enc, value ); 13 | return enc.result(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /libraries/fc/tests/sleep.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main( int argc, char** argv ) 5 | { 6 | fc::thread test("test"); 7 | auto result = test.async( [=]() { 8 | while( true ) 9 | { 10 | fc::usleep( fc::microseconds(1000) ); 11 | } 12 | }); 13 | char c; 14 | std::cin >> c; 15 | test.quit(); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /fc/src/git_revision.cpp.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define FC_GIT_REVISION_SHA "@FC_GIT_REVISION_SHA@" 4 | #define FC_GIT_REVISION_UNIX_TIMESTAMP @FC_GIT_REVISION_UNIX_TIMESTAMP@ 5 | 6 | namespace fc { 7 | 8 | const char* const git_revision_sha = FC_GIT_REVISION_SHA; 9 | const uint32_t git_revision_unix_timestamp = FC_GIT_REVISION_UNIX_TIMESTAMP; 10 | 11 | } // end namespace fc 12 | -------------------------------------------------------------------------------- /leveldb/util/filter_policy.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/filter_policy.h" 6 | 7 | namespace leveldb { 8 | 9 | FilterPolicy::~FilterPolicy() { } 10 | 11 | } // namespace leveldb 12 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/RequireMacros.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_REQUIREMACROS_H 2 | #define UNITTEST_REQUIREMACROS_H 3 | 4 | #include "RequiredCheckTestReporter.h" 5 | 6 | #ifdef REQUIRE 7 | #error UnitTest++ redefines REQUIRE 8 | #endif 9 | 10 | #define REQUIRE for(UnitTest::RequiredCheckTestReporter decoratedReporter(*UnitTest::CurrentTest::Results()); decoratedReporter.Next(); ) 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /secp256k1-zkp/libsecp256k1.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libsecp256k1 7 | Description: Optimized C library for EC operations on curve secp256k1 8 | URL: https://github.com/bitcoin/secp256k1 9 | Version: @PACKAGE_VERSION@ 10 | Cflags: -I${includedir} 11 | Libs.private: @SECP_LIBS@ 12 | Libs: -L${libdir} -lsecp256k1 13 | 14 | -------------------------------------------------------------------------------- /libraries/fc/src/git_revision.cpp.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define FC_GIT_REVISION_SHA "@FC_GIT_REVISION_SHA@" 4 | #define FC_GIT_REVISION_UNIX_TIMESTAMP @FC_GIT_REVISION_UNIX_TIMESTAMP@ 5 | 6 | namespace fc { 7 | 8 | const char* const git_revision_sha = FC_GIT_REVISION_SHA; 9 | const uint32_t git_revision_unix_timestamp = FC_GIT_REVISION_UNIX_TIMESTAMP; 10 | 11 | } // end namespace fc 12 | -------------------------------------------------------------------------------- /libraries/leveldb/util/filter_policy.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/filter_policy.h" 6 | 7 | namespace leveldb { 8 | 9 | FilterPolicy::~FilterPolicy() { } 10 | 11 | } // namespace leveldb 12 | -------------------------------------------------------------------------------- /fc/include/fc/crypto/base58.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc { 6 | std::string to_base58( const char* d, size_t s ); 7 | std::string to_base58( const std::vector& data ); 8 | std::vector from_base58( const std::string& base58_str ); 9 | size_t from_base58( const std::string& base58_str, char* out_data, size_t out_data_len ); 10 | } 11 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/base58.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc { 6 | std::string to_base58( const char* d, size_t s ); 7 | std::string to_base58( const std::vector& data ); 8 | std::vector from_base58( const std::string& base58_str ); 9 | size_t from_base58( const std::string& base58_str, char* out_data, size_t out_data_len ); 10 | } 11 | -------------------------------------------------------------------------------- /fc/vendor/scrypt-jane/scrypt-jane-test.c: -------------------------------------------------------------------------------- 1 | #define SCRYPT_TEST 2 | #include "scrypt-jane.c" 3 | 4 | int main(void) { 5 | int res = scrypt_power_on_self_test(); 6 | 7 | printf("%s: test %s\n", SCRYPT_MIX, (res & 1) ? "ok" : "FAILED"); 8 | printf("%s: test %s\n", SCRYPT_HASH, (res & 2) ? "ok" : "FAILED"); 9 | printf("scrypt: test vectors %s\n", (res & 4) ? "ok" : "FAILED"); 10 | 11 | return ((res & 7) == 7) ? 0 : 1; 12 | } 13 | -------------------------------------------------------------------------------- /libraries/client/Messages.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | namespace TiValue { 3 | namespace client { 4 | 5 | const MessageTypeEnum TrxMessage::type = MessageTypeEnum::trx_message_type; 6 | const MessageTypeEnum BlockMessage::type = MessageTypeEnum::block_message_type; 7 | const MessageTypeEnum BatchTrxMessage::type = MessageTypeEnum::batch_trx_message_type; 8 | 9 | } 10 | } // TiValue::client 11 | -------------------------------------------------------------------------------- /libraries/glua/glua_api_types.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | GluaModuleByteStream::GluaModuleByteStream() 5 | { 6 | is_bytes = false; 7 | contract_level = CONTRACT_LEVEL_TEMP; 8 | contract_state = CONTRACT_STATE_VALID; 9 | } 10 | 11 | GluaModuleByteStream::~GluaModuleByteStream() 12 | { 13 | contract_apis.clear(); 14 | offline_apis.clear(); 15 | contract_emit_events.clear(); 16 | } -------------------------------------------------------------------------------- /libraries/fc/vendor/scrypt-jane/scrypt-jane-test.c: -------------------------------------------------------------------------------- 1 | #define SCRYPT_TEST 2 | #include "scrypt-jane.c" 3 | 4 | int main(void) { 5 | int res = scrypt_power_on_self_test(); 6 | 7 | printf("%s: test %s\n", SCRYPT_MIX, (res & 1) ? "ok" : "FAILED"); 8 | printf("%s: test %s\n", SCRYPT_HASH, (res & 2) ? "ok" : "FAILED"); 9 | printf("scrypt: test vectors %s\n", (res & 4) ? "ok" : "FAILED"); 10 | 11 | return ((res & 7) == 7) ? 0 : 1; 12 | } 13 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/CurrentTest.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_CURRENTTESTRESULTS_H 2 | #define UNITTEST_CURRENTTESTRESULTS_H 3 | 4 | #include "HelperMacros.h" 5 | 6 | namespace UnitTest { 7 | 8 | class TestResults; 9 | class TestDetails; 10 | 11 | namespace CurrentTest 12 | { 13 | UNITTEST_LINKAGE TestResults*& Results(); 14 | UNITTEST_LINKAGE const TestDetails*& Details(); 15 | } 16 | 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /leveldb/port/README: -------------------------------------------------------------------------------- 1 | This directory contains interfaces and implementations that isolate the 2 | rest of the package from platform details. 3 | 4 | Code in the rest of the package includes "port.h" from this directory. 5 | "port.h" in turn includes a platform specific "port_.h" file 6 | that provides the platform specific implementation. 7 | 8 | See port_posix.h for an example of what must be provided in a platform 9 | specific header file. 10 | 11 | -------------------------------------------------------------------------------- /libraries/leveldb/port/README: -------------------------------------------------------------------------------- 1 | This directory contains interfaces and implementations that isolate the 2 | rest of the package from platform details. 3 | 4 | Code in the rest of the package includes "port.h" from this directory. 5 | "port.h" in turn includes a platform specific "port_.h" file 6 | that provides the platform specific implementation. 7 | 8 | See port_posix.h for an example of what must be provided in a platform 9 | specific header file. 10 | 11 | -------------------------------------------------------------------------------- /fc/include/fc/crypto/hex.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | uint8_t from_hex( char c ); 8 | fc::string to_hex( const char* d, uint32_t s ); 9 | std::string to_hex( const std::vector& data ); 10 | 11 | /** 12 | * @return the number of bytes decoded 13 | */ 14 | size_t from_hex( const fc::string& hex_str, char* out_data, size_t out_data_len ); 15 | } 16 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/websocketpp-configVersion.cmake.in: -------------------------------------------------------------------------------- 1 | set(PACKAGE_VERSION "@WEBSOCKETPP_VERSION@") 2 | 3 | # Check whether the requested PACKAGE_FIND_VERSION is compatible 4 | if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") 5 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 6 | else() 7 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 8 | if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") 9 | set(PACKAGE_VERSION_EXACT TRUE) 10 | endif() 11 | endif() 12 | -------------------------------------------------------------------------------- /fc/include/fc/crypto/base64.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len); 6 | inline std::string base64_encode(char const* bytes_to_encode, unsigned int in_len) { return base64_encode( (unsigned char const*)bytes_to_encode, in_len); } 7 | std::string base64_encode( const std::string& enc ); 8 | std::string base64_decode( const std::string& encoded_string); 9 | } // namespace fc 10 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/hex.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | uint8_t from_hex( char c ); 8 | fc::string to_hex( const char* d, uint32_t s ); 9 | std::string to_hex( const std::vector& data ); 10 | 11 | /** 12 | * @return the number of bytes decoded 13 | */ 14 | size_t from_hex( const fc::string& hex_str, char* out_data, size_t out_data_len ); 15 | } 16 | -------------------------------------------------------------------------------- /fc/include/fc/platform_independence.hpp: -------------------------------------------------------------------------------- 1 | #ifdef _MSC_VER 2 | #include 3 | #ifdef _M_X64 4 | #define __builtin_popcountll __popcnt64 5 | #else 6 | inline int __builtin_popcountll(unsigned __int64 value) 7 | { 8 | unsigned int lowBits = (unsigned int)value; 9 | int count = __popcnt(lowBits); 10 | unsigned int highBits = (unsigned int)(value >> 32); 11 | count += __popcnt(highBits); 12 | return count; 13 | } 14 | #endif 15 | #endif -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/base64.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len); 6 | inline std::string base64_encode(char const* bytes_to_encode, unsigned int in_len) { return base64_encode( (unsigned char const*)bytes_to_encode, in_len); } 7 | std::string base64_encode( const std::string& enc ); 8 | std::string base64_decode( const std::string& encoded_string); 9 | } // namespace fc 10 | -------------------------------------------------------------------------------- /fc/src/utf8/ReleaseNotes: -------------------------------------------------------------------------------- 1 | utf8 cpp library 2 | Release 2.3.4 3 | 4 | A minor bug fix release. Thanks to all who reported bugs. 5 | 6 | Note: Version 2.3.3 contained a regression, and therefore was removed. 7 | 8 | Changes from version 2.3.2 9 | - Bug fix [39]: checked.h Line 273 and unchecked.h Line 182 have an extra ';' 10 | - Bug fix [36]: replace_invalid() only works with back_inserter 11 | 12 | Files included in the release: utf8.h, core.h, checked.h, unchecked.h, utf8cpp.html, ReleaseNotes 13 | -------------------------------------------------------------------------------- /fc/src/io/varint.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace fc 5 | { 6 | void to_variant( const signed_int& var, variant& vo ) { vo = var.value; } 7 | void from_variant( const variant& var, signed_int& vo ) { vo.value = static_cast(var.as_int64()); } 8 | void to_variant( const unsigned_int& var, variant& vo ) { vo = var.value; } 9 | void from_variant( const variant& var, unsigned_int& vo ) { vo.value = static_cast(var.as_uint64()); } 10 | } 11 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/platform_independence.hpp: -------------------------------------------------------------------------------- 1 | #ifdef _MSC_VER 2 | #include 3 | #ifdef _M_X64 4 | #define __builtin_popcountll __popcnt64 5 | #else 6 | inline int __builtin_popcountll(unsigned __int64 value) 7 | { 8 | unsigned int lowBits = (unsigned int)value; 9 | int count = __popcnt(lowBits); 10 | unsigned int highBits = (unsigned int)(value >> 32); 11 | count += __popcnt(highBits); 12 | return count; 13 | } 14 | #endif 15 | #endif -------------------------------------------------------------------------------- /libraries/fc/src/utf8/ReleaseNotes: -------------------------------------------------------------------------------- 1 | utf8 cpp library 2 | Release 2.3.4 3 | 4 | A minor bug fix release. Thanks to all who reported bugs. 5 | 6 | Note: Version 2.3.3 contained a regression, and therefore was removed. 7 | 8 | Changes from version 2.3.2 9 | - Bug fix [39]: checked.h Line 273 and unchecked.h Line 182 have an extra ';' 10 | - Bug fix [36]: replace_invalid() only works with back_inserter 11 | 12 | Files included in the release: utf8.h, core.h, checked.h, unchecked.h, utf8cpp.html, ReleaseNotes 13 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/Posix/TimeHelpers.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TIMEHELPERS_H 2 | #define UNITTEST_TIMEHELPERS_H 3 | 4 | #include 5 | 6 | namespace UnitTest { 7 | 8 | class Timer 9 | { 10 | public: 11 | Timer(); 12 | void Start(); 13 | double GetTimeInMs() const; 14 | 15 | private: 16 | struct timeval m_startTime; 17 | }; 18 | 19 | 20 | namespace TimeHelpers 21 | { 22 | void SleepMs(int ms); 23 | } 24 | 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /libraries/fc/src/io/varint.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace fc 5 | { 6 | void to_variant( const signed_int& var, variant& vo ) { vo = var.value; } 7 | void from_variant( const variant& var, signed_int& vo ) { vo.value = static_cast(var.as_int64()); } 8 | void to_variant( const unsigned_int& var, variant& vo ) { vo = var.value; } 9 | void from_variant( const variant& var, unsigned_int& vo ) { vo.value = static_cast(var.as_uint64()); } 10 | } 11 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/AssertException.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_ASSERTEXCEPTION_H 2 | #define UNITTEST_ASSERTEXCEPTION_H 3 | 4 | #include "Config.h" 5 | #ifndef UNITTEST_NO_EXCEPTIONS 6 | 7 | #include "HelperMacros.h" 8 | #include 9 | 10 | namespace UnitTest { 11 | 12 | class UNITTEST_LINKAGE AssertException : public std::exception 13 | { 14 | public: 15 | AssertException(); 16 | virtual ~AssertException() throw(); 17 | }; 18 | 19 | } 20 | 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /utilities/include/bts/utilities/key_conversion.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace bts { namespace utilities { 8 | 9 | std::string key_to_wif_single_hash(const fc::ecc::private_key& key); 10 | std::string key_to_wif(const fc::ecc::private_key& key); 11 | fc::optional wif_to_key( const std::string& wif_key ); 12 | 13 | } } // end namespace bts::utilities 14 | -------------------------------------------------------------------------------- /db/include/bts/db/exception.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace bts { namespace db { 5 | 6 | FC_DECLARE_EXCEPTION( level_map_failure, 10000, "level_map failure" ); 7 | FC_DECLARE_EXCEPTION( level_map_open_failure, 10001, "level_map open failure" ); 8 | 9 | FC_DECLARE_EXCEPTION( level_pod_map_failure, 11000, "level_pod_map failure" ); 10 | FC_DECLARE_EXCEPTION( level_pod_map_open_failure, 11001, "level_pod_map open failure" ); 11 | 12 | } } // bts::db 13 | -------------------------------------------------------------------------------- /fc/src/compress/zlib.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "miniz.c" 4 | 5 | namespace fc 6 | { 7 | string zlib_compress(const string& in) 8 | { 9 | size_t compressed_message_length; 10 | char* compressed_message = (char*)tdefl_compress_mem_to_heap(in.c_str(), in.size(), &compressed_message_length, TDEFL_WRITE_ZLIB_HEADER | TDEFL_DEFAULT_MAX_PROBES); 11 | string result(compressed_message, compressed_message_length); 12 | free(compressed_message); 13 | return result; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /fc/vendor/udt4/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | IF( APPLE ) 3 | add_definitions( -DOSX ) 4 | ELSEIF( WIN32 ) 5 | 6 | ELSE() 7 | add_definitions( -DLINUX ) 8 | ENDIF() 9 | 10 | set( udt_sources 11 | src/api.cpp 12 | src/buffer.cpp 13 | src/cache.cpp 14 | src/ccc.cpp 15 | src/channel.cpp 16 | src/common.cpp 17 | src/core.cpp 18 | src/epoll.cpp 19 | src/list.cpp 20 | src/md5.cpp 21 | src/packet.cpp 22 | src/queue.cpp 23 | src/window.cpp 24 | ) 25 | 26 | add_library( udt ${udt_sources} ) 27 | -------------------------------------------------------------------------------- /libraries/include/glua/glua_common.h: -------------------------------------------------------------------------------- 1 | #ifndef glua_common_h 2 | #define glua_common_h 3 | 4 | #include 5 | 6 | #ifdef _DEBUG 7 | 8 | #if defined MEMCHECK_VLD 9 | #include 10 | #include 11 | #elif defined MEMCHECK_MEMWATCH 12 | #define MEMWATCH 13 | #define MW_STDIO 14 | #include 15 | #include "memwatch.h" 16 | #endif 17 | 18 | #endif // #ifdef _DEBUG 19 | 20 | #define MACRO_STR_RAW(tok) #tok 21 | #define MACRO_STR(tok) MACRO_STR_RAW(tok) 22 | 23 | #endif // #ifndef glua_common_h 24 | -------------------------------------------------------------------------------- /fc/include/fc/wait_any.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc { 6 | template 7 | int wait_any( fc::future& f1, fc::future& f2, const microseconds& timeout_us = microseconds::max() ) { 8 | fc::vector p(2); 9 | p[0] = static_pointer_cast(f1.promise()); 10 | p[1] = static_pointer_cast(f2.promise()); 11 | return wait( fc::move(p), timeout_us ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /libraries/fc/src/compress/zlib.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "miniz.c" 4 | 5 | namespace fc 6 | { 7 | string zlib_compress(const string& in) 8 | { 9 | size_t compressed_message_length; 10 | char* compressed_message = (char*)tdefl_compress_mem_to_heap(in.c_str(), in.size(), &compressed_message_length, TDEFL_WRITE_ZLIB_HEADER | TDEFL_DEFAULT_MAX_PROBES); 11 | string result(compressed_message, compressed_message_length); 12 | free(compressed_message); 13 | return result; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /libraries/fc/vendor/udt4/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | IF( APPLE ) 3 | add_definitions( -DOSX ) 4 | ELSEIF( WIN32 ) 5 | 6 | ELSE() 7 | add_definitions( -DLINUX ) 8 | ENDIF() 9 | 10 | set( udt_sources 11 | src/api.cpp 12 | src/buffer.cpp 13 | src/cache.cpp 14 | src/ccc.cpp 15 | src/channel.cpp 16 | src/common.cpp 17 | src/core.cpp 18 | src/epoll.cpp 19 | src/list.cpp 20 | src/md5.cpp 21 | src/packet.cpp 22 | src/queue.cpp 23 | src/window.cpp 24 | ) 25 | 26 | add_library( udt ${udt_sources} ) 27 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/wait_any.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc { 6 | template 7 | int wait_any( fc::future& f1, fc::future& f2, const microseconds& timeout_us = microseconds::max() ) { 8 | fc::vector p(2); 9 | p[0] = static_pointer_cast(f1.promise()); 10 | p[1] = static_pointer_cast(f2.promise()); 11 | return wait( fc::move(p), timeout_us ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /libraries/include/blockchain/SlateOperations.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace TiValue { 6 | namespace blockchain { 7 | 8 | struct DefineSlateOperation 9 | { 10 | static const OperationTypeEnum type; 11 | 12 | vector slate; 13 | 14 | void evaluate(TransactionEvaluationState& eval_state)const; 15 | }; 16 | 17 | } 18 | } // TiValue::blockchain 19 | 20 | FC_REFLECT(TiValue::blockchain::DefineSlateOperation, (slate)) 21 | -------------------------------------------------------------------------------- /libraries/include/rpc/Exceptions.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace TiValue { 6 | namespace rpc { 7 | 8 | // All registered in rpc_server.cpp 9 | FC_DECLARE_EXCEPTION(rpc_exception, 60000, "RPC Error"); 10 | FC_DECLARE_EXCEPTION(missing_parameter, 60001, "Missing Parameter"); 11 | FC_DECLARE_EXCEPTION(unknown_method, 60002, "Unknown Method"); 12 | FC_DECLARE_EXCEPTION(login_required, 60003, "Login Required"); 13 | 14 | } 15 | } // TiValue::rpc 16 | -------------------------------------------------------------------------------- /libraries/include/utilities/CommonApi.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | namespace TiValue { 6 | namespace utilities { 7 | 8 | int common_fread_octets(FILE* fp, void* dst_stream, int len); 9 | int common_fread_int(FILE* fp, int* dst_int); 10 | 11 | int common_fwrite_stream(FILE* fp, const void* src_stream, int len); 12 | int common_fwrite_int(FILE* fp, const int* src_int); 13 | bool isNumber(std::string input); 14 | 15 | } 16 | } // end namespace TiValue::utilities 17 | -------------------------------------------------------------------------------- /libraries/include/db/Exception.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace TiValue { 5 | namespace db { 6 | 7 | FC_DECLARE_EXCEPTION(level_map_failure, 10000, "level_map failure"); 8 | FC_DECLARE_EXCEPTION(level_map_open_failure, 10001, "level_map open failure"); 9 | 10 | FC_DECLARE_EXCEPTION(level_pod_map_failure, 11000, "level_pod_map failure"); 11 | FC_DECLARE_EXCEPTION(level_pod_map_open_failure, 11001, "level_pod_map open failure"); 12 | 13 | } 14 | } // TiValue::db 15 | -------------------------------------------------------------------------------- /libraries/include/glua/glua_vm.h: -------------------------------------------------------------------------------- 1 | #ifndef glua_vm_h 2 | #define glua_vm_h 3 | 4 | #include 5 | #include 6 | 7 | namespace glua 8 | { 9 | namespace vm 10 | { 11 | 12 | class VMCallinfo 13 | { 14 | 15 | }; 16 | 17 | class VMState 18 | { 19 | 20 | }; 21 | 22 | typedef std::shared_ptr VMStateP; 23 | 24 | class VM 25 | { 26 | public: 27 | VM(); 28 | virtual ~VM(); 29 | 30 | // void load(); 31 | 32 | void execute(VMStateP state); 33 | }; 34 | } 35 | } 36 | 37 | #endif -------------------------------------------------------------------------------- /libraries/include/UnitTest++/RequiredCheckException.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_REQUIREDCHECKEXCEPTION_H 2 | #define UNITTEST_REQUIREDCHECKEXCEPTION_H 3 | 4 | #include "Config.h" 5 | #ifndef UNITTEST_NO_EXCEPTIONS 6 | 7 | #include "HelperMacros.h" 8 | #include 9 | 10 | namespace UnitTest { 11 | 12 | class UNITTEST_LINKAGE RequiredCheckException : public std::exception 13 | { 14 | public: 15 | RequiredCheckException(); 16 | virtual ~RequiredCheckException() throw(); 17 | }; 18 | 19 | } 20 | 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/UnitTestPP.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTESTPP_H 2 | #define UNITTESTPP_H 3 | 4 | /* 5 | ** Windows stuff 6 | */ 7 | #if defined(_WIN32) /* { */ 8 | 9 | #if !defined(_CRT_SECURE_NO_WARNINGS) 10 | #define _CRT_SECURE_NO_WARNINGS /* avoid warnings about ISO C functions */ 11 | #endif 12 | 13 | #endif /* } */ 14 | 15 | #include "Config.h" 16 | #include "TestMacros.h" 17 | #include "CheckMacros.h" 18 | #include "RequireMacros.h" 19 | #include "TestRunner.h" 20 | #include "TimeConstraint.h" 21 | #include "ReportAssert.h" 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /libraries/include/utilities/KeyConversion.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace TiValue { 8 | namespace utilities { 9 | 10 | std::string key_to_wif_single_hash(const fc::ecc::private_key& key); 11 | std::string key_to_wif(const fc::ecc::private_key& key); 12 | fc::optional wif_to_key(const std::string& wif_key); 13 | 14 | } 15 | } // end namespace TiValue::utilities 16 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/dev/SConscript: -------------------------------------------------------------------------------- 1 | ## Main development example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env_cpp11 = env_cpp11.Clone () 11 | 12 | prgs = [] 13 | 14 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 15 | BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework','system','timer','chrono'],env_cpp11) + [platform_libs] + [polyfill_libs] 16 | prgs += env_cpp11.Program('main', ["main.cpp"], LIBS = BOOST_LIBS_CPP11) 17 | 18 | Return('prgs') 19 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/sip_client/README.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Checkout the project from git 4 | 5 | At the top level, run cmake: 6 | 7 | cmake -G 'Unix Makefiles' \ 8 | -D BUILD_EXAMPLES=ON \ 9 | -D WEBSOCKETPP_ROOT=/tmp/cm1 \ 10 | -D ENABLE_CPP11=OFF . 11 | 12 | and then make the example: 13 | 14 | make -C examples/sip_client 15 | 16 | Now run it: 17 | 18 | bin/sip_client ws://ws-server:80 19 | 20 | It has been tested against the repro SIP proxy from reSIProcate 21 | 22 | http://www.resiprocate.org/WebRTC_and_SIP_Over_WebSockets 23 | -------------------------------------------------------------------------------- /miniupnpc/minissdpc.h: -------------------------------------------------------------------------------- 1 | /* $Id: minissdpc.h,v 1.1 2007/08/31 15:15:33 nanard Exp $ */ 2 | /* Project: miniupnp 3 | * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 4 | * Author: Thomas Bernard 5 | * Copyright (c) 2005-2007 Thomas Bernard 6 | * This software is subjects to the conditions detailed 7 | * in the LICENCE file provided within this distribution */ 8 | #ifndef MINISSDPC_H_INCLUDED 9 | #define MINISSDPC_H_INCLUDED 10 | 11 | struct UPNPDev * 12 | getDevicesFromMiniSSDPD(const char * devtype, const char * socketpath); 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | #Generated files under windows by building 35 | win_lib/ 36 | *.sdf 37 | *.opensdf 38 | *.tlog 39 | windows/x64/Release/ 40 | windows/x64/Debug/ 41 | -------------------------------------------------------------------------------- /libraries/glua/glua_loader.cpp: -------------------------------------------------------------------------------- 1 | #include "glua/glua_loader.h" 2 | 3 | namespace TiValue 4 | { 5 | namespace lua 6 | { 7 | namespace parser 8 | { 9 | /* 10 | LuaLoader::LuaLoader(GluaModuleByteStream *stream) 11 | : _stream(stream) 12 | { 13 | } 14 | 15 | 16 | LuaLoader::~LuaLoader() 17 | { 18 | } 19 | 20 | void LuaLoader::load_bytecode() 21 | { 22 | // TODO 23 | } 24 | */ 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /miniupnpc/minisoap.h: -------------------------------------------------------------------------------- 1 | /* $Id: minisoap.h,v 1.4 2010/04/12 20:39:41 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2005 Thomas Bernard 5 | * This software is subject to the conditions detailed in the 6 | * LICENCE file provided in this distribution. */ 7 | #ifndef MINISOAP_H_INCLUDED 8 | #define MINISOAP_H_INCLUDED 9 | 10 | /*int httpWrite(int, const char *, int, const char *);*/ 11 | int soapPostSubmit(int, const char *, const char *, unsigned short, 12 | const char *, const char *, const char *); 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /fc/tests/lzma_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | using namespace fc; 8 | 9 | int main( int argc, char** argv ) 10 | { 11 | if( argc != 2 ) 12 | { 13 | std::cout << "usage: " << argv[0] << " \n"; 14 | exit( -1 ); 15 | } 16 | 17 | auto src = std::string( argv[1] ); 18 | auto dst = src + ".compressed"; 19 | lzma_compress_file( src, dst ); 20 | 21 | lzma_decompress_file( dst, src + ".decompressed" ); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /leveldb/NEWS: -------------------------------------------------------------------------------- 1 | Release 1.2 2011-05-16 2 | ---------------------- 3 | 4 | Fixes for larger databases (tested up to one billion 100-byte entries, 5 | i.e., ~100GB). 6 | 7 | (1) Place hard limit on number of level-0 files. This fixes errors 8 | of the form "too many open files". 9 | 10 | (2) Fixed memtable management. Before the fix, a heavy write burst 11 | could cause unbounded memory usage. 12 | 13 | A fix for a logging bug where the reader would incorrectly complain 14 | about corruption. 15 | 16 | Allow public access to WriteBatch contents so that users can easily 17 | wrap a DB. 18 | -------------------------------------------------------------------------------- /libraries/fc/tests/lzma_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | using namespace fc; 8 | 9 | int main( int argc, char** argv ) 10 | { 11 | if( argc != 2 ) 12 | { 13 | std::cout << "usage: " << argv[0] << " \n"; 14 | exit( -1 ); 15 | } 16 | 17 | auto src = std::string( argv[1] ); 18 | auto dst = src + ".compressed"; 19 | lzma_compress_file( src, dst ); 20 | 21 | lzma_decompress_file( dst, src + ".decompressed" ); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /fc/src/thread/non_preemptable_scope_check.cpp: -------------------------------------------------------------------------------- 1 | #ifndef NDEBUG 2 | #include 3 | #include 4 | #include "thread_d.hpp" 5 | 6 | 7 | namespace fc 8 | { 9 | non_preemptable_scope_check::non_preemptable_scope_check() 10 | { 11 | ++thread::current().my->non_preemptable_scope_count; 12 | } 13 | 14 | non_preemptable_scope_check::~non_preemptable_scope_check() 15 | { 16 | assert(thread::current().my->non_preemptable_scope_count > 0); 17 | --thread::current().my->non_preemptable_scope_count; 18 | } 19 | } // fc 20 | #endif -------------------------------------------------------------------------------- /leveldb/TODO: -------------------------------------------------------------------------------- 1 | ss 2 | - Stats 3 | 4 | db 5 | - Maybe implement DB::BulkDeleteForRange(start_key, end_key) 6 | that would blow away files whose ranges are entirely contained 7 | within [start_key..end_key]? For Chrome, deletion of obsolete 8 | object stores, etc. can be done in the background anyway, so 9 | probably not that important. 10 | - There have been requests for MultiGet. 11 | 12 | After a range is completely deleted, what gets rid of the 13 | corresponding files if we do no future changes to that range. Make 14 | the conditions for triggering compactions fire in more situations? 15 | -------------------------------------------------------------------------------- /libraries/leveldb/NEWS: -------------------------------------------------------------------------------- 1 | Release 1.2 2011-05-16 2 | ---------------------- 3 | 4 | Fixes for larger databases (tested up to one billion 100-byte entries, 5 | i.e., ~100GB). 6 | 7 | (1) Place hard limit on number of level-0 files. This fixes errors 8 | of the form "too many open files". 9 | 10 | (2) Fixed memtable management. Before the fix, a heavy write burst 11 | could cause unbounded memory usage. 12 | 13 | A fix for a logging bug where the reader would incorrectly complain 14 | about corruption. 15 | 16 | Allow public access to WriteBatch contents so that users can easily 17 | wrap a DB. 18 | -------------------------------------------------------------------------------- /libraries/fc/src/thread/non_preemptable_scope_check.cpp: -------------------------------------------------------------------------------- 1 | #ifndef NDEBUG 2 | #include 3 | #include 4 | #include "thread_d.hpp" 5 | 6 | 7 | namespace fc 8 | { 9 | non_preemptable_scope_check::non_preemptable_scope_check() 10 | { 11 | ++thread::current().my->non_preemptable_scope_count; 12 | } 13 | 14 | non_preemptable_scope_check::~non_preemptable_scope_check() 15 | { 16 | assert(thread::current().my->non_preemptable_scope_count > 0); 17 | --thread::current().my->non_preemptable_scope_count; 18 | } 19 | } // fc 20 | #endif -------------------------------------------------------------------------------- /libraries/leveldb/TODO: -------------------------------------------------------------------------------- 1 | ss 2 | - Stats 3 | 4 | db 5 | - Maybe implement DB::BulkDeleteForRange(start_key, end_key) 6 | that would blow away files whose ranges are entirely contained 7 | within [start_key..end_key]? For Chrome, deletion of obsolete 8 | object stores, etc. can be done in the background anyway, so 9 | probably not that important. 10 | - There have been requests for MultiGet. 11 | 12 | After a range is completely deleted, what gets rid of the 13 | corresponding files if we do no future changes to that range. Make 14 | the conditions for triggering compactions fire in more situations? 15 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/TestList.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TESTLIST_H 2 | #define UNITTEST_TESTLIST_H 3 | 4 | #include "HelperMacros.h" 5 | 6 | namespace UnitTest { 7 | 8 | class Test; 9 | 10 | class UNITTEST_LINKAGE TestList 11 | { 12 | public: 13 | TestList(); 14 | void Add (Test* test); 15 | 16 | Test* GetHead() const; 17 | 18 | private: 19 | Test* m_head; 20 | Test* m_tail; 21 | }; 22 | 23 | 24 | class UNITTEST_LINKAGE ListAdder 25 | { 26 | public: 27 | ListAdder(TestList& list, Test* test); 28 | }; 29 | 30 | } 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /secp256k1-zkp/.gitignore: -------------------------------------------------------------------------------- 1 | bench_inv 2 | bench_ecdh 3 | bench_sign 4 | bench_verify 5 | bench_recover 6 | bench_internal 7 | tests 8 | *.exe 9 | *.so 10 | *.a 11 | !.gitignore 12 | 13 | Makefile 14 | configure 15 | .libs/ 16 | Makefile.in 17 | aclocal.m4 18 | autom4te.cache/ 19 | config.log 20 | config.status 21 | *.tar.gz 22 | *.la 23 | libtool 24 | .deps/ 25 | .dirstamp 26 | build-aux/ 27 | *.lo 28 | *.o 29 | *~ 30 | src/libsecp256k1-config.h 31 | src/libsecp256k1-config.h.in 32 | m4/libtool.m4 33 | m4/ltoptions.m4 34 | m4/ltsugar.m4 35 | m4/ltversion.m4 36 | m4/lt~obsolete.m4 37 | src/stamp-h1 38 | libsecp256k1.pc 39 | -------------------------------------------------------------------------------- /leveldb/util/hash.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Simple hash function used for internal data structures 6 | 7 | #ifndef STORAGE_LEVELDB_UTIL_HASH_H_ 8 | #define STORAGE_LEVELDB_UTIL_HASH_H_ 9 | 10 | #include 11 | #include 12 | 13 | namespace leveldb { 14 | 15 | extern uint32_t Hash(const char* data, size_t n, uint32_t seed); 16 | 17 | } 18 | 19 | #endif // STORAGE_LEVELDB_UTIL_HASH_H_ 20 | -------------------------------------------------------------------------------- /libraries/leveldb/util/hash.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Simple hash function used for internal data structures 6 | 7 | #ifndef STORAGE_LEVELDB_UTIL_HASH_H_ 8 | #define STORAGE_LEVELDB_UTIL_HASH_H_ 9 | 10 | #include 11 | #include 12 | 13 | namespace leveldb { 14 | 15 | extern uint32_t Hash(const char* data, size_t n, uint32_t seed); 16 | 17 | } 18 | 19 | #endif // STORAGE_LEVELDB_UTIL_HASH_H_ 20 | -------------------------------------------------------------------------------- /fc/vendor/scrypt-jane/code/scrypt-conf.h: -------------------------------------------------------------------------------- 1 | /* 2 | pick the best algo at runtime or compile time? 3 | ---------------------------------------------- 4 | SCRYPT_CHOOSE_COMPILETIME (gcc only!) 5 | SCRYPT_CHOOSE_RUNTIME 6 | */ 7 | #define SCRYPT_CHOOSE_RUNTIME 8 | 9 | 10 | /* 11 | hash function to use 12 | ------------------------------- 13 | SCRYPT_BLAKE256 14 | SCRYPT_BLAKE512 15 | SCRYPT_SHA256 16 | SCRYPT_SHA512 17 | SCRYPT_SKEIN512 18 | */ 19 | //#define SCRYPT_SHA256 20 | 21 | 22 | /* 23 | block mixer to use 24 | ----------------------------- 25 | SCRYPT_CHACHA 26 | SCRYPT_SALSA 27 | */ 28 | //#define SCRYPT_SALSA 29 | -------------------------------------------------------------------------------- /fc/src/crypto/_elliptic_impl_priv.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /* private_key_impl based on libsecp256k1 5 | * used by mixed + secp256k1 6 | */ 7 | 8 | namespace fc { namespace ecc { namespace detail { 9 | 10 | 11 | const secp256k1_context_t* _get_context(); 12 | void _init_lib(); 13 | 14 | class private_key_impl 15 | { 16 | public: 17 | private_key_impl() noexcept; 18 | private_key_impl( const private_key_impl& cpy ) noexcept; 19 | 20 | private_key_impl& operator=( const private_key_impl& pk ) noexcept; 21 | 22 | private_key_secret _key; 23 | }; 24 | 25 | }}} 26 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | compiler: 3 | - gcc 4 | before_install: 5 | - sudo apt-get install libboost-regex1.48-dev libboost-system1.48-dev libboost-thread1.48-dev libboost-test1.48-dev libboost-random1.48-dev -y 6 | env: 7 | global: 8 | - BOOST_INCLUDES=/usr/include 9 | - BOOST_LIBS=/usr/lib 10 | script: scons -j 2 && scons test 11 | branches: 12 | only: 13 | - master 14 | - permessage-deflate 15 | - experimental 16 | - 0.3.x-cmake 17 | - develop 18 | notifications: 19 | recipients: 20 | - travis@zaphoyd.com 21 | email: 22 | on_success: change 23 | on_failure: always 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/scrypt-jane/code/scrypt-conf.h: -------------------------------------------------------------------------------- 1 | /* 2 | pick the best algo at runtime or compile time? 3 | ---------------------------------------------- 4 | SCRYPT_CHOOSE_COMPILETIME (gcc only!) 5 | SCRYPT_CHOOSE_RUNTIME 6 | */ 7 | #define SCRYPT_CHOOSE_RUNTIME 8 | 9 | 10 | /* 11 | hash function to use 12 | ------------------------------- 13 | SCRYPT_BLAKE256 14 | SCRYPT_BLAKE512 15 | SCRYPT_SHA256 16 | SCRYPT_SHA512 17 | SCRYPT_SKEIN512 18 | */ 19 | //#define SCRYPT_SHA256 20 | 21 | 22 | /* 23 | block mixer to use 24 | ----------------------------- 25 | SCRYPT_CHACHA 26 | SCRYPT_SALSA 27 | */ 28 | //#define SCRYPT_SALSA 29 | -------------------------------------------------------------------------------- /fc/include/fc/compress/lzma.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | 8 | std::vector lzma_compress( const std::vector& in ); 9 | std::vector lzma_decompress( const std::vector& compressed ); 10 | 11 | void lzma_compress_file( const path& src_path, 12 | const path& dst_path, 13 | unsigned char level = 5, 14 | unsigned int dict_size = (1 << 20) ); 15 | 16 | void lzma_decompress_file( const path& src_path, 17 | const path& dst_path ); 18 | 19 | } // namespace fc 20 | -------------------------------------------------------------------------------- /libraries/fc/src/crypto/_elliptic_impl_priv.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /* private_key_impl based on libsecp256k1 5 | * used by mixed + secp256k1 6 | */ 7 | 8 | namespace fc { namespace ecc { namespace detail { 9 | 10 | 11 | const secp256k1_context_t* _get_context(); 12 | void _init_lib(); 13 | 14 | class private_key_impl 15 | { 16 | public: 17 | private_key_impl() noexcept; 18 | private_key_impl( const private_key_impl& cpy ) noexcept; 19 | 20 | private_key_impl& operator=( const private_key_impl& pk ) noexcept; 21 | 22 | private_key_secret _key; 23 | }; 24 | 25 | }}} 26 | -------------------------------------------------------------------------------- /libraries/include/blockchain/ImessageOperations.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include 5 | #include 6 | 7 | namespace TiValue { 8 | namespace blockchain { 9 | struct ImessageMemoOperation 10 | { 11 | static const OperationTypeEnum type; 12 | string imessage; 13 | ImessageMemoOperation(){} 14 | ImessageMemoOperation(std::string imess) :imessage(imess){} 15 | void evaluate(TransactionEvaluationState& eval_state)const; 16 | }; 17 | } 18 | } 19 | FC_REFLECT(TiValue::blockchain::ImessageMemoOperation, (imessage)) 20 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/print_server/print_server.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | typedef websocketpp::server server; 7 | 8 | void on_message(websocketpp::connection_hdl, server::message_ptr msg) { 9 | std::cout << msg->get_payload() << std::endl; 10 | } 11 | 12 | int main() { 13 | server print_server; 14 | 15 | print_server.set_message_handler(&on_message); 16 | 17 | print_server.init_asio(); 18 | print_server.listen(9002); 19 | print_server.start_accept(); 20 | 21 | print_server.run(); 22 | } 23 | -------------------------------------------------------------------------------- /libraries/include/api/ConversionFunctions.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace TiValue { 7 | namespace api { 8 | 9 | fc::variant fc_ip_endpoint_to_variant(const fc::ip::endpoint& endpoint); 10 | fc::ip::endpoint variant_to_fc_ip_endpoint(const fc::variant& endpoint_as_variant); 11 | 12 | fc::variant time_interval_in_seconds_to_variant(const fc::microseconds time_interval); 13 | fc::microseconds variant_to_time_interval_in_seconds(const fc::variant& time_interval_as_variant); 14 | 15 | } 16 | } // end namespace TiValue::api 17 | -------------------------------------------------------------------------------- /libraries/include/net/Upnp.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace TiValue { 7 | namespace net { 8 | 9 | namespace detail { class UpnpServiceImpl; } 10 | 11 | class UpnpService 12 | { 13 | public: 14 | UpnpService(); 15 | ~UpnpService(); 16 | 17 | fc::ip::address external_ip()const; 18 | uint16_t mapped_port()const; 19 | void map_port(uint16_t p); 20 | private: 21 | std::unique_ptr my; 22 | }; 23 | 24 | } 25 | } // TiValue::net 26 | -------------------------------------------------------------------------------- /secp256k1-zkp/src/ecdh.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2015 Pieter Wuille, Andrew Poelstra * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_ECDH_ 8 | #define _SECP256K1_ECDH_ 9 | 10 | #include "scalar.h" 11 | #include "group.h" 12 | 13 | static void secp256k1_ecdh_point_multiply(secp256k1_gej_t *r, const secp256k1_ge_t *a, const secp256k1_scalar_t *q); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /fc/src/interprocess/signals.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace fc 5 | { 6 | void set_signal_handler( std::function handler, int signal_num ) 7 | { 8 | std::shared_ptr sig_set(new boost::asio::signal_set(fc::asio::default_io_service(), signal_num)); 9 | sig_set->async_wait( 10 | [sig_set,handler]( const boost::system::error_code& err, int num ) 11 | { 12 | handler( num ); 13 | sig_set->cancel(); 14 | // set_signal_handler( handler, signal_num ); 15 | } ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/compress/lzma.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | 8 | std::vector lzma_compress( const std::vector& in ); 9 | std::vector lzma_decompress( const std::vector& compressed ); 10 | 11 | void lzma_compress_file( const path& src_path, 12 | const path& dst_path, 13 | unsigned char level = 5, 14 | unsigned int dict_size = (1 << 20) ); 15 | 16 | void lzma_decompress_file( const path& src_path, 17 | const path& dst_path ); 18 | 19 | } // namespace fc 20 | -------------------------------------------------------------------------------- /secp256k1-zkp/src/java/org_bitcoin_NativeSecp256k1.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class org_bitcoin_NativeSecp256k1 */ 4 | 5 | #ifndef _Included_org_bitcoin_NativeSecp256k1 6 | #define _Included_org_bitcoin_NativeSecp256k1 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: org_bitcoin_NativeSecp256k1 12 | * Method: secp256k1_ecdsa_verify 13 | * Signature: (Ljava/nio/ByteBuffer;)I 14 | */ 15 | JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify 16 | (JNIEnv *, jclass, jobject); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /fc/include/fc/network/ntp.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | namespace fc { 9 | 10 | namespace detail { class ntp_impl; } 11 | 12 | class ntp 13 | { 14 | public: 15 | ntp(); 16 | ~ntp(); 17 | 18 | void add_server( const std::string& hostname, uint16_t port = 123 ); 19 | void set_request_interval( uint32_t interval_sec ); 20 | void request_now(); 21 | optional get_time()const; 22 | 23 | private: 24 | std::unique_ptr my; 25 | }; 26 | 27 | } // namespace fc 28 | -------------------------------------------------------------------------------- /fc/vendor/easylzma/src/pavlov/7zCrc.h: -------------------------------------------------------------------------------- 1 | /* 7zCrc.h -- CRC32 calculation 2 | 2008-03-13 3 | Igor Pavlov 4 | Public domain */ 5 | 6 | #ifndef __7Z_CRC_H 7 | #define __7Z_CRC_H 8 | 9 | #include 10 | 11 | #include "Types.h" 12 | 13 | extern UInt32 g_CrcTable[]; 14 | 15 | void MY_FAST_CALL CrcGenerateTable(void); 16 | 17 | #define CRC_INIT_VAL 0xFFFFFFFF 18 | #define CRC_GET_DIGEST(crc) ((crc) ^ 0xFFFFFFFF) 19 | #define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) 20 | 21 | UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size); 22 | UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /libraries/fc/src/interprocess/signals.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace fc 5 | { 6 | void set_signal_handler( std::function handler, int signal_num ) 7 | { 8 | std::shared_ptr sig_set(new boost::asio::signal_set(fc::asio::default_io_service(), signal_num)); 9 | sig_set->async_wait( 10 | [sig_set,handler]( const boost::system::error_code& err, int num ) 11 | { 12 | handler( num ); 13 | sig_set->cancel(); 14 | // set_signal_handler( handler, signal_num ); 15 | } ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /libraries/utilities/GitRevision.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define tichain_GIT_REVISION_SHA "7e7f255f185ffaf53397084f6ca747674088f176" 5 | #define tichain_GIT_REVISION_UNIX_TIMESTAMP 1488663957 6 | #define tichain_GIT_REVISION_DESCRIPTION "3.1.3" 7 | 8 | namespace TiValue { 9 | namespace utilities { 10 | 11 | const char* const git_revision_sha = tichain_GIT_REVISION_SHA; 12 | const uint32_t git_revision_unix_timestamp = tichain_GIT_REVISION_UNIX_TIMESTAMP; 13 | const char* const git_revision_description = tichain_GIT_REVISION_DESCRIPTION; 14 | 15 | } 16 | } // end namespace TiValue::utilities 17 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/network/ntp.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | namespace fc { 9 | 10 | namespace detail { class ntp_impl; } 11 | 12 | class ntp 13 | { 14 | public: 15 | ntp(); 16 | ~ntp(); 17 | 18 | void add_server( const std::string& hostname, uint16_t port = 123 ); 19 | void set_request_interval( uint32_t interval_sec ); 20 | void request_now(); 21 | optional get_time()const; 22 | 23 | private: 24 | std::unique_ptr my; 25 | }; 26 | 27 | } // namespace fc 28 | -------------------------------------------------------------------------------- /libraries/fc/vendor/easylzma/src/pavlov/7zCrc.h: -------------------------------------------------------------------------------- 1 | /* 7zCrc.h -- CRC32 calculation 2 | 2008-03-13 3 | Igor Pavlov 4 | Public domain */ 5 | 6 | #ifndef __7Z_CRC_H 7 | #define __7Z_CRC_H 8 | 9 | #include 10 | 11 | #include "Types.h" 12 | 13 | extern UInt32 g_CrcTable[]; 14 | 15 | void MY_FAST_CALL CrcGenerateTable(void); 16 | 17 | #define CRC_INIT_VAL 0xFFFFFFFF 18 | #define CRC_GET_DIGEST(crc) ((crc) ^ 0xFFFFFFFF) 19 | #define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) 20 | 21 | UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size); 22 | UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /libraries/blockchain/TransactionOperations.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | namespace TiValue { 4 | namespace blockchain { 5 | 6 | void TransactionOperation::evaluate(TransactionEvaluationState& eval_state)const 7 | { 8 | try { 9 | TransactionIdType id= eval_state.trx.result_trx_id; 10 | eval_state.evaluate(trx); 11 | eval_state._current_state->store(trx.id(), ResultTIdEntry(id)); 12 | eval_state._current_state->store(id, RequestIdEntry(trx.id())); 13 | } 14 | FC_CAPTURE_AND_RETHROW((*this)) 15 | } 16 | 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /utilities/git_revision.cpp.in: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define BITSHARES_GIT_REVISION_SHA "@BITSHARES_GIT_REVISION_SHA@" 5 | #define BITSHARES_GIT_REVISION_UNIX_TIMESTAMP @BITSHARES_GIT_REVISION_UNIX_TIMESTAMP@ 6 | #define BITSHARES_GIT_REVISION_DESCRIPTION "@BITSHARES_GIT_REVISION_DESCRIPTION@" 7 | 8 | namespace bts { namespace utilities { 9 | 10 | const char* const git_revision_sha = BITSHARES_GIT_REVISION_SHA; 11 | const uint32_t git_revision_unix_timestamp = BITSHARES_GIT_REVISION_UNIX_TIMESTAMP; 12 | const char* const git_revision_description = BITSHARES_GIT_REVISION_DESCRIPTION; 13 | 14 | } } // end namespace bts::utilities 15 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/TestReporterStdout.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TESTREPORTERSTDOUT_H 2 | #define UNITTEST_TESTREPORTERSTDOUT_H 3 | 4 | #include "TestReporter.h" 5 | 6 | namespace UnitTest { 7 | 8 | class UNITTEST_LINKAGE TestReporterStdout : public TestReporter 9 | { 10 | private: 11 | virtual void ReportTestStart(TestDetails const& test); 12 | virtual void ReportFailure(TestDetails const& test, char const* failure); 13 | virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed); 14 | virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed); 15 | }; 16 | 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /miniupnpc/connecthostport.h: -------------------------------------------------------------------------------- 1 | /* $Id: connecthostport.h,v 1.2 2012/06/23 22:32:33 nanard Exp $ */ 2 | /* Project: miniupnp 3 | * http://miniupnp.free.fr/ 4 | * Author: Thomas Bernard 5 | * Copyright (c) 2010-2012 Thomas Bernard 6 | * This software is subjects to the conditions detailed 7 | * in the LICENCE file provided within this distribution */ 8 | #ifndef CONNECTHOSTPORT_H_INCLUDED 9 | #define CONNECTHOSTPORT_H_INCLUDED 10 | 11 | /* connecthostport() 12 | * return a socket connected (TCP) to the host and port 13 | * or -1 in case of error */ 14 | int connecthostport(const char * host, unsigned short port, 15 | unsigned int scope_id); 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /fc/vendor/easylzma/src/pavlov/7zBuf.c: -------------------------------------------------------------------------------- 1 | /* 7zBuf.c -- Byte Buffer 2 | 2008-03-28 3 | Igor Pavlov 4 | Public domain */ 5 | 6 | #include "7zBuf.h" 7 | 8 | void Buf_Init(CBuf *p) 9 | { 10 | p->data = 0; 11 | p->size = 0; 12 | } 13 | 14 | int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc) 15 | { 16 | p->size = 0; 17 | if (size == 0) 18 | { 19 | p->data = 0; 20 | return 1; 21 | } 22 | p->data = (Byte *)alloc->Alloc(alloc, size); 23 | if (p->data != 0) 24 | { 25 | p->size = size; 26 | return 1; 27 | } 28 | return 0; 29 | } 30 | 31 | void Buf_Free(CBuf *p, ISzAlloc *alloc) 32 | { 33 | alloc->Free(alloc, p->data); 34 | p->data = 0; 35 | p->size = 0; 36 | } 37 | -------------------------------------------------------------------------------- /fc/src/network/resolve.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace fc 6 | { 7 | std::vector resolve( const fc::string& host, uint16_t port ) 8 | { 9 | auto ep = fc::asio::tcp::resolve( host, std::to_string(uint64_t(port)) ); 10 | std::vector eps; 11 | eps.reserve(ep.size()); 12 | for( auto itr = ep.begin(); itr != ep.end(); ++itr ) 13 | { 14 | if( itr->address().is_v4() ) 15 | { 16 | eps.push_back( fc::ip::endpoint(itr->address().to_v4().to_ulong(), itr->port()) ); 17 | } 18 | // TODO: add support for v6 19 | } 20 | return eps; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /libraries/fc/vendor/easylzma/src/pavlov/7zBuf.c: -------------------------------------------------------------------------------- 1 | /* 7zBuf.c -- Byte Buffer 2 | 2008-03-28 3 | Igor Pavlov 4 | Public domain */ 5 | 6 | #include "7zBuf.h" 7 | 8 | void Buf_Init(CBuf *p) 9 | { 10 | p->data = 0; 11 | p->size = 0; 12 | } 13 | 14 | int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc) 15 | { 16 | p->size = 0; 17 | if (size == 0) 18 | { 19 | p->data = 0; 20 | return 1; 21 | } 22 | p->data = (Byte *)alloc->Alloc(alloc, size); 23 | if (p->data != 0) 24 | { 25 | p->size = size; 26 | return 1; 27 | } 28 | return 0; 29 | } 30 | 31 | void Buf_Free(CBuf *p, ISzAlloc *alloc) 32 | { 33 | alloc->Free(alloc, p->data); 34 | p->data = 0; 35 | p->size = 0; 36 | } 37 | -------------------------------------------------------------------------------- /miniupnpc/miniupnpctypes.h: -------------------------------------------------------------------------------- 1 | /* $Id: miniupnpctypes.h,v 1.1 2011/02/15 11:10:40 nanard Exp $ */ 2 | /* Miniupnp project : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2011 Thomas Bernard 5 | * This software is subject to the conditions detailed in the 6 | * LICENCE file provided within this distribution */ 7 | #ifndef MINIUPNPCTYPES_H_INCLUDED 8 | #define MINIUPNPCTYPES_H_INCLUDED 9 | 10 | #if (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) 11 | #define UNSIGNED_INTEGER unsigned long long 12 | #define STRTOUI strtoull 13 | #else 14 | #define UNSIGNED_INTEGER unsigned int 15 | #define STRTOUI strtoul 16 | #endif 17 | 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /secp256k1-zkp/src/num_gmp.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_NUM_REPR_ 8 | #define _SECP256K1_NUM_REPR_ 9 | 10 | #include 11 | 12 | #define NUM_LIMBS ((256+GMP_NUMB_BITS-1)/GMP_NUMB_BITS) 13 | 14 | typedef struct { 15 | mp_limb_t data[2*NUM_LIMBS]; 16 | int neg; 17 | int limbs; 18 | } secp256k1_num_t; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /libraries/fc/src/network/resolve.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace fc 6 | { 7 | std::vector resolve( const fc::string& host, uint16_t port ) 8 | { 9 | auto ep = fc::asio::tcp::resolve( host, std::to_string(uint64_t(port)) ); 10 | std::vector eps; 11 | eps.reserve(ep.size()); 12 | for( auto itr = ep.begin(); itr != ep.end(); ++itr ) 13 | { 14 | if( itr->address().is_v4() ) 15 | { 16 | eps.push_back( fc::ip::endpoint(itr->address().to_v4().to_ulong(), itr->port()) ); 17 | } 18 | // TODO: add support for v6 19 | } 20 | return eps; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fc/vendor/easylzma/src/pavlov/Alloc.h: -------------------------------------------------------------------------------- 1 | /* Alloc.h -- Memory allocation functions 2 | 2008-03-13 3 | Igor Pavlov 4 | Public domain */ 5 | 6 | #ifndef __COMMON_ALLOC_H 7 | #define __COMMON_ALLOC_H 8 | 9 | #include 10 | 11 | void *MyAlloc(size_t size); 12 | void MyFree(void *address); 13 | 14 | #ifdef _WIN32 15 | 16 | void SetLargePageSize(); 17 | 18 | void *MidAlloc(size_t size); 19 | void MidFree(void *address); 20 | void *BigAlloc(size_t size); 21 | void BigFree(void *address); 22 | 23 | #else 24 | 25 | #define MidAlloc(size) MyAlloc(size) 26 | #define MidFree(address) MyFree(address) 27 | #define BigAlloc(size) MyAlloc(size) 28 | #define BigFree(address) MyFree(address) 29 | 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/TestReporter.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TESTREPORTER_H 2 | #define UNITTEST_TESTREPORTER_H 3 | 4 | #include "HelperMacros.h" 5 | 6 | namespace UnitTest { 7 | 8 | class TestDetails; 9 | 10 | class UNITTEST_LINKAGE TestReporter 11 | { 12 | public: 13 | virtual ~TestReporter(); 14 | 15 | virtual void ReportTestStart(TestDetails const& test) = 0; 16 | virtual void ReportFailure(TestDetails const& test, char const* failure) = 0; 17 | virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed) = 0; 18 | virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed) = 0; 19 | }; 20 | 21 | } 22 | #endif 23 | -------------------------------------------------------------------------------- /libraries/include/blockchain/Checkpoints.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace TiValue { 5 | namespace blockchain { 6 | namespace detail{ 7 | 8 | static std::map CHECKPOINT_BLOCKS 9 | { 10 | //{ 1246900, TiValue::blockchain::block_id_type( "b5214c1bc914ea5da6c1bb8f774d07f12b85dbe2" ) }, 11 | //{ 1279500, TiValue::blockchain::block_id_type( "488313d2c1c85bdec117bac0379f7b17f7cfbed3" ) } 12 | }; 13 | // Initialized in load_checkpoints() 14 | static uint32_t LAST_CHECKPOINT_BLOCK_NUM = 0; 15 | 16 | } 17 | } 18 | } // TiValue::blockchain 19 | -------------------------------------------------------------------------------- /libraries/include/contract_engine/contract_engine_builder.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace blockchain 7 | { 8 | namespace contract_engine 9 | { 10 | typedef ::glua::GluaContractEngine ActiveContractEngine; 11 | 12 | class ContractEngineBuilder 13 | { 14 | private: 15 | std::shared_ptr _engine; 16 | public: 17 | virtual ~ContractEngineBuilder(); 18 | ContractEngineBuilder *set_use_contract(bool use_contract); 19 | ContractEngineBuilder *set_caller(std::string caller, std::string caller_address); 20 | std::shared_ptr build(); 21 | }; 22 | } 23 | } -------------------------------------------------------------------------------- /miniupnpc/upnperrors.h: -------------------------------------------------------------------------------- 1 | /* $Id: upnperrors.h,v 1.2 2008/07/02 23:31:15 nanard Exp $ */ 2 | /* (c) 2007 Thomas Bernard 3 | * All rights reserved. 4 | * MiniUPnP Project. 5 | * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 6 | * This software is subjet to the conditions detailed in the 7 | * provided LICENCE file. */ 8 | #ifndef UPNPERRORS_H_INCLUDED 9 | #define UPNPERRORS_H_INCLUDED 10 | 11 | #include "declspec.h" 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /* strupnperror() 18 | * Return a string description of the UPnP error code 19 | * or NULL for undefinded errors */ 20 | LIBSPEC const char * strupnperror(int err); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fc/include/fc/crypto/dh.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc { 6 | 7 | struct diffie_hellman { 8 | diffie_hellman():valid(0),g(5){} 9 | bool generate_params( int s, uint8_t g ); 10 | bool generate_pub_key(); 11 | bool compute_shared_key( const char* buf, uint32_t s ); 12 | bool compute_shared_key( const std::vector& pubk); 13 | bool validate(); 14 | 15 | std::vector p; 16 | std::vector pub_key; 17 | std::vector priv_key; 18 | std::vector shared_key; 19 | bool valid; 20 | uint8_t g; 21 | }; 22 | 23 | } // namespace fc 24 | 25 | 26 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/tutorials/broadcast_tutorial/broadcast_tutorial.md: -------------------------------------------------------------------------------- 1 | Broadcast Tutorial 2 | ================== 3 | 4 | This tutorial will dig into some more nitty gritty details on how to build high 5 | scalability, high performance websocket servers for broadcast like workflows. 6 | 7 | Will go into features like: 8 | - minimizing work done in handlers 9 | - using asio thread pool mode 10 | - teaming multiple endpoints 11 | - setting accept queue depth 12 | - tuning compile time buffer sizes 13 | - prepared messages 14 | - flow control 15 | - basic operating system level tuning, particularly increasing file descriptor limits. 16 | - measuring performance with wsperf / autobahn 17 | - tuning permessage-deflate compression settings -------------------------------------------------------------------------------- /libraries/fc/vendor/easylzma/src/pavlov/Alloc.h: -------------------------------------------------------------------------------- 1 | /* Alloc.h -- Memory allocation functions 2 | 2008-03-13 3 | Igor Pavlov 4 | Public domain */ 5 | 6 | #ifndef __COMMON_ALLOC_H 7 | #define __COMMON_ALLOC_H 8 | 9 | #include 10 | 11 | void *MyAlloc(size_t size); 12 | void MyFree(void *address); 13 | 14 | #ifdef _WIN32 15 | 16 | void SetLargePageSize(); 17 | 18 | void *MidAlloc(size_t size); 19 | void MidFree(void *address); 20 | void *BigAlloc(size_t size); 21 | void BigFree(void *address); 22 | 23 | #else 24 | 25 | #define MidAlloc(size) MyAlloc(size) 26 | #define MidFree(address) MyFree(address) 27 | #define BigAlloc(size) MyAlloc(size) 28 | #define BigFree(address) MyFree(address) 29 | 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/ExceptionMacros.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_EXCEPTIONMACROS_H 2 | #define UNITTEST_EXCEPTIONMACROS_H 3 | 4 | #include "Config.h" 5 | 6 | #ifndef UNITTEST_NO_EXCEPTIONS 7 | #define UT_TRY(x) try x 8 | #define UT_THROW(x) throw x 9 | #define UT_RETHROW(ExceptionType) catch(ExceptionType&) { throw; } 10 | #define UT_CATCH(ExceptionType, ExceptionName, CatchBody) catch(ExceptionType& ExceptionName) CatchBody 11 | #define UT_CATCH_ALL(CatchBody) catch(...) CatchBody 12 | #else 13 | #define UT_TRY(x) x 14 | #define UT_THROW(x) 15 | #define UT_RETHROW(ExceptionType) 16 | #define UT_CATCH(ExceptionType, ExceptionName, CatchBody) 17 | #define UT_CATCH_ALL(CatchBody) 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /libraries/include/wallet/Config.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define TIV_WALLET_VERSION uint32_t( 109 ) 4 | 5 | #define TIV_WALLET_MIN_PASSWORD_LENGTH 8 6 | #define TIV_WALLET_MIN_BRAINKEY_LENGTH 32 7 | 8 | #define TIV_WALLET_DEFAULT_UNLOCK_TIME_SEC ( 60 * 60 ) 9 | 10 | #define TIV_WALLET_DEFAULT_TRANSACTION_FEE 1000 // XTS 11 | 12 | #define TIV_WALLET_DEFAULT_TRANSACTION_FEE_RATE 0.002 13 | #define TIV_WALLET_LEAST_TRANSACTION_FEE 10000 14 | 15 | #define TIV_WALLET_DEFAULT_TRANSACTION_EXPIRATION_SEC ( 60 * 60 ) 16 | 17 | #define WALLET_DEFAULT_MARKET_TRANSACTION_EXPIRATION_SEC ( 60 * 10 ) 18 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/dh.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc { 6 | 7 | struct diffie_hellman { 8 | diffie_hellman():valid(0),g(5){} 9 | bool generate_params( int s, uint8_t g ); 10 | bool generate_pub_key(); 11 | bool compute_shared_key( const char* buf, uint32_t s ); 12 | bool compute_shared_key( const std::vector& pubk); 13 | bool validate(); 14 | 15 | std::vector p; 16 | std::vector pub_key; 17 | std::vector priv_key; 18 | std::vector shared_key; 19 | bool valid; 20 | uint8_t g; 21 | }; 22 | 23 | } // namespace fc 24 | 25 | 26 | -------------------------------------------------------------------------------- /fc/vendor/boost_1.51/include/boost/process.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Boost.Process 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2006, 2007 Julio M. Merino Vidal 6 | // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling 7 | // Copyright (c) 2009 Boris Schaeling 8 | // Copyright (c) 2010 Felipe Tanus, Boris Schaeling 9 | // 10 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 11 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 12 | // 13 | 14 | /** 15 | * \file boost/process.hpp 16 | * 17 | * Convenience header that includes all public Boost.Process header files. 18 | */ 19 | 20 | #ifndef BOOST_PROCESS_HPP 21 | #define BOOST_PROCESS_HPP 22 | 23 | #include 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /fc/vendor/easylzma/src/pavlov/7zBuf.h: -------------------------------------------------------------------------------- 1 | /* 7zBuf.h -- Byte Buffer 2 | 2008-10-04 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_BUF_H 5 | #define __7Z_BUF_H 6 | 7 | #include "Types.h" 8 | 9 | typedef struct 10 | { 11 | Byte *data; 12 | size_t size; 13 | } CBuf; 14 | 15 | void Buf_Init(CBuf *p); 16 | int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc); 17 | void Buf_Free(CBuf *p, ISzAlloc *alloc); 18 | 19 | typedef struct 20 | { 21 | Byte *data; 22 | size_t size; 23 | size_t pos; 24 | } CDynBuf; 25 | 26 | void DynBuf_Construct(CDynBuf *p); 27 | void DynBuf_SeekToBeg(CDynBuf *p); 28 | int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc); 29 | void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /fc/include/fc/network/tcp_socket_io_hooks.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace fc 5 | { 6 | class tcp_socket_io_hooks 7 | { 8 | public: 9 | virtual ~tcp_socket_io_hooks() {} 10 | virtual size_t readsome(boost::asio::ip::tcp::socket& socket, char* buffer, size_t length) = 0; 11 | virtual size_t readsome(boost::asio::ip::tcp::socket& socket, const std::shared_ptr& buffer, size_t length, size_t offset) = 0; 12 | virtual size_t writesome(boost::asio::ip::tcp::socket& socket, const char* buffer, size_t length) = 0; 13 | virtual size_t writesome(boost::asio::ip::tcp::socket& socket, const std::shared_ptr& buffer, size_t length, size_t offset) = 0; 14 | }; 15 | } // namesapce fc 16 | -------------------------------------------------------------------------------- /libraries/fc/vendor/boost_1.51/include/boost/process.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Boost.Process 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2006, 2007 Julio M. Merino Vidal 6 | // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling 7 | // Copyright (c) 2009 Boris Schaeling 8 | // Copyright (c) 2010 Felipe Tanus, Boris Schaeling 9 | // 10 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 11 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 12 | // 13 | 14 | /** 15 | * \file boost/process.hpp 16 | * 17 | * Convenience header that includes all public Boost.Process header files. 18 | */ 19 | 20 | #ifndef BOOST_PROCESS_HPP 21 | #define BOOST_PROCESS_HPP 22 | 23 | #include 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /libraries/fc/vendor/easylzma/src/pavlov/7zBuf.h: -------------------------------------------------------------------------------- 1 | /* 7zBuf.h -- Byte Buffer 2 | 2008-10-04 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_BUF_H 5 | #define __7Z_BUF_H 6 | 7 | #include "Types.h" 8 | 9 | typedef struct 10 | { 11 | Byte *data; 12 | size_t size; 13 | } CBuf; 14 | 15 | void Buf_Init(CBuf *p); 16 | int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc); 17 | void Buf_Free(CBuf *p, ISzAlloc *alloc); 18 | 19 | typedef struct 20 | { 21 | Byte *data; 22 | size_t size; 23 | size_t pos; 24 | } CDynBuf; 25 | 26 | void DynBuf_Construct(CDynBuf *p); 27 | void DynBuf_SeekToBeg(CDynBuf *p); 28 | int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc); 29 | void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /fc/src/crypto/salsa20.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | extern "C" { 3 | #include 4 | } 5 | 6 | namespace fc 7 | { 8 | static bool salsa20_init = []() -> bool { ECRYPT_init(); return true; }(); 9 | 10 | void salsa20_encrypt( const fc::sha256& key, uint64_t iv, const char* plain, char* cipher, uint64_t len ) 11 | { 12 | ECRYPT_ctx ctx; 13 | ECRYPT_keysetup( &ctx, (unsigned char*)&key, ECRYPT_MAXIVSIZE, ECRYPT_MAXKEYSIZE ); 14 | ECRYPT_ivsetup( &ctx, (unsigned char*)&iv ); 15 | 16 | ECRYPT_encrypt_bytes( &ctx, (const unsigned char*)plain, (unsigned char*)cipher, len ); 17 | } 18 | void salsa20_decrypt( const fc::sha256& key, uint64_t iv, const char* cipher, char* plain, uint64_t len ) 19 | { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/network/tcp_socket_io_hooks.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace fc 5 | { 6 | class tcp_socket_io_hooks 7 | { 8 | public: 9 | virtual ~tcp_socket_io_hooks() {} 10 | virtual size_t readsome(boost::asio::ip::tcp::socket& socket, char* buffer, size_t length) = 0; 11 | virtual size_t readsome(boost::asio::ip::tcp::socket& socket, const std::shared_ptr& buffer, size_t length, size_t offset) = 0; 12 | virtual size_t writesome(boost::asio::ip::tcp::socket& socket, const char* buffer, size_t length) = 0; 13 | virtual size_t writesome(boost::asio::ip::tcp::socket& socket, const std::shared_ptr& buffer, size_t length, size_t offset) = 0; 14 | }; 15 | } // namesapce fc 16 | -------------------------------------------------------------------------------- /libraries/fc/src/crypto/salsa20.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | extern "C" { 3 | #include 4 | } 5 | 6 | namespace fc 7 | { 8 | static bool salsa20_init = []() -> bool { ECRYPT_init(); return true; }(); 9 | 10 | void salsa20_encrypt( const fc::sha256& key, uint64_t iv, const char* plain, char* cipher, uint64_t len ) 11 | { 12 | ECRYPT_ctx ctx; 13 | ECRYPT_keysetup( &ctx, (unsigned char*)&key, ECRYPT_MAXIVSIZE, ECRYPT_MAXKEYSIZE ); 14 | ECRYPT_ivsetup( &ctx, (unsigned char*)&iv ); 15 | 16 | ECRYPT_encrypt_bytes( &ctx, (const unsigned char*)plain, (unsigned char*)cipher, len ); 17 | } 18 | void salsa20_decrypt( const fc::sha256& key, uint64_t iv, const char* cipher, char* plain, uint64_t len ) 19 | { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fc/include/fc/thread/priority.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _FC_PRIORITY_HPP_ 2 | #define _FC_PRIORITY_HPP_ 3 | 4 | namespace fc { 5 | /** 6 | * An integer value used to sort asynchronous tasks. The higher the 7 | * prioirty the sooner it will be run. 8 | */ 9 | class priority { 10 | public: 11 | explicit priority( int v = 0):value(v){} 12 | priority( const priority& p ):value(p.value){} 13 | bool operator < ( const priority& p )const { 14 | return value < p.value; 15 | } 16 | static priority max() { return priority(10000); } 17 | static priority min() { return priority(-10000); } 18 | static priority _internal__priority_for_short_sleeps() { return priority(-100000); } 19 | int value; 20 | }; 21 | } 22 | #endif // _FC_PRIORITY_HPP_ 23 | -------------------------------------------------------------------------------- /fc/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Compiled Dynamic libraries 8 | *.so 9 | *.dylib 10 | *.dll 11 | 12 | # Compiled Static libraries 13 | *.lai 14 | *.la 15 | *.a 16 | *.lib 17 | 18 | #CMake->MSVC artifacts 19 | *.sln 20 | *.vcxproj 21 | ALL_BUILD 22 | ZERO_CHECK 23 | 24 | #MSVC secondary artifacts 25 | *.suo 26 | *.vcxproj.filters 27 | *.vcxproj.user 28 | *.pdb 29 | *.ilk 30 | *.lastbuildstate 31 | *.sdf 32 | *.opensdf 33 | Debug/ 34 | Release/ 35 | 36 | CMakeCache.txt 37 | CMakeFiles 38 | Makefile 39 | *.cmake 40 | *.cbp 41 | 42 | libfc.a 43 | libfc_debug.a 44 | 45 | *.sw* 46 | 47 | fc_automoc.cpp 48 | git_revision.cpp 49 | GitSHA3.cpp 50 | 51 | lzma_test 52 | ntp_test 53 | task_cancel_test 54 | udt_client 55 | udt_server 56 | -------------------------------------------------------------------------------- /fc/include/fc/container/flat_fwd.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc { 6 | 7 | using boost::container::flat_map; 8 | using boost::container::flat_set; 9 | 10 | namespace raw { 11 | template 12 | void pack( Stream& s, const flat_set& value ); 13 | template 14 | void unpack( Stream& s, flat_set& value ); 15 | template 16 | void pack( Stream& s, const flat_map& value ); 17 | template 18 | void unpack( Stream& s, flat_map& value ) ; 19 | } // namespace raw 20 | 21 | } // fc 22 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/.gitattributes: -------------------------------------------------------------------------------- 1 | # Lineendings 2 | *.sln eol=crlf 3 | *.vcproj eol=crlf 4 | *.vcxproj* eol=crlf 5 | 6 | # Whitespace rules 7 | # strict (no trailing, no tabs) 8 | *.cpp whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol 9 | *.hpp whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol 10 | *.c whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol 11 | *.h whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol 12 | 13 | # normal (no trailing) 14 | *.sql whitespace=trailing-space,space-before-tab,cr-at-eol 15 | *.txt whitespace=trailing-space,space-before-tab,cr-at-eol 16 | 17 | # special files which must ignore whitespace 18 | *.patch whitespace=-trailing-space 19 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/thread/priority.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _FC_PRIORITY_HPP_ 2 | #define _FC_PRIORITY_HPP_ 3 | 4 | namespace fc { 5 | /** 6 | * An integer value used to sort asynchronous tasks. The higher the 7 | * prioirty the sooner it will be run. 8 | */ 9 | class priority { 10 | public: 11 | explicit priority( int v = 0):value(v){} 12 | priority( const priority& p ):value(p.value){} 13 | bool operator < ( const priority& p )const { 14 | return value < p.value; 15 | } 16 | static priority max() { return priority(10000); } 17 | static priority min() { return priority(-10000); } 18 | static priority _internal__priority_for_short_sleeps() { return priority(-100000); } 19 | int value; 20 | }; 21 | } 22 | #endif // _FC_PRIORITY_HPP_ 23 | -------------------------------------------------------------------------------- /libraries/fc/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Compiled Dynamic libraries 8 | *.so 9 | *.dylib 10 | *.dll 11 | 12 | # Compiled Static libraries 13 | *.lai 14 | *.la 15 | *.a 16 | *.lib 17 | 18 | #CMake->MSVC artifacts 19 | *.sln 20 | *.vcxproj 21 | ALL_BUILD 22 | ZERO_CHECK 23 | 24 | #MSVC secondary artifacts 25 | *.suo 26 | *.vcxproj.filters 27 | *.vcxproj.user 28 | *.pdb 29 | *.ilk 30 | *.lastbuildstate 31 | *.sdf 32 | *.opensdf 33 | Debug/ 34 | Release/ 35 | 36 | CMakeCache.txt 37 | CMakeFiles 38 | Makefile 39 | *.cmake 40 | *.cbp 41 | 42 | libfc.a 43 | libfc_debug.a 44 | 45 | *.sw* 46 | 47 | fc_automoc.cpp 48 | git_revision.cpp 49 | GitSHA3.cpp 50 | 51 | lzma_test 52 | ntp_test 53 | task_cancel_test 54 | udt_client 55 | udt_server 56 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/container/flat_fwd.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc { 6 | 7 | using boost::container::flat_map; 8 | using boost::container::flat_set; 9 | 10 | namespace raw { 11 | template 12 | void pack( Stream& s, const flat_set& value ); 13 | template 14 | void unpack( Stream& s, flat_set& value ); 15 | template 16 | void pack( Stream& s, const flat_map& value ); 17 | template 18 | void unpack( Stream& s, flat_map& value ) ; 19 | } // namespace raw 20 | 21 | } // fc 22 | -------------------------------------------------------------------------------- /secp256k1-zkp/src/num_impl.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_NUM_IMPL_H_ 8 | #define _SECP256K1_NUM_IMPL_H_ 9 | 10 | #if defined HAVE_CONFIG_H 11 | #include "libsecp256k1-config.h" 12 | #endif 13 | 14 | #include "num.h" 15 | 16 | #if defined(USE_NUM_GMP) 17 | #include "num_gmp_impl.h" 18 | #elif defined(USE_NUM_NONE) 19 | /* Nothing. */ 20 | #else 21 | #error "Please select num implementation" 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/sip_client/SConscript: -------------------------------------------------------------------------------- 1 | ## SIP client example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is avaliable build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('sip_client', ["sip_client.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system','random'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('sip_client', ["sip_client.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /secp256k1-zkp/src/scalar_8x32.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_SCALAR_REPR_ 8 | #define _SECP256K1_SCALAR_REPR_ 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef struct { 14 | uint32_t d[8]; 15 | } secp256k1_scalar_t; 16 | 17 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7)}} 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /fc/src/utf8.cpp: -------------------------------------------------------------------------------- 1 | #include "fc/utf8.hpp" 2 | 3 | #include "utf8/checked.h" 4 | #include "utf8/core.h" 5 | #include "utf8/unchecked.h" 6 | 7 | #include 8 | 9 | namespace fc { 10 | 11 | bool is_utf8( const std::string& str ) 12 | { 13 | return utf8::is_valid( str.begin(), str.end() ); 14 | } 15 | 16 | void decodeUtf8(const std::string& input, std::wstring* storage) 17 | { 18 | assert(storage != nullptr); 19 | 20 | utf8::utf8to32(input.begin(), input.end(), std::back_inserter(*storage)); 21 | } 22 | 23 | void encodeUtf8(const std::wstring& input, std::string* storage) 24 | { 25 | assert(storage != nullptr); 26 | 27 | utf8::utf32to8(input.begin(), input.end(), std::back_inserter(*storage)); 28 | } 29 | 30 | } ///namespace fc 31 | 32 | 33 | -------------------------------------------------------------------------------- /fc/vendor/easylzma/src/pavlov/Bcj2.h: -------------------------------------------------------------------------------- 1 | /* Bcj2.h -- Converter for x86 code (BCJ2) 2 | 2008-10-04 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __BCJ2_H 5 | #define __BCJ2_H 6 | 7 | #include "Types.h" 8 | 9 | /* 10 | Conditions: 11 | outSize <= FullOutputSize, 12 | where FullOutputSize is full size of output stream of x86_2 filter. 13 | 14 | If buf0 overlaps outBuf, there are two required conditions: 15 | 1) (buf0 >= outBuf) 16 | 2) (buf0 + size0 >= outBuf + FullOutputSize). 17 | 18 | Returns: 19 | SZ_OK 20 | SZ_ERROR_DATA - Data error 21 | */ 22 | 23 | int Bcj2_Decode( 24 | const Byte *buf0, SizeT size0, 25 | const Byte *buf1, SizeT size1, 26 | const Byte *buf2, SizeT size2, 27 | const Byte *buf3, SizeT size3, 28 | Byte *outBuf, SizeT outSize); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/debug_server/SConscript: -------------------------------------------------------------------------------- 1 | ## Debug server example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('debug_server', ["debug_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('debug_server', ["debug_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/echo_server/SConscript: -------------------------------------------------------------------------------- 1 | ## Main development example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('echo_server', ["echo_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('echo_server', ["echo_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/print_server/SConscript: -------------------------------------------------------------------------------- 1 | ## Print server example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('print_server', ["print_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('print_server', ["print_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/testee_server/SConscript: -------------------------------------------------------------------------------- 1 | ## Autobahn Testee Server 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('testee_server', ["testee_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('testee_server', ["testee_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /leveldb/helpers/memenv/memenv.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 6 | #define STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 7 | 8 | namespace leveldb { 9 | 10 | class Env; 11 | 12 | // Returns a new environment that stores its data in memory and delegates 13 | // all non-file-storage tasks to base_env. The caller must delete the result 14 | // when it is no longer needed. 15 | // *base_env must remain live while the result is in use. 16 | Env* NewMemEnv(Env* base_env); 17 | 18 | } // namespace leveldb 19 | 20 | #endif // STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 21 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/Test.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TEST_H 2 | #define UNITTEST_TEST_H 3 | 4 | #include "TestDetails.h" 5 | 6 | namespace UnitTest { 7 | 8 | class TestResults; 9 | class TestList; 10 | 11 | class UNITTEST_LINKAGE Test 12 | { 13 | public: 14 | explicit Test(char const* testName, char const* suiteName = "DefaultSuite", char const* filename = "", int lineNumber = 0); 15 | virtual ~Test(); 16 | void Run(); 17 | 18 | TestDetails const m_details; 19 | Test* m_nextTest; 20 | 21 | mutable bool m_isMockTest; 22 | 23 | static TestList& GetTestList(); 24 | 25 | virtual void RunImpl() const; 26 | 27 | private: 28 | Test(Test const&); 29 | Test& operator =(Test const&); 30 | }; 31 | 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /miniupnpc/receivedata.h: -------------------------------------------------------------------------------- 1 | /* $Id: receivedata.h,v 1.3 2012/06/23 22:34:47 nanard Exp $ */ 2 | /* Project: miniupnp 3 | * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 4 | * Author: Thomas Bernard 5 | * Copyright (c) 2011-2012 Thomas Bernard 6 | * This software is subjects to the conditions detailed 7 | * in the LICENCE file provided within this distribution */ 8 | #ifndef RECEIVEDATA_H_INCLUDED 9 | #define RECEIVEDATA_H_INCLUDED 10 | 11 | /* Reads data from the specified socket. 12 | * Returns the number of bytes read if successful, zero if no bytes were 13 | * read or if we timed out. Returns negative if there was an error. */ 14 | int receivedata(int socket, 15 | char * data, int length, 16 | int timeout, unsigned int * scope_id); 17 | 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /libraries/fc/src/utf8.cpp: -------------------------------------------------------------------------------- 1 | #include "fc/utf8.hpp" 2 | 3 | #include "utf8/checked.h" 4 | #include "utf8/core.h" 5 | #include "utf8/unchecked.h" 6 | 7 | #include 8 | 9 | namespace fc { 10 | 11 | bool is_utf8( const std::string& str ) 12 | { 13 | return utf8::is_valid( str.begin(), str.end() ); 14 | } 15 | 16 | void decodeUtf8(const std::string& input, std::wstring* storage) 17 | { 18 | assert(storage != nullptr); 19 | 20 | utf8::utf8to32(input.begin(), input.end(), std::back_inserter(*storage)); 21 | } 22 | 23 | void encodeUtf8(const std::wstring& input, std::string* storage) 24 | { 25 | assert(storage != nullptr); 26 | 27 | utf8::utf32to8(input.begin(), input.end(), std::back_inserter(*storage)); 28 | } 29 | 30 | } ///namespace fc 31 | 32 | 33 | -------------------------------------------------------------------------------- /libraries/fc/vendor/easylzma/src/pavlov/Bcj2.h: -------------------------------------------------------------------------------- 1 | /* Bcj2.h -- Converter for x86 code (BCJ2) 2 | 2008-10-04 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __BCJ2_H 5 | #define __BCJ2_H 6 | 7 | #include "Types.h" 8 | 9 | /* 10 | Conditions: 11 | outSize <= FullOutputSize, 12 | where FullOutputSize is full size of output stream of x86_2 filter. 13 | 14 | If buf0 overlaps outBuf, there are two required conditions: 15 | 1) (buf0 >= outBuf) 16 | 2) (buf0 + size0 >= outBuf + FullOutputSize). 17 | 18 | Returns: 19 | SZ_OK 20 | SZ_ERROR_DATA - Data error 21 | */ 22 | 23 | int Bcj2_Decode( 24 | const Byte *buf0, SizeT size0, 25 | const Byte *buf1, SizeT size1, 26 | const Byte *buf2, SizeT size2, 27 | const Byte *buf3, SizeT size3, 28 | Byte *outBuf, SizeT outSize); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/iostream_server/SConscript: -------------------------------------------------------------------------------- 1 | ## iostream server example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('iostream_server', ["iostream_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('iostream_server', ["iostream_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/leveldb/helpers/memenv/memenv.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 6 | #define STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 7 | 8 | namespace leveldb { 9 | 10 | class Env; 11 | 12 | // Returns a new environment that stores its data in memory and delegates 13 | // all non-file-storage tasks to base_env. The caller must delete the result 14 | // when it is no longer needed. 15 | // *base_env must remain live while the result is in use. 16 | Env* NewMemEnv(Env* base_env); 17 | 18 | } // namespace leveldb 19 | 20 | #endif // STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 21 | -------------------------------------------------------------------------------- /fc/tests/compress.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main( int argc, char** ) 6 | { 7 | std::string line; 8 | std::getline( std::cin, line ); 9 | while( std::cin && line != "q" ) 10 | { 11 | try { 12 | 13 | std::string compressed = fc::smaz_compress( line ); 14 | std::cout<<"compressed size: "< 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | namespace fc { 8 | 9 | void rand_bytes(char* buf, int count) 10 | { 11 | static int init = init_openssl(); 12 | 13 | int result = RAND_bytes((unsigned char*)buf, count); 14 | if (result != 1) 15 | FC_THROW("Error calling OpenSSL's RAND_bytes(): ${code}", ("code", (uint32_t)ERR_get_error())); 16 | } 17 | 18 | void rand_pseudo_bytes(char* buf, int count) 19 | { 20 | static int init = init_openssl(); 21 | 22 | int result = RAND_pseudo_bytes((unsigned char*)buf, count); 23 | if (result == -1) 24 | FC_THROW("Error calling OpenSSL's RAND_pseudo_bytes(): ${code}", ("code", (uint32_t)ERR_get_error())); 25 | } 26 | 27 | } // namespace fc 28 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/telemetry_server/SConscript: -------------------------------------------------------------------------------- 1 | ## Main development example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('telemetry_server', ["telemetry_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('telemetry_server', ["telemetry_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/broadcast_server/SConscript: -------------------------------------------------------------------------------- 1 | ## Broadcast Server example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('broadcast_server', ["broadcast_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system','thread'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('broadcast_server', ["broadcast_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/telemetry_client/SConscript: -------------------------------------------------------------------------------- 1 | ## Telemetry client example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('telemetry_client', ["telemetry_client.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system','random'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('telemetry_client', ["telemetry_client.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/tests/compress.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main( int argc, char** ) 6 | { 7 | std::string line; 8 | std::getline( std::cin, line ); 9 | while( std::cin && line != "q" ) 10 | { 11 | try { 12 | 13 | std::string compressed = fc::smaz_compress( line ); 14 | std::cout<<"compressed size: "< 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | namespace fc { 8 | 9 | void rand_bytes(char* buf, int count) 10 | { 11 | static int init = init_openssl(); 12 | 13 | int result = RAND_bytes((unsigned char*)buf, count); 14 | if (result != 1) 15 | FC_THROW("Error calling OpenSSL's RAND_bytes(): ${code}", ("code", (uint32_t)ERR_get_error())); 16 | } 17 | 18 | void rand_pseudo_bytes(char* buf, int count) 19 | { 20 | static int init = init_openssl(); 21 | 22 | int result = RAND_pseudo_bytes((unsigned char*)buf, count); 23 | if (result == -1) 24 | FC_THROW("Error calling OpenSSL's RAND_pseudo_bytes(): ${code}", ("code", (uint32_t)ERR_get_error())); 25 | } 26 | 27 | } // namespace fc 28 | -------------------------------------------------------------------------------- /libraries/include/glua/glua_disassemble.h: -------------------------------------------------------------------------------- 1 | #ifndef glua_disassemble_h 2 | #define glua_disassemble_h 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace glua { 11 | namespace decompile { 12 | 13 | #define CC(r) (ISK((r)) ? 'K' : 'R') 14 | #define CV(r) (ISK((r)) ? INDEXK(r) : r) 15 | 16 | #define RK(r) (RegOrConst(f, r)) 17 | 18 | #define MAXCONSTSIZE 1024 19 | 20 | std::string luadec_disassemble(GluaDecompileContextP ctx, Proto* fwork, int dflag, std::string name); 21 | 22 | void luadec_disassembleSubFunction(GluaDecompileContextP ctx, Proto* f, int dflag, const char* funcnumstr); 23 | 24 | std::string RegOrConst(const Proto* f, int r); 25 | 26 | } 27 | } 28 | 29 | #endif // #ifndef glua_disassemble_h 30 | -------------------------------------------------------------------------------- /libraries/include/net/ChainServerCommands.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * This is an internal header for tiv. It does not contain any classes or functions intended for clients. 5 | * It exists purely as an implementation detail, and may change at any time without notice. 6 | */ 7 | 8 | #include 9 | 10 | const static uint32_t PROTOCOL_VERSION = 0; 11 | 12 | namespace TiValue { 13 | namespace net { 14 | namespace detail { 15 | enum ChainServerCommands { 16 | finish = 0, 17 | get_blocks_from_number 18 | }; 19 | } 20 | } 21 | } //namespace TiValue::net::detail 22 | 23 | FC_REFLECT_ENUM(TiValue::net::detail::ChainServerCommands, (finish)(get_blocks_from_number)) 24 | FC_REFLECT_TYPENAME(TiValue::net::detail::ChainServerCommands) 25 | -------------------------------------------------------------------------------- /libraries/include/rpc/RpcClientApi.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | namespace TiValue { 12 | namespace rpc { 13 | namespace detail { class RpcClientImpl; } 14 | 15 | using namespace TiValue::blockchain; 16 | using namespace TiValue::wallet; 17 | 18 | typedef vector > Balances; 19 | 20 | enum GenerateTransactionFlag 21 | { 22 | sign_and_broadcast = 0, 23 | do_not_broadcast = 1, 24 | do_not_sign = 2 25 | }; 26 | 27 | } 28 | } // TiValue::rpc 29 | FC_REFLECT_ENUM(TiValue::rpc::GenerateTransactionFlag, (do_not_broadcast)(do_not_sign)(sign_and_broadcast)) 30 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/TestDetails.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TESTDETAILS_H 2 | #define UNITTEST_TESTDETAILS_H 3 | 4 | #include "HelperMacros.h" 5 | 6 | namespace UnitTest { 7 | 8 | class UNITTEST_LINKAGE TestDetails 9 | { 10 | public: 11 | TestDetails(char const* testName, char const* suiteName, char const* filename, int lineNumber); 12 | TestDetails(const TestDetails& details, int lineNumber); 13 | 14 | char const* const suiteName; 15 | char const* const testName; 16 | char const* const filename; 17 | int const lineNumber; 18 | mutable bool timeConstraintExempt; 19 | 20 | TestDetails(TestDetails const&); // Why is it public? --> http://gcc.gnu.org/bugs.html#cxx_rvalbind 21 | private: 22 | TestDetails& operator=(TestDetails const&); 23 | }; 24 | 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /fc/src/crypto/scrypt.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "scrypt-jane.h" 4 | 5 | namespace fc { 6 | 7 | unsigned log2( unsigned n ) 8 | { 9 | if( n <= 0 ) FC_THROW_EXCEPTION( exception, "cannot take log2(${n})", ("n",n) ); 10 | unsigned i = 0; 11 | while( n >>= 1 ) ++i; 12 | return i; 13 | } 14 | 15 | void scrypt_derive_key( const std::vector& passphrase, const std::vector& salt, 16 | unsigned int n, unsigned int r, unsigned int p, std::vector& key ) 17 | { 18 | scrypt( passphrase.data(), passphrase.size(), salt.data(), salt.size(), 19 | log2( n ) - 1, log2( r ), log2( p ), key.data(), key.capacity() ); 20 | } 21 | 22 | } // namespace fc 23 | -------------------------------------------------------------------------------- /libraries/client/DebugApi.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #ifndef WIN32 8 | #include 9 | #endif 10 | 11 | namespace TiValue { 12 | namespace client { 13 | namespace detail { 14 | 15 | std::string ClientImpl::debug_get_client_name() const 16 | { 17 | // set limit in sandbox state 18 | if (_chain_db->get_is_in_sandbox()) 19 | FC_THROW_EXCEPTION(sandbox_command_forbidden, "in sandbox, this command is forbidden, you cannot call it!"); 20 | 21 | return this->_config.client_debug_name; 22 | } 23 | 24 | } 25 | } 26 | } // namespace TiValue::client::detail 27 | -------------------------------------------------------------------------------- /miniupnpc/miniwget.h: -------------------------------------------------------------------------------- 1 | /* $Id: miniwget.h,v 1.7 2012/06/23 22:35:59 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2005-2012 Thomas Bernard 5 | * This software is subject to the conditions detailed in the 6 | * LICENCE file provided in this distribution. 7 | * */ 8 | #ifndef MINIWGET_H_INCLUDED 9 | #define MINIWGET_H_INCLUDED 10 | 11 | #include "declspec.h" 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | LIBSPEC void * getHTTPResponse(int s, int * size); 18 | 19 | LIBSPEC void * miniwget(const char *, int *, unsigned int); 20 | 21 | LIBSPEC void * miniwget_getaddr(const char *, int *, char *, int, unsigned int); 22 | 23 | int parseURL(const char *, char *, unsigned short *, char * *, unsigned int *); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /libraries/fc/src/crypto/scrypt.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "scrypt-jane.h" 4 | 5 | namespace fc { 6 | 7 | unsigned log2( unsigned n ) 8 | { 9 | if( n <= 0 ) FC_THROW_EXCEPTION( exception, "cannot take log2(${n})", ("n",n) ); 10 | unsigned i = 0; 11 | while( n >>= 1 ) ++i; 12 | return i; 13 | } 14 | 15 | void scrypt_derive_key( const std::vector& passphrase, const std::vector& salt, 16 | unsigned int n, unsigned int r, unsigned int p, std::vector& key ) 17 | { 18 | scrypt( passphrase.data(), passphrase.size(), salt.data(), salt.size(), 19 | log2( n ) - 1, log2( r ), log2( p ), key.data(), key.capacity() ); 20 | } 21 | 22 | } // namespace fc 23 | -------------------------------------------------------------------------------- /fc/ntp_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main( int argc, char** argv ) 6 | { 7 | fc::ntp ntp_service; 8 | ntp_service.set_request_interval(5); 9 | fc::usleep(fc::seconds(4) ); 10 | auto time = ntp_service.get_time(); 11 | if( time ) 12 | { 13 | auto ntp_time = *time; 14 | auto delta = ntp_time - fc::time_point::now(); 15 | auto minutes = delta.count() / 1000000 / 60; 16 | auto hours = delta.count() / 1000000 / 60 / 60; 17 | auto seconds = delta.count() / 1000000; 18 | auto msec= delta.count() / 1000; 19 | idump( (fc::time_point::now() ) ); 20 | idump( (ntp_time)(delta)(msec)(seconds)(minutes)(hours) ); 21 | } 22 | else 23 | { 24 | elog( "no response" ); 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/debug_client/SConscript: -------------------------------------------------------------------------------- 1 | ## Debug client example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | Import('tls_libs') 10 | 11 | env = env.Clone () 12 | env_cpp11 = env_cpp11.Clone () 13 | 14 | prgs = [] 15 | 16 | # if a C++11 environment is available build using that, otherwise use boost 17 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 18 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] + [tls_libs] 19 | prgs += env_cpp11.Program('debug_client', ["debug_client.cpp"], LIBS = ALL_LIBS) 20 | else: 21 | ALL_LIBS = boostlibs(['system','random'],env) + [platform_libs] + [polyfill_libs] + [tls_libs] 22 | prgs += env.Program('debug_client', ["debug_client.cpp"], LIBS = ALL_LIBS) 23 | 24 | Return('prgs') 25 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/RequiredCheckTestReporter.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_REQUIRED_CHECK_TEST_REPORTER_H 2 | #define UNITTEST_REQUIRED_CHECK_TEST_REPORTER_H 3 | 4 | #include "HelperMacros.h" 5 | #include "ThrowingTestReporter.h" 6 | 7 | namespace UnitTest { 8 | 9 | class TestResults; 10 | 11 | // This RAII class decorates the current TestReporter with 12 | // a version that throws after reporting a failure. 13 | class UNITTEST_LINKAGE RequiredCheckTestReporter 14 | { 15 | public: 16 | explicit RequiredCheckTestReporter(TestResults& results); 17 | ~RequiredCheckTestReporter(); 18 | 19 | bool Next(); 20 | 21 | private: 22 | TestResults& m_results; 23 | TestReporter* m_originalTestReporter; 24 | ThrowingTestReporter m_throwingReporter; 25 | int m_continue; 26 | }; 27 | } 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/test/http/SConscript: -------------------------------------------------------------------------------- 1 | ## http unit tests 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | BOOST_LIBS = boostlibs(['unit_test_framework'],env) + [platform_libs] 14 | 15 | objs = env.Object('parser_boost.o', ["parser.cpp"], LIBS = BOOST_LIBS) 16 | prgs = env.Program('test_http_boost', ["parser_boost.o"], LIBS = BOOST_LIBS) 17 | 18 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 19 | BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework'],env_cpp11) + [platform_libs] + [polyfill_libs] 20 | objs += env_cpp11.Object('parser_stl.o', ["parser.cpp"], LIBS = BOOST_LIBS_CPP11) 21 | prgs += env_cpp11.Program('test_http_stl', ["parser_stl.o"], LIBS = BOOST_LIBS_CPP11) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /leveldb/port/port.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_PORT_PORT_H_ 6 | #define STORAGE_LEVELDB_PORT_PORT_H_ 7 | 8 | #include 9 | 10 | // Include the appropriate platform specific file below. If you are 11 | // porting to a new platform, see "port_example.h" for documentation 12 | // of what the new port_.h file must provide. 13 | #if defined(LEVELDB_PLATFORM_POSIX) 14 | # include "port/port_posix.h" 15 | #elif defined(LEVELDB_PLATFORM_CHROMIUM) 16 | # include "port/port_chromium.h" 17 | #elif defined(LEVELDB_PLATFORM_WINDOWS) 18 | # include "port/port_win.h" 19 | #endif 20 | 21 | #endif // STORAGE_LEVELDB_PORT_PORT_H_ 22 | -------------------------------------------------------------------------------- /fc/vendor/easylzma/src/pavlov/7zCrc.c: -------------------------------------------------------------------------------- 1 | /* 7zCrc.c -- CRC32 calculation 2 | 2008-08-05 3 | Igor Pavlov 4 | Public domain */ 5 | 6 | #include "7zCrc.h" 7 | 8 | #define kCrcPoly 0xEDB88320 9 | UInt32 g_CrcTable[256]; 10 | 11 | void MY_FAST_CALL CrcGenerateTable(void) 12 | { 13 | UInt32 i; 14 | for (i = 0; i < 256; i++) 15 | { 16 | UInt32 r = i; 17 | int j; 18 | for (j = 0; j < 8; j++) 19 | r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1)); 20 | g_CrcTable[i] = r; 21 | } 22 | } 23 | 24 | UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size) 25 | { 26 | const Byte *p = (const Byte *)data; 27 | for (; size > 0 ; size--, p++) 28 | v = CRC_UPDATE_BYTE(v, *p); 29 | return v; 30 | } 31 | 32 | UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size) 33 | { 34 | return CrcUpdate(CRC_INIT_VAL, data, size) ^ 0xFFFFFFFF; 35 | } 36 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/echo_server_tls/SConscript: -------------------------------------------------------------------------------- 1 | ## Main development example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | Import('tls_libs') 10 | 11 | env = env.Clone () 12 | env_cpp11 = env_cpp11.Clone () 13 | 14 | prgs = [] 15 | 16 | # if a C++11 environment is available build using that, otherwise use boost 17 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 18 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] + [tls_libs] 19 | prgs += env_cpp11.Program('echo_server_tls', ["echo_server_tls.cpp"], LIBS = ALL_LIBS) 20 | else: 21 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] + [tls_libs] 22 | prgs += env.Program('echo_server_tls', ["echo_server_tls.cpp"], LIBS = ALL_LIBS) 23 | 24 | Return('prgs') 25 | -------------------------------------------------------------------------------- /libraries/fc/ntp_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main( int argc, char** argv ) 6 | { 7 | fc::ntp ntp_service; 8 | ntp_service.set_request_interval(5); 9 | fc::usleep(fc::seconds(4) ); 10 | auto time = ntp_service.get_time(); 11 | if( time ) 12 | { 13 | auto ntp_time = *time; 14 | auto delta = ntp_time - fc::time_point::now(); 15 | auto minutes = delta.count() / 1000000 / 60; 16 | auto hours = delta.count() / 1000000 / 60 / 60; 17 | auto seconds = delta.count() / 1000000; 18 | auto msec= delta.count() / 1000; 19 | idump( (fc::time_point::now() ) ); 20 | idump( (ntp_time)(delta)(msec)(seconds)(minutes)(hours) ); 21 | } 22 | else 23 | { 24 | elog( "no response" ); 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /secp256k1-zkp/src/scalar_4x64.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_SCALAR_REPR_ 8 | #define _SECP256K1_SCALAR_REPR_ 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef struct { 14 | uint64_t d[4]; 15 | } secp256k1_scalar_t; 16 | 17 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{((uint64_t)(d1)) << 32 | (d0), ((uint64_t)(d3)) << 32 | (d2), ((uint64_t)(d5)) << 32 | (d4), ((uint64_t)(d7)) << 32 | (d6)}} 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /fc/README.md: -------------------------------------------------------------------------------- 1 | fc 2 | == 3 | 4 | FC stands for fast-compiling c++ library and provides a set of utility libraries useful 5 | for the development of asynchronous libraries. Some of the highlights include: 6 | 7 | - Cooperative Multi-Tasking Library with support for Futures, mutexes, signals. 8 | - Wrapper on Boost ASIO for handling async opperations cooperatively with easy to code synchronous style. 9 | - Reflection for C++ allowing automatic serialization in Json & Binary of C++ Structs 10 | - Automatic generation of client / server stubs for reflected interfaces with support for JSON-RPC 11 | - Cryptographic Primitives for a variaty of hashes and encryption algorithms 12 | - Logging Infrastructure 13 | - Wraps many Boost APIs, such as boost::filesystem, boost::thread, and boost::exception to acceleate compiles 14 | - Support for unofficial Boost.Process library. 15 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/examples/echo_server_both/SConscript: -------------------------------------------------------------------------------- 1 | ## Combo plain+tls echo server 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | Import('tls_libs') 10 | 11 | env = env.Clone () 12 | env_cpp11 = env_cpp11.Clone () 13 | 14 | prgs = [] 15 | 16 | # if a C++11 environment is available build using that, otherwise use boost 17 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 18 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] + [tls_libs] 19 | prgs += env_cpp11.Program('echo_server_both', ["echo_server_both.cpp"], LIBS = ALL_LIBS) 20 | else: 21 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] + [tls_libs] 22 | prgs += env.Program('echo_server_both', ["echo_server_both.cpp"], LIBS = ALL_LIBS) 23 | 24 | Return('prgs') 25 | -------------------------------------------------------------------------------- /libraries/include/glua/glua_compat.h: -------------------------------------------------------------------------------- 1 | // should be included after lua*.h 2 | #ifndef glua_compat_h 3 | #define glua_compat_h 4 | 5 | #include "lua.h" 6 | 7 | #define lua_open() luaL_newstate() 8 | #define luadec_freearray(L, b, n, t) luaM_freearray(L, b, n) 9 | 10 | #define UPVAL_TYPE Upvaldesc 11 | #define NUPS(f) (f->sizeupvalues) 12 | #define UPVAL_NAME(f, r) (f->upvalues[r].name) 13 | 14 | #define LUADEC_TFORLOOP OP_TFORCALL 15 | #define FUNC_BLOCK_END(f) (f->sizecode) 16 | 17 | // Lua >= 5.2 : is_vararg = 0 1 , never use parament arg, but main has a global arg 18 | #define NEED_ARG(f) 0 19 | 20 | 21 | #define rawtsvalue(o) tsvalue(o) 22 | 23 | #ifdef tsslen 24 | #define LUA_STRLEN(ts) tsslen(ts) 25 | #else 26 | #define LUA_STRLEN(ts) ((ts)->len) 27 | #endif 28 | 29 | #define MAXREGS 250 30 | #define MAXSTACK MAXREGS 31 | 32 | #endif // #ifndef LUADEC_LUA_COMPAT_H 33 | -------------------------------------------------------------------------------- /libraries/leveldb/port/port.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_PORT_PORT_H_ 6 | #define STORAGE_LEVELDB_PORT_PORT_H_ 7 | 8 | #include 9 | 10 | // Include the appropriate platform specific file below. If you are 11 | // porting to a new platform, see "port_example.h" for documentation 12 | // of what the new port_.h file must provide. 13 | #if defined(LEVELDB_PLATFORM_POSIX) 14 | # include "port/port_posix.h" 15 | #elif defined(LEVELDB_PLATFORM_CHROMIUM) 16 | # include "port/port_chromium.h" 17 | #elif defined(LEVELDB_PLATFORM_WINDOWS) 18 | # include "port/port_win.h" 19 | #endif 20 | 21 | #endif // STORAGE_LEVELDB_PORT_PORT_H_ 22 | -------------------------------------------------------------------------------- /fc/vendor/scrypt-jane/test-speed.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | test() { 4 | sleep 0.25 # mingw is stupid and will occasionally not have permission to overwrite scrypt_speed 5 | gcc scrypt-jane-speed.c -O3 -DSCRYPT_$1 -DSCRYPT_$2 $3 -o scrypt_speed 2>/dev/null 6 | local RC=$? 7 | if [ $RC -ne 0 ]; then 8 | echo "$1/$2: failed to compile " 9 | return 10 | fi 11 | ./scrypt_speed 12 | } 13 | 14 | testhash() { 15 | test $1 SALSA $2 16 | test $1 CHACHA $2 17 | test $1 SALSA64 $2 18 | } 19 | 20 | testhashes() { 21 | testhash SHA256 $1 22 | testhash SHA512 $1 23 | testhash BLAKE256 $1 24 | testhash BLAKE512 $1 25 | testhash SKEIN512 $1 26 | testhash KECCAK256 $1 27 | testhash KECCAK512 $1 28 | } 29 | 30 | if [ -z $1 ]; then 31 | testhashes 32 | elif [ $1 -eq 32 ]; then 33 | testhashes -m32 34 | elif [ $1 -eq 64 ]; then 35 | testhashes -m64 36 | fi 37 | 38 | rm -f scrypt_speed -------------------------------------------------------------------------------- /libraries/fc/vendor/easylzma/src/pavlov/7zCrc.c: -------------------------------------------------------------------------------- 1 | /* 7zCrc.c -- CRC32 calculation 2 | 2008-08-05 3 | Igor Pavlov 4 | Public domain */ 5 | 6 | #include "7zCrc.h" 7 | 8 | #define kCrcPoly 0xEDB88320 9 | UInt32 g_CrcTable[256]; 10 | 11 | void MY_FAST_CALL CrcGenerateTable(void) 12 | { 13 | UInt32 i; 14 | for (i = 0; i < 256; i++) 15 | { 16 | UInt32 r = i; 17 | int j; 18 | for (j = 0; j < 8; j++) 19 | r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1)); 20 | g_CrcTable[i] = r; 21 | } 22 | } 23 | 24 | UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size) 25 | { 26 | const Byte *p = (const Byte *)data; 27 | for (; size > 0 ; size--, p++) 28 | v = CRC_UPDATE_BYTE(v, *p); 29 | return v; 30 | } 31 | 32 | UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size) 33 | { 34 | return CrcUpdate(CRC_INIT_VAL, data, size) ^ 0xFFFFFFFF; 35 | } 36 | -------------------------------------------------------------------------------- /libraries/include/blockchain/TransactionOperations.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace TiValue { 7 | namespace blockchain { 8 | 9 | struct TransactionOperation 10 | { 11 | static const OperationTypeEnum type; 12 | 13 | TransactionOperation(){} 14 | 15 | TransactionOperation(const SignedTransaction& signed_trx) 16 | :trx(signed_trx){} 17 | 18 | TransactionOperation(const TransactionOperation& trx_op) 19 | :trx(trx_op.trx){} 20 | 21 | SignedTransaction trx; 22 | 23 | void evaluate(TransactionEvaluationState& eval_state)const; 24 | }; 25 | 26 | } 27 | } // TiValue::blockchain 28 | 29 | 30 | FC_REFLECT(TiValue::blockchain::TransactionOperation, (trx)) 31 | -------------------------------------------------------------------------------- /libraries/include/glua/glua_loader.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef glua_loader_h 3 | #define glua_loader_h 4 | 5 | #include "glua/lprefix.h" 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "glua/llimits.h" 12 | #include "glua/lstate.h" 13 | #include "glua/lua.h" 14 | #include "glua/tichain_lua_api.h" 15 | 16 | namespace TiValue 17 | { 18 | namespace lua 19 | { 20 | namespace parser 21 | { 22 | 23 | class LuaLoader 24 | { 25 | private: 26 | GluaModuleByteStream *_stream; // byte code stream 27 | public: 28 | LuaLoader(GluaModuleByteStream *stream); 29 | ~LuaLoader(); 30 | 31 | void load_bytecode(); // load bytecode stream to AST 32 | }; 33 | 34 | } 35 | } 36 | } 37 | 38 | #endif -------------------------------------------------------------------------------- /libraries/fc/README.md: -------------------------------------------------------------------------------- 1 | fc 2 | == 3 | 4 | FC stands for fast-compiling c++ library and provides a set of utility libraries useful 5 | for the development of asynchronous libraries. Some of the highlights include: 6 | 7 | - Cooperative Multi-Tasking Library with support for Futures, mutexes, signals. 8 | - Wrapper on Boost ASIO for handling async opperations cooperatively with easy to code synchronous style. 9 | - Reflection for C++ allowing automatic serialization in Json & Binary of C++ Structs 10 | - Automatic generation of client / server stubs for reflected interfaces with support for JSON-RPC 11 | - Cryptographic Primitives for a variaty of hashes and encryption algorithms 12 | - Logging Infrastructure 13 | - Wraps many Boost APIs, such as boost::filesystem, boost::thread, and boost::exception to acceleate compiles 14 | - Support for unofficial Boost.Process library. 15 | -------------------------------------------------------------------------------- /fc/include/fc/io/raw_unpack_file.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | namespace fc 8 | { 9 | namespace raw 10 | { 11 | template 12 | void unpack_file( const fc::path& filename, T& obj ) 13 | { 14 | try { 15 | fc::file_mapping fmap( filename.generic_string().c_str(), fc::read_only); 16 | fc::mapped_region mapr( fmap, fc::read_only, 0, fc::file_size(filename) ); 17 | auto cs = (const char*)mapr.get_address(); 18 | 19 | fc::datastream ds( cs, mapr.get_size() ); 20 | fc::raw::unpack(ds,obj); 21 | } FC_RETHROW_EXCEPTIONS( info, "unpacking file ${file}", ("file",filename) ); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /libraries/fc/vendor/scrypt-jane/test-speed.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | test() { 4 | sleep 0.25 # mingw is stupid and will occasionally not have permission to overwrite scrypt_speed 5 | gcc scrypt-jane-speed.c -O3 -DSCRYPT_$1 -DSCRYPT_$2 $3 -o scrypt_speed 2>/dev/null 6 | local RC=$? 7 | if [ $RC -ne 0 ]; then 8 | echo "$1/$2: failed to compile " 9 | return 10 | fi 11 | ./scrypt_speed 12 | } 13 | 14 | testhash() { 15 | test $1 SALSA $2 16 | test $1 CHACHA $2 17 | test $1 SALSA64 $2 18 | } 19 | 20 | testhashes() { 21 | testhash SHA256 $1 22 | testhash SHA512 $1 23 | testhash BLAKE256 $1 24 | testhash BLAKE512 $1 25 | testhash SKEIN512 $1 26 | testhash KECCAK256 $1 27 | testhash KECCAK512 $1 28 | } 29 | 30 | if [ -z $1 ]; then 31 | testhashes 32 | elif [ $1 -eq 32 ]; then 33 | testhashes -m32 34 | elif [ $1 -eq 64 ]; then 35 | testhashes -m64 36 | fi 37 | 38 | rm -f scrypt_speed -------------------------------------------------------------------------------- /libraries/fc/include/fc/io/raw_unpack_file.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | namespace fc 8 | { 9 | namespace raw 10 | { 11 | template 12 | void unpack_file( const fc::path& filename, T& obj ) 13 | { 14 | try { 15 | fc::file_mapping fmap( filename.generic_string().c_str(), fc::read_only); 16 | fc::mapped_region mapr( fmap, fc::read_only, 0, fc::file_size(filename) ); 17 | auto cs = (const char*)mapr.get_address(); 18 | 19 | fc::datastream ds( cs, mapr.get_size() ); 20 | fc::raw::unpack(ds,obj); 21 | } FC_RETHROW_EXCEPTIONS( info, "unpacking file ${file}", ("file",filename) ); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /leveldb/util/options.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/options.h" 6 | 7 | #include "leveldb/comparator.h" 8 | #include "leveldb/env.h" 9 | 10 | namespace leveldb { 11 | 12 | Options::Options() 13 | : comparator(BytewiseComparator()), 14 | create_if_missing(false), 15 | error_if_exists(false), 16 | paranoid_checks(false), 17 | env(Env::Default()), 18 | info_log(NULL), 19 | write_buffer_size(4<<20), 20 | max_open_files(1000), 21 | block_cache(NULL), 22 | block_size(4096), 23 | block_restart_interval(16), 24 | compression(kSnappyCompression), 25 | filter_policy(NULL) { 26 | } 27 | 28 | 29 | } // namespace leveldb 30 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/test/logger/SConscript: -------------------------------------------------------------------------------- 1 | ## logger unit tests 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | BOOST_LIBS = boostlibs(['unit_test_framework','system'],env) + [platform_libs] 14 | 15 | objs = env.Object('logger_basic_boost.o', ["basic.cpp"], LIBS = BOOST_LIBS) 16 | prgs = env.Program('logger_basic_boost', ["logger_basic_boost.o"], LIBS = BOOST_LIBS) 17 | 18 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 19 | BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework','system'],env_cpp11) + [platform_libs] + [polyfill_libs] 20 | objs += env_cpp11.Object('logger_basic_stl.o', ["basic.cpp"], LIBS = BOOST_LIBS_CPP11) 21 | prgs += env_cpp11.Program('logger_basic_stl', ["logger_basic_stl.o"], LIBS = BOOST_LIBS_CPP11) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/glua/ljsonrpclib.cpp: -------------------------------------------------------------------------------- 1 | #define ljsonrpclib_cpp 2 | 3 | #include "glua/lprefix.h" 4 | 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include "glua/lua.h" 17 | 18 | #include "glua/lauxlib.h" 19 | #include "glua/lualib.h" 20 | #include "glua/tichain_lua_api.h" 21 | 22 | #undef LUA_JSONRPC_VERSION 23 | #define LUA_JSONRPC_VERSION "1.0" 24 | 25 | // TODO 26 | 27 | static const luaL_Reg jsonrpclib[] = { 28 | // { "listen", lualib_http_listen }, 29 | { "version", nullptr }, 30 | { nullptr, nullptr } 31 | }; 32 | 33 | 34 | LUAMOD_API int luaopen_jsonrpc(lua_State *L) { 35 | luaL_newlib(L, jsonrpclib); 36 | lua_pushstring(L, LUA_JSONRPC_VERSION); 37 | lua_setfield(L, -2, "version"); 38 | return 1; 39 | } 40 | -------------------------------------------------------------------------------- /libraries/leveldb/util/options.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/options.h" 6 | 7 | #include "leveldb/comparator.h" 8 | #include "leveldb/env.h" 9 | 10 | namespace leveldb { 11 | 12 | Options::Options() 13 | : comparator(BytewiseComparator()), 14 | create_if_missing(false), 15 | error_if_exists(false), 16 | paranoid_checks(false), 17 | env(Env::Default()), 18 | info_log(NULL), 19 | write_buffer_size(4<<20), 20 | max_open_files(1000), 21 | block_cache(NULL), 22 | block_size(4096), 23 | block_restart_interval(16), 24 | compression(kSnappyCompression), 25 | filter_policy(NULL) { 26 | } 27 | 28 | 29 | } // namespace leveldb 30 | -------------------------------------------------------------------------------- /secp256k1-zkp/src/java/org_bitcoin_NativeSecp256k1.c: -------------------------------------------------------------------------------- 1 | #include "org_bitcoin_NativeSecp256k1.h" 2 | #include "include/secp256k1.h" 3 | 4 | JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify 5 | (JNIEnv* env, jclass classObject, jobject byteBufferObject) 6 | { 7 | unsigned char* data = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject); 8 | int sigLen = *((int*)(data + 32)); 9 | int pubLen = *((int*)(data + 32 + 4)); 10 | 11 | return secp256k1_ecdsa_verify(data, 32, data+32+8, sigLen, data+32+8+sigLen, pubLen); 12 | } 13 | 14 | static void __javasecp256k1_attach(void) __attribute__((constructor)); 15 | static void __javasecp256k1_detach(void) __attribute__((destructor)); 16 | 17 | static void __javasecp256k1_attach(void) { 18 | secp256k1_start(SECP256K1_START_VERIFY); 19 | } 20 | 21 | static void __javasecp256k1_detach(void) { 22 | secp256k1_stop(); 23 | } 24 | -------------------------------------------------------------------------------- /fc/include/fc/utf8.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __UTF8_HPP 2 | #define __UTF8_HPP 3 | 4 | #include 5 | 6 | /// This file contains general purpose utilities related to UTF-8 <-> Unicode conversions 7 | 8 | namespace fc 9 | { 10 | 11 | bool is_utf8( const std::string& str ); 12 | 13 | /** Decodes utf 8 std::string into unicode string. 14 | @param input - input string to be decoded and stored in 'storage' 15 | @param storage - buffer for converted text. Cannot be nullptr. 16 | */ 17 | void decodeUtf8(const std::string& input, std::wstring* storage); 18 | 19 | /** Encodes given wide (unicode) string into UTF-8 representation. 20 | @param input - input string to be encoded and stored in 'storage' 21 | @param storage - buffer for converted text. Cannot be nullptr. 22 | */ 23 | void encodeUtf8(const std::wstring& input, std::string* storage); 24 | 25 | } /// namespace fc 26 | 27 | #endif ///__UTF8_HPP 28 | 29 | -------------------------------------------------------------------------------- /fc/src/crypto/base32.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | namespace fc 5 | { 6 | std::vector from_base32( const std::string& b32 ) 7 | { 8 | auto len = cyoBase32DecodeGetLength( b32.size() ); 9 | std::vector v(len); 10 | cyoBase32Decode( v.data(), b32.c_str(), b32.size() ); 11 | return v; 12 | } 13 | 14 | std::string to_base32( const char* data, size_t len ) 15 | { 16 | auto s = cyoBase16EncodeGetLength(len); 17 | std::vector b32; 18 | b32.resize(s); 19 | cyoBase16Encode( b32.data(), data, len ); 20 | b32.resize( b32.size()-1); // strip the nullterm 21 | return std::string(b32.begin(),b32.end()); 22 | } 23 | 24 | std::string to_base32( const std::vector& vec ) 25 | { 26 | return to_base32( vec.data(), vec.size() ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/utf8.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __UTF8_HPP 2 | #define __UTF8_HPP 3 | 4 | #include 5 | 6 | /// This file contains general purpose utilities related to UTF-8 <-> Unicode conversions 7 | 8 | namespace fc 9 | { 10 | 11 | bool is_utf8( const std::string& str ); 12 | 13 | /** Decodes utf 8 std::string into unicode string. 14 | @param input - input string to be decoded and stored in 'storage' 15 | @param storage - buffer for converted text. Cannot be nullptr. 16 | */ 17 | void decodeUtf8(const std::string& input, std::wstring* storage); 18 | 19 | /** Encodes given wide (unicode) string into UTF-8 representation. 20 | @param input - input string to be encoded and stored in 'storage' 21 | @param storage - buffer for converted text. Cannot be nullptr. 22 | */ 23 | void encodeUtf8(const std::wstring& input, std::string* storage); 24 | 25 | } /// namespace fc 26 | 27 | #endif ///__UTF8_HPP 28 | 29 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/Win32/TimeHelpers.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TIMEHELPERS_H 2 | #define UNITTEST_TIMEHELPERS_H 3 | 4 | #include "../Config.h" 5 | #include "../HelperMacros.h" 6 | 7 | #ifdef UNITTEST_MINGW 8 | #ifndef __int64 9 | #define __int64 long long 10 | #endif 11 | #endif 12 | 13 | namespace UnitTest { 14 | 15 | class UNITTEST_LINKAGE Timer 16 | { 17 | public: 18 | Timer(); 19 | void Start(); 20 | double GetTimeInMs() const; 21 | 22 | private: 23 | __int64 GetTime() const; 24 | 25 | void* m_threadHandle; 26 | 27 | #if defined(_WIN64) 28 | unsigned __int64 m_processAffinityMask; 29 | #else 30 | unsigned long m_processAffinityMask; 31 | #endif 32 | 33 | __int64 m_startTime; 34 | __int64 m_frequency; 35 | }; 36 | 37 | 38 | namespace TimeHelpers 39 | { 40 | UNITTEST_LINKAGE void SleepMs(int ms); 41 | } 42 | 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /fc/vendor/boost_1.51/libs/context/fcontext.cpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright Oliver Kowalke 2009. 3 | // Distributed under the Boost Software License, Version 1.0. 4 | // (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | #define BOOST_CONTEXT_SOURCE 8 | 9 | #include 10 | 11 | #include 12 | 13 | #ifdef BOOST_HAS_ABI_HEADERS 14 | # include BOOST_ABI_PREFIX 15 | #endif 16 | 17 | namespace boost { 18 | namespace ctx { 19 | namespace detail { 20 | 21 | extern "C" BOOST_CONTEXT_DECL 22 | void * BOOST_CONTEXT_CALLDECL align_stack( void * vp) 23 | { 24 | void * base = vp; 25 | if ( 0 != ( ( ( uintptr_t) base) & 15) ) 26 | base = ( char * ) ( ( ( ( uintptr_t) base) - 15) & ~0x0F); 27 | return base; 28 | } 29 | 30 | } 31 | 32 | }} 33 | 34 | #ifdef BOOST_HAS_ABI_HEADERS 35 | # include BOOST_ABI_SUFFIX 36 | #endif 37 | -------------------------------------------------------------------------------- /libraries/fc/src/crypto/base32.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | namespace fc 5 | { 6 | std::vector from_base32( const std::string& b32 ) 7 | { 8 | auto len = cyoBase32DecodeGetLength( b32.size() ); 9 | std::vector v(len); 10 | cyoBase32Decode( v.data(), b32.c_str(), b32.size() ); 11 | return v; 12 | } 13 | 14 | std::string to_base32( const char* data, size_t len ) 15 | { 16 | auto s = cyoBase16EncodeGetLength(len); 17 | std::vector b32; 18 | b32.resize(s); 19 | cyoBase16Encode( b32.data(), data, len ); 20 | b32.resize( b32.size()-1); // strip the nullterm 21 | return std::string(b32.begin(),b32.end()); 22 | } 23 | 24 | std::string to_base32( const std::vector& vec ) 25 | { 26 | return to_base32( vec.data(), vec.size() ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /leveldb/db/db_iter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_DB_ITER_H_ 6 | #define STORAGE_LEVELDB_DB_DB_ITER_H_ 7 | 8 | #include 9 | #include "leveldb/db.h" 10 | #include "db/dbformat.h" 11 | 12 | namespace leveldb { 13 | 14 | class DBImpl; 15 | 16 | // Return a new iterator that converts internal keys (yielded by 17 | // "*internal_iter") that were live at the specified "sequence" number 18 | // into appropriate user keys. 19 | extern Iterator* NewDBIterator( 20 | DBImpl* db, 21 | const Comparator* user_key_comparator, 22 | Iterator* internal_iter, 23 | SequenceNumber sequence, 24 | uint32_t seed); 25 | 26 | } // namespace leveldb 27 | 28 | #endif // STORAGE_LEVELDB_DB_DB_ITER_H_ 29 | -------------------------------------------------------------------------------- /libraries/fc/vendor/boost_1.51/libs/context/fcontext.cpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright Oliver Kowalke 2009. 3 | // Distributed under the Boost Software License, Version 1.0. 4 | // (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | #define BOOST_CONTEXT_SOURCE 8 | 9 | #include 10 | 11 | #include 12 | 13 | #ifdef BOOST_HAS_ABI_HEADERS 14 | # include BOOST_ABI_PREFIX 15 | #endif 16 | 17 | namespace boost { 18 | namespace ctx { 19 | namespace detail { 20 | 21 | extern "C" BOOST_CONTEXT_DECL 22 | void * BOOST_CONTEXT_CALLDECL align_stack( void * vp) 23 | { 24 | void * base = vp; 25 | if ( 0 != ( ( ( uintptr_t) base) & 15) ) 26 | base = ( char * ) ( ( ( ( uintptr_t) base) - 15) & ~0x0F); 27 | return base; 28 | } 29 | 30 | } 31 | 32 | }} 33 | 34 | #ifdef BOOST_HAS_ABI_HEADERS 35 | # include BOOST_ABI_SUFFIX 36 | #endif 37 | -------------------------------------------------------------------------------- /libraries/include/glua/tichainlib.h: -------------------------------------------------------------------------------- 1 | #ifndef tichainlib_h 2 | #define tichainlib_h 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | namespace glua 22 | { 23 | namespace lib 24 | { 25 | int tichainlib_get_storage(lua_State *L); 26 | // TiValue.get_storage具体的实现 27 | int tichainlib_get_storage_impl(lua_State *L, 28 | const char *contract_id, const char *name); 29 | 30 | int tichainlib_set_storage(lua_State *L); 31 | 32 | int tichainlib_set_storage_impl(lua_State *L, 33 | const char *contract_id, const char *name, int value_index); 34 | } 35 | } 36 | 37 | #endif -------------------------------------------------------------------------------- /libraries/leveldb/db/db_iter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_DB_ITER_H_ 6 | #define STORAGE_LEVELDB_DB_DB_ITER_H_ 7 | 8 | #include 9 | #include "leveldb/db.h" 10 | #include "db/dbformat.h" 11 | 12 | namespace leveldb { 13 | 14 | class DBImpl; 15 | 16 | // Return a new iterator that converts internal keys (yielded by 17 | // "*internal_iter") that were live at the specified "sequence" number 18 | // into appropriate user keys. 19 | extern Iterator* NewDBIterator( 20 | DBImpl* db, 21 | const Comparator* user_key_comparator, 22 | Iterator* internal_iter, 23 | SequenceNumber sequence, 24 | uint32_t seed); 25 | 26 | } // namespace leveldb 27 | 28 | #endif // STORAGE_LEVELDB_DB_DB_ITER_H_ 29 | -------------------------------------------------------------------------------- /fc/src/shared_ptr.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | retainable::retainable() 8 | :_ref_count(1) { 9 | static_assert( sizeof(_ref_count) == sizeof(boost::atomic), "failed to reserve enough space" ); 10 | } 11 | 12 | retainable::~retainable() { 13 | assert( _ref_count <= 0 ); 14 | assert( _ref_count == 0 ); 15 | } 16 | void retainable::retain() { 17 | ((boost::atomic*)&_ref_count)->fetch_add(1, boost::memory_order_relaxed ); 18 | } 19 | 20 | void retainable::release() { 21 | boost::atomic_thread_fence(boost::memory_order_acquire); 22 | if( 1 == ((boost::atomic*)&_ref_count)->fetch_sub(1, boost::memory_order_release ) ) { 23 | delete this; 24 | } 25 | } 26 | 27 | int32_t retainable::retain_count()const { 28 | return _ref_count; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /fc/vendor/websocketpp/test/endpoint/SConscript: -------------------------------------------------------------------------------- 1 | ## endpoint unit tests 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | Import('tls_libs') 10 | 11 | env = env.Clone () 12 | env_cpp11 = env_cpp11.Clone () 13 | 14 | BOOST_LIBS = boostlibs(['unit_test_framework','system'],env) + [platform_libs] + [tls_libs] 15 | 16 | objs = env.Object('endpoint_boost.o', ["endpoint.cpp"], LIBS = BOOST_LIBS) 17 | prgs = env.Program('test_endpoint_boost', ["endpoint_boost.o"], LIBS = BOOST_LIBS) 18 | 19 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 20 | BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework','system'],env_cpp11) + [platform_libs] + [polyfill_libs] + [tls_libs] 21 | objs += env_cpp11.Object('endpoint_stl.o', ["endpoint.cpp"], LIBS = BOOST_LIBS_CPP11) 22 | prgs += env_cpp11.Program('test_endpoint_stl', ["endpoint_stl.o"], LIBS = BOOST_LIBS_CPP11) 23 | 24 | Return('prgs') 25 | -------------------------------------------------------------------------------- /libraries/include/glua/lundump.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lundump.h,v 1.45 2015/09/08 15:41:05 roberto Exp $ 3 | ** load precompiled Lua chunks 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lundump_h 8 | #define lundump_h 9 | 10 | #include "glua/llimits.h" 11 | #include "glua/lobject.h" 12 | #include "glua/lzio.h" 13 | 14 | 15 | /* data to catch conversion errors */ 16 | #define LUAC_DATA "\x19\x93\r\n\x1a\n" 17 | 18 | #define LUAC_INT 0x5678 19 | #define LUAC_NUM cast_num(370.5) 20 | 21 | #define MYINT(s) (s[0]-'0') 22 | #define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR)) 23 | #define LUAC_FORMAT 0 /* this is the official format */ 24 | 25 | /* load one chunk; from lundump.c */ 26 | LUAI_FUNC LClosure* luaU_undump(lua_State* L, ZIO* Z, const char* name); 27 | 28 | /* dump one chunk; from ldump.c */ 29 | LUAI_FUNC int luaU_dump(lua_State* L, const Proto* f, lua_Writer w, 30 | void* data, int strip); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /libraries/fc/src/shared_ptr.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | retainable::retainable() 8 | :_ref_count(1) { 9 | static_assert( sizeof(_ref_count) == sizeof(boost::atomic), "failed to reserve enough space" ); 10 | } 11 | 12 | retainable::~retainable() { 13 | assert( _ref_count <= 0 ); 14 | assert( _ref_count == 0 ); 15 | } 16 | void retainable::retain() { 17 | ((boost::atomic*)&_ref_count)->fetch_add(1, boost::memory_order_relaxed ); 18 | } 19 | 20 | void retainable::release() { 21 | boost::atomic_thread_fence(boost::memory_order_acquire); 22 | if( 1 == ((boost::atomic*)&_ref_count)->fetch_sub(1, boost::memory_order_release ) ) { 23 | delete this; 24 | } 25 | } 26 | 27 | int32_t retainable::retain_count()const { 28 | return _ref_count; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /fc/include/fc/log/gelf_appender.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace fc 8 | { 9 | // Log appender that sends log messages in JSON format over UDP 10 | // https://www.graylog2.org/resources/gelf/specification 11 | class gelf_appender : public appender 12 | { 13 | public: 14 | struct config 15 | { 16 | string endpoint = "127.0.0.1:12201"; 17 | string host = "fc"; // the name of the host, source or application that sent this message (just passed through to GELF server) 18 | }; 19 | 20 | gelf_appender(const variant& args); 21 | ~gelf_appender(); 22 | virtual void log(const log_message& m) override; 23 | 24 | private: 25 | class impl; 26 | fc::shared_ptr my; 27 | }; 28 | } // namespace fc 29 | 30 | #include 31 | FC_REFLECT(fc::gelf_appender::config, 32 | (endpoint)(host)) 33 | -------------------------------------------------------------------------------- /leveldb/port/win/stdint.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | // MSVC didn't ship with this file until the 2010 version. 6 | 7 | #ifndef STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 8 | #define STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 9 | 10 | #if !defined(_MSC_VER) 11 | #error This file should only be included when compiling with MSVC. 12 | #endif 13 | 14 | // Define C99 equivalent types. 15 | typedef signed char int8_t; 16 | typedef signed short int16_t; 17 | typedef signed int int32_t; 18 | typedef signed long long int64_t; 19 | typedef unsigned char uint8_t; 20 | typedef unsigned short uint16_t; 21 | typedef unsigned int uint32_t; 22 | typedef unsigned long long uint64_t; 23 | 24 | #endif // STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 25 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/log/gelf_appender.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace fc 8 | { 9 | // Log appender that sends log messages in JSON format over UDP 10 | // https://www.graylog2.org/resources/gelf/specification 11 | class gelf_appender : public appender 12 | { 13 | public: 14 | struct config 15 | { 16 | string endpoint = "127.0.0.1:12201"; 17 | string host = "fc"; // the name of the host, source or application that sent this message (just passed through to GELF server) 18 | }; 19 | 20 | gelf_appender(const variant& args); 21 | ~gelf_appender(); 22 | virtual void log(const log_message& m) override; 23 | 24 | private: 25 | class impl; 26 | fc::shared_ptr my; 27 | }; 28 | } // namespace fc 29 | 30 | #include 31 | FC_REFLECT(fc::gelf_appender::config, 32 | (endpoint)(host)) 33 | -------------------------------------------------------------------------------- /libraries/include/glua/lcompile.h: -------------------------------------------------------------------------------- 1 | /** 2 | * lua module injector header in TiValue 3 | * @author 4 | */ 5 | 6 | #ifndef lcompile_h 7 | #define lcompile_h 8 | 9 | #include "glua/lprefix.h" 10 | 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #include "glua/lua.h" 17 | #include "glua/lobject.h" 18 | 19 | void luaL_PrintFunctionToFile(FILE *out, const Proto* f, int full); 20 | void luaL_PrintFunction(const Proto* f, int full); 21 | void luaL_PrintConstant(FILE *out, const Proto* f, int i); 22 | void luaL_PrintDebug(FILE *out, const Proto* f); 23 | void luaL_PrintHeader(FILE *out, const Proto* f); 24 | void luaL_PrintCode(FILE *out, const Proto* f); 25 | void luaL_PrintString(FILE *out, const TString* ts); 26 | 27 | #define luaU_print luaL_PrintFunction 28 | #define luaU_fprint luaL_PrintFunctionToFile 29 | 30 | #define PROGNAME "luac" /* default program name */ 31 | #define OUTPUT PROGNAME ".out" /* default output file */ 32 | 33 | #endif -------------------------------------------------------------------------------- /libraries/leveldb/port/win/stdint.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | // MSVC didn't ship with this file until the 2010 version. 6 | 7 | #ifndef STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 8 | #define STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 9 | 10 | #if !defined(_MSC_VER) 11 | #error This file should only be included when compiling with MSVC. 12 | #endif 13 | 14 | // Define C99 equivalent types. 15 | typedef signed char int8_t; 16 | typedef signed short int16_t; 17 | typedef signed int int32_t; 18 | typedef signed long long int64_t; 19 | typedef unsigned char uint8_t; 20 | typedef unsigned short uint16_t; 21 | typedef unsigned int uint32_t; 22 | typedef unsigned long long uint64_t; 23 | 24 | #endif // STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 25 | -------------------------------------------------------------------------------- /leveldb/table/merger.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_MERGER_H_ 6 | #define STORAGE_LEVELDB_TABLE_MERGER_H_ 7 | 8 | namespace leveldb { 9 | 10 | class Comparator; 11 | class Iterator; 12 | 13 | // Return an iterator that provided the union of the data in 14 | // children[0,n-1]. Takes ownership of the child iterators and 15 | // will delete them when the result iterator is deleted. 16 | // 17 | // The result does no duplicate suppression. I.e., if a particular 18 | // key is present in K child iterators, it will be yielded K times. 19 | // 20 | // REQUIRES: n >= 0 21 | extern Iterator* NewMergingIterator( 22 | const Comparator* comparator, Iterator** children, int n); 23 | 24 | } // namespace leveldb 25 | 26 | #endif // STORAGE_LEVELDB_TABLE_MERGER_H_ 27 | -------------------------------------------------------------------------------- /libraries/api/ConversionFunctions.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace TiValue { 4 | namespace api { 5 | 6 | fc::variant fc_ip_endpoint_to_variant(const fc::ip::endpoint& endpoint) 7 | { 8 | return fc::variant(std::string(endpoint)); 9 | } 10 | 11 | fc::ip::endpoint variant_to_fc_ip_endpoint(const fc::variant& endpoint_as_variant) 12 | { 13 | return fc::ip::endpoint::from_string(endpoint_as_variant.as_string()); 14 | } 15 | 16 | fc::variant time_interval_in_seconds_to_variant(const fc::microseconds time_interval) 17 | { 18 | return time_interval.count() / fc::seconds(1).count(); 19 | } 20 | 21 | fc::microseconds variant_to_time_interval_in_seconds(const fc::variant& time_interval_as_variant) 22 | { 23 | return fc::seconds(time_interval_as_variant.as_int64()); 24 | } 25 | 26 | } 27 | } // end namespace TiValue::api 28 | -------------------------------------------------------------------------------- /libraries/blockchain/ImessageOperations.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace TiValue { 9 | namespace blockchain { 10 | void ImessageMemoOperation::evaluate(TransactionEvaluationState& eval_state) const 11 | { 12 | try 13 | { 14 | FC_ASSERT(!imessage.empty()); 15 | if (this->imessage.size() > TIV_BLOCKCHAIN_MAX_MESSAGE_SIZE) 16 | { 17 | FC_CAPTURE_AND_THROW(message_too_long, (imessage.size())); 18 | } 19 | auto fee = Asset(eval_state._current_state->get_imessage_need_fee(imessage), 0); 20 | eval_state.imessage_length = imessage.size(); 21 | eval_state.required_fees += fee; 22 | } FC_CAPTURE_AND_RETHROW((*this)) 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /libraries/include/UnitTest++/ThrowingTestReporter.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_THROWINGTESTREPORTER_H 2 | #define UNITTEST_THROWINGTESTREPORTER_H 3 | 4 | #include "TestReporter.h" 5 | 6 | namespace UnitTest { 7 | 8 | // A TestReporter that throws when ReportFailure is called. Otherwise it 9 | // forwards the calls to a decorated TestReporter 10 | class ThrowingTestReporter : public TestReporter 11 | { 12 | public: 13 | explicit ThrowingTestReporter(TestReporter* reporter); 14 | 15 | virtual ~ThrowingTestReporter(); 16 | virtual void ReportTestStart(TestDetails const& test); 17 | virtual void ReportFailure(TestDetails const& test, char const* failure); 18 | virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed); 19 | virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed); 20 | 21 | private: 22 | TestReporter* m_decoratedReporter; 23 | }; 24 | } 25 | 26 | #endif 27 | --------------------------------------------------------------------------------