Skip to content

fix(tips): pad tip code payload with incrementing digits instead of zeros - #1163

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/tip-code-payload-nonzero-padding
Jul 27, 2026
Merged

fix(tips): pad tip code payload with incrementing digits instead of zeros#1163
bmc08gt merged 1 commit into
code/cashfrom
fix/tip-code-payload-nonzero-padding

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

The tip code scan frame (PayloadKind.Tip, kind byte 2) wrote a 16-byte user id at offset 1 and left the 3 reserved trailing bytes (17–19) as zeros. The native Kik scanner strips trailing zero bytes on decode, so those frames came back short.

This fills the reserved trailing space with incrementing digits (1, 2, 3) instead of zeros, so the frame always ends non-zero and round-trips at full length.

Changes

  • PayloadKind.Tip.encode — fill the reserved region (offset 17 onward) with 1, 2, 3 instead of leaving zeros.
  • OpenCodePayload.kt — updated the Layout 2 frame diagram/comment.
  • OpenCodePayloadTests.kt — updated the assertion from listOf<Byte>(0, 0, 0) to listOf<Byte>(1, 2, 3).

Decoding is unaffected — Tip.decode reads only the 16-byte user id and ignores the reserved bytes. The cash frames are unchanged (they already fill all 20 bytes with currency/quarks/nonce).

Testing

  • :services:opencode:compileDebugKotlin
  • :services:opencode:compileDebugAndroidTestKotlin

…eros

The tip code frame wrote a 16-byte user id and left the 3 reserved
trailing bytes as zeros. The native Kik scanner strips trailing zero
bytes on decode, so those frames came back short. Fill the reserved
space with incrementing digits (1, 2, 3) so the frame ends non-zero and
round-trips at full length.
@github-actions github-actions Bot added type: fix Bug fix area: network gRPC, connectivity, API, exchange rates labels Jul 27, 2026
@bmc08gt
bmc08gt merged commit 379afb3 into code/cash Jul 27, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the fix/tip-code-payload-nonzero-padding branch July 27, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: network gRPC, connectivity, API, exchange rates type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant