mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Move serai-client off serai-runtime, MIT licensing it
Uses a full-fledged serai-abi to do so. Removes use of UncheckedExtrinsic as a pointlessly (for us) length-prefixed block with a more complicated signing algorithm than advantageous. In the future, we should considering consolidating the various primitives crates. I'm not convinced we benefit from one primitives crate per pallet.
This commit is contained in:
@@ -2,12 +2,10 @@ use core::time::Duration;
|
||||
|
||||
use tokio::time::sleep;
|
||||
|
||||
use scale::Encode;
|
||||
|
||||
use serai_client::Serai;
|
||||
use serai_client::{Transaction, Serai};
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub async fn publish_tx(serai: &Serai, tx: &[u8]) -> [u8; 32] {
|
||||
pub async fn publish_tx(serai: &Serai, tx: &Transaction) -> [u8; 32] {
|
||||
let mut latest = serai
|
||||
.block(serai.latest_finalized_block_hash().await.unwrap())
|
||||
.await
|
||||
@@ -39,8 +37,8 @@ pub async fn publish_tx(serai: &Serai, tx: &[u8]) -> [u8; 32] {
|
||||
block.unwrap()
|
||||
};
|
||||
|
||||
for transaction in block.transactions() {
|
||||
if transaction.encode() == tx {
|
||||
for transaction in &block.transactions {
|
||||
if transaction == tx {
|
||||
return block.hash();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user