A BIP-352 reference fix stops the silent-payments test asserting on nothing
A change merged into the BIP-352 (silent payments) reference implementation makes a small but exemplary correctness fix. In create_outputs, the code asserted that the sum of input private keys matched an expected value pulled from the test vectors:
assert Scalar.from_bytes_checked(bytes.fromhex(expected.get("input_private_key_sum"))) == a_sum
The expected argument is optional. When it was absent, expected.get(...) was called on None — the assertion did not compare anything meaningful, it crashed. The fix guards it:
if expected is not None:
assert Scalar.from_bytes_checked(...) == a_sum

What it means
An optional argument that the code dereferences unconditionally is not optional. The signature said expected could be omitted; the body assumed it never was. That gap is the bug, and it is one of the most common in any language with nullable values — the type or the docstring promises optionality that the code does not honour.
In reference code the stakes are higher than the diff suggests. BIP-352's reference implementation is what other wallets check themselves against. A test helper that throws when called the documented way is a small defect with a wide blast radius: every implementer who runs the vectors without the optional field hits it.
The right shape is the one this fix uses: honour the optionality at the point of use. Not "make the argument required", which would break callers who legitimately omit it, but "do the check only when the thing to check against exists". The assertion still fires when it can; it simply no longer fires when there is nothing to assert.
Source: https://github.com/bitcoin/bips/commit/8754690b725e9aa93ca8bd91bf0ac85dc44ce096