Skip to content

Commit

Permalink
bitcoin: Use no_std attribute
Browse files Browse the repository at this point in the history
As we do for other crates; default to `no_std`.
  • Loading branch information
tcharding committed Mar 5, 2024
1 parent 1bd3ba5 commit 34c2fd8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bitcoin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
//! achieve the same without this feature but it could
//! happen the implementations diverge one day.

#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
#![no_std]

// Experimental features we need.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
Expand Down Expand Up @@ -57,6 +57,9 @@ extern crate test;
#[macro_use]
extern crate alloc;

#[cfg(feature = "std")]
extern crate std;

#[cfg(feature = "base64")]
/// Encodes and decodes base64 as bytes or utf8.
pub extern crate base64;
Expand Down
1 change: 1 addition & 0 deletions bitcoin/src/p2p/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use io::{BufRead, Read, Write};

use crate::consensus::encode::{self, Decodable, Encodable, ReadExt, VarInt, WriteExt};
use crate::p2p::ServiceFlags;
use crate::prelude::*;

/// A message which can be sent on the Bitcoin network
#[derive(Clone, PartialEq, Eq, Hash)]
Expand Down
1 change: 1 addition & 0 deletions bitcoin/src/p2p/message_blockdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use crate::blockdata::block::BlockHash;
use crate::blockdata::transaction::{Txid, Wtxid};
use crate::consensus::encode::{self, Decodable, Encodable};
use crate::internal_macros::impl_consensus_encoding;
use crate::prelude::*;
use crate::p2p;

/// An inventory item.
Expand Down
1 change: 1 addition & 0 deletions bitcoin/src/p2p/message_bloom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use io::{BufRead, Write};

use crate::consensus::{encode, Decodable, Encodable, ReadExt};
use crate::internal_macros::impl_consensus_encoding;
use crate::prelude::*;

/// `filterload` message sets the current bloom filter
#[derive(Clone, PartialEq, Eq, Debug)]
Expand Down
1 change: 1 addition & 0 deletions bitcoin/src/p2p/message_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use crate::bip158::{FilterHash, FilterHeader};
use crate::blockdata::block::BlockHash;
use crate::internal_macros::impl_consensus_encoding;
use crate::prelude::*;

/// getcfilters message
#[derive(PartialEq, Eq, Clone, Debug)]
Expand Down

0 comments on commit 34c2fd8

Please sign in to comment.