Commit Graph

380 Commits

Author SHA1 Message Date
Chris Stewart
2d9d12816b
Add WalletCallbacks.onBlockProcessed() (#3912) 2021-12-16 12:26:48 -06:00
Chris Stewart
f71d3567ed
2021 11 23 crud action (#3851)
* 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
2021-11-30 12:38:55 -06:00
Chris Stewart
8765c2f845
Disjoint union dlc (#3839)
* 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>
2021-11-29 19:26:00 -06:00
benthecarman
155301fc1d
Allow lnd remote to work with certificate string (#3840) 2021-11-20 18:59:46 -06:00
rorp
a6898defe2
Support for Bitcoin Core v22 (#3834)
* Support for Bitcoin Core v22

* respond to the PR comments
2021-11-19 13:58:27 -06:00
benthecarman
079fa62073
Lnd v0.14.0 (#3835) 2021-11-19 06:55:56 -06:00
Chris Stewart
aa748c012f
2021 11 03 protocol version (#3793)
* ProtocolVersion WIP

* Start incorporating protocol version into DLC Offer

* Fix doc
2021-11-03 15:13:19 -05:00
rorp
403c78fd8f
Server Docker config (#3775) 2021-10-25 06:35:02 -05:00
rorp
d71208cf0f
Support Eclair v0.6.2 (#3765)
* Support Eclair v0.6.2

* cleanup
2021-10-19 11:46:54 -05:00
benthecarman
6d43d443ba
Initial c-lightning rpc support (#3755)
* Initial c-lightning support

* Respond to review
2021-10-19 10:58:29 -05:00
Chris Stewart
9668358807
2021 10 04 issue 3715 (#3724)
* 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
2021-10-10 07:51:00 -05:00
Shreyansh
99107b61ea
Add PeerDAO (#3738)
* add PeerDAO

* update DbManagementTest expected migration count
2021-10-10 07:50:11 -05:00
benthecarman
f6169cc3af
Add LndInstanceRemote (#3710) 2021-10-02 16:15:40 -05:00
Chris Stewart
4a44f9cd58
Run appServerTest on both windows and mac (#3609)
* 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
2021-09-27 10:25:48 -05:00
Chris Stewart
48213d9b81
Implement MasterXPubDAO (#3451)
* 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
2021-09-21 08:05:23 -05:00
Chris Stewart
132479d271
Implement ability to provide external entropy to bitcoin-s (#3672)
* 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
2021-09-18 09:49:11 -05:00
Chris Stewart
0fb2cd0149
Remove implicit conversions from BitcoinSAppConfig -> {WalletAppConfig,ChainAppConfig,NodeAppConfig} etc (#3652) 2021-09-08 13:54:18 -05:00
Shruthii RG
d53f164478
BitcoindRpcClient Improvements (#3600)
* Changes in bitcoind-rpc module

* Get things compiling

* Implement BitcoindInstanceRemote & BitcoindInstanceLocal

* Fix doc compile

* bitcoind remote instance test

* rename BitcoindInstanceRemote

* Scalafmt

* Applied requested changes(except one)

* implemented fromConfigFile and fromDataDir for BitcoindInstanceRemote

* implemented fromNetworkVersion

* BitcoindInstanceRemote changes

* Get things compiling

* Add implict type parameter to InstanceFactory

* Fix recursive reference of version <-> getNetworkInfo

* bug fix

* bug fix 2

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2021-09-07 08:49:01 -05:00
benthecarman
656e9b1b5d
Sort DLC table by last updated (#3607)
* 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
2021-08-31 14:27:36 -05:00
Chris Stewart
0746b14331
Move BitcoindRpcAppConfig into the bitcoind-rpc project (#3610) 2021-08-27 06:43:31 -05:00
rorp
704b02ae6c
Use random ports for pre-packaged Tor daemon (#3604)
* Use random ports for pre-packaged Tor daemon

* fix unit tests

* configurable random ports

* shutdown hook
2021-08-26 13:02:49 -05:00
Chris Stewart
a5f4f9663c
Add BitcoinSServerMain test to connect to bitcoind (#3591)
* Add BitcoinSServerMain test to connect to bitcoind

* Add tor tests

* Fix compile

* Remove println

* Allow to reset BitcoinSServer promise

* Remove println

Co-authored-by: benthecarman <benthecarman@live.com>
2021-08-26 09:08:38 -05:00
Chris Stewart
b980f4894d
Implement BitcoinSAppConfig with ActorSystem (#3596) 2021-08-24 07:41:05 -05:00
benthecarman
495ab62104
Tor in Testkit (#3484)
* 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
2021-08-23 13:06:14 -05:00
rorp
54ce2ebeb2
P2P reconnect logic (#3572)
* 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>
2021-08-20 05:51:51 -05:00
benthecarman
addb1254ee
Fix for if tor is already running (#3562) 2021-08-17 09:47:31 -05:00
benthecarman
621e8e9033
Rescan DLC Tests (#3515) 2021-08-11 07:29:33 -05:00
rorp
3d4cf1fc91
Tor support for all sub-projects (#3506) 2021-08-10 08:07:12 -05:00
Chris Stewart
4f7b6422ea
2021 08 06 app config refacotr (#3498)
* Move AppConfig into app-commons, reduce classpath deps on keyManager,tor

* Move test ServerArgParserTest

* Fix compile error
2021-08-07 14:36:11 -05:00
benthecarman
1051e6365a
DLC P2P Client (#3402)
* 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>
2021-08-02 18:15:56 -05:00
Shreyansh
1426c31483
Multi peer: Sync with random peer (#3454)
* ensure random peer used for sync supports compact filters

* test file

* fix

* refactor

* rerun ci

* rerun ci

* changes from comments

* fix

* fix tests

* changes from comments

* refactor

* remove unintended diffs
2021-07-31 07:54:31 -05:00
Shruthii RG
e2c2798e60
Implemented the ability to fetch unconfirmed transactions (#3429)
* 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
2021-07-23 13:01:07 -05:00
Chris Stewart
1032669f21
Add unit test for moving seeds and making sure we can get the same public key after moving (#3441) 2021-07-23 13:00:27 -05:00
benthecarman
2597904019
Move DLCWalletApi to core module (#3438) 2021-07-21 15:25:18 -05:00
Shreyansh
4be2b2109b
[WIP] Adding multi-peer support (#3401)
* establish conn with multiple peers

squash 1

squash 2

squash 3

* add tests

* change log msg level

* minor changes

* fix

* formatting

* fix docs

* commit to rerun ci

* changes from comments

* fix bug

* rerun ci
2021-07-21 15:18:45 -05:00
Chris Stewart
b2b2ca45db
Add ability to configure postgres database backends for test cases via reference.conf (#3421) 2021-07-19 09:55:36 -05:00
Chris Stewart
b7b2a7099f
2021 07 15 dlc oracle pg (#3413)
* WIP

* Get postgres test passing by not allowing 0 byte (NULL character in UTF 8 string) in the utf8 generator
2021-07-17 12:19:49 -05:00
rorp
8b663d91b6
Tor support for P2P (#3311)
* Tor support for P2P

* fix stuck connections

* unit tests

* docs

* update docs

* respond to the PR comments

* fix docs
2021-07-13 14:27:24 -05:00
benthecarman
cada6fdc63
Fix DLC not storing nSequence for funding inputs (#3342)
* Fix DLC wallet not storing nSequence for funding inputs

* Fix DLCTest
2021-06-29 09:36:30 -05:00
benthecarman
cfe0c2f0d8
Multi wallet support for DLC database (#3289)
* Multi wallet support for DLC database

* Fix for postgres
2021-06-22 12:56:26 -05:00
benthecarman
fafc564da8
Update LND to v0.13.0-beta (#3290) 2021-06-21 16:20:08 -05:00
benthecarman
e63a12e47f
Better error message for invalid DLC refunds (#3209) 2021-06-15 10:57:50 -05:00
Chris Stewart
aaa7b42ae7
Add unit test we can handle spending funds and receiving funds in same tx (#3185)
* 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
2021-06-14 08:57:30 -05:00
Chris Stewart
7ba7f8b9ba
Try to add block generate to address in fixture setup to get around compact filter sync edge case (#3231)
* 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
2021-06-08 12:47:28 -05:00
Chris Stewart
bf02e89faa
2021 05 29 dlc pnl (#3198)
* WIP

* WIP2

* Get tableview rendering something

* Add basic unit tests for accounting

* Add rate of return

* Add myPayout and theirPayout to json objects

* Address code review

* Fix 2.12 compile, adjust table view

* drop isInit column on table view

* Fix scala 2.13
2021-05-31 11:12:24 -05:00
benthecarman
0e701bc9d0
Fix verify funding sigs (#3194)
* Fix verify funding sigs

* Sort funding inputs

* Sort utxos in dlc signer

* Other multi input fixes & tests

* Fix compile error
2021-05-28 19:59:45 -05:00
Nadav Kohen
17d1145504
Removed extraneous findAll call from CRUD.updateAll (#3154)
* Removed extraneous findAll call from CRUD.updateAll

* Made update tests deal with unchanged element
2021-05-26 14:22:18 -06:00
benthecarman
be8e965367
DLC Wallet pulldown (#3138)
* DLC Wallet pulldown

* Respond to review
2021-05-25 17:31:01 -05:00
Nadav Kohen
ac3bae403b
Pulled down all remaining non-wallet non-gui code on adaptor-dlc (#3101) 2021-05-18 06:29:46 -05:00
Nadav Kohen
58070f4120
Pulled down dlc and dlcTest projects into core and dlcTest (#3068)
* 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
2021-05-14 12:27:21 -05:00