From be37e4a7874445056afb05deb149a5a418ad55a9 Mon Sep 17 00:00:00 2001 From: Santiago Carmuega Date: Tue, 3 May 2022 13:38:14 -0300 Subject: [PATCH] fix: Provide access to PlutusScript bytes --- pallas-primitives/src/alonzo/model.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pallas-primitives/src/alonzo/model.rs b/pallas-primitives/src/alonzo/model.rs index e7c0993d..c4375458 100644 --- a/pallas-primitives/src/alonzo/model.rs +++ b/pallas-primitives/src/alonzo/model.rs @@ -910,7 +910,13 @@ impl minicbor::encode::Encode for NativeScript { #[derive(Encode, Decode, Debug, PartialEq)] #[cbor(transparent)] -pub struct PlutusScript(#[n(0)] ByteVec); +pub struct PlutusScript(#[n(0)] pub ByteVec); + +impl AsRef<[u8]> for PlutusScript { + fn as_ref(&self) -> &[u8] { + self.0.as_slice() + } +} /* big_int = int / big_uint / big_nint ; New