Skip to content

balanceOf calls fail in quickstart example #212

@quazzuk

Description

@quazzuk

When running the quickstart example I see the following output:

Failed to get token balance: server returned an error response: error code -32602: missing value for required argument 1
Failed to get WETH balance: server returned an error response: error code -32602: missing value for required argument 1

Looks like this is due to the BlockId is not being set and defaulting to None resulting in it being absent from the eth_call

I fixed locally with the following:

let result = provider
        .call(&TransactionRequest {
            to: Some(TxKind::Call(token_address)),
            input: data.into(),
            ..Default::default()
        })
        .block(BlockId::latest())
        .await?;

I can push a PR, if you'd prefer?

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions