Skip to content

Bug: getAllChains() never awaits ensureConfig() and dumps chain list to console #7

Description

@David-patrick-chuks-02

Summary

In src/lib/lifi.ts:

export async function getAllChains() {
  ensureConfig();                 // not awaited
  const chains = await getChains({ chainTypes: [ChainType.EVM] });
  console.log(chains);            // dumps the entire chain list to stdout
}

ensureConfig() is called without await, so getChains() may run before LI.FI config (and the chain set) is initialized. It also logs the full chain array to the server console and is not referenced anywhere in the codebase (dead code).

Impact

  • Potential race condition if it is ever used.
  • Unwanted noise in server logs.
  • Dead export adds confusion about the intended helper API.

Suggested fix

  • await ensureConfig();
  • Remove the console.log(chains);
  • Either wire it up properly or remove the function entirely.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions