-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat(iota-framework): Display object extension #3861
Conversation
SystemDisplayCap
a3b474e
to
fc6bdfa
Compare
1b9d004
to
cff774d
Compare
f4568b5
to
0fa27f6
Compare
crates/iota-framework/packages/iota-system/sources/iota_system_display.move
Outdated
Show resolved
Hide resolved
} | ||
|
||
/// Immutable borrows the value associated with the key in the extra fields. | ||
public(package) fun borrow_extra_field<K: copy + drop + store, V: store>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two questions:
- Can you show me how would you implement a
x_y_z_object_display_exists()
function on the authority state? This will be needed when we introduce creating/updating the displays with endofepoch, and I don't fully see how you'd do this, as it is not simply adoes an object with this ID exists in the state?
type of query. - Assume there is an IotaSystemStateV2. How do you migrate the extra fields? You can't loop over them the way they are currently implemented, no? Would it make sense to use integer indexing so you can iterate over them since you know the bag size? And add some extra resolution table from index to type name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assume there is an IotaSystemStateV2. How do you migrate the extra fields? You can't loop over them the way they are currently implemented, no? Would it make sense to use integer indexing so you can iterate over them since you know the bag size? And add some extra resolution table from index to type name.
We can hardcode the keys in the migration function that should exist at the previous version so this might not be an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great questions:
- I was going to create such a function before marking the PR as ready to review 👍 We should also check if the
Display
of the specific version exists. - The extra fields are migrated just by moving a
Bag
object:
https://github.com/MystenLabs/sui/blob/69d3653419174917d8ffe667f230609970f9a544/crates/sui-framework/packages/sui-system/sources/sui_system_state_inner.move#L283
because all the fields are added asBag
dynamic fields. Migration for each extra field should be done separately if it is required.
ad1d661
to
4860b6f
Compare
c6b5ed2
to
5235500
Compare
aeb0ba0
to
d1a7faf
Compare
d1a7faf
to
8f82d05
Compare
Description of change
TODO
Links to any relevant issues
fixes #3087