Skip to content

Default to snake case in the Ethers.get_logs/2 overrides and options #151

@joaop21

Description

@joaop21

From the Ethers.get_logs/2 documentation:

  """
  ## Overrides and Options

  - `:address`: Indicates event emitter contract address. (nil means all contracts)
  - `:rpc_client`: The RPC Client to use. It should implement ethereum jsonRPC API. default: Ethereumex.HttpClient
  - `:rpc_opts`: Extra options to pass to rpc_client. (Like timeout, Server URL, etc.)
  - `:fromBlock`: Minimum block number of logs to filter.
  - `:toBlock`: Maximum block number of logs to filter.
  """

This naming needs to be more consistent.
In addition, there's a naming convention that Elixir projects should follow.
In this case, it's clear that fromBlock and toBlock should instead be from_block and to_block.

This is in the project's documentation, but following the convention here would make it more intuitive for Elixir developers.

For context, I was using this function and getting no logs because I was using snake case instead of camel case. I only found out about this when logging the raw request.

This leads me to think that validating the overrides and options might not be a bad idea 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions