From c4312753d2b95b0fa6200e9b36da16b7227a00e8 Mon Sep 17 00:00:00 2001 From: mohandast52 Date: Tue, 30 Jul 2024 01:17:04 +0530 Subject: [PATCH] chore: add logs for debugging --- .../Main/MainHeader/AgentButton/index.tsx | 19 +++++++++++++++++++ frontend/context/ServicesProvider.tsx | 12 ++++++++++-- frontend/hooks/useStakingContractInfo.ts | 7 +++++++ frontend/service/Autonolas.ts | 2 ++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/frontend/components/Main/MainHeader/AgentButton/index.tsx b/frontend/components/Main/MainHeader/AgentButton/index.tsx index cd6f72c59..7cb43bbfc 100644 --- a/frontend/components/Main/MainHeader/AgentButton/index.tsx +++ b/frontend/components/Main/MainHeader/AgentButton/index.tsx @@ -113,6 +113,8 @@ const AgentNotRunningButton = () => { // Must have a wallet to start the agent if (!wallets?.[0]) return; + console.log(wallets); + // Paused to stop overlapping service poll while wallet is created or service is built setIsServicePollingPaused(true); @@ -122,6 +124,8 @@ const AgentNotRunningButton = () => { // Mock "DEPLOYING" status (service polling will update this once resumed) setServiceStatus(DeploymentStatus.DEPLOYING); + console.log('before master safe: ', masterSafeAddress); + // Create master safe if it doesn't exist try { if (!masterSafeAddress) { @@ -136,6 +140,7 @@ const AgentNotRunningButton = () => { return; } + console.log('before create / deploy: '); // Then create / deploy the service try { await ServicesService.createService({ @@ -151,6 +156,7 @@ const AgentNotRunningButton = () => { return; } + console.log('before minimum staked amount required: '); // Show success notification based on whether there was a service prior to starting try { if (!service) { @@ -168,6 +174,8 @@ const AgentNotRunningButton = () => { showNotification?.('Error while showing "running" notification'); } + console.log('before setting services '); + // Can assume successful deployment // resume polling, optimistically update service status (poll will update, if needed) setIsServicePollingPaused(false); @@ -196,6 +204,8 @@ const AgentNotRunningButton = () => { return safeOlasBalanceWithStaked >= requiredOlas; } + console.log({ isEligibleForStaking, isAgentEvicted }); + // case if agent is evicted and user has met the staking criteria if (isEligibleForStaking && isAgentEvicted) return true; @@ -258,6 +268,15 @@ export const AgentButton = () => { return ; } + console.log('inside useMemo for start button'); + console.log({ + hasInitialLoaded, + serviceStatus, + isEligibleForStaking, + isAgentEvicted, + service, + }); + return (