Skip to content

Commit

Permalink
suppress v0 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
eagr committed Nov 1, 2024
1 parent 0bd8bfa commit e51bc13
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions chain/chain/src/resharding/event_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ mod tests {
let s5 = ShardId::new(5);

// Shard layouts V0 and V1 are rejected.
#[allow(deprecated)]
assert!(ReshardingEventType::from_shard_layout(&ShardLayout::v0(1, 0), block, prev_block)
.is_err());
assert!(ReshardingEventType::from_shard_layout(&ShardLayout::v1_test(), block, prev_block)
Expand Down
2 changes: 2 additions & 0 deletions core/primitives/src/shard_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,7 @@ mod tests {
#[test]
fn test_shard_layout_v0() {
let num_shards = 4;
#[allow(deprecated)]
let shard_layout = ShardLayout::v0(num_shards, 0);
let mut shard_id_distribution: HashMap<ShardId, _> =
shard_layout.shard_ids().map(|shard_id| (shard_id.into(), 0)).collect();
Expand Down Expand Up @@ -1142,6 +1143,7 @@ mod tests {

#[test]
fn test_shard_layout_all() {
#[allow(deprecated)]
let v0 = ShardLayout::v0(1, 0);
let v1 = ShardLayout::get_simple_nightshade_layout();
let v2 = ShardLayout::get_simple_nightshade_layout_v2();
Expand Down
1 change: 1 addition & 0 deletions tools/database/src/corrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ impl CorruptStateSnapshotCommand {
let mut store_update = store.store_update();
// TODO(resharding) automatically detect the shard version
let shard_layout = match self.shard_layout_version {
#[allow(deprecated)]
0 => ShardLayout::v0(1, 0),
1 => ShardLayout::get_simple_nightshade_layout(),
2 => ShardLayout::get_simple_nightshade_layout_v2(),
Expand Down

0 comments on commit e51bc13

Please sign in to comment.