-
Notifications
You must be signed in to change notification settings - Fork 13
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
[Supplier] refactor: supplier module errors #265
Conversation
d5492ed
to
3d97a36
Compare
a789bb3
to
7c961b5
Compare
3d97a36
to
cd0c4d7
Compare
9f31147
to
190b58b
Compare
cd0c4d7
to
f509fbf
Compare
190b58b
to
6ebd664
Compare
6ebd664
to
6817364
Compare
// NB: this is *NOT* a gRPC status error because the bech32 parse | ||
// error occurs during request validation (i.e. client-side). | ||
expectedErr: types.ErrSupplierInvalidAddress.Wrapf( | ||
// TODO_CONSIDERATION: prefer using "%q" in error format strings |
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.
I think this is an awesome idea. Let's start doing this!
Might just be worth @mentioning protocol-dev on discord and we'll adopt it over time.
Co-authored-by: harry <53987565+h5law@users.noreply.github.com> Co-authored-by: Daniel Olshansky <olshansky.daniel@gmail.com>
Co-authored-by: Daniel Olshansky <olshansky.daniel@gmail.com> Co-authored-by: harry <53987565+h5law@users.noreply.github.com>
@@ -9,7 +9,7 @@ import ( | |||
// x/supplier module sentinel errors | |||
var ( | |||
ErrSupplierInvalidStake = sdkerrors.Register(ModuleName, 1, "invalid supplier stake") | |||
ErrSupplierInvalidAddress = sdkerrors.Register(ModuleName, 2, "invalid supplier address") | |||
ErrSupplierInvalidAddress = sdkerrors.Register(ModuleName, 2, "invalid address") |
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.
NIT: revert?
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.
The intention behind this change is to avoid creating an additional supplier module error which represents an invalid application address. As we're already wrapping these errors with formatted messages (#Wrapf()
), it seemed more appropriate to me to generalize the message here. Additionally, my understanding of the purpose of naming the errors after their modules was to easily signal which module an error came from.
Co-authored-by: Daniel Olshansky <olshansky.daniel@gmail.com>
The CI will now also run the e2e tests on devnet, which increases the time it takes to complete all CI checks. |
…ctor/supplier-errors
…ctor/supplier-errors
…ctor/supplier-errors
…plier-errors * pokt/main: [Supplier] refactor: supplier module errors (#265)
…/in-memory-network * issues/141/prep/in-memory-network: [Testing, Tooling] chore: in-memory network interface & config types (#289) trigger CI [Supplier] refactor: supplier module errors (#265) [Supplier] refactor: supplier module keys (#264) [Supplier] refactor: claim & proof protobufs + (#263) chore: review feedback improvements [Configs] feat: Add staking config parser of gateway staking (#302) chore: review feedback improvements fix: usage raw string literal chore: review feedback improvements [RingCache] Invalidate Cache On Redelegation Events (#239)
…ctor/in-memory-network * issues/141/feat/in-memory-network: chore: review feedback improvements feat: update SMT to v0.9.2 (#311) fix: linter errors fixup! chore: review feedback improvements chore: review feedback improvements chore: review feedback improvements [Testing, Tooling] chore: in-memory network interface & config types (#289) trigger CI [Supplier] refactor: supplier module errors (#265) [Supplier] refactor: supplier module keys (#264) [Supplier] refactor: claim & proof protobufs + (#263) chore: review feedback improvements [Configs] feat: Add staking config parser of gateway staking (#302) chore: review feedback improvements fix: usage raw string literal chore: review feedback improvements [RingCache] Invalidate Cache On Redelegation Events (#239)
* refactor: `NewMinedRelay` to shared testutil * refactor: claim & proof protobuf types * refactor: rename supplier keeper `UpsertClaim` & `UpsertProof` * refactor: misc. claim-side improvements * chore: add TODOs * refactor: supplier module keys * refactor: supplier module errors * chore: review feedback improvements Co-authored-by: harry <53987565+h5law@users.noreply.github.com> Co-authored-by: Daniel Olshansky <olshansky.daniel@gmail.com> * chore: review feedback improvements Co-authored-by: Daniel Olshansky <olshansky.daniel@gmail.com> Co-authored-by: harry <53987565+h5law@users.noreply.github.com> * chore: review feedback improvements Co-authored-by: Daniel Olshansky <olshansky.daniel@gmail.com> * chore: add TODOs * trigger CI * trigger CI * chore: add TODO * chore: generalize ErrSupplierInvalidAddress and simplify * chore: review feedback improvements Co-authored-by: Daniel Olshansky <olshansky.daniel@gmail.com> * fix: usage raw string literal --------- Co-authored-by: harry <53987565+h5law@users.noreply.github.com> Co-authored-by: Daniel Olshansky <olshansky.daniel@gmail.com>
Summary
Human Summary
Refactors supplier module error usage to be consistent with respect to:
It also makes "tighter" assertions about the error types/messages in failure test cases.
Issue
SubmitProof
message handling #141Type of change
Select one or more:
Testing
make go_develop_and_test
make test_e2e
devnet-test-e2e
label to the PR. This is VERY expensive, only do it after all the reviews are complete.Sanity Checklist