Skip to content

Commit

Permalink
#derive [unc] PublicKey
Browse files Browse the repository at this point in the history
  • Loading branch information
zwong91 committed Jun 7, 2024
1 parent 65fa63b commit a225524
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ members = [
exclude = ["examples/"]

[workspace.package]
version = "2.1.3"
version = "2.1.4"

# Special triple # comment for ci.
[patch.crates-io]
Expand Down
2 changes: 1 addition & 1 deletion unc-contract-standards/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Utility smart contracts standard library.
"""

[dependencies]
unc-sdk = { path = "../unc-sdk", version = "2.1.2", default-features = false, features = ["legacy"] }
unc-sdk = { path = "../unc-sdk", version = "2.1.4", default-features = false, features = ["legacy"] }

[dev-dependencies]
unc-sdk = { path = "../unc-sdk", default-features = false, features = ["unit-testing"] }
Expand Down
4 changes: 2 additions & 2 deletions unc-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ required-features = ["abi", "unstable"]
# Provide unc_bidgen macros.
serde = { version = "1", features = ["derive"] }
serde_json = "1"
unc-sdk-macros = { path = "../unc-sdk-macros", version = "2.1.3" }
unc-sys = { path = "../unc-sys", version = "2.1.3" }
unc-sdk-macros = { path = "../unc-sdk-macros", version = "2.1.4" }
unc-sys = { path = "../unc-sys", version = "2.1.4" }
base64 = "0.22.0"
borsh = { version = "1.0.0", features = ["derive"] }
bs58 = "0.5"
Expand Down
11 changes: 2 additions & 9 deletions unc-sdk/src/types/public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ impl TryFrom<PublicKey> for unc_crypto::PublicKey {
/// .parse()
/// .unwrap();
/// ```
#[derive(Debug, Clone, PartialEq, PartialOrd, Ord, Eq, BorshSerialize, Hash)]
#[unc(inside_uncsdk)]
#[derive(Debug, Clone, PartialEq, PartialOrd, Ord, Eq, Hash)]
pub struct PublicKey {
data: Vec<u8>,
}
Expand Down Expand Up @@ -177,14 +178,6 @@ impl serde::Serialize for PublicKey {
}
}

impl BorshDeserialize for PublicKey {
fn deserialize_reader<R: io::Read>(reader: &mut R) -> io::Result<Self> {
<Vec<u8> as BorshDeserialize>::deserialize_reader(reader).and_then(|s| {
Self::try_from(s).map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))
})
}
}

impl<'de> serde::Deserialize<'de> for PublicKey {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
Expand Down

0 comments on commit a225524

Please sign in to comment.