Struct exonum_btc_anchoring::api::Payload
[−]
[src]
pub struct Payload { pub block_height: Height, pub block_hash: Hash, pub prev_tx_chain: Option<TxId>, }
Anchoring transaction payload.
Data layout in OP_RETURN
script for Payload
v.1:
| Position in bytes | Description |
|------------------- |---------------------------------------------- |
| 0..6 | ASCII-encoded prefix EXONUM
|
| 6 | Version byte, currently is 1 |
| 7 | Payload kind: (0 is regular, 1 is recover) |
| 8..16 | Block height |
| 16..48 | Block 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<TxId>
Txid
of previous transactions chain if it has been lost.
Methods
impl Payload
[src]
pub fn from_script(script: &Script) -> Option<Payload>
[src]
Tries to extract payload from given Script
Trait Implementations
impl Debug for Payload
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for Payload
[src]
fn clone(&self) -> Payload
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more