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

Add cw4 hooks #156

Merged
merged 9 commits into from
Dec 6, 2020
Merged

Add cw4 hooks #156

merged 9 commits into from
Dec 6, 2020

Conversation

ethanfrey
Copy link
Member

@ethanfrey ethanfrey commented Dec 4, 2020

Closes #140

  • Update cw4 spec
  • Update cw4-group implementation
  • Test implementation
  • Update READMEs

@ethanfrey ethanfrey marked this pull request as ready for review December 4, 2020 21:50
@ethanfrey ethanfrey requested a review from maurolacy December 4, 2020 21:57
Copy link
Contributor

@maurolacy maurolacy left a comment

Choose a reason for hiding this comment

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

lgtm.

packages/cw4/src/hook.rs Show resolved Hide resolved
Comment on lines +93 to +97
let mut ctx = Context::new();
for h in HOOKS.may_load(deps.storage)?.unwrap_or_default() {
let msg = diff.clone().into_cosmos_msg(h)?;
ctx.add_message(msg);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, this would be similar to creating a msgs which is a Vec<CosmosMsg>, and attaching it to a HandleResponse.

Copy link
Member Author

Choose a reason for hiding this comment

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

Exactly, the Context was made to make that look a bit nicer.
Jury still a bit out if it is better, but happy for opinions.

Copy link
Contributor

@maurolacy maurolacy Dec 7, 2020

Choose a reason for hiding this comment

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

Maybe it's because I'm just used to it, but I like the other variant better.

contracts/cw4-group/src/contract.rs Show resolved Hide resolved
contracts/cw4-group/src/contract.rs Outdated Show resolved Hide resolved
contracts/cw4-group/src/contract.rs Show resolved Hide resolved
Co-authored-by: Mauro Lacy <maurolacy@users.noreply.github.com>
@ethanfrey ethanfrey merged commit ae587a1 into master Dec 6, 2020
@ethanfrey ethanfrey deleted the add-cw4-hooks branch December 6, 2020 21:07
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.

Add listeners to cw4-group (and cw4?)
2 participants