revert dash#1432: Rename consensus source library and API

It's a shared library, so we should keep its name and API 
distinguishable from Bitcoin's and avoid pkgconfig confusion

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
This commit is contained in:
Kittywhiskers Van Gogh 2022-08-02 22:05:18 +05:30
parent c587212f8c
commit f02085e988
9 changed files with 17 additions and 23 deletions

View File

@ -19,7 +19,7 @@ export PYTHONPATH
if BUILD_BITCOIN_LIBS
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libbitcoinconsensus.pc
pkgconfig_DATA = libdashconsensus.pc
endif
BITCOIND_BIN=$(top_builddir)/src/$(BITCOIN_DAEMON_NAME)$(EXEEXT)

View File

@ -1331,7 +1331,7 @@ define(MINIMUM_REQUIRED_BOOST, 1.47.0)
dnl Check for boost libs
AX_BOOST_BASE([MINIMUM_REQUIRED_BOOST])
if test x$want_boost = xno; then
AC_MSG_ERROR([[only libbitcoinconsensus can be built without boost]])
AC_MSG_ERROR([[only libdashconsensus can be built without boost]])
fi
AX_BOOST_FILESYSTEM
AX_BOOST_THREAD
@ -1537,7 +1537,7 @@ AC_MSG_CHECKING([whether to build libraries])
AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes])
if test x$build_bitcoin_libs = xyes; then
AC_DEFINE(HAVE_CONSENSUS_LIB, 1, [Define this symbol if the consensus lib has been built])
AC_CONFIG_FILES([libbitcoinconsensus.pc:libbitcoinconsensus.pc.in])
AC_CONFIG_FILES([libdashconsensus.pc:libdashconsensus.pc.in])
fi
AC_MSG_RESULT($build_bitcoin_libs)

View File

@ -7,7 +7,7 @@ The purpose of this library is to make the verification functionality that is cr
### API
The interface is defined in the C header `dashconsensus.h` located in `src/script/dashconsensus.h`.
The interface is defined in the C header `bitcoinconsensus.h` located in `src/script/bitcoinconsensus.h`.
#### Version
@ -39,9 +39,3 @@ The interface is defined in the C header `dashconsensus.h` located in `src/scri
- `dashconsensus_ERR_TX_INDEX` - An invalid index for `txTo`
- `dashconsensus_ERR_TX_SIZE_MISMATCH` - `txToLen` did not match with the size of `txTo`
- `dashconsensus_ERR_DESERIALIZE` - An error deserializing `txTo`
### Example Implementations
- [NBitcoin](https://github.com/NicolasDorier/NBitcoin/blob/master/NBitcoin/Script.cs#L814) (.NET Bindings)
- [node-libbitcoinconsensus](https://github.com/bitpay/node-libbitcoinconsensus) (Node.js Bindings)
- [java-libbitcoinconsensus](https://github.com/dexX7/java-libbitcoinconsensus) (Java Bindings)
- [bitcoinconsensus-php](https://github.com/Bit-Wasp/bitcoinconsensus-php) (PHP Bindings)

View File

@ -4,7 +4,7 @@ libdir=@libdir@
includedir=@includedir@
Name: @PACKAGE_NAME@ consensus library
Description: Library for the Bitcoin consensus protocol.
Description: Library for the Dash consensus protocol.
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -ldashconsensus
Cflags: -I${includedir}

View File

@ -48,7 +48,7 @@ if ENABLE_ZMQ
LIBBITCOIN_ZMQ=libbitcoin_zmq.a
endif
if BUILD_BITCOIN_LIBS
LIBBITCOINCONSENSUS=libbitcoinconsensus.la
LIBBITCOINCONSENSUS=libdashconsensus.la
endif
if ENABLE_WALLET
LIBBITCOIN_WALLET=libbitcoin_wallet.a
@ -622,7 +622,7 @@ libbitcoin_consensus_a_SOURCES = \
primitives/transaction.h \
pubkey.cpp \
pubkey.h \
script/dashconsensus.cpp \
script/bitcoinconsensus.cpp \
script/interpreter.cpp \
script/interpreter.h \
script/script.cpp \
@ -838,17 +838,17 @@ dash_wallet_LDADD += $(BACKTRACE_LIB) $(BOOST_LIBS) $(BDB_LIBS) $(EVENT_PTHREADS
# dashconsensus library #
if BUILD_BITCOIN_LIBS
include_HEADERS = script/dashconsensus.h
libbitcoinconsensus_la_SOURCES = support/cleanse.cpp $(crypto_libbitcoin_crypto_base_a_SOURCES) $(libbitcoin_consensus_a_SOURCES)
include_HEADERS = script/bitcoinconsensus.h
libdashconsensus_la_SOURCES = support/cleanse.cpp $(crypto_libbitcoin_crypto_base_a_SOURCES) $(libbitcoin_consensus_a_SOURCES)
if GLIBC_BACK_COMPAT
libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
libdashconsensus_la_SOURCES += compat/glibc_compat.cpp
endif
libbitcoinconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS)
libbitcoinconsensus_la_LIBADD = $(LIBSECP256K1) $(BLS_LIBS) $(GMP_LIBS)
libbitcoinconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL
libbitcoinconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libdashconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS)
libdashconsensus_la_LIBADD = $(LIBSECP256K1) $(BLS_LIBS) $(GMP_LIBS)
libdashconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL
libdashconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
endif
#

View File

@ -22,7 +22,7 @@
#ifndef HAVE_CONFIG_H
// While not technically a supported configuration, defaulting to defining these
// DECLs when we were compiled without autotools makes it easier for other build
// systems to build things like libbitcoinconsensus for strange targets.
// systems to build things like libdashconsensus for strange targets.
#ifdef htobe16
#define HAVE_DECL_HTOBE16 1
#endif

View File

@ -3,7 +3,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <script/dashconsensus.h>
#include <script/bitcoinconsensus.h>
#include <primitives/transaction.h>
#include <pubkey.h>

View File

@ -17,7 +17,7 @@
#include <streams.h>
#if defined(HAVE_CONSENSUS_LIB)
#include <script/dashconsensus.h>
#include <script/bitcoinconsensus.h>
#endif
#include <stdint.h>