refactor(ops): require durable allocation and checkpoints

This commit is contained in:
2026-09-05 11:59:34 +02:00
parent 8e9c9dcbbc
commit a91ef30498
17 changed files with 356 additions and 104 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
import {afterEach, expect} from 'vitest'
import {createMockMint} from 'lnurlcash-conformance/mock-mint'
import {bytesToHex, hexToBytes} from '@noble/hashes/utils.js'
import {bytesToHex, hexToBytes, utf8ToBytes} from '@noble/hashes/utils.js'
import {sha256} from '@noble/hashes/sha2.js'
import {buildNoteUrl, fetchNoteInfo} from 'lnurlcash-kit'
@@ -35,7 +35,7 @@ export const allocateOutputSecrets = (
): Promise<readonly string[]> => {
const secrets = Array.from({length: count}, () => {
allocatedSecretCounter += 1
return secret(`allocated-${allocatedSecretCounter.toString(16)}`)
return bytesToHex(sha256(utf8ToBytes(`allocated-${allocatedSecretCounter}`)))
})
return Promise.resolve(secrets)
}