Commit graph

414 commits

Author SHA1 Message Date
Chris Stewart
b9616066f2
wallet: Refactor {UTXOHandlingApi,AccountHandlingApi,AddressHandlingApi} to use 'get' prefix rather than 'list' prefix for method names (#5828) 2025-01-01 09:41:21 -06:00
Chris Stewart
b1403155fc
wallet: Refactor AddressHandling to be account specific (#5825)
* wallet: Refactor AddressHandling to be account specific

* fix compile

* Add test

* Fix AddressType.fromPurpose() for HDPurpose.Multisig

* Fix nodeTest/test

* Don't use HDPurpose.Multisig in test

* Return None for HDPurpose.Multisig inside of AddressType.fromPurpose()
2024-12-30 06:48:47 -06:00
Chris Stewart
25517265fe
wallet: Reduce noisy DEBUG log (#5820) 2024-12-22 15:57:36 -06:00
Chris Stewart
d29dad4472
2024 12 11 issue 5625 (#5803)
* wallet: Get UTXOHandlingApi.listUtxos() to be account specific

* wallet: Add UTXOHandlingApi.{getBalance(), getUnconfirmedBalance(), getConfirmedBalance(), getBalance(account), getUnconfirmedBalance(account), getConfirmedBalance(account)}

* wallet: Remove listDefaultAccountUtxos(), use listUtxos() instead
2024-12-11 14:26:22 -06:00
Chris Stewart
e2a0617d67
wallet: Don't cache TransactionProcessing now that it doesn't have internal state (#5797) 2024-11-30 09:05:02 -06:00
Chris Stewart
04757f9039
wallet: Remove TransactionProcessing.blockProcessingSignals (#5795)
* wallet: Remove TransactionProcessing.blockProcessingSignals in favor of using ActorSystem event bus

* Kill actor after the promise is completed

* Add WalletAppConfig.materializer
2024-11-30 07:16:49 -06:00
Chris Stewart
e5ff1a5018
wallet: Fix noisy log, only log when we have an output to search for (#5794) 2024-11-28 11:48:12 -06:00
Chris Stewart
6f13f263ee
wallet: Remove duplicate implementations of SendFundsHandlingHandling.sendFromOutpoints() (#5792)
* wallet: Remove duplicate implementations of SendFundsHandlingHandling.sendFromOutpoints()

* Improve error message

* Revert WalletSendingTest

* Add invariant to check that we aren't sending from 0 outpoints
2024-11-28 09:52:14 -06:00
Chris Stewart
dbdad48413
wallet: Remove unused wallet configurations (#5789) 2024-11-26 15:20:13 -06:00
Chris Stewart
d5a77a2297
wallet: Batch database actions in processBlockCachedUtxos() (#5788) 2024-11-26 10:35:08 -06:00
Chris Stewart
c6917b296b
config: Rename config option bitcoin-s.wallet.defaultAccountType -> bitcoin-s.wallet.purpose (#5783) 2024-11-24 08:16:18 -06:00
Chris Stewart
f6f01f333a
wallet: Cleanup RescanHandlingTest (#5781) 2024-11-22 11:07:22 -06:00
Chris Stewart
345ab017e5
testkit: Randomize defaultAccountType (purpose) in tests (#5775)
* testkit: Randomize defaultAccountType (purpose) in tests

* Remove redundant defaultAccountType settings

* scalafmt

* Fix ProcessBlockTest for nested-segwit purposes

* Fix dlcWalletTest
2024-11-22 11:07:13 -06:00
Chris Stewart
b6cc97a663
2024 11 20 prevoutmap ordering (#5776)
* Add test case and add invariant to RawTxSigner.sign()

* Add InputInfo.sortPreviousOutputMap()

* Fix bug where we were sorting prevoutputmap when it didn't need to be sorted
2024-11-21 08:59:15 -06:00
Chris Stewart
d8ad023254
wallet: Implement taproot keypath handling in the wallet (#5772) 2024-11-20 11:16:27 -06:00
Chris Stewart
80be2f5989
2024 11 15 partialsig typeparam (#5770)
* Add DigitalSignature type param to PartialSignature

* Remove isDummySignature
2024-11-18 09:15:33 -06:00
Chris Stewart
471c063532
Remove rescan specific threadpool (#5746) 2024-10-30 10:10:55 -05:00
Chris Stewart
3ae69b6ab5
wallet: Get processBlockCachedUtxos() using DBIOAction (#5740)
* wallet: Get processBlockCachedUtxos() using DBIOAction

* Remove unused val
2024-10-29 06:00:57 -05:00
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
2521c5da0e
Fix noisy log in TransactionProcessing (#5742) 2024-10-28 08:42:09 -05:00
Chris Stewart
fe8acbb42f
2024 10 25 Get TransactionProcessing.processTransactionImpl() using a single database transaction (#5739)
* Get TransactionProcessing.processTransactionImpl() using a single database transaction

Revert BlockHashWithConfs.scala

Get TransactionProcessing.processTransactionImpl() using a single DBIOAction to encapsulate our wallet's processing of a bitcoin transaction into a single database transaction

* Fix WalletCallbacksTest

* Revert logback-test.xml
2024-10-26 08:08:56 -05:00
Chris Stewart
8917188220
wallet: Rework where we fetch the number of block confirmations for a tx in the wallet (#5738)
* wallet: Rework where we fetch the number of block confirmations for a tx in the wallet

* fix reserve handling
2024-10-26 06:57:44 -05:00
Chris Stewart
29f10d046c
Turn on -Xlint (#5728)
Get entire codebase compiling

Fix DLCDAO

Revert .jvmopts

Finish rebase
2024-10-24 06:59:50 -05:00
Chris Stewart
00b1c85e65
Remove TableAutoInc[T] type parameter, its unnecessary and causes issues (#5711) 2024-10-15 07:31:26 -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
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
2d4a0adda4
Add FundTransactionHandlingApi, make FundTransactionHandling a case class (#5651) 2024-08-25 08:52:19 -05:00
Chris Stewart
42b13a6a62
wallet: Remove unecessary type parameter to TxCRUDComponent#TxTable (#5650) 2024-08-24 15:09:14 -05:00
Chris Stewart
4212d6d616
Create AccountHandlingApi, move inheritance from Wallet into HDWalletApi (#5627)
* Create AccountHandlingApi, move inheritance from Wallet.scala into HDWalletApi

* Fix get wallet accounts test
2024-08-21 13:23:46 -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
f5adc331f1
Move WalletDAOs to src (#5626) 2024-07-23 14:48:15 -05: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
Chris Stewart
4f791d71d7
Upgrade clightning to 24.02.2 (#5558)
* Upgrade clightning to 24.02.2

* Fix download hash

* Fix version

* Change CLightningInfo.fees_collected_msat from String -> Long

* Fix channels parsing, add support for p2tr address type and remove nested-segwit for clightning

* Revert version

* amount_msats -> amount_msat

* Fix more json parsing

* Try commenting out asserts for midChannelsA being completed in CLightningChannelOpenerTest

* scalafmt

* msatoshi -> amount_msat

* Change assertion to check assert the channel is not active in CLightningChannelOpenerTest

* Fix CLightningPayResult

* Ignore test case that uses sendtoaddress until we upgrade to psbt v2
2024-05-01 13:28:12 -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
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
ddb6f01d65
Simplify / reduce log level for compact filter logs (#5452) 2024-03-05 09:20:32 -06:00
Chris Stewart
42e5e87350
Reduce various logs in org.bitcoins.wallet to DEBUG (#5434) 2024-02-27 15:55:14 -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
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
Chris Stewart
531c909597
Use BitcoindRpcBackendUtil.buildBitcoindNodeApi() in wallet test fixtures, re-implement getConfirmationsForBlocks() to use akka streams to avoid max-open-requests limit inside of akka (#5259) 2023-10-12 18:02:06 -05:00
Chris Stewart
13e5e6501c
Fix bug where compact filters weren't being processed in order of block height during IBD (#5041)
* Fix bug where compact filters weren't being processed in order of block height during IBD

* Use sorted compact filter messages in chainApi.processFilters()
2023-04-10 16:42:48 -05:00