-
Notifications
You must be signed in to change notification settings - Fork 6
Wip w4 #66
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
base: round5
Are you sure you want to change the base?
Wip w4 #66
Conversation
mevernom
commented
Sep 23, 2024
- chore: add logos from round4 unions
- feat: displayName for players
| * @param newDisplayName - The new display name to set. | ||
| * @returns A transaction object for setting the display name. | ||
| */ | ||
| public async setDisplayName( |
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.
ContractsAPI only calls the contracts to get the data, not handle with the logic of submit transactions.
It is better to directly implement this function in GameManager
| public async setDisplayName( | ||
| playerAddress: EthAddress, | ||
| newDisplayName: string | ||
| ): Promise<Transaction<TxIntent>> { |
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.
please introduce UnconfirmedSetDisplayName
|
|
||
| // Function to set the displayName, accessible only by admin or player themselves | ||
| function setDisplayName(address player, string memory newDisplayName) public onlyAdminOrSelf(player) { | ||
| PlayerProfileStorage storage pps = LibStorage.playerProfileStorage(); |
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.
function pps() internal pure returns (PlayerProfileStorage storage) {
return LibStorage.playerProfileStorage();
}
You can directly use pps()
|
|
||
| // Function to get the displayName for a given player | ||
| function getDisplayName(address player) public view returns (string memory) { | ||
| PlayerProfileStorage storage pps = LibStorage.playerProfileStorage(); |
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.
You can directly use pps() here