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
5 changes: 4 additions & 1 deletion soroban-ledger-snapshot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2021"
rust-version.workspace = true

[dependencies]
soroban-env-host = { workspace = true, features = ["testutils"] }
soroban-env-host = { workspace = true }
soroban-env-common = {workspace = true, features = ["serde"]}
serde = { version = "1.0.0", features = ["derive"] }
serde_with = { version = "3.4.0", features = ["hex"] }
Expand All @@ -20,3 +20,6 @@ thiserror = "1.0"

[dev-dependencies]
pretty_assertions = "1.2.1"

[features]
testutils = ["soroban-env-host/testutils"]
7 changes: 4 additions & 3 deletions soroban-ledger-snapshot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{
use soroban_env_host::{
storage::SnapshotSource,
xdr::{LedgerEntry, LedgerKey},
Host, HostError, LedgerInfo,
HostError, LedgerInfo,
};

#[derive(thiserror::Error, Debug)]
Expand Down Expand Up @@ -50,13 +50,14 @@ impl LedgerSnapshot {
s
}

/// Update the snapshot with the state within the given [`Host`].
/// Update the snapshot with the state within the given [`soroban_env_host::Host`].
///
/// The ledger info of the host will overwrite the ledger info in the
/// snapshot. The entries in the host's storage will overwrite entries in
/// the snapshot. Existing entries in the snapshot that are untouched by the
/// host will remain.
pub fn update(&mut self, host: &Host) {
#[cfg(feature = "testutils")]
pub fn update(&mut self, host: &soroban_env_host::Host) {
let _result = host.with_ledger_info(|li| {
self.set_ledger_info(li.clone());
Ok(())
Expand Down
4 changes: 2 additions & 2 deletions soroban-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ ctor = { version = "0.2.9", optional = true }
[dev-dependencies]
soroban-sdk-macros = { workspace = true, features = ["testutils"] }
soroban-env-host = { workspace = true, features = ["testutils"] }
soroban-ledger-snapshot = { workspace = true, features = ["testutils"] }
stellar-xdr = { workspace = true, features = ["curr", "std"] }
soroban-spec = { workspace = true }
soroban-ledger-snapshot = { workspace = true }
ed25519-dalek = "2.0.0"
rand = "0.8.5"
ctor = "0.2.9"
Expand All @@ -58,7 +58,7 @@ expect-test = "1.4.1"

[features]
alloc = []
testutils = ["soroban-sdk-macros/testutils", "soroban-env-host/testutils", "dep:ed25519-dalek", "dep:arbitrary", "dep:derive_arbitrary", "dep:ctor", "dep:soroban-ledger-snapshot"]
testutils = ["soroban-sdk-macros/testutils", "soroban-env-host/testutils", "soroban-ledger-snapshot/testutils", "dep:ed25519-dalek", "dep:arbitrary", "dep:derive_arbitrary", "dep:ctor", "dep:soroban-ledger-snapshot"]
hazmat = []
docs = []

Expand Down