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

feat(crypto): implement error classes #2038

Merged
merged 13 commits into from
Feb 1, 2019
Merged

feat(crypto): implement error classes #2038

merged 13 commits into from
Feb 1, 2019

Conversation

faustbrian
Copy link
Contributor

@faustbrian faustbrian commented Jan 31, 2019

Proposed changes

Resolves #2028.

The crypto package now throws specific errors for specific issues rather then a generic Error. This allows us to assert types of errors in tests and the application itself rather then fiddling with the string messages of the generic error.

All of those errors extend the CryptoError class which is generic within the crypto package but still allows us to identify that the error came from the crypto package rather then guessing what happened.

Tests have been adjusted to assert instances of errors rather then messages.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING documentation
  • Lint and unit tests pass locally with my changes

@ghost
Copy link

ghost commented Jan 31, 2019

@faustbrian Thanks for submitting this pull request, a maintainer will get back to you shortly!

@ghost
Copy link

ghost commented Jan 31, 2019

@faustbrian @alexbarnsley @supaiku0 - please review this pull request in the next few days. Be sure to explicitly select labels so I know what's going on.

If no reviewer appears after a week, a reminder will be send out.

@ghost ghost added the Complexity: Medium label Jan 31, 2019
@ArkEcosystem ArkEcosystem deleted a comment Jan 31, 2019
@ghost
Copy link

ghost commented Jan 31, 2019

@faustbrian The ci/circleci: test-node11-2 job is failing as of a63996a72a3cd46b516899eed2c7fce15143e94f. Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@codecov-io
Copy link

codecov-io commented Jan 31, 2019

Codecov Report

Merging #2038 into develop will increase coverage by 0.11%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #2038      +/-   ##
==========================================
+ Coverage    73.69%   73.8%   +0.11%     
==========================================
  Files          366     367       +1     
  Lines         8223    8258      +35     
  Branches      1177    1174       -3     
==========================================
+ Hits          6060    6095      +35     
+ Misses        2131    2129       -2     
- Partials        32      34       +2
Impacted Files Coverage Δ
packages/crypto/src/identities/address.ts 100% <100%> (ø) ⬆️
packages/crypto/src/crypto/crypto.ts 100% <100%> (ø) ⬆️
...s/crypto/src/builder/transactions/multi-payment.ts 100% <100%> (ø) ⬆️
packages/crypto/src/serializers/transaction.ts 100% <100%> (ø) ⬆️
...ges/crypto/src/builder/transactions/transaction.ts 100% <100%> (ø) ⬆️
packages/crypto/src/errors.ts 100% <100%> (ø)
packages/crypto/src/crypto/bip38.ts 100% <100%> (ø) ⬆️
packages/crypto/src/identities/keys.ts 100% <100%> (ø) ⬆️
packages/crypto/src/deserializers/transaction.ts 100% <100%> (ø) ⬆️
packages/core-test-utils/src/helpers/container.ts 0% <0%> (ø) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef563b7...379ff23. Read the comment docs.

@spkjp spkjp merged commit b5bcfe9 into develop Feb 1, 2019
@ghost ghost deleted the feat/crypto-errors branch February 1, 2019 21:26
@ghost ghost removed the Status: Needs Review label Feb 1, 2019
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.

3 participants