Skip to content

Commit

Permalink
revert dash#1432: Rename consensus source library and API
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
kwvg and UdjinM6 committed Aug 9, 2022
1 parent c587212 commit f02085e
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
8 changes: 1 addition & 7 deletions doc/shared-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion libdashconsensus.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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}
18 changes: 9 additions & 9 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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
#
Expand Down
2 changes: 1 addition & 1 deletion src/compat/endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/test/script_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <streams.h>

#if defined(HAVE_CONSENSUS_LIB)
#include <script/dashconsensus.h>
#include <script/bitcoinconsensus.h>
#endif

#include <stdint.h>
Expand Down

0 comments on commit f02085e

Please sign in to comment.