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

Conditional migrate call with extra MigrateInfo argument after contract update #2212

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

kulikthebird
Copy link
Contributor

No description provided.

@kulikthebird kulikthebird force-pushed the tkulik/conditional_migrate branch 2 times, most recently from 92ee454 to 6ecd9a6 Compare August 14, 2024 14:32
@kulikthebird kulikthebird marked this pull request as ready for review August 14, 2024 14:33
@kulikthebird kulikthebird force-pushed the tkulik/conditional_migrate branch 2 times, most recently from 32fd38b to d0356bc Compare August 20, 2024 14:11
Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

👍

packages/std/src/types.rs Show resolved Hide resolved
packages/std/src/types.rs Outdated Show resolved Hide resolved
packages/std/src/types.rs Show resolved Hide resolved
packages/vm/src/calls.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@chipshort chipshort left a comment

Choose a reason for hiding this comment

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

Nice

packages/std/src/exports.rs Outdated Show resolved Hide resolved
packages/std/src/types.rs Show resolved Hide resolved
@kulikthebird kulikthebird force-pushed the tkulik/conditional_migrate branch 5 times, most recently from e19ee2c to a24f2c0 Compare August 29, 2024 14:37
@kulikthebird kulikthebird force-pushed the tkulik/conditional_migrate branch 3 times, most recently from b85cbe5 to 0b589db Compare September 2, 2024 12:57
Copy link
Collaborator

@chipshort chipshort left a 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.

packages/derive/src/lib.rs Show resolved Hide resolved
packages/vm/src/calls.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@chipshort chipshort left a 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!

Copy link
Member

@webmaster128 webmaster128 left a 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)
}
})
}
Copy link
Member

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

@@ -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());
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@chipshort
Copy link
Collaborator

Forgot one more thing: Can you add a CHANGELOG entry for this? (rebase on main before that, since I just merged another PR)

@kulikthebird kulikthebird merged commit 3a60939 into main Sep 5, 2024
32 checks passed
@kulikthebird kulikthebird deleted the tkulik/conditional_migrate branch September 5, 2024 09:40
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.

Conditional migrate call with extra MigrateInfo argument after contract update
3 participants