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

[rfq] add test for unknown chainid #3006

Open
trajan0x opened this issue Aug 10, 2024 · 1 comment
Open

[rfq] add test for unknown chainid #3006

trajan0x opened this issue Aug 10, 2024 · 1 comment

Comments

@trajan0x
Copy link
Contributor

No description provided.

Copy link

greptile-apps bot commented Aug 10, 2024

To add a test for an unknown chain ID, follow these steps:

  1. Locate the Test File: Navigate to the test file where chain ID tests are implemented. This is likely in the tests directory, possibly under a file related to chain ID validation.

  2. Add Test Case: Add a new test case for an unknown chain ID. For example, in a file like ChainIDTest.js, add the following code:

it('should handle unknown chain ID', async () => {
  const unknownChainID = 9999; // Example unknown chain ID
  try {
    await someFunctionThatUsesChainID(unknownChainID);
  } catch (error) {
    assert.equal(error.message, 'Unknown chain ID');
  }
});
  1. Update Functionality: Ensure the function that uses the chain ID throws an error for unknown IDs. For example, in ChainIDHandler.js:
function someFunctionThatUsesChainID(chainID) {
  const knownChainIDs = [1, 3, 4, 5]; // Example known chain IDs
  if (!knownChainIDs.includes(chainID)) {
    throw new Error('Unknown chain ID');
  }
  // existing functionality
}
  1. Commit Changes: Commit the changes with a message like Add test for unknown chain ID.

References

/packages/sdk-router/src/sdk.test.ts
/agents/contracts/test/attestationharness/generate.go
/packages/contracts-rfq/deployments/base_sepolia
/services/rfq/README.md
/packages/contracts-rfq/deployments/op_sepolia
/services/explorer/graphql/client/client.go
/docs/bridge/docs/rfq/API/upsert-quote.api.mdx
/agents/contracts/test/snapshotharness/generate.go
/services/rfq/relayer/relapi/model.go
/services/scribe/config/chain.go
/packages/contracts-rfq/deployments/eth_sepolia
/packages/synapse-interface/assets/chains
/packages/contracts-rfq/deployments/bnb_testnet
/packages/solidity-devops/deployments/eth_sepolia
/services/rfq/api/docs/swagger.yaml
/packages/contracts-rfq/deployments/mainnet
/packages/contracts-rfq/deployments/scroll
/core/go.mod
/packages/contracts-rfq/deployments/base
/packages/contracts-rfq/deployments/optimism
/packages/contracts-rfq/deployments/scroll_sepolia
/services/cctp-relayer/contracts/cctp/generate.go
/agents/contracts/destination/generate.go
/packages/synapse-interface/public/pauses/v1/examples/paused-chains-example.json
/services/explorer/go.mod

About Greptile

This response provides a starting point for your research, not a precise solution.

Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

Ask Greptile · Edit Issue Bot Settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant