From a95fab3a303d22923a7e5a9b5dce503a376af46e Mon Sep 17 00:00:00 2001 From: Alex Coats Date: Wed, 13 Sep 2023 16:56:32 -0400 Subject: [PATCH] comments and derive --- sdk/src/types/block/address/mod.rs | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/sdk/src/types/block/address/mod.rs b/sdk/src/types/block/address/mod.rs index e955f880e3..7662268326 100644 --- a/sdk/src/types/block/address/mod.rs +++ b/sdk/src/types/block/address/mod.rs @@ -33,22 +33,22 @@ pub enum Address { /// An Ed25519 address. #[packable(tag = Ed25519Address::KIND)] Ed25519(Ed25519Address), - /// An Ed25519 address. + /// A restricted Ed25519 address. #[packable(tag = Restricted::::KIND)] RestrictedEd25519(Restricted), /// An account address. #[packable(tag = AccountAddress::KIND)] Account(AccountAddress), - /// An account address. + /// A restricted account address. #[packable(tag = Restricted::::KIND)] RestrictedAccount(Restricted), /// An NFT address. #[packable(tag = NftAddress::KIND)] Nft(NftAddress), - /// An NFT address. + /// A restricted NFT address. #[packable(tag = Restricted::::KIND)] RestrictedNft(Restricted), - /// An NFT address. + /// An implicit account creation address. #[packable(tag = ImplicitAccountCreationAddress::KIND)] ImplicitAccountCreation(ImplicitAccountCreationAddress), } @@ -323,7 +323,7 @@ impl CapabilityFlag { pub const ALL: u8 = u8::MAX; } -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, From, Deref)] +#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, From, Deref, Packable)] #[repr(transparent)] pub struct Capabilities(u8); @@ -348,22 +348,6 @@ impl Capabilities { } } -impl Packable for Capabilities { - type UnpackError = ::UnpackError; - type UnpackVisitor = (); - - fn pack(&self, packer: &mut P) -> Result<(), P::Error> { - self.0.pack(packer) - } - - fn unpack( - unpacker: &mut U, - _visitor: &Self::UnpackVisitor, - ) -> Result> { - u8::unpack::<_, VERIFY>(unpacker, &()).coerce().map(Into::into) - } -} - #[cfg(feature = "serde")] pub(crate) mod dto { use serde::{Deserialize, Serialize};