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

Avoid casting to determine confirmation state when mapping staking transactions #1872

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Aug 29, 2024

Summary

When determining the confirmation state of native deposit transacitons, we currently cast a transaction that can be either aMultisigTransaction or ModuleTransaction to MultisigTransaction. It is still theoretically possible to deposit via a module, meaning that this cast is not safe.

This avoids casting and instead checks for the existence of the confirmations property in the transaction in question, inherently meaning that it is a MultisigTransaction.

Changes

  • Check for confirmations property instead of casting

@coveralls
Copy link

Pull Request Test Coverage Report for Build 10612544702

Details

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 46.719%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/routes/transactions/mappers/common/transaction-info.mapper.ts 0 1 0.0%
Totals Coverage Status
Change from base Build 10597705364: 0.0%
Covered Lines: 4765
Relevant Lines: 8251

💛 - Coveralls

Copy link
Member

@hectorgomezv hectorgomezv left a comment

Choose a reason for hiding this comment

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

👏🏻👏🏻👏🏻 Thanks!

@hectorgomezv hectorgomezv merged commit 8671b32 into main Aug 29, 2024
18 checks passed
@hectorgomezv hectorgomezv deleted the remove-staking-casting branch August 29, 2024 12:24
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