forked from unimatrix/web
DUNE-012: add standalone stronghold policy and tests
This commit is contained in:
parent
0c8d2376d2
commit
da7d21e731
4 changed files with 261 additions and 1 deletions
|
|
@ -112,4 +112,9 @@ No task groups have been created yet. Allocate G-001 upon the first actual group
|
|||
- Completed read-only proposal in `docs/STARFALL-STRONGHOLD-POLICY.md`; reference source inspected with git show at Starfall `2577efe` without editing that checkout.
|
||||
- Compares exclusive claim and shared strongholds; recommends one galaxy owner while preserving residents' alliance membership. Covers atomic claims/slots, leader permissions, inactive claims, ownership/bonus UI, safe migration and protected 1:1 ghosts.
|
||||
- Existing conflicts require explicit resolution; no assets, memberships or gameplay rules changed. No runtime tests claimed. Not a Dune product patchnote task.
|
||||
- Colleague relayed SF-047 (P0): route these bounded policy exercises to this agent. Apply under the user's direct standing collaboration approval; retain in successor handoff. Return proposals to colleague; new gameplay policy still requires the user's decision before implementation.
|
||||
- Colleague relayed SF-047 (P0): route these bounded policy exercises to this agent. Apply under the user's direct standing collaboration approval; retain in successor handoff. Return proposals to colleague; new gameplay policy still requires the user's decision before implementation.
|
||||
## DUNE-012 — P2 — standalone stronghold policy contribution (SF-049 / G011)
|
||||
|
||||
- Completed within the user's standing collaboration approval: pure ESM policy, 14 passing Node tests and integration notes in `proposals/stronghold-policy/`.
|
||||
- Covers round-scoped galaxy/alliance reservation, claim/release/transfer, legacy disputes and guarded adjudication. Preserves original snapshots, asset references and historical IDs. Trusted permissions and database compare-and-swap remain required integration duties.
|
||||
- No Starfall files/branches, gameplay state or deployments changed. This is a standalone contribution for colleague integration; not a Dune plugin/product patchnote task.
|
||||
44
proposals/stronghold-policy/README.md
Normal file
44
proposals/stronghold-policy/README.md
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# Stronghold policy proposal — DUNE-012 / SF-049 / G011
|
||||
|
||||
Standalone pure JavaScript contribution for the Starfall colleague. Not imported by Dune or Starfall and not deployed. Implements the exclusive-claim proposal in [the policy report](../../docs/STARFALL-STRONGHOLD-POLICY.md). Uses standard ESM and `structuredClone`; no packages or credentials.
|
||||
|
||||
Run from repository root:
|
||||
|
||||
```sh
|
||||
node --test proposals/stronghold-policy/policy.test.mjs
|
||||
```
|
||||
|
||||
## Model and exports
|
||||
|
||||
`state = { revision, claims }`; each claim has stable `id`, `roundId`, canonical `galaxy` (`x:y`), stable `allianceId`, `status` and `assetRefs`. Asset references include structures, construction reservations and any other assets that must block release. Other metadata is preserved. The integration adapter must populate this authoritative inventory; omitting real assets defeats release protection.
|
||||
|
||||
- `claimStronghold`: reserve a free galaxy for an alliance, maximum one reserved stronghold per alliance per round. Canonical coordinate validation prevents padded-coordinate duplicates.
|
||||
- `releaseStronghold`: release an undisputed, empty reservation; retain its historical record and ID. Even administrators cannot bypass the asset guard.
|
||||
- `transferStronghold`: transfer the claim and its asset references together, preserving identity and active/inactive status. Both source and target leadership approvals, or explicit staff authority, are required. The target must have no other reservation in that round.
|
||||
- `markDisputed`: staff freezes one or more existing claims with a short reason. Released history cannot be disputed.
|
||||
- `importLegacyClaims`: trusted snapshot normalisation; overlapping galaxy OR alliance reservations become disputed, including connected conflicts. No assets or rows deleted. This is an offline migration constructor with revision zero; do not use it as a live state reset.
|
||||
- `resolveConflict`: staff selects a disputed winner and explicit active/inactive status. Only directly overlapping losers are released, and only if they have no assets. Others remain disputed pending their own resolution. The function cannot decide a winner or move assets for staff.
|
||||
- `bonusEligible`: local structure-dependent bonus gate using round, accepted/current alliance membership represented by the adapter, resident galaxy, active claim and functional-structure flag. It is not the whole bonus system: preserve existing alliance-wide effects, cooldowns, production calculations and reward ledger separately.
|
||||
- `validateState`, `normalizeGalaxy`, `PolicyError`: validation/helpers. Errors expose stable codes: INVALID, STALE, NOT_FOUND, FORBIDDEN, CONFLICT, DUPLICATE_ID, DISPUTED, RELEASED, ASSETS_REMAIN.
|
||||
|
||||
Active, inactive and disputed records all reserve ownership. Only released records free it. Overlapping reservations are allowed solely when every overlapping pair is disputed. The retained inactive claim deliberately prevents instant hostile takeover; no expiry/conquest mechanic is introduced. The adapter must apply authorised active↔inactive lifecycle updates when structures fail or return, without freeing ownership and while retaining revision checks.
|
||||
|
||||
## Required integration boundary
|
||||
|
||||
Every mutator receives `expectedRevision` and returns a cloned, validated state with the next revision. Inputs are never mutated; failed operations leave the original state intact. No timestamps, network calls, random IDs, account edits, planet relocation or deployments are performed. Supply IDs server-side. Unknown/nonexistent IDs and malformed state fail explicitly.
|
||||
|
||||
`context = { authorizedAllianceIds: [...] }` must be derived from server-verified stronghold management permissions, never request JSON. A transfer context contains both IDs only after independently verifying approvals for the particular source, target, claim and current revision. Do not interpret it as proof that a single player controls both alliances. `admin: true` is trusted adjudication authority, not a client flag. Record approver identities/reason in the server audit log. Residence eligibility, account/round existence, request origin and any cooldown/cost checks also belong at that boundary.
|
||||
|
||||
Pure functions do **not** serialize requests. Two calls using the same snapshot can both return valid candidates. The Worker adapter must persist claim state, occupancy, asset ownership, funds and audit records in one supported transaction/conditional operation:
|
||||
|
||||
1. Read authoritative state and asset reservations, derive trusted permissions, validate the expected revision and call the policy.
|
||||
2. Commit using compare-and-swap (`revision = expectedRevision`) and uniqueness protection for current `(round, galaxy)` and `(round, alliance)` reservations. Reject a zero-row revision update with 409 and commit none of the dependent writes. In D1, select an atomic supported batch/transaction design that enforces these conditions for the whole operation; a lone conditional update followed by unconditional writes is insufficient.
|
||||
3. Preserve legacy conflicts in a separate conflict ledger or equivalent representation compatible with unique live-claim constraints. Do not add an unconditional unique constraint directly across unresolved disputed rows. Transfer claim ownership and actual structure records consistently; policy asset references alone do not rewrite their owner fields.
|
||||
4. Persist operation IDs/results for request retries. This proposal intentionally rejects reused claim IDs and already released claims; replay the recorded result for an identical authorised operation before invoking it again. Reject an operation-ID reuse with changed payload.
|
||||
5. Emit notifications only after commit. Add real database concurrency/rollback tests before integration; this suite tests domain policy, not database atomicity.
|
||||
|
||||
No coordinate-slot allocation is implemented here. Existing global occupancy checks must still distinguish players, ghosts, structures and reservations. Preserve ordinary 1–10 / 11–15 ranges and the approved special handling of 1:1, including protected tribute 1:1:11. A galaxy claim alone never grants permission to occupy a ghost slot, move a planet, change membership or trigger a round reset.
|
||||
|
||||
## Checks performed
|
||||
|
||||
14 Node tests pass: independent round namespaces, galaxy/alliance exclusivity, permissions and two-party transfer, stale revisions, historical IDs, asset-guarded release, inactive reservation, metadata-preserving transfer, legacy conflict retention, staff adjudication, local bonus gates and invalid input. A concurrency-oriented test explicitly demonstrates why persistence needs compare-and-swap. No Starfall runtime or deployment checks are claimed.
|
||||
122
proposals/stronghold-policy/policy.mjs
Normal file
122
proposals/stronghold-policy/policy.mjs
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
// Framework-independent proposal for SF-049. Context must come from server policy.
|
||||
export class PolicyError extends Error {
|
||||
constructor(code, message) { super(message); this.name = 'PolicyError'; this.code = code; }
|
||||
}
|
||||
const fail = (code, message) => { throw new PolicyError(code, message); };
|
||||
const states = new Set(['active', 'inactive', 'disputed', 'released']);
|
||||
const reserved = claim => claim.status !== 'released';
|
||||
const identifier = value => typeof value === 'string' && value.trim() === value && value.length > 0 && value.length <= 120;
|
||||
function id(value) { if (!identifier(value)) fail('INVALID', 'Invalid identifier.'); return value; }
|
||||
export function normalizeGalaxy(value) {
|
||||
if (typeof value !== 'string' || !/^\d{1,3}:\d{1,3}$/.test(value)) fail('INVALID', 'Use galaxy x:y.');
|
||||
const [x, y] = value.split(':').map(Number);
|
||||
if (x < 1 || y < 1) fail('INVALID', 'Galaxy coordinates must be positive.');
|
||||
return `${x}:${y}`;
|
||||
}
|
||||
function overlaps(a, b) {
|
||||
return a.roundId === b.roundId && (a.galaxy === b.galaxy || a.allianceId === b.allianceId);
|
||||
}
|
||||
function checkRows(rows) {
|
||||
if (!Array.isArray(rows)) fail('INVALID', 'Claims must be an array.');
|
||||
const ids = new Set();
|
||||
for (const row of rows) {
|
||||
if (!row || !identifier(row.id) || ids.has(row.id)) fail('INVALID', 'Claim IDs must be unique.');
|
||||
ids.add(row.id); id(row.roundId); id(row.allianceId);
|
||||
if (normalizeGalaxy(row.galaxy) !== row.galaxy || !states.has(row.status)) fail('INVALID', 'Invalid claim state.');
|
||||
if (!Array.isArray(row.assetRefs) || row.assetRefs.some(x => !identifier(x)) || new Set(row.assetRefs).size !== row.assetRefs.length) fail('INVALID', 'Invalid asset references.');
|
||||
if (row.status === 'released' && row.assetRefs.length) fail('ASSETS_REMAIN', 'Released claims cannot retain assets.');
|
||||
}
|
||||
}
|
||||
export function validateState(state) {
|
||||
if (!state || !Number.isSafeInteger(state.revision) || state.revision < 0) fail('INVALID', 'Invalid revision.');
|
||||
checkRows(state.claims);
|
||||
for (let i = 0; i < state.claims.length; i++) {
|
||||
const a = state.claims[i];
|
||||
for (const b of state.claims.slice(i + 1)) {
|
||||
if (reserved(a) && reserved(b) && overlaps(a, b) && (a.status !== 'disputed' || b.status !== 'disputed')) fail('CONFLICT', 'Overlapping reservations must remain disputed.');
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function start(state, command) {
|
||||
validateState(state);
|
||||
if (!command || !Number.isSafeInteger(command.expectedRevision) || command.expectedRevision !== state.revision) fail('STALE', 'Refresh before retrying.');
|
||||
if (state.revision === Number.MAX_SAFE_INTEGER) fail('INVALID', 'Revision exhausted.');
|
||||
return structuredClone(state);
|
||||
}
|
||||
function finish(state) { state.revision++; validateState(state); return state; }
|
||||
function find(state, claimId) {
|
||||
id(claimId);
|
||||
return state.claims.find(c => c.id === claimId) || fail('NOT_FOUND', 'Claim not found.');
|
||||
}
|
||||
function manage(context, allianceId) {
|
||||
if (context?.admin === true) return;
|
||||
if (!Array.isArray(context?.authorizedAllianceIds) || !context.authorizedAllianceIds.includes(allianceId)) fail('FORBIDDEN', 'Stronghold management permission required.');
|
||||
}
|
||||
function admin(context) { if (context?.admin !== true) fail('FORBIDDEN', 'Conflict adjudication requires administrator permission.'); }
|
||||
function available(state, candidate, excluded = new Set()) {
|
||||
if (state.claims.some(c => reserved(c) && !excluded.has(c.id) && overlaps(candidate, c))) fail('CONFLICT', 'Galaxy or alliance already reserved in this round.');
|
||||
}
|
||||
export function claimStronghold(state, command, context) {
|
||||
const next = start(state, command);
|
||||
const candidate = {id: id(command.id), roundId: id(command.roundId), allianceId: id(command.allianceId), galaxy: normalizeGalaxy(command.galaxy), status: 'active', assetRefs: []};
|
||||
manage(context, candidate.allianceId);
|
||||
if (next.claims.some(c => c.id === candidate.id)) fail('DUPLICATE_ID', 'Claim ID already exists.');
|
||||
available(next, candidate); next.claims.push(candidate); return finish(next);
|
||||
}
|
||||
export function releaseStronghold(state, command, context) {
|
||||
const next = start(state, command), claim = find(next, command.claimId);
|
||||
manage(context, claim.allianceId);
|
||||
if (claim.status === 'disputed') fail('DISPUTED', 'Resolve the dispute first.');
|
||||
if (claim.status === 'released') fail('RELEASED', 'Claim already released.');
|
||||
if (claim.assetRefs.length) fail('ASSETS_REMAIN', 'Handle structures and build reservations before release.');
|
||||
claim.status = 'released'; return finish(next);
|
||||
}
|
||||
export function transferStronghold(state, command, context) {
|
||||
const next = start(state, command), claim = find(next, command.claimId), target = id(command.targetAllianceId);
|
||||
// Non-admin context represents verified approvals by BOTH alliance leaderships.
|
||||
manage(context, claim.allianceId); manage(context, target);
|
||||
if (claim.status === 'disputed') fail('DISPUTED', 'Resolve the dispute first.');
|
||||
if (claim.status === 'released') fail('RELEASED', 'Released claims cannot transfer.');
|
||||
if (target === claim.allianceId) fail('INVALID', 'Choose a different alliance.');
|
||||
available(next, {...claim, allianceId: target}, new Set([claim.id]));
|
||||
claim.allianceId = target; return finish(next);
|
||||
}
|
||||
export function markDisputed(state, command, context) {
|
||||
const next = start(state, command); admin(context);
|
||||
if (!Array.isArray(command.claimIds) || !command.claimIds.length || new Set(command.claimIds).size !== command.claimIds.length || !identifier(command.reason)) fail('INVALID', 'Supply claim IDs and a short reason.');
|
||||
for (const claimId of command.claimIds) {
|
||||
const claim = find(next, claimId);
|
||||
if (!reserved(claim)) fail('RELEASED', 'Released claims cannot be disputed.');
|
||||
claim.status = 'disputed'; claim.disputeReason = command.reason;
|
||||
}
|
||||
return finish(next);
|
||||
}
|
||||
export function resolveConflict(state, command, context) {
|
||||
const next = start(state, command); admin(context);
|
||||
const winner = find(next, command.winnerClaimId);
|
||||
if (winner.status !== 'disputed') fail('INVALID', 'Winner must be disputed.');
|
||||
if (!['active', 'inactive'].includes(command.winnerStatus)) fail('INVALID', 'Choose the adjudicated status.');
|
||||
const losers = next.claims.filter(c => c.id !== winner.id && reserved(c) && overlaps(winner, c));
|
||||
// Assets must already have an approved and persisted remediation; never discard them.
|
||||
if (losers.some(c => c.assetRefs.length)) fail('ASSETS_REMAIN', 'Conflicting assets require an explicit remediation plan.');
|
||||
for (const loser of losers) { loser.status = 'released'; loser.resolutionWinnerId = winner.id; }
|
||||
winner.status = command.winnerStatus; delete winner.disputeReason;
|
||||
return finish(next);
|
||||
}
|
||||
export function importLegacyClaims(rows) {
|
||||
// Trusted snapshot only: preserves IDs, assets, owners and other metadata.
|
||||
if (!Array.isArray(rows)) fail('INVALID', 'Claims must be an array.');
|
||||
const claims = structuredClone(rows).map(c => ({...c, galaxy: normalizeGalaxy(c.galaxy)}));
|
||||
checkRows(claims);
|
||||
const conflicting = new Set();
|
||||
for (const a of claims) for (const b of claims) {
|
||||
if (a.id !== b.id && reserved(a) && reserved(b) && overlaps(a, b)) { conflicting.add(a.id); conflicting.add(b.id); }
|
||||
}
|
||||
for (const c of claims) if (conflicting.has(c.id)) { c.status = 'disputed'; c.disputeReason = 'Legacy overlapping reservations'; }
|
||||
const result = {revision: 0, claims}; validateState(result); return result;
|
||||
}
|
||||
export function bonusEligible(state, claimId, member) {
|
||||
validateState(state); const claim = find(state, claimId);
|
||||
return claim.status === 'active' && member?.hasFunctionalStructure === true && member.roundId === claim.roundId && member.allianceId === claim.allianceId && normalizeGalaxy(member.galaxy) === claim.galaxy;
|
||||
}
|
||||
89
proposals/stronghold-policy/policy.test.mjs
Normal file
89
proposals/stronghold-policy/policy.test.mjs
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {claimStronghold, releaseStronghold, transferStronghold, markDisputed, resolveConflict, importLegacyClaims, bonusEligible, validateState} from './policy.mjs';
|
||||
const empty = () => ({revision: 0, claims: []});
|
||||
const auth = {authorizedAllianceIds: ['a', 'b']}, staff = {admin: true};
|
||||
const row = (id, allianceId, galaxy, assetRefs = []) => ({id, allianceId, galaxy, assetRefs, roundId: 'r', status: 'active'});
|
||||
const claim = (state, fields = {}, context = auth) => claimStronghold(state, {expectedRevision: state.revision, id: 'c', allianceId: 'a', galaxy: '01:01', roundId: 'r', ...fields}, context);
|
||||
const error = code => e => e.code === code;
|
||||
test('claim canonicalises coordinates and leaves frozen input untouched', () => {
|
||||
const state = Object.freeze({revision: 0, claims: Object.freeze([])}), next = claim(state);
|
||||
assert.equal(next.claims[0].galaxy, '1:1'); assert.equal(next.revision, 1); assert.equal(state.claims.length, 0);
|
||||
});
|
||||
test('galaxy and alliance reservations are exclusive per round', () => {
|
||||
const state = claim(empty());
|
||||
assert.throws(() => claim(state, {id:'d', allianceId:'b', galaxy:'1:1'}), error('CONFLICT'));
|
||||
assert.throws(() => claim(state, {id:'d', galaxy:'2:2'}), error('CONFLICT'));
|
||||
assert.equal(claim(state, {id:'d', roundId:'other'}).claims.length, 2);
|
||||
});
|
||||
test('management authority is required, including both parties on transfer', () => {
|
||||
assert.throws(() => claim(empty(), {}, {}), error('FORBIDDEN'));
|
||||
const state = claim(empty());
|
||||
assert.throws(() => transferStronghold(state, {expectedRevision:1,claimId:'c',targetAllianceId:'b'}, {authorizedAllianceIds:['a']}), error('FORBIDDEN'));
|
||||
});
|
||||
test('stale revision rejects competing write and caller must persist with CAS', () => {
|
||||
const initial = empty(), first = claim(initial);
|
||||
const otherCandidate = claim(initial, {id:'d',allianceId:'b'});
|
||||
assert.equal(first.revision, otherCandidate.revision); // Pure functions alone cannot serialize a database.
|
||||
assert.throws(() => claimStronghold(first, {expectedRevision:0}), error('STALE'));
|
||||
});
|
||||
test('released IDs remain historical and cannot be reused', () => {
|
||||
const state = releaseStronghold(claim(empty()), {claimId:'c',expectedRevision:1}, auth);
|
||||
assert.equal(state.claims[0].status, 'released');
|
||||
assert.equal(claim(state, {id:'d'}).claims.length, 2);
|
||||
assert.throws(() => claim(state), error('DUPLICATE_ID'));
|
||||
});
|
||||
test('assets or construction reservations block release without deletion', () => {
|
||||
const state = importLegacyClaims([row('c','a','1:1',['structure-1','build-1'])]);
|
||||
assert.throws(() => releaseStronghold(state,{claimId:'c',expectedRevision:0},auth),error('ASSETS_REMAIN'));
|
||||
assert.deepEqual(state.claims[0].assetRefs,['structure-1','build-1']);
|
||||
});
|
||||
test('inactive claims still reserve ownership and provide no resident bonus', () => {
|
||||
const state=importLegacyClaims([{...row('c','a','1:1'),status:'inactive'}]);
|
||||
assert.throws(()=>claim(state,{id:'d',allianceId:'b'}),error('CONFLICT'));
|
||||
assert.equal(bonusEligible(state,'c',{roundId:'r',allianceId:'a',galaxy:'1:1',hasFunctionalStructure:true}),false);
|
||||
});
|
||||
test('transfer preserves claim identity, metadata and assets', () => {
|
||||
const state=importLegacyClaims([{...row('c','a','1:1',['s']),note:'retained'}]);
|
||||
const next=transferStronghold(state,{claimId:'c',expectedRevision:0,targetAllianceId:'b'},auth);
|
||||
assert.equal(next.claims[0].allianceId,'b'); assert.equal(next.claims[0].id,'c');
|
||||
assert.deepEqual(next.claims[0].assetRefs,['s']); assert.equal(next.claims[0].note,'retained'); assert.equal(state.claims[0].allianceId,'a');
|
||||
});
|
||||
test('transfer rejects target alliance existing reservation',()=>{
|
||||
const state=importLegacyClaims([row('c','a','1:1'),row('d','b','2:2')]);
|
||||
assert.throws(()=>transferStronghold(state,{claimId:'c',expectedRevision:0,targetAllianceId:'b'},auth),error('CONFLICT'));
|
||||
});
|
||||
test('legacy import marks transitive conflicts, retaining every owner and asset',()=>{
|
||||
const rows=[row('c','a','01:01',['s']),row('d','b','1:1'),row('e','b','2:2'),row('f','x','3:3')];
|
||||
const state=importLegacyClaims(rows);
|
||||
assert.deepEqual(state.claims.map(c=>c.status),['disputed','disputed','disputed','active']);
|
||||
assert.equal(state.claims.length,rows.length); assert.equal(rows[0].status,'active');
|
||||
assert.equal(state.claims[0].allianceId,'a'); assert.deepEqual(state.claims[0].assetRefs,['s']);
|
||||
});
|
||||
test('disputes require staff and freeze release and transfer',()=>{
|
||||
const state=claim(empty()), command={claimIds:['c'],reason:'Review',expectedRevision:1};
|
||||
assert.throws(()=>markDisputed(state,command,auth),error('FORBIDDEN'));
|
||||
const disputed=markDisputed(state,command,staff);
|
||||
assert.throws(()=>releaseStronghold(disputed,{claimId:'c',expectedRevision:2},auth),error('DISPUTED'));
|
||||
assert.throws(()=>transferStronghold(disputed,{claimId:'c',expectedRevision:2,targetAllianceId:'b'},auth),error('DISPUTED'));
|
||||
});
|
||||
test('adjudication never discards competing assets; chooses explicit winner',()=>{
|
||||
const blocked=importLegacyClaims([row('c','a','1:1'),row('d','b','1:1',['s'])]);
|
||||
const command={winnerClaimId:'c',winnerStatus:'active',expectedRevision:0};
|
||||
assert.throws(()=>resolveConflict(blocked,command,staff),error('ASSETS_REMAIN'));
|
||||
const safe=importLegacyClaims([row('c','a','1:1'),row('d','b','1:1')]);
|
||||
assert.throws(()=>resolveConflict(safe,command,auth),error('FORBIDDEN'));
|
||||
const next=resolveConflict(safe,command,staff);
|
||||
assert.deepEqual(next.claims.map(c=>c.status),['active','released']); assert.equal(next.claims[1].resolutionWinnerId,'c');
|
||||
});
|
||||
test('local bonus requires current round, alliance, residence and functioning structure',()=>{
|
||||
const state=claim(empty()), member={roundId:'r',allianceId:'a',galaxy:'01:01',hasFunctionalStructure:true};
|
||||
assert.equal(bonusEligible(state,'c',member),true);
|
||||
for(const override of [{roundId:'old'},{allianceId:'b'},{galaxy:'2:2'},{hasFunctionalStructure:false}]) assert.equal(bonusEligible(state,'c',{...member,...override}),false);
|
||||
});
|
||||
test('invalid state, duplicate IDs, missing claims and forged statuses fail',()=>{
|
||||
assert.throws(()=>claim(empty(),{galaxy:'1:0'}),error('INVALID'));
|
||||
assert.throws(()=>importLegacyClaims([row('c','a','1:1'),row('c','b','2:2')]),error('INVALID'));
|
||||
assert.throws(()=>validateState({revision:0,claims:[{...row('c','a','1:1'),status:'unknown'}]}),error('INVALID'));
|
||||
assert.throws(()=>releaseStronghold(empty(),{claimId:'absent',expectedRevision:0},auth),error('NOT_FOUND'));
|
||||
});
|
||||
Loading…
Reference in a new issue

Staff