-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move Merkle ledger tests to Alcotest #15744
Conversation
!ci-build-me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the refactor logic makes sense to me, but i think this is breaking dev unit tests right now. The syncable ledger tests seem to reference merkle_ledger_tests
.
!ci-build-me |
1 similar comment
!ci-build-me |
- dune: sort dependencies by alphabetical order - dune: removed dependency on ppx_inline_test
Avoid mixing sprintf and ^ string concatenation operator
71e63ac
to
070a164
Compare
!ci-build-me |
1 similar comment
!ci-build-me |
!ci-build-me |
@@ -59,12 +59,12 @@ module Hash = struct | |||
* important impossible to create an account such that (merge a b = hash_account account) *) | |||
|
|||
let hash_account account = | |||
Md5.digest_string ("0" ^ Format.sprintf !"%{sexp: Account.t}" account) | |||
Md5.digest_string (Format.sprintf !"0%{sexp: Account.t}" account) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the only non-refactoring code modification of this PR @rbonichon ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of. This is also refactoring, isn't it?. But this is why there is a different commit for this change. We could remove it. But I'm not sure it's worth making a separate PR for this specific change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's alright to keep it as is
accum + Balance.to_nanomina_int (Account.balance acct) | ||
in | ||
let parent_sum = | ||
Maskable.foldi maskable ~init:0 ~f:balance_summer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maskable.foldi maskable ~init:0 ~f:balance_summer | |
Maskable.fold maskable ~init:0 ~f:balance_summer |
and remove unused parameter from the balance_summer
function (same modification could be applied below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately fold
does not exist.
@@ -156,477 +172,505 @@ module Make (Test : Test_intf) = struct | |||
in | |||
test_hashes_at_address addr | |||
|
|||
let%test "parent, mask agree on set" = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand correctly that this test was written twice (same code, duplicated)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly
!ci-build-me |
Use
alcotest
to express tests for Merkle ledger(s).Sneaked in a small update in one the test Modules.