mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 12:49:23 +00:00
Make coin a dedicated library
Closes https://github.com/serai-dex/serai/issues/128.
This commit is contained in:
@@ -5,8 +5,9 @@ use thiserror::Error;
|
||||
|
||||
use frost::{curve::Curve, FrostError};
|
||||
|
||||
mod coin;
|
||||
pub use serai_coin as coin;
|
||||
use coin::{CoinError, Coin};
|
||||
|
||||
mod wallet;
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -29,10 +30,3 @@ pub enum SignError {
|
||||
#[error("network had an error {0}")]
|
||||
NetworkError(NetworkError),
|
||||
}
|
||||
|
||||
// Generate a static view key for a given chain in a globally consistent manner
|
||||
// Doesn't consider the current group key to increase the simplicity of verifying Serai's status
|
||||
// Takes an index, k, for more modern privacy protocols which use multiple view keys
|
||||
pub fn view_key<C: Coin>(k: u64) -> <C::Curve as Curve>::F {
|
||||
C::Curve::hash_to_F(b"Serai DEX View Key", &[C::ID, &k.to_le_bytes()].concat())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user