Conversation
…aw for consistency
…est for untracked errors
…resholdForClassicOperation
…nit test for untracked errors
…in string helper functions
…uthEntry functions for SorobanAuthorizationEntry handling
- Added Transaction class to handle transaction metadata and operations parsing. - Implemented factory methods for creating Transaction instances from metadata. - Introduced memoization for performance optimization on frequently accessed properties. - Added comprehensive unit tests for Transaction class covering various scenarios and envelope types. - Created types for Ledger, Transaction, and Operation for better type safety and clarity. - Updated module exports to include new ledger-parser functionalities.
- Implemented LedgerStreamer class to support live and historical ingestion of Stellar ledgers. - Added methods for starting live, archive, and automatic streaming modes. - Introduced configuration options for batch size, wait intervals, and error handling. - Created type definitions for handlers and options related to ledger streaming.
…RLs and add health check for MainNet PRO
feat: add Event Streamer variant with type definitions - Introduced `EventStreamerOptions` and `EventStreamerConfig` interfaces for event streaming configuration. - Created a new file `types.ts` under `rpc-streamer/src/variants/event/`. feat: implement Ledger Streamer variant with integration and unit tests - Added `createLedgerStreamer` function to handle live and archive ingestion of ledgers. - Implemented integration tests for the Ledger Streamer in `index.integration.test.ts`. - Created unit tests for the Ledger Streamer ingestors in `index.unit.test.ts`. - Defined `LedgerStreamerOptions` and `LedgerStreamerConfig` interfaces for ledger streaming configuration. - Added necessary mock helpers and test cases to ensure proper functionality and error handling.
…n in integration tests
…vent filter and transaction classes
…57) The Contract constructor creates a fallback RPC server when no `rpc` is passed, but ignores `networkConfig.allowHttp`. This causes all HTTP RPC URLs (e.g. local development) to fail with "Cannot connect to insecure Soroban RPC server".
… @colibri/rpc-streamer
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #58 +/- ##
==========================================
+ Coverage 99.42% 99.50% +0.08%
==========================================
Files 162 174 +12
Lines 9350 10580 +1230
Branches 1028 1239 +211
==========================================
+ Hits 9296 10528 +1232
+ Misses 54 44 -10
- Partials 0 8 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Release bump across the workspace packages with small consistency/type-safety refactors (notably adopting isDefined) plus dependency/version updates, and a test adjustment around Soroban resource fees.
Changes:
- Bump package versions (
@colibri/core→ 0.16.1 and dependent workspace packages) and update rootstellar-sdkversion. - Replace direct
=== undefinedchecks withisDefinedin several modules and apply formatting/trailing-comma consistency. - Update
ContractRPC construction to pass throughallowHttp, and adjust an AssembleTransaction fee test expectation.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sep10/src/client/jwt.ts | Use isDefined for JWT claim presence checks; minor formatting. |
| sep10/deno.json | Bump package version and @colibri/core dependency. |
| rpc-streamer/src/streamer.ts | Use isDefined for stop-ledger waiting condition. |
| rpc-streamer/deno.json | Bump package version and @colibri/core dependency. |
| plugins/fee-bump/deno.json | Bump package version and core dependency version. |
| deno.json | Update stellar-sdk dependency version. |
| core/processes/assemble-transaction/index.unit.test.ts | Update fee expectation and formatting in tests. |
| core/ledger-parser/transaction/index.ts | Use isDefined, tighten casting, and formatting/doc adjustments. |
| core/ledger-parser/ledger/index.ts | Formatting/doc tweaks and trailing commas. |
| core/event/parsing/ledger-close-meta.ts | Use isDefined in filter checks and formatting. |
| core/event/event-filter/index.ts | Use isDefined to simplify topics serialization. |
| core/deno.json | Bump core package version to 0.16.1. |
| core/contract/index.ts | Pass allowHttp into stellar-sdk/rpc Server construction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| it("executes with resourceFee and add it to the total fee", async () => { | ||
| const inclusionFee = "10"; | ||
| const transaction = createTestTransaction(inclusionFee); | ||
| const sorobanData = new SorobanDataBuilder(); | ||
| sorobanData.setResourceFee(1); | ||
| sorobanData.setResourceFee(3); | ||
|
|
||
| const input: AssembleTransactionInput = { | ||
| transaction, | ||
| sorobanData, | ||
| authEntries: [], | ||
| resourceFee: 5, | ||
| }; | ||
|
|
||
| const result = await P_AssembleTransaction().run(input); | ||
| assertInstanceOf(result, Transaction); | ||
| assertEquals(result.fee, "15"); | ||
| assertEquals(result.fee, "18"); // 10 inclusion fee + 3 resource fee from soroban data + 5 resource fee from input | ||
| }); |
There was a problem hiding this comment.
The expected fee in this test doesn’t match the current AssembleTransaction implementation. assemble-transaction/index.ts computes updatedFee = parseInt(transaction.fee) + resourceFee and does not add sorobanData’s internal resourceFee, so this assertion will fail when sorobanData.setResourceFee(3) and resourceFee: 5 are provided. Either update the test to expect only inclusionFee + resourceFee (and ideally keep the SorobanDataBuilder’s resourceFee consistent with resourceFee), or update the assemble logic/types so that both the Soroban data resource fee and the explicit resourceFee are intentionally summed.
There was a problem hiding this comment.
It seems this have changed in the way the transaction builder accounts for the sorobanData object in addition to the main fee property
This pull request introduces minor improvements and bug fixes across multiple core modules, focusing on code consistency, improved type safety, and test accuracy.
Fix
Code Consistency and Type Safety:
isDefinedutility inEventFilter,Transaction, and event parsing logic, leading to safer and more readable code. [1] [2] [3]unknown as xdr.AccountIdfor improved type safety.Test Improvements:
AssembleTransactionunit test to ensure the total transaction fee is accurately computed, reflecting both resource fees from Soroban data and input. [1] [2]General Maintenance:
core/deno.jsonfrom0.16.0to0.16.1.These changes collectively improve code reliability, readability, and test accuracy across the core modules.