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

[indexer-alt] Add tests for obj_info pruner #20809

Open
wants to merge 2 commits into
base: xun/indexer-alt-obj-info-support-consensus-v2
Choose a base branch
from

Conversation

lxfind
Copy link
Contributor

@lxfind lxfind commented Jan 7, 2025

Description

Describe the changes or additions included in this PR.

Test plan

How did you test the new or updated feature?


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

Copy link

vercel bot commented Jan 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 9, 2025 0:25am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Jan 9, 2025 0:25am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Jan 9, 2025 0:25am
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Jan 9, 2025 0:25am

@lxfind lxfind marked this pull request as ready for review January 7, 2025 19:25
@lxfind lxfind temporarily deployed to sui-typescript-aws-kms-test-env January 7, 2025 19:25 — with GitHub Actions Inactive
@lxfind lxfind temporarily deployed to sui-typescript-aws-kms-test-env January 7, 2025 19:25 — with GitHub Actions Inactive
@lxfind lxfind requested review from wlmyng and amnn January 7, 2025 19:25
@lxfind lxfind force-pushed the xun/indexer-alt-obj-info-pruner-tests branch from 3933a24 to 9cedb9c Compare January 8, 2025 02:49
@lxfind lxfind temporarily deployed to sui-typescript-aws-kms-test-env January 8, 2025 02:49 — with GitHub Actions Inactive
Copy link
Contributor

@wlmyng wlmyng left a comment

Choose a reason for hiding this comment

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

tests look good to me, just a question about integration testing

crates/sui-indexer-alt/src/handlers/obj_info.rs Outdated Show resolved Hide resolved
@lxfind lxfind force-pushed the xun/indexer-alt-obj-info-pruner-tests branch from 9cedb9c to 0d5e0a2 Compare January 9, 2025 00:21
@lxfind lxfind temporarily deployed to sui-typescript-aws-kms-test-env January 9, 2025 00:21 — with GitHub Actions Inactive
@lxfind lxfind changed the base branch from main to xun/indexer-alt-obj-info-support-consensus-v2 January 9, 2025 00:21
Copy link
Contributor

@wlmyng wlmyng left a comment

Choose a reason for hiding this comment

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

Lgtm, some minor comments

@@ -216,11 +254,31 @@ mod tests {
let result = obj_info.process(&Arc::new(checkpoint3)).unwrap();
assert_eq!(result.len(), 1);
let processed = &result[0];
assert_eq!(processed.cp_sequence_number, 3);
assert_eq!(processed.cp_sequence_number, 2);
Copy link
Contributor

Choose a reason for hiding this comment

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

noob q but how come this isn't 3, since the transfer object occurs in checkpoint 3 and qualifies to be inserted into values/processed?

Copy link
Contributor

Choose a reason for hiding this comment

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

ah the checkpoint builder starts from 0

#[test]
fn test_process_wrap() {
#[tokio::test]
async fn test_process_wrap() {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice test

#[test]
fn test_process_object_owned_object() {
#[tokio::test]
async fn test_process_object_owned_object() {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we also add a pruning component to this test?

#[test]
fn test_process_consensus_v2_object() {
#[tokio::test]
async fn test_process_consensus_v2_object() {
Copy link
Contributor

Choose a reason for hiding this comment

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

and same here - i think the result is the first entry gets pruned right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants