diff --git a/crypto/txscript/src/bindings/mod.rs b/crypto/txscript/src/bindings/mod.rs index 213cfe377..7c0cb4800 100644 --- a/crypto/txscript/src/bindings/mod.rs +++ b/crypto/txscript/src/bindings/mod.rs @@ -1,2 +1,7 @@ +pub mod opcodes; + #[cfg(feature = "py-sdk")] pub mod python; + +#[cfg(any(feature = "wasm32-core", feature = "wasm32-sdk"))] +pub mod wasm; diff --git a/crypto/txscript/src/wasm/opcodes.rs b/crypto/txscript/src/bindings/opcodes.rs similarity index 100% rename from crypto/txscript/src/wasm/opcodes.rs rename to crypto/txscript/src/bindings/opcodes.rs diff --git a/crypto/txscript/src/bindings/python/builder.rs b/crypto/txscript/src/bindings/python/builder.rs index 3cdc24f9a..a612fa783 100644 --- a/crypto/txscript/src/bindings/python/builder.rs +++ b/crypto/txscript/src/bindings/python/builder.rs @@ -1,4 +1,4 @@ -use crate::wasm::opcodes::Opcodes; +use crate::bindings::opcodes::Opcodes; use crate::{script_builder as native, standard}; use kaspa_consensus_core::tx::ScriptPublicKey; use kaspa_python_core::types::PyBinary; diff --git a/crypto/txscript/src/wasm/builder.rs b/crypto/txscript/src/bindings/wasm/builder.rs similarity index 100% rename from crypto/txscript/src/wasm/builder.rs rename to crypto/txscript/src/bindings/wasm/builder.rs diff --git a/crypto/txscript/src/wasm/mod.rs b/crypto/txscript/src/bindings/wasm/mod.rs similarity index 65% rename from crypto/txscript/src/wasm/mod.rs rename to crypto/txscript/src/bindings/wasm/mod.rs index 0d293916f..849efad49 100644 --- a/crypto/txscript/src/wasm/mod.rs +++ b/crypto/txscript/src/bindings/wasm/mod.rs @@ -6,12 +6,10 @@ use cfg_if::cfg_if; cfg_if! { if #[cfg(any(feature = "wasm32-sdk", feature = "wasm32-core"))] { - pub mod opcodes; + // pub mod opcodes; pub mod builder; - pub use self::opcodes::*; + pub use crate::bindings::opcodes::*; pub use self::builder::*; - } else if #[cfg(feature = "py-sdk")] { - pub mod opcodes; } } diff --git a/crypto/txscript/src/lib.rs b/crypto/txscript/src/lib.rs index 778116e17..097822292 100644 --- a/crypto/txscript/src/lib.rs +++ b/crypto/txscript/src/lib.rs @@ -1,7 +1,7 @@ extern crate alloc; extern crate core; -#[cfg(feature = "py-sdk")] +#[cfg(any(feature = "wasm32-sdk", feature = "py-sdk", feature = "py-sdk"))] pub mod bindings; pub mod caches; mod data_stack; @@ -11,8 +11,6 @@ pub mod result; pub mod script_builder; pub mod script_class; pub mod standard; -#[cfg(any(feature = "wasm32-sdk", feature = "py-sdk"))] -pub mod wasm; use crate::caches::Cache; use crate::data_stack::{DataStack, Stack}; diff --git a/python/src/lib.rs b/python/src/lib.rs index ef1810073..be1d4a612 100644 --- a/python/src/lib.rs +++ b/python/src/lib.rs @@ -30,7 +30,7 @@ cfg_if::cfg_if! { m.add_class::()?; m.add_class::()?; - m.add_class::()?; + m.add_class::()?; m.add_function(wrap_pyfunction!(kaspa_wallet_core::bindings::python::message::py_sign_message, m)?)?; m.add_function(wrap_pyfunction!(kaspa_wallet_core::bindings::python::message::py_verify_message, m)?)?; diff --git a/wasm/src/lib.rs b/wasm/src/lib.rs index 308e084a0..d48b94081 100644 --- a/wasm/src/lib.rs +++ b/wasm/src/lib.rs @@ -145,7 +145,7 @@ cfg_if::cfg_if! { pub use kaspa_addresses::{Address, Version as AddressVersion}; pub use kaspa_consensus_core::tx::{ScriptPublicKey, Transaction, TransactionInput, TransactionOutpoint, TransactionOutput}; pub use kaspa_pow::wasm::*; - pub use kaspa_txscript::wasm::*; + pub use kaspa_txscript::bindings::wasm::*; pub mod rpc { //! Kaspa RPC interface @@ -172,7 +172,7 @@ cfg_if::cfg_if! { pub use kaspa_addresses::{Address, Version as AddressVersion}; pub use kaspa_consensus_core::tx::{ScriptPublicKey, Transaction, TransactionInput, TransactionOutpoint, TransactionOutput}; pub use kaspa_pow::wasm::*; - pub use kaspa_txscript::wasm::*; + pub use kaspa_txscript::bindings::wasm::*; pub mod rpc { //! Kaspa RPC interface