Lot U : après la fusion, les contrats réels de S et V remplacent les champs annoncés ; canCast et byChain retirés (le serveur dit open et way)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Yvv
2026-11-03 07:43:51 +01:00
co-authored by Claude Opus 5.5
parent d367d73a9e
commit af08fdaa8b
2 changed files with 1 additions and 31 deletions
+1 -14
View File
@@ -6,7 +6,7 @@ import type { DocState } from './doc.svelte';
import { i18n, t, type Key } from './i18n/index.svelte';
import { toasts } from './toast.svelte';
import { moduleName, sectionLabel } from './labels';
import type { Entered, VoteAccess } from './types';
import type { Entered } from './types';
/** A line of a vote: one version, for or against, or null to withdraw one's vote. */
export interface Line {
@@ -14,19 +14,6 @@ export interface Line {
choice: 'for' | 'against' | null;
}
/**
* Whether this session sees the buttons of the vote: open, or simulated while the chain is
* closed (lot V: « les boutons de vote apparaissent partout comme si le vote était ouvert »).
*/
export function canCast(access: VoteAccess | null | undefined): boolean {
return !!access && (access.open || access.simulated === true);
}
/** A vote that goes through the person's Ğ1 wallet; a simulated vote never does. */
export function byChain(access: VoteAccess | null | undefined): boolean {
return access?.way === 'chain' && access.simulated !== true && !!access.chain;
}
/** Cents of Ğ1, as the person reads them: « 0,1 » in French. */
export function g1Amount(cents: number): string {
return i18n.number(cents / 100);