Enum ckb_client::address::AddressPayload
source · 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 copy 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
source§fn eq(&self, other: &AddressPayload) -> bool
fn eq(&self, other: &AddressPayload) -> bool
This method tests for
self and other values to be equal, and is used
by ==.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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.