Skip to content

Commit 0b5b153

Browse files
authored
Merge pull request #81 from Kami-no-san/main
fix: resolve CI issues with cross-platform build and formatting
2 parents f22e2f7 + 9cf461d commit 0b5b153

20 files changed

Lines changed: 226 additions & 202 deletions

File tree

apps/api/src/modules/badge/badge.controller.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ export class BadgeController {
1111

1212
@Get(':contractId.svg')
1313
@ApiOperation({ summary: 'Get dynamic SVG security badge for a contract' })
14-
async getBadge(
15-
@Param('contractId') contractId: string,
16-
@Response() response: ExpressResponse,
17-
) {
14+
async getBadge(@Param('contractId') contractId: string, @Response() response: ExpressResponse) {
1815
const svg = await this.badgeService.generateBadge(contractId);
19-
16+
2017
response.set('Content-Type', 'image/svg+xml');
2118
response.set('Cache-Control', 'public, max-age=3600'); // Cache for 1 hour
2219
response.send(svg);

apps/api/src/modules/badge/badge.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ export class BadgeService {
9090
return 'NONE';
9191
}
9292

93-
private mapBadgeLevelToStatus(badgeLevel: string): 'VERIFIED' | 'PENDING' | 'FLAGGED' | 'REVOKED' {
93+
private mapBadgeLevelToStatus(
94+
badgeLevel: string,
95+
): 'VERIFIED' | 'PENDING' | 'FLAGGED' | 'REVOKED' {
9496
if (badgeLevel === 'FLAGGED') return 'FLAGGED';
9597
if (badgeLevel === 'REVOKED') return 'REVOKED';
9698
if (badgeLevel === 'NONE') return 'PENDING';

apps/api/src/modules/blockchain/soroban-client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ export class SorobanClient {
8585
]);
8686
}
8787

88-
async getBadge(_contractAddress: string): Promise<{ badge_level: string; security_score: number; issued_at: number } | null> {
88+
async getBadge(
89+
_contractAddress: string,
90+
): Promise<{ badge_level: string; security_score: number; issued_at: number } | null> {
8991
try {
9092
// For now, return null to indicate no on-chain badge data
9193
// In production, this would use the Soroban RPC to query the contract

apps/api/src/modules/github-webhook/github-webhook.controller.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Body, Controller, Headers, Post } from '@nestjs/common';
22
import { ConfigService } from '@nestjs/config';
3-
import { ApiHeader,ApiOperation, ApiTags } from '@nestjs/swagger';
3+
import { ApiHeader, ApiOperation, ApiTags } from '@nestjs/swagger';
44
import { logger } from '@veridion/logger';
55

66
import { GithubWebhookService } from './github-webhook.service';
@@ -94,7 +94,10 @@ export class GithubWebhookController {
9494
}
9595

9696
// Handle different pull request events
97-
if (eventType === 'pull_request' && ['opened', 'synchronize', 'reopened'].includes(payload.action)) {
97+
if (
98+
eventType === 'pull_request' &&
99+
['opened', 'synchronize', 'reopened'].includes(payload.action)
100+
) {
98101
await this.githubWebhookService.handlePullRequestEvent(payload);
99102
}
100103

apps/api/src/modules/github-webhook/github-webhook.service.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ interface Project {
1313

1414
@Injectable()
1515
export class GithubWebhookService {
16-
constructor(
17-
private readonly config: ConfigService,
18-
) {}
16+
constructor(private readonly config: ConfigService) {}
1917

2018
verifySignature(payload: string, signature: string, secret: string): boolean {
2119
const hmac = createHmac('sha256', secret);

apps/api/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"extends": "../../packages/config/tsconfig/nestjs.json",
33
"compilerOptions": {
44
"outDir": "./dist",
5-
"baseUrl": "./src",
65
"rootDir": "./src",
76
"paths": {
87
"@/*": ["./src/*"]

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
},
1818
"dependencies": {
1919
"@monaco-editor/react": "^4.6.0",
20+
"monaco-editor": "~0.54.0",
2021
"@radix-ui/react-accordion": "^1.1.2",
2122
"@radix-ui/react-alert-dialog": "^1.0.5",
2223
"@radix-ui/react-avatar": "^1.0.4",

apps/web/src/app/verify/[txHash]/page.tsx

Lines changed: 30 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { AlertCircle, CheckCircle, Clock, Shield, XCircle } from 'lucide-react';
12
import { notFound } from 'next/navigation';
2-
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
3+
34
import { Badge } from '@/components/ui/badge';
4-
import { Shield, CheckCircle, AlertCircle, Clock, XCircle } from 'lucide-react';
5+
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
56

67
interface VerificationData {
78
txHash: string;
@@ -18,7 +19,7 @@ interface VerificationData {
1819
}>;
1920
}
2021

21-
async function getVerificationData(txHash: string): Promise<VerificationData | null> {
22+
function getVerificationData(txHash: string): VerificationData | null {
2223
// In production, this would fetch from the blockchain or API
2324
// For now, return mock data
2425
if (txHash.length < 10) return null;
@@ -40,12 +41,8 @@ async function getVerificationData(txHash: string): Promise<VerificationData | n
4041
};
4142
}
4243

43-
export default async function VerificationExplorerPage({
44-
params,
45-
}: {
46-
params: { txHash: string };
47-
}) {
48-
const verification = await getVerificationData(params.txHash);
44+
export default function VerificationExplorerPage({ params }: { params: { txHash: string } }) {
45+
const verification = getVerificationData(params.txHash);
4946

5047
if (!verification) {
5148
notFound();
@@ -89,17 +86,15 @@ export default async function VerificationExplorerPage({
8986
};
9087

9188
return (
92-
<div className="min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 py-12 px-4">
93-
<div className="max-w-4xl mx-auto space-y-6">
89+
<div className="min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 px-4 py-12 dark:from-slate-900 dark:to-slate-800">
90+
<div className="mx-auto max-w-4xl space-y-6">
9491
{/* Header */}
95-
<div className="text-center space-y-4">
92+
<div className="space-y-4 text-center">
9693
<div className="flex justify-center">
97-
<Shield className="h-16 w-16 text-primary" />
94+
<Shield className="text-primary h-16 w-16" />
9895
</div>
9996
<h1 className="text-4xl font-bold">Verification Explorer</h1>
100-
<p className="text-muted-foreground">
101-
View on-chain audit verification details
102-
</p>
97+
<p className="text-muted-foreground">View on-chain audit verification details</p>
10398
</div>
10499

105100
{/* Status Card */}
@@ -118,30 +113,20 @@ export default async function VerificationExplorerPage({
118113
<CardContent className="space-y-4">
119114
<div className="grid grid-cols-2 gap-4">
120115
<div>
121-
<p className="text-sm font-medium text-muted-foreground">
122-
Transaction Hash
123-
</p>
116+
<p className="text-muted-foreground text-sm font-medium">Transaction Hash</p>
124117
<p className="font-mono text-sm">{verification.txHash}</p>
125118
</div>
126119
<div>
127-
<p className="text-sm font-medium text-muted-foreground">
128-
Audit ID
129-
</p>
120+
<p className="text-muted-foreground text-sm font-medium">Audit ID</p>
130121
<p className="font-mono text-sm">{verification.auditId}</p>
131122
</div>
132123
<div>
133-
<p className="text-sm font-medium text-muted-foreground">
134-
Contract Address
135-
</p>
124+
<p className="text-muted-foreground text-sm font-medium">Contract Address</p>
136125
<p className="font-mono text-sm">{verification.contractAddress}</p>
137126
</div>
138127
<div>
139-
<p className="text-sm font-medium text-muted-foreground">
140-
Verified At
141-
</p>
142-
<p className="text-sm">
143-
{new Date(verification.verifiedAt).toLocaleString()}
144-
</p>
128+
<p className="text-muted-foreground text-sm font-medium">Verified At</p>
129+
<p className="text-sm">{new Date(verification.verifiedAt).toLocaleString()}</p>
145130
</div>
146131
</div>
147132
</CardContent>
@@ -156,13 +141,13 @@ export default async function VerificationExplorerPage({
156141
<div className="flex items-center gap-4">
157142
<div className="text-5xl font-bold">{verification.securityScore}</div>
158143
<div className="flex-1">
159-
<div className="h-4 bg-slate-200 rounded-full overflow-hidden">
144+
<div className="h-4 overflow-hidden rounded-full bg-slate-200">
160145
<div
161146
className="h-full bg-gradient-to-r from-green-400 to-green-600 transition-all duration-500"
162147
style={{ width: `${verification.securityScore}%` }}
163148
/>
164149
</div>
165-
<p className="text-sm text-muted-foreground mt-2">
150+
<p className="text-muted-foreground mt-2 text-sm">
166151
{verification.securityScore >= 90
167152
? 'Excellent security posture'
168153
: verification.securityScore >= 75
@@ -184,15 +169,13 @@ export default async function VerificationExplorerPage({
184169
<CardContent>
185170
<div className="flex items-center gap-4">
186171
<div
187-
className={`w-20 h-20 rounded-full bg-gradient-to-br ${badgeColors[verification.badgeLevel as keyof typeof badgeColors]} flex items-center justify-center text-white font-bold text-xl shadow-lg`}
172+
className={`h-20 w-20 rounded-full bg-gradient-to-br ${badgeColors[verification.badgeLevel as keyof typeof badgeColors]} flex items-center justify-center text-xl font-bold text-white shadow-lg`}
188173
>
189174
{verification.badgeLevel[0]}
190175
</div>
191176
<div>
192177
<p className="text-2xl font-bold">{verification.badgeLevel} Badge</p>
193-
<p className="text-sm text-muted-foreground">
194-
Issued by Veridion Audit Network
195-
</p>
178+
<p className="text-muted-foreground text-sm">Issued by Veridion Audit Network</p>
196179
</div>
197180
</div>
198181
</CardContent>
@@ -208,15 +191,15 @@ export default async function VerificationExplorerPage({
208191
{verification.auditSignatures.map((sig, index) => (
209192
<div
210193
key={index}
211-
className="flex items-center justify-between p-3 bg-slate-50 dark:bg-slate-800 rounded-lg"
194+
className="flex items-center justify-between rounded-lg bg-slate-50 p-3 dark:bg-slate-800"
212195
>
213196
<div className="flex items-center gap-3">
214-
<div className="w-8 h-8 bg-primary/10 rounded-full flex items-center justify-center">
215-
<CheckCircle className="h-4 w-4 text-primary" />
197+
<div className="bg-primary/10 flex h-8 w-8 items-center justify-center rounded-full">
198+
<CheckCircle className="text-primary h-4 w-4" />
216199
</div>
217200
<div>
218201
<p className="font-mono text-sm">{sig.auditor}</p>
219-
<p className="text-xs text-muted-foreground">
202+
<p className="text-muted-foreground text-xs">
220203
{new Date(sig.timestamp).toLocaleString()}
221204
</p>
222205
</div>
@@ -236,23 +219,23 @@ export default async function VerificationExplorerPage({
236219
<CardContent>
237220
<div className="space-y-2">
238221
<div className="flex justify-between">
239-
<span className="text-sm text-muted-foreground">Network</span>
222+
<span className="text-muted-foreground text-sm">Network</span>
240223
<span className="text-sm font-medium">Stellar Mainnet</span>
241224
</div>
242225
<div className="flex justify-between">
243-
<span className="text-sm text-muted-foreground">Protocol</span>
226+
<span className="text-muted-foreground text-sm">Protocol</span>
244227
<span className="text-sm font-medium">Soroban</span>
245228
</div>
246229
<div className="flex justify-between">
247-
<span className="text-sm text-muted-foreground">Contract</span>
248-
<span className="text-sm font-mono">Veridion Verifier</span>
230+
<span className="text-muted-foreground text-sm">Contract</span>
231+
<span className="font-mono text-sm">Veridion Verifier</span>
249232
</div>
250233
<div className="pt-4">
251234
<a
252235
href={`https://stellar.expert/tx/${verification.txHash}`}
253236
target="_blank"
254237
rel="noopener noreferrer"
255-
className="text-sm text-primary hover:underline"
238+
className="text-primary text-sm hover:underline"
256239
>
257240
View on Stellar Expert →
258241
</a>
@@ -262,7 +245,7 @@ export default async function VerificationExplorerPage({
262245
</Card>
263246

264247
{/* Footer */}
265-
<div className="text-center text-sm text-muted-foreground">
248+
<div className="text-muted-foreground text-center text-sm">
266249
<p>Powered by Veridion • Smart Contract Security Platform</p>
267250
<p className="mt-1">
268251
<a href="/" className="text-primary hover:underline">

0 commit comments

Comments
 (0)