Skip to content

Commit 74e0612

Browse files
committed
update : config threshold
1 parent 382709b commit 74e0612

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ NEXT_PUBLIC_NFT_STORAGE_KEY=your-nft-storage-api-key
2323
# SBT Contract Address Overrides (optional; prefer env over code edits)
2424
# NEXT_PUBLIC_SBT_CONTRACT_ADDRESS_POLYGON_AMOY=0xYourDeployedAmoyContractAddress
2525

26+
# Cert threshold for publishing Web3 certificates
27+
# Lower this for testing, then raise it back before public use.
28+
# NEXT_PUBLIC_CERT_THRESHOLD=40
29+
2630
# RPC URLs (optional - defaults are provided in code)
2731
# POLYGON_AMOY_RPC=https://rpc-amoy.polygon.technology
2832
# POLYGON_RPC=https://polygon-rpc.com

src/lib/scoring/engine.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ export interface RatingReport {
9898
budgetPenaltyApplied: boolean;
9999
}
100100

101-
const CERT_THRESHOLD = 40;
101+
const DEFAULT_CERT_THRESHOLD = 40;
102+
const CERT_THRESHOLD = readCertThreshold();
102103

103104
/** Public scoring entry point. */
104105
export function score(state: BuildState): RatingReport {
@@ -178,6 +179,13 @@ export function score(state: BuildState): RatingReport {
178179

179180
const RULE_PACK_VERSION = '0.1.0';
180181

182+
function readCertThreshold(): number {
183+
const raw = process.env.NEXT_PUBLIC_CERT_THRESHOLD ?? process.env.CERT_THRESHOLD;
184+
if (!raw) return DEFAULT_CERT_THRESHOLD;
185+
const parsed = Number(raw);
186+
return Number.isFinite(parsed) ? parsed : DEFAULT_CERT_THRESHOLD;
187+
}
188+
181189
function clamp(v: number, min: number, max: number) {
182190
return Math.max(min, Math.min(max, v));
183191
}

0 commit comments

Comments
 (0)