Enum kaspa_txscript::script_class::ScriptClass
source · #[repr(u8)]
pub enum ScriptClass {
NonStandard,
PubKey,
PubKeyECDSA,
ScriptHash,
}
Expand description
Standard classes of script payment in the blockDAG
Variants§
NonStandard
None of the recognized forms
PubKey
Pay to pubkey
PubKeyECDSA
Pay to pubkey ECDSA
ScriptHash
Pay to script hash
Implementations§
source§impl ScriptClass
impl ScriptClass
pub fn from_script(script_public_key: &ScriptPublicKey) -> Self
pub fn is_pay_to_pubkey(script_public_key: &[u8]) -> bool
sourcepub fn is_pay_to_pubkey_ecdsa(script_public_key: &[u8]) -> bool
pub fn is_pay_to_pubkey_ecdsa(script_public_key: &[u8]) -> bool
transaction, false otherwise.
sourcepub fn is_pay_to_script_hash(script_public_key: &[u8]) -> bool
pub fn is_pay_to_script_hash(script_public_key: &[u8]) -> bool
Returns true if the script is in the standard pay-to-script-hash (P2SH) format, false otherwise.
pub fn version(&self) -> ScriptPublicKeyVersion
Trait Implementations§
source§impl BorshDeserialize for ScriptClass
impl BorshDeserialize for ScriptClass
source§impl BorshSchema for ScriptClass
impl BorshSchema for ScriptClass
source§fn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
source§fn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
fn add_definitions_recursively( definitions: &mut HashMap<Declaration, Definition> )
Recursively, using DFS, add type definitions required for this type. For primitive types
this is an empty map. Type definition explains how to serialize/deserialize a type.
source§fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
fn add_definition( declaration: String, definition: Definition, definitions: &mut HashMap<String, Definition, RandomState> )
Helper method to add a single type definition to the map.
fn schema_container() -> BorshSchemaContainer
source§impl BorshSerialize for ScriptClass
impl BorshSerialize for ScriptClass
source§impl Clone for ScriptClass
impl Clone for ScriptClass
source§fn clone(&self) -> ScriptClass
fn clone(&self) -> ScriptClass
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 ScriptClass
impl Debug for ScriptClass
source§impl<'de> Deserialize<'de> for ScriptClass
impl<'de> Deserialize<'de> for ScriptClass
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for ScriptClass
impl Display for ScriptClass
source§impl From<Version> for ScriptClass
impl From<Version> for ScriptClass
source§impl FromStr for ScriptClass
impl FromStr for ScriptClass
source§impl PartialEq<ScriptClass> for ScriptClass
impl PartialEq<ScriptClass> for ScriptClass
source§fn eq(&self, other: &ScriptClass) -> bool
fn eq(&self, other: &ScriptClass) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ScriptClass
impl Serialize for ScriptClass
source§impl TryFrom<&str> for ScriptClass
impl TryFrom<&str> for ScriptClass
impl Eq for ScriptClass
impl StructuralEq for ScriptClass
impl StructuralPartialEq for ScriptClass
Auto Trait Implementations§
impl RefUnwindSafe for ScriptClass
impl Send for ScriptClass
impl Sync for ScriptClass
impl Unpin for ScriptClass
impl UnwindSafe for ScriptClass
Blanket Implementations§
§impl<T> CastFrom for Twhere
T: Any + 'static,
impl<T> CastFrom for Twhere T: Any + 'static,
§fn ref_any(&self) -> &(dyn Any + 'static)
fn ref_any(&self) -> &(dyn Any + 'static)
Returns a immutable reference to
Any
, which is backed by the type implementing this trait.§fn mut_any(&mut self) -> &mut (dyn Any + 'static)
fn mut_any(&mut self) -> &mut (dyn Any + 'static)
Returns a mutable reference to
Any
, which is backed by the type implementing this trait.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.