Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Nikos/5071/investigate signtransaction testcases - #5377

Merged
nikoulai merged 6 commits into
1.xfrom
nikos/5071/investigate-signtransaction-testcases
Sep 6, 2022
Merged

Nikos/5071/investigate signtransaction testcases#5377
nikoulai merged 6 commits into
1.xfrom
nikos/5071/investigate-signtransaction-testcases

Conversation

@nikoulai

@nikoulai nikoulai commented Aug 24, 2022

Copy link
Copy Markdown
Contributor

Description

#5071 part 1: r and v values in testcases don't align with signTransaction results.

In two testcases r and v were wrong (they were even the same between the tests). signTransaction returns the right values (cross checked with external libraries, too)

Discussion:
r and s are bigints in ethereumjs and we cast them to strings. This leads to some values with smaller values to be of smaller length when casted to string (missing leading 0s). I think, we should prepend them, but, this could be a breaking change for some users and better leave them as they are.

@render

render Bot commented Aug 24, 2022

Copy link
Copy Markdown

@coveralls

coveralls commented Aug 24, 2022

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 2971408301

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 437 unchanged lines in 7 files lost coverage.
  • Overall coverage decreased (-2.3%) to 72.235%

Files with Coverage Reduction New Missed Lines %
packages/web3-core-requestmanager/src/jsonrpc.js 2 82.76%
packages/web3-core-helpers/src/formatters.js 25 80.95%
packages/web3-core-helpers/src/errors.js 31 4.41%
packages/web3-utils/src/soliditySha3.js 55 5.13%
packages/web3-utils/src/index.js 62 29.31%
packages/web3-utils/src/utils.js 96 13.31%
packages/web3-eth-accounts/src/index.js 166 23.62%
Totals Coverage Status
Change from base Build 2965177708: -2.3%
Covered Lines: 3405
Relevant Lines: 4437

💛 - Coveralls

@nikoulai
nikoulai force-pushed the nikos/5071/investigate-signtransaction-testcases branch from 09f5e2f to d80552f Compare August 25, 2022 09:31
@luu-alex

Copy link
Copy Markdown
Contributor

bigints casted into strings should be fine though no? I think the issue is that some part where the bigint will be turned into a number, thats when we get smaller values. If thats the issue it wont be breaking

Comment thread test/eth.accounts.signTransaction.js
@jdevcs jdevcs added the 1.x 1.0 related issues label Sep 1, 2022
@nikoulai
nikoulai requested a review from jdevcs September 5, 2022 14:03
@jdevcs jdevcs added the Future Release For future release. label Sep 6, 2022
This was referenced Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

1.x 1.0 related issues Future Release For future release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants