cosmos-sdk/x/distribution/types
Tyler 2188dd0f3c
feat: add coins burned to slash event (#9458)
<!--
The default pull request template is for types feat, fix, or refactor.
For other templates, add one of the following parameters to the url:
- template=docs.md
- template=other.md
-->

## Description

Adds the amount of coins slashed from the validator to the `Slash` event. Additionally, before this PR, the jail/slash events were emitted **BEFORE** the slash/jail functions were even ran, which could result in a false positive event if an error occurred in these functions. ~~These events were moved to the end of the functions that implement the logic for them instead.~~ This PR moves the events to be emitted after the logic is executed. 

Closes: #9138 

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

- +Add `amount_slashed` to slash event
- +Slash now returns the amount of tokens burned
- +Events moved to be emitted after the logic is executed
- +Add test to test the slash return amount
~~- +Add EventType `Jail` to separate it from the `Slash` event~~
~~- +Move slash/jail events into the functions that execute the logic for it~~
~~- -Remove `Reason` attribute from slash event (didn't appear to be consistent with what was happening in code)~~

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [x] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [x] provided a link to the relevant issue or specification
- [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [x] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [x] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [x] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [x] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - @ryanchristo 
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [x] reviewed state machine logic - not applicable
- [x] reviewed API design and naming - @ryanchristo 
- [x] reviewed documentation is accurate - @ryanchristo 
- [x] reviewed tests and test coverage - @ryanchristo 
- [ ] manually tested (if applicable)
2021-07-05 14:33:30 +00:00
..
codec.go RegisterInterfaces registers service Msg type_urls (#7671) 2020-10-28 19:20:45 +00:00
common_test.go Replace tmcrypto.PubKey by our own cryptotypes.PubKey (#7419) 2020-11-09 16:01:43 +00:00
delegator.go Merge PR #5610: proto: migrate x/distr to use hybrid codec 2020-02-11 09:58:37 -05:00
distribution.pb.go Update gogo proto deps with v1.3.2 security fixes (#8350) 2021-01-15 19:45:34 +00:00
errors.go Merge PR #5665: Bump Module ABCI Error Codes 2020-02-18 14:43:00 +01:00
events.go Merge PR #5102: Make events const and alias them (if internal) 2019-09-25 09:17:02 -07:00
expected_keepers.go feat: add coins burned to slash event (#9458) 2021-07-05 14:33:30 +00:00
fee_pool.go Merge PR #5610: proto: migrate x/distr to use hybrid codec 2020-02-11 09:58:37 -05:00
fee_pool_test.go x/distribution: fix module's parameters validation (#8918) 2021-03-17 20:06:54 +00:00
genesis.go Change `address` from bytes to bech32 strings (#7242) 2020-09-25 10:25:37 +00:00
genesis.pb.go Update gogo proto deps with v1.3.2 security fixes (#8350) 2021-01-15 19:45:34 +00:00
keys.go docs: x/distribution spec (#8928) 2021-05-03 18:40:34 +00:00
msg.go build(deps): bump github.com/otiai10/copy from 1.5.0 to 1.5.1 (#9077) 2021-04-09 14:09:25 +00:00
msg_test.go Merge PR #5384: Fund Community Pool -- Part II 2019-12-10 23:02:15 -05:00
params.go x/distribution: fix module's parameters validation (#8918) 2021-03-17 20:06:54 +00:00
params_internal_test.go x/distribution: fix module's parameters validation (#8918) 2021-03-17 20:06:54 +00:00
params_test.go x/distribution: fix module's parameters validation (#8918) 2021-03-17 20:06:54 +00:00
proposal.go Change `address` from bytes to bech32 strings (#7242) 2020-09-25 10:25:37 +00:00
querier.go x/distribution: gRPC query service (#6600) 2020-07-13 20:01:16 +00:00
query.go Change `address` from bytes to bech32 strings (#7242) 2020-09-25 10:25:37 +00:00
query.pb.go Update gogo proto deps with v1.3.2 security fixes (#8350) 2021-01-15 19:45:34 +00:00
query.pb.gw.go gRPC gateway issue with colons in the account url path (#8649) 2021-02-22 11:30:45 +00:00
tx.pb.go Update gogo proto deps with v1.3.2 security fixes (#8350) 2021-01-15 19:45:34 +00:00
validator.go Merge PR #5610: proto: migrate x/distr to use hybrid codec 2020-02-11 09:58:37 -05:00