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: add support for maximum output values #708

Open
wants to merge 1 commit into
base: feat/bigint-functions
Choose a base branch
from

Conversation

glevco
Copy link
Contributor

@glevco glevco commented Jul 23, 2024

Depends on #728

Motivation

See https://github.com/HathorNetwork/internal-issues/issues/363.

This is the last PR in the bigint refactor, and it changes the OutputValueType to bigint. It leverages the structures implemented in previous PRs to support this change.

Acceptance Criteria

  • Change OutputValueType from number to bigint.
  • Change number literals to bigint literals (123 -> 123n). This is the bulk of this PR as tests have a lot of literals.
  • Add explicit conversions to/from BigInt/Number where necessary.
  • Some other related changes such as using - instead of Math.abs as the Math module does not support bigint.

Security Checklist

  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@glevco glevco requested a review from r4mmer July 23, 2024 15:41
@glevco glevco self-assigned this Jul 23, 2024
@glevco glevco force-pushed the feat/max-output-value branch 4 times, most recently from 1cd72aa to 783d11b Compare July 23, 2024 23:10
@glevco glevco changed the base branch from master to refactor/ts-tests July 23, 2024 23:10
@glevco glevco force-pushed the feat/max-output-value branch 3 times, most recently from 0a73d53 to 086a85f Compare July 24, 2024 15:57
Copy link

codecov bot commented Jul 24, 2024

Codecov Report

Attention: Patch coverage is 46.49123% with 61 lines in your changes missing coverage. Please review.

Please upload report for BASE (feat/bigint-functions@8ddab19). Learn more about missing BASE report.

Files Patch % Lines
src/utils/storage.ts 42.85% 12 Missing ⚠️
src/utils/transaction.ts 40.00% 12 Missing ⚠️
src/wallet/wallet.ts 0.00% 11 Missing ⚠️
src/wallet/partialTxProposal.ts 22.22% 7 Missing ⚠️
src/models/partial_tx.ts 42.85% 4 Missing ⚠️
src/storage/leveldb/utxo_index.ts 42.85% 4 Missing ⚠️
src/storage/storage.ts 0.00% 4 Missing ⚠️
src/utils/buffer.ts 60.00% 2 Missing ⚠️
src/models/output.ts 66.66% 1 Missing ⚠️
src/new/wallet.js 75.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@                   Coverage Diff                    @@
##             feat/bigint-functions     #708   +/-   ##
========================================================
  Coverage                         ?   54.29%           
========================================================
  Files                            ?       82           
  Lines                            ?     6209           
  Branches                         ?     1343           
========================================================
  Hits                             ?     3371           
  Misses                           ?     2830           
  Partials                         ?        8           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@glevco glevco force-pushed the feat/max-output-value branch 5 times, most recently from 57e0347 to f7e6797 Compare July 26, 2024 02:45
Base automatically changed from refactor/ts-tests to master July 31, 2024 18:18
@glevco glevco changed the base branch from master to refactor/typing-improvements August 1, 2024 14:49
@glevco glevco force-pushed the refactor/typing-improvements branch from efe15e4 to c744d46 Compare August 2, 2024 20:27
@glevco glevco force-pushed the feat/max-output-value branch 2 times, most recently from 3d6628d to 661b941 Compare August 2, 2024 20:43
@glevco glevco force-pushed the refactor/typing-improvements branch from c744d46 to 1b31680 Compare August 2, 2024 20:45
@glevco glevco changed the base branch from refactor/typing-improvements to feat/bigint-functions August 2, 2024 20:46
@glevco glevco force-pushed the feat/max-output-value branch 4 times, most recently from 11e2178 to a6dda14 Compare August 2, 2024 21:28
@@ -5,7 +5,7 @@ on:
- release
- release-candidate
- master
- refactor/typing-improvements # TODO: REMOVE THIS
- feat/bigint-functions # TODO: REMOVE THIS
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove this

@@ -12,7 +12,7 @@ on:
- release
- release-candidate
- master
- refactor/typing-improvements # TODO: REMOVE THIS
- feat/bigint-functions # TODO: REMOVE THIS
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove this

@glevco glevco marked this pull request as ready for review August 5, 2024 18:25
This was referenced Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant