Skip to content

Commit b629788

Browse files
committed
Adds a wrapper check before tx submission
1 parent c6b8334 commit b629788

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/sdk/src/tx.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,12 @@ pub async fn process_tx(
277277
// We use this to determine when the wrapper tx makes it on-chain
278278
let tx_hash = tx.header_hash().to_string();
279279
let cmts = tx.commitments().clone();
280-
// FIXME: add a check to avoid submitting raw txs? Yes
281280
let wrapper_hash = tx.wrapper_hash();
281+
if wrapper_hash.is_none() {
282+
return Err(Error::Other(
283+
"Can't submit a non-wrapper transaction".to_string(),
284+
));
285+
}
282286
// We use this to determine when the inner tx makes it
283287
// on-chain
284288
let to_broadcast = TxBroadcastData::Live { tx, tx_hash };

0 commit comments

Comments
 (0)