Skip to content

Commit 17b4e6b

Browse files
committed
corrected join pool process
1 parent 20c7b41 commit 17b4e6b

4 files changed

Lines changed: 23 additions & 6 deletions

File tree

apps/box/src/components/Cards/PoolCard.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ const DetailInfo = ({
171171
console.log('Step 2: Calling API joinPool...');
172172
const request = {
173173
peerId: clusterPeerId,
174+
kuboPeerId: currentBloxPeerId,
174175
account: account,
175176
chain: selectedChain,
176177
poolId: poolId,
@@ -268,6 +269,7 @@ const DetailInfo = ({
268269
try {
269270
const request = {
270271
peerId: clusterPeerId,
272+
kuboPeerId: currentBloxPeerId,
271273
account: account,
272274
chain: selectedChain,
273275
poolId: parseInt(pool.poolID, 10),
@@ -381,6 +383,14 @@ const DetailInfo = ({
381383
<FxText variant="bodyXSRegular" color="content2">
382384
Join Status:
383385
</FxText>
386+
<FxText variant="bodyXSRegular" color={joinState.step1Complete ? 'greenBase' : 'errorBase'}>
387+
• Blox Configuration: {joinState.step1Complete ? '✓ Complete' : '✗ Pending'}
388+
</FxText>
389+
{joinState.step1Error && (
390+
<FxText variant="bodyXSRegular" color="errorBase" marginTop="4">
391+
Blox Error: {joinState.step1Error}
392+
</FxText>
393+
)}
384394
<FxText variant="bodyXSRegular" color={joinState.step2Complete ? 'greenBase' : 'errorBase'}>
385395
• Pool Registration: {joinState.step2Complete ? '✓ Complete' : '✗ Pending'}
386396
</FxText>

apps/box/src/hooks/usePools.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ export const usePools = () => {
253253
try {
254254
const request: JoinPoolRequest = {
255255
peerId: currentClusterPeerId,
256+
kuboPeerId: currentBloxPeerId,
256257
account: connectedAccount,
257258
chain: selectedChain,
258259
poolId: parseInt(poolId, 10),
@@ -282,7 +283,7 @@ export const usePools = () => {
282283
};
283284
}
284285
},
285-
[connectedAccount, currentClusterPeerId, selectedChain, loadPools]
286+
[connectedAccount, currentBloxPeerId, currentClusterPeerId, selectedChain, loadPools]
286287
);
287288

288289
const joinPool = useCallback(
@@ -313,6 +314,7 @@ export const usePools = () => {
313314
try {
314315
const request: JoinPoolRequest = {
315316
peerId: currentClusterPeerId,
317+
kuboPeerId: currentBloxPeerId,
316318
account: connectedAccount,
317319
chain: selectedChain,
318320
poolId: parseInt(poolId, 10),
@@ -342,7 +344,7 @@ export const usePools = () => {
342344
};
343345
}
344346
},
345-
[connectedAccount, currentClusterPeerId, selectedChain, loadPools]
347+
[connectedAccount, currentBloxPeerId, currentClusterPeerId, selectedChain, loadPools]
346348
);
347349

348350
// API-based cancel join request function
@@ -358,6 +360,7 @@ export const usePools = () => {
358360
try {
359361
const request: JoinPoolRequest = {
360362
peerId: currentClusterPeerId,
363+
kuboPeerId: currentBloxPeerId,
361364
account: connectedAccount,
362365
chain: selectedChain,
363366
poolId: parseInt(poolId, 10),
@@ -387,7 +390,7 @@ export const usePools = () => {
387390
};
388391
}
389392
},
390-
[connectedAccount, currentClusterPeerId, selectedChain, loadPools]
393+
[connectedAccount, currentBloxPeerId, currentClusterPeerId, selectedChain, loadPools]
391394
);
392395

393396
const leavePool = useCallback(

apps/box/src/hooks/usePoolsWithFallback.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ export const usePoolsWithFallback = () => {
275275
try {
276276
const request: JoinPoolRequest = {
277277
peerId: currentClusterPeerId,
278+
kuboPeerId: currentBloxPeerId,
278279
account: effectiveAccount,
279280
chain: selectedChain,
280281
poolId: parseInt(poolId, 10),
@@ -304,7 +305,7 @@ export const usePoolsWithFallback = () => {
304305
};
305306
}
306307
},
307-
[effectiveAccount, currentClusterPeerId, selectedChain, loadPools]
308+
[effectiveAccount, currentBloxPeerId, currentClusterPeerId, selectedChain, loadPools]
308309
);
309310

310311
/**
@@ -322,6 +323,7 @@ export const usePoolsWithFallback = () => {
322323
try {
323324
const request: JoinPoolRequest = {
324325
peerId: currentClusterPeerId,
326+
kuboPeerId: currentBloxPeerId,
325327
account: effectiveAccount,
326328
chain: selectedChain,
327329
poolId: parseInt(poolId, 10),
@@ -351,7 +353,7 @@ export const usePoolsWithFallback = () => {
351353
};
352354
}
353355
},
354-
[effectiveAccount, currentClusterPeerId, selectedChain, loadPools]
356+
[effectiveAccount, currentBloxPeerId, currentClusterPeerId, selectedChain, loadPools]
355357
);
356358

357359
/**
@@ -369,6 +371,7 @@ export const usePoolsWithFallback = () => {
369371
try {
370372
const request: JoinPoolRequest = {
371373
peerId: currentClusterPeerId,
374+
kuboPeerId: currentBloxPeerId,
372375
account: effectiveAccount,
373376
chain: selectedChain,
374377
poolId: parseInt(poolId, 10),
@@ -398,7 +401,7 @@ export const usePoolsWithFallback = () => {
398401
};
399402
}
400403
},
401-
[effectiveAccount, currentClusterPeerId, selectedChain, loadPools]
404+
[effectiveAccount, currentBloxPeerId, currentClusterPeerId, selectedChain, loadPools]
402405
);
403406

404407
// Load pools when we have an effective account

apps/box/src/services/poolApiService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { SupportedChain } from '../contracts/types';
22

33
export interface JoinPoolRequest {
44
peerId: string;
5+
kuboPeerId?: string;
56
account: string;
67
chain: SupportedChain;
78
poolId: number;

0 commit comments

Comments
 (0)