Skip to content

Commit 6b4104e

Browse files
binierakoptelov
authored andcommitted
feat(v2/hashing): MinaTransactionTransactionStableV2
1 parent 99ee4f9 commit 6b4104e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mina-p2p-messages/src/v2/hashing.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,22 @@ impl<'de> serde::Deserialize<'de> for TransactionHash {
125125
}
126126
}
127127

128+
impl generated::MinaTransactionTransactionStableV2 {
129+
pub fn hash(&self) -> io::Result<TransactionHash> {
130+
match self {
131+
Self::Command(v) => v.hash(),
132+
Self::FeeTransfer(_) => Err(io::Error::new(
133+
io::ErrorKind::Unsupported,
134+
"fee transfer tx hashing is not yet supported",
135+
)),
136+
Self::Coinbase(_) => Err(io::Error::new(
137+
io::ErrorKind::Unsupported,
138+
"coinbase tx hashing is not yet supported",
139+
)),
140+
}
141+
}
142+
}
143+
128144
impl generated::MinaBaseUserCommandStableV2 {
129145
pub fn hash(&self) -> io::Result<TransactionHash> {
130146
match self {

0 commit comments

Comments
 (0)