diff --git a/Cargo.lock b/Cargo.lock index ac3b9285d..4d4a44ef4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -778,7 +778,6 @@ dependencies = [ "failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "grin_keychain 0.4.2", "grin_util 0.4.2", - "grin_wallet 0.4.2", "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -788,6 +787,7 @@ dependencies = [ "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/chain/tests/data_file_integrity.rs b/chain/tests/data_file_integrity.rs index baf580e60..4fc50100f 100644 --- a/chain/tests/data_file_integrity.rs +++ b/chain/tests/data_file_integrity.rs @@ -35,7 +35,7 @@ use core::global::{self, ChainTypes}; use core::pow::{self, Difficulty}; use core::{consensus, genesis}; use keychain::{ExtKeychain, ExtKeychainPath, Keychain}; -use wallet::libtx; +use core::libtx; fn clean_output_dir(dir_name: &str) { let _ = fs::remove_dir_all(dir_name); diff --git a/chain/tests/mine_simple_chain.rs b/chain/tests/mine_simple_chain.rs index a1be68c5c..01f03d0cb 100644 --- a/chain/tests/mine_simple_chain.rs +++ b/chain/tests/mine_simple_chain.rs @@ -35,7 +35,7 @@ use core::global::ChainTypes; use core::pow::Difficulty; use core::{consensus, global, pow}; use keychain::{ExtKeychain, ExtKeychainPath, Keychain}; -use wallet::libtx::{self, build}; +use core::libtx::{self, build}; fn clean_output_dir(dir_name: &str) { let _ = fs::remove_dir_all(dir_name); diff --git a/chain/tests/store_indices.rs b/chain/tests/store_indices.rs index 822ce9e96..632b3ff0a 100644 --- a/chain/tests/store_indices.rs +++ b/chain/tests/store_indices.rs @@ -29,7 +29,7 @@ use core::core::Block; use core::global::{self, ChainTypes}; use core::pow::{self, Difficulty}; use keychain::{ExtKeychain, ExtKeychainPath, Keychain}; -use wallet::libtx; +use core::libtx; fn clean_output_dir(dir_name: &str) { let _ = fs::remove_dir_all(dir_name); diff --git a/chain/tests/test_coinbase_maturity.rs b/chain/tests/test_coinbase_maturity.rs index 0edee3c5e..2866c19ab 100644 --- a/chain/tests/test_coinbase_maturity.rs +++ b/chain/tests/test_coinbase_maturity.rs @@ -35,7 +35,7 @@ use core::global::{self, ChainTypes}; use core::pow::Difficulty; use core::{consensus, pow}; use keychain::{ExtKeychain, ExtKeychainPath, Keychain}; -use wallet::libtx::{self, build}; +use core::libtx::{self, build}; fn clean_output_dir(dir_name: &str) { let _ = fs::remove_dir_all(dir_name); diff --git a/core/Cargo.toml b/core/Cargo.toml index dd869cb7d..051de715e 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -24,11 +24,9 @@ rand = "0.5" serde = "1" serde_derive = "1" siphasher = "0.2" +uuid = { version = "0.6", features = ["serde", "v4"] } log = "0.4" chrono = "0.4.4" grin_keychain = { path = "../keychain" } grin_util = { path = "../util" } - -[dev-dependencies] -grin_wallet = { path = "../wallet" } diff --git a/core/fuzz/src/main.rs b/core/fuzz/src/main.rs index 2b6232706..96a336ca2 100644 --- a/core/fuzz/src/main.rs +++ b/core/fuzz/src/main.rs @@ -7,8 +7,8 @@ use grin_core::core::{Block, BlockHeader, CompactBlock, Transaction}; use grin_core::ser; use grin_keychain::keychain::ExtKeychain; use grin_keychain::Keychain; -use grin_wallet::libtx::build::{input, output, transaction, with_fee}; -use grin_wallet::libtx::reward; +use grin_core::libtx::build::{input, output, transaction, with_fee}; +use grin_core::libtx::reward; use std::fs::{self, File}; use std::path::Path; diff --git a/core/src/lib.rs b/core/src/lib.rs index e9db864ff..e8d5a72db 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -39,6 +39,7 @@ extern crate serde_derive; extern crate siphasher; #[macro_use] extern crate log; +extern crate uuid; extern crate chrono; extern crate failure; #[macro_use] @@ -51,5 +52,6 @@ pub mod consensus; pub mod core; pub mod genesis; pub mod global; +pub mod libtx; pub mod pow; pub mod ser; diff --git a/wallet/src/libtx/aggsig.rs b/core/src/libtx/aggsig.rs similarity index 97% rename from wallet/src/libtx/aggsig.rs rename to core/src/libtx/aggsig.rs index e87b920bd..cc8995a0a 100644 --- a/wallet/src/libtx/aggsig.rs +++ b/core/src/libtx/aggsig.rs @@ -32,9 +32,9 @@ use util::secp::{self, aggsig, Message, Secp256k1, Signature}; /// # Example /// /// ``` +/// # extern crate grin_core as core; /// # extern crate grin_util as util; -/// # extern crate grin_wallet as wallet; -/// use wallet::libtx::aggsig; +/// use core::libtx::aggsig; /// use util::secp::{ContextFlag, Secp256k1}; /// let secp = Secp256k1::with_caps(ContextFlag::SignOnly); /// let secret_nonce = aggsig::create_secnonce(&secp).unwrap(); @@ -66,11 +66,11 @@ pub fn create_secnonce(secp: &Secp256k1) -> Result { /// # Example /// /// ``` +/// # extern crate grin_core as core; /// # extern crate grin_util as util; -/// # extern crate grin_wallet as wallet; /// # extern crate rand; /// use rand::thread_rng; -/// use wallet::libtx::aggsig; +/// use core::libtx::aggsig; /// use util::secp::key::{PublicKey, SecretKey}; /// use util::secp::{ContextFlag, Secp256k1, Message}; /// @@ -137,11 +137,11 @@ pub fn calculate_partial_sig( /// # Example /// /// ``` +/// # extern crate grin_core as core; /// # extern crate grin_util as util; -/// # extern crate grin_wallet as wallet; /// # extern crate rand; /// use rand::thread_rng; -/// use wallet::libtx::aggsig; +/// use core::libtx::aggsig; /// use util::secp::key::{PublicKey, SecretKey}; /// use util::secp::{ContextFlag, Secp256k1, Message}; /// @@ -224,12 +224,11 @@ pub fn verify_partial_sig( /// ``` /// # extern crate grin_util as util; /// # extern crate grin_core as core; -/// # extern crate grin_wallet as wallet; /// # extern crate grin_keychain as keychain; /// use core::consensus::reward; -/// use wallet::libtx::{aggsig, proof}; /// use util::secp::key::{PublicKey, SecretKey}; /// use util::secp::{ContextFlag, Secp256k1}; +/// use core::libtx::{aggsig, proof}; /// use core::core::transaction::kernel_sig_msg; /// use core::core::{Output, OutputFeatures}; /// use keychain::{Keychain, ExtKeychain}; @@ -297,10 +296,9 @@ where /// ``` /// # extern crate grin_util as util; /// # extern crate grin_core as core; -/// # extern crate grin_wallet as wallet; /// # extern crate grin_keychain as keychain; /// use core::consensus::reward; -/// use wallet::libtx::{aggsig, proof}; +/// use core::libtx::{aggsig, proof}; /// use util::secp::key::{PublicKey, SecretKey}; /// use util::secp::{ContextFlag, Secp256k1}; /// use core::core::transaction::kernel_sig_msg; @@ -368,11 +366,11 @@ pub fn verify_single_from_commit( /// # Example /// /// ``` +/// # extern crate grin_core as core; /// # extern crate grin_util as util; -/// # extern crate grin_wallet as wallet; /// # extern crate rand; /// use rand::thread_rng; -/// use wallet::libtx::aggsig; +/// use core::libtx::aggsig; /// use util::secp::key::{PublicKey, SecretKey}; /// use util::secp::{ContextFlag, Secp256k1, Message}; /// diff --git a/wallet/src/libtx/build.rs b/core/src/libtx/build.rs similarity index 98% rename from wallet/src/libtx/build.rs rename to core/src/libtx/build.rs index 42cffa610..9a9c564ff 100644 --- a/wallet/src/libtx/build.rs +++ b/core/src/libtx/build.rs @@ -25,7 +25,7 @@ //! build::transaction(vec![input_rand(75), output_rand(42), output_rand(32), //! with_fee(1)]) -use core::core::{Input, Output, OutputFeatures, Transaction, TxKernel}; +use core::{Input, Output, OutputFeatures, Transaction, TxKernel}; use keychain::{BlindSum, BlindingFactor, Identifier, Keychain}; use libtx::Error; use libtx::{aggsig, proof}; @@ -251,7 +251,7 @@ mod test { use util::RwLock; use super::*; - use core::core::verifier_cache::{LruVerifierCache, VerifierCache}; + use core::verifier_cache::{LruVerifierCache, VerifierCache}; use keychain::{ExtKeychain, ExtKeychainPath}; fn verifier_cache() -> Arc> { diff --git a/wallet/src/libtx/error.rs b/core/src/libtx/error.rs similarity index 98% rename from wallet/src/libtx/error.rs rename to core/src/libtx/error.rs index 0bd73f422..c26316f37 100644 --- a/wallet/src/libtx/error.rs +++ b/core/src/libtx/error.rs @@ -16,7 +16,7 @@ use failure::{Backtrace, Context, Fail}; use std::fmt::{self, Display}; -use core::core::{committed, transaction}; +use core::{committed, transaction}; use keychain; use util::secp; diff --git a/wallet/src/libtx/mod.rs b/core/src/libtx/mod.rs similarity index 96% rename from wallet/src/libtx/mod.rs rename to core/src/libtx/mod.rs index 9a17da5d9..b532db0e0 100644 --- a/wallet/src/libtx/mod.rs +++ b/core/src/libtx/mod.rs @@ -28,8 +28,8 @@ pub mod proof; pub mod reward; pub mod slate; -use core::consensus; -use core::core::Transaction; +use consensus; +use core::Transaction; pub use libtx::error::{Error, ErrorKind}; diff --git a/wallet/src/libtx/proof.rs b/core/src/libtx/proof.rs similarity index 100% rename from wallet/src/libtx/proof.rs rename to core/src/libtx/proof.rs diff --git a/wallet/src/libtx/reward.rs b/core/src/libtx/reward.rs similarity index 93% rename from wallet/src/libtx/reward.rs rename to core/src/libtx/reward.rs index ba59122f8..e92a6aa8d 100644 --- a/wallet/src/libtx/reward.rs +++ b/core/src/libtx/reward.rs @@ -16,10 +16,10 @@ //! reward. use keychain::{Identifier, Keychain}; -use core::consensus::reward; -use core::core::transaction::kernel_sig_msg; -use core::core::KernelFeatures; -use core::core::{Output, OutputFeatures, TxKernel}; +use consensus::reward; +use core::transaction::kernel_sig_msg; +use core::KernelFeatures; +use core::{Output, OutputFeatures, TxKernel}; use libtx::error::Error; use libtx::{aggsig, proof}; use util::static_secp_instance; diff --git a/wallet/src/libtx/slate.rs b/core/src/libtx/slate.rs similarity index 98% rename from wallet/src/libtx/slate.rs rename to core/src/libtx/slate.rs index d5c6f147a..a5edc2351 100644 --- a/wallet/src/libtx/slate.rs +++ b/core/src/libtx/slate.rs @@ -19,10 +19,10 @@ use rand::thread_rng; use std::sync::Arc; use uuid::Uuid; -use core::core::committed::Committed; -use core::core::transaction::kernel_sig_msg; -use core::core::verifier_cache::LruVerifierCache; -use core::core::{amount_to_hr_string, Transaction}; +use core::committed::Committed; +use core::transaction::kernel_sig_msg; +use core::verifier_cache::LruVerifierCache; +use core::{amount_to_hr_string, Transaction}; use keychain::{BlindSum, BlindingFactor, Keychain}; use libtx::error::{Error, ErrorKind}; use libtx::{aggsig, build, tx_fee}; diff --git a/core/tests/block.rs b/core/tests/block.rs index cfccbed58..6634a55ad 100644 --- a/core/tests/block.rs +++ b/core/tests/block.rs @@ -16,7 +16,6 @@ extern crate chrono; extern crate grin_core; extern crate grin_keychain as keychain; extern crate grin_util as util; -extern crate grin_wallet as wallet; use std::sync::Arc; use std::time::Instant; @@ -34,9 +33,9 @@ use grin_core::core::verifier_cache::{LruVerifierCache, VerifierCache}; use grin_core::core::Committed; use grin_core::core::{Block, BlockHeader, CompactBlock, KernelFeatures, OutputFeatures}; use grin_core::{global, ser}; +use grin_core::libtx::build::{self, input, output, with_fee}; use keychain::{BlindingFactor, ExtKeychain, Keychain}; use util::secp; -use wallet::libtx::build::{self, input, output, with_fee}; fn verifier_cache() -> Arc> { Arc::new(RwLock::new(LruVerifierCache::new())) diff --git a/core/tests/common/mod.rs b/core/tests/common/mod.rs index b9604642a..066591462 100644 --- a/core/tests/common/mod.rs +++ b/core/tests/common/mod.rs @@ -17,14 +17,13 @@ extern crate grin_core; extern crate grin_keychain as keychain; extern crate grin_util as util; -extern crate grin_wallet as wallet; use grin_core::core::block::{Block, BlockHeader}; use grin_core::core::Transaction; use grin_core::pow::Difficulty; use keychain::{Identifier, Keychain}; -use wallet::libtx::build::{self, input, output, with_fee}; -use wallet::libtx::reward; +use grin_core::libtx::build::{self, input, output, with_fee}; +use grin_core::libtx::reward; // utility producing a transaction with 2 inputs and a single outputs pub fn tx2i1o() -> Transaction { diff --git a/core/tests/core.rs b/core/tests/core.rs index d503e7667..f01eb002a 100644 --- a/core/tests/core.rs +++ b/core/tests/core.rs @@ -16,7 +16,6 @@ extern crate grin_core; extern crate grin_keychain as keychain; extern crate grin_util as util; -extern crate grin_wallet as wallet; use std::sync::Arc; use util::RwLock; @@ -29,12 +28,12 @@ use grin_core::core::block::Error::KernelLockHeight; use grin_core::core::hash::{Hashed, ZERO_HASH}; use grin_core::core::verifier_cache::{LruVerifierCache, VerifierCache}; use grin_core::core::{aggregate, deaggregate, KernelFeatures, Output, Transaction}; +use grin_core::libtx::build::{ + self, initial_tx, input, output, with_excess, with_fee, with_lock_height, +}; use grin_core::ser; use keychain::{BlindingFactor, ExtKeychain, Keychain}; use util::static_secp_instance; -use wallet::libtx::build::{ - self, initial_tx, input, output, with_excess, with_fee, with_lock_height, -}; #[test] fn simple_tx_ser() { diff --git a/core/tests/transaction.rs b/core/tests/transaction.rs index ad8e32bab..14364e0ba 100644 --- a/core/tests/transaction.rs +++ b/core/tests/transaction.rs @@ -16,14 +16,13 @@ extern crate grin_core; extern crate grin_keychain as keychain; extern crate grin_util as util; -extern crate grin_wallet as wallet; pub mod common; use grin_core::core::{Output, OutputFeatures}; +use grin_core::libtx::proof; use grin_core::ser; use keychain::{ExtKeychain, Keychain}; -use wallet::libtx::proof; #[test] fn test_output_ser_deser() { diff --git a/core/tests/verifier_cache.rs b/core/tests/verifier_cache.rs index ff8d237af..4206bedca 100644 --- a/core/tests/verifier_cache.rs +++ b/core/tests/verifier_cache.rs @@ -16,7 +16,6 @@ extern crate chrono; extern crate grin_core; extern crate grin_keychain as keychain; extern crate grin_util as util; -extern crate grin_wallet as wallet; use std::sync::Arc; use util::RwLock; @@ -26,7 +25,7 @@ pub mod common; use grin_core::core::verifier_cache::{LruVerifierCache, VerifierCache}; use grin_core::core::{Output, OutputFeatures}; use keychain::{ExtKeychain, Keychain}; -use wallet::libtx::proof; +use grin_core::libtx::proof; fn verifier_cache() -> Arc> { Arc::new(RwLock::new(LruVerifierCache::new())) diff --git a/pool/tests/block_building.rs b/pool/tests/block_building.rs index 487560a94..db1214c46 100644 --- a/pool/tests/block_building.rs +++ b/pool/tests/block_building.rs @@ -34,7 +34,7 @@ use core::core::{Block, BlockHeader, Transaction}; use core::pow::Difficulty; use keychain::{ExtKeychain, Keychain}; -use wallet::libtx; +use core::libtx; use common::*; diff --git a/pool/tests/block_reconciliation.rs b/pool/tests/block_reconciliation.rs index c470c27e9..735c9e2be 100644 --- a/pool/tests/block_reconciliation.rs +++ b/pool/tests/block_reconciliation.rs @@ -35,7 +35,7 @@ use core::core::hash::Hashed; use core::core::verifier_cache::LruVerifierCache; use core::pow::Difficulty; use keychain::{ExtKeychain, Keychain}; -use wallet::libtx; +use core::libtx; #[test] fn test_transaction_pool_block_reconciliation() { diff --git a/pool/tests/common/mod.rs b/pool/tests/common/mod.rs index 848f3f0fd..5f83b6930 100644 --- a/pool/tests/common/mod.rs +++ b/pool/tests/common/mod.rs @@ -40,7 +40,7 @@ use chain::types::Tip; use pool::*; use keychain::{ExtKeychain, Keychain}; -use wallet::libtx; +use core::libtx; use pool::types::*; use pool::TransactionPool; diff --git a/pool/tests/transaction_pool.rs b/pool/tests/transaction_pool.rs index b9526328b..dd8a2a519 100644 --- a/pool/tests/transaction_pool.rs +++ b/pool/tests/transaction_pool.rs @@ -33,7 +33,7 @@ use core::core::verifier_cache::LruVerifierCache; use core::core::{transaction, Block, BlockHeader}; use core::pow::Difficulty; use keychain::{ExtKeychain, Keychain}; -use wallet::libtx; +use core::libtx; /// Test we can add some txs to the pool (both stempool and txpool). #[test] diff --git a/servers/src/mining/mine_block.rs b/servers/src/mining/mine_block.rs index 5015e0611..a7cb22e42 100644 --- a/servers/src/mining/mine_block.rs +++ b/servers/src/mining/mine_block.rs @@ -25,7 +25,7 @@ use util::RwLock; use chain; use common::types::Error; use core::core::verifier_cache::VerifierCache; -use core::{consensus, core, ser}; +use core::{consensus, core, libtx, ser}; use keychain::{ExtKeychain, Identifier, Keychain}; use pool; use util; @@ -173,7 +173,7 @@ fn burn_reward(block_fees: BlockFees) -> Result<(core::Output, core::TxKernel, B let keychain = ExtKeychain::from_random_seed().unwrap(); let key_id = ExtKeychain::derive_key_id(1, 1, 0, 0, 0); let (out, kernel) = - wallet::libtx::reward::output(&keychain, &key_id, block_fees.fees, block_fees.height) + libtx::reward::output(&keychain, &key_id, block_fees.fees, block_fees.height) .unwrap(); Ok((out, kernel, block_fees)) } diff --git a/wallet/src/adapters/file.rs b/wallet/src/adapters/file.rs index ed6516ff4..dadc1ecf0 100644 --- a/wallet/src/adapters/file.rs +++ b/wallet/src/adapters/file.rs @@ -19,7 +19,7 @@ use std::io::{Read, Write}; use serde_json as json; use std::collections::HashMap; -use libtx::slate::Slate; +use core::libtx::slate::Slate; use libwallet::{Error, ErrorKind}; use {WalletCommAdapter, WalletConfig}; diff --git a/wallet/src/adapters/http.rs b/wallet/src/adapters/http.rs index b8efc9574..824095c11 100644 --- a/wallet/src/adapters/http.rs +++ b/wallet/src/adapters/http.rs @@ -18,7 +18,7 @@ use std::collections::HashMap; use api; use controller; -use libtx::slate::Slate; +use core::libtx::slate::Slate; use libwallet::{Error, ErrorKind}; use {instantiate_wallet, WalletCommAdapter, WalletConfig}; diff --git a/wallet/src/adapters/mod.rs b/wallet/src/adapters/mod.rs index 2b9c0113f..300b0417c 100644 --- a/wallet/src/adapters/mod.rs +++ b/wallet/src/adapters/mod.rs @@ -22,7 +22,7 @@ pub use self::null::NullWalletCommAdapter; use std::collections::HashMap; -use libtx::slate::Slate; +use core::libtx::slate::Slate; use libwallet::Error; use WalletConfig; diff --git a/wallet/src/adapters/null.rs b/wallet/src/adapters/null.rs index 90ee66c7e..60e790659 100644 --- a/wallet/src/adapters/null.rs +++ b/wallet/src/adapters/null.rs @@ -13,7 +13,7 @@ // limitations under the License. /// Null Output 'plugin' implementation -use libtx::slate::Slate; +use core::libtx::slate::Slate; use libwallet::Error; use {WalletCommAdapter, WalletConfig}; diff --git a/wallet/src/controller.rs b/wallet/src/controller.rs index d6a4f8d84..8c27a2cfd 100644 --- a/wallet/src/controller.rs +++ b/wallet/src/controller.rs @@ -24,7 +24,7 @@ use futures::future::{err, ok}; use futures::{Future, Stream}; use hyper::{Body, Request, Response, StatusCode}; use keychain::Keychain; -use libtx::slate::Slate; +use core::libtx::slate::Slate; use libwallet::api::{APIForeign, APIOwner}; use libwallet::types::{ CbData, NodeClient, OutputData, SendTXArgs, TxLogEntry, WalletBackend, WalletInfo, diff --git a/wallet/src/error.rs b/wallet/src/error.rs index c5fef5919..d7c4a8b43 100644 --- a/wallet/src/error.rs +++ b/wallet/src/error.rs @@ -15,7 +15,7 @@ //! Implementation specific error types use api; use keychain; -use libtx; +use core::libtx; use libwallet; use std::fmt::{self, Display}; diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index 0cf1d09f3..ef7bd37e3 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -50,7 +50,6 @@ mod adapters; pub mod controller; pub mod display; mod error; -pub mod libtx; pub mod libwallet; pub mod lmdb_wallet; mod node_clients; diff --git a/wallet/src/libwallet/api.rs b/wallet/src/libwallet/api.rs index 2b4f2578a..7a5fc659d 100644 --- a/wallet/src/libwallet/api.rs +++ b/wallet/src/libwallet/api.rs @@ -38,7 +38,7 @@ use core::core::hash::Hashed; use core::core::Transaction; use core::ser; use keychain::{Identifier, Keychain}; -use libtx::slate::Slate; +use core::libtx::slate::Slate; use libwallet::internal::{keys, tx, updater}; use libwallet::types::{ AcctPathMapping, BlockFees, CbData, NodeClient, OutputData, TxLogEntry, TxWrapper, diff --git a/wallet/src/libwallet/error.rs b/wallet/src/libwallet/error.rs index 403b8fd44..93557d185 100644 --- a/wallet/src/libwallet/error.rs +++ b/wallet/src/libwallet/error.rs @@ -22,7 +22,7 @@ use failure::{Backtrace, Context, Fail}; use core; use core::core::transaction; use keychain; -use libtx; +use core::libtx; /// Error definition #[derive(Debug, Fail)] @@ -257,7 +257,7 @@ impl From for Error { } impl From for Error { - fn from(error: libtx::Error) -> Error { + fn from(error: core::libtx::Error) -> Error { Error { inner: Context::new(ErrorKind::LibTX(error.kind())), } diff --git a/wallet/src/libwallet/internal/mod.rs b/wallet/src/libwallet/internal/mod.rs index 46c9bd432..63c886e50 100644 --- a/wallet/src/libwallet/internal/mod.rs +++ b/wallet/src/libwallet/internal/mod.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! lower-level wallet functions which build upon libtx to perform wallet +//! lower-level wallet functions which build upon core::libtx to perform wallet //! operations #![deny(non_upper_case_globals)] diff --git a/wallet/src/libwallet/internal/restore.rs b/wallet/src/libwallet/internal/restore.rs index a553b67eb..c16172c41 100644 --- a/wallet/src/libwallet/internal/restore.rs +++ b/wallet/src/libwallet/internal/restore.rs @@ -15,7 +15,7 @@ use core::global; use keychain::{ExtKeychain, Identifier, Keychain}; -use libtx::proof; +use core::libtx::proof; use libwallet::internal::keys; use libwallet::types::*; use libwallet::Error; diff --git a/wallet/src/libwallet/internal/selection.rs b/wallet/src/libwallet/internal/selection.rs index eae6664e2..6ec6b3f2a 100644 --- a/wallet/src/libwallet/internal/selection.rs +++ b/wallet/src/libwallet/internal/selection.rs @@ -15,7 +15,7 @@ //! Selection of inputs for building transactions use keychain::{Identifier, Keychain}; -use libtx::{build, slate::Slate, tx_fee}; +use core::libtx::{build, slate::Slate, tx_fee}; use libwallet::error::{Error, ErrorKind}; use libwallet::internal::keys; use libwallet::types::*; diff --git a/wallet/src/libwallet/internal/tx.rs b/wallet/src/libwallet/internal/tx.rs index 329ef0612..8408855c2 100644 --- a/wallet/src/libwallet/internal/tx.rs +++ b/wallet/src/libwallet/internal/tx.rs @@ -19,7 +19,7 @@ use uuid::Uuid; use core::ser; use keychain::{Identifier, Keychain}; -use libtx::slate::Slate; +use core::libtx::slate::Slate; use libwallet::internal::{selection, updater}; use libwallet::types::{Context, NodeClient, TxLogEntryType, WalletBackend}; use libwallet::{Error, ErrorKind}; @@ -234,7 +234,7 @@ where #[cfg(test)] mod test { use keychain::{ExtKeychain, ExtKeychainPath, Keychain}; - use libtx::build; + use core::libtx::build; #[test] // demonstrate that input.commitment == referenced output.commitment diff --git a/wallet/src/libwallet/internal/updater.rs b/wallet/src/libwallet/internal/updater.rs index 7c63b5fab..850159097 100644 --- a/wallet/src/libwallet/internal/updater.rs +++ b/wallet/src/libwallet/internal/updater.rs @@ -23,7 +23,7 @@ use core::consensus::reward; use core::core::{Output, TxKernel}; use core::{global, ser}; use keychain::{Identifier, Keychain}; -use libtx::reward; +use core::libtx::reward; use libwallet; use libwallet::error::{Error, ErrorKind}; use libwallet::internal::keys; diff --git a/wallet/src/libwallet/types.rs b/wallet/src/libwallet/types.rs index 972865120..1fa5e56cb 100644 --- a/wallet/src/libwallet/types.rs +++ b/wallet/src/libwallet/types.rs @@ -31,7 +31,7 @@ use core::ser; use keychain::{Identifier, Keychain}; -use libtx::aggsig; +use core::libtx::aggsig; use libwallet::error::{Error, ErrorKind}; use util; diff --git a/wallet/tests/common/testclient.rs b/wallet/tests/common/testclient.rs index a47d5aea1..0ef47bf9d 100644 --- a/wallet/tests/common/testclient.rs +++ b/wallet/tests/common/testclient.rs @@ -42,7 +42,7 @@ use core::{pow, ser}; use keychain::Keychain; use util::secp::pedersen; -use wallet::libtx::slate::Slate; +use core::libtx::slate::Slate; use wallet::libwallet::types::*; use wallet::{controller, libwallet, WalletCommAdapter, WalletConfig}; diff --git a/wallet/tests/libwallet.rs b/wallet/tests/libwallet.rs index c7d1dc956..62c55d5dd 100644 --- a/wallet/tests/libwallet.rs +++ b/wallet/tests/libwallet.rs @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! libtx specific tests +//! core::libtx specific tests extern crate grin_core as core; extern crate grin_keychain as keychain; extern crate grin_util as util; @@ -24,7 +24,7 @@ use core::core::transaction::kernel_sig_msg; use keychain::{BlindSum, BlindingFactor, ExtKeychain, Keychain}; use util::secp; use util::secp::key::{PublicKey, SecretKey}; -use wallet::libtx::{aggsig, proof}; +use core::libtx::{aggsig, proof}; use wallet::libwallet::types::Context; use wallet::{EncryptedWalletSeed, WalletSeed}; diff --git a/wallet/tests/repost.rs b/wallet/tests/repost.rs index 152ea003f..e25ec53e8 100644 --- a/wallet/tests/repost.rs +++ b/wallet/tests/repost.rs @@ -35,7 +35,7 @@ use std::time::Duration; use core::global; use core::global::ChainTypes; use keychain::ExtKeychain; -use wallet::libtx::slate::Slate; +use core::libtx::slate::Slate; use wallet::{libwallet, FileWalletCommAdapter}; fn clean_output_dir(test_dir: &str) { diff --git a/wallet/tests/restore.rs b/wallet/tests/restore.rs index ac94a31b5..d9ba8cc01 100644 --- a/wallet/tests/restore.rs +++ b/wallet/tests/restore.rs @@ -35,7 +35,7 @@ use std::time::Duration; use core::global; use core::global::ChainTypes; use keychain::{ExtKeychain, Identifier, Keychain}; -use wallet::libtx::slate::Slate; +use core::libtx::slate::Slate; use wallet::libwallet; use wallet::libwallet::types::AcctPathMapping; diff --git a/wallet/tests/transaction.rs b/wallet/tests/transaction.rs index 22ad40aaa..7b3c5a3c2 100644 --- a/wallet/tests/transaction.rs +++ b/wallet/tests/transaction.rs @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! tests for transactions building within libtx +//! tests for transactions building within core::libtx extern crate grin_chain as chain; extern crate grin_core as core; extern crate grin_keychain as keychain; @@ -35,7 +35,7 @@ use std::time::Duration; use core::global; use core::global::ChainTypes; use keychain::ExtKeychain; -use wallet::libtx::slate::Slate; +use core::libtx::slate::Slate; use wallet::libwallet; use wallet::libwallet::types::OutputStatus; @@ -123,7 +123,7 @@ fn basic_transaction_api(test_dir: &str) -> Result<(), libwallet::Error> { let (_, wallet1_info) = api.retrieve_summary_info(true, 1)?; let (refreshed, txs) = api.retrieve_txs(true, None, None)?; assert!(refreshed); - let fee = wallet::libtx::tx_fee( + let fee = core::libtx::tx_fee( wallet1_info.last_confirmed_height as usize - cm as usize, 2, 1, @@ -169,7 +169,7 @@ fn basic_transaction_api(test_dir: &str) -> Result<(), libwallet::Error> { "Wallet 1 Info Post Transaction, after {} blocks: {:?}", wallet1_info.last_confirmed_height, wallet1_info ); - let fee = wallet::libtx::tx_fee( + let fee = core::libtx::tx_fee( wallet1_info.last_confirmed_height as usize - 1 - cm as usize, 2, 1,