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

draft: fix: balance calculations and scout-audit warnings #79

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Teolhyn
Copy link
Contributor

@Teolhyn Teolhyn commented Dec 12, 2024

No description provided.

Comment on lines +61 to +63
let admin: Address = e.storage().persistent().get(&LoansDataKey::Admin).unwrap();
admin.require_auth();

Copy link
Contributor

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);
Copy link
Contributor

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

Copy link
Contributor Author

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)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Love it

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