Skip to content

fix(crypto): handle mainnet address exceptions#3055

Merged
faustbrian merged 9 commits intodevelopfrom
fix/crypto/mainnet-address-exceptions
Oct 13, 2019
Merged

fix(crypto): handle mainnet address exceptions#3055
faustbrian merged 9 commits intodevelopfrom
fix/crypto/mainnet-address-exceptions

Conversation

@spkjp
Copy link
Copy Markdown
Contributor

@spkjp spkjp commented Oct 11, 2019

Summary

A handful of mainnet transactions have an invalid recipient. Due to a
refactor of the address network byte validation (#3000) it is no longer
trivially possible to handle them. Now, if an invalid address is encountered
during transfer serialization, the error is bubbled up to defer the
AddressNetworkByteError until the actual id is available to call
isException.

Also due to stricter checks the negative balance exceptions failed. Add
extra safeguard to handle them properly.

Checklist

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

A handful of mainnet transactions have an invalid recipient. Due to a
refactor of the Address network byte validation it is no longer
trivially possible to handle them. If an invalid address is encountered
during transfer serialization, the error is bubbled up to defer the
`AddressNetworkByteError` until the actual id is available to call
`isException`.
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 11, 2019

Codecov Report

Merging #3055 into develop will decrease coverage by 0.03%.
The diff coverage is 58.33%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3055      +/-   ##
===========================================
- Coverage    65.65%   65.62%   -0.04%     
===========================================
  Files          425      425              
  Lines        11715    11733      +18     
  Branches      1593     1601       +8     
===========================================
+ Hits          7692     7700       +8     
- Misses        3987     3997      +10     
  Partials        36       36
Impacted Files Coverage Δ
...ages/core-transactions/src/handlers/transaction.ts 68.23% <0%> (-3.37%) ⬇️
packages/crypto/src/errors.ts 79.24% <0%> (ø) ⬆️
packages/crypto/src/transactions/types/transfer.ts 100% <100%> (ø) ⬆️
packages/crypto/src/identities/address.ts 100% <100%> (+3.44%) ⬆️
...ackages/crypto/src/transactions/types/htlc-lock.ts 100% <100%> (ø) ⬆️
packages/crypto/src/transactions/serializer.ts 88.8% <100%> (ø) ⬆️
...ckages/core-database-postgres/src/state-builder.ts 85.41% <44.44%> (-5.7%) ⬇️
.../core-database-postgres/src/postgres-connection.ts 71.07% <57.14%> (-1.34%) ⬇️
packages/crypto/src/transactions/utils.ts 93.75% <75%> (-6.25%) ⬇️

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 2226abe...3bf6a7a. Read the comment docs.

@faustbrian faustbrian merged commit ed46b61 into develop Oct 13, 2019
@faustbrian faustbrian deleted the fix/crypto/mainnet-address-exceptions branch October 13, 2019 03:58
vasild added a commit that referenced this pull request Oct 14, 2019
…o-from-string

* ArkEcosystem/core/develop:
  fix(crypto): handle mainnet address exceptions (#3055)
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