Skip to content

Commit

Permalink
finish first attempt at 'impl Payload for Contract'
Browse files Browse the repository at this point in the history
Basically, byte serialization is performed by Contract::serialize_in
there is no auth data, and no certificate slice.
  • Loading branch information
saibatizoku committed Oct 26, 2021
1 parent 952f10f commit 07a2d6f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions chain-impl-mockchain/src/smartcontract/mod.rs
Expand Up @@ -159,15 +159,20 @@ impl Payload for Contract {
type Auth = ();

fn payload_data(&self) -> crate::transaction::PayloadData<Self> {
todo!();
PayloadData(
self.serialize_in(ByteBuilder::new())
.finalize_as_vec()
.into(),
std::marker::PhantomData,
)
}
fn payload_auth_data(_auth: &Self::Auth) -> crate::transaction::PayloadAuthData<Self> {
todo!();
PayloadAuthData(Vec::new().into(), std::marker::PhantomData)
}
fn payload_to_certificate_slice(
_p: crate::transaction::PayloadSlice<'_, Self>,
) -> Option<crate::certificate::CertificateSlice<'_>> {
todo!();
) -> Option<CertificateSlice<'_>> {
None
}
}

Expand Down

0 comments on commit 07a2d6f

Please sign in to comment.