Update rust-bitcoin
authorMatt Corallo <git@bluematt.me>
Fri, 15 Jan 2021 01:57:56 +0000 (20:57 -0500)
committerMatt Corallo <git@bluematt.me>
Fri, 26 Feb 2021 20:15:18 +0000 (15:15 -0500)
12 files changed:
background-processor/Cargo.toml
fuzz/Cargo.toml
lightning-block-sync/Cargo.toml
lightning-c-bindings/Cargo.toml
lightning-c-bindings/src/c_types/mod.rs
lightning-net-tokio/Cargo.toml
lightning-persister/Cargo.toml
lightning/Cargo.toml
lightning/src/lib.rs
lightning/src/ln/onion_route_tests.rs
lightning/src/util/ser.rs
lightning/src/util/test_utils.rs

index 71fbbbff83f0929818dd3a02371266aee91addc2..1a4dc488436bbf3d3450d50087cff6bf7f6468b7 100644 (file)
@@ -7,7 +7,7 @@ edition = "2018"
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 
 [dependencies]
-bitcoin = "0.24"
+bitcoin = "0.26"
 lightning = { version = "0.0.12", path = "../lightning", features = ["allow_wallclock_use"] }
 lightning-persister = { version = "0.0.1", path = "../lightning-persister" }
 
index cb5d40eaa5837500fccd0e3201ed2feb1b31fb41..99ed288f185be2c6f3942b08ae6d87280eb690f2 100644 (file)
@@ -19,7 +19,7 @@ stdin_fuzz = []
 [dependencies]
 afl = { version = "0.4", optional = true }
 lightning = { path = "../lightning", features = ["fuzztarget"] }
-bitcoin = { version = "0.24", features = ["fuzztarget"] }
+bitcoin = { version = "0.26", features = ["fuzztarget"] }
 hex = "0.3"
 honggfuzz = { version = "0.5", optional = true }
 libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git", optional = true }
index aec6d1404c098f0fe4b58b6af73ba40e6299e503..c454de395e27d1c5bb95034ca5f5a6318c134ca6 100644 (file)
@@ -13,7 +13,7 @@ rest-client = [ "serde", "serde_json", "chunked_transfer" ]
 rpc-client = [ "serde", "serde_json", "chunked_transfer" ]
 
 [dependencies]
-bitcoin = "0.24"
+bitcoin = "0.26"
 lightning = { version = "0.0.12", path = "../lightning" }
 tokio = { version = "1.0", features = [ "io-util", "net" ], optional = true }
 serde = { version = "1.0", features = ["derive"], optional = true }
index 6bde30475f93382ffe58d0f0df3eaf63a580d57f..7c569abc7e35868e0a96f9fa79f4206270000666 100644 (file)
@@ -15,7 +15,7 @@ crate-type = ["staticlib"
 ,"cdylib"]
 
 [dependencies]
-bitcoin = "0.24"
+bitcoin = "0.26"
 lightning = { version = "0.0.12", path = "../lightning" }
 
 # We eventually want to join the root workspace, but for now, the bindings generation is
index 074aef25e84089698864306680aab11136adbe65..0a96f3e7d6789d0ad0be381022db26bb78b727ed 100644 (file)
@@ -72,8 +72,8 @@ pub enum Secp256k1Error {
        InvalidSecretKey,
        InvalidRecoveryId,
        InvalidTweak,
+       TweakCheckFailed,
        NotEnoughMemory,
-       CallbackPanicked,
 }
 impl Secp256k1Error {
        pub(crate) fn from_rust(err: SecpError) -> Self {
@@ -85,6 +85,7 @@ impl Secp256k1Error {
                        SecpError::InvalidSecretKey => Secp256k1Error::InvalidSecretKey,
                        SecpError::InvalidRecoveryId => Secp256k1Error::InvalidRecoveryId,
                        SecpError::InvalidTweak => Secp256k1Error::InvalidTweak,
+                       SecpError::TweakCheckFailed => Secp256k1Error::TweakCheckFailed,
                        SecpError::NotEnoughMemory => Secp256k1Error::NotEnoughMemory,
                }
        }
index 9165388066da3082f6e427bb6664c3dcb08bd2ff..587fe1b12a913798c5cf6e2511a82f1f4f9336ef 100644 (file)
@@ -10,7 +10,7 @@ For Rust-Lightning clients which wish to make direct connections to Lightning P2
 """
 
 [dependencies]
-bitcoin = "0.24"
+bitcoin = "0.26"
 lightning = { version = "0.0.12", path = "../lightning" }
 tokio = { version = "1.0", features = [ "io-util", "macros", "rt", "sync", "net", "time" ] }
 
index d8be01c926b5d649b7f5955dbab14a325c63e2d4..fa71dc0d4dd9e9e0ac67e0acfd0014abd2aa8215 100644 (file)
@@ -8,7 +8,7 @@ Utilities to manage channel data persistence and retrieval.
 """
 
 [dependencies]
-bitcoin = "0.24"
+bitcoin = "0.26"
 lightning = { version = "0.0.12", path = "../lightning" }
 libc = "0.2"
 
@@ -16,7 +16,7 @@ libc = "0.2"
 winapi = { version = "0.3", features = ["winbase"] }
 
 [dev-dependencies.bitcoin]
-version = "0.24"
+version = "0.26"
 features = ["bitcoinconsensus"]
 
 [dev-dependencies]
index 0b51a3992731636736917d3ebcde7e37215d5b38..f02813bfd3c2bbfa64365aef65f128cf77ec130c 100644 (file)
@@ -27,13 +27,13 @@ unsafe_revoked_tx_signing = []
 unstable = []
 
 [dependencies]
-bitcoin = "0.24"
+bitcoin = "0.26"
 
 hex = { version = "0.3", optional = true }
 regex = { version = "0.1.80", optional = true }
 
 [dev-dependencies.bitcoin]
-version = "0.24"
+version = "0.26"
 features = ["bitcoinconsensus"]
 
 [dev-dependencies]
index 7310a49aef53ac6f1432df78c0e04103002836ab..567a7e18687abef37c6c1939e892684304d40512 100644 (file)
@@ -19,7 +19,7 @@
 //! instead of having a rather-separate lightning appendage to a wallet.
 
 #![cfg_attr(not(any(feature = "fuzztarget", feature = "_test_utils")), deny(missing_docs))]
-#![forbid(unsafe_code)]
+#![cfg_attr(not(any(test, feature = "fuzztarget", feature = "_test_utils")), forbid(unsafe_code))]
 
 // In general, rust is absolutely horrid at supporting users doing things like,
 // for example, compiling Rust code for real environments. Disable useless lints
index bf2709cded67badeb799e261e66c324bbf1c3c46..551db24e9d7786f0a85816c00de8736dec8bcf6b 100644 (file)
@@ -219,7 +219,7 @@ impl msgs::ChannelUpdate {
                use bitcoin::secp256k1::ffi::Signature as FFISignature;
                use bitcoin::secp256k1::Signature;
                msgs::ChannelUpdate {
-                       signature: Signature::from(FFISignature::new()),
+                       signature: Signature::from(unsafe { FFISignature::new() }),
                        contents: msgs::UnsignedChannelUpdate {
                                chain_hash: BlockHash::hash(&vec![0u8][..]),
                                short_channel_id: 0,
index 1d24e26408fba830603cb3f95b9b4bbd20354d57..b718e228c93e8233ce799e7fa10c90b26cd89b9d 100644 (file)
@@ -707,8 +707,7 @@ macro_rules! impl_consensus_ser {
                        fn write<W: Writer>(&self, writer: &mut W) -> Result<(), ::std::io::Error> {
                                match self.consensus_encode(WriterWriteAdaptor(writer)) {
                                        Ok(_) => Ok(()),
-                                       Err(consensus::encode::Error::Io(e)) => Err(e),
-                                       Err(_) => panic!("We shouldn't get a consensus::encode::Error unless our Write generated an std::io::Error"),
+                                       Err(e) => Err(e),
                                }
                        }
                }
index afc6e598e76edccffdfe022c04d693a6f78ad0d6..fb54299fb3f73b5faadbce347f5ed0c99486ddbe 100644 (file)
@@ -253,12 +253,14 @@ fn get_dummy_channel_announcement(short_chan_id: u64) -> msgs::ChannelAnnounceme
                excess_data: Vec::new(),
        };
 
-       msgs::ChannelAnnouncement {
-               node_signature_1: Signature::from(FFISignature::new()),
-               node_signature_2: Signature::from(FFISignature::new()),
-               bitcoin_signature_1: Signature::from(FFISignature::new()),
-               bitcoin_signature_2: Signature::from(FFISignature::new()),
-               contents: unsigned_ann,
+       unsafe {
+               msgs::ChannelAnnouncement {
+                       node_signature_1: Signature::from(FFISignature::new()),
+                       node_signature_2: Signature::from(FFISignature::new()),
+                       bitcoin_signature_1: Signature::from(FFISignature::new()),
+                       bitcoin_signature_2: Signature::from(FFISignature::new()),
+                       contents: unsigned_ann,
+               }
        }
 }
 
@@ -266,7 +268,7 @@ fn get_dummy_channel_update(short_chan_id: u64) -> msgs::ChannelUpdate {
        use bitcoin::secp256k1::ffi::Signature as FFISignature;
        let network = Network::Testnet;
        msgs::ChannelUpdate {
-               signature: Signature::from(FFISignature::new()),
+               signature: Signature::from(unsafe { FFISignature::new() }),
                contents: msgs::UnsignedChannelUpdate {
                        chain_hash: genesis_block(network).header.block_hash(),
                        short_channel_id: short_chan_id,