Skip to content

Commit

Permalink
feat: make PublicAddress and MainKey transparent
Browse files Browse the repository at this point in the history
  • Loading branch information
grumbach authored and joshuef committed Sep 12, 2023
1 parent cc1f0c3 commit c597196
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dbc_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl DerivedKey {
/// corresponding to that DbcId, and thus unlock the value of the Dbc by using that DerivedKey.
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Copy, Debug, PartialEq, Eq, Ord, PartialOrd, Clone)]
pub struct PublicAddress(PublicKey);
pub struct PublicAddress(pub PublicKey);

impl PublicAddress {
pub fn new(public_key: PublicKey) -> Self {
Expand Down Expand Up @@ -117,6 +117,11 @@ impl MainKey {
Self(SerdeSecret(secret_key))
}

/// Get the secret key.
pub fn secret_key(&self) -> &SecretKey {
&self.0
}

/// This is the static public address which is shared with others, and
/// to which payments can be made by getting a new unique identifier for a Dbc to be created.
pub fn public_address(&self) -> PublicAddress {
Expand Down

0 comments on commit c597196

Please sign in to comment.