Derive Pod/Zeroable for Pubkey
This commit is contained in:
parent
df39b37cb8
commit
f966859829
|
@ -5271,6 +5271,7 @@ dependencies = [
|
||||||
"borsh-derive",
|
"borsh-derive",
|
||||||
"bs58 0.4.0",
|
"bs58 0.4.0",
|
||||||
"bv",
|
"bv",
|
||||||
|
"bytemuck",
|
||||||
"curve25519-dalek 3.2.0",
|
"curve25519-dalek 3.2.0",
|
||||||
"hex",
|
"hex",
|
||||||
"itertools 0.10.1",
|
"itertools 0.10.1",
|
||||||
|
|
|
@ -3135,6 +3135,7 @@ dependencies = [
|
||||||
"borsh-derive",
|
"borsh-derive",
|
||||||
"bs58 0.4.0",
|
"bs58 0.4.0",
|
||||||
"bv",
|
"bv",
|
||||||
|
"bytemuck",
|
||||||
"curve25519-dalek 3.2.0",
|
"curve25519-dalek 3.2.0",
|
||||||
"hex",
|
"hex",
|
||||||
"itertools 0.10.1",
|
"itertools 0.10.1",
|
||||||
|
|
|
@ -16,6 +16,7 @@ blake3 = { version = "1.0.0", features = ["traits-preview"] }
|
||||||
borsh = "0.9.1"
|
borsh = "0.9.1"
|
||||||
borsh-derive = "0.9.1"
|
borsh-derive = "0.9.1"
|
||||||
bs58 = "0.4.0"
|
bs58 = "0.4.0"
|
||||||
|
bytemuck = { version = "1.7.2", features = ["derive"] }
|
||||||
bv = { version = "0.11.1", features = ["serde"] }
|
bv = { version = "0.11.1", features = ["serde"] }
|
||||||
hex = "0.4.2"
|
hex = "0.4.2"
|
||||||
itertools = "0.10.1"
|
itertools = "0.10.1"
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
#![allow(clippy::integer_arithmetic)]
|
#![allow(clippy::integer_arithmetic)]
|
||||||
use crate::{decode_error::DecodeError, hash::hashv};
|
use {
|
||||||
|
crate::{decode_error::DecodeError, hash::hashv},
|
||||||
use borsh::{BorshDeserialize, BorshSchema, BorshSerialize};
|
borsh::{BorshDeserialize, BorshSchema, BorshSerialize},
|
||||||
use num_derive::{FromPrimitive, ToPrimitive};
|
bytemuck::{Pod, Zeroable},
|
||||||
use std::{
|
num_derive::{FromPrimitive, ToPrimitive},
|
||||||
convert::{Infallible, TryFrom},
|
std::{
|
||||||
fmt, mem,
|
convert::{Infallible, TryFrom},
|
||||||
str::FromStr,
|
fmt, mem,
|
||||||
|
str::FromStr,
|
||||||
|
},
|
||||||
|
thiserror::Error,
|
||||||
};
|
};
|
||||||
use thiserror::Error;
|
|
||||||
|
|
||||||
/// Number of bytes in a pubkey
|
/// Number of bytes in a pubkey
|
||||||
pub const PUBKEY_BYTES: usize = 32;
|
pub const PUBKEY_BYTES: usize = 32;
|
||||||
|
@ -48,20 +50,22 @@ impl From<u64> for PubkeyError {
|
||||||
|
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
#[derive(
|
#[derive(
|
||||||
Serialize,
|
AbiExample,
|
||||||
Deserialize,
|
|
||||||
BorshSerialize,
|
|
||||||
BorshDeserialize,
|
BorshDeserialize,
|
||||||
BorshSchema,
|
BorshSchema,
|
||||||
|
BorshSerialize,
|
||||||
Clone,
|
Clone,
|
||||||
Copy,
|
Copy,
|
||||||
Default,
|
Default,
|
||||||
|
Deserialize,
|
||||||
Eq,
|
Eq,
|
||||||
PartialEq,
|
|
||||||
Ord,
|
|
||||||
PartialOrd,
|
|
||||||
Hash,
|
Hash,
|
||||||
AbiExample,
|
Ord,
|
||||||
|
PartialEq,
|
||||||
|
PartialOrd,
|
||||||
|
Pod,
|
||||||
|
Serialize,
|
||||||
|
Zeroable,
|
||||||
)]
|
)]
|
||||||
pub struct Pubkey([u8; 32]);
|
pub struct Pubkey([u8; 32]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue