-
Notifications
You must be signed in to change notification settings - Fork 341
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
Conditional migrate call with extra MigrateInfo argument after contract update #2212
Conversation
6fef09a
to
ef3da24
Compare
92ee454
to
6ecd9a6
Compare
32fd38b
to
d0356bc
Compare
d0356bc
to
f6ffb68
Compare
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.
👍
25d378b
to
f15c71c
Compare
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.
Nice
e19ee2c
to
a24f2c0
Compare
b85cbe5
to
0b589db
Compare
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.
Looks good, just one small request from my side.
0b589db
to
2618bd9
Compare
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.
Looks good to me now! Nice work!
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.
Beautiful. Just a CHANGELOG.md entry missing
Err(err) | ||
} | ||
}) | ||
} |
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.
Yeah, exactly – this is super nice. All users of cosmwasm-vm can benefit from the feature now and we have strong typing
packages/vm/src/environment.rs
Outdated
@@ -272,6 +272,10 @@ impl<A: BackendApi, S: Storage, Q: Querier> Environment<A, S, Q> { | |||
let func = instance.exports.get_function(name)?; | |||
Ok(func.clone()) | |||
})?; | |||
let function_arity = func.param_arity(store); | |||
if args.len() != function_arity { | |||
return Err(VmError::function_arity_mismatch()); |
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 would add function arity and number of args as additional info fields to the error for the sake of debugability when something unexpected happens. But this is nice to have and not needed for the feature.
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.
Done
Forgot one more thing: Can you add a CHANGELOG entry for this? (rebase on main before that, since I just merged another PR) |
2618bd9
to
c09d19e
Compare
a02a90e
to
53643a3
Compare
No description provided.