Repository navigation
Add transaction state detection and network health check services - #15
Merged
Merged
Conversation
- Add TransactionState enum (Broadcasted, Pending, ConfirmedSuccess, ConfirmedReverted, Replaced, StalePending) - Add TransactionStateInfo DTO with state and metadata - Add ITransactionStatusService interface with GetTransactionStateAsync - Add TransactionStatusService using receipt polling and mempool/nonce checks - Add NetworkHealthInfo DTO for health check results - Add INetworkHealthService interface with CheckNetworkHealthAsync - Add NetworkHealthService checking block freshness, gas price, chain ID - Register new services in Configuration.cs - Add unit tests for both new services (12 new tests) Co-authored-by: Phelecks <47243363+Phelecks@users.noreply.github.com> Agent-Logs-Url: https://github.com/Tricksfor-Organization/BlockChainTools/sessions/33c42eb9-2ed0-4d7f-a7ce-51a18903f68c
Copilot
AI
changed the title
[WIP] Add transaction state detection and blockchain network status
Add transaction state detection and network health check services
Mar 22, 2026
Co-authored-by: Phelecks <47243363+Phelecks@users.noreply.github.com> Agent-Logs-Url: https://github.com/Tricksfor-Organization/BlockChainTools/sessions/24dee835-ccb3-4b1c-b35e-2092ffefd0c1
… NuGet packages, update READMEs - Change INetworkHealthService parameter from BigInteger? to Chain? - Upgrade Nethereum.* 5.8.0 → 6.0.4 - Upgrade Microsoft.Extensions.DependencyInjection 10.0.1 → 10.0.5 - Upgrade NUnit 4.4.0 → 4.5.1, NUnit3TestAdapter 6.1.0 → 6.2.0 - Upgrade Microsoft.NET.Test.Sdk 18.0.1 → 18.3.0 - Upgrade Testcontainers 4.10.0 → 4.11.0 - Upgrade Aspire.StackExchange.Redis.DistributedCaching 13.1.0 → 13.1.3 - Update both README.md files with new services and correct dependency versions Co-authored-by: Phelecks <47243363+Phelecks@users.noreply.github.com> Agent-Logs-Url: https://github.com/Tricksfor-Organization/BlockChainTools/sessions/24dee835-ccb3-4b1c-b35e-2092ffefd0c1
Contributor
There was a problem hiding this comment.
Pull request overview
Adds two new diagnostic services to BlockChainTools—transaction lifecycle state detection and RPC/network health checking—along with DI registration, DTOs, tests, documentation updates, and dependency upgrades.
Changes:
- Introduces
ITransactionStatusService/TransactionStatusService+TransactionState/TransactionStateInfofor receipt/mempool/nonce-based transaction state detection. - Introduces
INetworkHealthService/NetworkHealthService+NetworkHealthInfofor latest block freshness, gas price, and optional chain ID validation. - Updates DI wiring, READMEs, and central NuGet package versions.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/BlockChainTools/Services/TransactionStatusService.cs |
Implements transaction state detection logic |
src/BlockChainTools/Interfaces/ITransactionStatusService.cs |
Adds public contract for transaction state detection |
src/BlockChainTools/DataTransferObjects/TransactionState.cs |
Defines transaction lifecycle enum |
src/BlockChainTools/DataTransferObjects/TransactionStateInfo.cs |
DTO returned by transaction state detection |
src/BlockChainTools/Services/NetworkHealthService.cs |
Implements network/RPC health checks |
src/BlockChainTools/Interfaces/INetworkHealthService.cs |
Adds public contract for network health checks |
src/BlockChainTools/DataTransferObjects/NetworkHealthInfo.cs |
DTO returned by network health check |
src/BlockChainTools/Configuration.cs |
Registers new services in DI |
tests/BlockChainTools.Tests/TransactionStatusServiceTests.cs |
Adds tests for transaction status service |
tests/BlockChainTools.Tests/NetworkHealthServiceTests.cs |
Adds tests for network health service |
src/BlockChainTools/README.md |
Documents new services in package README |
README.md |
Adds usage docs/examples + dependency version updates |
Directory.Packages.props |
Central package version upgrades |
…kHealthAsync to reduce cognitive complexity - Remove Broadcasted from TransactionState enum (never returned by GetTransactionStateAsync) - Remove Broadcasted test case - Extract EvaluateBlockFreshness helper; inline Chain cast to eliminate ternary - Update README to reflect actual returned states Co-authored-by: Phelecks <47243363+Phelecks@users.noreply.github.com> Agent-Logs-Url: https://github.com/Tricksfor-Organization/BlockChainTools/sessions/1d8b147d-a32f-4525-84c8-d0ff31b40763
The health check only needs block number and timestamp, not full transaction objects. GetBlockWithTransactionsHashesByNumber returns only tx hashes, reducing RPC payload size and latency on high-throughput networks. Co-authored-by: Phelecks <47243363+Phelecks@users.noreply.github.com> Agent-Logs-Url: https://github.com/Tricksfor-Organization/BlockChainTools/sessions/6c6da43a-8e70-4bfa-8cd3-c11c93a6c907
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


TransactionState.Broadcastedfrom enum (done in previous session)CheckNetworkHealthAsynccognitive complexity withEvaluateBlockFreshnesshelper (done in previous session)GetBlockWithTransactionsByNumberwith lighterGetBlockWithTransactionsHashesByNumberinNetworkHealthService(only block number + timestamp needed for health check)📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.