Commit Graph

50 Commits

Author SHA1 Message Date
Chris Stewart
16fb5d2dad
2023 12 19 compiler opts (#5330)
* Enable more compiler options

* enable -Xlint:valpattern, fix bug with out Test / scalacOptions were set with incorrect source code compiler flags

* Enable -Xlint:eta-sam

* Fix cryptoTestJVM

* Fix cryptoTestJS/test

* Fix asyncUtilTest

* Fix asyncUtilTest
2023-12-20 05:42:01 -06:00
Chris Stewart
c03b158f94
Implement RescanTerminatedEarly exception to terminate the stream, implement ArgumentSource (#4574)
* Implement RescanTerminatedEarly exception to terminate the stream, implement ArgumentSource to understand where arguments passed into bitcoin-s are coming from

* Bump timeout
2022-08-04 14:11:07 -05:00
rorp
78648f1e40
PostgreSQL friendly wallet names (#4571)
* Postgres friendly wallet names

* cleanup

* fix unit tests
2022-08-04 08:54:33 -05:00
Chris Stewart
08699c0ee0
Remove nested Option[Option[AesPassword]] (#4564) 2022-08-02 14:08:26 -05:00
Chris Stewart
d4210fad65
Pull over changes from loadwallet branch (#4527) 2022-07-21 12:12:32 -05:00
Chris Stewart
948d2b424e
Make KeyManagerAppConfig.walletName return String rather than Option[String] (#4507) 2022-07-16 09:33:10 -05:00
rorp
414557effb
Add imported flag to the seed JSON (#4459)
* Add `imported` flag to the seed JSON

* scalafmt

* update `walletinfo`

* fix docs

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-07-08 18:55:47 -05:00
rorp
a7aad46934
Seed backup API (#4357)
* Seed backup API

* respond to the PR comments

* exportseed/importseed symmetry

* update docs
2022-06-22 08:14:11 -05:00
Chris Stewart
341c712563
Validate bitcoin-s.wallet.walletName config option (#4336) 2022-05-17 10:29:17 -05:00
Chris Stewart
5113cac6c2
Log root xpub on keymanager startup (#4157) 2022-03-03 12:43:12 -06:00
Chris Stewart
b46574c0c4
2022 02 18 sync since creationtime pt2 (#4109)
* 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
2022-02-22 08:00:14 -06:00
benthecarman
142612f034
Make newConfigOfType use Vector[Config] (#4039) 2022-02-04 06:14:16 -06:00
Chris Stewart
e802254a20
2022 01 24 rm appconfig varargs (#4011)
* Get things compiling

* Get tests passing

* Fix docs
2022-01-25 07:25:05 -06: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
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
8432712dba
Fix sbt deprecation warnings (#3163) 2021-05-27 06:28:32 -05:00
Nadav Kohen
63a6f9309d
Introduced AsyncAdaptorSign and AdaptorSign traits (#3037) 2021-05-05 09:34:03 -05:00
benthecarman
fa80f36d2f Get all of Core working with JS (#2826)
* core-test-js-json

* Add SigPointComputer cross compile
Co-authored-by: Nadav Kohen <nadavk25@gmail.com>

* Fix java.time for scalajs

* InetAddress for scalajs

* Fix linking errors in coreTestJS

* Easy fixes

* InetAddress Tests

* Update micropickle, fix exact functions

* Get BigSizeUIntTest working with upickle

* Fix exact funcs

* Update Base58Test with upickle

* Update ScriptSignatureTest with upickle

* Update TransactionTest with upickle

* Update BlockFilterTest with upickle

* Update ScriptInterpreterTest with upickle

* Update MnemonicCodeTest with upickle

* Add InetAddress unit tests

* Fix compile errors

* Get core tests running, not passing

* Sign with js

* Fix PSBTUnitTest

* Fix PBKDF2 for JS

* Use bcrypto's secp256k1 instead of ecdsa

* Fix 2.12.12 compile

* Core tests passing :)

* Test corejs
2021-03-31 15:04:30 -05:00
benthecarman
07514e2348 Remove logging from core (#2810)
* Remove logging from core

* Remove slf4j from testkit core

* Remove logback from coretest
2021-03-21 19:11:55 -05:00
Aris
85087b0f70 Refactoring chain (#2662) 2021-02-13 14:10:40 -06:00
Chris Stewart
8f958bf5d9 Update scalafmt (#2619) 2021-02-03 16:37:12 -06:00
benthecarman
e10e278aa4 Add walletinfo rpc (#2546)
* Add walletinfo rpc

* Move rootXpub to key manager obj

* Make configuration keys for getinfo the same as the ones in our configuration files

* Cleanup

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2021-01-22 13:55:21 -06:00
benthecarman
4fb1c4f954 Make KeyManager return better error messages (#2464)
* Make KeyManager return better error messages

* Increase test coverage

* Refactor

* Create type for raw strings
2021-01-04 12:43:55 -06:00
Ben Carman
559bebbdbe Import Seed cli commands (#2376)
* Import Seed cli commands

* Respond to review
2020-12-21 06:53:20 -06:00
Chris Stewart
97d4ec8490 Remove CompatEither, it was needed for historical purposes to support… (#2394)
* Remove CompatEither, it was needed for historical purposes to support Scala 2.11.x

* Revert files from another change
2020-12-18 09:51:28 -06:00
Ben Carman
52ef1fa185 Add ability to store ExtPrivateKey instead of Mnemonic (#2372)
* Add ability to store ExtPrivateKey instead of Mnemonic

* Use private vals, change name

* Fix docs

* private to km

* Correct scaladocs
2020-12-17 13:25:04 -06:00
Ben Carman
1225584526 Multi Wallet support (#2345)
* 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
2020-12-16 17:27:56 -06:00
Chris Stewart
af4a0baf2d Mask BIP39 password in the BIP39KeyManager (#2350)
* Mask BIP39 password in the BIP39KeyManager

* Add toString test
2020-12-11 16:15:44 -06:00
Ben Carman
fdb2b675e9 Create KeyManagerAppConfig (#2268)
* Create KeyManagerAppConfig

* Fix name

* Use module name
2020-11-19 06:23:26 -06:00
Ben Carman
c29b787ab5 Add ability to change aes password (#2254)
* Add ability to change aes password

* Add docs

* Rename, add logs + tests
2020-11-15 08:07:49 -06:00
Ben Carman
47a38f88db Make aesPassword option for wallet config (#2217)
* Make aesPassword option for wallet config

* Add to docs

* Make AesPassword optional

* Small touchups

* Fix for oracle server

* Fix docs

* Increase code coverage
2020-11-06 07:00:18 -06:00
Ben Carman
2d34e2b690 Move DLC Oracle module to master (#2083) 2020-09-29 19:48:02 -05:00
Ben Carman
1e3aee55c3 Merge pull request #2019
* Refactor logging to only use grizzled slf4j

* Fix docs

* test travis config change
2020-09-19 14:09:12 -05:00
Chris Stewart
955978f635 Apply string factory to a bunch of easy things (#1891)
* Apply string factory to a bunch of easy things

* Refactor HDPath, ExtKey, and LnTagPrefix to use StringFactory

* Implemen StringFactory on LnHumanReadablePart, ScriptType, ServiceIdentifier

* Implement StringFactory on AesCrypt, NodeUri, AddressTag, PSBT, TxoState

* Fix failing tests, fix website compile

* Apply StringFactory to all ScriptOperations, ChannelState, Script Parsing
2020-08-25 10:48:37 -05:00
Ben Carman
cfde581d0c Move all remaining wallet db representations (#1885) 2020-08-24 13:13:52 -05:00
Ben Carman
d187834e1a Create KeyManager Api & move SpendingInfoDb to core (#1848)
* Create KeyManager Api & move SpendingInfoDb to core

* Fix docs, remove sealed form KeyManagerApi

* Move SpendingInfoDb to core wallet api
2020-08-21 14:37:12 -05:00
Nadav Kohen
faf2e0148a Fix All Loggers! (#1695)
* Fixed logging so that appenders are always started when logging is happening

* Started rolling policy so that file appenders could start in getLoggerImpl
2020-07-28 07:13:38 -05:00
Ben Carman
16dd256716 Override correct equals functions (#1621)
* Override correct equals functions

* Remove no longer needed function
2020-07-06 06:37:19 -05:00
Scala Steward
97a4886c6e Update scalafmt-core to 2.6.0 (#1579)
* Update scalafmt-core to 2.6.0

* Upgrade scalafmt, fix all formatting errors

* Scalafmt on 2.12

* fix test

* More fixes

Co-authored-by: Ben Carman <benthecarman@live.com>
2020-06-19 10:38:12 -05:00
Ben Carman
b561e47d6b Implement KeyManagerLogger (#1386) 2020-05-28 13:06:50 -05:00
Nadav Kohen
a503441619 Crypto Project Refactor (#1380)
* Added crypto project and decoupled BitcoinSLogger from NetworkElement

Decoupled BitcoinSLogger from Factory

Moved NetworkElement into crypto project

Moved Factory and BitcoinSUtil (renamed to BytesUtil) to crypto project

Moved MaskedToString to crypto project

Added BytesUtil to imports and cleaned up CryptoUtil.recoverPoint

Moved the rest of crypto stuff to the crypto project

Moved crypto tests to crypto-test project

* Added documentation for crypto project
2020-04-30 12:34:53 -05:00
Ben Carman
6d7685b76e Add wallet creation time for rescans (#1353)
* Add wallet creation time for rescans

* Fix docs

* Clean up and add test

* Remove account bday

* Fix compile issue and docs

* Add more chain handler tests

* Use Instant over Long, add docs

* Fix docs
2020-04-29 09:49:41 -05:00
Chris Stewart
5eef801813 Fix hardcoded network for the default wallet account (#1277)
* Fix hardcoded network for the default wallet account

* Refactor call to HDUtil.getCoinType()
2020-03-30 12:30:48 -05:00
Nadav Kohen
90c56fff7e Added server handling for empty account tables while a seed exists (#1094)
* Added server handling for empty account tables while a seed exists

* Add test coverage to key-manager

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2020-02-09 11:14:53 -06:00
Chris Stewart
55f168f920 Implement abililty to use BIP39 password. This means this password ne… (#990)
* Implement abililty to use BIP39 password. This means this password needs to be password through our various projects to be able to correctly generate the key that controls the wallet. This also renames 'CreateKeyManagerApi' -> 'BIP39CreateKeymanagerApi' as the bip39 password is needed when creating the KeyManager

* Add bip39 password to BIP39KeyManager.fromParams(), fix mdocs

* Fix bug in unit test were whe weren't specifying password

* Fix rebase issues
2020-01-03 11:03:45 -06:00
rorp
93c02f02d0 Automated wallet recovery (#985)
* Automated wallet recovery

* responded to the PR comments

* some more changes

* fix docs

* cleanup
2020-01-02 13:18:41 -06:00
Chris Stewart
c3fb7c9a67 This creates a subtype BIP39KeyManager and moves all existing KeyMana… (#988)
* This creates a subtype BIP39KeyManager and moves all existing KeyManager functionality to that subtype. We leave a empty 'KeyManager' trait for now

* Fix website docs
2019-12-27 10:09:04 -06:00
Chris Stewart
24ff908240 Move initialization of wallet entropy into the key manager (#966)
* Move initialization of wallet entropy into the key manager

* Enable key-manager in ci, add coverage minimum

* Add coverage minimum for key manager, add KeyManagerParams, start adding KeyManager test harness

* Remove success cases on ADTs, start using Either

* fix import

* Get test coverage to 90%

* Add documentation for key-manager.md, add side bar for key-manager

* Fix wallet.md

* Make seedPath default to baseDatadir, so we don't have a unique seed for every network. Add more documentation

* Address code review

* Address code review from Ben

* Add missing import

* Add more tests for coverage
2019-12-26 19:12:08 -06:00
Chris Stewart
dd4787f2af 2019 11 30 key manager (#904)
* Segregate key manager from wallet

* More consistent naming in build.sbt, run scalafmt

* Add test case making sure we don't overwrite a mnemonic seed

* Add key-manager.md

* Fix compile issues with older scala versions

* Address code review
2019-12-04 07:43:29 -06:00