Janus 5 лет назад
Родитель
Сommit
9f35f9c14e
2 измененных файлов с 6 добавлено и 4 удалено
  1. 3 0
      src/service/btc.rs
  2. 3 4
      src/wallet/cashierdb.rs

+ 3 - 0
src/service/btc.rs

@@ -11,7 +11,10 @@ use bitcoin::network::constants::Network;
 
 use bitcoin::hash_types::PubkeyHash;
 
+// Swap out these types for any future non bitcoin-rs types
 pub type PubAddress = Address;
+pub type PubKey = PublicKey;
+pub type PrivKey = PrivateKey;
 
 pub struct BitcoinKeys {
     secret_key: SecretKey,

+ 3 - 4
src/wallet/cashierdb.rs

@@ -2,10 +2,9 @@ use crate::serial;
 use crate::serial::{deserialize, serialize, Decodable, Encodable};
 use crate::util::join_config_path;
 use crate::{Error, Result};
+use crate::service::btc::{PrivKey, PubKey, PubAddress};
 
 use secp256k1::key::SecretKey;
-use bitcoin::util::ecdsa::{PrivateKey, PublicKey};
-use bitcoin::util::address::Address;
 
 use async_std::sync::{Arc, Mutex};
 use ff::Field;
@@ -56,8 +55,8 @@ impl CashierDb {
     pub fn put_exchange_keys(
         &self,
         dkey_pub: jubjub::SubgroupPoint,
-        btc_private: PrivateKey,
-        btc_public: PublicKey,
+        btc_private: PrivKey,
+        btc_public: PubKey,
         // Successful btc tx id
         txid: String,
     ) -> Result<()> {