-
Notifications
You must be signed in to change notification settings - Fork 144
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 market actor publish_storage_deals #1327
Conversation
vm/actor/src/builtin/market/mod.rs
Outdated
let mut msm = state.mutator(store); | ||
msm.with_pending_proposals(Permission::ReadOnly); | ||
msm.with_escrow_table(Permission::ReadOnly); | ||
msm.with_locked_table(Permission::ReadOnly); |
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.
Not tested but pretty sure you can chain withs like this:
let msm = state.mutator(store)
.with_pending_proposals(Permission::ReadOnly)
.with_escrow_table(Permission::ReadOnly)
.with_locked_table(Permission::ReadOnly);
This would allow msm
binding staying immutable.
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.
hm, i get an error when i try that:
error[E0716]: temporary value dropped while borrowed
--> vm/actor/src/builtin/market/mod.rs:268:23
|
268 | let msm = state.mutator(store)
| ^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
...
271 | .with_locked_table(Permission::ReadOnly);
| - temporary value is freed at the end of this statement
...
319 | let client_balance_ok = msm
| _____________________________________-
320 | | .balance_covered(client, total_client_lockup.get(&client).unwrap())
| |___________________________________________________________________________________- borrow later used here
|
= note: consider using a `let` binding to create a longer lived value
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.
There are places like here where withs are chained but then a build
is used. Not sure at all if we need this.
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.
oh nice, yeah updated!
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.
lgtm
Summary of changes
Changes introduced in this pull request:
Reference issue to close (if applicable)
Closes n/a
Other information and links