Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove console.log from injector #5

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ Wallet Guard acts as an intermediary between your browser and wallet, analyzing
provider.isWalletGuard = true;
console.log('Wallet Guard is running!');
} catch (error) {
console.log('Wallet Guard could not start!');
// If we can't add ourselves to this provider, don't mess with other providers.
log.warn({ provider, error }, 'Could not attach to provider');
}
}
};

```

<br>
Expand Down
1 change: 0 additions & 1 deletion src/content-scripts/contentScripts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ listenToRequest(async (request: RequestArgs) => {

newSimulations.forEach((simulation: StoredSimulation) => {
log.info('dispatching continue or reject');
console.log(simulation, 'simulationnnnnn');
// Either dispatch the corresponding event, or push the item to new simulations.
if (simulation.state === StoredSimulationState.Confirmed) {
log.debug('Dispatch confirmed', simulation.id);
Expand Down
2 changes: 0 additions & 2 deletions src/injected/injectWalletGuard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,9 @@ const addWalletGuardProxy = (provider: any) => {
value: new Proxy(provider.sendAsync, sendAsyncHandler),
});
provider.isWalletGuard = true;
console.log('Wallet Guard is running!');
} catch (error) {
// If we can't add ourselves to this provider, don't mess with other providers.
log.warn({ provider, error }, 'Could not attach to provider');
console.log('Wallet Guard could not start!');
}
}
};
Expand Down
1 change: 0 additions & 1 deletion src/lib/helpers/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export function createDomainName(domainObj: ParseResultListed) {

// Handle URLs like gov.uk, netlify.app, etc.
if (!domain) {
console.log('domain is blank');
return topLevelDomains.join('.');
}

Expand Down
2 changes: 0 additions & 2 deletions src/lib/simulation/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export const fetchSimulate = async (args: {
const { error } = await result.json();
return { type: ResponseType.Error, error };
} catch (e: any) {
console.log('ERROR: ', e);
return { error: e.message, type: ResponseType.Error };
}
};
Expand Down Expand Up @@ -88,7 +87,6 @@ export const fetchSignature = async (
return { type: ResponseType.Error };
}
} catch (e: any) {
console.log('ERROR: ', e);
return { error: e.message, type: ResponseType.Error };
}
};
11 changes: 0 additions & 11 deletions src/lib/simulation/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export const addSimulation = async (simulation: StoredSimulation) => {
// Add new simulation to the front.
simulations.push({ ...simulation });

console.log('add simulation', simulation);
return chrome.storage.local.set({ simulations });
};

Expand All @@ -69,14 +68,12 @@ const completeSimulation = async (id: string, simulation: SimulationResponse) =>

simulations.forEach((storedSimulation: StoredSimulation) => {
if (storedSimulation.id === id) {
console.log('simulation found id', id);
log.debug('Simulation found id', id);
storedSimulation.state = StoredSimulationState.Success;
storedSimulation.simulation = simulation;
}
});

console.log('completeSimulation', simulation);
return chrome.storage.local.set({ simulations });
};

Expand All @@ -91,7 +88,6 @@ export const skipSimulation = async (id: string) => {
}
});

console.log('skipSimulation', id);
return chrome.storage.local.set({ simulations });
};

Expand All @@ -106,7 +102,6 @@ const revertSimulation = async (id: string, error?: string) => {
}
});

console.log('revertSimulation', id, error);
return chrome.storage.local.set({ simulations });
};

Expand All @@ -117,7 +112,6 @@ export const removeSimulation = async (id: string) => {
return storedSimulation.id !== id;
});

console.log('removesimulation', id, simulations);
return chrome.storage.local.set({ simulations });
};

Expand All @@ -133,7 +127,6 @@ export const updateSimulationState = async (id: string, state: StoredSimulationS
: x
);

console.log('update simulation state', state, id, simulations);
return chrome.storage.local.set({ simulations });
};

Expand All @@ -151,7 +144,6 @@ const updateSimulatioWithErrorMsg = async (id: string, error?: string) => {
: x
);

console.log('update simulation with error msg', id, error, simulations);
return chrome.storage.local.set({ simulations });
};

Expand All @@ -164,7 +156,6 @@ export const fetchSimulationAndUpdate = async (args: RequestArgs) => {
state = StoredSimulationState.Confirmed;
}

console.log('args', args);
if ('transaction' in args) {
const result = await Promise.all([
addSimulation({
Expand Down Expand Up @@ -198,7 +189,6 @@ export const fetchSimulationAndUpdate = async (args: RequestArgs) => {
fetchSignature(args),
]);
response = result[1];
console.log(response, 'sign message response');
} else {
const result = await Promise.all([
addSimulation({
Expand Down Expand Up @@ -227,7 +217,6 @@ export const fetchSimulationAndUpdate = async (args: RequestArgs) => {
if (!response.simulation) {
throw new Error('Invalid state');
}
console.log('made it through');
return completeSimulation(args.id, response.simulation);
}
};
Expand Down