This commit is contained in:
Dave Hrycyszyn
2024-06-24 08:02:17 +01:00
parent d6c118ca3b
commit 643a0d7f52
5 changed files with 120 additions and 61 deletions

View File

@@ -1,3 +1,4 @@
use bdk::database::MemoryDatabase;
use bft_json_crdt::json_crdt::{BaseCrdt, SignedOp};
use fastcrypto::ed25519::Ed25519KeyPair;
use tokio::sync::mpsc;
@@ -7,7 +8,7 @@ use crate::{clients::websocket::Client, crdt::TransactionList, utils};
pub struct SideNode {
crdt: BaseCrdt<TransactionList>,
bft_crdt_keys: fastcrypto::ed25519::Ed25519KeyPair,
bitcoin_keys: bitcoin::secp256k1::Keypair,
bitcoin_wallet: bdk::Wallet<MemoryDatabase>,
incoming_receiver: mpsc::Receiver<SignedOp>,
stdin_receiver: std::sync::mpsc::Receiver<String>,
handle: ezsockets::Client<Client>,
@@ -17,7 +18,7 @@ impl SideNode {
pub fn new(
crdt: BaseCrdt<TransactionList>,
bft_crdt_keys: Ed25519KeyPair,
bitcoin_keys: bitcoin::secp256k1::Keypair,
bitcoin_wallet: bdk::Wallet<MemoryDatabase>,
incoming_receiver: mpsc::Receiver<SignedOp>,
stdin_receiver: std::sync::mpsc::Receiver<String>,
handle: ezsockets::Client<Client>,
@@ -25,7 +26,7 @@ impl SideNode {
let node = Self {
crdt,
bft_crdt_keys,
bitcoin_keys,
bitcoin_wallet,
incoming_receiver,
stdin_receiver,
handle,