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(core-manager): dispatch wallet events #3776

Merged
merged 8 commits into from
Jun 8, 2020

Conversation

sebastijankuzner
Copy link
Contributor

Summary

This PR introduces new WatcherWallet, which is inherited Wallet with ability to dispatch events on every attribute or property change. When using core-manager original wallet factory is replaced with custom factory which return wallet proxies.

Checklist

  • Tests
  • Ready to be merged

@sebastijankuzner sebastijankuzner changed the title feat(core-manager): implement wallet events feat(core-manager): dispatch wallet events Jun 5, 2020
new Services.Attributes.AttributeMap(
context.container.get<Services.Attributes.AttributeSet>(Container.Identifiers.WalletAttributes),
if (!app.isBound(Container.Identifiers.WalletFactory)) {
app.bind(Container.Identifiers.WalletFactory).toFactory<Contracts.State.Wallet>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably use rebind to avoid any issues because core-manager will usually be loaded after the WalletFactory has already been bound.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about it, but the problem is, because core-manager needs to be loaded right after core-logger-pino, otherwise the half of the logs (from classes created in register mehtod) are missing. We need to replace log service with LogServiceWrapper before other classes are created.

@codecov
Copy link

codecov bot commented Jun 8, 2020

Codecov Report

Merging #3776 into develop will decrease coverage by 1.60%.
The diff coverage is 90.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3776      +/-   ##
===========================================
- Coverage    89.40%   87.80%   -1.61%     
===========================================
  Files          615      617       +2     
  Lines        13558    13591      +33     
  Branches      1527     1533       +6     
===========================================
- Hits         12121    11933     -188     
- Misses         313      525     +212     
- Partials      1124     1133       +9     
Impacted Files Coverage Δ
packages/core-manager/src/service-provider.ts 92.00% <71.42%> (+0.69%) ⬆️
packages/core-manager/src/events.ts 75.00% <75.00%> (ø)
packages/core-manager/src/watcher-wallet.ts 95.83% <95.83%> (ø)
.../core-state/src/wallets/indexers/wallet-indexes.ts 100.00% <100.00%> (ø)
packages/core-state/src/wallets/wallet.ts 100.00% <100.00%> (ø)
...ages/core-test-framework/src/internal/delegates.ts 0.00% <0.00%> (-100.00%) ⬇️
...test-framework/src/matchers/functional/accepted.ts 6.89% <0.00%> (-89.66%) ⬇️
packages/core-test-framework/src/cli/console.ts 9.52% <0.00%> (-85.72%) ⬇️
...test-framework/src/matchers/blockchain/dispatch.ts 14.28% <0.00%> (-85.72%) ⬇️
...ackages/core-test-framework/src/internal/signer.ts 19.04% <0.00%> (-80.96%) ⬇️
... and 75 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 7c348e1...2b33da0. Read the comment docs.

@faustbrian faustbrian merged commit 7cb916a into develop Jun 8, 2020
@ghost ghost deleted the feat/core-manager/wallet-emitter branch June 8, 2020 09:11
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.

2 participants