generated from ChainSafe/yarn-workspaces-typescript-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
146 additions
and
25 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { HttpProvider } from "web3"; | ||
import { Domain, Network } from "@buildwithsygma/sygma-sdk-core"; | ||
|
||
// TODO: Refactor to be reusable... and maybe add sinon | ||
export function createMockHttpProvider(): typeof HttpProvider { | ||
return MockHttpProvider as unknown as typeof HttpProvider; | ||
} | ||
|
||
class MockHttpProvider { | ||
async request(payload: { method: string }) { | ||
if (payload.method === "eth_chainId") { | ||
return { jsonrpc: "2.0", id: 1, result: "0x5" }; // Example chain ID in hex format | ||
} | ||
} | ||
} | ||
|
||
export const mockDomains: Domain[] = [ | ||
{ | ||
id: 1, | ||
chainId: 5, | ||
name: "goerli", | ||
type: Network.EVM, | ||
}, | ||
{ | ||
id: 2, | ||
chainId: 11155111, | ||
name: "sepolia", | ||
type: Network.EVM, | ||
}, | ||
{ | ||
id: 6, | ||
chainId: 17000, | ||
name: "holesky", | ||
type: Network.EVM, | ||
}, | ||
{ | ||
id: 7, | ||
chainId: 80001, | ||
name: "mumbai", | ||
type: Network.EVM, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters