-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Example] Added the Knight token object example #8489
Conversation
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.
Looking really good! Just a few comments
aptos-move/move-examples/token_objects/knight/sources/knight.move
Outdated
Show resolved
Hide resolved
aptos-move/move-examples/token_objects/knight/sources/knight.move
Outdated
Show resolved
Hide resolved
aptos-move/move-examples/token_objects/knight/sources/knight.move
Outdated
Show resolved
Hide resolved
aptos-move/move-examples/token_objects/knight/sources/knight.move
Outdated
Show resolved
Hide resolved
aptos-move/move-examples/token_objects/knight/sources/knight.move
Outdated
Show resolved
Hide resolved
aptos-move/move-examples/token_objects/knight/sources/knight.move
Outdated
Show resolved
Hide resolved
aptos-move/move-examples/token_objects/knight/sources/knight.move
Outdated
Show resolved
Hide resolved
aptos-move/move-examples/token_objects/knight/sources/knight.move
Outdated
Show resolved
Hide resolved
aptos-move/move-examples/token_objects/knight/sources/knight.move
Outdated
Show resolved
Hide resolved
aptos-move/move-examples/token_objects/knight/sources/knight.move
Outdated
Show resolved
Hide resolved
aptos-move/move-examples/token_objects/knight/sources/knight.move
Outdated
Show resolved
Hide resolved
aptos-move/move-examples/token_objects/knight/sources/knight.move
Outdated
Show resolved
Hide resolved
c6ee4a2
to
eb438b9
Compare
// Gets `property_mutator_ref` to update the health point and condition in the property map. | ||
let property_mutator_ref = &knight.property_mutator_ref; | ||
// Updates the health point in the property map. | ||
property_map::update_typed(property_mutator_ref, &string::utf8(HEALTH_POINT_PROPERTY_NAME), new_health_point); |
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.
What's the purpose behind duplicating the health value into a property map and in the HealthToken
resource on the knight token object? I think I am missing the original context of doing it this way, so was just wondering
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.
It's duplicated in the property map so that the wallet recognizes and displays it as a property. Currently, only the entries in the property map appear in Petra, not the Move resources.
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.
Besides @xbtmatt's comment, looks good to me!
aptos-move/move-examples/token_objects/knight/sources/food.move
Outdated
Show resolved
Hide resolved
eb438b9
to
dcda8ff
Compare
This module implements the knight token (non-fungible token) and the food tokens (fungible token). This module has the function to feed a knight token with food tokens to increase the knight's health point.
dcda8ff
to
3bb4505
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
This module implements the knight token (non-fungible token) and the food tokens (fungible token). This module has the function to feed a knight token with food tokens to increase the knight's health point.
This module implements the knight token (non-fungible token) and the food tokens (fungible token). This module has the function to feed a knight token with food tokens to increase the knight's health point.
This module implements the knight token (non-fungible token) and the food tokens (fungible token). This module has the function to feed a knight token with food tokens to increase the knight's health point.
This module implements the knight token (non-fungible token) and the food tokens (fungible token). This module has the function to feed a knight token with food tokens to increase the knight's health point.
This module implements the knight token (non-fungible token) and the food tokens (fungible token). This module has the function to feed a knight token with food tokens to increase the knight's health point.
Description
This module implements the knight token (non-fungible token) and the food tokens (fungible token). This module has the function to feed a knight token with food tokens to increase the knight's health point.
Test Plan
aptos move test