Skip to content

Macro the db.ex function wrappers #1191

Open
@Arkenan

Description

@Arkenan

Disclaimer: good first issue if you're not knowleadgable about the protocol, but macros are not trivial elixir. If you have worked with macros in any language but are new to ethereum consensus this might be a good first issue.

Most wrappers in the db.ex have the following pattern:

def some_function(some_args) do
  ref = GenServer.call(@registered_name, :get_ref)
  Exleveldb.some_function(some_args)
end

This makes adding each function in leveldb a bit of an unnecessary effort. Ideally we should have a macro that allowed us to do something like this:

wrapper function_a(a_args)
wrapper function_b(b_args)

That automatically did the boilerplate for a single function. This ticket will be finished when both the macro is coded and also all functions in Exleveldb are wrapped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersrefactorIdeas to improve code usability or performance with little or no change to behavior

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions