Commit Graph

279 Commits

Author SHA1 Message Date
Chris Stewart
f75a52b521
Refactor TransactionProcessing.processTransaction() to use BlockHashWithConfs (#5744)
* Refactor TransactionProcessing.processTransaction() to use BlockHashWithConfs

Create WalletUtil.getBlockHashWithConfs(), use it in various places through the codebase

* Fix docs
2024-10-28 12:52:53 -05:00
Chris Stewart
4471f74ccf
Add error field toImportDescriptorResult, move BitcoindException to app-commons (#5705)
* Add error field to ImportDescriptorResult, move BitcoindException to app-commons

* Fix docs
2024-10-12 09:49:42 -05:00
Chris Stewart
52c0625ba9
2024 09 30 dlcwallet has a wallet (#5692)
* refactor: Rework codebase so that DLCWallet has-a instance of Wallet rather than is-a via inheritance

* Fix cast

* Fix RescanHandling in DLCWallet

* Remove default implementation of WalletApi.broadcastTransaction()

* fix broadcast callback for DLCWallet

* Add DLCWalletDAOs.fromDLCAppConfig()

* Fix scaladoc for AddressHandlingApi.getUnusedAddress
2024-10-01 13:29:58 -05:00
Chris Stewart
13a895efe9
2024 09 24 simplify wallet (#5685)
* WIP: Simplify wallet

# Conflicts:
#	fee-provider/src/main/scala/org/bitcoins/feeprovider/FeeProviderFactory.scala

# Conflicts:
#	wallet/src/main/scala/org/bitcoins/wallet/Wallet.scala

* Get walletTest/test passing

* Remove WalletApi.{start(),stop()}

 Conflicts:
	core/src/main/scala/org/bitcoins/core/api/wallet/WalletApi.scala
	wallet/src/main/scala/org/bitcoins/wallet/Wallet.scala
	wallet/src/main/scala/org/bitcoins/wallet/WalletHolder.scala

* Cleanup RescanDLCTest

* Move checkRootAccount into AccountHandling.scala

* Fix rebase

* Fix docs
2024-09-27 13:40:29 -05:00
Chris Stewart
7caea21b6a
refactor: Move more methods out of WalletApi (#5681)
Remove more methods out of WalletApi

refactor: move getTransactionsToBroadcast to SendFundsHandlingApi
2024-09-26 16:22:30 -05:00
Chris Stewart
e087b174c5
Move RandomFeeProvider to src (#5684)
* Move RandomFeeProvider to src

* Fix comment
2024-09-24 15:45:31 -05:00
Chris Stewart
d17934f17f
Add SendFundsHandlingApi, remove HDWalletApi (#5680)
* Begin moving methods out of HDWalletApi

* Add SendFundsHandlingApi, remove HDWalletApi

* Fix docs

* Move makeOpReturnCommitment() to SendFundsHandlingApi

* Remove MockWalletApi

* Cleanup

* Fix RoutesSpec

* Revert logback-test.xml
2024-09-22 09:32:01 -05:00
Chris Stewart
8cfd5e8d6b
2024 09 19 address handling refactor (#5679)
* wallet: Create has-a relationship for AddressHandling rather than is-a

* Fix infinite loop in AccountHandlingApi.getNewAddress(account)

* Fix appServerTest

* Revert Server.scala
2024-09-21 11:41:57 -05:00
Chris Stewart
8c5d685953
Refactor codebase to have has-a relationship with RescanHandling rather than is-a (#5675)
* Refactor codebase to have has-a relationship with RescanHandling rather than is-a

get everything compiling

Get all tests passing

* Revert and clean up files

* Fix docs
2024-09-19 09:46:56 -05:00
Chris Stewart
625e790477
Rework TransactionProcessing to be a has-a relationship rather than is-a relationship in the codebase (#5659)
Refactor TransactionProcessing into case class

Get walletTest/test passing

DLCWallet WIP

Get dlcWalletTest/test passing

Small cleanups

Fix RoutesSpec gettransaction unit test

revert logback-test.xml

cleanup
2024-09-18 12:51:21 -05:00
Chris Stewart
1939e9fd2e
core: Fix bug in RescanStarted.entireRescanDoneF (#5654) 2024-09-05 08:48:33 -05:00
Chris Stewart
2d4a0adda4
Add FundTransactionHandlingApi, make FundTransactionHandling a case class (#5651) 2024-08-25 08:52:19 -05:00
Chris Stewart
35003ca970
refactor: Change interval param of BitcoindRpcBackendUtil.startBitcoindBlockPolling (#5640)
* refactor: Change interval param of BitcoindRpcBackendUtil.startBitcoindBlockPolling to be an Option, if none given we select a sane parameter based on the network we are on

* Fix compile
2024-08-13 13:25:20 -05:00
Chris Stewart
41fab3dfd2
2024 08 07 createnewaccount rpc (#5638)
* Implement creatnewaccount rpc

* Get WalletRoutesSpec createnewaccount unit test passing

* Rename HDPurposes -> HDPurpose

* Fix docs

* Implement ConsoleCli arg, change HDPurpose json serialization to be a json string instead of a num
2024-08-13 10:32:03 -05:00
Chris Stewart
0eb1788226
Refactor WalletApi.createNewAccount to not use KeyManagerParams (#5635) 2024-08-10 15:17:35 -07:00
Chris Stewart
458f3cb7d3
2024 07 29 rm tx bitcoind callbacks (#5632)
* fix docs

* Fix docs

* WIP

* Integrate BitcoindCallbacks

* Revert loback-test.xml

* Remove logs
2024-08-03 05:16:57 -07:00
Chris Stewart
e68ebeadbc
refactor: Create UtxoHandlingApi, move to has-a relationship within Wallet (#5624)
* refactor: Create UtxoHandlingApi, move to has-a relationship within Wallet

* Add WalletApi.{markUTXOsAsReserved, unmarkUTXOsAsReserved, listUtxos(state), listUtxos(account), listUtxos(tag)}

* move listUtxos(account) into NeutrinoHDWalletApi

* cleanup

* Revert files

* Revert more files

* Remove comment
2024-07-22 14:40:48 -05:00
Chris Stewart
d13e12afae
2024 05 11 wallet xsource3 (#5588)
* Add -Xsource:3 to chain/

* -quickfix chainTest

* Add -Xsource:3 to wallet/ wallet-test/ dlc-wallet/ dlc-wallet-test/
2024-05-11 09:49:10 -05:00
Scala Steward
afddf73c48
Update scalafmt-core to 3.8.1 (#5501)
* Update scalafmt-core to 3.8.1

* Update .scalafmt.conf settings to be factory default settings

* Fix typo

* scalafmt

* Empty commit to re-run CI

* Revert some scalafmt back to original scalafmt.conf

---------

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2024-04-20 19:55:49 -05:00
Chris Stewart
a6d93622f8
2024 04 16 descriptor fidelity (#5529)
* Implement unit tests for key expression fidelity to user input for hardened paths

* Create HardenedType, rework BIP32Node to take Option[HardenedType] as a parameter

* Fix docs
2024-04-17 18:35:33 -05:00
Chris Stewart
d162242a39
2024 03 24 v21 rpc refactor (#5494)
* WIP: Consolidate V19FilterRpc into BlockchainRpc

* Implement ChainApi.getFilterHeader() with bitcoind

* Make {BitcoindV22RpcClient,BitcoindV23RpcClient,BitcoindV24RpcClient} extend BitcoindRpcClient directly

* Fix MiningRpcTest

* Remove cast in BitcoindBackendTest
2024-03-26 13:04:26 -05:00
Chris Stewart
177542a13c
Remove grizzled.sl4fj was its no longer maintained (#5482) 2024-03-18 16:48:58 -05:00
Chris Stewart
55e4dab86e
Rework NodeApi.downloadBlocks() to use DoubleSha256DigestBE (#5456)
* Rework NodeApi.downloadBlocks() to use DoubleSha256DigestBE rather than DoubleSha256Digest

* Fix test cases

* Fix docs

* Fix compile
2024-03-05 15:19:32 -06:00
Chris Stewart
8b23b1f4f6
Add delay to wait for zmq to get setup in chainTest (#5427)
* Add delay to wait for zmq to get setup in chainTest

* Add println

* only run zmq tests on CI

* Bump Thread.sleep from 1ms -> 10ms

* Empty commit to re-run CI

* Revert things

* try making thread names more unique

* try no sleep

* Remove println

* Put logging back

* Try removing ZMQ.NOBLOCK

* turn off parallelExecution to see if it matters

* Add more logging

* Re-enable parallelExecution

* Try catching all NonFatal exns

* Bump timeout

* Bump maxTries

* Try downgrading jeromq back to 0.5.4

* Revert things

* scalafmt
2024-03-03 11:54:50 -06:00
Chris Stewart
cb26f6de07
Add WalletZmqSubscribers (#5423)
Move connection logic into ZMQSubscriber.start() rather than SubscriberRunnable
2024-02-26 11:28:39 -06:00
Chris Stewart
1dff918848
2023 02 21 pekko (#5413)
* Get dependencies resolving, get tor module compiling

* Get everything compiling with pekko

* Rework configs/logging to use pekko namespace

* Rename AkkaUtil -> PekkoUtil, BitcoinSAkkaAsyncTest -> BitcoinSPekkoAsyncTest
2024-02-22 10:26:21 -06:00
Chris Stewart
af74450c62
Cancel polling job after walletTest is executed (#5379) 2024-01-31 10:24:44 -06:00
Chris Stewart
5c2c8ee30b
2023 10 19 recursive rescan state (#5269)
* WIP: Implement future chaining for recursive rescans

* Fix deadlock by segregating RescanStarted.doneF into two different methods, one tracking the single pass rescan and one tracking the entire rescan

* scalafmt, add comment

* Fix bug where we were completing Promise twice

* Fix unit test

* Cleanup logs

* Cleanup comment

* Bump timeout

* Empty commit to run CI

* Empty commit to re-run CI

* Empty commit to re-run CI
2023-10-24 08:13:45 -05:00
Chris Stewart
b252c2d6a2
2023 10 16 Implement WalletCallbackStreamManager, DLCWalletCallbackStreamManager (#5263)
* WIP: Implement WalletCallbackStreamManager

* Implement stopping of WalletCallbackStreamManager in WalletAppConfig

* WIP: DLCWalletCallbackStreamManager

* Refactor DLCWalletCallbacks to be a trait

* Integrate DLCWalletCallbackStreamManager into WebsocketUtil

* Use  java.util.concurrent.atomic.AtomicBoolean rather than monix

* Remove logger param from dlc callbacks

* fix docs

* Call super.stop() in DLCappConfig

* Empty commit to run CI

* Try to debug

* Empty commit to run CI

* Revert things
2023-10-19 11:52:07 -05:00
Scala Steward
d7037ede28
Update scala-library to 2.13.12 (#5235)
* Update scala-library to 2.13.12

* Fix compiler errors on scala 2.13.12

---------

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2023-09-12 10:45:17 -05:00
Chris Stewart
ebe98959ed
Upgrade to scalac 2.13.11 (#5097)
* Upgrade to scalac 2.13.11

* Fix compile issues with scalac 2.13.11
2023-06-08 10:27:39 -05:00
Chris Stewart
36f30c5915
Fix bug where bip39Password was not passed as param in test case (#5040)
* Fix bug where bip39Password was not passed as param in test case

* Empty commit to re-run CI

* Empty commit to re-run CI
2023-04-08 22:19:13 -05:00
Chris Stewart
36ec40dfa3
implement generating addresses when wallet is initialized if creationTime is > 1 hour ago (#5034) 2023-04-04 11:40:26 -05:00
Chris Stewart
af349d2179
Remove support for v19 of bitcoind (#4991)
* Remove support for v19 of bitcoind

* Remove downloading v19 bitcoind inside of bitcoind-rpc.sbt

* Clean up docs

* Move unit tests in BitcoindV19RpcClientTest into other test files so we don't remove them, these rpcs are supported in future versions of bitcoind
2023-02-16 10:27:56 -06:00
Chris Stewart
c7febc1ef0
Segregate P2PClientTest and P2PClientActorTest (#4974)
* Segregate P2PClientTest and P2PClientActorTest to make it easier to test the actor

* Fix cleanup code

* Clean up tables for postgres test case

* Fix BitcoinSAppConfigBitcoinFixtureStarted.afterAll()

* Empty commit

* Add forceNamedWallet parameter to for postgres test cases where we need multiple wallets. This prevents them from writing to the same postgres schema by making unique wallet names

* Cleanup:

* Empty commit
2023-02-06 15:07:18 -06:00
benthecarman
1d1af1d52e
Add generate helper function for bitcoind (#4852) 2022-10-19 14:22:30 -05:00
rorp
ddc672cc46
Fix unconfirmed -> confirmed state change (#4816)
* Fix unconfirmed -> confirmed state change

* refactor

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-10-06 07:06:18 -05:00
benthecarman
cad13182df
Use postrgres when flagged in TrezorAddressTest (#4768)
* Use postrgres when flagged in TrezorAddressTest

* Clean database on shutdown
2022-09-15 20:07:51 -05:00
Chris Stewart
2bf1c9d1a5
Try to debug what is happening on CI with zmq test (#4708)
* Try to debug what is happening on CI

* Turn off logging

* Fix compile errors

* try to add sleep to get zmq started

* Cleanup

* Empty commit
2022-09-05 13:23:10 -05:00
Chris Stewart
a0eb0824a2
Fix some bugs around resetting rescan state when a rescan fails (#4642)
* Fix some bugs around resetting rescan state when a rescan fails

* Add test case

* Use .fail() method
2022-08-22 12:55:18 -05:00
Chris Stewart
c09da6f116
Bump rescan test timeouts from 5 -> 10 seconds (#4639)
* Bump rescan test timeouts from 5 -> 10 seconds

* Empty commit

* Use AsyncUtil.awaitCondition rather than a hard timeout
2022-08-22 08:52:43 -05:00
Chris Stewart
eb1327824b
Fix bug where we were not generating change addresses during a rescan (#4631)
* Fix bug where we were not generating change addresses during a rescan with a fresh address pool

* Turn logging level down

* Add awaitRescanDone before checking addresses

* Alternate order we clear addresses and utxos
2022-08-20 13:23:27 -05:00
benthecarman
6119a334fa
Make fundRawTransactionInternal use DBIOActions (#4575)
* Make fundRawTransactionInternal use DBIOActions

* Fix to correctly use callback

* Move reservedUTXOsCallbackF to FundRawTxHelper
2022-08-06 17:14:02 -05:00
rorp
cf22816003
Fix rescan batch boundary bug (#4549)
* Fix rescan batch boundary bug

* Make arguments for rescan required to avoid bugs

* WIP: Debug rescan batches

* Add forceGenerateSpks to fix one bug

* Remove addressCount != 0 check now that we have forceGenerateSpks

* Remove comment

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-08-06 14:07:35 -05:00
Chris Stewart
c89491c3e7
2022 07 29 fix multiple batch test (#4556)
* Fix multiple batch unit test so it fails

* Fix compile

* Move generateScriptPubKeys into buildFilterMatchFlow()

* Rename param to filterBatchSize

* Rename to buildRescanFlow

* Remove println

* Cleanup
2022-08-03 12:33:37 -05:00
Chris Stewart
b1a7f92c67
Refactor to not use filterThenSum() when calculating balances (#4562)
* Refactor to not use filterThenSum() when calculating balances

* Add await for balance as blocks are processed async

* Add more assertions, fix bad assertions I introduced
2022-08-02 12:33:46 -05:00
Chris Stewart
191df09196
Move pollBitcoind out of startBitcoindBlockPolling (#4559)
* Move pollBitcoind out of startBitcoindBlockPolling

* Rework startBitcoindBlockPolling to not return Future[Cancellable]

* Stop NodeCallbacksStreamManager inside of NodeAppConfig.stop()

* Make BitcoindSyncState which encapsulates syncing with bitcoind and polling of mempool

* Fix bug where processingBitcoindBlocks cannot be top level val as that method may be used by different parts of the codebase

* Rename isPolling -> processingBitcoindBlocks

* Cleanup more resources in appServerTest/test

* Complete polling stream regardless if we synced blocks are not to complete the Future returned by pollBitcoind

* Empty commit to run CI
2022-08-02 06:40:17 -05:00
Chris Stewart
af9e5eaeef
Expose DBIOActions for various models in wallet, remove address queue (#4524)
* Expose DBIOActions for various models in wallet, use them in generateScriptPubKeys

* Remove addresses queue

* Remove test case

* Fix rebase
2022-07-31 10:36:45 -05:00
Chris Stewart
4b83286922
2022 07 25 wallet api refactor (#4545)
* Move MockChainQueryApi/NodeApi out of BaseWalletTest

* refactor BitcoinSServerMain.start() to return WalletHolder

* Add walletConfig to WalletWithBitcoind

* Move findOutputsBeingSpent into WalletApi

* Add WalletApi.clearAllAddresses(), HDWalletApi.{findAccount, getnewaddress(account)}

* Add HDWalletApi.fundRawTransaction() with an account as parameter

* Add WalletApi.findByScriptPubKey()

* Fix lots of tests in WalletIntegrationTest

* Create WalletApi.processOurTransaction()

* Get things compiling

* Fix tag integration test

* Refactor AnyDLCHDWalletApi -> DLCNeutrinoHDWalletApi

* Fix docs

* Get postgres tests passing locally

* Move initBalance map before calling callback in CallBackUtilTest

* Get compile working, rename to destroyOnlyWalletWithBitcoindCached

* Fix docs

* Fix missing destroyWalletAppConfig

* Fix scalafmt

* Fix bug in dlcWalletTest where wallet db thread pools weren't being shutdown after unit test completes

* Empty commit
2022-07-31 08:04:39 -05:00
Chris Stewart
2cd8c80f67
Refactor so we don't create multiple WalletAppConfig in testkit (#4548)
* Refactor so we don't create multiple WalletAppConfig in testkit

Fix buildBip39PasswordConfig

* Remove bip39Password argument from dlcWalletTest fixtures

* Fix allowExternalDLCAddresses config in tests

* Remove unnecessary overrides of BitcoinSWalletTest.getFreshConfig, fix docs

* Add DLCExecutionBackendTest.afterAll()

* Fix nodeTest bip39Password usage

* Fix bug where we weren't using correct config inside of getFreshConfig

* Fix DLCExecutionBitcoindBackendtest.afterAll()

* Fix RescanDLCTest
2022-07-30 17:20:18 -05:00