Skip to content

Commit

Permalink
Formatting fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom committed Sep 23, 2020
1 parent b6cd096 commit 5363ce9
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions zcash_extensions/src/transparent/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,17 @@ impl FromPayload for Precondition {

fn from_payload(mode: u32, payload: &[u8]) -> Result<Self, Self::Error> {
match mode {
open::MODE =>
payload.try_into()
.map_err(|_| Error::IllegalPayloadLength(payload.len()))
.map(open::Precondition)
.map(Precondition::Open),
close::MODE =>
payload.try_into()
.map_err(|_| Error::IllegalPayloadLength(payload.len()))
.map(close::Precondition)
.map(Precondition::Close),
open::MODE => payload
.try_into()
.map_err(|_| Error::IllegalPayloadLength(payload.len()))
.map(open::Precondition)
.map(Precondition::Open),

close::MODE => payload
.try_into()
.map_err(|_| Error::IllegalPayloadLength(payload.len()))
.map(close::Precondition)
.map(Precondition::Close),

_ => Err(Error::ModeInvalid(mode)),
}
Expand Down Expand Up @@ -189,18 +189,18 @@ impl FromPayload for Witness {

fn from_payload(mode: u32, payload: &[u8]) -> Result<Self, Self::Error> {
match mode {
open::MODE =>
payload.try_into()
.map_err(|_| Error::IllegalPayloadLength(payload.len()))
.map(open::Witness)
.map(Witness::Open),
close::MODE =>
payload.try_into()
.map_err(|_| Error::IllegalPayloadLength(payload.len()))
.map(close::Witness)
.map(Witness::Close),
open::MODE => payload
.try_into()
.map_err(|_| Error::IllegalPayloadLength(payload.len()))
.map(open::Witness)
.map(Witness::Open),

close::MODE => payload
.try_into()
.map_err(|_| Error::IllegalPayloadLength(payload.len()))
.map(close::Witness)
.map(Witness::Close),

_ => Err(Error::ModeInvalid(mode)),
}
}
Expand Down

0 comments on commit 5363ce9

Please sign in to comment.