Skip to content
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

[BUG] "personal information not registered" flag is set incorrectly with latest_flg == 1 when the data was set null #640

Closed
purplesmoke05 opened this issue Jun 7, 2024 · 0 comments · Fixed by #641
Assignees
Labels
bug Something isn't working

Comments

@purplesmoke05
Copy link
Member

Describe the bug

  • GET: /{token_address}/history/{ledger_id} returns some_personal_info_not_registered flag and it may be set incorrectly when the personal info was modified to null by the issuer.
  • This is because there are some differences of the below two.

# Retrieve personal info
if token_contract.require_personal_info_registered is True:
# Retrieve from contract storage
personal_info = await personal_info_contract.get_info(
account_address, default_value=None
)
if any(personal_info.values()) is False:
personal_info_not_registered = True
else:
personal_info_not_registered = False
else:
# Do not retrieve contract data and return the default value
personal_info = ContractPersonalInfoType().model_dump()
personal_info_not_registered = True
return personal_info, personal_info_not_registered

# Retrieve personal info from contract storage
personal_info_contract = PersonalInfoContract(
issuer=issuer_account,
contract_address=token_contract.personal_info_contract_address,
)
personal_info = await personal_info_contract.get_info(
account_address=account_address, default_value=None
)
personal_info_not_registered = False
return personal_info, personal_info_not_registered

Expected behavior

  • "personal information not registered" flag is set correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant