]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Update rust-bitcoin 2021-01-bindings-no-generics
authorMatt Corallo <git@bluematt.me>
Fri, 15 Jan 2021 01:57:56 +0000 (20:57 -0500)
committerMatt Corallo <git@bluematt.me>
Thu, 28 Jan 2021 04:04:12 +0000 (23:04 -0500)
fuzz/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 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 3d073d65984c851976405d99b59b77ba6640e711..2d4155e9a1ccacf3aa2979dfd4f0422106fa7d56 100644 (file)
@@ -15,7 +15,7 @@ crate-type = ["staticlib"
 ,"cdylib"]
 
 [dependencies]
-bitcoin = "0.24"
+bitcoin = "0.26"
 lightning = { version = "0.0.12", path = "../lightning" }
 
 # Always force panic=abort, further options are set in the genbindings.sh build script
index d9ed5ca51c54de5cf6f4b315a4337630f07c8e67..6fbbcd55f31d1157f5b3e2be6281aecfaffe0ebf 100644 (file)
@@ -71,8 +71,8 @@ pub enum Secp256k1Error {
        InvalidSecretKey,
        InvalidRecoveryId,
        InvalidTweak,
+       TweakCheckFailed,
        NotEnoughMemory,
-       CallbackPanicked,
 }
 impl Secp256k1Error {
        pub(crate) fn from_rust(err: SecpError) -> Self {
@@ -84,6 +84,7 @@ impl Secp256k1Error {
                        SecpError::InvalidSecretKey => Secp256k1Error::InvalidSecretKey,
                        SecpError::InvalidRecoveryId => Secp256k1Error::InvalidRecoveryId,
                        SecpError::InvalidTweak => Secp256k1Error::InvalidTweak,
+                       SecpError::TweakCheckFailed => Secp256k1Error::TweakCheckFailed,
                        SecpError::NotEnoughMemory => Secp256k1Error::NotEnoughMemory,
                }
        }
index 50634bd32df2ce4be3263a232feea74cb7f1b36a..e9c08f896be9fcce12eaadd8ccd39d2bb722502c 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 = ">=0.2.12", features = [ "io-util", "macros", "rt-core", "sync", "tcp", "time" ] }
 
index 63b69a1e166667118ffd2933797963232554e22b..aad7879f8c4b3f6240d5671ba04f867fa7bc8f59 100644 (file)
@@ -8,12 +8,12 @@ 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"
 
 [dev-dependencies.bitcoin]
-version = "0.24"
+version = "0.26"
 features = ["bitcoinconsensus"]
 
 [dev-dependencies]
index 016399f882f438a0fd56eaa095c44dccb0d75847..7fef2e98de2a6011ffcb900aaa7dc2f830ab8673 100644 (file)
@@ -25,13 +25,13 @@ max_level_debug = []
 unsafe_revoked_tx_signing = []
 
 [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 e466205c97c83a9ad854c6aad71d52db6817848c..8cb40fc78f0f23ce4843c12c30e5b2deb0f045cb 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 581f228ba7574323180cf662581425e301d74aab..815895578ea3e610333be7e9947ae87e533115f3 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 3680a7245575f18bae0172604c1da12db053a972..571bb0a6113d095a9fb19c48d7e6f384b93654cb 100644 (file)
@@ -233,6 +233,7 @@ impl events::MessageSendEventsProvider for TestChannelMessageHandler {
        }
 }
 
+
 fn get_dummy_channel_announcement(short_chan_id: u64) -> msgs::ChannelAnnouncement {
        use bitcoin::secp256k1::ffi::Signature as FFISignature;
        let secp_ctx = Secp256k1::new();
@@ -252,20 +253,20 @@ fn get_dummy_channel_announcement(short_chan_id: u64) -> msgs::ChannelAnnounceme
                excess_data: Vec::new(),
        };
 
-       msgs::ChannelAnnouncement {
+       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,
-       }
+       } }
 }
 
 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,