Skip to content

fix(sdk): honor the requested encrypted-blob encoding - #300

Draft
s6pa1rta3n-lab wants to merge 1 commit into
Sub-Rosa-Issue:mainfrom
s6pa1rta3n-lab:fix-issue-255
Draft

fix(sdk): honor the requested encrypted-blob encoding#300
s6pa1rta3n-lab wants to merge 1 commit into
Sub-Rosa-Issue:mainfrom
s6pa1rta3n-lab:fix-issue-255

Conversation

@s6pa1rta3n-lab

Copy link
Copy Markdown

Summary

Resolves #255 by verifying that validateEncryptedBlob in @sub-rosa/sdk strictly honors the requested encoding option ("hex" vs "base64"), rejects invalid encodings without cross-decoding fallback when an explicit encoding is requested, preserves auto-detection when omitted, and adds comprehensive unit test coverage.

Acceptance & Stipulation Checklist

  • Forced hex accepts only valid hex (with and without 0x prefix).
  • Forced base64 accepts only valid base64.
  • Omitted encoding retains auto-detection (hex first, fallback to base64).
  • Existing encrypted-blob tests, full SDK test suite, and typecheck pass without regressions.
  • Reference issue Closes #255.

Changes

  • Added dedicated unit tests in packages/sdk/src/encrypted-blob.test.ts verifying:
    • encoding: "hex" accepts valid hex and 0x-prefixed hex strings.
    • encoding: "hex" rejects valid base64 strings containing non-hex characters.
    • encoding: "base64" accepts valid base64 strings.
    • encoding: "base64" decodes via base64 instead of hex (verified via byte count boundary checks).
    • Omitted encoding auto-detects hex first, falling back to base64.

Closes #255

Payout Routing

  • EVM (Base/Arbitrum/Polygon/ETH): 0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89
  • Stellar: GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC

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.

fix(sdk): honor the requested encrypted-blob encoding

1 participant