Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/helpers/ts-templates/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bsv/templates",
"version": "1.8.0",
"version": "1.8.1",
"type": "module",
"description": "BSV Blockchain Script Templates",
"main": "dist/cjs/mod.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/helpers/ts-templates/src/MandalaAdmin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { createMinimallyEncodedScriptChunk } from './mandala-encoding.js'
export interface AssetMetadata { label: string, ticker?: string, decimals?: number, [k: string]: unknown }

export type MandalaActionKind =
| 'register' | 'issue' | 'redeem' | 'recover'
| 'register' | 'issue' | 'redeem'
| 'pause' | 'unpause'
| 'blockIdentity' | 'unblockIdentity'
| 'allowIdentity' | 'unallowIdentity'
Expand Down
2 changes: 1 addition & 1 deletion packages/overlays/topics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bsv/overlay-topics",
"version": "1.4.0",
"version": "1.4.1",
"description": "Canonical BSV overlay topic managers and lookup services",
"type": "module",
"main": "./dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/overlays/topics/src/__tests__/mandala.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,14 @@ describe('MandalaTopicManager control gate', () => {
const forgedOffChain = encodeLinkagePayload({
inputs: [],
outputs: [{ index: 0, linkage: (decodeLinkagePayload(transfer.offChainValues).outputs[0].linkage) as any }],
admin: [{ index: 0, actionDetails: { kind: 'recover', assetId } }]
admin: [{ index: 0, actionDetails: { kind: 'reissue', assetId } }]
} as any)
const tm = new MandalaTopicManager({ verifierWallet: overlay as any, screeningProvider: new InMemoryScreeningProvider([]), adminWallet: overlay as any, adminProtocolID: adminProto, stateStore: stubStore(deny) })
const result = await tm.identifyAdmissibleOutputs(transfer.beef, [0], forgedOffChain)
expect(result.outputsToAdmit).toEqual([])
})

it('rejects any tx that spends a frozen outpoint (incl. would-be recover/redeem)', async () => {
it('rejects any tx that spends a frozen outpoint (incl. would-be redeem)', async () => {
const overlay = new ProtoWallet(PrivateKey.fromRandom())
const assetId = `${'a'.repeat(64)}.0`
const transfer = await buildPeerTransfer(assetId, 100, overlay)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const remove = (xs: string[], x: string): string[] => xs.filter(v => v !== x)
type Handler = (s: AssetAdminState, d: MandalaActionDetails, ctx: FoldContext) => void

// Per-kind handlers mutate the COPY `s` and reassign array fields to NEW arrays,
// never mutating the input state or its arrays. issue/redeem/recover and unknown
// never mutating the input state or its arrays. issue/redeem and unknown
// kinds have no handler: no control-state change.
const HANDLERS: Partial<Record<MandalaActionKind, Handler>> = {
register: (s, _d, ctx) => { if (typeof ctx.issuer === 'string') s.issuerIdentityKey = ctx.issuer },
Expand Down
4 changes: 2 additions & 2 deletions packages/overlays/topics/src/mandala/MandalaTopicManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class MandalaTopicManager implements TopicManager {
if (!pkhMatches || !priorOutpointSpent(tx, details)) {
return { admitted: false }
}
if ((details.kind === 'issue' || details.kind === 'recover' || details.kind === 'reissue') && typeof details.assetId === 'string') {
if ((details.kind === 'issue' || details.kind === 'reissue') && typeof details.assetId === 'string') {
return { admitted: true, issuance: { assetId: details.assetId, amount: details.amount ?? 0 } }
}
// A redeem authorizes destruction of `amount` units, i.e. a negative supply
Expand Down Expand Up @@ -227,7 +227,7 @@ export class MandalaTopicManager implements TopicManager {
const frozen = new Set<string>([...state.frozenOutpoints.map(f => f.outpoint), ...state.evictedOutpoints])

// Gate 1: frozen/evicted input spend — applies to ALL txs (blocks
// recover/redeem of a frozen coin too; only unfreeze/reissue resolve it).
// redeem of a frozen coin too; only unfreeze/reissue resolve it).
if (inputOutpoints.some(op => frozen.has(op))) return false

const adminAction = adminAssetKinds.get(assetId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ describe('foldAction', () => {
expect(s.frozenOutpoints).toEqual([])
expect(s.evictedOutpoints).toEqual(['tt.2'])
})
it('issue/redeem/recover do not change control state', () => {
it('issue/redeem do not change control state', () => {
const base = S({ isPaused: true })
for (const kind of ['issue', 'redeem', 'recover'] as const) {
for (const kind of ['issue', 'redeem'] as const) {
expect(foldAction(base, d({ kind, amount: 1 }))).toEqual(base)
}
})
Expand Down
Loading