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

refactored queries, ante/post handlers and DenomResolver #81

Merged

Conversation

swelf19
Copy link
Contributor

@swelf19 swelf19 commented May 23, 2024

  • Fields/structures/queries and all entities that are essentially gas_price but were named fee, renamed to gas_price
  • Extended DenomResolver interface, the interface requires an additional method ExtraDenoms, the method should return a list of all denoms in which it is possible to pay fees. Used in GasPrices method to display gas prices for all currencies.
  • The ConvertToDenom DenomResolver method now works with DecCoin instead of Coin.
  • Params.Enabled parameter turns off not only post handler, but also ante handler.
  • Query server refactored. Now it serves two queries.
    1. GasPrice with a denom payload as argument. Returns a gas price for specified denom
    2. GasPrices without arguments. Returns a list of all gas prices (addetionel denoms come from ExtraDenoms method). Those can be used as fees

x/feemarket/ante/fee.go Outdated Show resolved Hide resolved
x/feemarket/post/fee.go Outdated Show resolved Hide resolved
x/feemarket/keeper/feemarket.go Outdated Show resolved Hide resolved
tests/e2e/setup.go Outdated Show resolved Hide resolved
@swelf19 swelf19 marked this pull request as ready for review May 29, 2024 15:05
x/feemarket/ante/fee.go Outdated Show resolved Hide resolved
x/feemarket/client/cli/query.go Outdated Show resolved Hide resolved
x/feemarket/fuzz/aimd_eip1559_test.go Outdated Show resolved Hide resolved
x/feemarket/keeper/feemarket.go Outdated Show resolved Hide resolved
x/feemarket/keeper/query_server.go Outdated Show resolved Hide resolved
x/feemarket/keeper/query_server.go Outdated Show resolved Hide resolved
Short: "Query for the current feemarket base fee",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, _ []string) error {
Use: "gas-price",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add a cli query for gas-prices

@swelf19
Copy link
Contributor Author

swelf19 commented May 29, 2024

I also updated output format from

$ neutrond q feemarket gas-price untrn
0.002500000000000000untrn
$ neutrond q feemarket gas-prices
0.002500000000000000untrn

to

$ ./build/neutrond q feemarket gas-price untrn
price:
  amount: "0.002500000000000000"
  denom: untrn

wdyt?
it also allows you to encode output as json

@aljo242 aljo242 merged commit cf0c02f into skip-mev:main May 29, 2024
6 checks passed
mergify bot pushed a commit that referenced this pull request May 29, 2024
* refactored queries, ante/post handlers and DenomResolver

* fixed tests

* disabling Ante when params.enabled == false

* renamed AllowedDenom -> ExtraDenoms. Renamed fee entities to gasprice

* tiny fixes

* reuse variable instaed of getting it by index

* Update x/feemarket/fuzz/aimd_eip1559_test.go

Co-authored-by: Alex Johnson <[email protected]>

* Update x/feemarket/keeper/query_server.go

Co-authored-by: Alex Johnson <[email protected]>

* Update x/feemarket/keeper/query_server.go

Co-authored-by: Alex Johnson <[email protected]>

* Update x/feemarket/keeper/feemarket.go

Co-authored-by: Alex Johnson <[email protected]>

* some reviews fixes (fee -> gasPrice)

* added cli query gas-prices. updated output format for gas-price(s) queries

---------

Co-authored-by: Alex Johnson <[email protected]>
(cherry picked from commit cf0c02f)

# Conflicts:
#	tests/e2e/suite.go
aljo242 pushed a commit that referenced this pull request May 29, 2024
* refactored queries, ante/post handlers and DenomResolver

* fixed tests

* disabling Ante when params.enabled == false

* renamed AllowedDenom -> ExtraDenoms. Renamed fee entities to gasprice

* tiny fixes

* reuse variable instaed of getting it by index

* Update x/feemarket/fuzz/aimd_eip1559_test.go

Co-authored-by: Alex Johnson <[email protected]>

* Update x/feemarket/keeper/query_server.go

Co-authored-by: Alex Johnson <[email protected]>

* Update x/feemarket/keeper/query_server.go

Co-authored-by: Alex Johnson <[email protected]>

* Update x/feemarket/keeper/feemarket.go

Co-authored-by: Alex Johnson <[email protected]>

* some reviews fixes (fee -> gasPrice)

* added cli query gas-prices. updated output format for gas-price(s) queries

---------

Co-authored-by: Alex Johnson <[email protected]>
(cherry picked from commit cf0c02f)

# Conflicts:
#	tests/e2e/suite.go

Co-authored-by: swelf19 <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants