pub struct WitnessSet {
pub vkeywitness: Option<NonEmptyVec<VKeyWitness>>,
pub native_script: Option<NonEmptyVec<MemoizedNativeScript>>,
pub bootstrap_witness: Option<NonEmptyVec<BootstrapWitness>>,
pub plutus_v1_script: Option<NonEmptyVec<PlutusScript<1>>>,
pub plutus_data: Option<NonEmptyVec<MemoizedPlutusData>>,
pub redeemer: Option<Redeemers>,
pub plutus_v2_script: Option<NonEmptyVec<PlutusScript<2>>>,
pub plutus_v3_script: Option<NonEmptyVec<PlutusScript<3>>>,
}Expand description
FIXME: Accidentally not a set
NonEmptyVec below are supposed to be a NonEmptySet where duplicates would fail to decode. But it isn’t. In the Haskell’s codebsae, the default decoder for Set fails on duplicate starting from v9 and above:
However, the decoders for witnesses fields were (accidentally) overridden and did not use the
default Set implementation. So, duplicates were silently ignored instead of leading to
decoder failure (while still allowing a set tag, and still expecting at least one element):
Importantly, this behaviour is changing again in v12, back to being a non-empty set / maps.
Fields§
§vkeywitness: Option<NonEmptyVec<VKeyWitness>>§native_script: Option<NonEmptyVec<MemoizedNativeScript>>§bootstrap_witness: Option<NonEmptyVec<BootstrapWitness>>FIXME: Accidentally not a set
See note on vkeywitness.
plutus_v1_script: Option<NonEmptyVec<PlutusScript<1>>>§plutus_data: Option<NonEmptyVec<MemoizedPlutusData>>§redeemer: Option<Redeemers>§plutus_v2_script: Option<NonEmptyVec<PlutusScript<2>>>§plutus_v3_script: Option<NonEmptyVec<PlutusScript<3>>>Implementations§
Source§impl WitnessSet
impl WitnessSet
Sourcepub fn get_provided_scripts(&self) -> BTreeMap<Hash<SCRIPT>, ScriptKind>
pub fn get_provided_scripts(&self) -> BTreeMap<Hash<SCRIPT>, ScriptKind>
Collect provided scripts and compute each ScriptHash in a witness set
Trait Implementations§
Source§impl Clone for WitnessSet
impl Clone for WitnessSet
Source§fn clone(&self) -> WitnessSet
fn clone(&self) -> WitnessSet
Returns a duplicate 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 WitnessSet
impl Debug for WitnessSet
Source§impl<'bytes, Ctx> Decode<'bytes, Ctx> for WitnessSet
impl<'bytes, Ctx> Decode<'bytes, Ctx> for WitnessSet
Source§impl Default for WitnessSet
impl Default for WitnessSet
Source§fn default() -> WitnessSet
fn default() -> WitnessSet
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for WitnessSet
impl<'de> Deserialize<'de> for WitnessSet
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<Ctx> Encode<Ctx> for WitnessSet
impl<Ctx> Encode<Ctx> for WitnessSet
Source§impl PartialEq for WitnessSet
impl PartialEq for WitnessSet
Source§impl Serialize for WitnessSet
impl Serialize for WitnessSet
impl Eq for WitnessSet
impl StructuralPartialEq for WitnessSet
Auto Trait Implementations§
impl Freeze for WitnessSet
impl RefUnwindSafe for WitnessSet
impl Send for WitnessSet
impl Sync for WitnessSet
impl Unpin for WitnessSet
impl UnsafeUnpin for WitnessSet
impl UnwindSafe for WitnessSet
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more