@gearbox-protocol/periphery-v3 1.3.17 → 1.3.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -127,13 +127,10 @@ contract DataCompressorV3 is IDataCompressorV3, ContractsRegisterTrait, LinearIn
127
127
  uint256 len = creditManagers.length;
128
128
  unchecked {
129
129
  for (uint256 op = COUNT; op <= QUERY; ++op) {
130
- if (op == QUERY && index == 0) {
131
- break;
132
- } else {
133
- result = new CreditAccountData[](index);
134
- index = 0;
135
- }
130
+ if (op == QUERY && index == 0) break;
136
131
 
132
+ result = new CreditAccountData[](index);
133
+ index = 0;
137
134
  for (uint256 i = 0; i < len; ++i) {
138
135
  address _cm = creditManagers[i];
139
136
 
@@ -141,18 +138,20 @@ contract DataCompressorV3 is IDataCompressorV3, ContractsRegisterTrait, LinearIn
141
138
  address[] memory creditAccounts = ICreditManagerV3(_cm).creditAccounts();
142
139
  uint256 caLen = creditAccounts.length;
143
140
  for (uint256 j; j < caLen; ++j) {
144
- if (
145
- (borrower == address(0) || _getBorrowerOrRevert(_cm, creditAccounts[j]) == borrower)
146
- && (
147
- !liquidatableOnly
148
- || ICreditManagerV3(_cm).isLiquidatable(creditAccounts[j], PERCENTAGE_FACTOR)
149
- )
150
- ) {
151
- if (op == QUERY) {
152
- result[index] = _getCreditAccountData(_cm, creditAccounts[j]);
153
- }
154
- ++index;
141
+ if (borrower != address(0) && borrower != _getBorrowerOrRevert(_cm, creditAccounts[j])) {
142
+ continue;
143
+ }
144
+
145
+ if (liquidatableOnly) {
146
+ try ICreditManagerV3(_cm).isLiquidatable(creditAccounts[j], PERCENTAGE_FACTOR) returns (
147
+ bool isLiquidatable
148
+ ) {
149
+ if (!isLiquidatable) continue;
150
+ } catch {}
155
151
  }
152
+
153
+ if (op == QUERY) result[index] = _getCreditAccountData(_cm, creditAccounts[j]);
154
+ ++index;
156
155
  }
157
156
  }
158
157
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/periphery-v3",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "main": "index.js",
5
5
  "repository": "git@github.com:Gearbox-protocol/periphery-v3.git",
6
6
  "author": "Mikael <26343374+0xmikko@users.noreply.github.com>",