Skip to content

Commit

Permalink
Add comment and format
Browse files Browse the repository at this point in the history
  • Loading branch information
fmkra committed May 24, 2024
1 parent 528b7c5 commit 114f449
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/core/headers_store.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ trait IHeadersStore<TContractState> {
// @param mmr_id The id of the MMR to clone
// @param last_pos last_pos of the given MMR
// @param new_mmr_id The id of the new MMR
// @dev Notice that to prevent overwriting existing MMRs, a check if the MMR with the new id
// already exists is performed. Because of that MMR root = 0 is reserved for non-existing MMRs,
// so 0 cannot be used as a valid mmr root anywhere.
fn create_branch_from(
ref self: TContractState, mmr_id: MmrId, last_pos: MmrSize, new_mmr_id: MmrId
);
Expand Down
3 changes: 1 addition & 2 deletions src/core/tests/test_headers_store.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ fn test_create_branch_from_message() {

// Root equal to 0 is not allowed.
assert(
dispatcher.create_branch_from_message(0, 1, 0, mmr_id_2).is_err(),
'Root = 0 should fail'
dispatcher.create_branch_from_message(0, 1, 0, mmr_id_2).is_err(), 'Root = 0 should fail'
);

// Creating MMR with the same ID should fail.
Expand Down

0 comments on commit 114f449

Please sign in to comment.