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

feat: init custom fee antehandler and posthandler #27

Merged
merged 69 commits into from
Nov 28, 2023

Conversation

aljo242
Copy link
Collaborator

@aljo242 aljo242 commented Nov 15, 2023

  • init fee antehandler and posthandlerwhich accepts a FeeMarketKeeper interface
  • wire in app.go
  • move helper functions to the ante pkg
  • add ante and post packages
  • add test suite for ante and post

Comment on lines +198 to +204
if tc.ExpPass {
require.NoError(t, txErr)
require.NoError(t, handleErr)
require.NotNil(t, newCtx)

s.Ctx = newCtx
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to do any validation on the sent amount? I know that this is technically going to be testing external code but ideally we check fee amount was deducted, and that the context priority was correctly set.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So right now, all of these tests use a mock bank keeper, so the fees aren't really "sent". I figured we would do the validation of that in an e2e test, but we could also do it here.

wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

yea, im fine with e2e.

Copy link
Contributor

@davidterpay davidterpay left a comment

Choose a reason for hiding this comment

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

left some comments

return ctx, errorsmod.Wrapf(err, "unable to get fee market state")
}

state.Window[state.Index] += gas
Copy link
Contributor

Choose a reason for hiding this comment

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

I would use state.Update since that has a safety check on block gas limit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

blessed be thee

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@aljo242 aljo242 merged commit e872422 into main Nov 28, 2023
4 checks passed
@aljo242 aljo242 deleted the aljo242/fee-antehandler branch November 28, 2023 18:55
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