Struct cardano_serialization_lib::crypto::TransactionHash
source · pub struct TransactionHash(_);
Implementations§
source§impl TransactionHash
impl TransactionHash
pub fn from_bytes(bytes: Vec<u8>) -> Result<TransactionHash, DeserializeError>
source§impl TransactionHash
impl TransactionHash
sourcepub fn to_bytes(&self) -> Vec<u8>
pub fn to_bytes(&self) -> Vec<u8>
Examples found in repository?
src/utils.rs (line 1194)
1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213
pub fn make_daedalus_bootstrap_witness(
tx_body_hash: &TransactionHash,
addr: &ByronAddress,
key: &LegacyDaedalusPrivateKey,
) -> BootstrapWitness {
let chain_code = key.chaincode();
let pubkey = Bip32PublicKey::from_bytes(&key.0.to_public().as_ref()).unwrap();
let vkey = Vkey::new(&pubkey.to_raw_key());
let signature =
Ed25519Signature::from_bytes(key.0.sign(&tx_body_hash.to_bytes()).as_ref().to_vec())
.unwrap();
BootstrapWitness::new(&vkey, &signature, chain_code, addr.attributes())
}
#[wasm_bindgen]
pub fn make_icarus_bootstrap_witness(
tx_body_hash: &TransactionHash,
addr: &ByronAddress,
key: &Bip32PrivateKey,
) -> BootstrapWitness {
let chain_code = key.chaincode();
let raw_key = key.to_raw_key();
let vkey = Vkey::new(&raw_key.to_public());
let signature = raw_key.sign(&tx_body_hash.to_bytes());
BootstrapWitness::new(&vkey, &signature, chain_code, addr.attributes())
}
pub fn to_bech32(&self, prefix: &str) -> Result<String, JsError>
pub fn from_bech32(bech_str: &str) -> Result<TransactionHash, JsError>
pub fn to_hex(&self) -> String
pub fn from_hex(hex: &str) -> Result<TransactionHash, JsError>
source§impl TransactionHash
impl TransactionHash
pub const BYTE_COUNT: usize = 32usize
Trait Implementations§
source§impl Clone for TransactionHash
impl Clone for TransactionHash
source§fn clone(&self) -> TransactionHash
fn clone(&self) -> TransactionHash
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 TransactionHash
impl Debug for TransactionHash
source§impl<'de> Deserialize<'de> for TransactionHash
impl<'de> Deserialize<'de> for TransactionHash
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 Deserialize for TransactionHash
impl Deserialize for TransactionHash
fn deserialize<R: BufRead>(
raw: &mut Deserializer<R>
) -> Result<Self, DeserializeError>
source§impl Display for TransactionHash
impl Display for TransactionHash
source§impl Hash for TransactionHash
impl Hash for TransactionHash
source§impl JsonSchema for TransactionHash
impl JsonSchema for TransactionHash
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl Ord for TransactionHash
impl Ord for TransactionHash
source§fn cmp(&self, other: &TransactionHash) -> Ordering
fn cmp(&self, other: &TransactionHash) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<TransactionHash> for TransactionHash
impl PartialEq<TransactionHash> for TransactionHash
source§fn eq(&self, other: &TransactionHash) -> bool
fn eq(&self, other: &TransactionHash) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<TransactionHash> for TransactionHash
impl PartialOrd<TransactionHash> for TransactionHash
source§fn partial_cmp(&self, other: &TransactionHash) -> Option<Ordering>
fn partial_cmp(&self, other: &TransactionHash) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more