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

update starknet dictionary logic #13

Merged
merged 1 commit into from
Jan 19, 2025
Merged

update starknet dictionary logic #13

merged 1 commit into from
Jan 19, 2025

Conversation

jiqiang90
Copy link
Collaborator

Description

  • Add common for phrase tx with different types,so we can follow this logic for other filter etc
  • Update logic in dictionary v1
  • Update test for dictionary v1

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have tested locally
  • I have performed a self review of my changes
  • Updated any relevant documentation
  • Linked to any relevant issues
  • I have added tests relevant to my changes
  • Any dependent changes have been merged and published in downstream modules
  • My code is up to date with the base branch
  • I have updated relevant changelogs. We suggest using chan

@jiqiang90 jiqiang90 merged commit 14410c6 into main Jan 19, 2025
2 of 3 checks passed
Copy link

Coverage report

Caution

Test run failed

St.
Category Percentage Covered / Total
🔴 Statements 46.75% 2161/4622
🟡 Branches 66.17% 223/337
🔴 Functions 52% 104/200
🔴 Lines 46.75% 2161/4622

Test suite run failed

Failed tests: 2/42. Failed suites: 2/10.
  ● buildDictionaryV1QueryEntries › Transaction filters › Build a filter for contract type

    expect(received).toEqual(expected) // deep equality

    - Expected  - 2
    + Received  + 0

      Array [
    -   Array [
        Object {
          "conditions": Array [
            Object {
              "field": "type",
              "matcher": "equalTo",
              "value": "L1_HANDLER",
            },
          ],
          "entity": "calls",
        },
    -   ],
      ]

      136 |       const result = buildDictionaryV1QueryEntries([ds]);
      137 |
    > 138 |       expect(result).toEqual([
          |                      ^
      139 |         [
      140 |           {
      141 |             conditions: [

      at Object.<anonymous> (packages/node/src/indexer/dictionary/v1/starknetDictionaryV1.spec.ts:138:22)


  ● Codegen spec › validate Abi.json path field

    expect(received).rejects.toThrow(expected)

    Expected pattern: /Asset: "zkLend" not found in project/
    Received message: "Error: Asset zkLend, file ./abis/xxx.json does not exist"

          127 |     const filePath = path.join(projectPath, value.file);
          128 |     if (!fs.existsSync(filePath)) {
        > 129 |       throw new Error(`Error: Asset ${name}, file ${value.file} does not exist`);
              |             ^
          130 |     }
          131 |     // We use actual abi file name instead on name provided in assets
          132 |     // This is aligning with files in './ethers-contracts'

      at addAsset (packages/common-starknet/src/codegen/codegen-controller.ts:129:13)
      at prepareSortedAssets (packages/common-starknet/src/codegen/codegen-controller.ts:141:7)
      at generateAbis (packages/common-starknet/src/codegen/codegen-controller.ts:234:24)
      at Object.<anonymous> (packages/common-starknet/src/codegen/codegen-controller.spec.ts:40:19)
      at Object.toThrow (node_modules/expect/build/index.js:210:22)
      at Object.<anonymous> (packages/common-starknet/src/codegen/codegen-controller.spec.ts:41:15)

Report generated by 🧪jest coverage report action from 18ccc8f

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.

1 participant