Skip to content

Commit

Permalink
Merge pull request #57 from ubiquibot/development
Browse files Browse the repository at this point in the history
Development into main
  • Loading branch information
rndquu authored Sep 6, 2024
2 parents 161d527 + acaecdd commit 4843a38
Show file tree
Hide file tree
Showing 4 changed files with 10,132 additions and 7,098 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@octokit/webhooks": "^13.1.0",
"@sinclair/typebox": "^0.32.5",
"@supabase/supabase-js": "2.42.0",
"@ubiquity-dao/rpc-handler": "^1.1.0",
"@ubiquity-dao/rpc-handler": "1.3.0",
"@uniswap/permit2-sdk": "^1.2.0",
"dotenv": "^16.4.4",
"ethers": "6.11.1",
Expand Down
4 changes: 2 additions & 2 deletions src/utils/get-fastest-provider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-expect-error - no types
import { RPCHandler, HandlerConstructorConfig } from "@ubiquity-dao/rpc-handler";
import { JsonRpcProvider } from "ethers";

Expand All @@ -19,7 +18,8 @@ function getHandler(networkId: number | string) {
export async function getFastestProvider(networkId: number | string): Promise<JsonRpcProvider> {
try {
const handler = getHandler(networkId);
return await handler.getFastestRpcProvider();
const provider = await handler.getFastestRpcProvider();
return new JsonRpcProvider(provider.connection.url);
} catch (e) {
throw new Error(`Failed to get fastest provider for networkId: ${networkId}`);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/generate-erc721-permit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ describe("generateErc721PermitSignature", () => {
});

it("should throw an error if RPC is not defined", async () => {
context.config.evmNetworkId = 123;
await expect(generateErc721PermitSignature(context, "123", "contribution")).rejects.toThrow("Failed to get fastest provider for networkId: 123");
context.config.evmNetworkId = 0;
await expect(generateErc721PermitSignature(context, "123", "contribution")).rejects.toThrow("Failed to get fastest provider for networkId: 0");
});

it("should throw an error if NFT minter private key is not defined", async () => {
Expand Down
Loading

0 comments on commit 4843a38

Please sign in to comment.