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

watchBlock with fetching transactions doesn't work #2960

Closed
1 task done
franklee00 opened this issue Nov 3, 2024 · 3 comments
Closed
1 task done

watchBlock with fetching transactions doesn't work #2960

franklee00 opened this issue Nov 3, 2024 · 3 comments
Labels
needs reproduction Misc: Needs Reproduction

Comments

@franklee00
Copy link

Check existing issues

Viem Version

latest

Current Behavior

While set the options includeTransactions to true, onBlock fetch undefined instead of transactions arrays.

client.watchBlocks({
    includeTransactions: true, 
    onBlock: async (block) => {
        console.log(block.transactions)
    },
    onError: (error) => console.error(error),
});

Expected Behavior

return array of transactions

Steps To Reproduce

No response

Link to Minimal Reproducible Example

No response

Anything else?

No response

@jxom
Copy link
Member

jxom commented Nov 3, 2024

Needs repro. We have a test for this.

@jxom jxom added the needs reproduction Misc: Needs Reproduction label Nov 3, 2024
Copy link
Contributor

github-actions bot commented Nov 3, 2024

Hello @franklee00.

Please provide a minimal reproduction using StackBlitz, TypeScript Playground (for type issues), or a separate minimal GitHub repository.

Minimal reproductions are required as they save us a lot of time reproducing your config/environment and issue, and allow us to help you faster.

Once a minimal reproduction is added, a team member will confirm it works, then re-open the issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2024
@franklee00
Copy link
Author

franklee00 commented Nov 4, 2024

The answer is in the test file--adding options below and everything goes well. It works!

`onBlock: (block) => blocks.push(block),

includeTransactions: true,
poll: true,
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction Misc: Needs Reproduction
Projects
None yet
Development

No branches or pull requests

2 participants