mirror of
https://github.com/tompro/sattle.git
synced 2026-10-26 01:49:58 +00:00
build(deps): adopt lnurlcash-kit 0.8 contracts
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
// Wire-contract coverage for the pinned lnurlcash-kit 0.5.0 /
|
// Wire-contract coverage for the pinned lnurlcash-kit 0.8.0 /
|
||||||
// lnurlcash-conformance 0.4.0 artifacts. Contracts the app's mint flows
|
// lnurlcash-conformance 0.7.0 artifacts. Contracts the app's mint flows
|
||||||
// rely on:
|
// rely on:
|
||||||
// the kit must MAP the mint-address wire field `nodeCapacity` onto the
|
// the kit must MAP the mint-address wire field `nodeCapacity` onto the
|
||||||
// app-facing `nodeCapacityMsat` (0.1.0 spread it under its wire name, so
|
// app-facing `nodeCapacityMsat` (0.1.0 spread it under its wire name, so
|
||||||
@@ -19,6 +19,7 @@ import {buildNoteUrl, fetchMintAddress, hashK1} from 'lnurlcash-kit'
|
|||||||
|
|
||||||
import {claimMintedNote, prepareMint} from './ops'
|
import {claimMintedNote, prepareMint} from './ops'
|
||||||
import {mintAddressCacheInfo} from './trustedMints'
|
import {mintAddressCacheInfo} from './trustedMints'
|
||||||
|
import './mintContract.v08.cases'
|
||||||
|
|
||||||
type Mint = Awaited<ReturnType<typeof createMockMint>>
|
type Mint = Awaited<ReturnType<typeof createMockMint>>
|
||||||
|
|
||||||
@@ -136,8 +137,8 @@ describe('mint-address wire contract', () => {
|
|||||||
|
|
||||||
describe('withdraw-link forms', () => {
|
describe('withdraw-link forms', () => {
|
||||||
it('accepts the lnurlw:// withdraw link the conformance mock mint advertises', async () => {
|
it('accepts the lnurlw:// withdraw link the conformance mock mint advertises', async () => {
|
||||||
// conformance 0.4.0 defaults to plain https links; lnurlw:// (the form
|
// conformance 0.7.0 defaults to plain https links; lnurlw:// is an
|
||||||
// lnurl-mint emits under LUD-17) is an explicit option
|
// explicit LUD-17 transport form
|
||||||
const m = await mint({testHooks: true, withdrawLinkForm: 'lnurlw'})
|
const m = await mint({testHooks: true, withdrawLinkForm: 'lnurlw'})
|
||||||
const prepared = await prepareMint(`mint@127.0.0.1:${m.port}`, 21_000)
|
const prepared = await prepareMint(`mint@127.0.0.1:${m.port}`, 21_000)
|
||||||
expect(prepared.withdrawLink).toMatch(/^lnurlw:\/\//)
|
expect(prepared.withdrawLink).toMatch(/^lnurlw:\/\//)
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
// The wallet's deterministic-secret and signed-output work depends on this
|
||||||
|
// exact installed API surface, so package drift must fail before funds code runs.
|
||||||
|
|
||||||
|
import {describe, expect, it} from 'vitest'
|
||||||
|
import {
|
||||||
|
cashNodeFromHex,
|
||||||
|
cashNodeToHex,
|
||||||
|
cashSecretSource,
|
||||||
|
deriveCashRoot,
|
||||||
|
restoreFromSeed,
|
||||||
|
verifyNoteSignature,
|
||||||
|
verifyNoteSignatureAgainst,
|
||||||
|
verifyNoteSignatureHash,
|
||||||
|
verifyNoteSignatureHashAgainst,
|
||||||
|
} from 'lnurlcash-kit'
|
||||||
|
import type {LnurlcashOptions} from 'lnurlcash-kit'
|
||||||
|
import conformancePackage from '../../node_modules/lnurlcash-conformance/package.json'
|
||||||
|
import kitPackage from '../../node_modules/lnurlcash-kit/package.json'
|
||||||
|
|
||||||
|
const retryOptions = {mutationRetries: 1} satisfies LnurlcashOptions
|
||||||
|
const requiredExports = [
|
||||||
|
deriveCashRoot,
|
||||||
|
cashNodeToHex,
|
||||||
|
cashNodeFromHex,
|
||||||
|
cashSecretSource,
|
||||||
|
restoreFromSeed,
|
||||||
|
verifyNoteSignature,
|
||||||
|
verifyNoteSignatureAgainst,
|
||||||
|
verifyNoteSignatureHash,
|
||||||
|
verifyNoteSignatureHashAgainst,
|
||||||
|
] as const
|
||||||
|
|
||||||
|
describe('lnurlcash 0.8 dependency contract', () => {
|
||||||
|
it('exposes the BIP-32, recovery, signature, and retry contracts', () => {
|
||||||
|
expect(requiredExports.every((value) => typeof value === 'function')).toBe(true)
|
||||||
|
expect(retryOptions.mutationRetries).toBe(1)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('runs against the exact installed package versions', () => {
|
||||||
|
expect(kitPackage.version).toBe('0.8.0')
|
||||||
|
expect(conformancePackage.version).toBe('0.7.0')
|
||||||
|
})
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user