Skip to content

Commit

Permalink
refactor(contract): remove console.log statements
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsdls committed Jan 27, 2024
1 parent 99e37e8 commit 3ede4f4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/thirdweb/src/contract/actions/resolve-abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ const ABI_RESOLUTION_CACHE = new WeakMap<ThirdwebContract<Abi>, Promise<Abi>>();
export function resolveContractAbi<abi extends Abi>(
contract: ThirdwebContract<abi>,
): Promise<abi> {
console.log("[resolveContractAbi] - entry", contract);
if (ABI_RESOLUTION_CACHE.has(contract)) {
console.log("[resolveContractAbi] - cache hit");
return ABI_RESOLUTION_CACHE.get(contract) as Promise<abi>;
}
console.log("[resolveContractAbi] - no cache");

const prom = (async () => {
console.log("[resolveContractAbi] - fetching");
// if the contract already HAS a user defined we always use that!
if (contract.abi) {
return contract.abi as abi;
Expand All @@ -29,7 +26,7 @@ export function resolveContractAbi<abi extends Abi>(
);
const json = await response.json();
// abi is in json.output.abi
console.log("[resolveContractAbi] - resolved");

return json.output.abi as abi;
})();
ABI_RESOLUTION_CACHE.set(contract, prom);
Expand Down

0 comments on commit 3ede4f4

Please sign in to comment.