Commit Graph

539 Commits

Author SHA1 Message Date
rorp
74a44d1c4d Initial BIP157 support (#695)
* WIP: Initial BIP157 support

* store block hash and hetgh along with its compact filter header

* download and parse block filters

* getcfilters/cfilter

* cfilter table

* rescan full filter chain

* improved rescan performance

* optimize compact headers download

* addressed the PR comments

* split SVP and Neutrino node implementations

* configurable filter batch sizes

* initial filter sync

* addressed comments

* chage filter table's primary key

* fix Golomb filter deserialization

* batch database inserts

* neutrino node test

* fixed node test

* addressed the PR comments

* serializers tests

* cleanup

* fix compilation errors

* fix unit tests

* increase test coverage

* enable NeutrinoNodeTest

* make scalafmt happy

* don't cache experimental binaries

* inclease test coverage

* fix unit tests

* more granular CI tests

* disable NeutrinoNodeTest

* refactor tests

* addressed comments

* test coveage

* fix formatting

* responded to the comments

* some more changes

* fix the build

* test coverage

* revert testnet3 config parameter

* minor changes

* cleanup
2019-09-25 13:18:51 -05:00
Chris Stewart
67ead0bc7e 2019 09 05 scalafmt update (#735)
* Update scalafmt to 2.0.1

* Scalafmt

In this commit we
1) Reconfigure the .scalafmt.conf file
2) Add a scalafmt binary (same version as specified in conf file)
3) Use said binary on CI to check that everything is formatted correctly

* Ran scalafmt

* Update scalafmt ignore

* Add scalafmt plugin to project/plugins.sbt, run it

* run scalafmt
2019-09-05 20:02:58 -05:00
Chris Stewart
642a3366b1 Add receiver param to BitcoindRpcTestUtil.fundBlockChainTransaction() (#737)
* Add receiver param to BitcoindRpcTestUtil.fundBlockChainTransaction()

* Actually implement awaiting for the hash to be seen
2019-09-05 13:18:32 -05:00
Chris Stewart
d4ccc2c441 2019 09 05 v18 rpc (#734)
* This is for colin

* Fix remaining errors on V18 RPC calls

* remove unused code final formatting fix

* implemented fixed listwalletdir rpc test

* responding to code review and replacing flatmaps
2019-09-05 09:15:00 -05:00
Torkel Rogstad
e0a5646258 Deprecate generate (#728) 2019-09-01 07:46:38 -05:00
Torkel Rogstad
8a58d7dde8 Make it possible to construct RPC client without ActorSystem (#725) 2019-08-30 15:12:18 -05:00
Chris Stewart
d810e17324 Remove BlockchainBuilder, speed up ChainHandler test that processes m… (#723)
* Remove BlockchainBuilder, speed up ChainHandler test that processes mainnet headers, add test for ChainAppConfig

* Add test for BlockHeaderDAO.getAncestorAtHeight()

* Consolidate ChainAppConfigTest, add ScalaTestUtil to help with working with scalatest, speed up ChainHandlerTest a bit more
2019-08-27 12:29:22 -05:00
Torkel Rogstad
2f7fb05f96 Build and CI improvements (#710)
* Build and CI improvements

In this commit we:

1) Parallelize the Travis CI config, by splitting
    each project into its own Travis task
2) Download bitcoind binaries through sbt

* Use binaries downloaded by sbt task

* Make BitcoindRpcTestUtil work on Travis without bitcoind on PATH

* Add new downloadEclair task to sbt

* use sbt downloaded binaries in tests

* Fix Eclair and Bitcoind tests
2019-08-27 10:48:48 -05:00
Torkel Rogstad
5e9b26bbab Remove untyped CryptoUtil methods (#722)
Types are our friends:-)
2019-08-27 06:32:50 -05:00
Torkel Rogstad
c2f37335b8 Bump Scala versions (#697)
* Bump Scala versions

Support Scala 2.12.9
and 2.13.0.

To make this easier, we delete the `scripts` project. Everything
that was in here was covered by content on the website. We also
delete the `doc` folder, as that was a remnant from when `scripts`
was called `doc`.

* Crib uPickle akka-http support while we wait for publish

* Fix compiler warnings

* Add note on test logging to contribution guide

* Reduce duplication in Blockchain implementation

* Use Scala 2.12 for website

* Introduce compat package object for collections converters

* Fix Either compiler warnings

* Add sync-chain and create-wallet docs from deleted scripts

* Fix rebase goofup
2019-08-23 13:53:00 -05:00
Torkel Rogstad
2f5d4db1b2 Bump test coverage (#713)
* Bump test coverage

* Lower test coverage requirement for chain
2019-08-23 18:32:55 +02:00
Torkel Rogstad
2a0d78d054 Tweak module logging (#698)
* Split app loggers into their corresponding modules

This avoids a bunch of places with awkward implicit resolution.

We also make sure that all logging in node, chain and wallet
happens with the app loggers, and not BitcoinSLogger

* Tune test logging level to WARN
2019-08-20 08:11:10 -05:00
Chris Stewart
ff051ac7a2 2019 08 05 broadcast tx test (#680)
* Start refactoring BroadcastTransactionTest to use new SpvNodeFundedWalletBitcoind fixture

* Double timeout to 10.seconds on spv node disconnect

* Attempt to bump disconnect even more

* Add more logging around starting and stoping spv node to try and debug failures with fixtures on test suites

* move starting of spv node into one place in the fixtures -- createSpvNode() --, also look at ordering of destruction to make sure that the spv node is stopped/destroyed BEFORE bitcoind is stopped/destroyed. If the inverse order happens, our spv node won't receive a response from bitcoind and will hang waiting for the Tcp connection to close gracefully

* Try switching from  to  to get CI to pass

* Add more logging and throws to try and debug failures on ci

* Add logging in the case we send a close command and peer isn't defined

* Match on Tcp.Connect on default receive in P2PClient

* Make SpvNode.disconnect() check to see if we are connected before attempting to disconnect

* Add more logging in fixtures, change behavior of SpvNode.disconnect() to not throw if we are already disconnected

* Switch to preferred way of terminating actor system in tests

* Make PeerMessageSender.sendMsg() return a , make sure a message is not sent to P2PClient until we are fully intialized

* Switch p2p logging to DEBUG

* Complete disconnect promise on peer message recv in the case where we didn't have a peer to begin with

* Make SpvNodeTest more robust, fix bug for when we send 'sendheaders' message. We shouldn't do this until our peer has sent us a verack

* Only send 'sendheaders' message to our peer after we receive a 'sendheaders' message from our peer. Hopefully this solves async issues where we were sending 'sendheaders' before our handshake was fully completed with our peer which means we wouldn't get headers sent to us

* Cleanup pt1
2019-08-14 07:18:36 -05:00
Chris Stewart
b0b1c1cc42 Start the process of refactoring our ChainHandler to be able to avoid… (#655)
* Start the process of refactoring our ChainHandler to be able to avoid database calls on TipValidation

WIP: Begin explicity passing state back and forth in return types of PeerMessageReceiver, P2PClient, , DataMessageHandler. This commit also implements the ability to keep our blockchain completely in memory. Previously when we were updating the tip of the chain, we had to make a database read to figure out what the best tips are. This is suboptimal for performance because a database read needs to be done for every block header we see, now we just keep the chain in memory

Fix bug in DataMessageHandler that pre-emptively sent a getheadersmsg to our peer. Make 'chainApiF' internal to our spvNode (not a parameter). This forces the chainApi to be created from disk everytime a new SpvNode is spun up. This keeps us in sync with the blockchain at disk at the cost of disk access and less modularity of SpvNode

Address torkel code review

Fix rebase issues

Address code review

Address nadav code review

* Rebase onto master, fix api changes
2019-08-06 13:31:54 -05:00
Chris Stewart
c934d8efc2 Address issue #673, also refactor fixture stuff to be in companion ob… (#676)
* Address issue #673, also refactor fixture stuff to be in companion objects rather than traits so they can be re-used without extending the trait itself. This allows for more modularity with our fixtures

* fix bugs in unit tests, address #675 to make MerkleBufferTests faster

* Refactor test timeout in UpdateBloomFitlerTest

* fix callback logic bug on matching unrelated txs/addresses in UpdateBloomFilterTest, re-order broadcasting of things to avoid async bugs hopefully

* Make  a def in NodeUnitTest, this keeps tests in the same suite from using the same config. This allows us to write multiple tests per suite, instead of just one. This also adds implicit parameters to our fixture constructors/destructors to properly create and destroy this config. The long term goal here also should be getting rid of config.initialize() we are calling everywhere as this is a anti-pattern, fixtures should take care of construction and destruction of things

* Broadcast tx earlier in test case for UpdateBloomFilterTest

* Rework NodeWithWalletTest to use the new fixtures we have in the node project, now use SpvNodeFundedWalletBitcoind
2019-08-06 11:49:17 -05:00
Torkel Rogstad
46280c9e59 Add functionality for updating SPV node bloom filter (#585)
* Add functionality for updating SPV node bloom filter

* Add SPV node shutdown to exit hook

* Clean up traits/case classes

* Change fixture in WalletBloomTest

* Fix logging bug in TransactionProcessing

* Add MerkleBuffers

In this commit we add MerkleBuffers, which is an object
that lets us aggreagate merkleblocks with their corresponding
transactions before sending them out. This is global, mutable
state (bad!) but it's a working solution for now;

* Use TestAsyncUtil

* Add MerkleBuffers test

* Send getdata if receiving single header

* Change awaitSync to use block count

* Fix UpdateBloomFilterTest

* Add more logging of chain/headers validation

* Send getdata for all blocks

* Nits: Scaladocs, comments toString
2019-08-02 09:22:20 -05:00
Torkel Rogstad
a76f61f97c Add configurable logging to data directory (#640)
* Add logging to data directory

In this commit we add the ability for the node, chain
and wallet projects (+ the server) to log to the users
data directory instead of whatever directory the
binaries was launched from. This is inherently a bit
more complicated than our previous setup, because
we need to read the user directory before we can create
loggers. As a result of this, some files/methods were
moved around, so the relevant app config could be
found in scope.

We also  introduce several logging categories that can be
tuned individually through user configuration. These logggers
are exposed both as traits that give a field `logger`, or
as methods that return the required logger.

* Add datadir configuration to AppConfig

In this commit we add support for AppConfig to pick up
the data directory configuration file. We also add
a section to the contributing guide on how to tune
logging levels.

* Pass data directories explicitly for configuration
2019-08-01 06:01:56 -05:00
cwaldron97
e6dcd1cfb4 Cleaning up Publish Logs (#634)
* This PR is attempting to remove the publishing errors when publish
locally many of which are incorrectly linked things in scaladocs which
there are some differences in formatting. Hopefully this removes alot
if not all of the "link not found for ..." warning messages that show
up.
2019-07-31 12:28:22 +02:00
Chris Stewart
13ba42b087 Call BitcoindRpcTestUtil.stopServer inside of EclairRpcTestUtil.shutdown (#645)
* Call BitcoindRpcTestUtil.stopServer inside of EclairRpcTestUtil.shutdown

* Reset submodule
2019-07-18 12:35:33 -05:00
Torkel Rogstad
7f0b11c019 Add functionality for broadcasting TXs to node (#577)
* Add functionality for broadcasting TXs to node

In this commit we add functionality and tests
for broadcasting a TX from our node. To accomplish
this we introduce a table over broadcastable TXs
that's added to when the externally facing method
broadcastTransaction(tx) withing SpvNode is called.
We send out a inv message for the TX we just added,
and upon receiving a getdata message we search in
the previously mentioned table for entries where
the hashes match up.

* Broadcast TX from server to SPV node

* Perform assertions on the balance of bitcoind after sending a TX

* Remove typeclass from broadcast TX

* Refactor withFundedWalletAndBitcoind

* Match on BitcoindExecption instead of throwable

* Clean up broadcast functionality after code review
2019-07-17 07:32:05 -05:00
Torkel Rogstad
4f4636448c Node cleanup (#591)
* Cleanup

In this commit we cleanup a few Scaladocs and change some
trait/impl pairs into just a case class.

* Node cleanup

In this commit we
1) Rename Client to P2PClient. Client is a very generic name.
2) Clean up some Scaladocs
3) Remove some unecessary objects/traits/classes and replace them
    with case classes
4) Add trace logging of bytes received in P2PClient
2019-07-13 09:26:00 -05:00
rorp
684607f510 Some API changes for Eclair test kit 2019-07-10 14:04:54 -07:00
Torkel Rogstad
30e6d7030f Somewhat dirty standalone server and CLI binary (#558)
* PoC bitcoin-s-cli

* Add CLI, Server sbt projects, remove Ammonite

In this commit we set up sbt configuration for
CLI, Server (in-work-name) and corresponding
test projects.

We also remove Ammonite shell from sbt, as that
isn't really being used. bloop console offers
the same functionality way more ergonimic.

* Move BitcoinSAppConfig into new server project

Server project depends on node, chain wand wallet
so this is a good time for introducing this class
into main sources. We also introduce
BitcoinSTestAppConfig in testkit, to replace the
functionality in BitcoinSAppConfig related to
tests.

* Type chain in blockchainresult

* MVP server setup for node, chain and wallet

* Extremely dirty CLI for interacting with server

* initial attempt at mimicking Bitcoin Core API

* WalletStorage: add method for checking for seed existance

* Check for seed existance on wallet startup

* Fix bug where MnemonicNotFound was not an error

* Segregate confirmed and unconfirmed balance methods

* Add error handling, improve formatting of CLI output

* Tweak build

Bump Sttp version, downgrade to uPickle 2.11 compat,
skip publish in cli-test and server-test

* Add CLI, server and picklers to root project
2019-07-10 06:33:17 -05:00
Torkel Rogstad
8756495685 Fix a test we forgot to update 2019-07-10 11:39:00 +02:00
Torkel Rogstad
a71aecec52 Process outgoing transactions (#555)
* Split wallet functionality into multiple traits

In this commit we refactor LockedWallet into multiple traits
that provide functionality related to a subset of total wallet
functionality. This has the benefit of making it clear which
methods are helper methods that are only intended to be used
in a very specific setting, and which methods are part of the
internal wallet API that other parts of the wallet can use.

* Rework TransactionOutput and TransactionOutPoint to case classes

* Add extension methods for flattening lists of assertions

* Segregate confirmed and unconfirmed balance methods

* Add test for FutureUtil.sequentially

* Add trace logging of balance fetching

* Process outgoing TXOs

Move TX processing into separate trait, add internal API method

Unify DB representation of TXOs

    Prior to this commit we stored TXO information
    across diferent tables, with joins and tuples
    needed a bunch of places to keep track of
    everything we needed. In this commit we unify
    the tables, leaving us with only one table for
    TXOs.
2019-07-09 06:25:24 -05:00
rorp
d74a0560b8 [WIP] New Eclair RPC client (#535)
* [WIP] New Eclair RPC client

* channel, close, connect, getinfo, open, peers

* allchannels, allnodes, allupdates

* audit, channels, findroutetonode, forceclose, updaterelayfee

* Initial version of createinvoice

* ShortChannelId: improved error handling and scaladoc

* addressed the PR comments

* parseinvoice, payinvoice, getsentinfo, getreceivedinfo, sendtonode, sendtoroute

* unit tests

* addressed the PR comments

* ws, usablebalances, channelstats, networkfees, getinvoice, listinvoices

* addressed PR comments

* change eclair URL

* cleanup

* addressed comments

* fidex compiler warnings

* Eclair 0.3.1

* scaladoc

* cleanup
2019-07-03 13:38:56 -05:00
Torkel Rogstad
3fd96cf776 Have sampleSome do a maximum of 10 attempts 2019-07-01 19:02:01 +02:00
Torkel Rogstad
157e3def15 Add annotated type to public method 2019-07-01 13:00:05 +02:00
Torkel Rogstad
f8e5ac19ba Add TX generator for non-empty output TXs 2019-06-27 15:29:21 +02:00
Torkel Rogstad
6ffd505946 Add sampleSome method to scalacheck.Gen 2019-06-27 15:29:21 +02:00
Torkel Rogstad
0f5669bac3 Rename HDCHain.toAddress 2019-06-27 15:28:08 +02:00
Torkel Rogstad
86517c0a6d Replace incoming/outgoing TXs with TXOs
Rework the wallet DB model so that instead
of dealing with incoming and outgoing transactions
we deal with incoming and outgoing transaction
outputs.
2019-06-27 15:28:08 +02:00
Torkel Rogstad
454808abea Add TX generators that pay to a given SPK 2019-06-27 15:28:08 +02:00
Torkel Rogstad
1eb80d82a1 Get rid of compiler warnings 2019-06-27 15:28:08 +02:00
Torkel Rogstad
f5591f3c0f Replace addUtxo with processTransaction
In this commit we replace addUtxo with
processTransaction in the wallet API. addUtxo
is kept around, but only as an internal
implementation detail.

The new flow looks like this:
1) The wallet gets notified about a new TX
    through a processTransaction call
2) It then searches through our already
    processed incoming TXs:
        if found, updates the confirmation
            status
        else, inserts it into the DB
3) We then call addUtxo, if the previous
    step resulted in a new TX in our
    DB
2019-06-27 15:28:08 +02:00
Torkel Rogstad
e2278f7606 Get UTXO DB unit tests passing 2019-06-27 15:28:08 +02:00
Torkel Rogstad
88e318d485 Move WalletDAOs to testkit 2019-06-27 15:28:08 +02:00
Torkel Rogstad
ff5b1c25f1 Add foreign key on UTXOs to incoming transactions 2019-06-27 15:28:08 +02:00
Torkel Rogstad
e4e9ec9db9 Add SPK field to AddressTable 2019-06-27 15:23:23 +02:00
Torkel Rogstad
13deceab30 Move utxos into wallet test util 2019-06-27 15:23:23 +02:00
Torkel Rogstad
161db9ff92 Add toBase64/fromBase64 to AesEncryptedData 2019-06-25 11:39:17 +02:00
Torkel Rogstad
d58f3dc715 Update AesCrypt to work with keys
In this commit we update our AesCrypt
functionality to work with AES keys rather
than passphrases that are extended to keys.
This makes it easier to integrate with other
languages, as the key stretching introduces
a bunch of additional parameters to the
actual AES encryption.

We also include tests that verify that we're
able to encrypt/decrypt using Bitcoin-S,
Crypto-JS (JavaScript), pycrypto (Python)
and OpenSSL CLI.
2019-06-24 17:21:41 +02:00
Chris Stewart
a716d374ca Attempt to sync with sendheaders (#537)
* Attempt to sync with sendheaders

Fix sync with headers by generating one block in regtest to get out of IBD

Fix comment

Add more comments

Add missing actor system import

more clean up

* refactor test case to avoid sleeping the thread
2019-06-20 05:58:25 -05:00
Torkel Rogstad
a87858247c Service identifier and node cleanup (#522)
* Log messages more granularely in node

* Add pong message

* Rework P2P service identifier

The old implementation didn't catch the notion
that service identifiers was a bit field where
multiple services could be set at the same time.

* Make Peer take InetSocketAddress

Previously it took NetworkIpAddress.
This doesn't make any sense, as we
need to know the services bitfield
to construct a NetworkIpAddress.

* Clean up logs and toString methods

* Clean up node README and main method

* Make all networks final case objects

* Skip publishing of wallet, node and chain

* Clean up logging of node and chain modules

* Add logging of max height in SpvNodeMain

* Clean up Scaladoc and toStrings

* Add logging configuration as symlinks in node

We'll have to figure out a more stable solution to
configure logging for the SPV node, but for the time
being this is an acceptable solution.

* Fix 2.11 compiler error
2019-06-17 14:27:51 -05:00
Nadav Kohen
c89104bfda BIP 158 Golomb-Rice Coded Sets and block filters (#481)
* Implemented GCS (WIP)

Added some of Chris' tests for golombEncode and golombDecode

Fixed GCS.golombDecodeSet

Separated GCS object from GolombFilter class

Added hanging test for set encoding

Fixed property test for encoding and decoding arbitrary sets

Added test for GCS.buildGCS and hashing function consistency

Added method to construct a Block Filter from a Block

Added scaladocs in GCS.scala

Added TempUtxoProvider to make BlockFilter testable

Wrote a test for GolombFilter.matchesHash

Added test for arbitrary data matching in bip 158 filter

Added optional right-padding on GCS BitVector, BlockFilter.fromHex, and got started on BlockFilterTest

Cleaned up Bip158TestCase.fromJsArray

Fixed parsing of test vectors for bip 158

Wrote test for BlockFilter (doesn't pass)

Responded to some code review

Included CompactSizeUInt in filter

Created BitcoinScriptUtil.getDataTokens for output serialization

Wrote test for BitcoinScriptUtil.getDataTokens

Added test for BitcoinScriptUtil on the genesis block

Fixed name

:(

* Fixed SipHash and block serialization!

* Fixed bugs relating to empty scripts, all tests passgit push --force-with-lease nadav 2019-05-28-bip158 !

* Cleaned up BitcoinScriptUtil.getDataTokens and its test

* Responded to code review

* Factored out common code from BlockFilter apply methods

* Some cleanup
2019-06-17 11:17:20 -05:00
Torkel Rogstad
435aef7b0b Pass bloom filter to SPV node (#514)
* Add getAddressInfo to Wallet API

* Add Bloom filter and event callbacks to SPV node

* Move wallet test trait to testkit

* Test for connecting SPV node with wallet

* Tune logging in SPV node

* Clean up BloomFilter

* Proper toString in inventory and inventorymessage

* Actually pass in callbacks to SPV node

* Fix rebase screwup and partially respond to code review

* Default to file based databases in tests

This is due to issues with deadlocks with
in-memory based databases. We need DBs
to stay alive between connections, but
not across tests.

In DB intensive chain validation tests we
use in-memory databases instead. This
seems like a reasonable tradeoff between
simplicity and speed.

* Make SpvNodeCallbacks contain sequence of functions within

* Make Bloom filter non-optional in SpvNode
2019-06-17 06:48:26 -05:00
Torkel Rogstad
fa84c11f52 Default to file based databases in tests (#517)
This is due to issues with deadlocks with
in-memory based databases. We need DBs
to stay alive between connections, but
not across tests.

In DB intensive chain validation tests we
use in-memory databases instead. This
seems like a reasonable tradeoff between
simplicity and speed.
2019-06-14 11:10:36 -05:00
Torkel Rogstad
6de0ba268e Bump P2P + crypto test coverage (#506)
* Rename P2P tests and move generators into correct package

* Add more tests for P2P messages

* Add note on coverage to contributing guide

* Replace network in P2P header with typed network

* Add more P2P tests

* Add more tests for ECPriv and ECPub
2019-06-11 10:01:46 -05:00
Torkel Rogstad
03be955717 Refactor logback configuration to reduce repetition (#499) 2019-06-07 07:29:40 -05:00
Torkel Rogstad
1ff0dee934 Reshuffle package location of P2P messages (#495)
* Reshuffle package location of P2P messages

Previously the companion objects for P2P messages
and the actual messages were in different pacakges.
This made them more awkward to use than necessary.

We also clean up some Scaladocs in this commit.

* Move all P2P messages to core
2019-06-06 09:13:32 -05:00
Torkel Rogstad
3c4157a698 Multi module configuration (#494)
* Replace AppConfig with more specific types

* Rework database configuration

In this commit we:

1) Introduce new database settings for all submodules,
and at the same time remove the singular datbase setting
for the entire project
2) Introduce a new method .initialize on all configs
that is responsible for creating needed directories,
databases and files
3) Introduce a new class BitcoinSAppConfig that wraps
configs for all three other subproject config. We
also provide implicit conversions that enable this
super-config to be passed in wherever a specialized
config is required.
4) Add more tests for our configuration setup.

* Add Ammonite to Docs deps
2019-06-05 10:48:15 -05:00
Torkel Rogstad
49ffbea801 Make TestAsyncUtil serializable (#493)
Every now and then the Scalatest framework
has crashed when reporting errors, with
failure to serialize this. There should
be no downside to having the trait here,
and we avoid the nasty Scalatest failure.
2019-06-05 07:18:17 -05:00
Chris Stewart
a3dd824e57 Node (#490)
* WIP: 2018 12 22 node project (#280)

* Add files from old spv node project

src compiling

test files compiling

ran scalafmt

Fix serializer tests

Get non networking test cases to work

WIP: Debug peermessagehandler

Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db

WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler

Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages

* Wip: Node refactor

* Create node test project, move all node tests into that project and move all generators for the node project into testkit

* Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver

* Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver

* update readme about status of node project (#359)

* Add flyway plugin to manage database schemas (#361)

* Add flyway plugin to manage database schemas

* Switch database driver to sqlite3 to be more portable, rework configs for sqlite3

* Set up sqlite database directories and files if they are not already created

* Add torkel's review

* Add chain, wallet, db-commons projects (#367)

* Add chain, wallet, db-commons projects

* Rework db creation logic if they db does not exist

* Add config logging to try to debug travis ci

* Pass explicit class loader for db config

* Remove duplicate call to dbConfig

* Make DbConfig.dbConfig a lazy val

* Remove noisy log

* Add scaladoc to DbConfig

* Switch dbConfig readme paragraphs

* Fix compile issues introduced during rebase onto master with rpc changes (#394)

* WIP: 2019 03 12 tip validation (#378)

* Implement blockchain handling data structures

Add TipValidation happy path

Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW

Add overflow check, fix endianness bug for checking proof of work

Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests

fix a few nits

Fix compile error, clean up unused import

Remove redundant files from node project

* Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project

* Add full POW change check in TipValidation, address code review nits

* Configure logging in chainTest, turn logging OFF in other test projects

* Address code review pt2

* Add coverage minimum for chain project (#398)

* Add coverage minimum for chain project

* Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests

* Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly

* Address code review, fix a flaky test in ClientTest.scala

* Test Fixtures (#403)

* Working test fixtures

* Removed ChainTestFixture trait in main code

* Composing Fixtures (#413)

* Downloaded over 9000 mainnet BlockHeaders into a json file

* Added new fixture with populated blockHeaderDAO

* Split writing to db into batches

* Rebased

* Simplified fixtures with makeFixture abstraction

* Added util functions for composing builders

* Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress

* Address code review

* wip

* A compiling withBitcoindZmqChainHandler fixture

* Tests passing!

* Made blockHeaderDAO private

* Got 9000 new block headers from 562375 to 571375

* Added offset to populated blockHeaderDAO fixture

* Added scaladocs to fixture things

* Initial wallet: import UTXO and spend it (#391)

* Updates ExtKeyVersion with fromChainParams method

* Add equals to Address

* Update BIP44 classes

* Add ScriptType

* Initial work on wallet support

* Add foreign keys pragma for SQLite

* Add UTXO models and DAO

* Add addres P2WPKH generation and WIP for addUTXO

* Add logging config for wallet

* Add change address generation, proper-ish addUtxo and sendToAddress

* Address code review on #391

* Add empty AES passphrase invariant

* Add poor mans test fixtures

* Add listUtxos, listAddresses and getBalance to wallet API

* Use fixtures from chain project

* Fix CI test failures

* Fix broken up package path

* Updates bloop config for new projects (#424)

* Multi fixture file (#419)

* Created FixtureTag and ChainFixture

Used ChainFixture in BitcoinPowTest

Added implicit conversions for nice syntactic sugar

* Added documentation for multi-fixture

* Made defaultTag a val

* add a logback-test.xml to the wallet project (#433)

* Introduce AppConfig that combines ChainParams and DbConfig (#432)

* 2019 04 23 app config per project db config per project (#434)

* Add DB conf file resolution that works across projects

* Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network

* Add ammonite to db-commons, remove noisy logs

* remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing

* Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object

* remove cast in Wallet.scala

* Add EnhancedEither class for 2.11 compat (#437)

Add implicit conversion from Either to
2.11-compatible Either-wrapper. Also
remove trailing comma in WalletTestUtil
that breaks 2.11 build.

* Fix CI tests hanging (#438)

* Execute wallet tests sequentially to avoid SQLite deadlocks

* Refactor logback config to reduce duplication

* Use in-memory SQLite DB for unit tests

* Debug prints for DatabaseConfig.forConfig

* Fork JVMs in test to ensure proper in-memory DBs

* Pass in Akka config to Eclair tests, avoid cluttering Akka log output

* Don't fork JVM on node tests'

* Move things out of ChainUnitTest (#448)

* Move things out of ChainUnitTest

* Remove printlns

* 2019 04 29 client test (#449)

* Bump timeout on connect to node test

* Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized

* Wrote tests for POW difficulty change calculation and header processing (#429)

Fixed BitcoinPowTest

Rebased onto AppConfig code

Rewrote ChainHandler integration test

Made chain handler test synchronous

Fixed a couple test bugs

Implmented a more efficient getAncestorByHeight

Fixed ChainHandler integration test by using the correct starting conditions

Responded to code review

Responded to more code review

Deleted redundant Pow test

Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance

* WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450)

* Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc

* Add check for having the best block hash in our chain state already

* Fix prev block hash to be empty hash if genesis block header

* BlockchainBuilder (#439)

* First commit for implementing a BlockchainBuilder

* use Builder rather than ReusableBuilder to be compatible with scala 2.11.x

* Decouple Blockchain & BlockHeaderDAO

* Rebase onto node, incorporate changes in #429

* Add more comments

* Reverse order of headers in builder

* rebase onot node branch, refactor apis

* DB: Add utility method for listing tables in a DB (#447)

* Node rebase (#458)

* Implement BIP32 path diffing

* Rebase node onto newest HD changes in master

* Fix 2.11 compile errors

* 2019 05 01 wallet ammonite scripts pt2 (#452)

* wip -- not finding testkit in doc worksheet

Wip -- classdef not found for create-wallet.sc

zmq bug

Clean up some logs

nest zmq start in bitcoindF

update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout

Rebase onto node branch with new configs

Successfully running ammonite script create-wallet.sc

2019 05 01 wallet ammonite scripts pt2 (#25)

* Refactor Ammonite dep

* Add basic error handling in AmmoniteBridge

* Add very basic README for doc project

Fix compile issues after rebasing onto master

Add code to sync our wallet code with bitcoind after creating a tx

* refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger()

* Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc

Co-Authored-By: Christewart <stewart.chris1234@gmail.com>

* 2019 05 05 sync chain (#460)

* Add code to sync our wallet code with bitcoind after creating a tx

Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest

* fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly

* rename script from persist-chain.sc -> sync-chain.sc

* fix 2.11.x compile issues

* Refactor chain, node, wallet config (#463)

* Refactor chain, node, wallet config

Get rid of NetworkDb, DbConfig
Add proper structure to conf system,
moving everything under the bitcoin-s
root key.

* Remove Scalacheck from node project

* Add doc on configuration

* Add override feature to AppConfig

* Address code review in #463

* Throw if default data dir is used in tests, add Scaladoc to AppConfig

* Add explanations for withOverrides, link to configuration.md from AppConfig

* Fix compile error

* Moves chain fixtures to testkit project (#475)

reset node files

* Store encrypted mnemonic to disk (#462)

* Add WalletStorage object

* Add encrypted mnemonic storage, locked wallet

Add lock and unlock operations to wallet.
Separate between locked and unlock wallet.

* Handle non-existant seed file

* Respond to code review from Chris

* Use val instead of import

* Add doc on how mnemonics are encrypted/stored

* 2019 05 15 spv sync headers (#479)

* Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit

* Implement test case to sync a header via spv into bitcoin-s

* Fix compiler errors

* Make node project Main runnable (#26)

* Add logging configuration to node project

* Make default config workable in non-test environments

* Add more logging of config in BH DAO and AppConfig

* Make Peer id optional

* Make node Main.scala runnable

* Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes

* Address code review from torkel

* Reintroduce withOverrides (#29)

* Turn off chain validation logs

* Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf

* Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF

* remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 09:53:00 -05:00
Chris Stewart
5256327a56 Downgrade sbt-api-mappings plugin to try and get it to work with mac osx (#486)
* Downgrade sbt-api-mappings plugin to try and get it to work with mac osx

* Change version to 2.1.0
2019-05-30 13:38:36 -05:00
Chris Stewart
8bede3fddc Give sbt-api-mappings plugin a concrete version, fix compiler warnings with unused imports (#485) 2019-05-30 09:47:21 -05:00
Chris Stewart
08b4ee1afe update readmes (#467) 2019-05-30 09:02:03 -05:00
Torkel Rogstad
fb178eb295 Add proper parsing of bitcoin.conf, rework auth credentials (#478)
* Add proper parsing of bitcoin.conf, remove datadir

Somewhat recently a new config format was introduced
in Bitcoin Core. Options can now be specified under
section headers ([regtest], [main], [test]), as
well as with network prefixes (regtest.rpcport,
main.prune) and the traditional format. In this commit
we introduce a new type BitcoindConfig that parses
this format. We also make the necessary changes in
the bitcoind/Eclair RPC clients to accomodate this new
type.

We also remove the datadir field from
BitcoindAuthCredentials. This is not strictly necessary
to connect to a bitcoind, so this is a bad separation
of concerns. The datadir field is instead moved into
the BitcoindInstance.

Finally we go over some places in tests and test
utils and assert that we are operating in the
user temporary directory. This is a safety measure
so that other developers/users won't do the same
mistake I did while working on this and accidentally
blow up their $HOME/.bitcoin directory.

* Add BitcoindRpcClient.fromDatadir

* Address code review from Chris
2019-05-28 11:33:16 -05:00
Torkel Rogstad
90f2551571 BIP84 and BIP49 (#444)
* BIP84 and BIP49

* Respond to code review

* Update HDChainType.scala
2019-05-03 04:47:10 -05:00
Torkel Rogstad
2e9c524652 Add AES encryption and decryption (#395) 2019-04-08 09:47:43 -05:00
Torkel Rogstad
fb16d6b200 Add support for Bitcoin Core 0.17 (#384) 2019-03-26 12:41:05 -05:00
Torkel Rogstad
06e5b6b450 Add BIP44 and BIP32 path support (#379)
* Add BIP44 and BIP32 path support

Make paths from strings, indexes/coins/chains,
BIP32 children types.

Derive xprivs and xpubs from paths.

* Address code review on BIP44 from Chris

* Rename children -> path, bip32child -> bip32node

* update README with bip44 name changes
2019-03-19 13:09:11 -05:00
Chris Stewart
eaa87b1e2b Move BitcoinSUnitTest abstract class to the testkit project so it can be reused across our codebase (#375) 2019-03-07 14:48:34 -06:00
Chris Stewart
7e9f4362bf Make the doublesha256digest generator more random (#371) 2019-03-04 15:21:38 -06:00
Chris Stewart
201e52f32d Integrate big endian hashes, integrate them into the bitcoind-rpc project (#364) 2019-02-28 13:27:06 -06:00
Torkel Rogstad
db5a7254b9 BIP39 support (#353)
* Adds SHA256 hashing of BitVector

* Add BIP39 support
2019-02-28 06:13:37 -06:00
Nadav Kohen
a0c1ab91b4 testkit refactor (rename and repackage) (#355)
* Refactored testkit to have a package called testkit and renamed AsyncUtil and TestUtil, ran scalafmt

* Updated internal file names list
2019-02-21 10:04:31 -06:00
Torkel Rogstad
0e9e021ad7 Updates READMEs for root, testkit and zmq (#356) 2019-02-21 07:44:33 -06:00
Chris Stewart
88e6450c5a Reduce number of requests we send to eclair in testkits, add commandN… (#343)
* Reduce number of requests we send to eclair in testkits, add commandName param to parseResult in EclairRpcClient

* Factor our EclairRpcClient error message

* Make jvm opts more sane, refactor error message code again

* Add error message on EclairRpcTestUtil.sendPayments, scalafmt
2019-02-19 14:18:37 -06:00
Nadav Kohen
abc6f55a08 transformRetryToTestFailure in scala 2.11.12 (#346)
* Made transformRetryToTestFailure compile in scala 2.11.12

* Fixed RpcUtilTest

* Replaced match with if/else because match wasn't working
2019-02-19 13:00:43 -06:00
Nadav Kohen
8a491022fa Better test error messages (#336)
* Improves error messages in with testkit

* Added the changes to BitcoindRpcTestUtil and EclairRpcTestUtil

* Responded to code review
2019-02-18 19:28:54 -06:00
Chris Stewart
2879d9c25c 2019 02 14 fix digital signature bug ln invoice (#337)
* Fix bug of sign issue when serializing r,s ln invoice signatures, we weren't using the proper sign in some rare cases. We always want the BigInteger to be non-negative for r,s

* Fixing initialization problem with EmptyDigitalSignature

* revert default Deps.scala bitcoinsV to published version

* Address code review nits

* remove negative ln currency unit test case
2019-02-16 16:04:31 -06:00
Torkel Rogstad
696e9f4c45 Add BasicArithmetic trait (#329)
* Add BasicArithmetic to MilliSatoshis

* Add BasicArithmetic

* Add LnCurrencyUnit, CurrencyUnit, Number to BasicArithmetic

* Add tests for BasicArithmetic

* Make logger in unit test class protected and annotated

* Use BitcoinSUnitTest class

* Address code review
2019-02-16 15:19:00 -06:00
Chris Stewart
b44c7af53d Make start methods return Future[Unit] (#328)
WIP: Refactoring EclairTestUtil to use Futures

Finished refactor EclairTestUtil to use futures

Address code review

fix async bug in chan opening

Change snapshot version to something that should compile
2019-02-07 19:58:18 -06:00
Torkel Rogstad
8a203e881f Fixes conversion bug when sending with Eclair RPC (#318)
* Improved toString for LnCurrencyUnit

* Test for amount equality in RPC send methods

* Fix conversion bug in Eclair RPC client

* Version bump
2019-02-01 09:13:25 -06:00
Torkel Rogstad
8bbd4e0631 Adds audit RPC call + test (#314) 2019-01-28 18:15:02 -06:00
Torkel Rogstad
e068382701 findroute RPC call tests/types (#301)
* Improved toString methdos

* Eclair RPC for findroute

* ConfigUtil for getStringOrElse

* Scaladoc

* Version bump

* Typed ChannelDesc a and b fields
2019-01-23 08:45:46 -06:00
Torkel Rogstad
dec5bf0c14 Scaladoc (#296)
* Scaladoc formatting

* Adds sbt-api-mappings plugin
2019-01-21 06:36:39 -06:00
Torkel Rogstad
fd2c39abff Improves types for Eclair RPC (#298)
* Improves types for Eclair RPC

* Version bump

* Adds note in README.md on where artifacts are published
2019-01-18 06:34:08 -06:00
Chris Stewart
ab95053af8 version 0.0.3 (#290)
* version 0.0.3

* Fix cross compile issues so we can now compile and publish a dependency for the scala 2.11 series

scalafmt

* bump versions on readme, try to fix scoverage crossversion issue

* Downgrade scoverage to try and get it to work with ci

* Tinker with scoverage versions

* Add suggestion from scoverage people to exclude secp256k1jni from build coverage
2019-01-10 09:07:18 -06:00
Torkel Rogstad
22f8b35700 Scaladoc formatting (#295) 2019-01-10 08:54:57 -06:00
Torkel Rogstad
edcf097b2a Scaladoc formatting (#292) 2019-01-09 08:57:30 -06:00
Chris Stewart
268e235b4d Add secp256k1jni readme, start working main project readme, move old readme to core/README.md (#276)
Add documentation for TxBuilder

Try to fix links on core/README.md

add readme badges for bintray

Nits and formatting of README (#23)

ran scalafmt, fixed format in secp readme
2019-01-08 09:29:06 -06:00
Nadav Kohen
cc04732e41 RpcRetryException (#274)
* Created RpcRetryException for better error messages on RpcUtil timeouts

* De-duplicated RpcUtil

* Ran scalafmt

* Fixed an import and a version
2019-01-07 16:49:17 -06:00
Torkel Rogstad
1301336231 Adds typesafe-config parsing of bitcoin.conf (#279)
* Adds typesafe-config parsing of bitcoin.conf

Adds ZmqConfig trait

* Only add datadir if not present

* Use old and new config settings
2019-01-07 09:30:59 -06:00
Torkel Rogstad
abcd7c5d6d Fixes some Scaladocs (#286)
* Fixes some Scaladocs

* ran scalafmt

* ran test:scalafmt
2019-01-07 09:23:29 -06:00
Chris Stewart
497a4d7274 2018 12 14 rm gen dup test files (#269)
* remove duplicate files in rpc,eclair-rpc and replace them with publish testkit dep

remove gen package, fix bugs in testkit generators that weren't properly copied for the gen project

* Adding bintray resolver, fixing bug in bech32 address generator where exception was being thrown because an unassigned witness spk was hash was being called
2018-12-15 10:09:52 -06:00
Chris Stewart
cc2067c88c Remove all old EscrowTimeoutScriptSig/ScriptPubKey and channels stuff, this is obsolete now with the Lightning Network (#265)
run scalafmt
2018-12-09 15:47:57 -05:00
Nadav Kohen
4b8cebf3a4 Added scalafmt and ran it (#264) 2018-12-09 14:43:31 -05:00
Chris Stewart
18986b620d Lightning Network (#256)
* Implementation of LnCurrencyUnit

Fix unary and unneeded comments.

Refactor and change arithmetic to use PicoBitcoins.

Add property based testing for LnCurrencyUnits

Refactor LnCurrencyUnits after code review

Fix case and change LnPolicy to val

Remove division and add Unit tests

* Add additional unit tests and deserialization

* WIP: Implement LnHumanReadablePart (#190)

* Initial Implementation of LnHumanReadablePart

* Add unit tests and improve deserialization from string

* Refactor LnParams and LnHrp. Add requirements for instantiating LnHrp.

* Clean up and re-organize things

Re-working LnHumanReadablePart.fromString

Fix unnecessary pattern match

Removing test case

* Created eclairRpc project (#193)

Added getinfo functionality

Added connect functionality

Added most of the rpcs

Added send and checkpayment functionality

Added updaterelayfee functionality

Fixed compile errors

Ran scalafmt

Added DaemonInstance and start/stop methods

Added TestUtil

Added open test

Fixed typo in allUpdates

Fixed ChannelResult

Add eclair prefix to rpc stuff

open channel unit test passing

Adding instructions to grab default eclair in build

Add zmq config to bitcoin.conf

rename test log files, bump timeouts on connections

Add eclair-rpc README, rework some RpcUtil/TestUtil stuff for async

fixing bug in precious block, addressing code review

Address more code review comments

* Add NodeId, NodeUri, ChannelId (#196)

refactor json serializing methods to SerializerUtil, add more types

* Adding LnCurrencyUnit types to rpc api, fixing bug where eclair tests were not binding to a random port for zmq (#198)

Remove start stuff

* Adding more rpc tests, testing open, payment over channel, and closing of the channel (#199)

Add checkpayment tests

Address code review, create EclairTestUtil.createNodPair

* Two way eclair transactions sanity test (#200)

* Added a test for sending payments in both directions

* Updated travis bitcoin core version

* Initial LnInvoice Implementation (#194)

Start typing some ln invoice stuff

Add support for Fallback Address encoding

Part 1: Breaking out Bech32 specific functions into a util class, don't embed in Bech32Address

re-naming fromBase8ToBase5 -> from8BitTo5bit

Part 1: Breaking out Bech32 specific functions into a util class, don't embed in Bech32Address

rework ln invoices tags

fix more method names in Bech32

Rename ScriptPubKeyTag -> NodeIdTag

All invoice tags tests passing except weird serialization order one

Address code review, add some more comments

rename 'LnInvoiceTags' -> 'LnInvoiceTaggedFields'

create a UInt5 type to represent all of the bech32 data structures

Passing all serialization in the BOLT11 examples

First cut at deserialization

* Adding bitcoin-s types to the eclair-rpc, fixing bug with decoding numbers, refactoring more things (#204)

* Switch bech32 p2wpkh hash from RipdeMd160 -> Sha256Hash160Digest (#206)

* Add testkit project / dependency (#209)

fix core-gen build.sbt name

* add correct dependencies to testkit (#210)

* Get dep name right (#211)

* Add serialization symmetry property for LnInvoice, fixing various bugs in LnInvoice data structures, adding generators for various LnInvoice data structures (#217)

* Reworking AuthCredentials and Instances so that we can read from config files (#218)

add core files that were missing

* Reworking a lot of testkit data structures to be more helpful for testing (#219)

Add missing EclairApi file

remove noisy log

* Rebase onto master, fix testkit compile issues

* Simplify LnCurrencyUnit, add MilliSatoshis, refactor EclairRpc to use… (#226)

* Simplify LnCurrencyUnit, add MilliSatoshis, refactor EclairRpc to use MilliSatoshis

* Add some helper functions around millisatoshis for comparing them to other things

* more tests / helper methods, at generator for millisatoshis

* Fix typo

* Fix comparison operators for millisatoshis, add Writes for MilliSatos… (#227)

* Fix comparison operators for millisatoshis, add Writes for MilliSatoshis in JsonWriters

* re-add comparison operators to LnCurrencyUnit for convinience

* Add millisatoshi reads (#228)

* Updating version of eclair to https://github.com/ACINQ/eclair/releases/download/v0.2-beta8/eclair-node-0.2-beta8-52821b8.jar (#229)

* Derive nodeId from ln invoice signature, move nodeid case class into … (#230)

* Derive nodeId from ln invoice signature, move nodeid case class into the core project

* Add missing assert

* Fix null pointer exception that could occurred during requiring the invoice's signature to valid. This could occurr if a user tried to construct an invoice with an invalid signature (#233)

* Turn down logging / remove logging (#235)

* Cleaned up eclair conf (#237)

* Cleaned up eclair conf

* Added test for bad auth and Reads for LnInvoice

* WIP: rebase onto master with new compiler opts

fix more compiler warnings with testkit

* fix new compiler warnings for scalac 2.12.x on ln (#253)

* fix new compiler warnings for scalac 2.12.x on ln

* fix missing p2wpkhoutput in rawoutput testkit/CreditingTxGen.scala

* First cut at code review for the ln branch (#258)

Fix bug in parsing the LnTagPrefix.CltvExpiry, add properties that check if the NodeIdTag is given explicitly to the invoice

remove dumb invariants

revert version

* 2018 12 4 ln code review rd2 (#259)

* Amend EclairRpc test case for confirming that channel is closed

* Add final check to test case to make sure the bitcoind wallet received funds when closing channel

* Address Torkel's code review

* Addresses some review on #256 (#260)

* Docstring cleanup, small nits

* Refactors some redudant data, nested if => switch

* Fixes SO error by reversing remowal of `new`

* Fixes a couple of bugs

* map.get instead of list.find

* StringBuilder in HRP

* Rework NetworkParam to LnParam

* Cleanup

* Renames file to match trait/object name

* Docstring cleanup, pure formatting

* Simplifies a few expressions, doesn't change semantics

* Adds overloaded findRoute method instead of Either[NodeId, LnInvoice]

* Eclair cleanup

* Address concerns from Chris

* Type annotation to match case

* Address nadav's code review
2018-12-08 11:03:24 -05:00