test: repay scenarios and missing borrow with native token #63
pull-request.yml
on: pull_request
Verify
/
Lint
18s
Verify
/
Test
3m 5s
Annotations
8 errors
|
Verify / Test
Process completed with exit code 1.
|
|
packages/client/src/actions/withdraw.test.ts > Given an Aave Market > And the reserve allows withdrawals in native tokens > When the user withdraws from the reserve in native tokens > Then the user should receive the amount in native tokens:
packages/client/src/actions/withdraw.test.ts#L174
AssertionError: expected [ { …(7) } ] to deeply equal [ ObjectContaining{…} ]
- Expected
+ Received
[
- ObjectContaining {
- "balance": ObjectContaining {
- "amount": ObjectContaining {
- "value": toBeBigDecimalCloseTo<0>,
+ {
+ "__typename": "MarketUserReserveSupplyPosition",
+ "apy": {
+ "__typename": "DecimalValue",
+ "decimals": 27,
+ "raw": "437558260941021637092900838",
+ "value": "0.437558260941021637092900838",
+ },
+ "balance": {
+ "__typename": "TokenAmount",
+ "amount": {
+ "__typename": "DecimalValue",
+ "decimals": 18,
+ "raw": "10000000000000000",
+ "value": "0.01",
+ },
+ "usd": "36.8278",
+ "usdPerToken": "3682.78",
+ },
+ "canBeCollateral": true,
+ "currency": {
+ "__typename": "Currency",
+ "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
+ "chainId": 99999999,
+ "decimals": 18,
+ "imageUrl": "https://token-logos.family.co/asset?id=99999999:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2&token=WETH",
+ "name": "Wrapped Ether",
+ "symbol": "WETH",
+ },
+ "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",
},
},
]
❯ packages/client/src/actions/withdraw.test.ts:174:30
|
|
packages/client/src/actions/withdraw.test.ts > Given an Aave Market > And a user with a supply position > When the user withdraws their supply > Then it should be reflected in the user supply positions:
packages/client/src/actions/withdraw.test.ts#L109
AssertionError: expected [ { …(7) } ] to deeply equal [ ObjectContaining{…} ]
- Expected
+ Received
[
- ObjectContaining {
- "balance": ObjectContaining {
- "amount": ObjectContaining {
- "value": toBeBigDecimalCloseTo<0>,
+ {
+ "__typename": "MarketUserReserveSupplyPosition",
+ "apy": {
+ "__typename": "DecimalValue",
+ "decimals": 27,
+ "raw": "437558260940015637219313502",
+ "value": "0.437558260940015637219313502",
+ },
+ "balance": {
+ "__typename": "TokenAmount",
+ "amount": {
+ "__typename": "DecimalValue",
+ "decimals": 18,
+ "raw": "10000000000000000",
+ "value": "0.01",
+ },
+ "usd": "36.8278",
+ "usdPerToken": "3682.78",
+ },
+ "canBeCollateral": true,
+ "currency": {
+ "__typename": "Currency",
+ "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
+ "chainId": 99999999,
+ "decimals": 18,
+ "imageUrl": "https://token-logos.family.co/asset?id=99999999:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2&token=WETH",
+ "name": "Wrapped Ether",
+ "symbol": "WETH",
+ },
+ "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",
},
},
]
❯ packages/client/src/actions/withdraw.test.ts:109:30
|
|
packages/client/src/actions/vaultDeploy.test.ts > Given the Aave Protocol v3 > When user deploys a vault for wETH on default market > Then vault is created:
packages/client/src/actions/vaultDeploy.test.ts#L53
AssertionError: expected +0 to be 1 // Object.is equality
- Expected
+ Received
- 1
+ 0
❯ packages/client/src/actions/vaultDeploy.test.ts:53:44
|
|
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:
packages/client/src/actions/eMode.test.ts#L172
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": "38197935029163585482632510",
+ "value": "0.03819793502916358548263251",
+ },
+ "balance": {
+ "__typename": "TokenAmount",
+ "amount": {
+ "__typename": "DecimalValue",
+ "decimals": 6,
+ "raw": "10000",
+ "value": "0.01",
+ },
+ "usd": "0.0099986",
+ "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:172:30
|
|
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:
packages/client/src/actions/eMode.test.ts#L70
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,
- "emode": ObjectContaining {
+ "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
|
|
packages/client/src/actions/borrow.test.ts > Given an Aave Market > And a user with a supply position > When user set the supply as collateral > Then it should be possible to borrow native from the reserve:
packages/client/src/actions/borrow.test.ts#L189
AssertionError: expected +0 to be 1 // Object.is equality
- Expected
+ Received
- 1
+ 0
❯ packages/client/src/actions/borrow.test.ts:189:43
|
|
packages/client/src/actions/borrow.test.ts > Given an Aave Market > And a user with a supply position > When user set the supply as collateral > Then it should be possible to borrow ERC20 from the reserve:
packages/client/src/actions/borrow.test.ts#L126
AssertionError: expected +0 to be 1 // Object.is equality
- Expected
+ Received
- 1
+ 0
❯ packages/client/src/actions/borrow.test.ts:126:43
|