From a3441a687141930e15b0d4979e9aad136805d084 Mon Sep 17 00:00:00 2001
From: Luke Parker <lukeparker5132@gmail.com>
Date: Mon, 14 Aug 2023 08:18:19 -0400
Subject: [PATCH] Don't have publish return the 'hash'

---
 coordinator/src/main.rs           | 9 ++++-----
 substrate/client/src/serai/mod.rs | 7 +++++--
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/coordinator/src/main.rs b/coordinator/src/main.rs
index 6c455bb8..8c113131 100644
--- a/coordinator/src/main.rs
+++ b/coordinator/src/main.rs
@@ -195,8 +195,8 @@ pub async fn scan_tributaries<D: Db, Pro: Processors, P: P2p>(
           async move {
             loop {
               match serai.publish(&tx).await {
-                Ok(hash) => {
-                  log::info!("set key pair for {:?} in TX {}", set, hex::encode(hash));
+                Ok(_) => {
+                  log::info!("set key pair for {set:?}");
                   break;
                 }
                 // This is assumed to be some ephemeral error due to the assumed fault-free
@@ -576,13 +576,12 @@ pub async fn handle_processors<D: Db, Pro: Processors, P: P2p>(
           let tx = Serai::execute_batch(batch.clone());
           loop {
             match serai.publish(&tx).await {
-              Ok(hash) => {
+              Ok(_) => {
                 log::info!(
-                  "executed batch {:?} {} (block {}) in TX {}",
+                  "executed batch {:?} {} (block {})",
                   batch.batch.network,
                   batch.batch.id,
                   hex::encode(batch.batch.block),
-                  hex::encode(hash),
                 );
                 break;
               }
diff --git a/substrate/client/src/serai/mod.rs b/substrate/client/src/serai/mod.rs
index fd043447..c2cf2c92 100644
--- a/substrate/client/src/serai/mod.rs
+++ b/substrate/client/src/serai/mod.rs
@@ -300,8 +300,11 @@ impl Serai {
       .map_err(|_| SeraiError::InvalidRuntime)
   }
 
-  pub async fn publish(&self, tx: &Encoded) -> Result<[u8; 32], SeraiError> {
-    self.0.rpc().submit_extrinsic(tx).await.map(Into::into).map_err(SeraiError::RpcError)
+  pub async fn publish(&self, tx: &Encoded) -> Result<(), SeraiError> {
+    // Drop the hash, which is the hash of the raw TX, as TXs are allowed to share hashes and this
+    // hash is practically useless/unsafe
+    // If we are to return something, it should be block included in and position within block
+    self.0.rpc().submit_extrinsic(tx).await.map(|_| ()).map_err(SeraiError::RpcError)
   }
 }