Commit Graph

38 Commits

Author SHA1 Message Date
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
05894e8c54
2024 05 10 keymanager xsource3 (#5583)
* Get key-manager compiling with -Xsource:3

* Get testkit-core compiling with -Xsource:3
2024-05-10 18:44:11 -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
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
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
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
1959495cec Add testkit-core module (#2726)
* 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
2021-03-02 07:05: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
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
Chris Stewart
581d46c2c8 2020 11 02 cleanup (#2233)
* 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
2020-11-03 11:07:04 -06:00
Ben Carman
2d34e2b690 Move DLC Oracle module to master (#2083) 2020-09-29 19:48:02 -05:00
Ben Carman
82b324f1aa Increase test coverage in WalletStorage (#2030) 2020-09-18 06:34:13 -05:00
Ben Carman
db852e4ffb Increase code coverage in key manager (#2024) 2020-09-16 15:05:19 -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
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
040730cd31 Increase Key Manager test coverage (#1465) 2020-05-26 06:13:01 -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
2a785388bf Create KeyManagerTestUtil.bip39PasswordNonEmpty for test case that requires non empty password (#1373) 2020-04-27 13:41:18 -05:00
Chris Stewart
c30efd4919 Add testkit md (#1234)
* Add testkit md

* Address ben's code review

* Fix links
2020-03-15 12:39:43 -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
f8a21201ac Run test:scalafmt, and enforce it on CI (#1023)
* Run test:scalafmt, and enforce it on CI

* Run test:scalafmt
2020-01-23 14:46:57 -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
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