Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xgreenx committed Mar 9, 2024
1 parent 04415cc commit a14f761
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 21 deletions.
12 changes: 6 additions & 6 deletions bin/fuel-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ tikv-jemallocator = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = [
"ansi",
"env-filter",
"json",
"ansi",
"env-filter",
"json",
] }
url = { version = "2.2", optional = true }

Expand All @@ -55,9 +55,9 @@ relayer = ["fuel-core/relayer", "dep:url"]
parquet = ["fuel-core-chain-config/parquet"]
rocksdb = ["fuel-core/rocksdb", "dep:fuel-core-storage", "dep:itertools"]
rocksdb-production = [
"fuel-core/rocksdb-production",
"dep:fuel-core-storage",
"dep:itertools",
"fuel-core/rocksdb-production",
"dep:fuel-core-storage",
"dep:itertools",
]
# features to enable in production, but increase build times
production = ["env", "relayer", "rocksdb-production", "p2p", "parquet"]
5 changes: 1 addition & 4 deletions bin/fuel-core/src/cli/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,7 @@ mod tests {
let height = 10u32.into();
block.header_mut().application_mut().da_height = 14u64.into();
block.header_mut().set_block_height(height);
self.db
.storage::<FuelBlocks>()
.insert(&height, &block)
.unwrap();
let _ = self.db.storage::<FuelBlocks>().insert(&height, &block);

block
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ expression: encoded_json
"contracts": [],
"contract_state": [],
"contract_balance": [],
"block_height": 0
"block_height": 0,
"da_block_height": 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ expression: encoded_json
],
"contract_state": [],
"contract_balance": [],
"block_height": 0
"block_height": 0,
"da_block_height": 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ expression: encoded_json
"contracts": [],
"contract_state": [],
"contract_balance": [],
"block_height": 0
"block_height": 0,
"da_block_height": 0
}
5 changes: 2 additions & 3 deletions crates/fuel-core/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,8 @@ impl ChainStateDb for Database {
}

fn get_last_block(&self) -> StorageResult<CompressedBlock> {
Ok(self
.latest_compressed_block()?
.ok_or(not_found!(FuelBlocks))?)
self.latest_compressed_block()?
.ok_or(not_found!(FuelBlocks))
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/tests/balances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async fn balance() {
nonce: (nonce as u64).into(),
amount,
data: vec![],
da_height: DaBlockHeight::from(1usize),
da_height: DaBlockHeight::from(0usize),
})
.collect(),
..Default::default()
Expand Down Expand Up @@ -184,7 +184,7 @@ async fn first_5_balances() {
nonce: (nonce as u64).into(),
amount,
data: vec![],
da_height: DaBlockHeight::from(1usize),
da_height: DaBlockHeight::from(0usize),
};
nonce += 1;
message
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ mod message_coin {
nonce: (nonce as u64).into(),
amount,
data: vec![],
da_height: DaBlockHeight::from(1u64),
da_height: DaBlockHeight::from(0u64),
})
.collect(),
..Default::default()
Expand Down Expand Up @@ -529,7 +529,7 @@ mod all_coins {
nonce: (nonce as u64).into(),
amount,
data: vec![],
da_height: DaBlockHeight::from(1u64),
da_height: DaBlockHeight::from(0u64),
})
.collect(),
..Default::default()
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ async fn loads_snapshot() {
nonce: Nonce::from(rng.gen_range(0..1000)),
amount: rng.gen_range(0..1000),
data: vec![],
da_height: DaBlockHeight(rng.gen_range(0..1000)),
da_height: DaBlockHeight(19),
}],
block_height: BlockHeight::from(10),
da_block_height: 20u64.into(),
Expand Down

0 comments on commit a14f761

Please sign in to comment.