feat(kotlin-sdk): transaction decoder JNI binding over key-wallet-ffi transaction_decode#4187
Conversation
… transaction_decode Android port of the Swift TransactionDecoder (PR dashpay#3981): one new JNI export (TxDecodeNative.decodeTransaction) marshaling key-wallet-ffi's transaction_decode result into a packed big-endian BLOB, parsed by the new org.dashfoundation.dashsdk.keywallet.TransactionDecoder into DecodedTransaction (txid + per-input prev outpoints / unauthenticated P2PKH sender hints + per-output address/value/script). - rs-unified-sdk-jni/src/tx_decode.rs: thin single-entry-point marshaler (CLAUDE.md boundary rule); JNI-free decode_to_blob core is host-tested, incl. a fixture blob hex pinned byte-for-byte from Kotlin's TransactionDecoderTest (cross-language layout pin). - Binds the transaction_decode already present in v4.1-dev's rust-dashcore pin (upstream rust-dashcore#870) — no vendored Rust changes needed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 22 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Final review complete — no blockers (commit 40aa94f) |
|
Reviewed against v4.1-dev with focus on FFI fidelity and Swift parity. This is a faithful counterpart of the Swift
|
|
Post-merge follow-up only; I found no blocker in the decoder architecture. Kotlin exposes |
|
@coderabbitai full review |
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 22 minutes. |
|
Thanks for the review and approval. All three notes are implemented in a small follow-up PR (opening shortly): the script-encoder null branch now writes length 0 (plus the same guard one level up for the input/output arrays, with lying-fixture tests), Separately: could you hit "Re-run failed jobs" on the x86_64 emulator check on #4182 and #4183? As you noted, the failure predates the diffs — it's the known emulator-boot flake, and we don't have rerun rights. |
Adds the Android/Kotlin counterpart of the Swift
TransactionDecoder(#3981): a single JNI export (TxDecodeNative.decodeTransaction) over key-wallet-ffi'stransaction_decode— already present inv4.1-dev's rust-dashcore pin via upstream rust-dashcore#870, so no vendored Rust changes are needed. The JNI layer marshals the decode result into a packed big-endian BLOB parsed by the neworg.dashfoundation.dashsdk.keywallet.TransactionDecoderintoDecodedTransaction(txid + per-input prev outpoints / unauthenticated P2PKH sender hints + per-output address/value/script).The JNI-free
decode_to_blobcore is host-tested (7 Rust tests), including a fixture blob pinned byte-for-byte against Kotlin'sTransactionDecoderTest(4 tests) as a cross-language layout pin.Verified:
cargo test -p rs-unified-sdk-jni(17 tests) and:sdk:assembleRelease+ sdk unit tests all pass against the pin'stransaction_decodesignature (no API drift).🤖 Generated with Claude Code