fix(continuity): hash exact remote receipt bytes

This commit is contained in:
冰朔 2026-08-05 21:13:01 +08:00
commit e2887513b2
3 changed files with 18 additions and 8 deletions

View file

@ -11,6 +11,7 @@ import {
parseArgs,
safeCacheRelative,
selfTest,
sha256,
} from "./finalize-development.mjs";
test("the finalizer accepts only the registered Fifth Domain code channel", () => {
@ -83,3 +84,7 @@ test("macOS AppleDouble sidecars are never parsed as JSON records", () => {
assert.equal(isJsonRecordName("._lease.json"), false);
assert.equal(isJsonRecordName("lease.txt"), false);
});
test("receipt hashes preserve exact trailing bytes", () => {
assert.notEqual(sha256(Buffer.from("{}")), sha256(Buffer.from("{}\n")));
});