Skip to content

Commit

Permalink
crypto/txscript/src/wasm -> crypto/txscript/src/bindings/wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
smartgoo committed Nov 16, 2024
1 parent db7efa6 commit c943255
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
5 changes: 5 additions & 0 deletions crypto/txscript/src/bindings/mod.rs
Original file line number Diff line number Diff line change
@@ -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;
File renamed without changes.
2 changes: 1 addition & 1 deletion crypto/txscript/src/bindings/python/builder.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
4 changes: 1 addition & 3 deletions crypto/txscript/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cfg_if::cfg_if! {
m.add_class::<kaspa_bip32::Mnemonic>()?;

m.add_class::<kaspa_txscript::bindings::python::ScriptBuilder>()?;
m.add_class::<kaspa_txscript::wasm::opcodes::Opcodes>()?;
m.add_class::<kaspa_txscript::bindings::opcodes::Opcodes>()?;

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)?)?;
Expand Down
4 changes: 2 additions & 2 deletions wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c943255

Please sign in to comment.