Commit graph

1495 commits

Author SHA1 Message Date
Chris Stewart
4a407ccdf1
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
Chris Stewart
ca6cfdf83b
Bump plugin versions, remove scalariform (#255)
* Bump plugin versions, remove scalariform

* Bump sbt version to 1.2.4
2018-11-28 14:45:49 -05:00
Chris Stewart
3802c5534c
Switch default scalac to 2.12.7 (#254) 2018-11-28 14:16:03 -05:00
Chris Stewart
2b087a131b
2018 11 24 scala 2.12 warnings (#251)
* fixing compiler warnings for core module

* fix rpc project compiler warnings for scalac 2.12

* revert default scala version to 2.11.12
2018-11-25 14:51:36 -05:00
Chris Stewart
4620345ebe
2018 11 21 performance improvements (#249)
* Change ScriptConstant members from def to val

change all stuff in org.bitcoins.script.constant._ to actually be constant , this seems to improve performance from rudimentary bench marks by 2x

* rework RawSerializerHelper.writeCmpctSizeUInt to remove extra loop

* Fix bug where P2WPKHWitnessV0/P2WSHWitnessV0 didn't extend ScritpWitnessV0, add a few optimizations in ScriptWitness
2018-11-23 20:56:19 -05:00
Chris Stewart
cad975308a Add BlockBench and benchmark README 2018-11-23 08:38:30 -05:00
Chris Stewart
7365cbc3e6 Bump travis ci scalav
Add scalav 2.12.7 to the travis ci matrix

Add more jdk versions

explicitly set scalav when starting sbt for travis

Bump junit interface for secp256k1 tests

remove openjdk/oraclejdk 9 for now
2018-11-23 07:55:37 -05:00
Chris Stewart
0ca38fd03b Make core the only module covered by code coverage 2018-11-23 06:47:25 -05:00
Chris Stewart
f9dafb6ebb Remove annoying logs 2018-11-18 18:37:26 -05:00
Chris Stewart
a5bdda8d94 Add compiler options for the Compile scope 2018-11-18 18:37:26 -05:00
Chris Stewart
9a82a3e884 Optimize RawBitcoinSerializer.parseCmpctSizeUIntSeq to use a builder rather than just manually appending time. Seems to speed up performance on the two test vectors in BlockTests by ~1s 2018-11-18 11:18:36 -05:00
Torkel Rogstad
1e2f0df30f Adds cancelable in Global := true 2018-11-15 14:11:34 -05:00
Chris Stewart
0770b7b8e6
Add qualifers to dependencies to download sources (#240) 2018-11-11 17:22:22 -05:00
Torkel Rogstad
056718bbdb Adds classpath argument to .jvmopts (#232) 2018-11-10 08:39:28 -05:00
Nadav Kohen
8ec3824db9 Added test for ZMQSubscriber that actually checks sent data (#225) 2018-11-03 10:46:31 -04:00
Chris Stewart
e42e66a9de
Bump versions of dependencies (#224) 2018-10-26 10:06:49 -04:00
Torkel Rogstad
a48969f70a Bitcoind spawn tweaks (#221)
* Test for single node creation

* Passes parameters explicitly to bitcoind
2018-10-17 17:49:40 -04:00
sken
a4b8985cfd fix broken links in read me (#220) 2018-10-17 09:26:25 -04:00
Tanner R
7d3208baf5 Initial Test Coverage Improvement (#214) 2018-10-12 21:28:17 -04:00
Chris Stewart
b211d3408d
implement p2sh(p2wpkh) inside of the interpreter and TxBuilder (#207)
fix bug in P2SHScriptSignature.redeemScript

uncommenting the fuzz tests

Add p2sh(p2wsh) test vectors from BIP143

Fix possible index out of bounds exception w/ updating an EmptyWitness
2018-10-01 10:00:44 -04:00
Nadav Kohen
b3384c1f18 Updated bitcoind version in travis to 0.16.3 (#202) 2018-09-21 19:31:59 -04:00
Korachal Phadvibulya
38c7941d6b Use Gen.delay instead of Gen.const for generating privateKey (#197) 2018-09-16 08:51:08 -04:00
Nadav Kohen
872a94c9d1 Moved TestUtil in test to RpcUtil in main, added alternative to awaitCondition that uses the ActorSystem scheduler instead of Thread.sleep (#191)
Altered awaitCondition to use scheduler instead of Thread.sleep

Added initial tests and fixed initial bugs

Added tests for awaitCondition and createNodePair/deleteNodePair

Minor tweaks to RpcClientTest

Moved some code back into TestUtil and got rid of TestUtil and RpcUtil actor systems

Refactor retryUntilSatisfied, make duration parameters have type FiniteDuration

Made timeouts configurable and added docs

Fixed dumb bug
2018-09-07 07:16:02 -04:00
Chris Stewart
74c49b073f
Add 'Bitcoind' prefix to all bitcoind specific rpc stuff (#192) 2018-09-06 16:12:55 -04:00
Chris Stewart
3d10f6e57f
Merge pull request #187 from Christewart/bump_sbt_version
bump sbt to 1.1.6, bump scalac version to 2.11.12
2018-08-26 14:02:23 -04:00
Chris Stewart
9db5180d6f bump sbt to 1.1.6, bump scalac version to 2.11.12
Adding compilerOpts, adding commonSettings across projects
2018-08-26 12:44:25 -05:00
Chris Stewart
1d74af09d6
Merge pull request #186 from Christewart/rm_scodec_prefix
removing scoded.bits prefix from application code
2018-08-10 16:04:49 -04:00
Chris Stewart
1799fa3227 removing scoded.bits prefix from application code
Finishing scodec.bits refactor
2018-08-10 14:01:14 -05:00
Chris Stewart
f718370824
Merge pull request #183 from Christewart/topic/scodec
Refactoring bitcoin-s to use scodec
2018-08-10 11:32:13 -04:00
Daniel James
cd794d9ee3 scodec
Migration to scodec

Src is compiling

tests compiling

All unit tests passing now

fix compiler issue in ScriptParser

bump timeout to run on travis ci

Fixing two unit tests that had types failing

Turn down excessive logging

Uncomment rpc tests

fixing nits
2018-08-09 21:32:17 -05:00
Chris Stewart
beaca99cd0
Merge pull request #182 from Christewart/segwit_pubkey_invariant
Add invariant that doesn't allow segwit scripts to be created with un…
2018-07-29 12:12:35 -04:00
Chris Stewart
88c0af2b39 Add invariant that doesn't allow segwit scripts to be created with uncompressed public keys
reset scalafmt for rpc/

Removing unit test that used uncompressed public key for P2WSH, removing extra debug
2018-07-22 14:10:01 -05:00
Chris Stewart
b36c111ab6
Merge pull request #171 from nkohen/rpc
Rpc
2018-07-01 10:29:28 -04:00
nkohen
4df0295d0e Changed all println to logs, fixed bug where waiting was needed in preciousBlock test, and removed vars for ports (replacing them with random ports) which is now done in TestUtil 2018-06-30 20:32:45 -05:00
nkohen
e22af13d86 Fixed travis problem I made in last commit 2018-06-28 10:10:02 -05:00
nkohen
646478b202 Made travis install bitcoin v0.16.0 2018-06-28 09:56:32 -05:00
nkohen
1b2fe2b87b Fixed async bug in ban tests 2018-06-27 23:21:32 -05:00
nkohen
17c3c2281f Ran scalafmt 2018-06-27 17:43:48 -05:00
nkohen
8dd6d57afa Fixed endianness bugs 2018-06-25 13:53:59 -05:00
nkohen
6dd7ffade9 added travis integration, added awaitSync to createNodePair, cleaned up RpcAddressReads and TransactionInputReads, added ScripSignatureReads, made sure all tests run all assertions as intended 2018-06-25 13:38:40 -05:00
nkohen
58996516bf Made AddressType an ADT instead of an Enumeration, made datadir a File instead of a String, fixed listSinceBlock (allowing for no header hash to be given), cleaned up signRawTransaction, factored out checkUnitError function in parseResult, removed unused imports, fixed getBlockHash test, ran scalafmt, and responded to some minor changes from code review 2018-06-25 09:56:37 -05:00
nkohen
846ea34143 I think I fixed the concurrency/Thread.sleep issues! 2018-06-25 09:56:37 -05:00
nkohen
ed409a693b Began work on replacing bad uses of Thread.sleep 2018-06-25 09:56:37 -05:00
nkohen
618418502a Added implementation and test for getBlockTemplate, replaced filter(...).head with find(...).get (performs better), and ran scalafmt 2018-06-25 09:56:37 -05:00
nkohen
b96123355a Added tests for prioritiseTransaction and invalidateBlock 2018-06-25 09:56:37 -05:00
nkohen
17fed6f874 Added test for importPrunedFunds and removePrunedFunds 2018-06-25 09:56:37 -05:00
nkohen
0e5904faa0 Added tests for importPubKey and preciousBlock 2018-06-25 09:56:37 -05:00
nkohen
6390f19d51 Added tests for bumpFee and combineRawTransaction 2018-06-25 09:56:37 -05:00
nkohen
d30e689058 Refactored JsonModels to follow bitcoind's organization as specified by the help rpc 2018-06-25 09:56:37 -05:00
nkohen
8296935646 Fixed ban tests 2018-06-25 09:56:37 -05:00