-
Notifications
You must be signed in to change notification settings - Fork 17
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
fix: minor issues NTRN-402 #43
fix: minor issues NTRN-402 #43
Conversation
68abb6f
to
1dc75d1
Compare
@@ -95,32 +84,25 @@ pub fn execute_update_config( | |||
deps: DepsMut, | |||
info: MessageInfo, | |||
new_credits_contract_address: Option<String>, | |||
new_owner: Option<Admin>, | |||
new_owner: String, |
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.
why did you change Admin
to String
?
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.
long story short: so it's simpler and common
simpler: because it's anyway eventually stored as Addr
in the contract's cfg. just look a bit below at how this value was handled and how it's now handled. Admin
struct is very complicated to be passed, just look at the changes here: https://github.com/neutron-org/neutron/pull/166/files. if we pass Admin::CoreModule
, it simply sets the owner to the sender, so why don't allow sending the simple sender address?
common: another reason is that we have the owner field as String in all other contracts
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.
okay, i prefer to trust you!
|
||
#[error("Invalid vesting denominator")] | ||
InvalidVestingDenominator(String), | ||
#[error("vesting_denominator must be more than zero")] |
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.
more -> greater
@@ -21,10 +22,23 @@ pub struct Config { | |||
/// Address of the security DAO contract | |||
pub security_dao_address: Addr, | |||
|
|||
// Denomintator used int the vesting release function | |||
// Denomintator used in the vesting release function |
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.
Denomintator -> Denominator
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.
LGTM
task: https://p2pvalidator.atlassian.net/browse/NTRN-402
subtask report:
owner
mandatory for the mentioned contracts + for the lockdrop and credits vaults;checked_div
doesn't returnOverflowError
butDivideByZeroError
), so I've added a non-zero check and prettified errors handling;denom
andmin_period
require and what's wrong with thevesting_denominator
validation, so I kept the original validation but moved it to aConfig
struct method and added tests for it. If you have an idea please let me know.relative PRs:
tests run: https://github.com/neutron-org/neutron-tests/actions/runs/4446787903