mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Don't have publish return the 'hash'
This commit is contained in:
@@ -195,8 +195,8 @@ pub async fn scan_tributaries<D: Db, Pro: Processors, P: P2p>(
|
|||||||
async move {
|
async move {
|
||||||
loop {
|
loop {
|
||||||
match serai.publish(&tx).await {
|
match serai.publish(&tx).await {
|
||||||
Ok(hash) => {
|
Ok(_) => {
|
||||||
log::info!("set key pair for {:?} in TX {}", set, hex::encode(hash));
|
log::info!("set key pair for {set:?}");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// This is assumed to be some ephemeral error due to the assumed fault-free
|
// 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());
|
let tx = Serai::execute_batch(batch.clone());
|
||||||
loop {
|
loop {
|
||||||
match serai.publish(&tx).await {
|
match serai.publish(&tx).await {
|
||||||
Ok(hash) => {
|
Ok(_) => {
|
||||||
log::info!(
|
log::info!(
|
||||||
"executed batch {:?} {} (block {}) in TX {}",
|
"executed batch {:?} {} (block {})",
|
||||||
batch.batch.network,
|
batch.batch.network,
|
||||||
batch.batch.id,
|
batch.batch.id,
|
||||||
hex::encode(batch.batch.block),
|
hex::encode(batch.batch.block),
|
||||||
hex::encode(hash),
|
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -300,8 +300,11 @@ impl Serai {
|
|||||||
.map_err(|_| SeraiError::InvalidRuntime)
|
.map_err(|_| SeraiError::InvalidRuntime)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn publish(&self, tx: &Encoded) -> Result<[u8; 32], SeraiError> {
|
pub async fn publish(&self, tx: &Encoded) -> Result<(), SeraiError> {
|
||||||
self.0.rpc().submit_extrinsic(tx).await.map(Into::into).map_err(SeraiError::RpcError)
|
// 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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user