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

fix: prevent wallet managers from indexing/creating ghost wallets #2405

Merged

Conversation

Projects
None yet
4 participants
@Nigui
Copy link

Nigui commented Apr 11, 2019

Proposed changes

Calling wallet manager methods like findByAddress with undefined as value can lead to unexpected behaviours.
For example in WalletManager.applyTransaction, even there is no recipient, this line creates a new wallet object without address or public key (a.k.a a ghost) and index it.
Recipient constant is not null anymore, so wired behaviour can occur (like balance update).
There is no side-effects for now in core project, but it could have some with new transaction types.
Moreover, in api/v2/wallets you got a new wallet with wired properties.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improve a current implementation without adding a new feature or fixing a bug)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build (changes that affect the build system)
  • Docs (documentation only changes)
  • Test (adding missing tests or fixing existing tests)
  • Other... Please describe:

Checklist

  • I have read the CONTRIBUTING documentation
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@Nigui Nigui requested review from faustbrian, kristjank and supaiku0 as code owners Apr 11, 2019

@ArkEcosystemBot

This comment has been minimized.

Copy link
Member

ArkEcosystemBot commented Apr 11, 2019

Thanks for submitting this pull request! A maintainer will review this in the next few days and explicitly select labels so you know what's going on.

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

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Apr 11, 2019

Codecov Report

Merging #2405 into develop will decrease coverage by 0.01%.
The diff coverage is 33.33%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2405      +/-   ##
===========================================
- Coverage    66.18%   66.17%   -0.02%     
===========================================
  Files          400      400              
  Lines         8599     8605       +6     
  Branches       385      432      +47     
===========================================
+ Hits          5691     5694       +3     
- Misses        2864     2866       +2     
- Partials        44       45       +1
Impacted Files Coverage Δ
...s/core-transaction-pool/src/pool-wallet-manager.ts 96.55% <100%> (+0.12%) ⬆️
packages/core-database/src/wallet-manager.ts 74.67% <25%> (-1.17%) ⬇️
packages/core-logger-winston/src/formatter.ts 42.85% <0%> (ø) ⬆️

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 ff1f252...22c1802. Read the comment docs.

@ArkEcosystemBot

This comment has been minimized.

Copy link
Member

ArkEcosystemBot commented Apr 12, 2019

A collaborator has approved this PR. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait.

Thank you for your contribution!

@faustbrian faustbrian merged commit d84d80b into ArkEcosystem:develop Apr 12, 2019

10 checks passed

ci/circleci: test-node10-functional Your tests passed on CircleCI!
Details
ci/circleci: test-node10-integration-0 Your tests passed on CircleCI!
Details
ci/circleci: test-node10-integration-1 Your tests passed on CircleCI!
Details
ci/circleci: test-node10-integration-2 Your tests passed on CircleCI!
Details
ci/circleci: test-node10-unit Your tests passed on CircleCI!
Details
ci/circleci: test-node11-functional Your tests passed on CircleCI!
Details
ci/circleci: test-node11-integration-0 Your tests passed on CircleCI!
Details
ci/circleci: test-node11-integration-1 Your tests passed on CircleCI!
Details
ci/circleci: test-node11-integration-2 Your tests passed on CircleCI!
Details
ci/circleci: test-node11-unit Your tests passed on CircleCI!
Details
@ArkEcosystemBot

This comment has been minimized.

Copy link
Member

ArkEcosystemBot commented Apr 12, 2019

Your pull request has been merged and marked as tier 3. It will earn you $25 USD.

@Nigui Nigui deleted the universal-name-system:fix/wallet-manager-ghost branch Apr 17, 2019

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