1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-25 04:17:59 +01:00

Adjust expected test result, and explain the difference

This commit is contained in:
Heiko Schaefer 2023-07-17 01:16:17 +02:00
parent 80a95684d8
commit 077641c803
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D

View file

@ -317,11 +317,27 @@ class AuthenticateTest {
Pair(20, listOf(t.aliceFpr, t.bobFpr, t.georgeFpr)), Pair(20, listOf(t.aliceFpr, t.bobFpr, t.georgeFpr)),
), 240) ), 240)
// NOTE: original expectation from sequoia-wot:
// sp(q3, t.henryFpr, t.henryUid,
// listOf(Pair(60, listOf(t.aliceFpr, t.bobFpr, t.georgeFpr, t.henryFpr)),
// Pair(60, listOf(t.jennyFpr, t.georgeFpr, t.henryFpr))
// ), null)
// NOTE: Adjusted expectation for pgpainless.
// sequoia-wot searches for paths in a very specific way:
// backward_propagate() gets called twice in succession, from `authenticate()`, with two different search
// modes. The results get merged in a very specific way. In this test, that approach leads to a different
// distribution of trust amounts found for the two paths, which also happens to switch the ordering of the
// two paths.
// Note that the authentication result (the trust amount) remains unchanged, the total flow of 120 remains,
// it's just distributed differently between the two available paths. Both results are correct.
sp(q3, t.henryFpr, t.henryUid, sp(q3, t.henryFpr, t.henryUid,
listOf(Pair(60, listOf(t.aliceFpr, t.bobFpr, t.georgeFpr, t.henryFpr)), listOf(Pair(100, listOf(t.jennyFpr, t.georgeFpr, t.henryFpr)),
Pair(60, listOf(t.jennyFpr, t.georgeFpr, t.henryFpr)) Pair(20, listOf(t.aliceFpr, t.bobFpr, t.georgeFpr, t.henryFpr))
), null) ), null)
sp(q3, t.isaacFpr, t.isaacUid, listOf(Pair(60, listOf(t.aliceFpr, t.bobFpr, t.georgeFpr, t.henryFpr, t.isaacFpr))), null) sp(q3, t.isaacFpr, t.isaacUid, listOf(Pair(60, listOf(t.aliceFpr, t.bobFpr, t.georgeFpr, t.henryFpr, t.isaacFpr))), null)
sp(q3, t.jennyFpr, t.jennyUid, listOf(Pair(120, listOf(t.jennyFpr))), null) sp(q3, t.jennyFpr, t.jennyUid, listOf(Pair(120, listOf(t.jennyFpr))), null)