Commit graph

70 commits

Author SHA1 Message Date
Matt Corallo
a51d5cef58 Update rust-bitcoin 2021-02-26 15:15:18 -05:00
Valentine Wallace
12c735ab3a
Add PersistenceNotifier to ChannelManager
This will allow the ChannelManager to signal when it has new
updates to persist, and adds a way for ChannelManager persisters
to be notified when they should re-persist the ChannelManager
to disk/backups.

Feature-gate the wait_timeout function because the core
lightning crate shouldn't depend on wallclock time unless
users opt into it.
2021-02-19 15:00:43 -05:00
Matt Corallo
2ae6b3fad4 Add a trivial benchmark of calculating routes on today's graph
Sadly rust upstream never really figured out the benchmark story,
and it looks like the API we use here may not be long for this
world. Luckily, we can switch to criterion with largely the same
API if that happens before upstream finishes ongoing work with the
custom test framework stuff.

Sadly, it requires fetching the current network graph, which I did
using Val's route-testing script written to test the MPP router.
2021-02-15 16:51:51 -05:00
Matt Corallo
c07b4de983 Expose test_utils to fuzztarget (in addition to _test_utils feature) 2021-01-04 12:40:40 -05:00
Devrandom
2de29ae049 Introduce CommitmentTransaction, ChannelTransactionParameters
CommitmentTransaction maintains the per-commitment transaction fields needed to construct the associated bitcoin transactions (commitment, HTLC).  It replaces passing around of Bitcoin transactions.  The ChannelKeys API is modified accordingly.

By regenerating the transaction when implementing a validating external signer, this allows a higher level of assurance that all relevant aspects of the transactions were checked for policy violations.

ChannelTransactionParameters replaces passing around of individual per-channel fields that are needed to construct Bitcoin transactions.

Eliminate ChannelStaticData in favor of ChannelTransactionParameters.

Use counterparty txid instead of tx in channelmonitor update.
2020-12-30 13:40:18 -08:00
Matt Corallo
4aa8e9cda7 Bump version to 0.0.12 2020-11-24 16:35:20 -05:00
Valentine Wallace
4350cc615c
Put test utilities behind a feature flag.
The utilities will still be part of cfg(test). The purpose of this
is to enable other crates in the workspace to use the test utilities.
2020-10-16 11:30:33 -04:00
Matt Corallo
b9707da138 Update to latest upstream rust-bitcoin 2020-09-10 16:20:01 -04:00
Devrandom
ce0cecd50a export "unsafe_revoked_tx_signing" feature
Allows unsafe signing in dev code, such as functional testing of
justice transactions outside our crate.
2020-08-11 09:23:31 +02:00
joe.miyamoto
1fc6d6b5ee
Improve error message.
... for ChannelError and APIMisuseError
Before this commit, When rl returns error, we don't know
The actual parameter which caused the error.
By returning parameterised `String` instead of predefined `&'static str`,
We can give a caller improved error message.

TestLogger now has two additional methods
1. `assert_log_contains` which checks the logged messsage
  has how many entry which includes the specified string as a substring.
2. `aasert_log_regex` mostly the same with `assert_log_contains`
  but it is more flexible that caller specifies regex which has
  to be satisfied instead of just a substring.
For regex, tests now includes `regex` as dev-dependency.
2020-07-22 10:34:47 +09:00
Jeffrey Czyz
43eed8dd8b
Make test output deterministic
Tests use sources of randomness to produce seeds, preimages, secrets,
and ephemeral data. However, this makes comparing logs between different
test runs difficult. Remove uses of random number generators and the
current time in favor of fixed values in order to make the test output
deterministic.
2020-06-18 19:28:50 -07:00
Gleb Naumenko
6164a95267 Remove non-bitcoin chain helpers 2020-05-12 09:27:11 -04:00
Dr. Maxim Orlovsky
27079e04d7 Adopting new bitcoin hash types and crate version 2020-04-29 12:37:46 +02:00
Dr. Maxim Orlovsky
eff8af2110 BDR: Linearizing secp256k1 deps 2020-04-28 16:17:44 +02:00
Dr. Maxim Orlovsky
4909d3cd6a Bitcoin deps refactoring (BDR): Linearizing bitcoin_hash deps 2020-04-28 16:17:42 +02:00
Matt Corallo
8b18d906bb Bump versions to 0.0.11/net-tokio 0.0.3 2020-04-24 22:10:00 -04:00
Matt Corallo
1e52786e1c Bump versions to 0.0.10 2019-12-11 18:17:54 -05:00
Matt Corallo
6fc775da45 Bump bitcoin dep to 0.21 2019-12-11 18:17:54 -05:00
Matt Corallo
a62e96bcd9 Move test profile to crate root, so it has effect again 2019-11-28 01:21:41 -05:00
RJ Rybarczyk
88fef649b1 Use workspaces to separate crates 2019-11-15 02:44:30 +00:00