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

Improve balance tracking #584

Merged
merged 5 commits into from
Aug 2, 2020
Merged

Improve balance tracking #584

merged 5 commits into from
Aug 2, 2020

Conversation

ben-kaufman
Copy link
Contributor

No description provided.

@@ -47,6 +48,9 @@ export function handleProposalExecuted(
if (ent != null) {
ent.executed = true;
ent.returnValue = event.params._genericCallReturnValue;
if (BigInt.fromI32(0).lt(ent.value)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should it check if the call succeed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well if the call fails the event won't happen in the first place. So I don't think we need to/ can do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

not sure about that as if https://github.com/daostack/arc/blob/master/contracts/controller/Avatar.sol#L58 revert the event will still be emitted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be handle at the Avatar module listen to the handle GenericCall event.
not in the genericScheme

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I changed it

@@ -27,6 +28,12 @@ function handleAvatarBalance(
store.set('AvatarContract', avatar.id, avatar);
}

export function handleGenericCall(event: GenericCall): void {
if (event.params._success) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should it also check if the balance is not 0 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants