We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63794a4 commit c2abd2cCopy full SHA for c2abd2c
crates/cast/src/lib.rs
@@ -323,15 +323,8 @@ impl<P: Provider<AnyNetwork>> Cast<P> {
323
/// # Ok(())
324
/// # }
325
/// ```
326
- pub async fn publish(
327
- &self,
328
- mut raw_tx: String,
329
- ) -> Result<PendingTransactionBuilder<AnyNetwork>> {
330
- raw_tx = match raw_tx.strip_prefix("0x") {
331
- Some(s) => s.to_string(),
332
- None => raw_tx,
333
- };
334
- let tx = hex::decode(raw_tx)?;
+ pub async fn publish(&self, raw_tx: String) -> Result<PendingTransactionBuilder<AnyNetwork>> {
+ let tx = hex::decode(strip_0x(&raw_tx))?;
335
let res = self.provider.send_raw_transaction(&tx).await?;
336
337
Ok(res)
0 commit comments