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(types): cleanup and organize types package #1451

Merged
merged 4 commits into from
Aug 31, 2022
Merged

Conversation

technicallyty
Copy link
Contributor

Description

  • cleans up type package by consolidating files in the folders that use them
  • moves fixture package into testutil directory, as it is mainly a test utility
  • remove unused files/functions
  • renames the FixtureFactory implementation file from testutil.go to impl.go

Closes: n/a


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...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • 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...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@technicallyty technicallyty marked this pull request as ready for review August 31, 2022 19:27
@technicallyty technicallyty requested a review from a team August 31, 2022 19:27
@codecov
Copy link

codecov bot commented Aug 31, 2022

Codecov Report

Merging #1451 (8967f06) into main (91e79f8) will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1451      +/-   ##
==========================================
+ Coverage   78.42%   78.48%   +0.05%     
==========================================
  Files         240      237       -3     
  Lines       18399    18386      -13     
==========================================
  Hits        14430    14430              
+ Misses       3131     3118      -13     
  Partials      838      838              
Impacted Files Coverage Δ
x/data/server/testsuite/genesis.go 100.00% <100.00%> (ø)
x/data/server/testsuite/suite.go 100.00% <100.00%> (ø)
x/ecocredit/server/tests/utils.go 100.00% <100.00%> (ø)
types/testutil/fixture/id.go

Copy link
Member

@ryanchristo ryanchristo left a comment

Choose a reason for hiding this comment

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

LGTM. One small nit and a changelog entry 🙏

Comment on lines 16 to 18
"github.com/cosmos/cosmos-sdk/baseapp"
sdkmodules "github.com/cosmos/cosmos-sdk/types/module"
"google.golang.org/grpc"
Copy link
Member

Choose a reason for hiding this comment

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

group imports 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

4e1f883 🤝

Comment on lines +9 to +16
type ModuleID struct {
ModuleName string
Path []byte
}

func (m ModuleID) Address() sdk.AccAddress {
return AddressHash(m.ModuleName, m.Path)
}
Copy link
Member

Choose a reason for hiding this comment

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

Moving this is a breaking change in the types module. We should add a changelog entry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

8967f06 🤝

Comment on lines +3 to +8
type InvokerFactory func(callInfo CallInfo) (Invoker, error)

type CallInfo struct {
Method string
Caller ModuleID
}
Copy link
Member

Choose a reason for hiding this comment

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

Moving this is a breaking change in the types module. We should add a changelog entry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

8967f06 🤝

@ryanchristo ryanchristo merged commit 25fecb4 into main Aug 31, 2022
@ryanchristo ryanchristo deleted the ty/cleanup_types branch August 31, 2022 21:20
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