Skip to content

Commit 5cdae04

Browse files
fix: upgrade to grovedb version 2.2.1 and fix purchase issue
1 parent f5a3e77 commit 5cdae04

8 files changed

Lines changed: 234 additions & 329 deletions

File tree

Cargo.lock

Lines changed: 214 additions & 309 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/rs-drive-abci/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ assert_matches = "1.5.0"
9999
drive-abci = { path = ".", features = ["testing-config"] }
100100

101101
# For tests of grovedb verify
102-
rocksdb = { version = "0.22.0" }
102+
rocksdb = { version = "0.23.0" }
103103
integer-encoding = { version = "4.0.0" }
104104

105105
[features]

packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/documents_batch/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7678,14 +7678,14 @@ mod tests {
76787678

76797679
assert_eq!(processing_result.aggregated_fees().storage_fee, 64611000);
76807680

7681-
assert_eq!(processing_result.aggregated_fees().processing_fee, 4339120);
7681+
assert_eq!(processing_result.aggregated_fees().processing_fee, 4345280);
76827682

76837683
assert_eq!(
76847684
processing_result
76857685
.aggregated_fees()
76867686
.fee_refunds
76877687
.calculate_refunds_amount_for_identity(identity.id()),
7688-
Some(53203452)
7688+
Some(52987722)
76897689
);
76907690

76917691
let query_sender_results = platform
@@ -7712,7 +7712,7 @@ mod tests {
77127712
// the seller should have received 0.1 and already had 0.1 minus the processing fee and storage fee
77137713
assert_eq!(
77147714
seller_balance,
7715-
dash_to_credits!(0.2) - original_creation_cost + 50272452
7715+
dash_to_credits!(0.2) - original_creation_cost + 46955162
77167716
);
77177717

77187718
let buyers_balance = platform
@@ -7722,7 +7722,7 @@ mod tests {
77227722
.expect("expected that purchaser exists");
77237723

77247724
// the buyer paid 0.1, but also storage and processing fees
7725-
assert_eq!(buyers_balance, dash_to_credits!(0.9) - 68950120);
7725+
assert_eq!(buyers_balance, dash_to_credits!(0.9) - 68956280);
77267726
}
77277727

77287728
#[test]

packages/rs-drive/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ bs58 = { version = "0.5.0", optional = true }
4949
base64 = { version = "0.22.1", optional = true }
5050
tempfile = { version = "3", optional = true }
5151
enum-map = { version = "2.0.3", optional = true }
52-
intmap = { version = "2.0.0", features = ["serde"], optional = true }
52+
intmap = { version = "3.0.1", features = ["serde"], optional = true }
5353
chrono = { version = "0.4.35", optional = true }
5454
itertools = { version = "0.13", optional = true }
55-
grovedb = { version = "2.1.0", optional = true, default-features = false }
56-
grovedb-costs = { version = "2.1.0", optional = true }
57-
grovedb-path = { version = "2.1.0" }
58-
grovedb-storage = { version = "2.1.0", optional = true }
59-
grovedb-version = { version = "2.1.0" }
60-
grovedb-epoch-based-storage-flags = { version = "2.1.0" }
55+
grovedb = { version = "2.2.1", optional = true, default-features = false }
56+
grovedb-costs = { version = "2.2.1", optional = true }
57+
grovedb-path = { version = "2.2.1" }
58+
grovedb-storage = { version = "2.2.1", optional = true }
59+
grovedb-version = { version = "2.2.1" }
60+
grovedb-epoch-based-storage-flags = { version = "2.2.1" }
6161

6262
[dev-dependencies]
6363
criterion = "0.5"
@@ -104,7 +104,7 @@ server = [
104104
"dpp/system_contracts",
105105
"dpp/state-transitions",
106106
"fee-distribution",
107-
"grovedb/full",
107+
"grovedb/minimal",
108108
"grovedb/estimated_costs",
109109
"grovedb-storage",
110110
"grovedb-costs",

packages/rs-drive/src/drive/document/estimation_costs/stateless_delete_of_non_tree_for_costs/v0/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ impl Drive {
7777
)),
7878
))?;
7979

80-
Ok((s as u64, layer_info.clone()))
80+
Ok((s, layer_info.clone()))
8181
})
82-
.collect::<Result<IntMap<EstimatedLayerInformation>, Error>>()?;
82+
.collect::<Result<IntMap<u16, EstimatedLayerInformation>, Error>>()?;
8383
// We need to update the current layer to only have 1 element that we want to delete
8484
let mut last_layer_information = layer_map
85-
.remove((key_info_path.len() - 1) as u64)
85+
.remove((key_info_path.len() - 1) as u16)
8686
.ok_or(Error::Fee(FeeError::CorruptedEstimatedLayerInfoMissing(
8787
"last layer info missing".to_owned(),
8888
)))?;
8989
last_layer_information.estimated_layer_sizes = element_estimated_sizes;
90-
layer_map.insert((key_info_path.len() - 1) as u64, last_layer_information);
90+
layer_map.insert((key_info_path.len() - 1) as u16, last_layer_information);
9191
Ok(BatchDeleteUpTreeApplyType::StatelessBatchDelete {
9292
estimated_layer_info: layer_map,
9393
})

packages/rs-drive/src/util/grove_operations/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ pub enum BatchDeleteUpTreeApplyType {
221221
/// Stateless batch delete
222222
StatelessBatchDelete {
223223
/// The estimated layer info
224-
estimated_layer_info: IntMap<EstimatedLayerInformation>,
224+
estimated_layer_info: IntMap<u16, EstimatedLayerInformation>,
225225
},
226226
/// Stateful batch delete
227227
StatefulBatchDelete {

packages/rs-platform-version/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ license = "MIT"
1111
thiserror = { version = "1.0.63" }
1212
bincode = { version = "2.0.0-rc.3" }
1313
versioned-feature-core = { git = "https://github.com/dashpay/versioned-feature-core", version = "1.0.0" }
14-
grovedb-version = { version = "2.1.0" }
14+
grovedb-version = { version = "2.2.1" }
1515
once_cell = "1.19.0"
1616

1717
[features]

packages/strategy-tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ platform-version = { path = "../rs-platform-version", features = [
4646
] }
4747

4848
# For tests of grovedb verify
49-
rocksdb = { version = "0.22.0" }
49+
rocksdb = { version = "0.23.0" }

0 commit comments

Comments
 (0)