Skip to content

Commit

Permalink
chore: rename tcx_chain to tcx_keystore
Browse files Browse the repository at this point in the history
  • Loading branch information
XuNeal committed Oct 12, 2023
1 parent 904d2c6 commit 7794140
Show file tree
Hide file tree
Showing 66 changed files with 128 additions and 158 deletions.
64 changes: 18 additions & 46 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ members=[
"token-core/tcx-constants",
"token-core/tcx-primitive",
"token-core/tcx-crypto",
"token-core/tcx-chain",
"token-core/tcx-keystore",
"token-core/tcx-tron",
"token-core/tcx-btc-kin",
"token-core/tcx-ckb",
Expand Down
2 changes: 1 addition & 1 deletion token-core/tcx-atom/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
tcx-crypto = { path = "../tcx-crypto" }
tcx-chain = { path = "../tcx-chain" }
tcx-keystore = { path = "../tcx-keystore" }
tcx-primitive = { path = "../tcx-primitive" }
tcx-constants = { path = "../tcx-constants" }

Expand Down
4 changes: 2 additions & 2 deletions token-core/tcx-atom/src/address.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use core::str::FromStr;

use bech32::{FromBase32, ToBase32, Variant};
use tcx_chain::{Address, ChainFactory, PublicKeyEncoder, Result};
use tcx_constants::CoinInfo;
use tcx_crypto::hash;
use tcx_keystore::{Address, ChainFactory, PublicKeyEncoder, Result};
use tcx_primitive::TypedPublicKey;

// size of address
Expand Down Expand Up @@ -77,7 +77,7 @@ impl ChainFactory for AtomChainFactory {
mod tests {

use crate::address::AtomAddress;
use tcx_chain::Address;
use tcx_keystore::Address;

use tcx_constants::{CoinInfo, CurveType};
use tcx_crypto::hex;
Expand Down
2 changes: 1 addition & 1 deletion token-core/tcx-atom/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pub mod signer;
pub mod transaction;

pub mod cosmos {
use tcx_chain::{Account, Keystore};
use tcx_constants::{CoinInfo, CurveType};
use tcx_keystore::{Account, Keystore};

pub const CHAINS: [&'static str; 1] = ["COSMOS"];

Expand Down
4 changes: 2 additions & 2 deletions token-core/tcx-atom/src/signer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::transaction::{AtomTxInput, AtomTxOutput};
use tcx_chain::{ChainSigner, Keystore, Result, TransactionSigner as TraitTransactionSigner};
use tcx_keystore::{ChainSigner, Keystore, Result, TransactionSigner as TraitTransactionSigner};

use tcx_crypto::{hash, hex};

Expand Down Expand Up @@ -31,9 +31,9 @@ mod tests {
use super::*;
use crate::address::AtomAddress;

use tcx_chain::{HdKeystore, Keystore, KeystoreGuard, Metadata};
use tcx_constants::{CoinInfo, TEST_PASSWORD};
use tcx_constants::{CurveType, TEST_MNEMONIC};
use tcx_keystore::{HdKeystore, Keystore, KeystoreGuard, Metadata};

#[test]
fn sign_transaction() -> core::result::Result<(), failure::Error> {
Expand Down
2 changes: 1 addition & 1 deletion token-core/tcx-btc-kin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"

[dependencies]
tcx-crypto = { path = "../tcx-crypto" }
tcx-chain = { path = "../tcx-chain" }
tcx-keystore = { path = "../tcx-keystore" }
tcx-primitive = { path = "../tcx-primitive" }
tcx-constants = { path = "../tcx-constants" }
tcx-common = { path = "../tcx-common" }
Expand Down
4 changes: 2 additions & 2 deletions token-core/tcx-btc-kin/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use bitcoin::{Address as LibAddress, Script};
use bitcoin_hashes::Hash;
use secp256k1::Secp256k1;

use tcx_chain::Address;
use tcx_constants::CoinInfo;
use tcx_keystore::Address;
use tcx_primitive::{Ss58Codec, TypedPrivateKey, TypedPublicKey};

use crate::network::BtcKinNetwork;
Expand Down Expand Up @@ -294,7 +294,7 @@ mod tests {
use tcx_primitive::{Bip32DeterministicPrivateKey, Derive, DeterministicPrivateKey, Ss58Codec};

use crate::address::BtcKinAddress;
use crate::tcx_chain::Address;
use crate::tcx_keystore::Address;
use crate::BtcKinNetwork;

#[test]
Expand Down
4 changes: 2 additions & 2 deletions token-core/tcx-btc-kin/src/bch_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use core::result;

use std::fmt::{Display, Formatter};
use std::str::FromStr;
use tcx_chain::Address;
use tcx_constants::CoinInfo;
use tcx_keystore::Address;
use tcx_primitive::TypedPublicKey;

fn remove_bch_prefix(addr: &str) -> String {
Expand Down Expand Up @@ -108,9 +108,9 @@ mod tests {
use super::{remove_bch_prefix, BchAddress};

use crate::address::WIFDisplay;
use tcx_chain::Address;
use tcx_constants::coin_info::coin_info_from_param;
use tcx_constants::{CoinInfo, CurveType};
use tcx_keystore::Address;
use tcx_primitive::{PrivateKey, Secp256k1PrivateKey, TypedPublicKey};
use tcx_primitive::{PublicKey, TypedPrivateKey};

Expand Down
12 changes: 6 additions & 6 deletions token-core/tcx-btc-kin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ extern crate num_integer;
extern crate num_traits;

#[macro_use]
extern crate tcx_chain;
extern crate tcx_keystore;
extern crate core;

pub type Result<T> = result::Result<T, failure::Error>;

pub use address::{BtcKinAddress, WIFDisplay};
pub use bch_address::BchAddress;
pub use network::BtcKinNetwork;
use tcx_chain::{Address, Keystore};
use tcx_keystore::{Address, Keystore};
use tcx_primitive::{
Bip32DeterministicPublicKey, Derive, DeterministicPublicKey, FromHex, TypedPublicKey,
};
Expand Down Expand Up @@ -64,8 +64,8 @@ pub enum Error {

pub mod bitcoin {
use crate::{BtcKinAddress, BITCOIN, LITECOIN};
use tcx_chain::{Account, Keystore};
use tcx_constants::CoinInfo;
use tcx_keystore::{Account, Keystore};

pub const CHAINS: [&'static str; 2] = [BITCOIN, LITECOIN];

Expand Down Expand Up @@ -172,8 +172,8 @@ pub fn calc_btc_change_address(

pub mod bitcoincash {
use crate::BITCOINCASH;
use tcx_chain::{Account, Keystore};
use tcx_constants::{CoinInfo, CurveType};
use tcx_keystore::{Account, Keystore};

pub static CHAINS: [&'static str; 1] = [BITCOINCASH];

Expand Down Expand Up @@ -225,10 +225,10 @@ mod tests {

use serde_json::Value;

use tcx_chain::KeystoreGuard;
use tcx_chain::{HdKeystore, Keystore, Metadata};
use tcx_constants::CurveType;
use tcx_constants::{CoinInfo, TEST_MNEMONIC, TEST_PASSWORD};
use tcx_keystore::KeystoreGuard;
use tcx_keystore::{HdKeystore, Keystore, Metadata};

const BIP_PATH: &str = "m/44'/145'/0'";

Expand Down
Loading

0 comments on commit 7794140

Please sign in to comment.