Skip to content

cw20-escrow refactoring: Unify handling of native and cw20#92

Merged
ethanfrey merged 7 commits intomasterfrom
unify-cw20-native
Sep 23, 2020
Merged

cw20-escrow refactoring: Unify handling of native and cw20#92
ethanfrey merged 7 commits intomasterfrom
unify-cw20-native

Conversation

@maurolacy
Copy link
Copy Markdown
Contributor

@maurolacy maurolacy commented Sep 18, 2020

A first iteration on #88.

This can be unified / simplified further, by example by introducing a Cw20Balance type. Or by introducing a generic Coin, that is a wrapper around NativeCoin and Cw20Coin. But, better leave those for another task / PR.

I'm not so happy with some of the trade-offs here. Like using a tuple type for the escrow balance. I also couldn't avoid code repetition in some parts, due to the structural differences between a Coin and a Cw20Coin. Maybe wrapping everything into a generic Coin is a good idea?

@maurolacy maurolacy requested a review from ethanfrey September 18, 2020 20:45
@maurolacy maurolacy self-assigned this Sep 18, 2020
Copy link
Copy Markdown
Contributor

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

Nice integration and ideas.

Added some comments to clean it up a bit more.

Copy link
Copy Markdown
Contributor

@ethanfrey ethanfrey 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, merging.

Left some comment on a few style nitpicks, things for the future

@ethanfrey ethanfrey merged commit b86cb8e into master Sep 23, 2020
@ethanfrey ethanfrey deleted the unify-cw20-native branch September 23, 2020 21:15
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.

2 participants