mirror of
https://github.com/luxfi/bridge.git
synced 2026-09-24 00:26:46 +00:00
Add the substrate broadcast handler at internal/broadcast/dot.go:
- POST {"method":"author_submitExtrinsic","params":["0x<hex>"]} against
the network's substrate RPC, return the 0x-prefixed extrinsic hash
on success.
- DOTBroadcastError classification (retryable vs fatal) by substrate
error code + message:
Invalid::Future / AlreadyImported / pool-full / runtime-upgrade
-> retryable (orchestrator polls again next tick)
Invalid::Stale / Invalid::BadProof / Module(...)
-> fatal (re-sign needed or pallet rejection)
- Default RPC endpoints: rpc.polkadot.io (mainnet),
westend-rpc.polkadot.io (testnet), kusama-rpc.polkadot.io (canary).
Wire dispatch in client.go Broadcast switch: AddressTypeDOT lands in
broadcastDOT. ErrFamilyNotImplemented now reads BTC/SOL/TON/XRP only.
Tests cover happy-path, Stale/BadProof fatal, Future retryable,
AlreadyImported retryable, Module error fatal, 4xx-with-envelope, 5xx
without envelope, empty result, and error-string formatting.