-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 x/evidence to ADR-031 #7538
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7538 +/- ##
==========================================
- Coverage 54.18% 54.15% -0.04%
==========================================
Files 604 605 +1
Lines 38159 38162 +3
==========================================
- Hits 20675 20665 -10
- Misses 15388 15401 +13
Partials 2096 2096 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update the return type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-approving, LGTM.
Co-authored-by: Marie Gauthier <[email protected]>
// implement in order to process submitted evidence. The concrete MsgSubmitEvidence | ||
// must be defined at the application-level. | ||
type MsgSubmitEvidence interface { | ||
type MsgSubmitEvidenceI interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we still need an interface here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And why the renaming?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we still need an interface here?
basically:
- MsgSubmitEvidence is the wire type
- MsgSubmitEvidenceI is the domain type, which the keeper manipulates
not strictly necessary, but i also don't want to introduce too many refactors here
And why the renaming?
it's confusing to have an interface and a struct having the same name.
x/evidence/keeper/keeper.go
Outdated
// the corresponding registered Evidence Handler. An error is returned if no | ||
// registered Handler exists or if the Handler fails. Otherwise, the evidence is | ||
// persisted. | ||
func (k Keeper) SubmitEvidence(ctx sdk.Context, evidence exported.Evidence) error { | ||
func (k Keeper) SubmitEvidenceI(ctx sdk.Context, evidence exported.Evidence) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (k Keeper) SubmitEvidenceI(ctx sdk.Context, evidence exported.Evidence) error { | |
func (k Keeper) SubmitEvidence(ctx sdk.Context, evidence exported.Evidence) error { |
Let's revert this. There is no EvidenceI
interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, i'll add a msgServer struct then
* Refactor x/evidence to ADR-031 * Add hash in response * Update changelog * Update x/evidence/keeper/keeper.go * Update proto/cosmos/evidence/v1beta1/tx.proto Co-authored-by: Marie Gauthier <[email protected]> * Use msgServer struct Co-authored-by: Marie Gauthier <[email protected]>
* Refactor RegisterQueryServices -> RegisterServices (#7518) * Refactor RegisterQueryServices -> RegisterServices * Fix tests * Add ADR 031 BaseApp and codec infrastructure (#7519) * Refactor RegisterQueryServices -> RegisterServices * Cleaner proto files * Fix tests * Add MsgServer * Fix lint * Remove MsgServer from configurator for now * Remove useless file * Fix build * typo * Add router * Fix test * WIP * Add router * Remove test helper * Add beginning of test * Move test to simapp? * ServiceMsg implement sdk.Msg * Add handler by MsgServiceRouter * Correct signature * Add full test * use TxEncoder * Update baseapp/msg_service_router.go Co-authored-by: Aaron Craelius <[email protected]> * Push changes * WIP on ServiceMsg unpacking * Make TestMsgService test pass * Fix tests * Tidying up * Tidying up * Tidying up * Add JSON test * Add comments * Tidying * Lint * Register MsgRequest interface * Rename * Fix tests * RegisterCustomTypeURL * Add changelog entries * Put in features * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk <[email protected]> * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk <[email protected]> * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk <[email protected]> * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk <[email protected]> * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk <[email protected]> * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk <[email protected]> * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk <[email protected]> * Address review comments * Address nit * Fix lint * Update codec/types/interface_registry.go Co-authored-by: Marie Gauthier <[email protected]> * godoc Co-authored-by: Aaron Craelius <[email protected]> Co-authored-by: Aaron Craelius <[email protected]> Co-authored-by: Aleksandr Bezobchuk <[email protected]> Co-authored-by: Marie Gauthier <[email protected]> * Refactor x/bank according to ADR 031 (#7520) * Refactor x/bank according to ADR 031 * Add comment * Update comment * Add comment * Add tests, address edge cases * Imports Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Refactor x/{gov, crisis} according to ADR 031 (#7533) * Refactor x/gov according to ADR 31 * fix tests * Refactor x/crisis according to ADR 031 * fix lint * lint * lint * review changes * lint * review change * fic doc Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Refactor x/distribution according to ADR 031 (#7524) * Refactor x/distribution according to ADR 31 * lint * removed unused * Apply suggestions from code review Co-authored-by: Marie Gauthier <[email protected]> Co-authored-by: Aaron Craelius <[email protected]> Co-authored-by: Marie Gauthier <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * [x/slashing] Implement Protobuf Msg Services (#7557) * Update x/slashing to use proto msg service * Fix proto-gen Co-authored-by: Aaron Craelius <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Refactor x/auth/vesting to use ADR-031 (#7551) * update auth/vesting module to use proto msg services * rm accidental tmp files * Update x/auth/vesting/msg_server.go Co-authored-by: Marie Gauthier <[email protected]> * golangci-lint fix Co-authored-by: Marie Gauthier <[email protected]> Co-authored-by: Aaron Craelius <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Refactor x/staking according to ADR 031 (#7556) * Refactor x/staking according to ADR 031 * lint * review changes * review changes * review changes Co-authored-by: Aaron Craelius <[email protected]> * Add MsgServer to Configurator for ADR 031 wiring (#7584) * Add MsgServer to Configurator for ADR 031 wiring * Add docs, wire up evidence & staking * Add integration test * Add comments * Doc strings * Update types/module/configurator.go Co-authored-by: Aleksandr Bezobchuk <[email protected]> * Update types/module/configurator.go Co-authored-by: Cory <[email protected]> * Wire up vesting * Update CHANGELOG.md Co-authored-by: Aleksandr Bezobchuk <[email protected]> Co-authored-by: Amaury Martiny <[email protected]> Co-authored-by: Cory <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Refactor x/evidence to ADR-031 (#7538) * Refactor x/evidence to ADR-031 * Add hash in response * Update changelog * Update x/evidence/keeper/keeper.go * Update proto/cosmos/evidence/v1beta1/tx.proto Co-authored-by: Marie Gauthier <[email protected]> * Use msgServer struct Co-authored-by: Marie Gauthier <[email protected]> * Refactor x/ibc to ADR 031 (#7576) * WIP: Refactor x/ibc to ADR 031 * updated handler * removed unsued * fix * Add proto service for ibc/transfer * lint * remove old upgrade handler * added doc * review changes * fix tests * formatter * Add MsgServer wiring in RegisterServices Co-authored-by: Aaron Craelius <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * add changelog entries for non-nil Result.Data fields in message responses Co-authored-by: Aaron Craelius <[email protected]> Co-authored-by: Amaury Martiny <[email protected]> Co-authored-by: Aaron Craelius <[email protected]> Co-authored-by: Aleksandr Bezobchuk <[email protected]> Co-authored-by: Marie Gauthier <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: atheeshp <[email protected]>
Description
ref: #7500
closes #7542
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.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes