mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-04 22:33:06 +00:00
24 lines
479 B
Rust
24 lines
479 B
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
use crate::signature::PublicKey;
|
|
|
|
#[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct Address {
|
|
value: [u8; 32],
|
|
}
|
|
|
|
impl Address {
|
|
pub fn new(value: [u8; 32]) -> Self {
|
|
Self { value }
|
|
}
|
|
|
|
pub fn from_public_key(public_key: &PublicKey) -> Self {
|
|
// TODO: Check specs
|
|
Address::new(*public_key.value())
|
|
}
|
|
|
|
pub fn value(&self) -> &[u8; 32] {
|
|
&self.value
|
|
}
|
|
}
|