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(identities): improve implementation #120

Conversation

@sleepdefic1t
Copy link
Contributor

commented Jul 31, 2019

This PR is mostly centered around improving the Identities implementation.

Use of std::array replaces std::vector in many instances to avoid dynamic allocation. The result is a ~4x-6x gain in execution speed of relevant functions, and a reduced memory footprint overall.

Specifically, this PR does the following:

  • refactors Identities classes.
  • adds hash class.
  • adds curve class.
  • adds str helpers.
  • adds base58 class.
  • moves hex helpers.
  • updates other classes to match changes.
  • adds relevant tests.
  • updates scrips, examples, documentation, and changelog.

What kind of change does this PR introduce?

  • Refactor

Does this PR introduce a breaking change?

  • Yes
  • No

WIF class is now Wif, and Identities namespace is now identities per C++ code style guidelines.

Does this PR release a new version?

  • Yes
  • No

The PR fulfills these requirements:

  • It's submitted to the develop branch, not the master branch
  • All tests are passing
  • New/updated tests are included

faustbrian and others added some commits Jul 16, 2019

refactor(identities): improve implementation
This PR is mostly centered around improving the Identities implementation.

Use of std::array replaces std::vector in many instances to avoid dynamic allocation. The result is a ~4x-6x gain in execution speed of relevant functions, and a reduced memory footprint overall.

Specifically, this PR does the following:
- refactors Identities classes.
- adds hash class.
- adds curve class.
- adds str helpers.
- adds base58 class.
- moves hex helpers.
- updates other classes to match changes.
- adds relevant tests.
- updates scrips, examples, documentation, and changelog.
Update base58.cpp
codacy incorrectly analyzing header struct member as unused.
Not at all the case.
@codecov-io

This comment has been minimized.

Copy link

commented Jul 31, 2019

Codecov Report

Merging #120 into develop will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #120      +/-   ##
===========================================
- Coverage    91.52%   91.49%   -0.03%     
===========================================
  Files           30       34       +4     
  Lines          861      858       -3     
===========================================
- Hits           788      785       -3     
  Misses          73       73
Impacted Files Coverage Δ
src/include/cpp-crypto/transactions/transaction.h 66.66% <ø> (ø) ⬆️
src/helpers/crypto.cpp 100% <100%> (ø) ⬆️
src/transactions/transaction.cpp 88.82% <100%> (-0.12%) ⬇️
src/crypto/curve.cpp 100% <100%> (ø)
src/identities/privatekey.cpp 100% <100%> (ø) ⬆️
src/identities/keys.cpp 100% <100%> (ø)
src/utils/base58.cpp 100% <100%> (ø)
src/identities/wif.cpp 100% <100%> (ø) ⬆️
src/transactions/builder.cpp 76.78% <100%> (+0.42%) ⬆️
src/transactions/deserializer.cpp 88.38% <100%> (+0.38%) ⬆️
... and 14 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 5e361e3...025323b. Read the comment docs.

@sleepdefic1t

This comment has been minimized.

Copy link
Contributor Author

commented Jul 31, 2019

Codacy not config'd to watch develop.

You can view the current PR at codacy.com/project/sleepdefic1t/cpp-crypto.

The majority of the issues are documentation-style related.
Those and others will be resolved in a subsequent PR.

@sleepdefic1t sleepdefic1t changed the title [WIP]refactor(identities): improve implementation refactor(identities): improve implementation Jul 31, 2019

@sleepdefic1t sleepdefic1t marked this pull request as ready for review Jul 31, 2019

sleepdefic1t added some commits Aug 1, 2019

misc cleanup.
trailing return, comments, naming, etc
Update address.cpp
remove redundant strlen check.

sleepdefic1t added some commits Aug 6, 2019

Update hex.cpp
testname helpers -> utils
@sleepdefic1t

This comment has been minimized.

Copy link
Contributor Author

commented Aug 7, 2019

this is ready, @faustbrian

@sleepdefic1t

This comment has been minimized.

Copy link
Contributor Author

commented Aug 7, 2019

@faustbrian, good to go 👍

@faustbrian faustbrian merged commit de42ef9 into ArkEcosystem:develop Aug 8, 2019

7 checks passed

Codacy/PR Quality Review Up to standards. A positive pull request.
Details
ci/circleci: build-arduino-default Your tests passed on CircleCI!
Details
ci/circleci: build-linux-clang-5 Your tests passed on CircleCI!
Details
ci/circleci: build-linux-default Your tests passed on CircleCI!
Details
ci/circleci: build-linux-gcc7 Your tests passed on CircleCI!
Details
ci/circleci: build-macos-9-2 Your tests passed on CircleCI!
Details
ci/circleci: build-macos-9-3 Your tests passed on CircleCI!
Details

@sleepdefic1t sleepdefic1t deleted the sleepdefic1t:refactor(identities)/improve-implementation branch Aug 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.