-
Notifications
You must be signed in to change notification settings - Fork 12
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
UNI-1316 Borrower/Staker addresses functions #170
base: master
Are you sure you want to change the base?
UNI-1316 Borrower/Staker addresses functions #170
Conversation
UNI-1316 data columns missing from optimism and opgoe members table
Columns Missing:
|
Codecov Report
@@ Coverage Diff @@
## master #170 +/- ##
==========================================
+ Coverage 82.64% 82.90% +0.25%
==========================================
Files 20 20
Lines 922 936 +14
Branches 173 173
==========================================
+ Hits 762 776 +14
Misses 98 98
Partials 62 62
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
function getBorrowerAddresses(address underlying, address account) public view returns (address[] memory) { | ||
IUserManager userManager = IUserManager(marketRegistry.userManagers(underlying)); | ||
|
||
uint256 voucheeCount = userManager.getVoucheeCount(account); | ||
address[] memory addresses = new address[](voucheeCount); | ||
|
||
for (uint256 i = 0; i < voucheeCount; i++) { | ||
(address borrower, ) = userManager.vouchees(account, i); | ||
addresses[i] = borrower; | ||
} | ||
|
||
return addresses; | ||
} |
Check warning
Code scanning / Slither
Unused return Medium
function getStakerAddresses(address underlying, address account) public view returns (address[] memory) { | ||
IUserManager userManager = IUserManager(marketRegistry.userManagers(underlying)); | ||
|
||
uint256 voucherCount = userManager.getVoucherCount(account); | ||
address[] memory addresses = new address[](voucherCount); | ||
|
||
for (uint256 i = 0; i < voucherCount; i++) { | ||
(address staker, , ,) = userManager.vouchers(account, i); | ||
addresses[i] = staker; | ||
} | ||
|
||
return addresses; | ||
} |
Check warning
Code scanning / Slither
Unused return Medium
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.
@0xbarbs How about add some unit tests for the new functions?
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
Adds
getBorrowerAddresses
andgetStakerAddresses
functions to the union lens contractt