Skip to content

Commit

Permalink
[indexer-alt] Support consensus v2 objects in obj-info (#20826)
Browse files Browse the repository at this point in the history
## Description 

Describe the changes or additions included in this PR.

## Test plan 

This will be tested together in
#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:
  • Loading branch information
lxfind authored Jan 9, 2025
1 parent 0c3711f commit dc88b02
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/sui-indexer-alt-schema/src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit dc88b02

Please sign in to comment.