Files
bridge/internal
zeekay 61d403336e test(bridge): TON broadcast + v4r2 assembler test coverage
internal/broadcast/ton_test.go:

- Happy path: hex payload → base64 on wire, X-API-Key header set
  per-network, response hash returned verbatim.
- Base64 payload pass-through (skip the hex re-encode).
- Error classification matrix:
    429 / "rate" → ErrTONRateLimited (retryable)
    "invalid boc" / "wrong signature" → ErrTONMalformedBOC (fatal)
    "account not initialized" → ErrTONAccountNotInitialized (re-build w/ state_init)
    HTTP 502/503/504 → TONError{Retryable:true}
- Family-dispatch parity: TON_TESTNET must NOT trip ErrFamilyNotImplemented.
- Direct parser tests (no HTTP) for non-JSON 5xx + hash-less success
  payloads (synthesized "ton:sendBoc:ok:200" identifier).
- isHexString + payload normalizer unit tests.

internal/txassembler/ton_test.go:

- Address derivation: same pubkey ⇒ same address (deterministic),
  different pubkeys ⇒ different addresses, UQ vs EQ flags surface
  correctly via TONAddressFromPubKey / …BounceableFromPubKey, raw
  form parses back to the same address (parse-roundtrip via
  ParseTONAddress).
- PreSign native transfer: deterministic body hash under a fixed
  clock, StateInit populated/skipped per SourceInitialized flag,
  rejects nil / zero / negative amounts + bad pubkey + spec
  SourceAddress mismatch.
- PreSign jetton: spec-provided JettonSourceWallet skips the
  JettonProvider, provider path is invoked with the right
  (network, master, owner) args, missing-provider + missing-master
  both error cleanly.
- PreSign + FinalizeTONHex round-trip: locally sign u.SigHash with
  Ed25519, finalize, decode the resulting BOC, verify
  ExternalMessage.Body's first 64 bytes match the signature.
- Body schema: 1 ref (the internal message), 112 bits of header
  data (subwallet 32 + valid_until 32 + seqno 32 + op 8 + mode 8).
- State_init hash matches the pubkey-derived address — confirms
  the wallet contract we deploy on first send IS the wallet
  contract whose address we keygen'd to.
- Static seqno provider drives v4r2 body's seqno field.
2026-05-27 17:55:34 -07:00
..
2026-05-27 14:49:55 +02:00
2026-05-27 14:49:55 +02:00