diff --git a/bitcoin/src/blockdata/script/types/borrowed.rs b/bitcoin/src/blockdata/script/borrowed.rs similarity index 100% rename from bitcoin/src/blockdata/script/types/borrowed.rs rename to bitcoin/src/blockdata/script/borrowed.rs diff --git a/bitcoin/src/blockdata/script/mod.rs b/bitcoin/src/blockdata/script/mod.rs index b843ac82..b13088d0 100644 --- a/bitcoin/src/blockdata/script/mod.rs +++ b/bitcoin/src/blockdata/script/mod.rs @@ -48,20 +48,35 @@ //! At the time of writing there's only one operation using the cache - `push_verify`, so the cache //! is minimal but we may extend it in the future if needed. +use alloc::rc::Rc; +use alloc::sync::Arc; + +use core::cmp::Ordering; +use core::borrow::{Borrow, BorrowMut}; use core::fmt; +use core::ops::{Deref, DerefMut}; + +#[cfg(feature = "serde")] +use serde; use crate::blockdata::opcodes::{self, all::*}; -use crate::OutPoint; +use crate::consensus::{encode, Decodable, Encodable}; +use crate::hash_types::{ScriptHash, WScriptHash}; +use crate::hashes::hex; +use crate::{io, OutPoint}; +use crate::prelude::*; +mod borrowed; mod builder; mod instruction; -mod types; +mod owned; #[cfg(test)] mod tests; +pub use self::borrowed::*; pub use self::builder::*; pub use self::instruction::*; -pub use self::types::*; +pub use self::owned::*; /// Encodes an integer in script(minimal CScriptNum) format. /// @@ -213,6 +228,505 @@ fn opcode_to_verify(opcode: Option) -> Option { }) } +// We keep all the `Script` and `ScriptBuf` impls together since its easier to see side-by-side. + +impl From for Box