Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ jobs:
- name: Build
uses: ./.github/actions/setup

# test:
# name: Test
# needs: lint
# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v4

# - name: Run Tests
# uses: ./.github/actions/tests
# with:
# environment: 'staging'
# private_key: ${{ secrets.PRIVATE_KEY }}
test:
name: Test
needs: lint
runs-on: ubuntu-latest
continue-on-error: true

steps:
- uses: actions/checkout@v4

- name: Run Tests
uses: ./.github/actions/tests
with:
environment: 'staging'
private_key: ${{ secrets.PRIVATE_KEY }}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"test:react": "vitest --project react",
"test:borrow": "vitest --project client packages/client/src/actions/borrow.test.ts",
"test:vaultDeploy": "vitest --project client packages/client/src/actions/vaultDeploy.test.ts",
"test:856": "vitest --project client packages/client/src/actions/eMode.test.ts -t 'Then they should be able to disable it at any time'",
"test:857": "vitest --project client packages/client/src/actions/eMode.test.ts -t \"Then the market's reserves should have user state that reflects the selected E-Mode category settings\"",
"test:858": "vitest --project client packages/client/src/actions/eMode.test.ts -t \"Then any user supply position that are not included in the E-Mode category should not be able to be used as collateral\"",
"test:withdraw": "vitest --project client packages/client/src/actions/withdraw.test.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/actions/eMode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
(r) => r.underlyingToken.address === reserve.underlyingToken.address,
);

expect(reserve).toMatchObject({

Check failure on line 70 in packages/client/src/actions/eMode.test.ts

View workflow job for this annotation

GitHub Actions / Verify / Test

packages/client/src/actions/eMode.test.ts > Given an Aave Market > When a user enables an E-Mode category for the given market > Then the market's reserves should have user state that reflects the selected E-Mode category settings

AssertionError: expected { __typename: 'Reserve', …(16) } to match object { userState: ObjectContaining{…} } (106 matching properties omitted from actual) - Expected + Received { - "userState": ObjectContaining { + "userState": { + "__typename": "ReserveUserState", + "balance": { + "__typename": "TokenAmount", + "amount": { + "__typename": "DecimalValue", + "decimals": 18, + "raw": "0", + "value": "0", + }, + "usd": "0", + "usdPerToken": "0.3024919", + }, + "borrowable": { + "__typename": "TokenAmount", + "amount": { + "__typename": "DecimalValue", + "decimals": 18, + "raw": "0", + "value": "0", + }, + "usd": "0", + "usdPerToken": "0.3024919", + }, "canBeBorrowed": false, - "canBeCollateral": false, + "canBeCollateral": true, + "emode": { + "__typename": "EmodeReserveInfo", + "canBeBorrowed": true, + "canBeCollateral": true, + "categoryId": 1, + "label": "ETH correlated", + "liquidationPenalty": { + "__typename": "DecimalValue", + "decimals": 4, + "raw": "100", + "value": "0.01", + }, + "liquidationThreshold": { + "__typename": "DecimalValue", + "decimals": 4, + "raw": "9500", + "value": "0.95", + }, + "maxLTV": { + "__typename": "DecimalValue", + "decimals": 4, + "raw": "9300", + "value": "0.93", + }, + }, + "isInIsolationMode": true, + "suppliable": { + "__typename": "TokenAmount", + "amount": { + "__typename": "DecimalValue", + "decimals": 18, + "raw": "0", + "value": "0", + }, + "usd": "0", + "usdPerToken": "0.3024919", + }, }, } ❯ packages/client/src/actions/eMode.test.ts:70:25
userState: expect.objectContaining({
canBeCollateral: eModeCategoryReserve?.canBeCollateral ?? false,
canBeBorrowed: eModeCategoryReserve?.canBeBorrowed ?? false,
Expand All @@ -94,7 +94,7 @@
assertOk(result);

expect(result.value).toMatchObject({
eModeEnabled: true,
eModeEnabled: false,
});
});
});
Expand Down Expand Up @@ -166,7 +166,7 @@
});
assertOk(result);

expect(result.value).toMatchObject([

Check failure on line 169 in packages/client/src/actions/eMode.test.ts

View workflow job for this annotation

GitHub Actions / Verify / Test

packages/client/src/actions/eMode.test.ts > Given an Aave Market > And the user has some supply positions > When the user enables an E-Mode category involving some of the supply positions > Then any user supply position that are not included in the E-Mode category should not be able to be used as collateral

AssertionError: expected [ { …(7) }, { …(7) } ] to match object [ ObjectContaining{…}, …(1) ] (27 matching properties omitted from actual) - Expected + Received @@ -1,10 +1,48 @@ [ - ObjectContaining { - "canBeCollateral": false, - "currency": ObjectContaining { + { + "__typename": "MarketUserReserveSupplyPosition", + "apy": { + "__typename": "DecimalValue", + "decimals": 27, + "raw": "38197814116076091353773944", + "value": "0.038197814116076091353773944", + }, + "balance": { + "__typename": "TokenAmount", + "amount": { + "__typename": "DecimalValue", + "decimals": 6, + "raw": "9999", + "value": "0.009999", + }, + "usd": "0.00999760014", + "usdPerToken": "0.99986", + }, + "canBeCollateral": true, + "currency": { + "__typename": "Currency", "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "chainId": 99999999, + "decimals": 6, + "imageUrl": "https://token-logos.family.co/asset?id=99999999:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&token=USDC", + "name": "USD Coin", + "symbol": "USDC", + }, + "isCollateral": true, + "market": { + "__typename": "MarketInfo", + "address": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2", + "chain": { + "__typename": "Chain", + "chainId": 99999999, + "explorerUrl": "https://dashboard.tenderly.co/explorer/vnet/27ff3c60-0e2c-4d46-8190-f5170dc7da8c", + "icon": "https://statics.aave.com/ethereum.svg", + "name": "Forked Ethereum", + }, + "icon": "https://statics.aave.com/ethereum.svg", + "name": "AaveV3ForkedEthereum", }, }, ObjectContaining { "canBeCollateral": true, "currency": ObjectContaining { ❯ packages/client/src/actions/eMode.test.ts:169:30
expect.objectContaining({
currency: expect.objectContaining({
address: USDC_ADDRESS,
Expand Down
Loading