diff --git a/api/bitcoin/all-features.txt b/api/bitcoin/all-features.txt index 2a9ac5fb9..ce95c75a9 100644 --- a/api/bitcoin/all-features.txt +++ b/api/bitcoin/all-features.txt @@ -6372,6 +6372,7 @@ pub const fn bitcoin::blockdata::witness::Witness::new() -> Self pub const fn bitcoin::consensus::encode::VarInt::size(&self) -> usize pub const fn bitcoin::consensus::params::Params::new(network: bitcoin::network::Network) -> Self pub const fn bitcoin::network::Network::params(self) -> &'static bitcoin::consensus::params::Params +pub const fn bitcoin::p2p::Magic::from_bytes(bytes: [u8; 4]) -> bitcoin::p2p::Magic pub const fn bitcoin::transaction::predict_weight_from_slices(inputs: &[bitcoin::blockdata::transaction::InputWeightPrediction], output_script_lens: &[usize]) -> bitcoin_units::weight::Weight pub enum bitcoin::EcdsaSighashType pub enum bitcoin::NetworkKind @@ -8844,7 +8845,6 @@ pub fn bitcoin::p2p::Magic::consensus_encode bool pub fn bitcoin::p2p::Magic::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::result::Result<(), core::fmt::Error> pub fn bitcoin::p2p::Magic::from(network: bitcoin::network::Network) -> bitcoin::p2p::Magic -pub fn bitcoin::p2p::Magic::from_bytes(bytes: [u8; 4]) -> bitcoin::p2p::Magic pub fn bitcoin::p2p::Magic::from_params(params: impl core::convert::AsRef) -> Self pub fn bitcoin::p2p::Magic::from_str(s: &str) -> core::result::Result pub fn bitcoin::p2p::Magic::hash<__H: core::hash::Hasher>(&self, state: &mut __H) diff --git a/api/bitcoin/default-features.txt b/api/bitcoin/default-features.txt index 58cd8415e..8fbb1eb83 100644 --- a/api/bitcoin/default-features.txt +++ b/api/bitcoin/default-features.txt @@ -6071,6 +6071,7 @@ pub const fn bitcoin::blockdata::witness::Witness::new() -> Self pub const fn bitcoin::consensus::encode::VarInt::size(&self) -> usize pub const fn bitcoin::consensus::params::Params::new(network: bitcoin::network::Network) -> Self pub const fn bitcoin::network::Network::params(self) -> &'static bitcoin::consensus::params::Params +pub const fn bitcoin::p2p::Magic::from_bytes(bytes: [u8; 4]) -> bitcoin::p2p::Magic pub const fn bitcoin::transaction::predict_weight_from_slices(inputs: &[bitcoin::blockdata::transaction::InputWeightPrediction], output_script_lens: &[usize]) -> bitcoin_units::weight::Weight pub enum bitcoin::EcdsaSighashType pub enum bitcoin::NetworkKind @@ -8378,7 +8379,6 @@ pub fn bitcoin::p2p::Magic::consensus_encode bool pub fn bitcoin::p2p::Magic::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::result::Result<(), core::fmt::Error> pub fn bitcoin::p2p::Magic::from(network: bitcoin::network::Network) -> bitcoin::p2p::Magic -pub fn bitcoin::p2p::Magic::from_bytes(bytes: [u8; 4]) -> bitcoin::p2p::Magic pub fn bitcoin::p2p::Magic::from_params(params: impl core::convert::AsRef) -> Self pub fn bitcoin::p2p::Magic::from_str(s: &str) -> core::result::Result pub fn bitcoin::p2p::Magic::hash<__H: core::hash::Hasher>(&self, state: &mut __H) diff --git a/api/bitcoin/no-features.txt b/api/bitcoin/no-features.txt index b2cdd8b35..4c701b276 100644 --- a/api/bitcoin/no-features.txt +++ b/api/bitcoin/no-features.txt @@ -5453,6 +5453,7 @@ pub const fn bitcoin::blockdata::witness::Witness::new() -> Self pub const fn bitcoin::consensus::encode::VarInt::size(&self) -> usize pub const fn bitcoin::consensus::params::Params::new(network: bitcoin::network::Network) -> Self pub const fn bitcoin::network::Network::params(self) -> &'static bitcoin::consensus::params::Params +pub const fn bitcoin::p2p::Magic::from_bytes(bytes: [u8; 4]) -> bitcoin::p2p::Magic pub const fn bitcoin::transaction::predict_weight_from_slices(inputs: &[bitcoin::blockdata::transaction::InputWeightPrediction], output_script_lens: &[usize]) -> bitcoin_units::weight::Weight pub enum bitcoin::EcdsaSighashType pub enum bitcoin::NetworkKind @@ -7711,7 +7712,6 @@ pub fn bitcoin::p2p::Magic::consensus_encode bool pub fn bitcoin::p2p::Magic::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::result::Result<(), core::fmt::Error> pub fn bitcoin::p2p::Magic::from(network: bitcoin::network::Network) -> bitcoin::p2p::Magic -pub fn bitcoin::p2p::Magic::from_bytes(bytes: [u8; 4]) -> bitcoin::p2p::Magic pub fn bitcoin::p2p::Magic::from_params(params: impl core::convert::AsRef) -> Self pub fn bitcoin::p2p::Magic::from_str(s: &str) -> core::result::Result pub fn bitcoin::p2p::Magic::hash<__H: core::hash::Hasher>(&self, state: &mut __H) diff --git a/bitcoin/src/p2p/mod.rs b/bitcoin/src/p2p/mod.rs index 42d49030b..a7bedce1f 100644 --- a/bitcoin/src/p2p/mod.rs +++ b/bitcoin/src/p2p/mod.rs @@ -223,7 +223,7 @@ impl Magic { pub const REGTEST: Self = Self([0xFA, 0xBF, 0xB5, 0xDA]); /// Create network magic from bytes. - pub fn from_bytes(bytes: [u8; 4]) -> Magic { Magic(bytes) } + pub const fn from_bytes(bytes: [u8; 4]) -> Magic { Magic(bytes) } /// Get network magic bytes. pub fn to_bytes(self) -> [u8; 4] { self.0 }