Repository navigation
test(sdk): remove placeholder specs and unused fixtures - #1214
Conversation
|
@dynamicgram11-cmyk is attempting to deploy a commit to the Collins' projects Team on Vercel. A member of the Team first needs to authorize it. |
collinsezedike
left a comment
There was a problem hiding this comment.
@dynamicgram11-cmyk the intent matches #1055, but the rewrite does not compile or pass. blend-adapter.test.ts renames VAULT_STATE to VAUL_STATE on two lines, so the reference is undefined. tx-submission.test.ts imports keeperFeeConfig and maxFeeAttempt, neither of which packages/stellar-sdk-helpers/src/keeper-tx.ts exports; that module exports KEEPER_BASE_FEE_STROOPS, KEEPER_MAX_FEE_STROOPS, and DEFAULT_FEE_ESCALATION. Its keeperFeeForAttempt also takes (attempt, baseFee, config?), so the one-argument calls pass no base fee. The commit subject exceeds 72 characters and includes the issue number, which fails the required Commit Messages check. Fix the typo, use the real exports and signature, and amend the subject.
| it("parses the recorded vault state fixture", () => { | ||
| expect(VAULT_STATE.id).toBe("vault-0"); | ||
| expect(VAULT_STATE.totalAssets).toBe(10000000); | ||
| expect(VAUL_STATE.id).toBe("vault-0"); |
There was a problem hiding this comment.
VAUL_STATE is undefined here and on the next line; restore VAULT_STATE.
| import { describe, it, expect } from "vitest"; | ||
| import { | ||
| keeperFeeForAttempt, | ||
| keeperFeeConfig, |
There was a problem hiding this comment.
keeperFeeConfig is not exported by keeper-tx.ts. That module exports DEFAULT_FEE_ESCALATION (with maxFee and multiplier) and KEEPER_BASE_FEE_STROOPS.
| import { | ||
| keeperFeeForAttempt, | ||
| keeperFeeConfig, | ||
| maxFeeAttempt, |
There was a problem hiding this comment.
maxFeeAttempt is not exported by keeper-tx.ts. Derive it in the test from DEFAULT_FEE_ESCALATION, or export it from the module.
| const { baseFee, multiplier, maxFee } = keeperFeeConfig; | ||
|
|
||
| it("returns the base fee at attempt 0", () => { | ||
| expect(keeperFeeForAttempt(0)).toBe(baseFee); |
There was a problem hiding this comment.
keeperFeeForAttempt is (attempt, baseFee, config?). This call passes no baseFee, so it evaluates against undefined; pass KEEPER_BASE_FEE_STROOPS (or the configured base fee) as the second argument every time it is called.
8347792 to
d9ca1c9
Compare
|
@dynamicgram11-cmyk Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
collinsezedike
left a comment
There was a problem hiding this comment.
@dynamicgram11-cmyk The obfuscated payload has been removed. The test rewrite still does not compile. blend-adapter.test.ts uses VAUL_STATE on lines 14 and 15. tx-submission.test.ts imports keeperFeeConfig and maxFeeAttempt, which keeper-tx.ts does not export, and calls keeperFeeForAttempt without its baseFee argument.
a6b00d0 to
944a87b
Compare
944a87b to
53fcc0b
Compare
collinsezedike
left a comment
There was a problem hiding this comment.
@dynamicgram11-cmyk thank you for your contribution. If you would like to pick up another open issue, the issue list has more work available.
|
@dynamicgram11-cmyk if Meridian is useful to you, would you consider starring the repository? |
Summary
The placeholder specs in
packages/sdkdid not exercise production code. The behaviors they named are covered where the real modules live inpackages/stellar-sdk-helpers, so this removes the fake suites and the fixtures only they used.Changes
packages/sdk/src/blend-adapter.test.ts,tx-submission.test.ts, andkeeper-retry.test.ts.packages/sdk/src/fixturesdirectory.branch_structure.json.Verification
pnpm --filter @meridian/sdk test: 61 passed, coverage 97.75% statements / 95.74% branches / 96.66% functions / 98.73% linespnpm --filter @meridian/sdk typecheckpnpm --filter @meridian/sdk lintCoverage for the real modules remains in
packages/stellar-sdk-helpers/src/blend.test.ts,keeper-tx.test.ts,keeper-retry.test.ts, andkeeper-state.test.ts. The removed files contained no production assertions, so no behavior that was previously tested becomes untested.Closes #1055