1
0
Fork 0
mirror of https://github.com/bitcoin-s/bitcoin-s.git synced 2025-03-21 06:22:21 +01:00
Commit graph

143 commits

Author SHA1 Message Date
Chris Stewart
7045fdb099
Add peers section to the example configuration () 2020-01-23 14:45:18 -06:00
Nadav Kohen
d858df743d
PSBT Support ()
* PSBT Serialization/Deserialization ()

* PSBT Serialization and Deserialization

* Remove debug code

* Create PSBTParseResult, Add more psbt test cases, and various small nits

* PSBT version checking

* Remove PSBTHelper, give PSBTRecord and PSBTMap a fromBytes

* Fix compile issue, preserve ADT

* PSBT Combiner

* PSBT Updater

* Fix PSBT version number to be read as little endian

* Make function names more clear, add scaladoc, require not finalized

* Combiner scaladocs

* Test case from BIP

* Make compatible with older versions

* PSBT: Fix for EmptyWitness changes ()

* PSBTInputMap to UTXOSigningInfo

* Remove vars

* Add missing param

* Fix byteVectorOrdering for when x == y

* getUTXOSpendingInfo Tests

* Fix formatting errors

* Give conditional path default value

* formatting fix

* Fixed InputPSBTRecord.FinalizedScriptSig using asmBytes ()

* Fixed PSBTTest after rebasing onto master

* PSBT Constructors and Extraction ()

* Added PSBT constructors

* Revived option to use signers in toUTXOSpendingInfo

* Added transaction extraction

* Responded to code review

* Added extraction test from BIP

* Added validation (option) to PSBT extraction

* Added property based test for PSBT.extractTransactionAndValidate

* Marked PSBT as new code for PropertyCheckConfiguration

* PSBT Finalizer ()

* Added finalizing functionality to PSBTs

* Cleaned things up

* Added finalizer test, fails

* Check that PSBT is not already finalized when finalizing PSBT

* Added P2PKWithTimeout cases

* Formatting fix

* PSBT Generators ()

* Introduced non-finalized constructor

* Added property based test comparing finalized and un-finalized construction, it currently fails due to EmptyScriptPubKey not being supported in various ways. Also fixed a ton of bugs!

* Fixed easy bugs relating to EmptyScriptPubKey, one is left

* Fixed the last bugs (multisig order and 0-of-n stuff) and now tests pass!

* Separated out direct finalized PSBT construction from non-finalized PSBT construction

* Translated construction work in tests into PSBT generators

* Added serialization symmetry test

* Made PSBT fee generation dependent on other generators to ensure low enough fees for signing

* Responded to code review

* Added scaladocs

* Fixed arbitraryPSBT to work with older scala versions

* Fixed PSBT compilation breakages from rebase

* Fixed test breakages from rebase

* Validate the PSBT unknown is not a known field

* Increase code coverage on PSBT tests

* Address review

* formatting

* Add error messages, rename function

* Psbt Signer ()

* PSBT Signer

* Create addSignature function for PSBTs

* Use PartialSignature instead of Tuple

* Create extra util functions

* scaladoc and simplify case

* Formatting fix for psbt scaladocs

* Clean up code, add error messages, and scaladoc

* add type hints

* Change InputPSBTMap.fromUTXOSpendingInfo to use BitcoinSingleSigner

* optimize import

* Define separator byte for psbt map

* getRecords simplification

* remove braces, add error message

* PSBT stuff assigned to nkohen ()

* Responded to psbt review assigned to me

* Moved separatorByte to a place where all can use it

* PSBT independent record calls ()

* PSBT independent record calls

* move logic to super class

Co-authored-by: Nadav Kohen <nadavk25@gmail.com>

* Reworked PSBT finalization to return a Try[PSBT] rather than an Option[PSBT] ()

* PSBT signer property based tests ()

* PSBT property based tests

* Address review

* PSBT Combiner property based tests ()

* PSBT Combiner property based tests

* Create pruneGlobal util function

* Switch to arbitrary gen

* Use BaseTransaction instead of Transaction

* Fix transaction witness to work from base transactions

* PSBTs response to Chris's review ()

* PSBT chris's review

* Rename val, give master fingerprint a val

* Formatting fix

* Responded to code review from chris assigned to nkohen

* Split PSBT.scala into many files

* PSBT Docs ()

* PSBT docs

* Fix compiler error, remove nesting

* PSBT output updater tests

* Validate psbt outputs

* Clean up code

* Remove P2WPKHWitnessV0 addition

* format

* PSBT Updater property based tests

* Move code to match block

* EmptyScriptWitness check

* Address nadav review

* Remove unnecessary code, make utxo adder better

* Move require and add error message

* Move require

* PSBT unit tests by Ben

* Change to EmptyScriptPubKey

* Added unit tests to increase code coverage

* responded to review

* Move PSBT unit test to separate file

* Make unknown generator only generate distinct records

* Use groupBy key instead of distinct

* use only first element

* Combine distinctness by key

Co-authored-by: Ben Carman <benthecarman@live.com>
2020-01-23 11:36:42 -07:00
rorp
fd6503ef8d
Eclair performance tests ()
* Eclair performance tests

* some more changes

* fix unit tests

* scaladoc

* limit number of payment requests

* fix build errors
2020-01-21 12:54:15 -08:00
Chris Stewart
bc9a25b47f
2020 1 11 accounts ()
* Create 'fundRawTransaction' and 'fundRawTransactionInternal'

* Move TransactionTestUtil to testkit, begin writing tests for fundrawtransaction

* Add FundTransactionTests

* Move things to 'FundTransactionHandling' trait

* Start segregating things by HDAccount in the wallet, this gives us the ability to query for balances based on account, fund a transaction based on an account, generate a new address based on an account etc. All old api calls are now based on the default account, i.e. getBalance() returns the balance for account 0, fundRawTransaction funds the transaction from account 0 etc.

* Fix compile issue with 2.11.x

* Bump address generation Thread.sleep() to 500ms

* Address ben code review

* Address code review
2020-01-21 14:20:58 -06:00
Nadav Kohen
7512ca35d1
Updated P2PKWithTimeout to use CSV instead of CLTV () 2020-01-21 12:43:09 -07:00
rorp
3124a1afc5 Merge branch 'master' into eclair_bench 2020-01-21 10:17:20 -08:00
Chris Stewart
cd4a354620
Try bumping the Thread.sleep() to get CI to pass on slow mac osx () 2020-01-19 09:41:54 -06:00
Nadav Kohen
3ffd9888ed
Single Signing ()
* Introduced UTXOSpendingInfoSingle

* Implemented constructors for UTXOSpendingInfoSingle

* Introduced BitcoinSignerSingle

* Implemented SingleSigner

* Added property-based test for SingleSigner, it fails

* Fixed SignerTest :)

* Responded to code review

* Added scaladocs

* Fixed p2sh(p2wsh) signing

* Responded to code review and separated UTXOSpendingInfoSingle from UTXOSpendingInfoFull

* Fixed outputGen after rebase

* Fixed txbuilder.md to show this branch's changes
2020-01-15 10:00:55 -07:00
rorp
bc9f09972a some more changes 2020-01-14 13:53:12 -08:00
Chris Stewart
bf3a89bfdd
2020 1 04 fund raw tx ()
* Create 'fundRawTransaction' and 'fundRawTransactionInternal'

* Move TransactionTestUtil to testkit, begin writing tests for fundrawtransaction

* Add FundTransactionTests

* Move things to 'FundTransactionHandling' trait

* Address code review

* Run scalafmt
2020-01-13 13:45:33 -06:00
rorp
3d1b109ea5 Merge branch 'master' into eclair_bench 2020-01-07 14:23:11 -08:00
rorp
e1acac05eb Eclair performance tests 2020-01-07 10:02:08 -08:00
Chris Stewart
1ad402ea56
Add more expressive txo states for the wallet ()
* Add more expressive txo states for the wallet

* Rename 'PendingReceived/PendingSpent' -> 'UnconfirmedReceived/UnconfirmedSent'

* Address code review

* Fix posInt implementation to work with older scala versions

* Rename to PendingConfirmationReceived/PendingConfirmationSpent
2020-01-05 18:42:20 -06:00
Chris Stewart
039722aedc
Implement abililty to use BIP39 password. This means this password ne… ()
* 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
d776e1c952 Automated wallet recovery ()
* Automated wallet recovery

* responded to the PR comments

* some more changes

* fix docs

* cleanup
2020-01-02 13:18:41 -06:00
Chris Stewart
25916ac6f2
This creates a subtype BIP39KeyManager and moves all existing KeyMana… ()
* 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
8fb1716b1c
Move initialization of wallet entropy into the key manager ()
* 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
Ben Carman
34a3efdcf9 Change ScriptPubKey to RawScriptPubKey in ScriptWitness () 2019-12-24 07:45:55 -06:00
rorp
a31066d17e
Move rescan logic from node to wallet ()
* Move rescan logic from node to wallet
2019-12-23 08:57:55 -08:00
Nadav Kohen
74f7f73797 P2PKWithTimeoutSPK ()
* Introduced P2PKWithTimeoutSPK

* Responded to review

* Added some testing for cltv and p2pkWithTimeout SPKs

* Responded to more review
2019-12-19 09:48:00 -06:00
Chris Stewart
62f2b19515
Refactor make dependent fixtures to use built in scalatest helper met… ()
* Refactor make dependent fixtures to use built in scalatest helper methods

* Avoid unit return warning
2019-12-15 18:25:51 -06:00
rorp
b92fc1cb8f
Compute confirmations dynamically ()
* Compute confirmations dynamically
2019-12-14 12:06:22 -08:00
rorp
fd64c42b69
Add a reference to ChainQueryApi to the wallet ()
* Add reference to ChainQueryApi to wallet
2019-12-10 14:22:33 -08:00
Chris Stewart
ade8bea831
2019 12 10 scalatest 3.1.0 ()
* Update scalatest to 3.1.0

* Modify code to support scalatest 3.1.0
2019-12-10 09:12:47 -06:00
rorp
7cfd33b753 ChainQueryApi ()
* ChainQueryApi

* cleanup
2019-12-09 09:39:35 -06:00
rorp
a752c5301f
Neutrino Wallet: OnCompactFilter handler ()
* Neutrino Wallet: OnCompactFilter handler
2019-12-06 13:10:33 -08:00
Ben Carman
858138fa85 Bitcoind v19 RPC ()
* bitcoind v19 new RPC calls and tests ()

* bitcoind v19 new RPC calls and tests

* Code review changes

* Review part 2

* Rename variable to be more descriptive

* Explanitory comment

* Ignore broken test cases

* Add missing signing functions

* Add test to check avoid_reuse flag is on ()

* Add test to check avoid_reuse flag is on

* Add test to make sure flags weren't set

* bitcoind v19 Update mempool RPCs and tests ()

* Update mempool RPC calls to bitcoind v19 compatibility

* Typo fix

* Add parameter name to calls

* Fix remaining rpc calls

* Formatting

* scaladoc for param

* Change param to correct type

* Clarify on scaladoc

* Add missing fees parmater to mempool rpcs ()

* Add weight field to mempool entries after v19 ()

* Move DescriptorRpc to be able to be used by future versions of bitcoind ()

* Add window_final_block_height to GetChainTxStatsResult ()

* Add passphrase argument to createwallet for later versions ()

* Add passphrase argument to createwallet for later versions

* Scaladoc + empty passphrase requirement

* Error message

* Add new services names parameter to P2P rpcs ()

* Add new services names parameter to P2P rpcs

* Add ServiceIdentifier Reads

* Add fallback case

* Address review

* Change to Try

* Move PsbtRpc to be able to be used by future versions of bitcoind ()

* Move PsbtRpc to be able to be used by future versions of bitcoind

* Add test

* Address comment

* Enable bloom filters for v19

* Enable bip 61 for tests

* Change to official binaries

* Force v18 for Spv Tests

* Remove unused config line
2019-12-04 07:44:44 -06:00
Chris Stewart
72097e31bd
2019 11 30 key manager ()
* 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
Nadav Kohen
3183f17ce2 BitcoinTxBuilderTest Hang ()
* Fix hanging bug in BitcoinTxBuilderTest

* Added forAllAsync to BitcoinSAsyncTest
2019-12-02 13:04:58 -06:00
rorp
9e677b602d [Neutrino] Update balances ()
* [Neutrino] Update balances

* responded to the comments

* some more changes
2019-11-27 16:00:19 -06:00
Nadav Kohen
b89d20e9a8 Moved BitcoinTxBuilder property tests into ScalaTest context, fixed bug where opPushData was marking valid short P2SH scripts as invalid () 2019-11-27 13:51:49 -06:00
Nadav Kohen
15ec7b89b6 Nicer Satoshis.apply ()
* Replaced Satoshis(Int64(_)) with Satoshis(_)

* Fixed SignerTest
2019-11-26 14:43:14 -06:00
rorp
43ec85af39 Rescan RPC ()
* Rescan RPC

* cleanup

* fix optional args

* cleanup

* unit tests

* fix build error

* fix unit tests

* scalaMock

* cleanup

* more unit tests

* some more validation checks
2019-11-21 08:03:32 -06:00
Nadav Kohen
306699ba8a MultiSignatureWithTimeoutScriptPubKey ()
* Added MultiSignatureWithTimeoutScriptPubKey

* Renamed If and NotIf to NonStandardIf and NonStandardNotIf and removed multiple representations

* Added MultiSignatureScriptPubKey to CreditingTxGenerators

* Responded to code review

* Fixed UTXOSpendingInfoTest
2019-11-18 15:08:50 -06:00
Nadav Kohen
254828e94e OP_NOTIF ScriptPubKey and Signing ()
* Implemented OP_NOTIF

* Responded to code review

* Fixed test bug for sampling
2019-11-18 10:45:33 -06:00
Nadav Kohen
4355543709 Conditional Signing Tests ()
* Added ConditionalScriptPubKeys to CreditingTxGen so that we are actually testing Conditional signing now

* Responded to code review

* Renamed scriptPubKeyTooBig => redeemScriptTooBig
2019-11-15 14:26:21 -06:00
Nadav Kohen
3c7fd6c34a Nested OP_IF ScriptPubKey and signing ()
* Enabled nested conditional parsing

* Added nested conditionals to tests

* Responded to code review
2019-11-13 15:44:35 -06:00
rorp
73c734ff24 Fix monitorInvoice unit test ()
* Fix monitorInvoice unit test

* more logs

* even more logging

* fix build error

* custom eclair jar

* custom eclair

* more logging

* remove println's

* more logging

* more logging

* fix 'payment expiry is too close to the current block height'

* pobably the final fix

* cleanup

* fix download URL

* responded to PR comments
2019-11-06 12:42:38 -06:00
Nadav Kohen
38db570e8f OP_IF Signing ()
* Introduced ConditionalScriptPubKey

Some more progress

Added Conditional signing infrastracture, tests do not pass and there are no Conditional tests

Fixed tests!

* Redid calcLockTime and calcSequenceForInputs in TxBuilder (added Conditional support)

* Added ScriptGenerators for Conditional scripts, only one test to go!

* Fixed CLTV(Empty) tests

* Responded to code review

* responded to code review

* ScriptSignature only types Policy-compliant script signatures

* Fixed md doc
2019-11-05 18:48:50 -06:00
Nadav Kohen
3ed4c4aa84 RawScriptPubKey ()
* Introduced RawScriptPubKey type

* Responded to code review
2019-10-31 18:34:48 -05:00
Nadav Kohen
20c42795b8 Replace scriptPubKeyToSatisfy with spendingInfoToSatisfy in Signer ()
* Replace scriptPubKeyToSatisfy with spendingInfoToSatisfy and made UTXOSpendingInfo ADT nicer

Tightened up types on Signer with a type parameter

Factored out common functionality in Signer

Responded to code review

* More review
2019-10-31 12:17:30 -05:00
Nadav Kohen
310ccbb838 Spending Info ADT use ()
* Replaced TxBuilder signAndAddInput match with UTXOSpendingInfo match, tests don't pass

* Fixed tests!
2019-10-30 15:00:41 -05:00
cwaldron97
04edc40b7e (WIP)Changes to client start() ()
* changes to client

fixed daemon flag

yielding bitcoindRPCclient

versioned

more implementation

update

fixed yield error and some documentation

docs + compiler error fix

updated

responding to code review

missing bracket

fixed compiler warnings

fixed compiler warning

* scalafmt
2019-10-30 14:59:35 -05:00
rorp
abaa0581c0 Rescan and fetch blocks ()
* Rescan and fetch blocks

* unit test

* fix log level

* addessed the PR comments

* fix test timeout

* improve unit tests
2019-10-30 09:51:03 -05:00
Nadav Kohen
5454d675f7 Signer UTXOSpendingInfo refactor ()
* Refactored Signer interface to use TxSigComponent and UTXOSpendingInfo

Fixed all the broken things

Replaced TxSigComponent with unsigned Transaction in Signer interface to remove illegal states

* Added p2sh throw case in Signer
2019-10-25 15:40:33 -05:00
rorp
2038faf126 Upgrade to ecalir v0.3.2 ()
* Upgrade to ecalir v0.3.2

* addressed the PR comments

* some more changes

* and some more

* external payment id
2019-10-24 13:19:59 -05:00
rorp
6df467d295 Improve EclairRpcClientTest execution time () 2019-10-23 14:29:48 -05:00
rorp
80c8636308 Disable OSX neurtino tests in CI ()
* Disable OSX neurtino tests in CI

* fix command line

* fix travis config

* revert .travis and mark NeutrinoNodeTest as @DoNotDiscover
2019-10-06 09:30:08 -05:00
rorp
5ec86aef61 Fix bitcoind version for eclair tests () 2019-10-03 13:16:23 -05:00
rorp
27560ac1a5 Make tests to not require pre-installed bitcoind ()
* Make tests to not require pre-installed bitcoind

* update docs
2019-10-01 06:19:11 -05:00