pub enum AddressPayload {
Short {
index: CodeHashIndex,
hash: H160,
},
Full {
hash_type: ScriptHashType,
code_hash: Byte32,
args: Bytes,
},
}Variants§
Implementations§
Source§impl AddressPayload
impl AddressPayload
pub fn new_short(index: CodeHashIndex, hash: H160) -> AddressPayload
pub fn new_full( hash_type: ScriptHashType, code_hash: Byte32, args: Bytes, ) -> AddressPayload
pub fn new_full_data(code_hash: Byte32, args: Bytes) -> AddressPayload
👎Deprecated since 0.100.0-rc5: Use AddressType::Full instead
pub fn new_full_type(code_hash: Byte32, args: Bytes) -> AddressPayload
👎Deprecated since 0.100.0-rc5: Use AddressType::Full instead
pub fn ty(&self, is_new: bool) -> AddressType
pub fn is_short(&self) -> bool
pub fn is_short_acp(&self) -> bool
pub fn hash_type(&self) -> ScriptHashType
Sourcepub fn code_hash(&self, network: Option<NetworkType>) -> Byte32
pub fn code_hash(&self, network: Option<NetworkType>) -> Byte32
Get the code hash of an address
§Panics
When current addres is short format anyone-can-pay address, and the
network type is not Mainnet or Testnet this function will panic.
pub fn args(&self) -> Bytes
pub fn from_pubkey(pubkey: &PublicKey) -> AddressPayload
pub fn from_pubkey_hash(hash: H160) -> AddressPayload
pub fn display_with_network(&self, network: NetworkType, is_new: bool) -> String
Trait Implementations§
Source§impl Clone for AddressPayload
impl Clone for AddressPayload
Source§fn clone(&self) -> AddressPayload
fn clone(&self) -> AddressPayload
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AddressPayload
impl Debug for AddressPayload
Source§impl From<&AddressPayload> for Script
impl From<&AddressPayload> for Script
Source§fn from(payload: &AddressPayload) -> Script
fn from(payload: &AddressPayload) -> Script
Converts to this type from the input type.
Source§impl From<Script> for AddressPayload
impl From<Script> for AddressPayload
Source§fn from(lock: Script) -> AddressPayload
fn from(lock: Script) -> AddressPayload
Converts to this type from the input type.
Source§impl Hash for AddressPayload
impl Hash for AddressPayload
Source§impl PartialEq for AddressPayload
impl PartialEq for AddressPayload
impl Eq for AddressPayload
impl StructuralPartialEq for AddressPayload
Auto Trait Implementations§
impl !Freeze for AddressPayload
impl RefUnwindSafe for AddressPayload
impl Send for AddressPayload
impl Sync for AddressPayload
impl Unpin for AddressPayload
impl UnwindSafe for AddressPayload
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more