Skip to content

Commit

Permalink
refactor: minor fixes and extra comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Oct 12, 2024
1 parent ff55ddd commit b6bb2b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ impl DocumentCreateTransitionActionStructureValidationV0 for DocumentCreateTrans

// Don't do the following validation on testnet before epoch 2080
// As state transitions already happened that would break this validation
// We want to keep both if-s for better readability
#[allow(clippy::collapsible_if)]
if !(network == Network::Testnet && block_info.epoch.index < 2080) {
// Only for contested documents
if document_type
.contested_vote_poll_for_document_properties(self.data(), platform_version)?
.is_some()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,7 @@ mod tests {
.expect("expected a base transition"),
entropy: entropy.0,
data: document_1.clone().properties_consumed(),
// Sending 0 balance that should not be valid
prefunded_voting_balance: None,
}
.into();
Expand Down Expand Up @@ -1397,7 +1398,7 @@ mod tests {
.expect("expected to get back documents")
.documents_owned();

assert!(documents.get(0).is_none());
assert!(documents.first().is_none());
}

#[test]
Expand Down Expand Up @@ -1671,7 +1672,7 @@ mod tests {
.expect("expected to get back documents")
.documents_owned();

assert!(documents.get(0).is_some());
assert!(documents.first().is_some());
}

#[test]
Expand Down

0 comments on commit b6bb2b5

Please sign in to comment.