Skip to content

Commit

Permalink
rusk: use generic Message::from for Transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
herr-seppia committed Sep 3, 2024
1 parent c96e093 commit 1f9e1f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rusk/src/lib/http/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use std::collections::HashMap;
use std::net::SocketAddr;
use std::sync::Arc;

use execution_core::transfer::Transaction as ProtocolTransaction;
use node::database::rocksdb::{Backend, DBTransaction};
use node::database::{Mempool, DB};
use node::network::Kadcast;
Expand Down Expand Up @@ -153,10 +154,10 @@ impl RuskNode {
}

async fn propagate_tx(&self, tx: &[u8]) -> anyhow::Result<ResponseData> {
let tx = execution_core::transfer::Transaction::from_slice(tx)
let tx: Transaction = ProtocolTransaction::from_slice(tx)
.map_err(|e| anyhow::anyhow!("Invalid Data {e:?}"))?
.into();
let tx_message = Message::new_transaction(tx);
let tx_message = tx.into();

let network = self.network();
network.read().await.route_internal(tx_message);
Expand Down

0 comments on commit 1f9e1f2

Please sign in to comment.