From dc88b0265ee849c0453a75c588c6d843a1f6388b Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 9 Jan 2025 07:40:06 -0800 Subject: [PATCH] [indexer-alt] Support consensus v2 objects in obj-info (#20826) ## Description Describe the changes or additions included in this PR. ## Test plan This will be tested together in https://github.com/MystenLabs/sui/pull/20809 --- ## 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: --- crates/sui-indexer-alt-schema/src/objects.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/sui-indexer-alt-schema/src/objects.rs b/crates/sui-indexer-alt-schema/src/objects.rs index 849960d86de78..751431ca97ac4 100644 --- a/crates/sui-indexer-alt-schema/src/objects.rs +++ b/crates/sui-indexer-alt-schema/src/objects.rs @@ -85,14 +85,20 @@ impl StoredObjInfo { Owner::ObjectOwner(_) => StoredOwnerKind::Object, Owner::Shared { .. } => StoredOwnerKind::Shared, Owner::Immutable => StoredOwnerKind::Immutable, - Owner::ConsensusV2 { .. } => todo!(), + // We do not distinguish between fastpath owned and consensus v2 owned + // objects. Also we only support single owner for now. + // In the future, if we support more sophisticated authenticator, + // this will be changed. + Owner::ConsensusV2 { .. } => StoredOwnerKind::Address, }), owner_id: match object.owner() { Owner::AddressOwner(a) => Some(a.to_vec()), Owner::ObjectOwner(o) => Some(o.to_vec()), Owner::Shared { .. } | Owner::Immutable { .. } => None, - Owner::ConsensusV2 { .. } => todo!(), + Owner::ConsensusV2 { authenticator, .. } => { + Some(authenticator.as_single_owner().to_vec()) + } }, package: type_.map(|t| t.address().to_vec()),