Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
64 changes: 32 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ members = [

[workspace.dependencies]
bincode = { package = "grovedb-bincode", version = "=2.1.0" }
grovedb = { git = "https://github.com/dashpay/grovedb", rev = "5cb0962afdd3df8d58cd9f40cc723ce1f475aeb5", default-features = false }
grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "5cb0962afdd3df8d58cd9f40cc723ce1f475aeb5" }
grovedb-merk = { git = "https://github.com/dashpay/grovedb", rev = "5cb0962afdd3df8d58cd9f40cc723ce1f475aeb5", default-features = false }
grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "5cb0962afdd3df8d58cd9f40cc723ce1f475aeb5" }
grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "5cb0962afdd3df8d58cd9f40cc723ce1f475aeb5" }
grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "5cb0962afdd3df8d58cd9f40cc723ce1f475aeb5" }
grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "5cb0962afdd3df8d58cd9f40cc723ce1f475aeb5" }
grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "5cb0962afdd3df8d58cd9f40cc723ce1f475aeb5" }
grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "5cb0962afdd3df8d58cd9f40cc723ce1f475aeb5" }
grovedb = { git = "https://github.com/dashpay/grovedb", rev = "fc7028d83114d86f88222e7ff09fc47ae75360f0", default-features = false }
grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "fc7028d83114d86f88222e7ff09fc47ae75360f0" }
grovedb-merk = { git = "https://github.com/dashpay/grovedb", rev = "fc7028d83114d86f88222e7ff09fc47ae75360f0", default-features = false }
grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "fc7028d83114d86f88222e7ff09fc47ae75360f0" }
grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "fc7028d83114d86f88222e7ff09fc47ae75360f0" }
grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "fc7028d83114d86f88222e7ff09fc47ae75360f0" }
grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "fc7028d83114d86f88222e7ff09fc47ae75360f0" }
grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "fc7028d83114d86f88222e7ff09fc47ae75360f0" }
grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "fc7028d83114d86f88222e7ff09fc47ae75360f0" }
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "6c5775cf3293c9906367c04ac243a764ef836349" }
dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "6c5775cf3293c9906367c04ac243a764ef836349" }
dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "6c5775cf3293c9906367c04ac243a764ef836349" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,24 +177,27 @@ fn should_attribute_unflagged_replacement_cost_mismatch_to_token_history_version
7
);
let id = SystemDataContract::TokenHistory.id().to_buffer();
let op = QualifiedGroveDbOp::insert_or_replace_op(
contract_other_path(&id)
.iter()
.map(|p| p.to_vec())
.collect(),
vec![CONTRACT_VERSION_KEY],
new,
);
let error = platform
.drive
.grove_apply_batch(
let replace = |drive_version| {
let op = QualifiedGroveDbOp::insert_or_replace_op(
contract_other_path(&id)
.iter()
.map(|p| p.to_vec())
.collect(),
vec![CONTRACT_VERSION_KEY],
new.clone(),
);
platform.drive.grove_apply_batch(
LowLevelDriveOperation::grovedb_operations_batch_consume(vec![
LowLevelDriveOperation::GroveOperation(op),
]),
false,
Some(&tx),
&pv.drive,
drive_version,
)
};
// GROVE_V3 (protocol version 13) measures the replacement with the old
// flags and fails the commit.
let error = replace(&PlatformVersion::get(13).expect("PV13").drive)
.expect_err("unflagged replacement must expose the accounting mismatch");
assert!(
error
Expand All @@ -206,6 +209,9 @@ fn should_attribute_unflagged_replacement_cost_mismatch_to_token_history_version
"attributed path=[64,{},2]/64 old={old:?} error={error}",
hex::encode(id)
);
// GROVE_V4 measures it from the bytes it stores, so it applies.
replace(&pv.drive).expect("GROVE_V4 charges the unflagged replacement for its own bytes");
assert_eq!(version_item(&platform, Some(&tx)), new);
}

fn contract_element(platform: &TempPlatform<MockCoreRPCLike>, tx: TransactionArg) -> Element {
Expand Down
Loading