clawchain/clawchain-alloy
caelum0x a0093098b1 feat(rust): JSON-RPC POST broadcast + BroadcastMode (sync/async/commit)
The GET 0x-hex broadcast form blows past URL-length limits for large txs (e.g. a
CosmWasm 'store' of a multi-100kB wasm). Add a POST JSON-RPC broadcast path (tx base64
in the body — no size limit) and a BroadcastMode enum (Sync/Async/Commit):
- query.rs: BroadcastMode, broadcast_rpc_body (pure), parse_broadcast_result (handles
  flat sync/async + nested commit check_tx/tx_result, surfaces non-zero codes).
- provider.rs: post_rpc helper, broadcast_with_mode(tx, mode); default broadcast now
  POSTs in Sync mode. (GET path retained as broadcast_tx_sync_path for small txs.)

Offline tests for body-per-mode + result parsing (sync/async/commit/checktx-fail/
rpc-error). cargo build clean; 34 unit + 1 doctest pass. Live-verified: signed bank
send via POST broadcast committed on the 4-validator testnet.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 00:51:01 +03:00
..