[][src]Struct exonum_btc_anchoring::btc::Payload

pub struct Payload {
    pub block_height: Height,
    pub block_hash: Hash,
    pub prev_tx_chain: Option<Sha256d>,
}

Anchoring transaction payload.

Data layout in OP_RETURN script for Payload v.1:

Position in bytesDescription
0..6ASCII-encoded prefix EXONUM
6Version byte, currently is 1
7Payload kind: (0 is regular, 1 is recover)
8..16Block height
16..48Block hash
48..80 (Optionally)Txid of previous tx chain (only for recover kind)

In this way the length of regular payload is 48, and for recover is 80.

Fields

block_height: Height

Anchored block height.

block_hash: Hash

Anchored block hash.

prev_tx_chain: Option<Sha256d>

Txid of previous transactions chain if it has been lost.

Methods

impl Payload[src]

pub fn from_script(script: &Script) -> Option<Self>[src]

Tries to extract payload from given Script.

Trait Implementations

impl Clone for Payload[src]

impl Debug for Payload[src]

impl<'de> Deserialize<'de> for Payload[src]

impl PartialEq<Payload> for Payload[src]

impl Serialize for Payload[src]

impl StructuralPartialEq for Payload[src]

Auto Trait Implementations

impl RefUnwindSafe for Payload

impl Send for Payload

impl Sync for Payload

impl Unpin for Payload

impl UnwindSafe for Payload

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,