Skip to content

Commit 9d955f7

Browse files
committed
Update rust-bitcoin
1 parent ee68ffa commit 9d955f7

File tree

10 files changed

+16
-15
lines changed

10 files changed

+16
-15
lines changed

fuzz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ stdin_fuzz = []
1919
[dependencies]
2020
afl = { version = "0.4", optional = true }
2121
lightning = { path = "../lightning", features = ["fuzztarget"] }
22-
bitcoin = { version = "0.24", features = ["fuzztarget"] }
22+
bitcoin = { version = "0.26", features = ["fuzztarget"] }
2323
hex = "0.3"
2424
honggfuzz = { version = "0.5", optional = true }
2525
libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git", optional = true }

lightning-c-bindings/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ crate-type = ["staticlib"
1515
,"cdylib"]
1616

1717
[dependencies]
18-
bitcoin = "0.24"
18+
bitcoin = "0.26"
1919
lightning = { version = "0.0.12", path = "../lightning" }
2020

2121
# We eventually want to join the root workspace, but for now, the bindings generation is

lightning-c-bindings/src/c_types/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ pub enum Secp256k1Error {
7272
InvalidSecretKey,
7373
InvalidRecoveryId,
7474
InvalidTweak,
75+
TweakCheckFailed,
7576
NotEnoughMemory,
76-
CallbackPanicked,
7777
}
7878
impl Secp256k1Error {
7979
pub(crate) fn from_rust(err: SecpError) -> Self {
@@ -85,6 +85,7 @@ impl Secp256k1Error {
8585
SecpError::InvalidSecretKey => Secp256k1Error::InvalidSecretKey,
8686
SecpError::InvalidRecoveryId => Secp256k1Error::InvalidRecoveryId,
8787
SecpError::InvalidTweak => Secp256k1Error::InvalidTweak,
88+
SecpError::TweakCheckFailed => Secp256k1Error::TweakCheckFailed,
8889
SecpError::NotEnoughMemory => Secp256k1Error::NotEnoughMemory,
8990
}
9091
}

lightning-net-tokio/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ For Rust-Lightning clients which wish to make direct connections to Lightning P2
1010
"""
1111

1212
[dependencies]
13-
bitcoin = "0.24"
13+
bitcoin = "0.26"
1414
lightning = { version = "0.0.12", path = "../lightning" }
1515
tokio = { version = "1.0", features = [ "io-util", "macros", "rt", "sync", "net", "time" ] }
1616

lightning-persister/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ Utilities to manage channel data persistence and retrieval.
88
"""
99

1010
[dependencies]
11-
bitcoin = "0.24"
11+
bitcoin = "0.26"
1212
lightning = { version = "0.0.12", path = "../lightning" }
1313
libc = "0.2"
1414

1515
[target.'cfg(windows)'.dependencies]
1616
winapi = { version = "0.3", features = ["winbase"] }
1717

1818
[dev-dependencies.bitcoin]
19-
version = "0.24"
19+
version = "0.26"
2020
features = ["bitcoinconsensus"]
2121

2222
[dev-dependencies]

lightning/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ unsafe_revoked_tx_signing = []
2727
unstable = []
2828

2929
[dependencies]
30-
bitcoin = "0.24"
30+
bitcoin = "0.26"
3131

3232
hex = { version = "0.3", optional = true }
3333
regex = { version = "0.1.80", optional = true }
3434

3535
[dev-dependencies.bitcoin]
36-
version = "0.24"
36+
version = "0.26"
3737
features = ["bitcoinconsensus"]
3838

3939
[dev-dependencies]

lightning/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
//! instead of having a rather-separate lightning appendage to a wallet.
2020
2121
#![cfg_attr(not(any(feature = "fuzztarget", feature = "_test_utils")), deny(missing_docs))]
22-
#![forbid(unsafe_code)]
22+
#![cfg_attr(not(any(test, feature = "fuzztarget", feature = "_test_utils")), forbid(unsafe_code))]
2323

2424
// In general, rust is absolutely horrid at supporting users doing things like,
2525
// for example, compiling Rust code for real environments. Disable useless lints

lightning/src/ln/onion_route_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl msgs::ChannelUpdate {
219219
use bitcoin::secp256k1::ffi::Signature as FFISignature;
220220
use bitcoin::secp256k1::Signature;
221221
msgs::ChannelUpdate {
222-
signature: Signature::from(FFISignature::new()),
222+
signature: Signature::from(unsafe { FFISignature::new() }),
223223
contents: msgs::UnsignedChannelUpdate {
224224
chain_hash: BlockHash::hash(&vec![0u8][..]),
225225
short_channel_id: 0,

lightning/src/util/ser.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,7 @@ macro_rules! impl_consensus_ser {
707707
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), ::std::io::Error> {
708708
match self.consensus_encode(WriterWriteAdaptor(writer)) {
709709
Ok(_) => Ok(()),
710-
Err(consensus::encode::Error::Io(e)) => Err(e),
711-
Err(_) => panic!("We shouldn't get a consensus::encode::Error unless our Write generated an std::io::Error"),
710+
Err(e) => Err(e),
712711
}
713712
}
714713
}

lightning/src/util/test_utils.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ impl events::MessageSendEventsProvider for TestChannelMessageHandler {
236236
}
237237
}
238238

239+
239240
fn get_dummy_channel_announcement(short_chan_id: u64) -> msgs::ChannelAnnouncement {
240241
use bitcoin::secp256k1::ffi::Signature as FFISignature;
241242
let secp_ctx = Secp256k1::new();
@@ -255,20 +256,20 @@ fn get_dummy_channel_announcement(short_chan_id: u64) -> msgs::ChannelAnnounceme
255256
excess_data: Vec::new(),
256257
};
257258

258-
msgs::ChannelAnnouncement {
259+
unsafe { msgs::ChannelAnnouncement {
259260
node_signature_1: Signature::from(FFISignature::new()),
260261
node_signature_2: Signature::from(FFISignature::new()),
261262
bitcoin_signature_1: Signature::from(FFISignature::new()),
262263
bitcoin_signature_2: Signature::from(FFISignature::new()),
263264
contents: unsigned_ann,
264-
}
265+
} }
265266
}
266267

267268
fn get_dummy_channel_update(short_chan_id: u64) -> msgs::ChannelUpdate {
268269
use bitcoin::secp256k1::ffi::Signature as FFISignature;
269270
let network = Network::Testnet;
270271
msgs::ChannelUpdate {
271-
signature: Signature::from(FFISignature::new()),
272+
signature: Signature::from(unsafe { FFISignature::new() }),
272273
contents: msgs::UnsignedChannelUpdate {
273274
chain_hash: genesis_block(network).header.block_hash(),
274275
short_channel_id: short_chan_id,

0 commit comments

Comments
 (0)