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

Potential improvements for the new x/gasless module #435

Open
zale144 opened this issue May 28, 2024 · 0 comments
Open

Potential improvements for the new x/gasless module #435

zale144 opened this issue May 28, 2024 · 0 comments

Comments

@zale144
Copy link
Contributor

zale144 commented May 28, 2024

Technical debt in x/gasless

There are places where things could be simplified, written a bit more clearly, methods that are a bit too long with high cognitive complexity, making them a bit hard to interpret, such as:

  • `x/gasless/keeper/fee_helper.go - size and cognitive complexity of methods should be reduced
  • x/gasless/keeper/store.go - handling the closing of the iterator, such as in IterateAllTxGTIDs should be done simply by defer iter.Close()
  • there are places where slices are initialized as literals. we should avoid this
  • x/gasless/keeper/store.go/UpdateConsumerAllowance - Is this meant to update all the consumers with matching gasTank.Id? In that case the method should be named something like UpdateConsumerAllowances. Also, there are multiple places where consumptions are iterated to find the one with matching gasTank.Id. There should be a method for that.

There should be more unit tests across the module.

Potential future functionalities

  • Currently we can only have one fee denom per gas tank. It would be nice to remove that restriction in the future.
  • Another limitation is the possibility of having only one message per transaction. That can also be a bit restricting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant