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: avoid fundFakeUtxo changing inputs/outputs of the transaction #1528

Closed
wants to merge 3 commits into from

Conversation

LuizAsFight
Copy link
Contributor

No description provided.

Copy link
Contributor

This PR is published in NPM with version 0.0.0-pr-1528-20231215030938

Copy link
Contributor

Coverage report

❌ An unexpected error occurred. For more details, check console

Error: The process '/home/runner/setup-pnpm/node_modules/.bin/pnpm' failed with exit code 1
St.
Category Percentage Covered / Total
🟢 Statements
86.64% (+0.02% 🔼)
6061/6996
🟡 Branches
70.75% (+0.05% 🔼)
941/1330
🟡 Functions
77.39% (+0.04% 🔼)
996/1287
🟢 Lines
86.61% (+0.01% 🔼)
5806/6704

Test suite run failed

Failed tests: 2/1492. Failed suites: 1/259.
  ● TransactionRequest › fundWithFakeUtxos › should add BaseAssetId with amount bn(1) if not present in quantities

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

    Expected: "0x1"
    Received: undefined

      139 |       const baseAssetEntry = quantities.find((q) => q.assetId === BaseAssetId);
      140 |       expect(baseAssetEntry).not.toBeNull();
    > 141 |       expect(baseAssetEntry?.amount).toEqual(bn(1));
          |                                      ^
      142 |     });
      143 |
      144 |     it('should not add BaseAssetId if it is already present in quantities', () => {

      at Object.<anonymous> (packages/providers/src/transaction-request/transaction-request.test.ts:141:38)

  ● TransactionRequest › fundWithFakeUtxos › should filter inputs and outputs accordingly

    expect(received).not.toBe(expected) // Object.is equality

    Expected: not {"amount": "0x64", "assetId": "0x0101010101010101010101010101010101010101010101010101010101010101", "id": "0x0000000000000000000000000000000000000000000000000000000000000000", "maturity": 0, "owner": "0xcbf175787fc0ae608feec587471fca9d3bc7d00b9be1a60773e4c78ea9c3ac35", "txPointer": "0x00000000000000000000000000000000", "type": 0, "witnessIndex": 0}

      175 |
      176 |       // Coin and Message inputs should be filtered out
    > 177 |       expect(coinInput).not.toBe(MOCK_REQUEST_COIN_INPUT);
          |                             ^
      178 |       expect(messageInput).not.toBe(MOCK_REQUEST_MESSAGE_INPUT);
      179 |
      180 |       const coinOutput = transactionRequest.outputs.find((o) => o.type === OutputType.Coin);

      at Object.<anonymous> (packages/providers/src/transaction-request/transaction-request.test.ts:177:29)

Report generated by 🧪jest coverage report action from 24fa21e

@Torres-ssf
Copy link
Contributor

Closing this in favor of: #1531

@Torres-ssf Torres-ssf closed this Dec 15, 2023
@arboleya arboleya deleted the fix/fundFakeUtxo branch February 26, 2024 15:20
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.

2 participants