Skip to content

Commit

Permalink
types: add helper ObjectInfo::from_object
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed Jun 12, 2024
1 parent 76d4852 commit 078b075
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/sui-types/src/base_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,17 @@ impl ObjectInfo {
previous_transaction: o.previous_transaction,
}
}

pub fn from_object(object: &Object) -> Self {
Self {
object_id: object.id(),
version: object.version(),
digest: object.digest(),
type_: object.into(),
owner: object.owner,
previous_transaction: object.previous_transaction,
}
}
}
const PACKAGE: &str = "package";
impl ObjectType {
Expand Down

0 comments on commit 078b075

Please sign in to comment.