Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update pchain-type version
  • Loading branch information
syrettaman committed Sep 28, 2023
commit 26e0b3bc9610990ae5f0102af30cbc619f14911f
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ futures = "0.3.21"
hotstuff_rs = { version = "0.2", git = "https://github.com/parallelchain-io/hotstuff_rs" }
libp2p = { version = "0.52.1", features = ["dns", "gossipsub", "identify", "ping", "tcp", "kad", "noise", "yamux", "macros", "tokio"]}
log = "0.4"
pchain-types = "0.4.3"
pchain-types = { git = "https://github.com/parallelchain-io/pchain-types-rust", branch = "protocol_v0.5" }
tokio = { version = "1", features = ["rt-multi-thread", "sync", "macros"] }
libp2p-mplex = "0.40.0"

Expand Down
6 changes: 3 additions & 3 deletions src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use borsh::BorshSerialize;
use libp2p::gossipsub::IdentTopic;
use pchain_types::{
blockchain::Transaction,
blockchain::TransactionV1,
cryptography::{PublicAddress, Sha256Hash},
serialization::Serializable,
};
Expand Down Expand Up @@ -63,7 +63,7 @@ impl From<Topic> for IdentTopic {
#[derive(Clone)]
pub enum Message {
Consensus(hotstuff_rs::messages::Message),
Mempool(Transaction),
Mempool(TransactionV1),
DroppedTx(DroppedTxMessage),
}

Expand All @@ -81,7 +81,7 @@ impl From<Message> for Vec<u8> {
#[derive(Clone, borsh::BorshSerialize, borsh::BorshDeserialize)]
pub enum DroppedTxMessage {
MempoolDroppedTx {
txn: Transaction,
txn: TransactionV1,
status_code: DroppedTxStatusCode,
},
ExecutorDroppedTx {
Expand Down
4 changes: 2 additions & 2 deletions src/network_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::Config;
use crate::engine;
use crate::message_gate::MessageGateChain;
use crate::messages::{DroppedTxMessage, Message, Topic};
use pchain_types::{blockchain::Transaction, cryptography::PublicAddress};
use pchain_types::{blockchain::TransactionV1, cryptography::PublicAddress};

/// [NetworkHandle] provides inter-process messaging between application and the p2p
/// network. It started the main thread for the p2p network and handles for the [tokio::task]
Expand All @@ -38,7 +38,7 @@ impl NetworkHandle {
}
}

pub fn broadcast_mempool_tx_msg(&self, content: &Transaction) {
pub fn broadcast_mempool_tx_msg(&self, content: &TransactionV1) {
let _ = self.sender.try_send(SendCommand::Broadcast(
Topic::Mempool,
Message::Mempool(content.clone()),
Expand Down
6 changes: 3 additions & 3 deletions tests/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ use pchain_network::{
messages::{Topic, Envelope, Message},
NetworkHandle,
};
use pchain_types::{blockchain::Transaction, cryptography::PublicAddress};
use pchain_types::{blockchain::TransactionV1, cryptography::PublicAddress};

fn base_tx(signer: PublicAddress) -> Transaction {
Transaction {
fn base_tx(signer: PublicAddress) -> TransactionV1 {
TransactionV1 {
signer,
nonce: 0,
commands: vec![],
Expand Down