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

Fix RemoveExpiredAllocations to refund datacap to the client #607

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

anorth
Copy link
Member

@anorth anorth commented Sep 6, 2022

No description provided.

Copy link
Contributor

@ZenGround0 ZenGround0 left a comment

Choose a reason for hiding this comment

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

LGTM

ret_gen.add_fail(ExitCode::USR_FORBIDDEN);
info!("cannot revoke allocation {} that has not expired", alloc_id);
continue;
recovered_datacap += alloc.size.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: DataCap::from(alloc)

Copy link
Member Author

Choose a reason for hiding this comment

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

I deleted that From impl, it was too odd for me. We could do with some nicer accessors on PaddedPieceSize though.

let alloc1 = make_alloc(1, provider);
let alloc2 = make_alloc(2, provider);
let alloc3 = make_alloc(3, provider);
let alloc1 = make_alloc(1, &CLIENT, &provider, 128);
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@anorth anorth merged commit bbc82b6 into decouple-fil+ Sep 7, 2022
@anorth anorth deleted the anorth/alloc-tokens branch September 7, 2022 03:47
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