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

Folder/Package Renaming #16

Closed
colin-axner opened this issue May 14, 2018 · 3 comments
Closed

Folder/Package Renaming #16

colin-axner opened this issue May 14, 2018 · 3 comments

Comments

@colin-axner
Copy link
Member

Currently the bulk of the application is under the package types. The name "types" does not accurately represent all the files it contains. I think we should split this package into 2. 1 folder/package containing files for validation and low level database changes (mapper) and the other folder/package for higher level application changes and structure definitions.

For example we could have the packages auth and db:
package auth contains:

  • mapper.go
  • ante.go
  • utxo.go

package db contains:

  • handler.go
  • tx.go
  • keeper.go
  • errors.go

To work with the current version of the cosmos sdk we should add a errors.go file to define the codespace our errors will function in as outlined here. Notice that none of the files in package auth need to return an sdk.Error.

Thoughts?

@hamdiallam
Copy link
Member

I like the division

@colin-axner
Copy link
Member Author

To avoid circular dependencies here is an outline of the updated package ordering:
There are five packages : app, auth, db, types, and utils

  • app: app.go, app_test.go

  • auth: mapper.go, mapper_test.go, ante.go, ante_test.go, handler_test.go (can't be put in db or it creates a circular dependency, needs to be able to construct a mapper)

  • db:errors.go, handler.go, kepper.go, tx.go, tx_test.go

  • utils: utils.go

  • types:utxo.go, mapper.go (interface for utxo mapper)

@colin-axner
Copy link
Member Author

Updated spec in #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants