File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -220,9 +220,15 @@ impl Transaction {
220220 // Fall back to manual serialization if no context
221221 self . to_bytes_manual ( )
222222 } else {
223- // Unsigned: return the signing payload (call_data + extensions + additional_signed).
224- // This matches legacy toBroadcastFormat which returns construct.signingPayload().
225- self . signable_payload ( )
223+ // Unsigned: return the signing payload with a compact call_data length prefix.
224+ // Format: compact(call_data_len) | call_data | extensions | additional_signed
225+ // This matches legacy toBroadcastFormat (construct.signingPayload from txwrapper)
226+ // and is decodable by both wasm-dot and polkadot-js/txwrapper.
227+ use parity_scale_codec:: { Compact , Encode } ;
228+ let payload = self . signable_payload ( ) ?;
229+ let mut result = Compact ( self . call_data . len ( ) as u32 ) . encode ( ) ;
230+ result. extend_from_slice ( & payload) ;
231+ Ok ( result)
226232 }
227233 }
228234
You can’t perform that action at this time.
0 commit comments