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

test: primitives #227

Merged
merged 9 commits into from
Aug 15, 2024
Merged

test: primitives #227

merged 9 commits into from
Aug 15, 2024

Conversation

jbcaron
Copy link
Member

@jbcaron jbcaron commented Aug 9, 2024

The pull request focuses on adding and refining unit tests across primitives and client/sync modules.

Pull Request type

  • Testing

What is the current behavior?

What is the new behavior?

  • the sync process from FGW now directly transforms state updates into our primitive types instead of passing through starknet-cors’s intermediate types
  • removing the ToStateUpdateCore trait by directly implementing the From trait instead
  • adding unit tests across all crates of primitives:
    • block header
    • block inner
    • class
    • receipt
    • state update
    • transaction
  • The conversion between starknet-api transaction and our own transaction type has been updated. Previously, we used a reference . However, the new implementation now takes ownership of the Transaction instead of borrowing it. This change was made because the starknet-api now uses Felt as the primitive type for transactions. By taking ownership, it avoids unnecessary copies of Felt and reduces the need for iterations over vectors during the conversion process.

Does this introduce a breaking change?

No

Other information

our unit tests are currently being conducted on inconsistent data, I’ve opened #230 to address the issue

@jbcaron jbcaron marked this pull request as ready for review August 12, 2024 19:24
CHANGELOG.md Outdated Show resolved Hide resolved
crates/primitives/class/src/compile.rs Show resolved Hide resolved
crates/primitives/convert/src/felt.rs Outdated Show resolved Hide resolved
crates/primitives/convert/src/to_felt.rs Outdated Show resolved Hide resolved
crates/primitives/receipt/src/lib.rs Outdated Show resolved Hide resolved
crates/primitives/transactions/src/into_starknet_api.rs Outdated Show resolved Hide resolved
@jbcaron jbcaron requested a review from EvolveArt August 13, 2024 18:01
@jbcaron jbcaron self-assigned this Aug 14, 2024
@jbcaron jbcaron added the tests The label for testings label Aug 14, 2024
@jbcaron jbcaron merged commit aa1b888 into madara-alliance:main Aug 15, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests The label for testings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants