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

Implemented verified registry token receiver hook #601

Merged
merged 2 commits into from
Sep 9, 2022

Conversation

anorth
Copy link
Member

@anorth anorth commented Sep 5, 2022

Implements the token receiver hook, which will replace UseBytes (when market updated in #527).

I deleted the UseBytes tests, replacing them with tests for the receiver hook.

Closes #525

@anorth anorth requested a review from ZenGround0 September 5, 2022 04:11
@anorth anorth force-pushed the anorth/verifreg-tokenreceiver branch 4 times, most recently from 505bd59 to 619312c Compare September 7, 2022 08:03
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.

Looking at tests now

actors/verifreg/src/types.rs Outdated Show resolved Hide resolved
actors/verifreg/src/lib.rs Outdated Show resolved Hide resolved
actors/verifreg/src/lib.rs Show resolved Hide resolved
) -> Result<AllocationRequests, ActorError> {
let reqs: AllocationRequests = deserialize(serialized, "allocation requests")?;

let mut allocation_total = StoragePower::zero();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not DataCap? I think I'm missing something fundamental about how you use these types. If you use storage power here we should use it in claim_allocations too

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok changed, but I think we should delete the type now.

.id()
.unwrap();
let code_cid =
rt.get_actor_code_cid(addr).with_context_code(ExitCode::USR_ILLEGAL_ARGUMENT, || {
Copy link
Contributor

Choose a reason for hiding this comment

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

If this was just a bad address wouldn't we already fail on resolve_address? If so this should be ILLEGAL_STATE.

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 see what you mean, but it's not this actor's state that is busted. Basically the runtime is returning nonsensical results. I'll leave it because I don't think ILLEGAL_STATE is better, though I agree this isn't perfect.

actors/verifreg/tests/verifreg_actor_test.rs Outdated Show resolved Hide resolved
actors/verifreg/tests/verifreg_actor_test.rs Show resolved Hide resolved
@anorth anorth force-pushed the anorth/verifreg-tokenreceiver branch from 619312c to e02a793 Compare September 9, 2022 00:50
@anorth anorth force-pushed the anorth/verifreg-tokenreceiver branch from e02a793 to fc62f60 Compare September 9, 2022 00:51
@anorth anorth merged commit 5f944a6 into decouple-fil+ Sep 9, 2022
@anorth anorth deleted the anorth/verifreg-tokenreceiver branch September 9, 2022 01:18
shamb0 pushed a commit to shamb0/builtin-actors that referenced this pull request Jan 31, 2023
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