-
Notifications
You must be signed in to change notification settings - Fork 1
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
draft: fix: balance calculations and scout-audit warnings #79
base: main
Are you sure you want to change the base?
Conversation
let admin: Address = e.storage().persistent().get(&LoansDataKey::Admin).unwrap(); | ||
admin.require_auth(); | ||
|
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.
Maybe that deploy pool test fails because the test doesn't init the manager like it should? This could probably be fixed by e.mock_all_auths()
in that deploy_pool test.
new_manager_wasm_hash: BytesN<32>, | ||
new_pool_wasm_hash: BytesN<32>, | ||
) -> Result<(), Error> { | ||
let admin: Option<Address> = e.storage().persistent().get(&LoansDataKey::Admin); |
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.
If we have option values in variables like this, I think we should standardize our naming so the option-wrapper variable is named opt_admin
and the unwrapper data is admin
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.
As it's already returning Return type I'll just switch the if let Some to '?'
pub fn upgrade(e: Env, new_wasm_hash: BytesN<32>) { | ||
let loan_manager_addr = pool::read_loan_manager_addr(&e); | ||
pub fn upgrade(e: Env, new_wasm_hash: BytesN<32>) -> Result<(), Error> { | ||
let loan_manager_addr = pool::read_loan_manager_addr(&e)?; |
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.
Love it
No description provided.