Skip to content

Commit

Permalink
Adapt SnapshotSource interface
Browse files Browse the repository at this point in the history
  • Loading branch information
jayz22 committed Mar 6, 2023
1 parent 040a29c commit af12bcb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions src/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ rustc-simple-version = "0.1.0"
[dependencies.soroban-env-host]
version = "0.0.14"
git = "https://github.com/stellar/rs-soroban-env"
rev = "d06aaddca61f011cc64ec098b464233423197c3a"
rev = "5695440da452837555d8f7f259cc33341fdf07b0"
features = ["vm"]

[dependencies.soroban-test-wasms]
git = "https://github.com/stellar/rs-soroban-env"
rev = "d06aaddca61f011cc64ec098b464233423197c3a"
rev = "5695440da452837555d8f7f259cc33341fdf07b0"
10 changes: 5 additions & 5 deletions src/rust/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,14 +383,14 @@ impl Pfc {
}

impl SnapshotSource for Pfc {
fn get(&self, key: &LedgerKey) -> Result<LedgerEntry, HostError> {
let kv = xdr_to_vec_u8(key)?;
fn get(&self, key: &Rc<LedgerKey>) -> Result<Rc<LedgerEntry>, HostError> {
let kv = xdr_to_vec_u8(key.as_ref())?;
let lev = self.with_cb(|cb| cb.get_ledger_entry(&kv))?;
xdr_from_cxx_buf(&lev)
xdr_from_cxx_buf(&lev).map(|le| Rc::new(le))
}

fn has(&self, key: &LedgerKey) -> Result<bool, HostError> {
let kv = xdr_to_vec_u8(key)?;
fn has(&self, key: &Rc<LedgerKey>) -> Result<bool, HostError> {
let kv = xdr_to_vec_u8(key.as_ref())?;
self.with_cb(|cb| cb.has_ledger_entry(&kv))
}
}
Expand Down

5 comments on commit af12bcb

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from sisuresh
at jayz22@af12bcb

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging jayz22/stellar-core/storage-interface = af12bcb into auto

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jayz22/stellar-core/storage-interface = af12bcb merged ok, testing candidate = f94d660

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = f94d660

Please sign in to comment.