Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Change evm_hook to use Transaction Receipt #849

Merged
merged 11 commits into from
Jan 3, 2022
Merged

Conversation

ramacarlucho
Copy link
Contributor

@ramacarlucho ramacarlucho commented Dec 17, 2021

Closes: #ENG-381

Description

Some hooks may need gasUsed by the execution


For contributor use:

  • 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

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@codecov
Copy link

codecov bot commented Dec 17, 2021

Codecov Report

Merging #849 (d44e7dd) into main (9f4828e) will increase coverage by 0.38%.
The diff coverage is 74.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #849      +/-   ##
==========================================
+ Coverage   56.79%   57.18%   +0.38%     
==========================================
  Files          74       74              
  Lines        6106     6140      +34     
==========================================
+ Hits         3468     3511      +43     
+ Misses       2433     2423      -10     
- Partials      205      206       +1     
Impacted Files Coverage Δ
x/evm/keeper/state_transition.go 76.50% <70.83%> (+0.59%) ⬆️
types/account.go 35.71% <83.33%> (+35.71%) ⬆️
x/evm/keeper/hooks.go 100.00% <100.00%> (ø)
x/evm/keeper/keeper.go 81.56% <100.00%> (ø)
types/codec.go 100.00% <0.00%> (+100.00%) ⬆️

@github-actions github-actions bot added C:CLI C:Proto protobuf files (*.pb.go) C:Types common types, interfaces and functions from /types Type: Docs Improvements or additions to documentation labels Jan 3, 2022
@fedekunze fedekunze marked this pull request as ready for review January 3, 2022 14:53
Copy link
Contributor

@danburck danburck left a comment

Choose a reason for hiding this comment

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

LGTM

@fedekunze fedekunze merged commit b980450 into main Jan 3, 2022
@fedekunze fedekunze deleted the rama/hook-receipt branch January 3, 2022 16:18
} else if commit != nil {
// PostTxProcessing is successful, commit the cache context
commit()
ctx.EventManager().EmitEvents(k.Ctx().EventManager().Events())
Copy link
Contributor

Choose a reason for hiding this comment

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

hooks execution is moved under the k.WithContext(ctx), this changed the context hooks executed in.
And k.Ctx() is same as ctx here, we'll lose events emitted by hooks, and re-emit events in `ctx.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C:CLI C:Proto protobuf files (*.pb.go) C:Types common types, interfaces and functions from /types Type: Docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants