-
Notifications
You must be signed in to change notification settings - Fork 31
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
Start refactoring into storeutils #15
base: master
Are you sure you want to change the base?
Conversation
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.
Good progress. We need doc strings though
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.
EntityID
could be replaced by sdk.Uint
altogether
Re: The goal of the Let me know if this isn't enough of a reason to keep the standalone type and I'll remove it. |
f906c8a
to
3293c06
Compare
Note that the files in `storeutils` now return generic `error` objects rather than `sdk.Error`s. This is done in an effort to decouple them from the DEX codebase. To transform the error objects back into `sdk.Error`s that are meaningful to the DEX, I've created some wrapper functions in `types/errs/errs.go` that convert the `error` objects into the DEC-appropriate `sdk.Error`.
3293c06
to
5396c82
Compare
storeutil/operations.go
Outdated
) | ||
|
||
var ( | ||
ErrNotFound = errors.New("not found") |
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.
ErrNotFound = errors.New("not found") | |
ErrorStoreKeyNotFound = errors.New("key not found") |
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.
ErrorKeyNotFound
would work too
storeutil/operations.go
Outdated
|
||
var ( | ||
ErrNotFound = errors.New("not found") | ||
ErrAlreadyExists = errors.New("already exists") |
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.
ErrAlreadyExists = errors.New("already exists") | |
ErrorKeyExists = errors.New("key exists") |
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.
Just a couple of variable renames then this is good to go
Note that the files in
storeutils
now return genericerror
objects rather thansdk.Error
s. This is donein an effort to decouple them from the DEX codebase. To transform the error objects back into
sdk.Error
sthat are meaningful to the DEX, I've created some wrapper functions in
types/errs/errs.go
that convertthe
error
objects into the DEC-appropriatesdk.Error
.