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

Treasury #NTRN-286 #9

Merged
merged 36 commits into from
Dec 15, 2022
Merged

Treasury #NTRN-286 #9

merged 36 commits into from
Dec 15, 2022

Conversation

ratik
Copy link
Contributor

@ratik ratik commented Dec 2, 2022

@ratik ratik changed the title Treasury Treasury #NTRN-286 Dec 6, 2022
@ratik ratik marked this pull request as ready for review December 6, 2022 21:53
contracts/distribution/src/contract.rs Outdated Show resolved Hide resolved
contracts/distribution/src/contract.rs Outdated Show resolved Hide resolved
contracts/distribution/src/contract.rs Outdated Show resolved Hide resolved
contracts/distribution/src/contract.rs Outdated Show resolved Hide resolved
contracts/distribution/src/contract.rs Outdated Show resolved Hide resolved
contracts/distribution/src/contract.rs Outdated Show resolved Hide resolved
contracts/distribution/src/contract.rs Outdated Show resolved Hide resolved
zavgorodnii
zavgorodnii previously approved these changes Dec 13, 2022
@foxpy
Copy link
Contributor

foxpy commented Dec 13, 2022

@ratik good job! I would like to approve your PR, but there are still three threads open from my side, let's resolve them?

@ratik ratik requested review from foxpy and zavgorodnii December 13, 2022 13:11
foxpy
foxpy previously approved these changes Dec 13, 2022
pub owner: String,
pub denom: String,
/// Distribution rate in percent (0-100) which goes to distribution contract
pub distribution_rate: u8,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not Decimal type? It's easier to do some math stuff

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dunno, just matter of taste. As for me 30(%) looks more readable than 0.3

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but if you insist I'm happy to change it

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd change it to Decimal because:

  • Decimal is commonly used for some rate variables in cw contracts, that's why it was my first question for the PR :)
  • built-in math methods for percentage calculations;
  • more readable (but not for you 🙃 )

Wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, np. changed to Decimal

contracts/treasury/src/contract.rs Outdated Show resolved Hide resolved
contracts/treasury/src/contract.rs Outdated Show resolved Hide resolved
@quasisamurai quasisamurai self-requested a review December 14, 2022 11:38
contracts/distribution/src/contract.rs Outdated Show resolved Hide resolved
contracts/distribution/src/contract.rs Outdated Show resolved Hide resolved
contracts/distribution/src/contract.rs Outdated Show resolved Hide resolved
@ratik ratik requested review from pr0n00gler and foxpy December 14, 2022 15:24
contracts/distribution/Cargo.toml Outdated Show resolved Hide resolved
contracts/reserve/Cargo.toml Outdated Show resolved Hide resolved
contracts/treasury/Cargo.toml Outdated Show resolved Hide resolved
Copy link
Collaborator

@pr0n00gler pr0n00gler left a comment

Choose a reason for hiding this comment

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

Would be nice to have comments for some core methods of contracts: for example execute_fund in the distribution contract would be easier to read if the method was covered with comments.

The same about constants in state.rs files: I think it's better to have a small description for such constants.

@ratik ratik requested a review from pr0n00gler December 14, 2022 22:21
@zavgorodnii zavgorodnii merged commit cd382ef into main Dec 15, 2022
@albertandrejev albertandrejev deleted the feat/treasury branch December 16, 2022 08:58
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.

4 participants