Enum ckb_sdk::AddressPayload
source · [−]pub enum AddressPayload {
Short {
index: CodeHashIndex,
hash: H160,
},
Full {
hash_type: ScriptHashType,
code_hash: Byte32,
args: Bytes,
},
}Variants
Short
Full
Implementations
sourceimpl 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
Use AddressType::Full instead
pub fn new_full_type(code_hash: Byte32, args: Bytes) -> AddressPayload
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
sourceimpl Clone for AddressPayload
impl Clone for AddressPayload
sourcefn clone(&self) -> AddressPayload
fn clone(&self) -> AddressPayload
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for AddressPayload
impl Debug for AddressPayload
sourceimpl From<&AddressPayload> for Script
impl From<&AddressPayload> for Script
sourcefn from(payload: &AddressPayload) -> Script
fn from(payload: &AddressPayload) -> Script
Converts to this type from the input type.
sourceimpl From<Script> for AddressPayload
impl From<Script> for AddressPayload
sourcefn from(lock: Script) -> AddressPayload
fn from(lock: Script) -> AddressPayload
Converts to this type from the input type.
sourceimpl Hash for AddressPayload
impl Hash for AddressPayload
sourceimpl PartialEq<AddressPayload> for AddressPayload
impl PartialEq<AddressPayload> for AddressPayload
sourcefn 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 ==. Read more
sourcefn ne(&self, other: &AddressPayload) -> bool
fn ne(&self, other: &AddressPayload) -> bool
This method tests for !=.
impl Eq for AddressPayload
impl StructuralEq for AddressPayload
impl StructuralPartialEq for AddressPayload
Auto Trait Implementations
impl RefUnwindSafe for AddressPayload
impl Send for AddressPayload
impl Sync for AddressPayload
impl Unpin for AddressPayload
impl UnwindSafe for AddressPayload
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more