-
Notifications
You must be signed in to change notification settings - Fork 161
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
Market actor implementation #338
Conversation
CI is broken because you reverted the submodule changes after you merged in commit 5c6ccee To fix either undo that commit, or just cd into that submodule and do a git pull (pretty sure the latter should work if you commit the change, but it may not if you have the submodule cached locally) |
vm/actor/src/builtin/market/mod.rs
Outdated
let epoch_value = params | ||
.sector_expiry | ||
.checked_sub(rt.curr_epoch()) | ||
.ok_or_else(|| { | ||
ActorError::new( | ||
ExitCode::ErrIllegalArgument, | ||
format!( | ||
"invalid sector expiry epoch {:?} ahead of current {:?}", | ||
params.sector_expiry, | ||
rt.curr_epoch() | ||
), | ||
) | ||
})?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this may sound weird, but you actually need to do
.checked_sub(..).unwrap_or(1u8)
lol
I thought through the logic and their impl doesn't error when this value is negative, so this needs to succeed, divide 0 by a valid number and return successfully and/or panic on a divide by 0
Summary of changes
Changes introduced in this pull request:
Reference issue to close (if applicable)
Closes #264
Other information and links