* fix node test shared fixtures bug
The cached bitcoind fixtures were used and stopped in UnsyncedNeutrinoNodeTest which causes an error if NeutrinoNodeTest is run at the same time on high performant systems, which is why it escaped CI. Merges NeutrinoNodeTest and UnsyncedNeutrinoNodeTest
* fix possible issues with PeerMessageReceiverTest
This reverts commit 55e7cafee6c6fd8515650cf65d96f9d92a2a8812.
* fix filter sync issue when wallet creation time indicates already synced
* move switch peer test to NeutrinoNodeWithUnachedBitcoindTest
* add support to find and switch peers
* fix compile on 2.12
* allow empty config peers in regtest
* fix test
* minor fixes
changes timeouts, fix issue with ipv6 dns seeds, initDisconnect when disconnected bug, dbPeers order fix
* fix: not removing peers on initialization timeout
* fix: query again when previous failed
* fix: wrong condition for deferred peers
* restore log levels
* clean up
* add PeerStack to allow trying peers based on priority values
* fix migrations
* changes from comments
* use StartStopAsync
* changes from comments
* fix switch if peer down test
* changes from comments
* DLC <-> contact mapping
* updated docs
* populate dlc/contact mapping automatically
* typo
* respond to the PR comments
* rename `contact` to `peer`
* fix unit tests
* create a contact when an incoming offers gets created
* drop dlc_contact_mapping table
* fix build
* update the docs
* Revert "update the docs"
This reverts commit 2386adadcd.
* revert dlc-contact-* endpoints
t Please enter the commit message for your changes. Lines starting
* Refactor WalletAppConfig test fixture destructions to stop the config when tearing down
* Fix test fixture where walletappconfig might not be started
* DLCMessage.totalCollateral -> DLCMessage.collateral
* Fix bad names of {DLCOfferTLV,DLCAcceptTLV}.totalCollateralSatoshis, its not the total collateral, rather the collateral being contributed by the offerer and acceptor
* Fix rebase
* Fix appServerTest
* Fix docs
* Refactor receive flow to use the same utxo state transitions as the rest of the wallet
Get tests passing again with refactored utxos
Remove unecessary wallet methods
Fix test cases
* Remove fixture on UTXOHandlingTest
* Fix bug where funding happens in parallel in fixture and can lead to blockchain reorgs
* Get things compiling and tests passing
* Fix bug where we weren't using filter height correctly
* Fix docs
* Move creationTime into KeyManagerAppConfig
* Fix nodeTest/test test fixtures
* 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
* Add unit test we can handle spending funds and receiving funds in the same transaction inside the wallet
* Use fundRawTranaction() to make sure the utxo is reserved
* Try to add block generate to address in fixture setup to get around the case where block headers & filter headers are synced but compact filters are not
* Push to github to force re-run of CI 2
* Add ChainApi.getBestFilter(), use it in sync to determine if filter headers & filters are in sync
* Push to github to force re-run of CI 3
* Simplify getBestFilter, add unit test
* Add more comments, clean up some code
* Pulled down dlc and dlcTest projects into core and dlcTest
Added dlcTest to CI runs and fixed compilation issues
* Fixed docs
* loosened fee rate bound assertions to only sanity test
Turn off logging again
Try to move things around even more to make sure zmq is started
Turn logging level down to ERROR to hopefully get some meaningful output
Adjust both valdiation & ChainHandler to be ERROR level logging
switch zmqpubrawblock to be the port we know is free
Reduce logging to WARN
Bump bitcoind max retries to 120
Fix rebase
Revert logging
Remove some noisy logs
Restore logs to trace level
Add explicit tag
* Refactor MultiWalletTest to actually shutdown the walletAppConfigs
* Remove 'implicit' modifier from getFreshWalletConfig. This is a problem as it can be used implicitly to bind resources (threads, files etc) that need to be cleaned up. Since it is implicitly passed, it is very hard to remember to clean up these resources
* Cleanup TrezorAddressTest
* Remove unecessary BitcoinSWalletTest.afterAll()
* Fix docs
* Removal of datadir race condition
* Cleanup nodeTest to shutdown the transitive chainAppConfig required by NodeAppConfig
* remove experimental tag on NeutrinoNodeTest
* Remove extra line
* Cleanup after BitcoindChainhandlerViaZmqTest
* Push to github to force re-run of CI 2
* Reduce pg connections from 300 -> 50 in test cases
* Reduce connection count to 25
* Push to github to force re-run of CI
* Switch explorer over to prod for now as test is down to get CI passing
* Reduce shared buffers memory size
* Push to github to force re-run of CI 2
* Fix bug introduced in PR 2597, we need to explicitly call WalletAppConfig.stop() now rather than transitively calling it via Wallet.stop()
* Fix calls to wallet.stop() -> wallet.walletAppConfig.stop() in BitcoindBlockPolling,BitcoindBackend. Also add some explicit type annotations
* Get FilterSync test working with cached bitcoind in chainTest project
* Small refactor to be DRY
* Fix docs
* Refactor ChainSyncTest to use 1 cached bitcoind, as a by product add ChainWithBitcoindNewestCachedUnitTest
* Remove unecessary mixin trait
* Fix missing ChainWithBitcoindNewestCachedUnitTest.afterAll()
* Reduce thread pool size for akka's internal dispatcher in unit tests from 2 -> 1. Same with the blocking dispatcher
* Add comment
* Fix missing super.stop() to shutdown DbAppConfig db connection pool inside of all DbAppConfig subclasses that override stop()
* Fix import
* Remove implicit modifier to NodeUnitTest.getFreshConfig(), make sure we are shutting down chainAppConfig inside NodeUnitTest
* Remove chainTest subclasses implementing ActorSystem, make sure we do correct cleanup in ChainUnitTest
* Decouple CachedChainAppConfig & CachedAppConfig. When using only one sub module in the CachedAppConfig, teardown may fail as the other modules might not be started such as using chainAppConfig in chainTest, BitcoinSAppConfig.stop() requires us to call nodAppConfig.stop() first, which isn't started.
* Push to github to force re-run of CI 4
* Move wallet scheuler into WalletAppConfig, use scheduler.shutdownNow() so we actually shutdown the scheduler rather than wait for all queued tasks to finish executing before shutting down
* Fix typo
* Move rescan thread pool in to walletAppConfig, shut it down on wallet shutdown
* Fix compile
* Fix missing database shutdown on WalletAppConfig.stop()
* Cleanup BitcoindBlockPollingTest
* Cleanup ProcessBlockTest and all tests that use CachedBitcoind
* Cleanup BitcoindBackendTest
* Cache rescan thread pool rather than creating a new one everytime
* Add invariant to spendingInfoDb to that requires if the spendinginfodb is in a TxoState.spentStates, the SpendingInfoDb.spendingTxIdOpt is defined
* Remove unused SpendingInfoDAO.updateTxoState()
* Remove comment
* Make TxoState and explicit parameter for test methods. Most test methods depend on a sample utxo state, so make the caller of the method specify what state they want the txo to be in
* Fix github actions config
* Fix RoutesSpec test
* Wallet Rebroadcast Logic
* Use wallet scheduler for address queue rather than it's own thread
Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
* Bump default
Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
* Schnorr sigs for Scala.js
* fix build
* put BIP340 test vectors in a shared space
* remove teskit dependency, fix point edge cases
* fix build
* add unit tests for point addition
* scaladoc
* cleanup
* respond to the comments
* Fix usage of BitcoinSLogger
Co-authored-by: christewart <stewart.chris1234@gmail.com>
* 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
* 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
* Refactor starting second bitcoind in MempoolRpcTest, remove Thread.sleep
* Add AkkaUtil.nonBlockingSleep(), replace usages of Thread.sleep() with it where possible
* Remove more Thread.sleep()
* Try bumping threadpool for scheduler
* Reduce scheduler threadpool size to 2
* Push to github to force re-run of CI
* 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
* Refactor crypto module to be compatible with Scala.js
* more changes
* some more changes
* abstract out Schnorr stuff
* abstract out adapter stuff
* cleanup
* some more cleanup
* fix build
* Removed references to ECPoint outside of .jvm scope
* remove references to ECPoint from the shared code
* cleanup
* remove cirlular dependencies
* more cleanup
* cleanup
* move SipHash to CryptoContext
* scaladoc
* scalafmt
Co-authored-by: nkohen <nadavk25@gmail.com>
* 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
* Give connection pool example config
* Get hikari logging working on postgres
* fix 2.12.x
* Bump metrics core to a supported version
* Add hikari-logging and hikari-logging-interval configuration options to turn off/on hikari and schedule how often logs appear
* Turn off hikari logging in the db-commons/reference.conf and add it to appserver/reference.conf
* default the logging to off in scala code
* Make sure connection pool is enabled in db-commons, add default database configuration to website
* Address code review, fix things that didn't need to be changed
* Implement oracleAttestmentV0TLV, save outcome to db
* Update with tlv changes
* Update tlv to not have 2 list sizes
* small change
* Update OracleEvent.verifyAttestations
* Use correct pub key
* Verify correct outcomes
* 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
* 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
* Clean up fixture shutdown code a bit to try and see if this resolves issue on CI
* Rework fixtures so we aren't starting app configs in multiple places
* Fix scaladoc
* 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
* Rework BlockHeaderDAO.chainTips into two methods: BlockHeaderDAO.{getBestChainTips,getForkedChainTips}. getForkedChainTips is needed for reorg situations in the case a block header is received that builds off a stale tip
* Deduplicate BlockHeaderDAO.getBlockchains() that are subchains for the best chains
* Fail broadcasting transaction when disconnected
* Wait until disconnected
* Move test
* Move to separate file
* Attempt fix
* Make test never have a peer
* Improve reliablity
* Moved dlc data structures from commons to core
* Renamed DLC payout curve classes
* Split OutcomeValuePoint up into an ADT
* Added utility for computing Schnorr multiple-signature points
* Replaced tuples in RoundingIntervals with types
* Replaced tuples in DLCPayoutCurve with Indexed
* Fixed a compile bug
* 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
* Pulled down work from adaptor-dlc onto master
* Reverted some accidental deletions
* Removed unused import
* Added scaladocs
* Responded to Ben's review
* Added some scaladocs and invariants
* Responded to chris' review
* Responded to more review
* Added some comments
* Start refactoring testkit to allow for specifying a different binary directory than the sbt default
* Fix BitcoindRpcTestUtil
* Add BitcoindRpcTestClient
* Make BitcoinSAyncTest more thread safe and make sure we have all the expected test cases aggregated before we starting reducing over the results
* remove extra code
* Fix scala 2.12.x compile
* Introduce ChainHandlerCached which behaves like the old ChainHandler. Now Chainhandler.getBestBlockHeader() will read headers from the database
* Remove ChainHandler.blockchains field, now it's only available in ChainHandlerCached
* De-futurify ChainHandler.fromDatabase()
* Adjust logging
* Patch test case
* Use BlockHeaderDAO.chainTips when getting best header rather thean BlockHeaderDAO.getBlockchains(). Implement a helper method ChainHandler.toChainHandlerCached()
* Fix chain.md,wallet.md
* Make ChainHandler.getBestBlockHeader() consider time of header if chainwork is the same. Make test cases less strict on what header is the best header when both chainwork and time are the same on the eader
* Only execute callbacks on headers that are going to be created in the database, not all headers passed into ChainHandler.processHeadersWithChains()
* Turn up log level again
* Small optimizations, check if we have seen a header before before processing it in ChainHandler.processHeadersWithChains(). Fix FilterSyncMarker.toString(). Use ChainHandlerCached in Node
* Remove ChainHandlerCached in appServer, re-add it in Node.scala
* Update Oracle to use new TLVs
* Rename things to use new names, scaladoc, small clean ups
* Add descomposition tests, docs, sign numbers outside of range
* Update Oracle TLVs
* Change string size to be BigSizeUInt
* Move nonces to oracle event tlv
* Introduced EventDescriptor tests and NumericEventDescriptor methods to query possible outcome data
* Added contains function
* Added tests for containsToPrecision
* Remove EventDescriptor.outcomes and other related fields
* remove unused formatNum method
* Address code review from Ben
* Move oracle pub key to announcement
Co-authored-by: nkohen <nadavk25@gmail.com>
Co-authored-by: christewart <stewart.chris1234@gmail.com>
* Make aesPassword option for wallet config
* Add to docs
* Make AesPassword optional
* Small touchups
* Fix for oracle server
* Fix docs
* Increase code coverage
* 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
* Add Wallet State Descriptors
* Sync blocks while offline w/ bitcoind backend
* Add to WalletDbManagement
* Update db management test
* Respond to review
* Rename function
* Add test case for resolving typesafe config variables and making sure we honor system properties
* Remove println
* Move AppConfigTest test caess into the db-commons project
* Use absolute paths for resolving configurations
Make log level OFF again
WIP: Move resolution of config into AppConfig.start(), things are totally broken
WIP: Make AppConfig.config private
Get all tests passing again but using absolute path in configuration
* Cherry-pick onto master
* Fix BitcoinSAppConfig configuration keys to use the full path
* Apply code review
* Fix log, move invariant for requiredConfirmations back into the lazy val
* Fix DlcOracleAppConfig to use absolute path
* Add basic DLC Oracle
* Respond to review
* Respond to more review
* Add maturation time
* Add to testkit, tag hashes, better val names
* More clear vals, version tagged hashes
* Signing key clean up
* Add pubkey to db
* Introduce 'FilterSyncMarker' to ChainApi, make it clearier what exactly the (Int,DoubleSha256Digest) tuple is returned from ChainApi.nextBlockHeaderRange()
* Fix doc
* Add scaladoc to FilterSyncMarker
* Rebase onto master, fix conflicts to use FilterSyncMarker
* Pull over test cases, WIP
* Rework ChainHandler.nextBlockHeaderRange() to use hashes rather than heights to very integrity of header chain, add test case
* Modify test case to make sure we are generating the 'heaviest chain work' header as first in the tuple that is used in reorg test cases
* Refactor to helper method called 'findNextHeader()' to make things simpler
* Add scaladoc to ChainHandler.findNextHeader()
* WIP
* Fix bugs in ChainApi.nextBlockHeaderRange(), now return (startHeight,stopHash) rather than (stopHeight,stopHash)
* Get chain handler tests passing, remove genesis filter header/fitler from default chain project fixture, make it a specialized one to have genesis filter header/filter in the database. Use that specialized fixture in ChainHandlerTest for now
* FilterSync work without having the genesis filter and filter header inserted into the database
* fix bug in DataMessageHandler where we were using sendNextGetCompactFilterHeadersCommand rather than using peerMsgSender.sendGetCompactFilterHeadersMessage
* Refactor ChainHandler.findNextHeader() to centralize where chains are fetched
* Address ben's code review
* Extend StartStopAsync with BitcoinSAppConfig, create 'CachedAppConfig' test trait, clean up P2PClientTest
* Start cleaning up after ourselves in the chainTest test suite
* Call .stop() for appConfig's spun up in ChainAppConfigTest
* Database configuration defaults
* increase number of Postgres connections
* add more logging
* close connections pools in tests
* update afterAll()
* Fix conflict
Co-authored-by: rorp <rorp@users.noreply.github.com>
* Clean up code for BroadcastDAO test
* Extend StartStopAsync with BitcoinSAppConfig, create 'CachedAppConfig' test trait, clean up P2PClientTest
* Make MerkleBuffersTest use CachedAppConfig
* Start cleaning up after ourselves in the chainTest test suite
* Cancel background runnable for generating blocks after test case, add nodeAppConfig.stop() to tests in NodeAppConfigTest
* Stop mainnet nodeAppConfig in test as per ben's code review
* Refactor ChainUnitTest.withChainFixture() to use makeDependentFixture()
* Call .stop() for appConfig's spun up in ChainAppConfigTest
* Less parallelization on destruction of chainAppConfig
* Revert parallelExecution/fork jvm in CommonSettings