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

calc_range_start to cw0 #101

Closed
ethanfrey opened this issue Sep 30, 2020 · 0 comments · Fixed by #102
Closed

calc_range_start to cw0 #101

ethanfrey opened this issue Sep 30, 2020 · 0 comments · Fixed by #102
Assignees

Comments

@ethanfrey
Copy link
Member

We use this a lot of places. Often with HumanAddr. Sometimes with String or u64.

It would be nice to move the simple helpers for &[u8] like data (Vec<u8>, String, CanonicalAddr, HumanAddr) into cw0 so we don't cut and paste so much between contracts for the standard idiom.

I don't think let limit = limit.unwrap_or(DEFAULT_LIMIT).min(MAX_LIMIT) as usize; would benefit from a function, as it could only obscure the logic, and possibly lead to DEFAULT / MAX mixups.

@ethanfrey ethanfrey self-assigned this Sep 30, 2020
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 a pull request may close this issue.

1 participant