Replace substrate/client's use of Payload with usage of RuntimeCall

Gains explicit typing.
This commit is contained in:
Luke Parker
2023-11-22 11:23:00 -05:00
parent fcfdadc791
commit 08e6669403
9 changed files with 93 additions and 105 deletions

View File

@@ -2,10 +2,10 @@ use core::time::Duration;
use tokio::time::sleep;
use serai_client::{subxt::utils::Encoded, Serai};
use serai_client::Serai;
#[allow(dead_code)]
pub async fn publish_tx(serai: &Serai, tx: &Encoded) -> [u8; 32] {
pub async fn publish_tx(serai: &Serai, tx: &[u8]) -> [u8; 32] {
let mut latest =
serai.block(serai.latest_block_hash().await.unwrap()).await.unwrap().unwrap().number();
@@ -34,7 +34,7 @@ pub async fn publish_tx(serai: &Serai, tx: &Encoded) -> [u8; 32] {
};
for transaction in block.transactions() {
if transaction.0 == tx.0[2 ..] {
if transaction.0 == tx[2 ..] {
return block.hash();
}
}