pub enum WitnessOrd {
Mined(WitnessPos),
Tentative,
Ignored,
Archived,
}Expand description
RGB consensus information about the status of a witness transaction. This information is used in ordering state transitions during the validation, as well as consensus ordering of the contract global state data, as they are presented to all contract users.
Variants§
Mined(WitnessPos)
Transaction is included into layer 1 blockchain at a specific height and timestamp.
NB: only timestamp is used in consensus ordering though, see
WitnessPos::cmp for the details.
Tentative
Valid witness transaction which commits the most recent RGB state, but is not (yet) included into a layer 1 blockchain. Such transactions have a higher priority over onchain transactions (i.e. they are processed by the VM at the very end, and their global state becomes at the top of the contract state).
NB: not each and every signed offchain transaction should have this
status; all offchain cases which fall under Self::Archived must be
excluded. Valid cases for assigning Self::Tentative status are:
- transaction is present in the memepool;
- transaction is a part of transaction graph inside a state channel (only actual channel
state is accounted for; all previous channel state must have corresponding transactions
set to
Self::Archived); - transaction is an RBF replacement prepared to be broadcast (with the previous transaction
set to
Self::Archivedat the same moment).
Ignored
Witness transaction must be ignored by the update witnesses process.
Archived
Witness transaction must be excluded from the state processing.
Cases for the exclusion:
- transaction was removed from blockchain after a re-org and its inputs were spent by other transaction;
- previous transaction(s) after RBF replacement, once it is excluded from the mempool and replaced by RBFed successors;
- past state channel transactions once a new channel state is signed (and until they may become valid once again due to an uncooperative channel closing).
Implementations§
Trait Implementations§
Source§impl Clone for WitnessOrd
impl Clone for WitnessOrd
Source§fn clone(&self) -> WitnessOrd
fn clone(&self) -> WitnessOrd
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WitnessOrd
impl Debug for WitnessOrd
Source§impl<'de> Deserialize<'de> for WitnessOrd
impl<'de> Deserialize<'de> for WitnessOrd
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WitnessOrd, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WitnessOrd, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for WitnessOrd
impl Display for WitnessOrd
Source§impl From<WitnessPos> for WitnessOrd
impl From<WitnessPos> for WitnessOrd
Source§fn from(v: WitnessPos) -> WitnessOrd
fn from(v: WitnessPos) -> WitnessOrd
Source§impl Hash for WitnessOrd
impl Hash for WitnessOrd
Source§impl Ord for WitnessOrd
impl Ord for WitnessOrd
Source§fn cmp(&self, other: &WitnessOrd) -> Ordering
fn cmp(&self, other: &WitnessOrd) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for WitnessOrd
impl PartialEq for WitnessOrd
Source§impl PartialOrd for WitnessOrd
impl PartialOrd for WitnessOrd
Source§impl Serialize for WitnessOrd
impl Serialize for WitnessOrd
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl StrictDecode for WitnessOrd
impl StrictDecode for WitnessOrd
fn strict_decode(reader: &mut impl TypedRead) -> Result<WitnessOrd, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDumb for WitnessOrd
impl StrictDumb for WitnessOrd
fn strict_dumb() -> WitnessOrd
Source§impl StrictEncode for WitnessOrd
impl StrictEncode for WitnessOrd
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
W: TypedWrite,
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictSum for WitnessOrd
impl StrictSum for WitnessOrd
const ALL_VARIANTS: &'static [(u8, &'static str)]
fn variant_name(&self) -> &'static str
fn strict_check_variants()
fn variant_name_by_tag(tag: u8) -> Option<VariantName>
fn variant_ord(&self) -> u8
Source§impl StrictType for WitnessOrd
impl StrictType for WitnessOrd
const STRICT_LIB_NAME: &'static str = LIB_NAME_RGB_LOGIC
fn strict_name() -> Option<TypeName>
Source§impl StrictUnion for WitnessOrd
impl StrictUnion for WitnessOrd
fn strict_type_info() -> TypeInfo<Self>
impl Copy for WitnessOrd
impl Eq for WitnessOrd
impl StructuralPartialEq for WitnessOrd
Auto Trait Implementations§
impl Freeze for WitnessOrd
impl RefUnwindSafe for WitnessOrd
impl Send for WitnessOrd
impl Sync for WitnessOrd
impl Unpin for WitnessOrd
impl UnwindSafe for WitnessOrd
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.