Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.

add account status endpoint#7

Open
liorama wants to merge 55 commits intomasterfrom
lior/ecosystem
Open

add account status endpoint#7
liorama wants to merge 55 commits intomasterfrom
lior/ecosystem

Conversation

@liorama
Copy link

@liorama liorama commented Mar 25, 2019

No description provided.

@liorama liorama requested a review from doodyparizada March 25, 2019 15:31
@liorama liorama force-pushed the lior/ecosystem branch 2 times, most recently from d337bbb to 6c9491d Compare March 25, 2019 16:04
@doodyparizada
Copy link

LGTM, but why is travis failing?

src/app.py Outdated
raise MigrationErrors.AccountNotBurnedError(account_address)
logger.info(f'Verified that account {account_address} is burned')

account_data = get_account_data(account_address)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liorama There is some duplication here, as now is_burned is also calling horizon for the account_data.

src/helpers.py Outdated
if not is_valid_address(account_address):
raise MigrationErrors.AddressInvalidError(account_address)

account_data = get_account_data(account_address)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liorama @Ronserruya Didn't we want to also test that the trust limit has changed to the current kin balance? To make sure the user can't receive more KIN?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Burning and setting the balance is 1 transaction so if you burn you always set the balance.
In any case it doesn't matter, once the account is burned we migrate it, it is not like he can set his limit now and ask again since he already burned his account

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you just burn without setting the limit someone can use P2P to send your address KIN which will then be lost.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but I mean that the code on the client sends both ops in one tx, so its not like you can burn without setting the limit.

Copy link

@chancity chancity Apr 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ronserruya @doodyparizada a client without the KIN asset will fail to retrieve it's KIN balance and I assume an exception is thrown when this occurs. This will inevitable cause burning the wallet to fail because both ops are sent in a single transaction.

These condition may already be accounted (or required to be) for on android/ios client but I wanted to give my thoughts on it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chancity When a client doesn't have the kin asset, he doesn't go through migration, the client just starts on the new blockchain

def error_handle(exception: Exception):
# Log the exception and return an internal server error
logger.error(f'Unexpected exception: {str(exception)}')
logger.exception(f'Unexpected exception: {str(exception)}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger.exception adds the stacktrace of the last exception raised. What if some other exception is raised before getting to this method?

Wouldn't it be better to use

logger.exception(f'Unexpected exception: {str(exception)}', exc_info=exception)

To specifiy what exception you want the stack trace of?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error handler will be invoked on any exception that was thrown and not caught, I think this is the stacktrace I want to see.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants