Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [2.1.3] - 2025-01-27

### Fixes

- Fixed `sendBatches()` and `estimateBatches()` return values to correctly return batch results with `chainGroups` and `userOpHash` data.

## [2.1.2] - 2025-01-27

### Added Changes
Expand Down
10 changes: 7 additions & 3 deletions __tests__/EtherspotTransactionKit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ describe('EtherspotTransactionKit', () => {
const result = await transactionKit.estimateBatches();
expect(result.isEstimatedSuccessfully).toBe(true);
expect(result.batches['batch1']).toBeDefined();
expect(result.batches['batch1']).toHaveLength(2);
expect(result.batches['batch1'].transactions).toHaveLength(2);
});

it('should return error for estimating non-existent batch', async () => {
Expand All @@ -974,8 +974,12 @@ describe('EtherspotTransactionKit', () => {
onlyBatchNames: ['doesnotexist'],
});
expect(result.isEstimatedSuccessfully).toBe(false);
// For non-existent batches, the result should be empty
expect(Object.keys(result.batches)).toHaveLength(0);
// For non-existent batches, the result should contain an error entry
expect(result.batches['doesnotexist']).toBeDefined();
expect(result.batches['doesnotexist'].errorMessage).toBeDefined();
expect(result.batches['doesnotexist'].isEstimatedSuccessfully).toBe(
false
);
});

it('should throw if no provider in estimateBatches', async () => {
Expand Down
8 changes: 4 additions & 4 deletions lib/TransactionKit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2343,7 +2343,7 @@ export class EtherspotTransactionKit implements IInitial {
if (batchesToEstimate.length === 0) {
log('estimateBatches(): No batches to estimate', this.debugMode);
this.isEstimating = false;
return { ...result, ...this };
return result;
}

// ========================================================================
Expand Down Expand Up @@ -2756,7 +2756,7 @@ export class EtherspotTransactionKit implements IInitial {
this.containsEstimatingError = !result.isEstimatedSuccessfully;
this.isEstimating = false;

return { ...result, ...this };
return result;
} else {
// ========================================================================
// MODULAR MODE: Use Etherspot SDK for estimation
Expand Down Expand Up @@ -3062,7 +3062,7 @@ export class EtherspotTransactionKit implements IInitial {
this.containsEstimatingError = !result.isEstimatedSuccessfully;
this.isEstimating = false;

return { ...result, ...this };
return result;
}
}

Expand Down Expand Up @@ -4215,7 +4215,7 @@ export class EtherspotTransactionKit implements IInitial {
this.containsSendingError = !result.isSentSuccessfully;
this.isSending = false;

return { ...result, ...this };
return result;
}
}

Expand Down
Loading