Commit Graph

61 Commits

Author SHA1 Message Date
Chris Stewart
7a068ac036 2021 02 25 async utils (#2725)
* Refactor AsyncUtil to just use an execution context rather than an actor system

* Create async util project, use it in various projects that depend on it
2021-02-25 13:26:38 -06:00
Aris
f8694eb097 Fix/typos (#2633)
* Fix typos

* Collection minor fixes

Removes redundant .headOption on options
Replaces .exists(_ == ???) with .contains(???)
Replaces option == None with option.isEmpty
2021-02-07 15:00:25 -06:00
Chris Stewart
8f958bf5d9 Update scalafmt (#2619) 2021-02-03 16:37:12 -06:00
benthecarman
d69c60b8b2 Bitcoind v0.21.0 support (#2414)
* Bitcoind v0.21.0rc3 support

* Use v0.21.0 instead of Experimental in node tests

* Bump to rc5

* Use official release

* Fix rebase issues

* Remove DoNotDiscover tag

* Fix count for NeutrinoNodeTest
2021-01-14 14:01:44 -06:00
Nadav Kohen
e1422ddbc2 Fixed Low R signing (#2408)
* Fixed Low R signing and added a test

* Made separate test for comparing bitcoin-s and bitcoind

* Fixed PSBTUnitTest
2020-12-21 14:50:34 -06:00
Ben Carman
ba545760f9 Fix getPeerInfo for v0.20 (#2402) 2020-12-20 07:19:35 -06:00
Chris Stewart
d204056ad8 2020 12 19 enable test compileropts (#2400)
* Fix bug where test compiler opts were not enabled

* Fix all exsting compiler warnings in test project

* Add scalaCollectionCompat dependency to bitcoindRpcTest so we can use @nowarn annotation on scala 2.12
2020-12-20 07:09:07 -06:00
Chris Stewart
7df02c4198 Start refactoring testkit to allow for specifying a different binary … (#2325)
* Start refactoring testkit to allow for specifying a different binary directory than the sbt default

* Fix BitcoindRpcTestUtil

* Add BitcoindRpcTestClient
2020-12-07 13:14:40 -06:00
Ben Carman
471c5348c9 Use PSBT type in bitcoind calls (#2242) 2020-11-09 08:50:48 -06:00
Ben Carman
a7da3f25b6 Bitcoind RPC Multi-wallet support (#2231)
* Bitcoind RPC Multi-wallet support

* Add to docs
2020-11-07 09:24:09 -06:00
Ben Carman
d0b9e61dd9 Add bitcoind functions for load and unload wallet (#2229) 2020-11-02 07:41:37 -06:00
Ben Carman
920e30e5a2 Bitcoind v0.20 updated rpcs & tests (#2061)
* Bitcoind v0.20 updated rpcs & tests

* Test sorted multi
2020-09-28 14:25:28 -05:00
Chris Stewart
39ef35b9ee Rename parameter names from 'duration' -> 'interval' just like our ActorSystem.schedule() names the parameter (#2005) 2020-09-11 11:10:59 -05:00
Ben Carman
f468fff7ea Move ChainApi to core (#1888)
* Move Chain Db Reps to core

* Move ChainApi to Core
2020-08-25 07:08:42 -05:00
Nadav Kohen
1cea1f3bb2 Fixed getblockchaininfo for v19 (#1711) 2020-07-28 15:29:42 -05:00
Nadav Kohen
714d5a06fd Fixed getAddressInfo for versions 18 and 19 (#1679) 2020-07-17 13:20:36 -05:00
Ben Carman
26f9f6d519 Add signrawtxwithwallet bitcoind function (#1665) 2020-07-13 09:44:44 -05:00
Ben Carman
049bfda4ce Make getAddressInfo Tests not reliant on timestamp (#1635) 2020-07-08 06:22:13 -05:00
Ben Carman
0189a787e2 BitcoindV17RpcClientTest get system time closer to getNewAddress call (#1612) 2020-06-26 06:22:46 -05:00
Scala Steward
97a4886c6e Update scalafmt-core to 2.6.0 (#1579)
* Update scalafmt-core to 2.6.0

* Upgrade scalafmt, fix all formatting errors

* Scalafmt on 2.12

* fix test

* More fixes

Co-authored-by: Ben Carman <benthecarman@live.com>
2020-06-19 10:38:12 -05:00
Ben Carman
6880561d27 Bump spread for address info tests in BitcoindV17RpcClientTest (#1591) 2020-06-19 08:21:34 -05:00
Chris Stewart
c54d6dcbdc 2020 06 09 addr invoice string factory (#1538)
* Implement StringFactory with Address and LnInvoice

* Address code review

* Run scalafmt
2020-06-11 10:44:12 -05:00
Ben Carman
8197108c1f Attempt to fix BitcoindV19RpcClientTest from losing connection (#1515) 2020-06-08 14:14:14 -05:00
Ben Carman
a236073555 Optimize and Clean up WalletRpcTest (#1511) 2020-06-08 14:13:01 -05:00
Ben Carman
61d9f0efba Implement best block hash correctly (#1452)
* Implement best block hash correctly

* Handle no common history

* Fix getBlockProof to be BigInt instead of UInt32

* Fix warnings

* Make get best filter use chainwork

* Remove unused function, test isMissingChainWork

* Fix comparisons for chain work in sql

* Fix migrations from rebase

* Fix CI error

* Fix postgresql
2020-06-04 12:05:10 -05:00
Chris Stewart
cec29e6894 Try and improve reliability of UpdateBloomFilterTest, also add getMem… (#1434)
* Try and improve reliability of UpdateBloomFilterTest, also add getMemPoolEntryOpt() that returns an Option indicating if a tx was in the mempool

* Fix nits
2020-05-18 13:01:25 -05:00
Nadav Kohen
a503441619 Crypto Project Refactor (#1380)
* Added crypto project and decoupled BitcoinSLogger from NetworkElement

Decoupled BitcoinSLogger from Factory

Moved NetworkElement into crypto project

Moved Factory and BitcoinSUtil (renamed to BytesUtil) to crypto project

Moved MaskedToString to crypto project

Added BytesUtil to imports and cleaned up CryptoUtil.recoverPoint

Moved the rest of crypto stuff to the crypto project

Moved crypto tests to crypto-test project

* Added documentation for crypto project
2020-04-30 12:34:53 -05:00
Chris Stewart
3c008ff82b Attempt to add a bit of delay on expecting rescan to fail so we dont' have as much of a async issue (#1381) 2020-04-28 16:34:07 -05:00
Ben Carman
aa8a2e14a6 Move Json Reader, Writers, and Serializers to App Commons (#1328)
* Move Json Reader, Writers, and Serializers to App Commons

* Move app-commons outside of app/
2020-04-10 14:33:37 -05:00
rorp
c5f5b8c065 Fix the time based test cases in BitcoindV17RpcClientTest (#1224) 2020-03-13 11:24:43 -07:00
Nadav Kohen
052b64b7e2 Seq and Map Wrappers (#1131)
* Renamed size to byteSize in NetworkElement to avoid ambiguity

* Introduced SeqWrapper and MapWrapper to allow for wrapper case classes to have direct access to underlying methods

* Responded to review
2020-02-24 14:39:20 -06:00
Chris Stewart
f8a21201ac Run test:scalafmt, and enforce it on CI (#1023)
* Run test:scalafmt, and enforce it on CI

* Run test:scalafmt
2020-01-23 14:46:57 -06:00
Ben Carman
5206353a4a Bitcoind v19 RPC (#910)
* bitcoind v19 new RPC calls and tests (#863)

* bitcoind v19 new RPC calls and tests

* Code review changes

* Review part 2

* Rename variable to be more descriptive

* Explanitory comment

* Ignore broken test cases

* Add missing signing functions

* Add test to check avoid_reuse flag is on (#870)

* Add test to check avoid_reuse flag is on

* Add test to make sure flags weren't set

* bitcoind v19 Update mempool RPCs and tests (#868)

* Update mempool RPC calls to bitcoind v19 compatibility

* Typo fix

* Add parameter name to calls

* Fix remaining rpc calls

* Formatting

* scaladoc for param

* Change param to correct type

* Clarify on scaladoc

* Add missing fees parmater to mempool rpcs (#875)

* Add weight field to mempool entries after v19 (#876)

* Move DescriptorRpc to be able to be used by future versions of bitcoind (#878)

* Add window_final_block_height to GetChainTxStatsResult (#880)

* Add passphrase argument to createwallet for later versions (#883)

* Add passphrase argument to createwallet for later versions

* Scaladoc + empty passphrase requirement

* Error message

* Add new services names parameter to P2P rpcs (#874)

* Add new services names parameter to P2P rpcs

* Add ServiceIdentifier Reads

* Add fallback case

* Address review

* Change to Try

* Move PsbtRpc to be able to be used by future versions of bitcoind (#877)

* Move PsbtRpc to be able to be used by future versions of bitcoind

* Add test

* Address comment

* Enable bloom filters for v19

* Enable bip 61 for tests

* Change to official binaries

* Force v18 for Spv Tests

* Remove unused config line
2019-12-04 07:44:44 -06:00
Nadav Kohen
1578e2642f Nicer Satoshis.apply (#899)
* Replaced Satoshis(Int64(_)) with Satoshis(_)

* Fixed SignerTest
2019-11-26 14:43:14 -06:00
Chris Stewart
abffe5d7a9 Add sanity tests for .hashCode() and .equals() for multiple instances for EclairRpcClient/BitcoindRpcClient (#881) 2019-11-22 07:59:26 -06:00
rorp
7e19a706de Make tests to not require pre-installed bitcoind (#766)
* Make tests to not require pre-installed bitcoind

* update docs
2019-10-01 06:19:11 -05:00
Chris Stewart
eefbc37a81 2019 09 28 common test trait (#767)
* Create base traits for async tests called BaseAsyncTest, and then create two subtypes, BitcoinSAsyncTest and BitcoinSAsyncFixtureTest to make it easier to manage resources related to test cases. Now it is easier to shutdown things like an actor system in a structured manner

* Remove two bitcoind tests that don't make sense, 'duration' in the parameter is _really_ an interval (bad naming by usTesting an interval does not make sense inside of TestRpcUtilTest

* Turn log off for ChainAppConfigTest we expect to fail

* Bump timeout for BitcoinSUnitTest, use builtint sbt scalafmtCheck

* Remove hardcoded scalafmt binary

* reduce generator size to attempt to fix #768
2019-09-30 14:55:25 -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
rorp
244b4863ba Fix WalletRpcTest (#736) 2019-09-05 16:09:11 -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
rorp
4613d500e2 Make WalletRpcTest more determenistic (#731) 2019-09-04 06:51:33 -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
Torkel Rogstad
f6ed565c14 Refactor sbt and make Eclair tests download bitcoind (#727) 2019-08-30 15:11:52 -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
cwaldron97
47644b7910 (WIP) Createwallet rpc from V17 (#712)
* create wallet rpc

* fixed test

* change to createwallet test

* create wallet test
2019-08-21 16:34:11 -05:00
cwaldron97
7183296b6b Killing Joda Dependency (#643)
Remove Joda dependency
2019-07-29 12:22:25 +02:00
Torkel Rogstad
eb3fbbb259 Add types for various bitcoind RPC exceptions
In protocol.h (Bitcoin Core) all RPC errors are enumerated. The
exceptions added here are copied directly from that file.
2019-07-16 12:20:24 +02:00