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

fix: unit tests failing in CI #2258

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

konstantinabl
Copy link
Collaborator

@konstantinabl konstantinabl commented Mar 28, 2024

Description:

This PR updates the precheck.spec.ts file to resolve a TypeError occurring in the ethers package when using node version 20. The error arises because the 'from' field in the transaction doesn't match the signer's address.
It also adds return types and JSDoc where missing.

Related issue(s):

Fixes #2223

Notes for reviewer:

Checklist

  • Tested (unit, integration, etc.)

@konstantinabl konstantinabl linked an issue Mar 28, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Mar 28, 2024

Tests

    2 files  148 suites   13s ⏱️
821 tests 820 ✔️ 1 💤 0
833 runs  832 ✔️ 1 💤 0

Results for commit 2d54d8f.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

codecov-commenter commented Mar 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.15%. Comparing base (8c061f1) to head (20b1ac6).

❗ Current head 20b1ac6 differs from pull request most recent head dbe47ce. Consider uploading reports for the commit dbe47ce to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2258   +/-   ##
=======================================
  Coverage   75.15%   75.15%           
=======================================
  Files          13       13           
  Lines         644      644           
  Branches      118      118           
=======================================
  Hits          484      484           
  Misses        115      115           
  Partials       45       45           

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

Copy link

github-actions bot commented Mar 29, 2024

Acceptance Tests

     21 files     336 suites   26m 14s ⏱️
   587 tests    577 ✔️   3 💤   7
1 191 runs  1 167 ✔️ 13 💤 11

Results for commit 2d54d8f.

♻️ This comment has been updated with latest results.

@konstantinabl konstantinabl marked this pull request as ready for review March 29, 2024 13:46
Ivo-Yankov
Ivo-Yankov previously approved these changes Mar 29, 2024
natanasow
natanasow previously approved these changes Mar 29, 2024
Copy link
Collaborator

@natanasow natanasow left a comment

Choose a reason for hiding this comment

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

LGTM 👏

packages/relay/src/lib/precheck.ts Outdated Show resolved Hide resolved
packages/relay/src/lib/precheck.ts Outdated Show resolved Hide resolved
@georgi-l95 georgi-l95 dismissed stale reviews from natanasow and Ivo-Yankov via b4f1c6c April 3, 2024 11:24
@georgi-l95 georgi-l95 force-pushed the 2223-unit-tests-failing-in-ci branch from 0a995bc to d185259 Compare April 3, 2024 11:26
@wiz-inc-8f76296f7c
Copy link

wiz-inc-8f76296f7c bot commented Apr 3, 2024

Wiz Scan Summary

IaC Misconfigurations 0C 0H 0M 0L 0I
Vulnerabilities 1C 3H 7M 0L 0I
Sensitive Data 0C 0H 0M 0L 0I
Total 1C 3H 7M 0L 0I
Secrets 0🔑

AlfredoG87
AlfredoG87 previously approved these changes Apr 3, 2024
Copy link
Collaborator

@AlfredoG87 AlfredoG87 left a comment

Choose a reason for hiding this comment

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

LGTM

AlfredoG87
AlfredoG87 previously approved these changes Apr 3, 2024
natanasow
natanasow previously approved these changes Apr 24, 2024
Copy link
Collaborator

@natanasow natanasow left a comment

Choose a reason for hiding this comment

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

LGTM, 2 nits

packages/relay/src/lib/precheck.ts Outdated Show resolved Hide resolved
packages/relay/src/lib/precheck.ts Outdated Show resolved Hide resolved
packages/relay/src/lib/precheck.ts Show resolved Hide resolved
packages/relay/src/lib/precheck.ts Show resolved Hide resolved
evm_address: mockData.accountEvmAddress,
ethereum_nonce: defaultNonce,
};
let defaultNonce, defaultTx, signed, parsedTx, mirrorAccount, wallet;
Copy link
Contributor

Choose a reason for hiding this comment

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

QQ: Why did we change these from const to let?

Also, please specify the expected type of the variable if we're going to use let.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Some of them are let cause they are used in the tests below

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should I set mirror account to type any?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's better now, thanks! I would only move each field to a separate line and change the defaultNonce to const (it's not changed anywhere I believe?).

victor-yanev
victor-yanev previously approved these changes Apr 25, 2024
victor-yanev
victor-yanev previously approved these changes Apr 26, 2024
georgi-l95
georgi-l95 previously approved these changes Apr 27, 2024
Copy link
Collaborator

@georgi-l95 georgi-l95 left a comment

Choose a reason for hiding this comment

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

LG, small nit

packages/relay/tests/lib/eth/eth-helpers.ts Show resolved Hide resolved
Nana-EC
Nana-EC previously approved these changes May 7, 2024
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

LG.
Might need to rebase

Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Copy link

sonarcloud bot commented May 16, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

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.

Unit tests failing in CI
8 participants