Skip to content

fix(core-dart): detect C address sourceAccount and emit CONTRACT_SEND…#182

Merged
codeZe-us merged 2 commits intoBoxkit-Labs:mainfrom
Manuelshub:fix/dart-contract-sender-warning
Mar 28, 2026
Merged

fix(core-dart): detect C address sourceAccount and emit CONTRACT_SEND…#182
codeZe-us merged 2 commits intoBoxkit-Labs:mainfrom
Manuelshub:fix/dart-contract-sender-warning

Conversation

@Manuelshub
Copy link
Copy Markdown
Contributor

Closes #74

fix(core-dart): detect C address sourceAccount and emit CONTRACT_SENDER_DETECTED warning

Problem

extractRouting in the Dart implementation ignored the sourceAccount field
on RoutingInput entirely. If a contract address (C...) was supplied as the
transaction source, it passed through silently with no warning — leaving
downstream pipeline consumers with no signal that the routing context was
invalid.

The Go implementation already handled this correctly by checking sourceAccount
at the top of ExtractRouting and returning early with a
CONTRACT_SENDER_DETECTED warning. The Dart implementation was out of parity.

Solution

Added a sourceAccount check at the entry point of extractRouting, mirroring
the Go behavior exactly. If sourceAccount is non-null, non-empty, and parses
as a C address, the function returns early with:

  • routingSource: none
  • warnings: [CONTRACT_SENDER_DETECTED] (severity: info)

All other routing logic is bypassed, consistent with the spec.

Files Changed

  • packages/core-dart/lib/src/routing/extract.dart

Testing

All routing and spec vector tests pass.

dart test test/routing_test.dart test/spec_runner_test.dart
# +24: All tests passed!

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 27, 2026

@Manuelshub 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! 🚀

Learn more about application limits

@codeZe-us codeZe-us self-requested a review March 28, 2026 08:59
Copy link
Copy Markdown
Contributor

@codeZe-us codeZe-us left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Manuelshub This is okay

@codeZe-us codeZe-us merged commit f016fca into Boxkit-Labs:main Mar 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement contract-sender warning in extractRouting() for C-address sources

2 participants