Struct exonum_btc_anchoring::blockchain::AnchoringSchema
[−]
[src]
pub struct AnchoringSchema<T> { /* fields omitted */ }
Anchoring information schema.
Methods
impl<T> AnchoringSchema<T> where
T: AsRef<Snapshot>,
[src]
T: AsRef<Snapshot>,
pub fn new(snapshot: T) -> AnchoringSchema<T>
[src]
Creates anchoring schema for the given snapshot
.
pub fn signatures(&self, txid: &TxId) -> ListIndex<&T, MsgAnchoringSignature>
[src]
Returns table that contains signatures for the anchoring transaction with
the given normalized txid
.
pub fn lects(
&self,
validator_key: &PublicKey
) -> ProofListIndex<&T, LectContent>
[src]
&self,
validator_key: &PublicKey
) -> ProofListIndex<&T, LectContent>
Returns table that saves a list of lects for the validator with the given validator_key
.
pub fn lect_indexes(&self, validator_key: &PublicKey) -> MapIndex<&T, TxId, u64>
[src]
Returns table that keeps the lect index for every anchoring txid for the validator
with given validator_key
.
pub fn known_signatures(
&self
) -> MapIndex<&T, KnownSignatureId, MsgAnchoringSignature>
[src]
&self
) -> MapIndex<&T, KnownSignatureId, MsgAnchoringSignature>
Returns the table of known signatures, where key is the tuple (txid, validator_id, input)
.
pub fn known_txs(&self) -> MapIndex<&T, TxId, BitcoinTx>
[src]
Returns the table that keeps the anchoring transaction for any known txid.
pub fn anchoring_tx_chain(&self) -> MapIndex<&T, u64, AnchoringTx>
[src]
Returns table that maps anchoring transactions to their heights.
pub fn actual_anchoring_config(&self) -> AnchoringConfig
[src]
Returns the actual anchoring configuration.
pub fn following_anchoring_config(&self) -> Option<AnchoringConfig>
[src]
Returns the nearest following configuration if it exists.
pub fn previous_anchoring_config(&self) -> Option<AnchoringConfig>
[src]
Returns the previous anchoring configuration if it exists.
pub fn genesis_anchoring_config(&self) -> AnchoringConfig
[src]
Returns the anchoring configuration from the genesis block.
pub fn anchoring_config_by_height(&self, height: Height) -> AnchoringConfig
[src]
Returns the configuration that is the actual for the given height
.
For non-existent heights, it will return the configuration closest to them.
pub fn lect(&self, validator_key: &PublicKey) -> Option<BitcoinTx>
[src]
Returns lect
for validator with the given public_key
.
pub fn prev_lect(&self, validator_key: &PublicKey) -> Option<BitcoinTx>
[src]
Returns previous lect
for validator with the given public_key
.
pub fn collect_lects(&self, cfg: &AnchoringConfig) -> Option<BitcoinTx>
[src]
Returns a lect that is currently supported by at least 2/3 of the current set of validators.
pub fn find_lect_position(
&self,
anchoring_key: &PublicKey,
txid: &TxId
) -> Option<u64>
[src]
&self,
anchoring_key: &PublicKey,
txid: &TxId
) -> Option<u64>
Returns position in lects
table of validator with the given anchoring_key
for transaction with the given txid
.
pub fn state_hash(&self) -> Vec<Hash>
[src]
Returns the state_hash
for anchoring tables.
It contains a list of root_hash
of the actual lects
tables.
impl<'a> AnchoringSchema<&'a mut Fork>
[src]
pub fn signatures_mut(
&mut self,
txid: &TxId
) -> ListIndex<&mut Fork, MsgAnchoringSignature>
[src]
&mut self,
txid: &TxId
) -> ListIndex<&mut Fork, MsgAnchoringSignature>
Mutable variant of the signatures
index.
pub fn lects_mut(
&mut self,
validator_key: &PublicKey
) -> ProofListIndex<&mut Fork, LectContent>
[src]
&mut self,
validator_key: &PublicKey
) -> ProofListIndex<&mut Fork, LectContent>
Mutable variant of the lects
index.
pub fn lect_indexes_mut(
&mut self,
validator_key: &PublicKey
) -> MapIndex<&mut Fork, TxId, u64>
[src]
&mut self,
validator_key: &PublicKey
) -> MapIndex<&mut Fork, TxId, u64>
Mutable variant of the lect_indexes
index.
pub fn known_signatures_mut(
&mut self
) -> MapIndex<&mut Fork, KnownSignatureId, MsgAnchoringSignature>
[src]
&mut self
) -> MapIndex<&mut Fork, KnownSignatureId, MsgAnchoringSignature>
Mutable variant of the known_signatures
index.
pub fn known_txs_mut(&mut self) -> MapIndex<&mut Fork, TxId, BitcoinTx>
[src]
Mutable variant of the known_txs
index.
pub fn anchoring_tx_chain_mut(
&mut self
) -> MapIndex<&mut Fork, u64, AnchoringTx>
[src]
&mut self
) -> MapIndex<&mut Fork, u64, AnchoringTx>
Mutable variant of the signatures
index.
pub fn create_genesis_config(&mut self, cfg: &AnchoringConfig)
[src]
Creates and commits the genesis anchoring configuration from the proposed cfg
.
pub fn add_lect<Tx>(
&mut self,
validator_key: &PublicKey,
tx: Tx,
msg_hash: Hash
) where
Tx: Into<BitcoinTx>,
[src]
&mut self,
validator_key: &PublicKey,
tx: Tx,
msg_hash: Hash
) where
Tx: Into<BitcoinTx>,
Adds lect
from validator with the given public key
.
pub fn add_known_signature(
&mut self,
msg: MsgAnchoringSignature
) -> Result<(), ValidateError>
[src]
&mut self,
msg: MsgAnchoringSignature
) -> Result<(), ValidateError>
Adds signature to known if it is correct.
impl<T> AnchoringSchema<T>
[src]
pub fn into_snapshot(self) -> T
[src]
Converts schema back into snapshot.
Trait Implementations
impl<T: Debug> Debug for AnchoringSchema<T>
[src]
Auto Trait Implementations
impl<T> Send for AnchoringSchema<T> where
T: Send,
T: Send,
impl<T> Sync for AnchoringSchema<T> where
T: Sync,
T: Sync,