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

Upgrade fungible token library. Use standard exit codes. Use standard token method params/return types. #580

Merged
merged 2 commits into from
Aug 28, 2022

Conversation

anorth
Copy link
Member

@anorth anorth commented Aug 26, 2022

Updates to latest main commit on the token library branch.

The token receiver flow is a little awkward, the library has plans to improve this.

Closes #534. Closes #535.
FYI @alexytsu @abright

@anorth anorth requested a review from ZenGround0 August 26, 2022 05:49
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

Token::with(msg.rt.store(), &msg, &mut st.token, DATACAP_GRANULARITY, |token| {
token.allowance(&params.owner, &params.operator).exit_code(ExitCode::USR_UNSPECIFIED)
})
let token = Token::wrap(msg.rt.store(), &msg, DATACAP_GRANULARITY, &mut st.token);
Copy link
Contributor

Choose a reason for hiding this comment

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

Getting a wrapped token might be a candidate for a state function.

Copy link
Member Author

Choose a reason for hiding this comment

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

The lifetimes were tricky to deal with, but I managed to get just this line out to a helper function. I would like to get the Messenger out too, but don't know how to manage its lifetime.

actors/datacap/src/lib.rs Outdated Show resolved Hide resolved
@anorth anorth merged commit fef6314 into decouple-fil+ Aug 28, 2022
@anorth anorth deleted the anorth/tokenlib branch August 28, 2022 23:15
anorth added a commit that referenced this pull request Aug 28, 2022
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