* Part 1 of reworking/refactoring acceptDLCOffer
* scalafmt
* WIP
* Move offer creation into initDLCForAccept
* Refactor method name to getDlcDbOfferDbAccountDb
* Push to github to force re-run of CI
* Get refactor working where we decouple CETSignatures and the partial refund signature
* WIP
* Implement migration to specify serialization_version on global_dlc_data table
* Fix migrations test
* WIP
* implement contractid computation
* Get migration working for wallet on testnet
* Add check to make sure we only try to migrate old wallets
* Refactor DLCDataManagement.getOfferAndAcceptWithoutSigs to not use DLCTxBuilder
* WIP
* Bubble up Option[] into DLCWallet, trivially assert on it and then use .get. We will have to do the refactor of DLCWallet sometime in the future
* Change global_dlc_data serializationVersion at database level to not have an Option
* Add DLCDbState, propogate it through the codebase
* Remove log
* Remove invariant for making sure all DLCs are defined on migraiton, add log for the case of issue 4001
* Add filter on ALPHA serialization DLCs. We dont need to migrate DLCs that are using the beta serialization
* Rebase onto 4004
* Refactor to use the refund signature in the accept/sign message
* Add output index to the return of DLCTxBuilder.buildFundingTransaction()
* Fix compile
* Remove log
* Refactor testkit tests to use same nodeCallbacks that BitcoinSServerMain uses for neutrino
* Add test case
* Add logs for callbacks
* Cleanup
* Add test case for when funds are spent when we are offline
* Turn off logging again
* Cleanup more logs and comments
* Get refactor working where we decouple CETSignatures and the partial refund signature
* Add DLCAcceptWithCetSigs() for the case where we have a refund sig, but no cet signatures
* Fix bugs
* Fix sighash parsing bugs
* RPC password authentication
* fix compiler error
* add more unit tests
* change default behavior
* Cleanup and add unit test for sad path for rpc authentication
Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
* Implement recovery for when we cannot receive a fee rate from a FeeRateApi. Now we return -1 sats/vbyte if we cannot get the fee rate from a fee provider rather than throwing an internal server error
* Fix compile
* WIP
* Get appServerTest passing with chain notifications
* Reorder where SourceQueue gets initialized so that we can use it to construct the wallet's callbacks
* DRY
* Fix missing callback for neutrino chaincallbacks
* Bump timeout
* Bump timeout
* When wallet is empty call doSync() with the last blockheader bitcoind has seen
* Revert skipping compact filters on IBD for bitcoind
* Revert logging
* WIP
* Get basic websocket working (sort of)
* Push websocket fixes
* WIP: Implementing SpendingInfoDb json serializer
* Implement onreserved callbacks, add json serializers for SpendingInfoDb
* Get first unit test working for websockets when a address is generated
* Rework WalletNotification to have case classes, get unit test working for receiving addresses over the websocket
* WIP
* Add websocket callback for when a wallet processes a block
* Cleanup
* basic updates to unit test
* Fix compile
* Fix submodule
* Fix compile
* Get both unit tests passing when run by themselves
* Fix so both test cases can be run
* Implement unit tests for blockpressed and reservedutxos websockets
* Fix RoutesSpec get a block header test
* Implement configuration for wsbind and wsport via bitcoin-s.conf
* Add some nonblocking sleeps on all WebsocketTests
* Add documentation
* Properly close the server with .terminate() rather than .unbind()
* Add BitcoinSServerMainBitcoindFixture.afterAll()
* Add println
* Add more println
* Try to downgrade bitcoind version
* Fix datadir bug
* Cleanup callbacks so they don't have nested futures
* Fix SpendingInfoDb.apply() pattern match
* Add spendingInfoDb json serializer test, does not pass
* Fix SpendingInfoDb json serializer
* Make small refactors
* Fix compile
* Add maxBufferSize, change overflow strategy to OverflowStrategy.dropHead
* Address Nadav's code review
* Address ben's code review
* Implement DLC wallet callbacks
Add callbacks and tests for Claimed/RemoteClaimed
Add unit test for confirmed state
* Add some docs
* Address ben's code review
* Fix scalafmt
* WIP
* Finish implementing {CRUD,CRUDAction}.createAllAction()
* Try to make database inserts more atomic
* Consolidate more database calls in DLCWallet.initDLCForAccept()
* WIP2
* More refactor and using actions
* Add DLCIdDaoUtilNoPK for querying when dlcId is not a primary key
* Add DLCDataManagement.deleteDLC()
* make DLCWalletApi.createDLCOffer() use actions
* Rework DLCWallet.createNewDLCAccept() to use DBIOAction
* Use actions in DLCWallet.registerDLCAccept() a bit
* Create DLCActionBuilder, move actions to there
* Move more actions into ActionBuilder
* Implement transactionally on database writes for actions
* Implemented Disjoint Union DLC related data structures with dlcTest passing
Broke DLCClientTest up into multiple test files
Optimized DLC execution unit tests by checking all outcomes on a single setup DLC
Refactored DLCTest to allow for Disjoint Union DLC construction and validation, added tests
Responded to review
Fixed after cherry-pick
Fixed docs
* Fixed things after rebase
* Rebase
* Fix json serializer
* Finish fixing compile
* Start trying to make APIs better for multi oracle contract infos
* Clean things up in the GUI, try to make failures on disjoint union contracts as explicit as possible
* Use less numDigits as optimization for non secp CI test cases
* Fix compile
* Refactor BroadcastDLCDialog
* Fix test case optimization
* Clean up comment
Co-authored-by: nkohen <nadavk25@gmail.com>
* WIP
* Setup DLC fixtures to work with bitcoind
* Implement test case for issue 3715
* turn logging back down, add another assertion for making sure funding tx is still unconfirmed
* Make sure we are broadcasting from acceptor
* Cleanup
* Run appServerTest on both windows and mac
* Add just mac test name
* Add downloadBitcoind task to windows matrix
* Make exception easier to be hit
* Remove deleting of directory as that shouldn't be needed
* Add support for not running bitcoind in test suites as a daemon on windows
* Fix bug where i forgot to re-add daemon config
* Implement MasterXPubDAO
* Fix nits
* Add postgres migrations
* Make sure tables are getting cleaned on postgres
* Get dlcOracleTest test cases passing with validation of the master xpub in the database on startup
* Fix test case
* Fix more tests
* Move things around so keymanager does not need to depend on dbCommons
* Get all walletTest passing
* Add unit test for wallet startup
* Fix rebase
* Get all sqlite tests passing
* Get postgres test cases passing locally
* Remove early call to walletAppConfig.start() in node project
* Make KeyManagerAppConfig.externalEntropy private
* Fix MasterXpubDAO.existsOneXpub()
* Fix bug in migrating database for oralce project
* Encapsulate initialization of DLCOracle.start() method
* Use internal WalletAppConfig.kmConf rather than passing in custom key manager parameters
* Add KeyManagerAppConfig.defaultAccountType
* Get all tests passing besides TrezorAddressTest
* Get TrezorAddressTest passing with provided entropy
* Add unit test to make sure we can always derive the seed
* Get docs compiling
* Fix dlcWalletTest test cases
* Add more test cases to keymanager
* Add the new configuration to the example configuration
* Add more test cases
* Remove coverage on 2.12 as it isn't accurate
* Rework DLCOracleAppConfig.start() to call kmConf.start() so the oracle can use entropy provided via bitcoin-s.conf
* Sort DLC table by last updated
* Add LastUpdatedDb
* Make visible
* Fix compile
* Add time, fix sorting
* Switch to local time
* fix compile
* Fix test
* Fix postgres migration
* Specify zoneId
* Tor packaged for testkit
* Add CI row
* Small fixes
* More fixes
* Keep tor running
* Skip tor test for old version of bitcoind
* Respond to review
* Fix with master
* Bump tor start time to same as app config
* Use cached tor for DLCNodeTest
* Disable parallel execution for dlc node test with tor
* Fix DLCNodeTest for tor and clearnet
* Fix name of CI rows
* P2P reconnect logic
* some fixes
* more changes
* fix DuplicateFilters exception in case of disconnect in the middle of syncing filters
* more fixes
* Repurpose maxconnections test to be just a generic reconnection test
Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
* DLC P2P WIP
* P2PClient refactor (#10)
* Add to CI
* Remove unused
* Attempt to create DLCNode and Tests
* Full Tor support
* Get DLCNegotiationTest passing
* Config options, connect & send func
* Test for DLCNode
* Add createDLCNode to config
* Fix formatting
* Update DLC state after all other data is set
* Remove unneeded line
* Respond to some review
* 2021 07 26 dlc node code review (#13)
* WIP
* WIP2
* Rewrite tests not use Await.result()
* Skip Tor test on CI
* Cleanup threadpool leaks in tests
* Handle actor pattern matching better
* Respond to review
* Implement DLCNode.stop
* sock5 -> socks5
* Use Tcp.Unbind
* Respond to review
* Implement postStop
* Switch to unbind
Co-authored-by: rorp <rorp@users.noreply.github.com>
Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
* relay flag in version message made configurable
* modified test classes as well
* Update configuration.md
* reverted few files and cleaned up format
* fixed mistake
* enabled neutrino node to receive transactions as a callback
* added txid to log message
* changed txId to txIdBE
* unit test added for checking if we're getting transaction as a callback