lambdaclass / lambdaclass/eth-agent

RPC batch partial failure scenarios not tested

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

medium-priority testing
Dominant language
TypeScript
Stars
10
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Problem

Related to #8 - there are no tests verifying behavior when some requests in a batch succeed while others fail.

Current State

Tests likely only cover:

  • All requests succeed
  • All requests fail

Missing coverage for:

  • Mixed success/failure in same batch
  • Different error types in same batch
  • Recovery from partial failures

Recommendation

Add tests for partial failure scenarios:

describe('batch requests', () => {
  it('should handle mixed success/failure responses', async () => {
    mockRpc.mockResponses([
      { result: '0x1' },
      { error: { code: -32000, message: 'execution reverted' } },
      { result: '0x3' },
    ]);
    
    const results = await rpc.batchCall([...]);
    
    expect(results[0]).toEqual({ success: true, value: '0x1' });
    expect(results[1]).toEqual({ success: false, error: expect.any(Error) });
    expect(results[2]).toEqual({ success: true, value: '0x3' });
  });
});

Priority

Medium - Important for reliability

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Find the existing RPC batch request tests and the rpc.batchCall entry point first. Run the current test suite to confirm coverage for all-success and all-failure batches, then add cases for mixed outcomes, different error types, and recovery from partial failures. Done means the assertions verify successful and failed results remain correctly associated with their requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.