Commit Graph

159 Commits

Author SHA1 Message Date
Nadav Kohen
e6899b20b1 Made ECPrivateKey signing synchronous and got src compiling (#2652)
Fixed tests

De-futured tx buidling, finalizing and signing

Responded to review
2021-03-23 17:05:58 -05:00
benthecarman
c3c96a61c3 Reduce fee rate for spending coinbase utxos (#2815) 2021-03-23 05:56:05 -05:00
Chris Stewart
2287c6ced9 Implement caching of bitcoind in the walletTest,nodeTest, and partially bitcoindRpcTest project (#2792)
* Create CachedBitcoind, implement it in FundTransactionHandlingTest

* Add BaseWalletTest, extend it with BitcoinSWalletTest & BitcoinSWalletTestCachedBitcoind, add CachedBitcoinV19 and use it RescanHandlingTest

* Make ProcessBlockTest work with cached bitcoind

* Make trait for CachedBitcoindNewest for the newest version of bitcoind

* Make UTXOLifeCycleTest use cached bitcoind

* Add WalletBloom, WalletSyncTest to use cached bitcoinds

* Add WalletIntegrationTest

* Rework beforeAll() and afterAll() into the super trait like BaseWalletTest

* Add standlone BitcoindFixtures, use it in BitcoindBackendTest

* Use new BitcoindFixtures in BitcoindBlockPollingTest

* Introduce BaseNodeTest, start implementing the usage of cached bitcoinds in the nodeTest project

* Use cached bitcoind's with SpvNodeTest & SpvNodeWithWalletTest

* Fix bug on postgres with reusing database, upsert the genesis header rather than create it

* Get NeutrinoNode tests workign with cached bitcoinds

* Fix NeutrinoNodeWithWallet by destroying wallet state for Postgres

* Add teardown helper method for bitcoind

* Teardown chain project when using node fixtures since node is dependent upon the chain project.

* Turn off parallelExecution again

* Switch the parallelExecution flag to only be set on CI, so we can get better performance when running locally

* Start implementing BitcoindFixtures, use BitcoindFixturesCachedTriple on TestUtilRpcTest

* Fix compiler errors, begin implementing NodePair

* Refactor TestRpcUtilTest to use 2 bitcoinds rather than 2

* Reduce the number of bitcoinds that MultiWalletRpcTest needs from 3 -> 1

* Reduce number of bitcoinds used in WalletRpcTest from 3 -> 2

* Add some documentation

* Try to re-add parallelExecution

* Reduce the number of bitcoinds used in PsbtRpcTest from 3 -> 2

* Disable parallelExecution in Test again

* Make BitcoindV21RpcClientTest & BitcoindV20RpcClientTest reduce bitcoind usage from 2 -> 1

* Make BitcoindV19RpcClienttest reduce bitcoind usage from 2 -> 1

* Rework MempoolRpcTest to use fixtures, add BitcoindVersion to CachedBitcoindCollection

* Make sure clientAccumm has to be specified as a paramter now rather than filling in by default

* Begin parameterizing NodePair/NodeTriple to retain type information for the specific version of bitcoind that was used

* Don't implement version in super trait

* Fix docs

* Fix async issue in V21 test suite

* Append to vectors in CachedBitcoinCollection rather than replace

* Fix rebase issues

* Add scaladocs

* Fix BitcoindV18RpcClient address info test

* Implement fixtures in BitcoindV17RpcClientTest fixtures

* Cleanup v17 PsbtRpcTest

* Reduce bitcoind usage from 3 -> 1 in BitcoindV18RpcClientTest

* Remove abandon transaction test, this allows us to reduce the number of bitcoind's used in MempoolRpcTest from 3 -> 2

* Remove the requirement to inject  BitcoinSAsyncFixtureTest, add it in the test traits explicitly to make things easier. Also add explicit afterAll() method to tear down both the CachedBitcoind & BitcoinSAsyncFixtureTest

* Fix missing Await.result() in BitcoindRpcTest.afterAll()

* Rework MultiWalletRpcTest to use a NodePair

* Rework BlockchainRpcTest to use fixtures

* Rework Client start()/stop() methods. Now use an AtomicBoolean to indicate when a user has requested a client to start/stop rather than sending pings to bitcoind that can fail because the conneciton pool has been shutdown in test cases

* Try my luck with turning on parallelExecution in CI again

* Revert parallelExecution, now testes do not run in parallel on CI

* Only turn off parallelExecution for bitcoindRpcTest

* Adjust build to only have bitcoindRpcTest NOT in run parallel on mac, reduce number of blocks used in BitcoindRpcTestUtil.createNodeSequence

* Run less tests in the rpc test suite as that takes the longest, move them over to node/wallet/dlc test suite on mac osx CI

* Don't run eclair tests in parallel either

* Remove CachedBitcoind from BitcoinSWalletTest

* Fix async bug in test case

* Push to github to force re-run of CI

* Push to github to force re-run of CI

* Push to github to force re-run of CI
2021-03-19 06:37:53 -05:00
benthecarman
12bff309c2 Add Broadcast TxoState (#2735)
* Add broadcast TxoState

* Update scaladoc
2021-03-18 14:16:53 -05:00
benthecarman
9494eec1b8 Move blockhash to tx table from spending info table (#2744)
* Move blockhash to tx table from spending info table

* Add test, fix spending tx id col name

* Scaladocs, add test

* Add more unit test

* Make id not comparable in process tx test

* Fix tests

* attempt to fix

* Add mempool comment to scaladoc

* Deparallelize process inputs & outputs
2021-03-16 10:05:29 -05:00
Chris Stewart
1959495cec Add testkit-core module (#2726)
* Refactor AsyncUtil to just use an execution context rather than an actor system

* Create testkit-core, start moving data structures over to testkit-core

* WIP, getting rid of the hard dependency on BitcoinSAsyncTest and akka

* Rework test traits to not be dependnent on akka, move BaseAsyncTest into testkitCore, add a test trait that just uses the default scala executionContext

* Get everything compiling

* Move logback-test.xml to testkit-core so it applies to coreTest,cryptoTest as well

* Cleanup rebase issues

* Fix Deps.scala

* Address ben's code review

* Segregate jvm settings and compiler settings

* Filter out -Xfatal-warning for scalajs for now since there is a ton of errors

* Move maintainer settings into CommonSettings.settings
2021-03-02 07:05:21 -06:00
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
Chris Stewart
1a2ddf6a0d Reduce usage of .findAll() (doesn't scale for large dbs). Now pass in… (#2706)
* Reduce usage of .findAll() (doesn't scale for large dbs). Now pass in the specific things we are searching for

* Add timestamps for checking how long it takes to processBlock()
2021-02-21 16:15:50 -06:00
Chris Stewart
a5252b20ba Bump the timeout for address queue exception test to make sure we get correct exception (#2697) 2021-02-20 13:50:28 -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
e2ace38a1f Fix rescan to fetch blocks during scan (#2540) 2021-01-22 10:28:53 -06:00
benthecarman
2291bf0eae Create isChange function for wallet (#2535)
* Create isChange function for wallet

* Scaladocs
2021-01-20 12:11:24 -06:00
Chris Stewart
6193af7709 Remove WalletSync.sync() -> WalletSync.syncFullBlocks() (#2522) 2021-01-15 17:05:11 -06:00
Chris Stewart
51e9796b39 2021 01 11 issue 2493 (#2503)
* Rename NodeUnitTest.confg -> NodeUnitTest.getFreshConfig()

* Rename CachedBitcoinSAppConfig.config -> CachedBitcoinSAppConfig.cachedConfig

* Make CachedChainAppConfig extend CachedBitcoinSAppConfig

* use cached configs in both wallet/chain project as well taking ben's suggestion to fix those
2021-01-11 16:45:10 -06:00
Chris Stewart
98ace6f14e 2021 01 02 issue 2457 (#2461)
* WIP

* Get neutrino node with wallet 'receive information about received payments' working again

* Fix compile

* Remove initial sync logic from test case

* Remove sync logic in NeutrinoNodeWithWallet test cases

* Improve logging and rename a few things

* WIP2

* WIP3

* Get NeutrinoNodeWithWallet tests working

* Implement WalletSync, which allows you to sync a wallet from a arbitrary data source

* Get all tests passing again

* Use spv.appConfig in DataMessageHandlerTest rather than caching the config

* Modify cleanup to hopefully get CI passing

* Fix postgres tests by cleaning the table during the destroy phase of the test fixture. This is needed because the same postgres database is shared between tests in the same test suite

* Revert logback-test.xml

* Get sqlite/postgres tests passing pt 2

* syncHeight -> syncDescriptorOpt()

* Add case for genesis block hash in WalletSync

* Fix SpvNodeWithWallet test case to actually test spv functionality

* Remove nodeCallbacks parameters, callbacks should be registered on nodeAppConfig
2021-01-09 09:33:37 -06:00
Chris Stewart
dc73cb26ff Rename wallet.getSyncHeight() -> wallet.getSyncDescriptorOpt(). We don't just use height in the descriptor, the hash is just as valuable for connecting to chains (#2479) 2021-01-07 07:40:30 -06:00
benthecarman
4fb1c4f954 Make KeyManager return better error messages (#2464)
* Make KeyManager return better error messages

* Increase test coverage

* Refactor

* Create type for raw strings
2021-01-04 12:43:55 -06:00
Ben Carman
8df2fcd1fd Account for rounding of fee rate in CPFP test (#2423) 2020-12-23 07:18:42 -06:00
Ben Carman
8996be43ec Add extra checks for RBF transactions (#2416)
* Add extra checks for RBF transactions

* Move to util function, don't allow CPFP of confirmed txs
2020-12-22 14:12:15 -06:00
Ben Carman
f7671a4f99 Add wallet function to bump fee with CPFP (#2399)
* Add wallet function to bump fee with CPFP

* Add bump fee integration tests
2020-12-21 07:04:01 -06:00
Chris Stewart
4d9c9415d9 2020 12 20 root dependson (#2404)
* Make bitcoin-s root project depend on all other modules

* remove unused import

* Remove crossScalaVersion in root project
2020-12-21 06:47:04 -06:00
Ben Carman
fcfc3d076f Add wallet function to bump fee with RBF (#2392)
* Add wallet function to bump fee

* Bump sequence number

* Respond to review

* Fix test
2020-12-20 07:43:18 -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
Ben Carman
cd13bdb77a Rescan Improvements (#2379)
* Rescan Improvements

* Make test use fetchFilters instead
2020-12-18 07:05:59 -06:00
Ben Carman
52ef1fa185 Add ability to store ExtPrivateKey instead of Mnemonic (#2372)
* Add ability to store ExtPrivateKey instead of Mnemonic

* Use private vals, change name

* Fix docs

* private to km

* Correct scaladocs
2020-12-17 13:25:04 -06:00
Ben Carman
1225584526 Multi Wallet support (#2345)
* Multi Wallet support

* Fix Oracle tests

* Fix some CI errors

* Increase KeyManagerAppConfig code coverage

* Add test for multiple seeds in seed folder

* Move things in reference.conf files

* Lower key manager coverage requirement

* Fix postgres test issues

* Create DbAppConfig

* Add some docs, fix hardcoded postgres db name

* Clarify db vs schema

* Add character types

* Fix chaindb in conf

* Always copy default seed

* Remove need for driverName config
2020-12-16 17:27:56 -06:00
Ben Carman
685d5b0273 Let wallet sign PSBTs (#2236)
* Let wallet sign PSBTs

* Add example to docs

* Add logs and test case
2020-11-07 09:25:59 -06:00
Ben Carman
47a38f88db Make aesPassword option for wallet config (#2217)
* Make aesPassword option for wallet config

* Add to docs

* Make AesPassword optional

* Small touchups

* Fix for oracle server

* Fix docs

* Increase code coverage
2020-11-06 07:00:18 -06:00
Chris Stewart
581d46c2c8 2020 11 02 cleanup (#2233)
* Cleanup a bunch of imports in test

* Use @nowarn annotation for testing things that are deprecated

* Fix base58 test

* Cleanup crypto-test

* Use scala collection compat dependency to get access to the @nowarn annotation on scala 2.12.x

* Rework more scala 2.13.x compile failures in chain-test and key-manager-test

* Optimize imports for entire project

* Fix nits
2020-11-03 11:07:04 -06:00
Ben Carman
9787e89403 Add Wallet State Descriptors (#2157)
* Add Wallet State Descriptors

* Sync blocks while offline w/ bitcoind backend

* Add to WalletDbManagement

* Update db management test

* Respond to review

* Rename function
2020-10-14 14:17:51 -05:00
Ben Carman
d54c15d4cb Remove requirement for ZMQ with bitcoind backend (#2137)
* Remove requirement for ZMQ with bitcoind backend

* Add test, move poller to BitcoindRpcBackendUtil

* Add docs & logs, fix niche case

* Use AtomicReference, reset prevCount on failure
2020-10-12 07:59:57 -05:00
Ben Carman
09dfd5eb73 Add BIP45 Multisig Purpose (#2103)
* Add BIP45 Multisig Purpose

* Fix multisig purpose, add tests
2020-10-02 10:43:25 -05:00
Ben Carman
ed5228310b Use SubtractFeeFromOutputsFinalizer when sending full utxos (#2072) 2020-10-01 17:32:24 -05:00
Ben Carman
a694ef16b7 Add ability to fully spend utxos (#2063)
* Let RawTxSigner dummy sign transactions

* Add ability to fully spend utxos

* Fix NeutrinoNodeWithWalletTest

* Fix test, simplify call
2020-09-27 08:16:26 -05:00
Ben Carman
3ec3b5d699 Merge pull request #2029
* Add more processing blocks tests

* Add immature coinbase txo state

* Test balance, add doc
2020-09-20 10:39:31 -05:00
Ben Carman
1e3aee55c3 Merge pull request #2019
* Refactor logging to only use grizzled slf4j

* Fix docs

* test travis config change
2020-09-19 14:09:12 -05:00
Chris Stewart
00480cc391 Use randomized fee rates for wallet tests (#1977)
Co-authored-by: Ben Carman <benthecarman@live.com>
2020-09-09 16:46:33 -05:00
rorp
c62be8b5f6 Update callbacks for LN support (#1938)
Update callbacks for LN support
2020-09-09 11:02:31 -07:00
Ben Carman
5f7356c526 Fix Two KeyManagers in scope for fundRawTransactionInternal (#1986)
* Fix Two KeyManagers in scope for fundRawTransactionInternal

* Only fetch txs once
2020-09-09 09:40:38 -05:00
Ben Carman
edc80bf13e Don't spend immature coinbases, fix tests (#1981) 2020-09-07 15:08:41 -05:00
Ben Carman
c1d0d66398 Calculate correct TxoState when processing a transaction (#1929)
* Calculate correct TxoState when processing a transaction

* Test balance
2020-08-28 15:31:48 -05:00
Ben Carman
8d47b68764 Fix rescans that are larger than the batch size (#1916)
* Fix rescans that are larger than the batch size

* Add test
2020-08-27 14:09:25 -05:00
Chris Stewart
955978f635 Apply string factory to a bunch of easy things (#1891)
* Apply string factory to a bunch of easy things

* Refactor HDPath, ExtKey, and LnTagPrefix to use StringFactory

* Implemen StringFactory on LnHumanReadablePart, ScriptType, ServiceIdentifier

* Implement StringFactory on AesCrypt, NodeUri, AddressTag, PSBT, TxoState

* Fix failing tests, fix website compile

* Apply StringFactory to all ScriptOperations, ChannelState, Script Parsing
2020-08-25 10:48:37 -05:00
Ben Carman
304896e171 Move WalletApi to Core (#1890) 2020-08-25 07:05:20 -05:00
Ben Carman
98164bc5e3 Move WalletApi necessities to core (#1886) 2020-08-24 17:26:58 -05:00
Ben Carman
cfde581d0c Move all remaining wallet db representations (#1885) 2020-08-24 13:13:52 -05:00
Ben Carman
c6ad90139a Move TransactionDb to Core (#1849)
* Move TransactionDb to Core

* Move to api package
2020-08-22 08:04:30 -05:00
Ben Carman
9e06b826e1 Move AddressTagDb to Core (#1850)
* Move AddressTagDb to Core

* Move to wallet api package
2020-08-21 16:31:30 -05:00
Ben Carman
d187834e1a Create KeyManager Api & move SpendingInfoDb to core (#1848)
* Create KeyManager Api & move SpendingInfoDb to core

* Fix docs, remove sealed form KeyManagerApi

* Move SpendingInfoDb to core wallet api
2020-08-21 14:37:12 -05:00