Skip to content

Commit

Permalink
Merge branch 'ubiquity-os:development' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
hhio618 authored Oct 17, 2024
2 parents c78613a + d0d231b commit 9fe5fda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/handlers/generate-erc20-permit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ async function getTokenDecimals(tokenAddress: string, provider: ethers.providers
const tokenContract = new ethers.Contract(tokenAddress, erc20Abi, provider);
return await tokenContract.decimals();
} catch (error) {
const errorMessage = `Failed to get token decimals for token: ${tokenAddress}`;
logger.debug(errorMessage);
const errorMessage = `Failed to get token decimals for token: ${tokenAddress}, ${error}`;
logger.debug(errorMessage, { error });
throw new Error(errorMessage);
}
}
6 changes: 4 additions & 2 deletions src/utils/get-fastest-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ function getHandler(networkId: number | string) {
networkName: null,
runtimeRpcs: null,
networkRpcs: null,
proxySettings: {
retryCount: 5,
},
};

return new RPCHandler(config as HandlerConstructorConfig);
Expand All @@ -18,8 +21,7 @@ function getHandler(networkId: number | string) {
export async function getFastestProvider(networkId: number | string): Promise<providers.JsonRpcProvider> {
try {
const handler = getHandler(networkId);
const provider = await handler.getFastestRpcProvider();
return new providers.JsonRpcProvider(provider.connection.url);
return await handler.getFastestRpcProvider();
} catch (e) {
throw new Error(`Failed to get fastest provider for networkId: ${networkId}`);
}
Expand Down

0 comments on commit 9fe5fda

Please sign in to comment.