forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libwally-core: import version 3b02512
Signed-off-by: Rusty Russell <[email protected]>
- Loading branch information
1 parent
4a7418e
commit 1271ac8
Showing
259 changed files
with
75,238 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
bld | ||
src/*.pyc | ||
src/test/*.pyc | ||
src/test/__pycache__/ | ||
*~ | ||
*.class | ||
*.gcno | ||
*.gcda | ||
*.o | ||
*.lo | ||
*.la | ||
*.deps | ||
*.dirstamp | ||
*.libs | ||
*.venv | ||
Makefile | ||
Makefile.in | ||
aclocal.m4 | ||
autom4te.cache/ | ||
build | ||
compile | ||
config.guess | ||
config.log | ||
config.status | ||
config.sub | ||
configure | ||
depcomp | ||
dist | ||
install-sh | ||
libtool | ||
ltmain.sh | ||
missing | ||
src/*~ | ||
src/lcov* | ||
src/Makefile | ||
src/Makefile.in | ||
src/config.h | ||
src/config.h.in | ||
src/stamp-h1 | ||
src/test/Makefile | ||
src/test/Makefile.in | ||
src/test_clear* | ||
src/test-suite.log | ||
src/swig_java/swig_java_wrap.c | ||
src/swig_java/*.java | ||
src/swig_java/*.jar | ||
src/swig_java/src/com/blockstream/libwally | ||
src/swig_python/swig_python_wrap.c | ||
src/swig_python/wallycore/__init__.py | ||
src/swig_python/wallycore/wallycore.egg-info | ||
tools/build-aux/m4/l*.m4 | ||
tools/build-aux/test-driver | ||
src/secp256k1/test-suite.log | ||
src/secp256k1/tests.log | ||
src/secp256k1/tests.trs | ||
wallycore.egg-info/ | ||
wally*.gz | ||
wally*.sha256 | ||
wally*.asc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
git: | ||
depth: 5 | ||
branches: | ||
only: | ||
- master | ||
language: c | ||
sudo: required | ||
os: | ||
- linux | ||
- osx | ||
dist: trusty | ||
compiler: | ||
- clang | ||
- gcc | ||
addons: | ||
apt: | ||
packages: | ||
- python | ||
- python-dev | ||
- python3 | ||
- python3-dev | ||
- swig | ||
- gcc-multilib | ||
matrix: | ||
include: | ||
- os: linux | ||
compiler: clang | ||
env: HOST=i686-linux-gnu | ||
- os: linux | ||
compiler: gcc | ||
env: HOST=i686-linux-gnu | ||
- compiler: gcc | ||
os: linux | ||
env: PYTHON_VERSION=3.4 | ||
|
||
before_script: | ||
- ./tools/cleanup.sh && ./tools/autogen.sh | ||
before_install: | ||
- ./tools/travis_install.sh | ||
script: | ||
- ./tools/travis_build.sh | ||
notifications: | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
Use the following commands to build and install the library: | ||
|
||
$ ./tools/autogen.sh | ||
$ ./configure [options] | ||
$ make | ||
$ make install | ||
|
||
Note that ./configure --help can be used to determine configuration options. | ||
|
||
To fully clean the library, run: | ||
|
||
$ ./tools/cleanup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Note: the modules in the src/ccan/ directory have their own licenses, but | ||
except where noted in an individual source file, the rest of the code is | ||
covered by the following (BSD-MIT) license: | ||
|
||
Copyright Jon Griffiths (Blockstream) 2016. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ACLOCAL_AMFLAGS = -I tools/build-aux/m4 | ||
AUTOMAKE_OPTIONS = foreign | ||
SUBDIRS = src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
# libwally-core | ||
|
||
Wally is a collection of useful primitives for cryptocurrency wallets. | ||
|
||
Note that the library is currently pre-release and so the API may change | ||
without notice. | ||
|
||
Please report bugs and submit patches to https://github.com/jgriffiths/libwally-core. | ||
|
||
[![Build Status](https://travis-ci.org/jgriffiths/libwally-core.svg?branch=master)](https://travis-ci.org/jgriffiths/libwally-core) | ||
|
||
## Platforms | ||
|
||
Wally currently builds on all linux and OSX platforms as well as all supported | ||
Android NDK targets. Bindings for Python and Java are included. | ||
|
||
Windows support and further language bindings such as JavaScript are planned. | ||
|
||
## Building | ||
|
||
``` | ||
$ ./tools/autogen.sh | ||
$ ./configure <options - see below> | ||
$ make | ||
$ make check | ||
``` | ||
|
||
### configure options | ||
|
||
- `--enable-debug`. Enables debugging information and disables compiler | ||
optimisations (default: no). | ||
- `--enable-export-all`. Export all functions from the wally shared library. | ||
Ordinarily only API functions are exported. (default: no). Enable this | ||
if you want to test the internal functions of the library or are planning | ||
to submit patches. | ||
- `--enable-swig-python`. Enable the [SWIG](http://www.swig.org/) Python | ||
interface. The resulting shared library can be imported from Python using | ||
the generated interface file `src/swig_python/wallycore/wallycore.py`. (default: no). | ||
- `--enable-swig-java`. Enable the [SWIG](http://www.swig.org/) Java (JNI) | ||
interface. After building, see `src/swig_java/src/com/blockstream/libwally/Wally.java` | ||
for the Java interface definition (default: no). | ||
- `--enable-coverage`. Enables code coverage (default: no) Note that you will | ||
need [lcov](http://ltp.sourceforge.net/coverage/lcov.php) installed to | ||
build with this option enabled and generate coverage reports. | ||
|
||
NOTE: If you wish to run the Python tests you currently need to pass | ||
the `--enable-swig-python` option. This requirement will be removed | ||
in a future version. | ||
|
||
### Recommended development configure options | ||
|
||
``` | ||
$ ./configure --enable-debug --enable-export-all --enable-swig-python --enable-coverage | ||
``` | ||
|
||
### Python | ||
|
||
For python development, you can build and install wally using: | ||
|
||
``` | ||
$ python setup.py install | ||
``` | ||
|
||
It is suggested you only install this way into a virtualenv while the library | ||
is under heavy development. | ||
|
||
## Cleaning | ||
|
||
``` | ||
$ ./tools/cleanup.sh | ||
``` | ||
|
||
## Submitting patches | ||
|
||
Please use pull requests on github to submit. Before producing your patch you | ||
should format your changes using [uncrustify](https://github.com/uncrustify/uncrustify.git) | ||
version 0.60 or later. The script `./tools/uncrustify` will reformat all C | ||
sources in the library as needed, with the currently chosen uncrustify options. | ||
|
||
The version of uncrustify in Debian is unfortunately out of date and buggy. If | ||
you are using Debian this means you will need to download and build uncrustify | ||
from source using something like: | ||
|
||
``` | ||
$ git clone --depth 1 https://github.com/uncrustify/uncrustify.git | ||
$ cd uncrustify | ||
$ ./autogen.sh | ||
$ ./configure | ||
$ make | ||
$ sudo make install | ||
``` | ||
|
||
You should also make sure the existing tests pass and if possible write tests | ||
covering any new functionality, following the existing style. | ||
|
||
## Generating a coverage report | ||
|
||
To generate an HTML coverage report, use: | ||
|
||
``` | ||
$ ./tools/cleanup.sh | ||
$ ./tools/autogen.sh | ||
$ ./configure --enable-debug --enable-export-all --enable-swig-python --enable-swig-java --enable-coverage | ||
$ make | ||
$ ./tools/coverage.sh clean | ||
$ make check | ||
$ ./tools/coverage.sh | ||
``` | ||
|
||
The coverage report can then be viewed at `src/lcov/index.html`. Patches to | ||
increase the test coverage are welcome. |
Oops, something went wrong.