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

refactor: emit cumulative fees when incentivizing a packet multiple times #1391

Merged
merged 6 commits into from
May 18, 2022

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented May 16, 2022

Description

closes: #1327


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@codecov-commenter
Copy link

codecov-commenter commented May 16, 2022

Codecov Report

Merging #1391 (87ba078) into main (21021d0) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1391      +/-   ##
==========================================
+ Coverage   80.35%   80.37%   +0.01%     
==========================================
  Files         166      166              
  Lines       12083    12094      +11     
==========================================
+ Hits         9709     9720      +11     
  Misses       1918     1918              
  Partials      456      456              
Impacted Files Coverage Δ
modules/apps/29-fee/keeper/escrow.go 93.67% <100.00%> (+0.16%) ⬆️
modules/apps/29-fee/keeper/events.go 100.00% <100.00%> (ø)
modules/apps/29-fee/ibc_middleware.go 93.97% <0.00%> (-0.22%) ⬇️

Copy link
Member

@AdityaSripal AdityaSripal left a comment

Choose a reason for hiding this comment

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

nice and clean!

Comment on lines 24 to 26
totalRecvFees.Add(fee.Fee.RecvFee...)
totalAckFees.Add(fee.Fee.AckFee...)
totalTimeoutFees.Add(fee.Fee.TimeoutFee...)
Copy link
Member

@damiannolan damiannolan May 18, 2022

Choose a reason for hiding this comment

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

Should we reassign as coins.Add(...) returns sdk.Coins?

totalRecvFees = totalRecvFees.Add(...)
// ...etc

I think this needs to be done for the singular coin.Add() function. Not 100% sure about Coins but may be good practise to keep consistent and handle return value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems like a good idea to me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice catch 🐛 - the tests were using an expected value of "", the lack of reassigning didn't change the variable values

@colin-axner colin-axner merged commit 2ae4f10 into main May 18, 2022
@colin-axner colin-axner deleted the colin/1327-emit-cumulative-fees branch May 18, 2022 11:14
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.

EmitIncentivizedPacket should emit cumulative fees on a packet
6 participants