Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bcs field to Checkpoint #20340

Merged
merged 7 commits into from
Nov 22, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix changes
  • Loading branch information
stefan-mysten committed Nov 20, 2024
commit 21dfec1343ff111ef71eec93e7f5bfb964ef4f25
7 changes: 3 additions & 4 deletions crates/sui-graphql-rpc/src/types/checkpoint.rs
Original file line number Diff line number Diff line change
@@ -351,7 +351,6 @@ impl Checkpoint {
checkpoint_viewed_at: u64,
) -> Result<Connection<String, Checkpoint>, Error> {
use checkpoints::dsl;

let cursor_viewed_at = page.validate_cursor_consistency()?;
let checkpoint_viewed_at = cursor_viewed_at.unwrap_or(checkpoint_viewed_at);

@@ -512,7 +511,7 @@ impl Loader<DigestKey> for Db {
.await
.map_err(|e| Error::Internal(format!("Failed to fetch checkpoints: {e}")))?;

let checkpoint_ids: BTreeMap<_, _> = checkpoints
let checkpoint_id_to_stored: BTreeMap<_, _> = checkpoints
.into_iter()
.map(|stored| (stored.checkpoint_digest.clone(), stored))
.collect();
@@ -525,9 +524,9 @@ impl Loader<DigestKey> for Db {
checkpoint_viewed_at,
} = *key;

let stored = checkpoint_ids.get(digest.as_slice()).cloned()?;
let stored = checkpoint_id_to_stored.get(digest.as_slice()).cloned()?;
let checkpoint = Checkpoint {
stored: stored.clone(),
stored,
checkpoint_viewed_at,
};