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

bug: waitForTransactionReceipt doesn't accept client with multiple possible chains #3635

Open
1 task done
LufyCZ opened this issue Feb 25, 2024 · 3 comments · May be fixed by #3929
Open
1 task done

bug: waitForTransactionReceipt doesn't accept client with multiple possible chains #3635

LufyCZ opened this issue Feb 25, 2024 · 3 comments · May be fixed by #3929
Labels
Good First Issue Misc: Good First Issue

Comments

@LufyCZ
Copy link
Author

LufyCZ commented Feb 25, 2024

using client.waitForTransactionReceipt works fine (might be the intended usage?)

@jxom jxom transferred this issue from wevm/viem Feb 25, 2024
@tmm tmm added the Good First Issue Misc: Good First Issue label Mar 5, 2024
@tmm
Copy link
Member

tmm commented Apr 2, 2024

If anyone wants to look into this, this is the test that you need to pass:

getClient.test-d.ts

test('behavior: viem actions', () => {
  const config = createConfig({
    chains: [arbitrumNova, optimism],
    transports: {
      [arbitrumNova.id]: http(),
      [optimism.id]: http(),
    },
  })
  const client = getClient(config)
  waitForTransactionReceipt(client, { hash: '0x…' })
})

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 26, 2024
@jxom jxom reopened this Apr 26, 2024
@KedziaPawel
Copy link

shouldn't this issue be linked inside viem repo, as it was originally? The bug seems to be related to viem/actions which are part of viem repo. In the getClient.test-d.ts I need to write code like below to recreate the issue

import { chain, config } from '@wagmi/test'
import { expectTypeOf, test } from 'vitest'

import { http } from 'viem'
import { waitForTransactionReceipt } from 'viem/actions'
import { createConfig } from '../createConfig.js'
import { arbitrumNova, optimism } from '../exports/chains.js'
import { getClient } from './getClient.js'

test('behavior: viem actions', () => {
  const config = createConfig({
    chains: [arbitrumNova, optimism],
    transports: {
      [arbitrumNova.id]: http(),
      [optimism.id]: http(),
    },
  })
  const client = getClient(config)
  waitForTransactionReceipt(client, { hash: '0x…' })
})

@benschac benschac linked a pull request May 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Misc: Good First Issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants