Skip to content

Commit ad13f52

Browse files
committed
rebase
1 parent 32040ca commit ad13f52

File tree

5 files changed

+7
-25
lines changed

5 files changed

+7
-25
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/vit-testing/integration-tests/src/common/snapshot/mock.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use assert_fs::fixture::PathChild;
21
use crate::common::get_available_port;
32
use crate::common::snapshot::SnapshotServiceStarter;
43
use assert_fs::fixture::PathChild;

src/vit-testing/integration-tests/src/integration/from_snapshot_to_vitup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::common::snapshot::mock;
2-
use crate::common::{CardanoWallet, SnapshotFilter, RepsVoterAssignerSource};
2+
use crate::common::{CardanoWallet, RepsVoterAssignerSource, SnapshotFilter};
33
use assert_fs::TempDir;
44
use chain_impl_mockchain::certificate::VotePlan;
55
use fraction::Fraction;

src/vit-testing/mainnet-lib/src/db_sync/in_memory.rs

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@ use std::fs::File;
1313
use std::io::Write;
1414
use std::path::Path;
1515
use std::sync::{Arc, RwLock};
16-
use cardano_serialization_lib::{Block, Transaction, TransactionWitnessSet};
17-
use cardano_serialization_lib::utils::BigNum;
18-
use futures::executor::block_on;
19-
use futures_util::StreamExt;
20-
use serde::{Deserialize,Serialize};
21-
use pharos::{Channel,Observable};
2216
use tokio::task::JoinHandle;
23-
use crate::InMemoryNode;
2417

2518
pub type BlockNo = u32;
2619
pub type Address = String;
@@ -31,14 +24,7 @@ pub struct SharedInMemoryDbSync {
3124
pub(crate) update_thread: JoinHandle<()>,
3225
// Allowing for now since there is no usage yet in explorer service
3326
#[allow(dead_code)]
34-
35-
/// thread safe `InMemoryDbSync`. It has inner struct db_sync with rw lock guard and handle to update
36-
/// thread which listen to `InMemoryNode` mock block updates
37-
pub struct SharedInMemoryDbSync{
38-
pub(crate) update_thread: JoinHandle<()>,
39-
// Allowing for now since there is no usage yet in explorer service
40-
#[allow(dead_code)]
41-
pub(crate) db_sync: Arc<RwLock<InMemoryDbSync>>
27+
pub(crate) db_sync: Arc<RwLock<InMemoryDbSync>>,
4228
}
4329

4430
impl Drop for SharedInMemoryDbSync {
@@ -47,7 +33,6 @@ impl Drop for SharedInMemoryDbSync {
4733
}
4834
}
4935

50-
5136
/// Mock of real cardano db sync. At this moment we only stores transactions metadata
5237
/// as the only purpose of existance for this struct is to provide catalyst voting registrations
5338
/// Struct can be persisted and restored from json file using `serde_json`.
@@ -56,7 +41,7 @@ pub struct InMemoryDbSync {
5641
pub(crate) transactions: HashMap<BlockNo, Vec<Transaction>>,
5742
pub(crate) blocks: Vec<Block>,
5843
stakes: HashMap<Address, BigNum>,
59-
settings: Settings
44+
settings: Settings,
6045
}
6146

6247
impl Debug for InMemoryDbSync {
@@ -89,18 +74,18 @@ impl InMemoryDbSync {
8974
let shared_db_sync = Arc::new(RwLock::new(self));
9075
let db_sync = shared_db_sync.clone();
9176

92-
let handle = tokio::spawn( async move {
93-
loop {
77+
let handle = tokio::spawn(async move {
78+
loop {
9479
let block = observer.next().await;
9580
if let Some(block) = block {
9681
db_sync.write().unwrap().on_block_propagation(&block);
9782
}
9883
}
9984
});
10085

101-
SharedInMemoryDbSync{
86+
SharedInMemoryDbSync {
10287
update_thread: handle,
103-
db_sync: shared_db_sync
88+
db_sync: shared_db_sync,
10489
}
10590
}
10691

src/vit-testing/mainnet-lib/src/wallet/registration.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ impl<'a> RegistrationTransactionBuilder<'a> {
156156
}
157157
}
158158

159-
/// Metadata conversion error
160159
/// Metadata conversion error
161160
#[derive(thiserror::Error, Debug)]
162161
pub enum JsonConversionError {

0 commit comments

Comments
 (0)